main.f255f7efef480c0fecaf.js 1.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory();
  4. else if(typeof define === 'function' && define.amd)
  5. define([], factory);
  6. else if(typeof exports === 'object')
  7. exports["ivprogCore"] = factory();
  8. else
  9. root["ivprogCore"] = factory();
  10. })(window, function() {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // install a JSONP callback for chunk loading
  13. /******/ function webpackJsonpCallback(data) {
  14. /******/ var chunkIds = data[0];
  15. /******/ var moreModules = data[1];
  16. /******/ var executeModules = data[2];
  17. /******/
  18. /******/ // add "moreModules" to the modules object,
  19. /******/ // then flag all "chunkIds" as loaded and fire callback
  20. /******/ var moduleId, chunkId, i = 0, resolves = [];
  21. /******/ for(;i < chunkIds.length; i++) {
  22. /******/ chunkId = chunkIds[i];
  23. /******/ if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {
  24. /******/ resolves.push(installedChunks[chunkId][0]);
  25. /******/ }
  26. /******/ installedChunks[chunkId] = 0;
  27. /******/ }
  28. /******/ for(moduleId in moreModules) {
  29. /******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
  30. /******/ modules[moduleId] = moreModules[moduleId];
  31. /******/ }
  32. /******/ }
  33. /******/ if(parentJsonpFunction) parentJsonpFunction(data);
  34. /******/
  35. /******/ while(resolves.length) {
  36. /******/ resolves.shift()();
  37. /******/ }
  38. /******/
  39. /******/ // add entry modules from loaded chunk to deferred list
  40. /******/ deferredModules.push.apply(deferredModules, executeModules || []);
  41. /******/
  42. /******/ // run deferred modules when all chunks ready
  43. /******/ return checkDeferredModules();
  44. /******/ };
  45. /******/ function checkDeferredModules() {
  46. /******/ var result;
  47. /******/ for(var i = 0; i < deferredModules.length; i++) {
  48. /******/ var deferredModule = deferredModules[i];
  49. /******/ var fulfilled = true;
  50. /******/ for(var j = 1; j < deferredModule.length; j++) {
  51. /******/ var depId = deferredModule[j];
  52. /******/ if(installedChunks[depId] !== 0) fulfilled = false;
  53. /******/ }
  54. /******/ if(fulfilled) {
  55. /******/ deferredModules.splice(i--, 1);
  56. /******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
  57. /******/ }
  58. /******/ }
  59. /******/
  60. /******/ return result;
  61. /******/ }
  62. /******/
  63. /******/ // The module cache
  64. /******/ var installedModules = {};
  65. /******/
  66. /******/ // object to store loaded and loading chunks
  67. /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
  68. /******/ // Promise = chunk loading, 0 = chunk loaded
  69. /******/ var installedChunks = {
  70. /******/ "main": 0
  71. /******/ };
  72. /******/
  73. /******/ var deferredModules = [];
  74. /******/
  75. /******/ // The require function
  76. /******/ function __webpack_require__(moduleId) {
  77. /******/
  78. /******/ // Check if module is in cache
  79. /******/ if(installedModules[moduleId]) {
  80. /******/ return installedModules[moduleId].exports;
  81. /******/ }
  82. /******/ // Create a new module (and put it into the cache)
  83. /******/ var module = installedModules[moduleId] = {
  84. /******/ i: moduleId,
  85. /******/ l: false,
  86. /******/ exports: {}
  87. /******/ };
  88. /******/
  89. /******/ // Execute the module function
  90. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  91. /******/
  92. /******/ // Flag the module as loaded
  93. /******/ module.l = true;
  94. /******/
  95. /******/ // Return the exports of the module
  96. /******/ return module.exports;
  97. /******/ }
  98. /******/
  99. /******/
  100. /******/ // expose the modules object (__webpack_modules__)
  101. /******/ __webpack_require__.m = modules;
  102. /******/
  103. /******/ // expose the module cache
  104. /******/ __webpack_require__.c = installedModules;
  105. /******/
  106. /******/ // define getter function for harmony exports
  107. /******/ __webpack_require__.d = function(exports, name, getter) {
  108. /******/ if(!__webpack_require__.o(exports, name)) {
  109. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  110. /******/ }
  111. /******/ };
  112. /******/
  113. /******/ // define __esModule on exports
  114. /******/ __webpack_require__.r = function(exports) {
  115. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  116. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  117. /******/ }
  118. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  119. /******/ };
  120. /******/
  121. /******/ // create a fake namespace object
  122. /******/ // mode & 1: value is a module id, require it
  123. /******/ // mode & 2: merge all properties of value into the ns
  124. /******/ // mode & 4: return value when already ns object
  125. /******/ // mode & 8|1: behave like require
  126. /******/ __webpack_require__.t = function(value, mode) {
  127. /******/ if(mode & 1) value = __webpack_require__(value);
  128. /******/ if(mode & 8) return value;
  129. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  130. /******/ var ns = Object.create(null);
  131. /******/ __webpack_require__.r(ns);
  132. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  133. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  134. /******/ return ns;
  135. /******/ };
  136. /******/
  137. /******/ // getDefaultExport function for compatibility with non-harmony modules
  138. /******/ __webpack_require__.n = function(module) {
  139. /******/ var getter = module && module.__esModule ?
  140. /******/ function getDefault() { return module['default']; } :
  141. /******/ function getModuleExports() { return module; };
  142. /******/ __webpack_require__.d(getter, 'a', getter);
  143. /******/ return getter;
  144. /******/ };
  145. /******/
  146. /******/ // Object.prototype.hasOwnProperty.call
  147. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  148. /******/
  149. /******/ // __webpack_public_path__
  150. /******/ __webpack_require__.p = "";
  151. /******/
  152. /******/ var jsonpArray = window["webpackJsonpivprogCore"] = window["webpackJsonpivprogCore"] || [];
  153. /******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
  154. /******/ jsonpArray.push = webpackJsonpCallback;
  155. /******/ jsonpArray = jsonpArray.slice();
  156. /******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
  157. /******/ var parentJsonpFunction = oldJsonpFunction;
  158. /******/
  159. /******/
  160. /******/ // add entry module to deferred list
  161. /******/ deferredModules.push(["./js/main.js","vendors~main"]);
  162. /******/ // run deferred modules when ready
  163. /******/ return checkDeferredModules();
  164. /******/ })
  165. /************************************************************************/
  166. /******/ ({
  167. /***/ "./.ima_version.json":
  168. /*!***************************!*\
  169. !*** ./.ima_version.json ***!
  170. \***************************/
  171. /*! exports provided: version, default */
  172. /***/ (function(module) {
  173. module.exports = JSON.parse("{\"version\":\"2020_06_17 12_48\"}");
  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-12601NtkdG7r4cIqV/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. $sin: "sin",
  740. $cos: "cos",
  741. $tan: "tan",
  742. $sqrt: "sqrt",
  743. $pow: "pow",
  744. $log: "log",
  745. $abs: "abs",
  746. $negate: "negate",
  747. $invert: "invert",
  748. $max: "maximum",
  749. $min: "minimum",
  750. $rand: "random"
  751. });
  752. /***/ }),
  753. /***/ "./grammar/en/langLibs.js":
  754. /*!********************************!*\
  755. !*** ./grammar/en/langLibs.js ***!
  756. \********************************/
  757. /*! exports provided: default */
  758. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  759. "use strict";
  760. __webpack_require__.r(__webpack_exports__);
  761. /**
  762. * This is the dictionary of the language defined libraries
  763. */
  764. /* harmony default export */ __webpack_exports__["default"] = ({
  765. $mathLib: "Mathematic",
  766. $ioLib: "IO",
  767. $strLib: "Text",
  768. $arrayLib: "Array",
  769. $langLib: "Conversion"
  770. });
  771. /***/ }),
  772. /***/ "./grammar/es/ivprog.g4":
  773. /*!******************************!*\
  774. !*** ./grammar/es/ivprog.g4 ***!
  775. \******************************/
  776. /*! no static exports found */
  777. /***/ (function(module, exports, __webpack_require__) {
  778. module.exports =
  779. /******/ (function(modules) { // webpackBootstrap
  780. /******/ // The module cache
  781. /******/ var installedModules = {};
  782. /******/
  783. /******/ // The require function
  784. /******/ function __webpack_require__(moduleId) {
  785. /******/
  786. /******/ // Check if module is in cache
  787. /******/ if(installedModules[moduleId]) {
  788. /******/ return installedModules[moduleId].exports;
  789. /******/ }
  790. /******/ // Create a new module (and put it into the cache)
  791. /******/ var module = installedModules[moduleId] = {
  792. /******/ i: moduleId,
  793. /******/ l: false,
  794. /******/ exports: {}
  795. /******/ };
  796. /******/
  797. /******/ // Execute the module function
  798. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  799. /******/
  800. /******/ // Flag the module as loaded
  801. /******/ module.l = true;
  802. /******/
  803. /******/ // Return the exports of the module
  804. /******/ return module.exports;
  805. /******/ }
  806. /******/
  807. /******/
  808. /******/ // expose the modules object (__webpack_modules__)
  809. /******/ __webpack_require__.m = modules;
  810. /******/
  811. /******/ // expose the module cache
  812. /******/ __webpack_require__.c = installedModules;
  813. /******/
  814. /******/ // identity function for calling harmony imports with the correct context
  815. /******/ __webpack_require__.i = function(value) { return value; };
  816. /******/
  817. /******/ // define getter function for harmony exports
  818. /******/ __webpack_require__.d = function(exports, name, getter) {
  819. /******/ if(!__webpack_require__.o(exports, name)) {
  820. /******/ Object.defineProperty(exports, name, {
  821. /******/ configurable: false,
  822. /******/ enumerable: true,
  823. /******/ get: getter
  824. /******/ });
  825. /******/ }
  826. /******/ };
  827. /******/
  828. /******/ // getDefaultExport function for compatibility with non-harmony modules
  829. /******/ __webpack_require__.n = function(module) {
  830. /******/ var getter = module && module.__esModule ?
  831. /******/ function getDefault() { return module['default']; } :
  832. /******/ function getModuleExports() { return module; };
  833. /******/ __webpack_require__.d(getter, 'a', getter);
  834. /******/ return getter;
  835. /******/ };
  836. /******/
  837. /******/ // Object.prototype.hasOwnProperty.call
  838. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  839. /******/
  840. /******/ // __webpack_public_path__
  841. /******/ __webpack_require__.p = "";
  842. /******/
  843. /******/ // Load entry module and return exports
  844. /******/ return __webpack_require__(__webpack_require__.s = 1);
  845. /******/ })
  846. /************************************************************************/
  847. /******/ ([
  848. /* 0 */
  849. /***/ (function(module, exports, __webpack_require__) {
  850. // Generated from /tmp/tmp-12601a6lkpTcwTySs/ivprog.g4 by ANTLR 4.7
  851. // jshint ignore: start
  852. var antlr4 = __webpack_require__(2);
  853. var serializedATN = ["\u0003\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964",
  854. "\u00020\u01e3\b\u0001\u0004\u0002\t\u0002\u0004\u0003\t\u0003\u0004",
  855. "\u0004\t\u0004\u0004\u0005\t\u0005\u0004\u0006\t\u0006\u0004\u0007\t",
  856. "\u0007\u0004\b\t\b\u0004\t\t\t\u0004\n\t\n\u0004\u000b\t\u000b\u0004",
  857. "\f\t\f\u0004\r\t\r\u0004\u000e\t\u000e\u0004\u000f\t\u000f\u0004\u0010",
  858. "\t\u0010\u0004\u0011\t\u0011\u0004\u0012\t\u0012\u0004\u0013\t\u0013",
  859. "\u0004\u0014\t\u0014\u0004\u0015\t\u0015\u0004\u0016\t\u0016\u0004\u0017",
  860. "\t\u0017\u0004\u0018\t\u0018\u0004\u0019\t\u0019\u0004\u001a\t\u001a",
  861. "\u0004\u001b\t\u001b\u0004\u001c\t\u001c\u0004\u001d\t\u001d\u0004\u001e",
  862. "\t\u001e\u0004\u001f\t\u001f\u0004 \t \u0004!\t!\u0004\"\t\"\u0004#",
  863. "\t#\u0004$\t$\u0004%\t%\u0004&\t&\u0004\'\t\'\u0004(\t(\u0004)\t)\u0004",
  864. "*\t*\u0004+\t+\u0004,\t,\u0004-\t-\u0004.\t.\u0004/\t/\u00040\t0\u0004",
  865. "1\t1\u00042\t2\u00043\t3\u00044\t4\u00045\t5\u00046\t6\u00047\t7\u0004",
  866. "8\t8\u00049\t9\u0004:\t:\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0002",
  867. "\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0003",
  868. "\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0004\u0003\u0004",
  869. "\u0003\u0004\u0003\u0004\u0003\u0004\u0003\u0004\u0003\u0005\u0003\u0005",
  870. "\u0003\u0005\u0003\u0005\u0003\u0005\u0003\u0005\u0003\u0005\u0003\u0006",
  871. "\u0003\u0006\u0003\u0006\u0003\u0006\u0003\u0006\u0003\u0006\u0003\u0006",
  872. "\u0003\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0003\u0007",
  873. "\u0003\u0007\u0003\u0007\u0003\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003",
  874. "\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003\t\u0003\t\u0003\t\u0003\t\u0003",
  875. "\t\u0003\t\u0003\t\u0003\t\u0003\n\u0003\n\u0003\n\u0003\n\u0003\n\u0003",
  876. "\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003",
  877. "\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\f\u0003\f\u0003\f\u0003",
  878. "\f\u0003\f\u0003\f\u0003\r\u0003\r\u0003\r\u0003\r\u0003\r\u0003\r\u0003",
  879. "\r\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0003",
  880. "\u000e\u0003\u000e\u0003\u000e\u0003\u000f\u0003\u000f\u0003\u000f\u0003",
  881. "\u000f\u0003\u000f\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003",
  882. "\u0010\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0011\u0003",
  883. "\u0012\u0003\u0012\u0003\u0012\u0003\u0012\u0003\u0012\u0003\u0012\u0003",
  884. "\u0012\u0003\u0012\u0003\u0012\u0003\u0013\u0003\u0013\u0003\u0013\u0003",
  885. "\u0014\u0003\u0014\u0003\u0014\u0003\u0014\u0003\u0014\u0003\u0014\u0003",
  886. "\u0015\u0003\u0015\u0003\u0015\u0003\u0015\u0003\u0015\u0003\u0015\u0003",
  887. "\u0016\u0003\u0016\u0003\u0016\u0003\u0016\u0003\u0016\u0003\u0016\u0003",
  888. "\u0016\u0003\u0016\u0003\u0016\u0003\u0016\u0003\u0016\u0003\u0017\u0003",
  889. "\u0017\u0003\u0017\u0003\u0017\u0003\u0018\u0003\u0018\u0003\u0019\u0003",
  890. "\u0019\u0003\u0019\u0003\u001a\u0003\u001a\u0003\u001b\u0003\u001b\u0003",
  891. "\u001c\u0003\u001c\u0003\u001d\u0003\u001d\u0003\u001e\u0003\u001e\u0003",
  892. "\u001f\u0003\u001f\u0003 \u0003 \u0003!\u0003!\u0003\"\u0003\"\u0003",
  893. "\"\u0005\"\u0124\n\"\u0003#\u0003#\u0003$\u0003$\u0003%\u0003%\u0003",
  894. "&\u0003&\u0003\'\u0003\'\u0003\'\u0003\'\u0003\'\u0003\'\u0003\'\u0003",
  895. "\'\u0003\'\u0005\'\u0137\n\'\u0003(\u0003(\u0003)\u0003)\u0003*\u0003",
  896. "*\u0007*\u013f\n*\f*\u000e*\u0142\u000b*\u0003+\u0003+\u0003+\u0003",
  897. "+\u0003,\u0006,\u0149\n,\r,\u000e,\u014a\u0003,\u0003,\u0003,\u0003",
  898. ",\u0005,\u0151\n,\u0003,\u0006,\u0154\n,\r,\u000e,\u0155\u0003,\u0003",
  899. ",\u0003,\u0003,\u0005,\u015c\n,\u0003,\u0006,\u015f\n,\r,\u000e,\u0160",
  900. "\u0005,\u0163\n,\u0003-\u0006-\u0166\n-\r-\u000e-\u0167\u0003-\u0003",
  901. "-\u0006-\u016c\n-\r-\u000e-\u016d\u0003-\u0006-\u0171\n-\r-\u000e-\u0172",
  902. "\u0003-\u0003-\u0007-\u0177\n-\f-\u000e-\u017a\u000b-\u0003-\u0005-",
  903. "\u017d\n-\u0003.\u0003.\u0005.\u0181\n.\u0003.\u0006.\u0184\n.\r.\u000e",
  904. ".\u0185\u0003/\u0003/\u0007/\u018a\n/\f/\u000e/\u018d\u000b/\u0003/",
  905. "\u0003/\u00030\u00030\u00050\u0193\n0\u00031\u00031\u00031\u00051\u0198",
  906. "\n1\u00031\u00031\u00032\u00032\u00032\u00032\u00033\u00033\u00034\u0006",
  907. "4\u01a3\n4\r4\u000e4\u01a4\u00034\u00054\u01a8\n4\u00035\u00035\u0003",
  908. "6\u00036\u00037\u00037\u00037\u00037\u00057\u01b2\n7\u00038\u00038\u0003",
  909. "8\u00038\u00038\u00038\u00038\u00038\u00038\u00038\u00038\u00058\u01bf",
  910. "\n8\u00039\u00039\u00039\u00039\u00039\u00039\u00039\u0003:\u0003:\u0003",
  911. ":\u0003:\u0007:\u01cc\n:\f:\u000e:\u01cf\u000b:\u0003:\u0005:\u01d2",
  912. "\n:\u0003:\u0003:\u0003:\u0003:\u0003:\u0007:\u01d9\n:\f:\u000e:\u01dc",
  913. "\u000b:\u0003:\u0003:\u0005:\u01e0\n:\u0003:\u0003:\u0003\u01da\u0002",
  914. ";\u0003\u0003\u0005\u0004\u0007\u0005\t\u0006\u000b\u0007\r\b\u000f",
  915. "\t\u0011\n\u0013\u000b\u0015\f\u0017\r\u0019\u000e\u001b\u000f\u001d",
  916. "\u0010\u001f\u0011!\u0012#\u0013%\u0014\'\u0015)\u0016+\u0017-\u0002",
  917. "/\u00021\u00023\u00185\u00197\u001a9\u001b;\u001c=\u001d?\u001eA\u001f",
  918. "C E!G\"I#K$M%O&Q\'S(U)W*Y+[\u0002],_\u0002a-c.e\u0002g/i\u0002k\u0002",
  919. "m\u0002o\u0002q\u0002s0\u0003\u0002\u0012\u0004\u0002--//\u0005\u0002",
  920. "\'\',,11\u0004\u0002>>@@\u0005\u0002C\\aac|\u0006\u00022;C\\aac|\u0003",
  921. "\u00022;\u0003\u000223\u0004\u0002GGgg\u0006\u0002\f\f\u000f\u000f$",
  922. "$^^\u0006\u0002\f\f\u000f\u000f))^^\u0004\u0002\u000b\u000b\"\"\u0004",
  923. "\u0002\f\f\u000f\u000f\u0005\u00022;CHch\u0003\u000229\n\u0002$$))^",
  924. "^ddhhppttvv\u0003\u000225\u0002\u01f8\u0002\u0003\u0003\u0002\u0002",
  925. "\u0002\u0002\u0005\u0003\u0002\u0002\u0002\u0002\u0007\u0003\u0002\u0002",
  926. "\u0002\u0002\t\u0003\u0002\u0002\u0002\u0002\u000b\u0003\u0002\u0002",
  927. "\u0002\u0002\r\u0003\u0002\u0002\u0002\u0002\u000f\u0003\u0002\u0002",
  928. "\u0002\u0002\u0011\u0003\u0002\u0002\u0002\u0002\u0013\u0003\u0002\u0002",
  929. "\u0002\u0002\u0015\u0003\u0002\u0002\u0002\u0002\u0017\u0003\u0002\u0002",
  930. "\u0002\u0002\u0019\u0003\u0002\u0002\u0002\u0002\u001b\u0003\u0002\u0002",
  931. "\u0002\u0002\u001d\u0003\u0002\u0002\u0002\u0002\u001f\u0003\u0002\u0002",
  932. "\u0002\u0002!\u0003\u0002\u0002\u0002\u0002#\u0003\u0002\u0002\u0002",
  933. "\u0002%\u0003\u0002\u0002\u0002\u0002\'\u0003\u0002\u0002\u0002\u0002",
  934. ")\u0003\u0002\u0002\u0002\u0002+\u0003\u0002\u0002\u0002\u00023\u0003",
  935. "\u0002\u0002\u0002\u00025\u0003\u0002\u0002\u0002\u00027\u0003\u0002",
  936. "\u0002\u0002\u00029\u0003\u0002\u0002\u0002\u0002;\u0003\u0002\u0002",
  937. "\u0002\u0002=\u0003\u0002\u0002\u0002\u0002?\u0003\u0002\u0002\u0002",
  938. "\u0002A\u0003\u0002\u0002\u0002\u0002C\u0003\u0002\u0002\u0002\u0002",
  939. "E\u0003\u0002\u0002\u0002\u0002G\u0003\u0002\u0002\u0002\u0002I\u0003",
  940. "\u0002\u0002\u0002\u0002K\u0003\u0002\u0002\u0002\u0002M\u0003\u0002",
  941. "\u0002\u0002\u0002O\u0003\u0002\u0002\u0002\u0002Q\u0003\u0002\u0002",
  942. "\u0002\u0002S\u0003\u0002\u0002\u0002\u0002U\u0003\u0002\u0002\u0002",
  943. "\u0002W\u0003\u0002\u0002\u0002\u0002Y\u0003\u0002\u0002\u0002\u0002",
  944. "]\u0003\u0002\u0002\u0002\u0002a\u0003\u0002\u0002\u0002\u0002c\u0003",
  945. "\u0002\u0002\u0002\u0002g\u0003\u0002\u0002\u0002\u0002s\u0003\u0002",
  946. "\u0002\u0002\u0003u\u0003\u0002\u0002\u0002\u0005~\u0003\u0002\u0002",
  947. "\u0002\u0007\u0083\u0003\u0002\u0002\u0002\t\u0089\u0003\u0002\u0002",
  948. "\u0002\u000b\u0090\u0003\u0002\u0002\u0002\r\u0097\u0003\u0002\u0002",
  949. "\u0002\u000f\u009f\u0003\u0002\u0002\u0002\u0011\u00a9\u0003\u0002\u0002",
  950. "\u0002\u0013\u00b1\u0003\u0002\u0002\u0002\u0015\u00b6\u0003\u0002\u0002",
  951. "\u0002\u0017\u00c0\u0003\u0002\u0002\u0002\u0019\u00c6\u0003\u0002\u0002",
  952. "\u0002\u001b\u00cd\u0003\u0002\u0002\u0002\u001d\u00d5\u0003\u0002\u0002",
  953. "\u0002\u001f\u00da\u0003\u0002\u0002\u0002!\u00df\u0003\u0002\u0002",
  954. "\u0002#\u00e4\u0003\u0002\u0002\u0002%\u00ed\u0003\u0002\u0002\u0002",
  955. "\'\u00f0\u0003\u0002\u0002\u0002)\u00f6\u0003\u0002\u0002\u0002+\u00fc",
  956. "\u0003\u0002\u0002\u0002-\u0107\u0003\u0002\u0002\u0002/\u010b\u0003",
  957. "\u0002\u0002\u00021\u010d\u0003\u0002\u0002\u00023\u0110\u0003\u0002",
  958. "\u0002\u00025\u0112\u0003\u0002\u0002\u00027\u0114\u0003\u0002\u0002",
  959. "\u00029\u0116\u0003\u0002\u0002\u0002;\u0118\u0003\u0002\u0002\u0002",
  960. "=\u011a\u0003\u0002\u0002\u0002?\u011c\u0003\u0002\u0002\u0002A\u011e",
  961. "\u0003\u0002\u0002\u0002C\u0123\u0003\u0002\u0002\u0002E\u0125\u0003",
  962. "\u0002\u0002\u0002G\u0127\u0003\u0002\u0002\u0002I\u0129\u0003\u0002",
  963. "\u0002\u0002K\u012b\u0003\u0002\u0002\u0002M\u0136\u0003\u0002\u0002",
  964. "\u0002O\u0138\u0003\u0002\u0002\u0002Q\u013a\u0003\u0002\u0002\u0002",
  965. "S\u013c\u0003\u0002\u0002\u0002U\u0143\u0003\u0002\u0002\u0002W\u0162",
  966. "\u0003\u0002\u0002\u0002Y\u017c\u0003\u0002\u0002\u0002[\u017e\u0003",
  967. "\u0002\u0002\u0002]\u0187\u0003\u0002\u0002\u0002_\u0192\u0003\u0002",
  968. "\u0002\u0002a\u0194\u0003\u0002\u0002\u0002c\u019b\u0003\u0002\u0002",
  969. "\u0002e\u019f\u0003\u0002\u0002\u0002g\u01a7\u0003\u0002\u0002\u0002",
  970. "i\u01a9\u0003\u0002\u0002\u0002k\u01ab\u0003\u0002\u0002\u0002m\u01b1",
  971. "\u0003\u0002\u0002\u0002o\u01be\u0003\u0002\u0002\u0002q\u01c0\u0003",
  972. "\u0002\u0002\u0002s\u01df\u0003\u0002\u0002\u0002uv\u0007r\u0002\u0002",
  973. "vw\u0007t\u0002\u0002wx\u0007q\u0002\u0002xy\u0007i\u0002\u0002yz\u0007",
  974. "t\u0002\u0002z{\u0007c\u0002\u0002{|\u0007o\u0002\u0002|}\u0007c\u0002",
  975. "\u0002}\u0004\u0003\u0002\u0002\u0002~\u007f\u0007t\u0002\u0002\u007f",
  976. "\u0080\u0007g\u0002\u0002\u0080\u0081\u0007c\u0002\u0002\u0081\u0082",
  977. "\u0007n\u0002\u0002\u0082\u0006\u0003\u0002\u0002\u0002\u0083\u0084",
  978. "\u0007x\u0002\u0002\u0084\u0085\u0007c\u0002\u0002\u0085\u0086\u0007",
  979. "|\u0002\u0002\u0086\u0087\u0007k\u0002\u0002\u0087\u0088\u0007q\u0002",
  980. "\u0002\u0088\b\u0003\u0002\u0002\u0002\u0089\u008a\u0007n\u0002\u0002",
  981. "\u008a\u008b\u0007q\u0002\u0002\u008b\u008c\u0007i\u0002\u0002\u008c",
  982. "\u008d\u0007k\u0002\u0002\u008d\u008e\u0007e\u0002\u0002\u008e\u008f",
  983. "\u0007q\u0002\u0002\u008f\n\u0003\u0002\u0002\u0002\u0090\u0091\u0007",
  984. "e\u0002\u0002\u0091\u0092\u0007c\u0002\u0002\u0092\u0093\u0007f\u0002",
  985. "\u0002\u0093\u0094\u0007g\u0002\u0002\u0094\u0095\u0007k\u0002\u0002",
  986. "\u0095\u0096\u0007c\u0002\u0002\u0096\f\u0003\u0002\u0002\u0002\u0097",
  987. "\u0098\u0007k\u0002\u0002\u0098\u0099\u0007p\u0002\u0002\u0099\u009a",
  988. "\u0007v\u0002\u0002\u009a\u009b\u0007g\u0002\u0002\u009b\u009c\u0007",
  989. "k\u0002\u0002\u009c\u009d\u0007t\u0002\u0002\u009d\u009e\u0007q\u0002",
  990. "\u0002\u009e\u000e\u0003\u0002\u0002\u0002\u009f\u00a0\u0007e\u0002",
  991. "\u0002\u00a0\u00a1\u0007c\u0002\u0002\u00a1\u00a2\u0007t\u0002\u0002",
  992. "\u00a2\u00a3\u0007c\u0002\u0002\u00a3\u00a4\u0007e\u0002\u0002\u00a4",
  993. "\u00a5\u0007v\u0002\u0002\u00a5\u00a6\u0007g\u0002\u0002\u00a6\u00a7",
  994. "\u0007t\u0002\u0002\u00a7\u00a8\u0007g\u0002\u0002\u00a8\u0010\u0003",
  995. "\u0002\u0002\u0002\u00a9\u00aa\u0007g\u0002\u0002\u00aa\u00ab\u0007",
  996. "u\u0002\u0002\u00ab\u00ac\u0007e\u0002\u0002\u00ac\u00ad\u0007q\u0002",
  997. "\u0002\u00ad\u00ae\u0007n\u0002\u0002\u00ae\u00af\u0007j\u0002\u0002",
  998. "\u00af\u00b0\u0007c\u0002\u0002\u00b0\u0012\u0003\u0002\u0002\u0002",
  999. "\u00b1\u00b2\u0007e\u0002\u0002\u00b2\u00b3\u0007c\u0002\u0002\u00b3",
  1000. "\u00b4\u0007u\u0002\u0002\u00b4\u00b5\u0007q\u0002\u0002\u00b5\u0014",
  1001. "\u0003\u0002\u0002\u0002\u00b6\u00b7\u0007e\u0002\u0002\u00b7\u00b8",
  1002. "\u0007q\u0002\u0002\u00b8\u00b9\u0007p\u0002\u0002\u00b9\u00ba\u0007",
  1003. "v\u0002\u0002\u00ba\u00bb\u0007t\u0002\u0002\u00bb\u00bc\u0007c\u0002",
  1004. "\u0002\u00bc\u00bd\u0007t\u0002\u0002\u00bd\u00be\u0007k\u0002\u0002",
  1005. "\u00be\u00bf\u0007q\u0002\u0002\u00bf\u0016\u0003\u0002\u0002\u0002",
  1006. "\u00c0\u00c1\u0007e\u0002\u0002\u00c1\u00c2\u0007q\u0002\u0002\u00c2",
  1007. "\u00c3\u0007p\u0002\u0002\u00c3\u00c4\u0007u\u0002\u0002\u00c4\u00c5",
  1008. "\u0007v\u0002\u0002\u00c5\u0018\u0003\u0002\u0002\u0002\u00c6\u00c7",
  1009. "\u0007h\u0002\u0002\u00c7\u00c8\u0007w\u0002\u0002\u00c8\u00c9\u0007",
  1010. "p\u0002\u0002\u00c9\u00ca\u0007e\u0002\u0002\u00ca\u00cb\u0007c\u0002",
  1011. "\u0002\u00cb\u00cc\u0007q\u0002\u0002\u00cc\u001a\u0003\u0002\u0002",
  1012. "\u0002\u00cd\u00ce\u0007t\u0002\u0002\u00ce\u00cf\u0007g\u0002\u0002",
  1013. "\u00cf\u00d0\u0007v\u0002\u0002\u00d0\u00d1\u0007q\u0002\u0002\u00d1",
  1014. "\u00d2\u0007t\u0002\u0002\u00d2\u00d3\u0007p\u0002\u0002\u00d3\u00d4",
  1015. "\u0007g\u0002\u0002\u00d4\u001c\u0003\u0002\u0002\u0002\u00d5\u00d6",
  1016. "\u0007r\u0002\u0002\u00d6\u00d7\u0007c\u0002\u0002\u00d7\u00d8\u0007",
  1017. "t\u0002\u0002\u00d8\u00d9\u0007c\u0002\u0002\u00d9\u001e\u0003\u0002",
  1018. "\u0002\u0002\u00da\u00db\u0007r\u0002\u0002\u00db\u00dc\u0007c\u0002",
  1019. "\u0002\u00dc\u00dd\u0007t\u0002\u0002\u00dd\u00de\u0007g\u0002\u0002",
  1020. "\u00de \u0003\u0002\u0002\u0002\u00df\u00e0\u0007h\u0002\u0002\u00e0",
  1021. "\u00e1\u0007c\u0002\u0002\u00e1\u00e2\u0007e\u0002\u0002\u00e2\u00e3",
  1022. "\u0007c\u0002\u0002\u00e3\"\u0003\u0002\u0002\u0002\u00e4\u00e5\u0007",
  1023. "g\u0002\u0002\u00e5\u00e6\u0007p\u0002\u0002\u00e6\u00e7\u0007s\u0002",
  1024. "\u0002\u00e7\u00e8\u0007w\u0002\u0002\u00e8\u00e9\u0007c\u0002\u0002",
  1025. "\u00e9\u00ea\u0007p\u0002\u0002\u00ea\u00eb\u0007v\u0002\u0002\u00eb",
  1026. "\u00ec\u0007q\u0002\u0002\u00ec$\u0003\u0002\u0002\u0002\u00ed\u00ee",
  1027. "\u0007u\u0002\u0002\u00ee\u00ef\u0007g\u0002\u0002\u00ef&\u0003\u0002",
  1028. "\u0002\u0002\u00f0\u00f1\u0007u\u0002\u0002\u00f1\u00f2\u0007g\u0002",
  1029. "\u0002\u00f2\u00f3\u0007p\u0002\u0002\u00f3\u00f4\u0007c\u0002\u0002",
  1030. "\u00f4\u00f5\u0007q\u0002\u0002\u00f5(\u0003\u0002\u0002\u0002\u00f6",
  1031. "\u00f7\u0007h\u0002\u0002\u00f7\u00f8\u0007c\u0002\u0002\u00f8\u00f9",
  1032. "\u0007n\u0002\u0002\u00f9\u00fa\u0007u\u0002\u0002\u00fa\u00fb\u0007",
  1033. "q\u0002\u0002\u00fb*\u0003\u0002\u0002\u0002\u00fc\u00fd\u0007x\u0002",
  1034. "\u0002\u00fd\u00fe\u0007g\u0002\u0002\u00fe\u00ff\u0007t\u0002\u0002",
  1035. "\u00ff\u0100\u0007f\u0002\u0002\u0100\u0101\u0007c\u0002\u0002\u0101",
  1036. "\u0102\u0007f\u0002\u0002\u0102\u0103\u0007g\u0002\u0002\u0103\u0104",
  1037. "\u0007k\u0002\u0002\u0104\u0105\u0007t\u0002\u0002\u0105\u0106\u0007",
  1038. "q\u0002\u0002\u0106,\u0003\u0002\u0002\u0002\u0107\u0108\u0007p\u0002",
  1039. "\u0002\u0108\u0109\u0007c\u0002\u0002\u0109\u010a\u0007q\u0002\u0002",
  1040. "\u010a.\u0003\u0002\u0002\u0002\u010b\u010c\u0007G\u0002\u0002\u010c",
  1041. "0\u0003\u0002\u0002\u0002\u010d\u010e\u0007Q\u0002\u0002\u010e\u010f",
  1042. "\u0007W\u0002\u0002\u010f2\u0003\u0002\u0002\u0002\u0110\u0111\u0007",
  1043. "(\u0002\u0002\u01114\u0003\u0002\u0002\u0002\u0112\u0113\u0007*\u0002",
  1044. "\u0002\u01136\u0003\u0002\u0002\u0002\u0114\u0115\u0007+\u0002\u0002",
  1045. "\u01158\u0003\u0002\u0002\u0002\u0116\u0117\u0007]\u0002\u0002\u0117",
  1046. ":\u0003\u0002\u0002\u0002\u0118\u0119\u0007_\u0002\u0002\u0119<\u0003",
  1047. "\u0002\u0002\u0002\u011a\u011b\u0007}\u0002\u0002\u011b>\u0003\u0002",
  1048. "\u0002\u0002\u011c\u011d\u0007\u007f\u0002\u0002\u011d@\u0003\u0002",
  1049. "\u0002\u0002\u011e\u011f\u0007.\u0002\u0002\u011fB\u0003\u0002\u0002",
  1050. "\u0002\u0120\u0121\u0007>\u0002\u0002\u0121\u0124\u0007/\u0002\u0002",
  1051. "\u0122\u0124\u0007\u2192\u0002\u0002\u0123\u0120\u0003\u0002\u0002\u0002",
  1052. "\u0123\u0122\u0003\u0002\u0002\u0002\u0124D\u0003\u0002\u0002\u0002",
  1053. "\u0125\u0126\t\u0002\u0002\u0002\u0126F\u0003\u0002\u0002\u0002\u0127",
  1054. "\u0128\t\u0003\u0002\u0002\u0128H\u0003\u0002\u0002\u0002\u0129\u012a",
  1055. "\u0005/\u0018\u0002\u012aJ\u0003\u0002\u0002\u0002\u012b\u012c\u0005",
  1056. "1\u0019\u0002\u012cL\u0003\u0002\u0002\u0002\u012d\u012e\u0007@\u0002",
  1057. "\u0002\u012e\u0137\u0007?\u0002\u0002\u012f\u0130\u0007?\u0002\u0002",
  1058. "\u0130\u0137\u0007?\u0002\u0002\u0131\u0132\u0007>\u0002\u0002\u0132",
  1059. "\u0137\u0007?\u0002\u0002\u0133\u0137\t\u0004\u0002\u0002\u0134\u0135",
  1060. "\u0007#\u0002\u0002\u0135\u0137\u0007?\u0002\u0002\u0136\u012d\u0003",
  1061. "\u0002\u0002\u0002\u0136\u012f\u0003\u0002\u0002\u0002\u0136\u0131\u0003",
  1062. "\u0002\u0002\u0002\u0136\u0133\u0003\u0002\u0002\u0002\u0136\u0134\u0003",
  1063. "\u0002\u0002\u0002\u0137N\u0003\u0002\u0002\u0002\u0138\u0139\u0007",
  1064. "<\u0002\u0002\u0139P\u0003\u0002\u0002\u0002\u013a\u013b\u0005-\u0017",
  1065. "\u0002\u013bR\u0003\u0002\u0002\u0002\u013c\u0140\t\u0005\u0002\u0002",
  1066. "\u013d\u013f\t\u0006\u0002\u0002\u013e\u013d\u0003\u0002\u0002\u0002",
  1067. "\u013f\u0142\u0003\u0002\u0002\u0002\u0140\u013e\u0003\u0002\u0002\u0002",
  1068. "\u0140\u0141\u0003\u0002\u0002\u0002\u0141T\u0003\u0002\u0002\u0002",
  1069. "\u0142\u0140\u0003\u0002\u0002\u0002\u0143\u0144\u0005S*\u0002\u0144",
  1070. "\u0145\u00070\u0002\u0002\u0145\u0146\u0005S*\u0002\u0146V\u0003\u0002",
  1071. "\u0002\u0002\u0147\u0149\t\u0007\u0002\u0002\u0148\u0147\u0003\u0002",
  1072. "\u0002\u0002\u0149\u014a\u0003\u0002\u0002\u0002\u014a\u0148\u0003\u0002",
  1073. "\u0002\u0002\u014a\u014b\u0003\u0002\u0002\u0002\u014b\u0163\u0003\u0002",
  1074. "\u0002\u0002\u014c\u014d\u00072\u0002\u0002\u014d\u0151\u0007z\u0002",
  1075. "\u0002\u014e\u014f\u00072\u0002\u0002\u014f\u0151\u0007Z\u0002\u0002",
  1076. "\u0150\u014c\u0003\u0002\u0002\u0002\u0150\u014e\u0003\u0002\u0002\u0002",
  1077. "\u0151\u0153\u0003\u0002\u0002\u0002\u0152\u0154\u0005i5\u0002\u0153",
  1078. "\u0152\u0003\u0002\u0002\u0002\u0154\u0155\u0003\u0002\u0002\u0002\u0155",
  1079. "\u0153\u0003\u0002\u0002\u0002\u0155\u0156\u0003\u0002\u0002\u0002\u0156",
  1080. "\u0163\u0003\u0002\u0002\u0002\u0157\u0158\u00072\u0002\u0002\u0158",
  1081. "\u015c\u0007d\u0002\u0002\u0159\u015a\u00072\u0002\u0002\u015a\u015c",
  1082. "\u0007D\u0002\u0002\u015b\u0157\u0003\u0002\u0002\u0002\u015b\u0159",
  1083. "\u0003\u0002\u0002\u0002\u015c\u015e\u0003\u0002\u0002\u0002\u015d\u015f",
  1084. "\t\b\u0002\u0002\u015e\u015d\u0003\u0002\u0002\u0002\u015f\u0160\u0003",
  1085. "\u0002\u0002\u0002\u0160\u015e\u0003\u0002\u0002\u0002\u0160\u0161\u0003",
  1086. "\u0002\u0002\u0002\u0161\u0163\u0003\u0002\u0002\u0002\u0162\u0148\u0003",
  1087. "\u0002\u0002\u0002\u0162\u0150\u0003\u0002\u0002\u0002\u0162\u015b\u0003",
  1088. "\u0002\u0002\u0002\u0163X\u0003\u0002\u0002\u0002\u0164\u0166\t\u0007",
  1089. "\u0002\u0002\u0165\u0164\u0003\u0002\u0002\u0002\u0166\u0167\u0003\u0002",
  1090. "\u0002\u0002\u0167\u0165\u0003\u0002\u0002\u0002\u0167\u0168\u0003\u0002",
  1091. "\u0002\u0002\u0168\u0169\u0003\u0002\u0002\u0002\u0169\u016b\u00070",
  1092. "\u0002\u0002\u016a\u016c\t\u0007\u0002\u0002\u016b\u016a\u0003\u0002",
  1093. "\u0002\u0002\u016c\u016d\u0003\u0002\u0002\u0002\u016d\u016b\u0003\u0002",
  1094. "\u0002\u0002\u016d\u016e\u0003\u0002\u0002\u0002\u016e\u017d\u0003\u0002",
  1095. "\u0002\u0002\u016f\u0171\t\u0007\u0002\u0002\u0170\u016f\u0003\u0002",
  1096. "\u0002\u0002\u0171\u0172\u0003\u0002\u0002\u0002\u0172\u0170\u0003\u0002",
  1097. "\u0002\u0002\u0172\u0173\u0003\u0002\u0002\u0002\u0173\u0174\u0003\u0002",
  1098. "\u0002\u0002\u0174\u0178\u00070\u0002\u0002\u0175\u0177\t\u0007\u0002",
  1099. "\u0002\u0176\u0175\u0003\u0002\u0002\u0002\u0177\u017a\u0003\u0002\u0002",
  1100. "\u0002\u0178\u0176\u0003\u0002\u0002\u0002\u0178\u0179\u0003\u0002\u0002",
  1101. "\u0002\u0179\u017b\u0003\u0002\u0002\u0002\u017a\u0178\u0003\u0002\u0002",
  1102. "\u0002\u017b\u017d\u0005[.\u0002\u017c\u0165\u0003\u0002\u0002\u0002",
  1103. "\u017c\u0170\u0003\u0002\u0002\u0002\u017dZ\u0003\u0002\u0002\u0002",
  1104. "\u017e\u0180\t\t\u0002\u0002\u017f\u0181\t\u0002\u0002\u0002\u0180\u017f",
  1105. "\u0003\u0002\u0002\u0002\u0180\u0181\u0003\u0002\u0002\u0002\u0181\u0183",
  1106. "\u0003\u0002\u0002\u0002\u0182\u0184\t\u0007\u0002\u0002\u0183\u0182",
  1107. "\u0003\u0002\u0002\u0002\u0184\u0185\u0003\u0002\u0002\u0002\u0185\u0183",
  1108. "\u0003\u0002\u0002\u0002\u0185\u0186\u0003\u0002\u0002\u0002\u0186\\",
  1109. "\u0003\u0002\u0002\u0002\u0187\u018b\u0007$\u0002\u0002\u0188\u018a",
  1110. "\u0005_0\u0002\u0189\u0188\u0003\u0002\u0002\u0002\u018a\u018d\u0003",
  1111. "\u0002\u0002\u0002\u018b\u0189\u0003\u0002\u0002\u0002\u018b\u018c\u0003",
  1112. "\u0002\u0002\u0002\u018c\u018e\u0003\u0002\u0002\u0002\u018d\u018b\u0003",
  1113. "\u0002\u0002\u0002\u018e\u018f\u0007$\u0002\u0002\u018f^\u0003\u0002",
  1114. "\u0002\u0002\u0190\u0193\n\n\u0002\u0002\u0191\u0193\u0005m7\u0002\u0192",
  1115. "\u0190\u0003\u0002\u0002\u0002\u0192\u0191\u0003\u0002\u0002\u0002\u0193",
  1116. "`\u0003\u0002\u0002\u0002\u0194\u0197\u0007)\u0002\u0002\u0195\u0198",
  1117. "\u0005m7\u0002\u0196\u0198\n\u000b\u0002\u0002\u0197\u0195\u0003\u0002",
  1118. "\u0002\u0002\u0197\u0196\u0003\u0002\u0002\u0002\u0198\u0199\u0003\u0002",
  1119. "\u0002\u0002\u0199\u019a\u0007)\u0002\u0002\u019ab\u0003\u0002\u0002",
  1120. "\u0002\u019b\u019c\t\f\u0002\u0002\u019c\u019d\u0003\u0002\u0002\u0002",
  1121. "\u019d\u019e\b2\u0002\u0002\u019ed\u0003\u0002\u0002\u0002\u019f\u01a0",
  1122. "\u0007=\u0002\u0002\u01a0f\u0003\u0002\u0002\u0002\u01a1\u01a3\t\r\u0002",
  1123. "\u0002\u01a2\u01a1\u0003\u0002\u0002\u0002\u01a3\u01a4\u0003\u0002\u0002",
  1124. "\u0002\u01a4\u01a2\u0003\u0002\u0002\u0002\u01a4\u01a5\u0003\u0002\u0002",
  1125. "\u0002\u01a5\u01a8\u0003\u0002\u0002\u0002\u01a6\u01a8\u0005e3\u0002",
  1126. "\u01a7\u01a2\u0003\u0002\u0002\u0002\u01a7\u01a6\u0003\u0002\u0002\u0002",
  1127. "\u01a8h\u0003\u0002\u0002\u0002\u01a9\u01aa\t\u000e\u0002\u0002\u01aa",
  1128. "j\u0003\u0002\u0002\u0002\u01ab\u01ac\t\u000f\u0002\u0002\u01acl\u0003",
  1129. "\u0002\u0002\u0002\u01ad\u01ae\u0007^\u0002\u0002\u01ae\u01b2\t\u0010",
  1130. "\u0002\u0002\u01af\u01b2\u0005q9\u0002\u01b0\u01b2\u0005o8\u0002\u01b1",
  1131. "\u01ad\u0003\u0002\u0002\u0002\u01b1\u01af\u0003\u0002\u0002\u0002\u01b1",
  1132. "\u01b0\u0003\u0002\u0002\u0002\u01b2n\u0003\u0002\u0002\u0002\u01b3",
  1133. "\u01b4\u0007^\u0002\u0002\u01b4\u01b5\t\u0011\u0002\u0002\u01b5\u01b6",
  1134. "\u0005k6\u0002\u01b6\u01b7\u0005k6\u0002\u01b7\u01bf\u0003\u0002\u0002",
  1135. "\u0002\u01b8\u01b9\u0007^\u0002\u0002\u01b9\u01ba\u0005k6\u0002\u01ba",
  1136. "\u01bb\u0005k6\u0002\u01bb\u01bf\u0003\u0002\u0002\u0002\u01bc\u01bd",
  1137. "\u0007^\u0002\u0002\u01bd\u01bf\u0005k6\u0002\u01be\u01b3\u0003\u0002",
  1138. "\u0002\u0002\u01be\u01b8\u0003\u0002\u0002\u0002\u01be\u01bc\u0003\u0002",
  1139. "\u0002\u0002\u01bfp\u0003\u0002\u0002\u0002\u01c0\u01c1\u0007^\u0002",
  1140. "\u0002\u01c1\u01c2\u0007w\u0002\u0002\u01c2\u01c3\u0005i5\u0002\u01c3",
  1141. "\u01c4\u0005i5\u0002\u01c4\u01c5\u0005i5\u0002\u01c5\u01c6\u0005i5\u0002",
  1142. "\u01c6r\u0003\u0002\u0002\u0002\u01c7\u01c8\u00071\u0002\u0002\u01c8",
  1143. "\u01c9\u00071\u0002\u0002\u01c9\u01cd\u0003\u0002\u0002\u0002\u01ca",
  1144. "\u01cc\n\r\u0002\u0002\u01cb\u01ca\u0003\u0002\u0002\u0002\u01cc\u01cf",
  1145. "\u0003\u0002\u0002\u0002\u01cd\u01cb\u0003\u0002\u0002\u0002\u01cd\u01ce",
  1146. "\u0003\u0002\u0002\u0002\u01ce\u01d1\u0003\u0002\u0002\u0002\u01cf\u01cd",
  1147. "\u0003\u0002\u0002\u0002\u01d0\u01d2\u0007\u000f\u0002\u0002\u01d1\u01d0",
  1148. "\u0003\u0002\u0002\u0002\u01d1\u01d2\u0003\u0002\u0002\u0002\u01d2\u01d3",
  1149. "\u0003\u0002\u0002\u0002\u01d3\u01e0\u0007\f\u0002\u0002\u01d4\u01d5",
  1150. "\u00071\u0002\u0002\u01d5\u01d6\u0007,\u0002\u0002\u01d6\u01da\u0003",
  1151. "\u0002\u0002\u0002\u01d7\u01d9\u000b\u0002\u0002\u0002\u01d8\u01d7\u0003",
  1152. "\u0002\u0002\u0002\u01d9\u01dc\u0003\u0002\u0002\u0002\u01da\u01db\u0003",
  1153. "\u0002\u0002\u0002\u01da\u01d8\u0003\u0002\u0002\u0002\u01db\u01dd\u0003",
  1154. "\u0002\u0002\u0002\u01dc\u01da\u0003\u0002\u0002\u0002\u01dd\u01de\u0007",
  1155. ",\u0002\u0002\u01de\u01e0\u00071\u0002\u0002\u01df\u01c7\u0003\u0002",
  1156. "\u0002\u0002\u01df\u01d4\u0003\u0002\u0002\u0002\u01e0\u01e1\u0003\u0002",
  1157. "\u0002\u0002\u01e1\u01e2\b:\u0003\u0002\u01e2t\u0003\u0002\u0002\u0002",
  1158. "\u001e\u0002\u0123\u0136\u0140\u014a\u0150\u0155\u015b\u0160\u0162\u0167",
  1159. "\u016d\u0172\u0178\u017c\u0180\u0185\u018b\u0192\u0197\u01a4\u01a7\u01b1",
  1160. "\u01be\u01cd\u01d1\u01da\u01df\u0004\b\u0002\u0002\u0002\u0003\u0002"].join("");
  1161. var atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);
  1162. var decisionsToDFA = atn.decisionToState.map( function(ds, index) { return new antlr4.dfa.DFA(ds, index); });
  1163. function ivprog(input) {
  1164. antlr4.Lexer.call(this, input);
  1165. this._interp = new antlr4.atn.LexerATNSimulator(this, atn, decisionsToDFA, new antlr4.PredictionContextCache());
  1166. return this;
  1167. }
  1168. ivprog.prototype = Object.create(antlr4.Lexer.prototype);
  1169. ivprog.prototype.constructor = ivprog;
  1170. ivprog.EOF = antlr4.Token.EOF;
  1171. ivprog.RK_PROGRAM = 1;
  1172. ivprog.RK_REAL = 2;
  1173. ivprog.RK_VOID = 3;
  1174. ivprog.RK_BOOLEAN = 4;
  1175. ivprog.RK_STRING = 5;
  1176. ivprog.RK_INTEGER = 6;
  1177. ivprog.RK_CHARACTER = 7;
  1178. ivprog.RK_SWITCH = 8;
  1179. ivprog.RK_CASE = 9;
  1180. ivprog.RK_DEFAULT = 10;
  1181. ivprog.RK_CONST = 11;
  1182. ivprog.RK_FUNCTION = 12;
  1183. ivprog.RK_RETURN = 13;
  1184. ivprog.RK_FOR = 14;
  1185. ivprog.RK_BREAK = 15;
  1186. ivprog.RK_DO = 16;
  1187. ivprog.RK_WHILE = 17;
  1188. ivprog.RK_IF = 18;
  1189. ivprog.RK_ELSE = 19;
  1190. ivprog.RK_FALSE = 20;
  1191. ivprog.RK_TRUE = 21;
  1192. ivprog.RK_REFERENCE = 22;
  1193. ivprog.OPEN_PARENTHESIS = 23;
  1194. ivprog.CLOSE_PARENTHESIS = 24;
  1195. ivprog.OPEN_BRACE = 25;
  1196. ivprog.CLOSE_BRACE = 26;
  1197. ivprog.OPEN_CURLY = 27;
  1198. ivprog.CLOSE_CURLY = 28;
  1199. ivprog.COMMA = 29;
  1200. ivprog.EQUAL = 30;
  1201. ivprog.SUM_OP = 31;
  1202. ivprog.MULTI_OP = 32;
  1203. ivprog.AND_OPERATOR = 33;
  1204. ivprog.OR_OPERATOR = 34;
  1205. ivprog.RELATIONAL_OPERATOR = 35;
  1206. ivprog.COLON = 36;
  1207. ivprog.NOT_OPERATOR = 37;
  1208. ivprog.ID = 38;
  1209. ivprog.LIB_ID = 39;
  1210. ivprog.INTEGER = 40;
  1211. ivprog.REAL = 41;
  1212. ivprog.STRING = 42;
  1213. ivprog.CHARACTER = 43;
  1214. ivprog.WHITESPACE = 44;
  1215. ivprog.EOS = 45;
  1216. ivprog.COMMENTS = 46;
  1217. ivprog.prototype.channelNames = [ "DEFAULT_TOKEN_CHANNEL", "HIDDEN" ];
  1218. ivprog.prototype.modeNames = [ "DEFAULT_MODE" ];
  1219. ivprog.prototype.literalNames = [ null, "'programa'", "'real'", "'vazio'",
  1220. "'logico'", "'cadeia'", "'inteiro'", "'caractere'",
  1221. "'escolha'", "'caso'", "'contrario'",
  1222. "'const'", "'funcao'", "'retorne'", "'para'",
  1223. "'pare'", "'faca'", "'enquanto'", "'se'",
  1224. "'senao'", "'falso'", "'verdadeiro'",
  1225. "'&'", "'('", "')'", "'['", "']'", "'{'",
  1226. "'}'", "','", null, null, null, null,
  1227. null, null, "':'" ];
  1228. ivprog.prototype.symbolicNames = [ null, "RK_PROGRAM", "RK_REAL", "RK_VOID",
  1229. "RK_BOOLEAN", "RK_STRING", "RK_INTEGER",
  1230. "RK_CHARACTER", "RK_SWITCH", "RK_CASE",
  1231. "RK_DEFAULT", "RK_CONST", "RK_FUNCTION",
  1232. "RK_RETURN", "RK_FOR", "RK_BREAK", "RK_DO",
  1233. "RK_WHILE", "RK_IF", "RK_ELSE", "RK_FALSE",
  1234. "RK_TRUE", "RK_REFERENCE", "OPEN_PARENTHESIS",
  1235. "CLOSE_PARENTHESIS", "OPEN_BRACE", "CLOSE_BRACE",
  1236. "OPEN_CURLY", "CLOSE_CURLY", "COMMA",
  1237. "EQUAL", "SUM_OP", "MULTI_OP", "AND_OPERATOR",
  1238. "OR_OPERATOR", "RELATIONAL_OPERATOR",
  1239. "COLON", "NOT_OPERATOR", "ID", "LIB_ID",
  1240. "INTEGER", "REAL", "STRING", "CHARACTER",
  1241. "WHITESPACE", "EOS", "COMMENTS" ];
  1242. ivprog.prototype.ruleNames = [ "RK_PROGRAM", "RK_REAL", "RK_VOID", "RK_BOOLEAN",
  1243. "RK_STRING", "RK_INTEGER", "RK_CHARACTER",
  1244. "RK_SWITCH", "RK_CASE", "RK_DEFAULT", "RK_CONST",
  1245. "RK_FUNCTION", "RK_RETURN", "RK_FOR", "RK_BREAK",
  1246. "RK_DO", "RK_WHILE", "RK_IF", "RK_ELSE",
  1247. "RK_FALSE", "RK_TRUE", "RK_LOGICAL_NOT",
  1248. "RK_LOGICAL_AND", "RK_LOGICAL_OR", "RK_REFERENCE",
  1249. "OPEN_PARENTHESIS", "CLOSE_PARENTHESIS",
  1250. "OPEN_BRACE", "CLOSE_BRACE", "OPEN_CURLY",
  1251. "CLOSE_CURLY", "COMMA", "EQUAL", "SUM_OP",
  1252. "MULTI_OP", "AND_OPERATOR", "OR_OPERATOR",
  1253. "RELATIONAL_OPERATOR", "COLON", "NOT_OPERATOR",
  1254. "ID", "LIB_ID", "INTEGER", "REAL", "ExponentPart",
  1255. "STRING", "STRING_CHARACTER", "CHARACTER",
  1256. "WHITESPACE", "SEMICOLON", "EOS", "HEX_DIGIT",
  1257. "OCTAL_DIGIT", "ESC_SEQ", "ESC_OCTAL", "ESC_UNICODE",
  1258. "COMMENTS" ];
  1259. ivprog.prototype.grammarFileName = "ivprog.g4";
  1260. exports.ivprog = ivprog;
  1261. /***/ }),
  1262. /* 1 */
  1263. /***/ (function(module, exports, __webpack_require__) {
  1264. module.exports = {
  1265. ivprog: __webpack_require__(0).ivprog
  1266. };
  1267. /***/ }),
  1268. /* 2 */
  1269. /***/ (function(module, exports) {
  1270. module.exports = __webpack_require__(/*! antlr4/index */ "./node_modules/antlr4/index.js");
  1271. /***/ })
  1272. /******/ ]);
  1273. /***/ }),
  1274. /***/ "./grammar/es/langFunctions.js":
  1275. /*!*************************************!*\
  1276. !*** ./grammar/es/langFunctions.js ***!
  1277. \*************************************/
  1278. /*! exports provided: default */
  1279. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1280. "use strict";
  1281. __webpack_require__.r(__webpack_exports__);
  1282. /* This is a dictionary of the language defined functions
  1283. **/
  1284. /* harmony default export */ __webpack_exports__["default"] = ({
  1285. main_function: "inicio",
  1286. $read: "leia",
  1287. $write: "escreva",
  1288. $numElements: "total_of_elements",
  1289. $matrixLines: "total_of_lines",
  1290. $matrixColumns: "total_of_columns",
  1291. $substring: "subcadeia",
  1292. $length: "comprimento",
  1293. $uppercase: "caixa_alta",
  1294. $lowercase: "caixa_baixa",
  1295. $charAt: "char_at",
  1296. $isReal: "is_real",
  1297. $isInt: "is_integer",
  1298. $isBool: "is_logic",
  1299. $castReal: "to_real",
  1300. $castInt: "to_integer",
  1301. $castBool: "to_logic",
  1302. $castString: "to_string",
  1303. $sin: "sin",
  1304. $cos: "cos",
  1305. $tan: "tan",
  1306. $sqrt: "sqrt",
  1307. $pow: "pow",
  1308. $log: "log",
  1309. $abs: "abs",
  1310. $negate: "negate",
  1311. $invert: "invert",
  1312. $max: "maximum",
  1313. $min: "minimum"
  1314. });
  1315. /***/ }),
  1316. /***/ "./grammar/es/langLibs.js":
  1317. /*!********************************!*\
  1318. !*** ./grammar/es/langLibs.js ***!
  1319. \********************************/
  1320. /*! exports provided: default */
  1321. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1322. "use strict";
  1323. __webpack_require__.r(__webpack_exports__);
  1324. /**
  1325. * This is the dictionary of the language defined libraries
  1326. */
  1327. /* harmony default export */ __webpack_exports__["default"] = ({
  1328. $mathLib: "Mathematic",
  1329. $ioLib: "ES",
  1330. $strLib: "Texto",
  1331. $arrayLib: "Arranjo",
  1332. $langLib: "Conversion"
  1333. });
  1334. /***/ }),
  1335. /***/ "./grammar/index.js":
  1336. /*!**************************!*\
  1337. !*** ./grammar/index.js ***!
  1338. \**************************/
  1339. /*! exports provided: default */
  1340. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1341. "use strict";
  1342. __webpack_require__.r(__webpack_exports__);
  1343. /* harmony import */ var _pt_ivprog_g4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pt/ivprog.g4 */ "./grammar/pt/ivprog.g4");
  1344. /* harmony import */ var _pt_ivprog_g4__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_pt_ivprog_g4__WEBPACK_IMPORTED_MODULE_0__);
  1345. /* harmony import */ var _pt_langFunctions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pt/langFunctions */ "./grammar/pt/langFunctions.js");
  1346. /* harmony import */ var _pt_langLibs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./pt/langLibs */ "./grammar/pt/langLibs.js");
  1347. /* harmony import */ var _en_ivprog_g4__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./en/ivprog.g4 */ "./grammar/en/ivprog.g4");
  1348. /* harmony import */ var _en_ivprog_g4__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_en_ivprog_g4__WEBPACK_IMPORTED_MODULE_3__);
  1349. /* harmony import */ var _en_langFunctions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./en/langFunctions */ "./grammar/en/langFunctions.js");
  1350. /* harmony import */ var _en_langLibs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./en/langLibs */ "./grammar/en/langLibs.js");
  1351. /* harmony import */ var _es_ivprog_g4__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./es/ivprog.g4 */ "./grammar/es/ivprog.g4");
  1352. /* harmony import */ var _es_ivprog_g4__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_es_ivprog_g4__WEBPACK_IMPORTED_MODULE_6__);
  1353. /* harmony import */ var _es_langFunctions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./es/langFunctions */ "./grammar/es/langFunctions.js");
  1354. /* harmony import */ var _es_langLibs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./es/langLibs */ "./grammar/es/langLibs.js");
  1355. /* harmony default export */ __webpack_exports__["default"] = ({
  1356. pt: {
  1357. lexer: _pt_ivprog_g4__WEBPACK_IMPORTED_MODULE_0__["ivprog"],
  1358. langFuncs: _pt_langFunctions__WEBPACK_IMPORTED_MODULE_1__["default"],
  1359. langLibs: _pt_langLibs__WEBPACK_IMPORTED_MODULE_2__["default"]
  1360. },
  1361. en: {
  1362. lexer: _en_ivprog_g4__WEBPACK_IMPORTED_MODULE_3__["ivprog"],
  1363. langFuncs: _en_langFunctions__WEBPACK_IMPORTED_MODULE_4__["default"],
  1364. langLibs: _en_langLibs__WEBPACK_IMPORTED_MODULE_5__["default"]
  1365. },
  1366. es: {
  1367. lexer: _es_ivprog_g4__WEBPACK_IMPORTED_MODULE_6__["ivprog"],
  1368. langFuncs: _es_langFunctions__WEBPACK_IMPORTED_MODULE_7__["default"],
  1369. langLibs: _es_langLibs__WEBPACK_IMPORTED_MODULE_8__["default"]
  1370. }
  1371. });
  1372. /***/ }),
  1373. /***/ "./grammar/pt/ivprog.g4":
  1374. /*!******************************!*\
  1375. !*** ./grammar/pt/ivprog.g4 ***!
  1376. \******************************/
  1377. /*! no static exports found */
  1378. /***/ (function(module, exports, __webpack_require__) {
  1379. module.exports =
  1380. /******/ (function(modules) { // webpackBootstrap
  1381. /******/ // The module cache
  1382. /******/ var installedModules = {};
  1383. /******/
  1384. /******/ // The require function
  1385. /******/ function __webpack_require__(moduleId) {
  1386. /******/
  1387. /******/ // Check if module is in cache
  1388. /******/ if(installedModules[moduleId]) {
  1389. /******/ return installedModules[moduleId].exports;
  1390. /******/ }
  1391. /******/ // Create a new module (and put it into the cache)
  1392. /******/ var module = installedModules[moduleId] = {
  1393. /******/ i: moduleId,
  1394. /******/ l: false,
  1395. /******/ exports: {}
  1396. /******/ };
  1397. /******/
  1398. /******/ // Execute the module function
  1399. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  1400. /******/
  1401. /******/ // Flag the module as loaded
  1402. /******/ module.l = true;
  1403. /******/
  1404. /******/ // Return the exports of the module
  1405. /******/ return module.exports;
  1406. /******/ }
  1407. /******/
  1408. /******/
  1409. /******/ // expose the modules object (__webpack_modules__)
  1410. /******/ __webpack_require__.m = modules;
  1411. /******/
  1412. /******/ // expose the module cache
  1413. /******/ __webpack_require__.c = installedModules;
  1414. /******/
  1415. /******/ // identity function for calling harmony imports with the correct context
  1416. /******/ __webpack_require__.i = function(value) { return value; };
  1417. /******/
  1418. /******/ // define getter function for harmony exports
  1419. /******/ __webpack_require__.d = function(exports, name, getter) {
  1420. /******/ if(!__webpack_require__.o(exports, name)) {
  1421. /******/ Object.defineProperty(exports, name, {
  1422. /******/ configurable: false,
  1423. /******/ enumerable: true,
  1424. /******/ get: getter
  1425. /******/ });
  1426. /******/ }
  1427. /******/ };
  1428. /******/
  1429. /******/ // getDefaultExport function for compatibility with non-harmony modules
  1430. /******/ __webpack_require__.n = function(module) {
  1431. /******/ var getter = module && module.__esModule ?
  1432. /******/ function getDefault() { return module['default']; } :
  1433. /******/ function getModuleExports() { return module; };
  1434. /******/ __webpack_require__.d(getter, 'a', getter);
  1435. /******/ return getter;
  1436. /******/ };
  1437. /******/
  1438. /******/ // Object.prototype.hasOwnProperty.call
  1439. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  1440. /******/
  1441. /******/ // __webpack_public_path__
  1442. /******/ __webpack_require__.p = "";
  1443. /******/
  1444. /******/ // Load entry module and return exports
  1445. /******/ return __webpack_require__(__webpack_require__.s = 1);
  1446. /******/ })
  1447. /************************************************************************/
  1448. /******/ ([
  1449. /* 0 */
  1450. /***/ (function(module, exports, __webpack_require__) {
  1451. // Generated from /tmp/tmp-12601ui1vFcDRBaer/ivprog.g4 by ANTLR 4.7
  1452. // jshint ignore: start
  1453. var antlr4 = __webpack_require__(2);
  1454. var serializedATN = ["\u0003\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964",
  1455. "\u00026\u0222\b\u0001\u0004\u0002\t\u0002\u0004\u0003\t\u0003\u0004",
  1456. "\u0004\t\u0004\u0004\u0005\t\u0005\u0004\u0006\t\u0006\u0004\u0007\t",
  1457. "\u0007\u0004\b\t\b\u0004\t\t\t\u0004\n\t\n\u0004\u000b\t\u000b\u0004",
  1458. "\f\t\f\u0004\r\t\r\u0004\u000e\t\u000e\u0004\u000f\t\u000f\u0004\u0010",
  1459. "\t\u0010\u0004\u0011\t\u0011\u0004\u0012\t\u0012\u0004\u0013\t\u0013",
  1460. "\u0004\u0014\t\u0014\u0004\u0015\t\u0015\u0004\u0016\t\u0016\u0004\u0017",
  1461. "\t\u0017\u0004\u0018\t\u0018\u0004\u0019\t\u0019\u0004\u001a\t\u001a",
  1462. "\u0004\u001b\t\u001b\u0004\u001c\t\u001c\u0004\u001d\t\u001d\u0004\u001e",
  1463. "\t\u001e\u0004\u001f\t\u001f\u0004 \t \u0004!\t!\u0004\"\t\"\u0004#",
  1464. "\t#\u0004$\t$\u0004%\t%\u0004&\t&\u0004\'\t\'\u0004(\t(\u0004)\t)\u0004",
  1465. "*\t*\u0004+\t+\u0004,\t,\u0004-\t-\u0004.\t.\u0004/\t/\u00040\t0\u0004",
  1466. "1\t1\u00042\t2\u00043\t3\u00044\t4\u00045\t5\u00046\t6\u00047\t7\u0004",
  1467. "8\t8\u00049\t9\u0004:\t:\u0004;\t;\u0004<\t<\u0004=\t=\u0004>\t>\u0004",
  1468. "?\t?\u0004@\t@\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0002\u0003",
  1469. "\u0002\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0003\u0003",
  1470. "\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0004\u0003\u0004\u0003",
  1471. "\u0004\u0003\u0004\u0003\u0004\u0003\u0004\u0003\u0005\u0003\u0005\u0003",
  1472. "\u0005\u0003\u0005\u0003\u0005\u0003\u0005\u0003\u0005\u0003\u0006\u0003",
  1473. "\u0006\u0003\u0006\u0003\u0006\u0003\u0006\u0003\u0006\u0003\u0006\u0003",
  1474. "\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0003",
  1475. "\u0007\u0003\u0007\u0003\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003",
  1476. "\b\u0003\b\u0003\b\u0003\b\u0003\t\u0003\t\u0003\t\u0003\t\u0003\t\u0003",
  1477. "\t\u0003\t\u0003\t\u0003\n\u0003\n\u0003\n\u0003\n\u0003\n\u0003\u000b",
  1478. "\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b",
  1479. "\u0003\u000b\u0003\u000b\u0003\u000b\u0003\f\u0003\f\u0003\f\u0003\f",
  1480. "\u0003\f\u0003\f\u0003\r\u0003\r\u0003\r\u0003\r\u0003\r\u0003\r\u0003",
  1481. "\r\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0003",
  1482. "\u000e\u0003\u000e\u0003\u000e\u0003\u000f\u0003\u000f\u0003\u000f\u0003",
  1483. "\u000f\u0003\u000f\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003",
  1484. "\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003",
  1485. "\u0010\u0003\u0010\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0012\u0003",
  1486. "\u0012\u0003\u0012\u0003\u0012\u0003\u0013\u0003\u0013\u0003\u0013\u0003",
  1487. "\u0013\u0003\u0013\u0003\u0013\u0003\u0014\u0003\u0014\u0003\u0014\u0003",
  1488. "\u0014\u0003\u0014\u0003\u0015\u0003\u0015\u0003\u0015\u0003\u0015\u0003",
  1489. "\u0015\u0003\u0015\u0003\u0015\u0003\u0016\u0003\u0016\u0003\u0016\u0003",
  1490. "\u0016\u0003\u0016\u0003\u0016\u0003\u0016\u0003\u0016\u0003\u0017\u0003",
  1491. "\u0017\u0003\u0017\u0003\u0017\u0003\u0017\u0003\u0017\u0003\u0017\u0003",
  1492. "\u0017\u0003\u0017\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003",
  1493. "\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003",
  1494. "\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003",
  1495. "\u0019\u0003\u0019\u0003\u0019\u0003\u001a\u0003\u001a\u0003\u001a\u0003",
  1496. "\u001a\u0003\u001a\u0003\u001a\u0003\u001b\u0003\u001b\u0003\u001b\u0003",
  1497. "\u001b\u0003\u001b\u0003\u001b\u0003\u001c\u0003\u001c\u0003\u001c\u0003",
  1498. "\u001c\u0003\u001c\u0003\u001c\u0003\u001c\u0003\u001c\u0003\u001c\u0003",
  1499. "\u001c\u0003\u001c\u0003\u001d\u0003\u001d\u0003\u001d\u0003\u001d\u0003",
  1500. "\u001e\u0003\u001e\u0003\u001f\u0003\u001f\u0003\u001f\u0003 \u0003",
  1501. " \u0003!\u0003!\u0003\"\u0003\"\u0003#\u0003#\u0003$\u0003$\u0003%\u0003",
  1502. "%\u0003&\u0003&\u0003\'\u0003\'\u0003(\u0003(\u0003(\u0005(\u0163\n",
  1503. "(\u0003)\u0003)\u0003*\u0003*\u0003+\u0003+\u0003,\u0003,\u0003-\u0003",
  1504. "-\u0003-\u0003-\u0003-\u0003-\u0003-\u0003-\u0003-\u0005-\u0176\n-\u0003",
  1505. ".\u0003.\u0003/\u0003/\u00030\u00030\u00070\u017e\n0\f0\u000e0\u0181",
  1506. "\u000b0\u00031\u00031\u00031\u00031\u00032\u00062\u0188\n2\r2\u000e",
  1507. "2\u0189\u00032\u00032\u00032\u00032\u00052\u0190\n2\u00032\u00062\u0193",
  1508. "\n2\r2\u000e2\u0194\u00032\u00032\u00032\u00032\u00052\u019b\n2\u0003",
  1509. "2\u00062\u019e\n2\r2\u000e2\u019f\u00052\u01a2\n2\u00033\u00063\u01a5",
  1510. "\n3\r3\u000e3\u01a6\u00033\u00033\u00063\u01ab\n3\r3\u000e3\u01ac\u0003",
  1511. "3\u00063\u01b0\n3\r3\u000e3\u01b1\u00033\u00033\u00073\u01b6\n3\f3\u000e",
  1512. "3\u01b9\u000b3\u00033\u00053\u01bc\n3\u00034\u00034\u00054\u01c0\n4",
  1513. "\u00034\u00064\u01c3\n4\r4\u000e4\u01c4\u00035\u00035\u00075\u01c9\n",
  1514. "5\f5\u000e5\u01cc\u000b5\u00035\u00035\u00036\u00036\u00056\u01d2\n",
  1515. "6\u00037\u00037\u00037\u00057\u01d7\n7\u00037\u00037\u00038\u00038\u0003",
  1516. "8\u00038\u00039\u00039\u0003:\u0006:\u01e2\n:\r:\u000e:\u01e3\u0003",
  1517. ":\u0005:\u01e7\n:\u0003;\u0003;\u0003<\u0003<\u0003=\u0003=\u0003=\u0003",
  1518. "=\u0005=\u01f1\n=\u0003>\u0003>\u0003>\u0003>\u0003>\u0003>\u0003>\u0003",
  1519. ">\u0003>\u0003>\u0003>\u0005>\u01fe\n>\u0003?\u0003?\u0003?\u0003?\u0003",
  1520. "?\u0003?\u0003?\u0003@\u0003@\u0003@\u0003@\u0007@\u020b\n@\f@\u000e",
  1521. "@\u020e\u000b@\u0003@\u0005@\u0211\n@\u0003@\u0003@\u0003@\u0003@\u0003",
  1522. "@\u0007@\u0218\n@\f@\u000e@\u021b\u000b@\u0003@\u0003@\u0005@\u021f",
  1523. "\n@\u0003@\u0003@\u0003\u0219\u0002A\u0003\u0003\u0005\u0004\u0007\u0005",
  1524. "\t\u0006\u000b\u0007\r\b\u000f\t\u0011\n\u0013\u000b\u0015\f\u0017\r",
  1525. "\u0019\u000e\u001b\u000f\u001d\u0010\u001f\u0011!\u0012#\u0013%\u0014",
  1526. "\'\u0015)\u0016+\u0017-\u0018/\u00191\u001a3\u001b5\u001c7\u001d9\u0002",
  1527. ";\u0002=\u0002?\u001eA\u001fC E!G\"I#K$M%O&Q\'S(U)W*Y+[,]-_.a/c0e1g",
  1528. "\u0002i2k\u0002m3o4q\u0002s5u\u0002w\u0002y\u0002{\u0002}\u0002\u007f",
  1529. "6\u0003\u0002\u0012\u0004\u0002--//\u0005\u0002\'\',,11\u0004\u0002",
  1530. ">>@@\u0005\u0002C\\aac|\u0006\u00022;C\\aac|\u0003\u00022;\u0003\u0002",
  1531. "23\u0004\u0002GGgg\u0006\u0002\f\f\u000f\u000f$$^^\u0006\u0002\f\f\u000f",
  1532. "\u000f))^^\u0004\u0002\u000b\u000b\"\"\u0004\u0002\f\f\u000f\u000f\u0005",
  1533. "\u00022;CHch\u0003\u000229\n\u0002$$))^^ddhhppttvv\u0003\u000225\u0002",
  1534. "\u0237\u0002\u0003\u0003\u0002\u0002\u0002\u0002\u0005\u0003\u0002\u0002",
  1535. "\u0002\u0002\u0007\u0003\u0002\u0002\u0002\u0002\t\u0003\u0002\u0002",
  1536. "\u0002\u0002\u000b\u0003\u0002\u0002\u0002\u0002\r\u0003\u0002\u0002",
  1537. "\u0002\u0002\u000f\u0003\u0002\u0002\u0002\u0002\u0011\u0003\u0002\u0002",
  1538. "\u0002\u0002\u0013\u0003\u0002\u0002\u0002\u0002\u0015\u0003\u0002\u0002",
  1539. "\u0002\u0002\u0017\u0003\u0002\u0002\u0002\u0002\u0019\u0003\u0002\u0002",
  1540. "\u0002\u0002\u001b\u0003\u0002\u0002\u0002\u0002\u001d\u0003\u0002\u0002",
  1541. "\u0002\u0002\u001f\u0003\u0002\u0002\u0002\u0002!\u0003\u0002\u0002",
  1542. "\u0002\u0002#\u0003\u0002\u0002\u0002\u0002%\u0003\u0002\u0002\u0002",
  1543. "\u0002\'\u0003\u0002\u0002\u0002\u0002)\u0003\u0002\u0002\u0002\u0002",
  1544. "+\u0003\u0002\u0002\u0002\u0002-\u0003\u0002\u0002\u0002\u0002/\u0003",
  1545. "\u0002\u0002\u0002\u00021\u0003\u0002\u0002\u0002\u00023\u0003\u0002",
  1546. "\u0002\u0002\u00025\u0003\u0002\u0002\u0002\u00027\u0003\u0002\u0002",
  1547. "\u0002\u0002?\u0003\u0002\u0002\u0002\u0002A\u0003\u0002\u0002\u0002",
  1548. "\u0002C\u0003\u0002\u0002\u0002\u0002E\u0003\u0002\u0002\u0002\u0002",
  1549. "G\u0003\u0002\u0002\u0002\u0002I\u0003\u0002\u0002\u0002\u0002K\u0003",
  1550. "\u0002\u0002\u0002\u0002M\u0003\u0002\u0002\u0002\u0002O\u0003\u0002",
  1551. "\u0002\u0002\u0002Q\u0003\u0002\u0002\u0002\u0002S\u0003\u0002\u0002",
  1552. "\u0002\u0002U\u0003\u0002\u0002\u0002\u0002W\u0003\u0002\u0002\u0002",
  1553. "\u0002Y\u0003\u0002\u0002\u0002\u0002[\u0003\u0002\u0002\u0002\u0002",
  1554. "]\u0003\u0002\u0002\u0002\u0002_\u0003\u0002\u0002\u0002\u0002a\u0003",
  1555. "\u0002\u0002\u0002\u0002c\u0003\u0002\u0002\u0002\u0002e\u0003\u0002",
  1556. "\u0002\u0002\u0002i\u0003\u0002\u0002\u0002\u0002m\u0003\u0002\u0002",
  1557. "\u0002\u0002o\u0003\u0002\u0002\u0002\u0002s\u0003\u0002\u0002\u0002",
  1558. "\u0002\u007f\u0003\u0002\u0002\u0002\u0003\u0081\u0003\u0002\u0002\u0002",
  1559. "\u0005\u008a\u0003\u0002\u0002\u0002\u0007\u008f\u0003\u0002\u0002\u0002",
  1560. "\t\u0095\u0003\u0002\u0002\u0002\u000b\u009c\u0003\u0002\u0002\u0002",
  1561. "\r\u00a3\u0003\u0002\u0002\u0002\u000f\u00ab\u0003\u0002\u0002\u0002",
  1562. "\u0011\u00b5\u0003\u0002\u0002\u0002\u0013\u00bd\u0003\u0002\u0002\u0002",
  1563. "\u0015\u00c2\u0003\u0002\u0002\u0002\u0017\u00cc\u0003\u0002\u0002\u0002",
  1564. "\u0019\u00d2\u0003\u0002\u0002\u0002\u001b\u00d9\u0003\u0002\u0002\u0002",
  1565. "\u001d\u00e1\u0003\u0002\u0002\u0002\u001f\u00e6\u0003\u0002\u0002\u0002",
  1566. "!\u00f2\u0003\u0002\u0002\u0002#\u00f5\u0003\u0002\u0002\u0002%\u00f9",
  1567. "\u0003\u0002\u0002\u0002\'\u00ff\u0003\u0002\u0002\u0002)\u0104\u0003",
  1568. "\u0002\u0002\u0002+\u010b\u0003\u0002\u0002\u0002-\u0113\u0003\u0002",
  1569. "\u0002\u0002/\u011c\u0003\u0002\u0002\u00021\u012c\u0003\u0002\u0002",
  1570. "\u00023\u012f\u0003\u0002\u0002\u00025\u0135\u0003\u0002\u0002\u0002",
  1571. "7\u013b\u0003\u0002\u0002\u00029\u0146\u0003\u0002\u0002\u0002;\u014a",
  1572. "\u0003\u0002\u0002\u0002=\u014c\u0003\u0002\u0002\u0002?\u014f\u0003",
  1573. "\u0002\u0002\u0002A\u0151\u0003\u0002\u0002\u0002C\u0153\u0003\u0002",
  1574. "\u0002\u0002E\u0155\u0003\u0002\u0002\u0002G\u0157\u0003\u0002\u0002",
  1575. "\u0002I\u0159\u0003\u0002\u0002\u0002K\u015b\u0003\u0002\u0002\u0002",
  1576. "M\u015d\u0003\u0002\u0002\u0002O\u0162\u0003\u0002\u0002\u0002Q\u0164",
  1577. "\u0003\u0002\u0002\u0002S\u0166\u0003\u0002\u0002\u0002U\u0168\u0003",
  1578. "\u0002\u0002\u0002W\u016a\u0003\u0002\u0002\u0002Y\u0175\u0003\u0002",
  1579. "\u0002\u0002[\u0177\u0003\u0002\u0002\u0002]\u0179\u0003\u0002\u0002",
  1580. "\u0002_\u017b\u0003\u0002\u0002\u0002a\u0182\u0003\u0002\u0002\u0002",
  1581. "c\u01a1\u0003\u0002\u0002\u0002e\u01bb\u0003\u0002\u0002\u0002g\u01bd",
  1582. "\u0003\u0002\u0002\u0002i\u01c6\u0003\u0002\u0002\u0002k\u01d1\u0003",
  1583. "\u0002\u0002\u0002m\u01d3\u0003\u0002\u0002\u0002o\u01da\u0003\u0002",
  1584. "\u0002\u0002q\u01de\u0003\u0002\u0002\u0002s\u01e6\u0003\u0002\u0002",
  1585. "\u0002u\u01e8\u0003\u0002\u0002\u0002w\u01ea\u0003\u0002\u0002\u0002",
  1586. "y\u01f0\u0003\u0002\u0002\u0002{\u01fd\u0003\u0002\u0002\u0002}\u01ff",
  1587. "\u0003\u0002\u0002\u0002\u007f\u021e\u0003\u0002\u0002\u0002\u0081\u0082",
  1588. "\u0007r\u0002\u0002\u0082\u0083\u0007t\u0002\u0002\u0083\u0084\u0007",
  1589. "q\u0002\u0002\u0084\u0085\u0007i\u0002\u0002\u0085\u0086\u0007t\u0002",
  1590. "\u0002\u0086\u0087\u0007c\u0002\u0002\u0087\u0088\u0007o\u0002\u0002",
  1591. "\u0088\u0089\u0007c\u0002\u0002\u0089\u0004\u0003\u0002\u0002\u0002",
  1592. "\u008a\u008b\u0007t\u0002\u0002\u008b\u008c\u0007g\u0002\u0002\u008c",
  1593. "\u008d\u0007c\u0002\u0002\u008d\u008e\u0007n\u0002\u0002\u008e\u0006",
  1594. "\u0003\u0002\u0002\u0002\u008f\u0090\u0007x\u0002\u0002\u0090\u0091",
  1595. "\u0007c\u0002\u0002\u0091\u0092\u0007|\u0002\u0002\u0092\u0093\u0007",
  1596. "k\u0002\u0002\u0093\u0094\u0007q\u0002\u0002\u0094\b\u0003\u0002\u0002",
  1597. "\u0002\u0095\u0096\u0007n\u0002\u0002\u0096\u0097\u0007q\u0002\u0002",
  1598. "\u0097\u0098\u0007i\u0002\u0002\u0098\u0099\u0007k\u0002\u0002\u0099",
  1599. "\u009a\u0007e\u0002\u0002\u009a\u009b\u0007q\u0002\u0002\u009b\n\u0003",
  1600. "\u0002\u0002\u0002\u009c\u009d\u0007e\u0002\u0002\u009d\u009e\u0007",
  1601. "c\u0002\u0002\u009e\u009f\u0007f\u0002\u0002\u009f\u00a0\u0007g\u0002",
  1602. "\u0002\u00a0\u00a1\u0007k\u0002\u0002\u00a1\u00a2\u0007c\u0002\u0002",
  1603. "\u00a2\f\u0003\u0002\u0002\u0002\u00a3\u00a4\u0007k\u0002\u0002\u00a4",
  1604. "\u00a5\u0007p\u0002\u0002\u00a5\u00a6\u0007v\u0002\u0002\u00a6\u00a7",
  1605. "\u0007g\u0002\u0002\u00a7\u00a8\u0007k\u0002\u0002\u00a8\u00a9\u0007",
  1606. "t\u0002\u0002\u00a9\u00aa\u0007q\u0002\u0002\u00aa\u000e\u0003\u0002",
  1607. "\u0002\u0002\u00ab\u00ac\u0007e\u0002\u0002\u00ac\u00ad\u0007c\u0002",
  1608. "\u0002\u00ad\u00ae\u0007t\u0002\u0002\u00ae\u00af\u0007c\u0002\u0002",
  1609. "\u00af\u00b0\u0007e\u0002\u0002\u00b0\u00b1\u0007v\u0002\u0002\u00b1",
  1610. "\u00b2\u0007g\u0002\u0002\u00b2\u00b3\u0007t\u0002\u0002\u00b3\u00b4",
  1611. "\u0007g\u0002\u0002\u00b4\u0010\u0003\u0002\u0002\u0002\u00b5\u00b6",
  1612. "\u0007g\u0002\u0002\u00b6\u00b7\u0007u\u0002\u0002\u00b7\u00b8\u0007",
  1613. "e\u0002\u0002\u00b8\u00b9\u0007q\u0002\u0002\u00b9\u00ba\u0007n\u0002",
  1614. "\u0002\u00ba\u00bb\u0007j\u0002\u0002\u00bb\u00bc\u0007c\u0002\u0002",
  1615. "\u00bc\u0012\u0003\u0002\u0002\u0002\u00bd\u00be\u0007e\u0002\u0002",
  1616. "\u00be\u00bf\u0007c\u0002\u0002\u00bf\u00c0\u0007u\u0002\u0002\u00c0",
  1617. "\u00c1\u0007q\u0002\u0002\u00c1\u0014\u0003\u0002\u0002\u0002\u00c2",
  1618. "\u00c3\u0007e\u0002\u0002\u00c3\u00c4\u0007q\u0002\u0002\u00c4\u00c5",
  1619. "\u0007p\u0002\u0002\u00c5\u00c6\u0007v\u0002\u0002\u00c6\u00c7\u0007",
  1620. "t\u0002\u0002\u00c7\u00c8\u0007c\u0002\u0002\u00c8\u00c9\u0007t\u0002",
  1621. "\u0002\u00c9\u00ca\u0007k\u0002\u0002\u00ca\u00cb\u0007q\u0002\u0002",
  1622. "\u00cb\u0016\u0003\u0002\u0002\u0002\u00cc\u00cd\u0007e\u0002\u0002",
  1623. "\u00cd\u00ce\u0007q\u0002\u0002\u00ce\u00cf\u0007p\u0002\u0002\u00cf",
  1624. "\u00d0\u0007u\u0002\u0002\u00d0\u00d1\u0007v\u0002\u0002\u00d1\u0018",
  1625. "\u0003\u0002\u0002\u0002\u00d2\u00d3\u0007h\u0002\u0002\u00d3\u00d4",
  1626. "\u0007w\u0002\u0002\u00d4\u00d5\u0007p\u0002\u0002\u00d5\u00d6\u0007",
  1627. "e\u0002\u0002\u00d6\u00d7\u0007c\u0002\u0002\u00d7\u00d8\u0007q\u0002",
  1628. "\u0002\u00d8\u001a\u0003\u0002\u0002\u0002\u00d9\u00da\u0007f\u0002",
  1629. "\u0002\u00da\u00db\u0007g\u0002\u0002\u00db\u00dc\u0007x\u0002\u0002",
  1630. "\u00dc\u00dd\u0007q\u0002\u0002\u00dd\u00de\u0007n\u0002\u0002\u00de",
  1631. "\u00df\u0007x\u0002\u0002\u00df\u00e0\u0007c\u0002\u0002\u00e0\u001c",
  1632. "\u0003\u0002\u0002\u0002\u00e1\u00e2\u0007r\u0002\u0002\u00e2\u00e3",
  1633. "\u0007c\u0002\u0002\u00e3\u00e4\u0007t\u0002\u0002\u00e4\u00e5\u0007",
  1634. "c\u0002\u0002\u00e5\u001e\u0003\u0002\u0002\u0002\u00e6\u00e7\u0007",
  1635. "t\u0002\u0002\u00e7\u00e8\u0007g\u0002\u0002\u00e8\u00e9\u0007r\u0002",
  1636. "\u0002\u00e9\u00ea\u0007k\u0002\u0002\u00ea\u00eb\u0007v\u0002\u0002",
  1637. "\u00eb\u00ec\u0007c\u0002\u0002\u00ec\u00ed\u0007a\u0002\u0002\u00ed",
  1638. "\u00ee\u0007r\u0002\u0002\u00ee\u00ef\u0007c\u0002\u0002\u00ef\u00f0",
  1639. "\u0007t\u0002\u0002\u00f0\u00f1\u0007c\u0002\u0002\u00f1 \u0003\u0002",
  1640. "\u0002\u0002\u00f2\u00f3\u0007f\u0002\u0002\u00f3\u00f4\u0007g\u0002",
  1641. "\u0002\u00f4\"\u0003\u0002\u0002\u0002\u00f5\u00f6\u0007c\u0002\u0002",
  1642. "\u00f6\u00f7\u0007v\u0002\u0002\u00f7\u00f8\u0007g\u0002\u0002\u00f8",
  1643. "$\u0003\u0002\u0002\u0002\u00f9\u00fa\u0007r\u0002\u0002\u00fa\u00fb",
  1644. "\u0007c\u0002\u0002\u00fb\u00fc\u0007u\u0002\u0002\u00fc\u00fd\u0007",
  1645. "u\u0002\u0002\u00fd\u00fe\u0007q\u0002\u0002\u00fe&\u0003\u0002\u0002",
  1646. "\u0002\u00ff\u0100\u0007r\u0002\u0002\u0100\u0101\u0007c\u0002\u0002",
  1647. "\u0101\u0102\u0007t\u0002\u0002\u0102\u0103\u0007g\u0002\u0002\u0103",
  1648. "(\u0003\u0002\u0002\u0002\u0104\u0105\u0007t\u0002\u0002\u0105\u0106",
  1649. "\u0007g\u0002\u0002\u0106\u0107\u0007r\u0002\u0002\u0107\u0108\u0007",
  1650. "k\u0002\u0002\u0108\u0109\u0007v\u0002\u0002\u0109\u010a\u0007c\u0002",
  1651. "\u0002\u010a*\u0003\u0002\u0002\u0002\u010b\u010c\u0007c\u0002\u0002",
  1652. "\u010c\u010d\u0007v\u0002\u0002\u010d\u010e\u0007g\u0002\u0002\u010e",
  1653. "\u010f\u0007a\u0002\u0002\u010f\u0110\u0007s\u0002\u0002\u0110\u0111",
  1654. "\u0007w\u0002\u0002\u0111\u0112\u0007g\u0002\u0002\u0112,\u0003\u0002",
  1655. "\u0002\u0002\u0113\u0114\u0007g\u0002\u0002\u0114\u0115\u0007p\u0002",
  1656. "\u0002\u0115\u0116\u0007s\u0002\u0002\u0116\u0117\u0007w\u0002\u0002",
  1657. "\u0117\u0118\u0007c\u0002\u0002\u0118\u0119\u0007p\u0002\u0002\u0119",
  1658. "\u011a\u0007v\u0002\u0002\u011a\u011b\u0007q\u0002\u0002\u011b.\u0003",
  1659. "\u0002\u0002\u0002\u011c\u011d\u0007t\u0002\u0002\u011d\u011e\u0007",
  1660. "g\u0002\u0002\u011e\u011f\u0007r\u0002\u0002\u011f\u0120\u0007k\u0002",
  1661. "\u0002\u0120\u0121\u0007v\u0002\u0002\u0121\u0122\u0007c\u0002\u0002",
  1662. "\u0122\u0123\u0007a\u0002\u0002\u0123\u0124\u0007g\u0002\u0002\u0124",
  1663. "\u0125\u0007p\u0002\u0002\u0125\u0126\u0007s\u0002\u0002\u0126\u0127",
  1664. "\u0007w\u0002\u0002\u0127\u0128\u0007c\u0002\u0002\u0128\u0129\u0007",
  1665. "p\u0002\u0002\u0129\u012a\u0007v\u0002\u0002\u012a\u012b\u0007q\u0002",
  1666. "\u0002\u012b0\u0003\u0002\u0002\u0002\u012c\u012d\u0007u\u0002\u0002",
  1667. "\u012d\u012e\u0007g\u0002\u0002\u012e2\u0003\u0002\u0002\u0002\u012f",
  1668. "\u0130\u0007u\u0002\u0002\u0130\u0131\u0007g\u0002\u0002\u0131\u0132",
  1669. "\u0007p\u0002\u0002\u0132\u0133\u0007c\u0002\u0002\u0133\u0134\u0007",
  1670. "q\u0002\u0002\u01344\u0003\u0002\u0002\u0002\u0135\u0136\u0007h\u0002",
  1671. "\u0002\u0136\u0137\u0007c\u0002\u0002\u0137\u0138\u0007n\u0002\u0002",
  1672. "\u0138\u0139\u0007u\u0002\u0002\u0139\u013a\u0007q\u0002\u0002\u013a",
  1673. "6\u0003\u0002\u0002\u0002\u013b\u013c\u0007x\u0002\u0002\u013c\u013d",
  1674. "\u0007g\u0002\u0002\u013d\u013e\u0007t\u0002\u0002\u013e\u013f\u0007",
  1675. "f\u0002\u0002\u013f\u0140\u0007c\u0002\u0002\u0140\u0141\u0007f\u0002",
  1676. "\u0002\u0141\u0142\u0007g\u0002\u0002\u0142\u0143\u0007k\u0002\u0002",
  1677. "\u0143\u0144\u0007t\u0002\u0002\u0144\u0145\u0007q\u0002\u0002\u0145",
  1678. "8\u0003\u0002\u0002\u0002\u0146\u0147\u0007p\u0002\u0002\u0147\u0148",
  1679. "\u0007c\u0002\u0002\u0148\u0149\u0007q\u0002\u0002\u0149:\u0003\u0002",
  1680. "\u0002\u0002\u014a\u014b\u0007G\u0002\u0002\u014b<\u0003\u0002\u0002",
  1681. "\u0002\u014c\u014d\u0007Q\u0002\u0002\u014d\u014e\u0007W\u0002\u0002",
  1682. "\u014e>\u0003\u0002\u0002\u0002\u014f\u0150\u0007(\u0002\u0002\u0150",
  1683. "@\u0003\u0002\u0002\u0002\u0151\u0152\u0007*\u0002\u0002\u0152B\u0003",
  1684. "\u0002\u0002\u0002\u0153\u0154\u0007+\u0002\u0002\u0154D\u0003\u0002",
  1685. "\u0002\u0002\u0155\u0156\u0007]\u0002\u0002\u0156F\u0003\u0002\u0002",
  1686. "\u0002\u0157\u0158\u0007_\u0002\u0002\u0158H\u0003\u0002\u0002\u0002",
  1687. "\u0159\u015a\u0007}\u0002\u0002\u015aJ\u0003\u0002\u0002\u0002\u015b",
  1688. "\u015c\u0007\u007f\u0002\u0002\u015cL\u0003\u0002\u0002\u0002\u015d",
  1689. "\u015e\u0007.\u0002\u0002\u015eN\u0003\u0002\u0002\u0002\u015f\u0160",
  1690. "\u0007>\u0002\u0002\u0160\u0163\u0007/\u0002\u0002\u0161\u0163\u0007",
  1691. "\u2192\u0002\u0002\u0162\u015f\u0003\u0002\u0002\u0002\u0162\u0161\u0003",
  1692. "\u0002\u0002\u0002\u0163P\u0003\u0002\u0002\u0002\u0164\u0165\t\u0002",
  1693. "\u0002\u0002\u0165R\u0003\u0002\u0002\u0002\u0166\u0167\t\u0003\u0002",
  1694. "\u0002\u0167T\u0003\u0002\u0002\u0002\u0168\u0169\u0005;\u001e\u0002",
  1695. "\u0169V\u0003\u0002\u0002\u0002\u016a\u016b\u0005=\u001f\u0002\u016b",
  1696. "X\u0003\u0002\u0002\u0002\u016c\u016d\u0007@\u0002\u0002\u016d\u0176",
  1697. "\u0007?\u0002\u0002\u016e\u016f\u0007?\u0002\u0002\u016f\u0176\u0007",
  1698. "?\u0002\u0002\u0170\u0171\u0007>\u0002\u0002\u0171\u0176\u0007?\u0002",
  1699. "\u0002\u0172\u0176\t\u0004\u0002\u0002\u0173\u0174\u0007#\u0002\u0002",
  1700. "\u0174\u0176\u0007?\u0002\u0002\u0175\u016c\u0003\u0002\u0002\u0002",
  1701. "\u0175\u016e\u0003\u0002\u0002\u0002\u0175\u0170\u0003\u0002\u0002\u0002",
  1702. "\u0175\u0172\u0003\u0002\u0002\u0002\u0175\u0173\u0003\u0002\u0002\u0002",
  1703. "\u0176Z\u0003\u0002\u0002\u0002\u0177\u0178\u0007<\u0002\u0002\u0178",
  1704. "\\\u0003\u0002\u0002\u0002\u0179\u017a\u00059\u001d\u0002\u017a^\u0003",
  1705. "\u0002\u0002\u0002\u017b\u017f\t\u0005\u0002\u0002\u017c\u017e\t\u0006",
  1706. "\u0002\u0002\u017d\u017c\u0003\u0002\u0002\u0002\u017e\u0181\u0003\u0002",
  1707. "\u0002\u0002\u017f\u017d\u0003\u0002\u0002\u0002\u017f\u0180\u0003\u0002",
  1708. "\u0002\u0002\u0180`\u0003\u0002\u0002\u0002\u0181\u017f\u0003\u0002",
  1709. "\u0002\u0002\u0182\u0183\u0005_0\u0002\u0183\u0184\u00070\u0002\u0002",
  1710. "\u0184\u0185\u0005_0\u0002\u0185b\u0003\u0002\u0002\u0002\u0186\u0188",
  1711. "\t\u0007\u0002\u0002\u0187\u0186\u0003\u0002\u0002\u0002\u0188\u0189",
  1712. "\u0003\u0002\u0002\u0002\u0189\u0187\u0003\u0002\u0002\u0002\u0189\u018a",
  1713. "\u0003\u0002\u0002\u0002\u018a\u01a2\u0003\u0002\u0002\u0002\u018b\u018c",
  1714. "\u00072\u0002\u0002\u018c\u0190\u0007z\u0002\u0002\u018d\u018e\u0007",
  1715. "2\u0002\u0002\u018e\u0190\u0007Z\u0002\u0002\u018f\u018b\u0003\u0002",
  1716. "\u0002\u0002\u018f\u018d\u0003\u0002\u0002\u0002\u0190\u0192\u0003\u0002",
  1717. "\u0002\u0002\u0191\u0193\u0005u;\u0002\u0192\u0191\u0003\u0002\u0002",
  1718. "\u0002\u0193\u0194\u0003\u0002\u0002\u0002\u0194\u0192\u0003\u0002\u0002",
  1719. "\u0002\u0194\u0195\u0003\u0002\u0002\u0002\u0195\u01a2\u0003\u0002\u0002",
  1720. "\u0002\u0196\u0197\u00072\u0002\u0002\u0197\u019b\u0007d\u0002\u0002",
  1721. "\u0198\u0199\u00072\u0002\u0002\u0199\u019b\u0007D\u0002\u0002\u019a",
  1722. "\u0196\u0003\u0002\u0002\u0002\u019a\u0198\u0003\u0002\u0002\u0002\u019b",
  1723. "\u019d\u0003\u0002\u0002\u0002\u019c\u019e\t\b\u0002\u0002\u019d\u019c",
  1724. "\u0003\u0002\u0002\u0002\u019e\u019f\u0003\u0002\u0002\u0002\u019f\u019d",
  1725. "\u0003\u0002\u0002\u0002\u019f\u01a0\u0003\u0002\u0002\u0002\u01a0\u01a2",
  1726. "\u0003\u0002\u0002\u0002\u01a1\u0187\u0003\u0002\u0002\u0002\u01a1\u018f",
  1727. "\u0003\u0002\u0002\u0002\u01a1\u019a\u0003\u0002\u0002\u0002\u01a2d",
  1728. "\u0003\u0002\u0002\u0002\u01a3\u01a5\t\u0007\u0002\u0002\u01a4\u01a3",
  1729. "\u0003\u0002\u0002\u0002\u01a5\u01a6\u0003\u0002\u0002\u0002\u01a6\u01a4",
  1730. "\u0003\u0002\u0002\u0002\u01a6\u01a7\u0003\u0002\u0002\u0002\u01a7\u01a8",
  1731. "\u0003\u0002\u0002\u0002\u01a8\u01aa\u00070\u0002\u0002\u01a9\u01ab",
  1732. "\t\u0007\u0002\u0002\u01aa\u01a9\u0003\u0002\u0002\u0002\u01ab\u01ac",
  1733. "\u0003\u0002\u0002\u0002\u01ac\u01aa\u0003\u0002\u0002\u0002\u01ac\u01ad",
  1734. "\u0003\u0002\u0002\u0002\u01ad\u01bc\u0003\u0002\u0002\u0002\u01ae\u01b0",
  1735. "\t\u0007\u0002\u0002\u01af\u01ae\u0003\u0002\u0002\u0002\u01b0\u01b1",
  1736. "\u0003\u0002\u0002\u0002\u01b1\u01af\u0003\u0002\u0002\u0002\u01b1\u01b2",
  1737. "\u0003\u0002\u0002\u0002\u01b2\u01b3\u0003\u0002\u0002\u0002\u01b3\u01b7",
  1738. "\u00070\u0002\u0002\u01b4\u01b6\t\u0007\u0002\u0002\u01b5\u01b4\u0003",
  1739. "\u0002\u0002\u0002\u01b6\u01b9\u0003\u0002\u0002\u0002\u01b7\u01b5\u0003",
  1740. "\u0002\u0002\u0002\u01b7\u01b8\u0003\u0002\u0002\u0002\u01b8\u01ba\u0003",
  1741. "\u0002\u0002\u0002\u01b9\u01b7\u0003\u0002\u0002\u0002\u01ba\u01bc\u0005",
  1742. "g4\u0002\u01bb\u01a4\u0003\u0002\u0002\u0002\u01bb\u01af\u0003\u0002",
  1743. "\u0002\u0002\u01bcf\u0003\u0002\u0002\u0002\u01bd\u01bf\t\t\u0002\u0002",
  1744. "\u01be\u01c0\t\u0002\u0002\u0002\u01bf\u01be\u0003\u0002\u0002\u0002",
  1745. "\u01bf\u01c0\u0003\u0002\u0002\u0002\u01c0\u01c2\u0003\u0002\u0002\u0002",
  1746. "\u01c1\u01c3\t\u0007\u0002\u0002\u01c2\u01c1\u0003\u0002\u0002\u0002",
  1747. "\u01c3\u01c4\u0003\u0002\u0002\u0002\u01c4\u01c2\u0003\u0002\u0002\u0002",
  1748. "\u01c4\u01c5\u0003\u0002\u0002\u0002\u01c5h\u0003\u0002\u0002\u0002",
  1749. "\u01c6\u01ca\u0007$\u0002\u0002\u01c7\u01c9\u0005k6\u0002\u01c8\u01c7",
  1750. "\u0003\u0002\u0002\u0002\u01c9\u01cc\u0003\u0002\u0002\u0002\u01ca\u01c8",
  1751. "\u0003\u0002\u0002\u0002\u01ca\u01cb\u0003\u0002\u0002\u0002\u01cb\u01cd",
  1752. "\u0003\u0002\u0002\u0002\u01cc\u01ca\u0003\u0002\u0002\u0002\u01cd\u01ce",
  1753. "\u0007$\u0002\u0002\u01cej\u0003\u0002\u0002\u0002\u01cf\u01d2\n\n\u0002",
  1754. "\u0002\u01d0\u01d2\u0005y=\u0002\u01d1\u01cf\u0003\u0002\u0002\u0002",
  1755. "\u01d1\u01d0\u0003\u0002\u0002\u0002\u01d2l\u0003\u0002\u0002\u0002",
  1756. "\u01d3\u01d6\u0007)\u0002\u0002\u01d4\u01d7\u0005y=\u0002\u01d5\u01d7",
  1757. "\n\u000b\u0002\u0002\u01d6\u01d4\u0003\u0002\u0002\u0002\u01d6\u01d5",
  1758. "\u0003\u0002\u0002\u0002\u01d7\u01d8\u0003\u0002\u0002\u0002\u01d8\u01d9",
  1759. "\u0007)\u0002\u0002\u01d9n\u0003\u0002\u0002\u0002\u01da\u01db\t\f\u0002",
  1760. "\u0002\u01db\u01dc\u0003\u0002\u0002\u0002\u01dc\u01dd\b8\u0002\u0002",
  1761. "\u01ddp\u0003\u0002\u0002\u0002\u01de\u01df\u0007=\u0002\u0002\u01df",
  1762. "r\u0003\u0002\u0002\u0002\u01e0\u01e2\t\r\u0002\u0002\u01e1\u01e0\u0003",
  1763. "\u0002\u0002\u0002\u01e2\u01e3\u0003\u0002\u0002\u0002\u01e3\u01e1\u0003",
  1764. "\u0002\u0002\u0002\u01e3\u01e4\u0003\u0002\u0002\u0002\u01e4\u01e7\u0003",
  1765. "\u0002\u0002\u0002\u01e5\u01e7\u0005q9\u0002\u01e6\u01e1\u0003\u0002",
  1766. "\u0002\u0002\u01e6\u01e5\u0003\u0002\u0002\u0002\u01e7t\u0003\u0002",
  1767. "\u0002\u0002\u01e8\u01e9\t\u000e\u0002\u0002\u01e9v\u0003\u0002\u0002",
  1768. "\u0002\u01ea\u01eb\t\u000f\u0002\u0002\u01ebx\u0003\u0002\u0002\u0002",
  1769. "\u01ec\u01ed\u0007^\u0002\u0002\u01ed\u01f1\t\u0010\u0002\u0002\u01ee",
  1770. "\u01f1\u0005}?\u0002\u01ef\u01f1\u0005{>\u0002\u01f0\u01ec\u0003\u0002",
  1771. "\u0002\u0002\u01f0\u01ee\u0003\u0002\u0002\u0002\u01f0\u01ef\u0003\u0002",
  1772. "\u0002\u0002\u01f1z\u0003\u0002\u0002\u0002\u01f2\u01f3\u0007^\u0002",
  1773. "\u0002\u01f3\u01f4\t\u0011\u0002\u0002\u01f4\u01f5\u0005w<\u0002\u01f5",
  1774. "\u01f6\u0005w<\u0002\u01f6\u01fe\u0003\u0002\u0002\u0002\u01f7\u01f8",
  1775. "\u0007^\u0002\u0002\u01f8\u01f9\u0005w<\u0002\u01f9\u01fa\u0005w<\u0002",
  1776. "\u01fa\u01fe\u0003\u0002\u0002\u0002\u01fb\u01fc\u0007^\u0002\u0002",
  1777. "\u01fc\u01fe\u0005w<\u0002\u01fd\u01f2\u0003\u0002\u0002\u0002\u01fd",
  1778. "\u01f7\u0003\u0002\u0002\u0002\u01fd\u01fb\u0003\u0002\u0002\u0002\u01fe",
  1779. "|\u0003\u0002\u0002\u0002\u01ff\u0200\u0007^\u0002\u0002\u0200\u0201",
  1780. "\u0007w\u0002\u0002\u0201\u0202\u0005u;\u0002\u0202\u0203\u0005u;\u0002",
  1781. "\u0203\u0204\u0005u;\u0002\u0204\u0205\u0005u;\u0002\u0205~\u0003\u0002",
  1782. "\u0002\u0002\u0206\u0207\u00071\u0002\u0002\u0207\u0208\u00071\u0002",
  1783. "\u0002\u0208\u020c\u0003\u0002\u0002\u0002\u0209\u020b\n\r\u0002\u0002",
  1784. "\u020a\u0209\u0003\u0002\u0002\u0002\u020b\u020e\u0003\u0002\u0002\u0002",
  1785. "\u020c\u020a\u0003\u0002\u0002\u0002\u020c\u020d\u0003\u0002\u0002\u0002",
  1786. "\u020d\u0210\u0003\u0002\u0002\u0002\u020e\u020c\u0003\u0002\u0002\u0002",
  1787. "\u020f\u0211\u0007\u000f\u0002\u0002\u0210\u020f\u0003\u0002\u0002\u0002",
  1788. "\u0210\u0211\u0003\u0002\u0002\u0002\u0211\u0212\u0003\u0002\u0002\u0002",
  1789. "\u0212\u021f\u0007\f\u0002\u0002\u0213\u0214\u00071\u0002\u0002\u0214",
  1790. "\u0215\u0007,\u0002\u0002\u0215\u0219\u0003\u0002\u0002\u0002\u0216",
  1791. "\u0218\u000b\u0002\u0002\u0002\u0217\u0216\u0003\u0002\u0002\u0002\u0218",
  1792. "\u021b\u0003\u0002\u0002\u0002\u0219\u021a\u0003\u0002\u0002\u0002\u0219",
  1793. "\u0217\u0003\u0002\u0002\u0002\u021a\u021c\u0003\u0002\u0002\u0002\u021b",
  1794. "\u0219\u0003\u0002\u0002\u0002\u021c\u021d\u0007,\u0002\u0002\u021d",
  1795. "\u021f\u00071\u0002\u0002\u021e\u0206\u0003\u0002\u0002\u0002\u021e",
  1796. "\u0213\u0003\u0002\u0002\u0002\u021f\u0220\u0003\u0002\u0002\u0002\u0220",
  1797. "\u0221\b@\u0003\u0002\u0221\u0080\u0003\u0002\u0002\u0002\u001e\u0002",
  1798. "\u0162\u0175\u017f\u0189\u018f\u0194\u019a\u019f\u01a1\u01a6\u01ac\u01b1",
  1799. "\u01b7\u01bb\u01bf\u01c4\u01ca\u01d1\u01d6\u01e3\u01e6\u01f0\u01fd\u020c",
  1800. "\u0210\u0219\u021e\u0004\b\u0002\u0002\u0002\u0003\u0002"].join("");
  1801. var atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);
  1802. var decisionsToDFA = atn.decisionToState.map( function(ds, index) { return new antlr4.dfa.DFA(ds, index); });
  1803. function ivprog(input) {
  1804. antlr4.Lexer.call(this, input);
  1805. this._interp = new antlr4.atn.LexerATNSimulator(this, atn, decisionsToDFA, new antlr4.PredictionContextCache());
  1806. return this;
  1807. }
  1808. ivprog.prototype = Object.create(antlr4.Lexer.prototype);
  1809. ivprog.prototype.constructor = ivprog;
  1810. ivprog.EOF = antlr4.Token.EOF;
  1811. ivprog.RK_PROGRAM = 1;
  1812. ivprog.RK_REAL = 2;
  1813. ivprog.RK_VOID = 3;
  1814. ivprog.RK_BOOLEAN = 4;
  1815. ivprog.RK_STRING = 5;
  1816. ivprog.RK_INTEGER = 6;
  1817. ivprog.RK_CHARACTER = 7;
  1818. ivprog.RK_SWITCH = 8;
  1819. ivprog.RK_CASE = 9;
  1820. ivprog.RK_DEFAULT = 10;
  1821. ivprog.RK_CONST = 11;
  1822. ivprog.RK_FUNCTION = 12;
  1823. ivprog.RK_RETURN = 13;
  1824. ivprog.RK_FOR = 14;
  1825. ivprog.RK_FOR_ALT = 15;
  1826. ivprog.RK_FOR_FROM = 16;
  1827. ivprog.RK_FOR_TO = 17;
  1828. ivprog.RK_FOR_PASS = 18;
  1829. ivprog.RK_BREAK = 19;
  1830. ivprog.RK_DO = 20;
  1831. ivprog.RK_DO_UNTIL = 21;
  1832. ivprog.RK_WHILE = 22;
  1833. ivprog.RK_WHILE_ALT = 23;
  1834. ivprog.RK_IF = 24;
  1835. ivprog.RK_ELSE = 25;
  1836. ivprog.RK_FALSE = 26;
  1837. ivprog.RK_TRUE = 27;
  1838. ivprog.RK_REFERENCE = 28;
  1839. ivprog.OPEN_PARENTHESIS = 29;
  1840. ivprog.CLOSE_PARENTHESIS = 30;
  1841. ivprog.OPEN_BRACE = 31;
  1842. ivprog.CLOSE_BRACE = 32;
  1843. ivprog.OPEN_CURLY = 33;
  1844. ivprog.CLOSE_CURLY = 34;
  1845. ivprog.COMMA = 35;
  1846. ivprog.EQUAL = 36;
  1847. ivprog.SUM_OP = 37;
  1848. ivprog.MULTI_OP = 38;
  1849. ivprog.AND_OPERATOR = 39;
  1850. ivprog.OR_OPERATOR = 40;
  1851. ivprog.RELATIONAL_OPERATOR = 41;
  1852. ivprog.COLON = 42;
  1853. ivprog.NOT_OPERATOR = 43;
  1854. ivprog.ID = 44;
  1855. ivprog.LIB_ID = 45;
  1856. ivprog.INTEGER = 46;
  1857. ivprog.REAL = 47;
  1858. ivprog.STRING = 48;
  1859. ivprog.CHARACTER = 49;
  1860. ivprog.WHITESPACE = 50;
  1861. ivprog.EOS = 51;
  1862. ivprog.COMMENTS = 52;
  1863. ivprog.prototype.channelNames = [ "DEFAULT_TOKEN_CHANNEL", "HIDDEN" ];
  1864. ivprog.prototype.modeNames = [ "DEFAULT_MODE" ];
  1865. ivprog.prototype.literalNames = [ null, "'programa'", "'real'", "'vazio'",
  1866. "'logico'", "'cadeia'", "'inteiro'", "'caractere'",
  1867. "'escolha'", "'caso'", "'contrario'",
  1868. "'const'", "'funcao'", "'devolva'", "'para'",
  1869. "'repita_para'", "'de'", "'ate'", "'passo'",
  1870. "'pare'", "'repita'", "'ate_que'", "'enquanto'",
  1871. "'repita_enquanto'", "'se'", "'senao'",
  1872. "'falso'", "'verdadeiro'", "'&'", "'('",
  1873. "')'", "'['", "']'", "'{'", "'}'", "','",
  1874. null, null, null, null, null, null, "':'" ];
  1875. ivprog.prototype.symbolicNames = [ null, "RK_PROGRAM", "RK_REAL", "RK_VOID",
  1876. "RK_BOOLEAN", "RK_STRING", "RK_INTEGER",
  1877. "RK_CHARACTER", "RK_SWITCH", "RK_CASE",
  1878. "RK_DEFAULT", "RK_CONST", "RK_FUNCTION",
  1879. "RK_RETURN", "RK_FOR", "RK_FOR_ALT",
  1880. "RK_FOR_FROM", "RK_FOR_TO", "RK_FOR_PASS",
  1881. "RK_BREAK", "RK_DO", "RK_DO_UNTIL", "RK_WHILE",
  1882. "RK_WHILE_ALT", "RK_IF", "RK_ELSE", "RK_FALSE",
  1883. "RK_TRUE", "RK_REFERENCE", "OPEN_PARENTHESIS",
  1884. "CLOSE_PARENTHESIS", "OPEN_BRACE", "CLOSE_BRACE",
  1885. "OPEN_CURLY", "CLOSE_CURLY", "COMMA",
  1886. "EQUAL", "SUM_OP", "MULTI_OP", "AND_OPERATOR",
  1887. "OR_OPERATOR", "RELATIONAL_OPERATOR",
  1888. "COLON", "NOT_OPERATOR", "ID", "LIB_ID",
  1889. "INTEGER", "REAL", "STRING", "CHARACTER",
  1890. "WHITESPACE", "EOS", "COMMENTS" ];
  1891. ivprog.prototype.ruleNames = [ "RK_PROGRAM", "RK_REAL", "RK_VOID", "RK_BOOLEAN",
  1892. "RK_STRING", "RK_INTEGER", "RK_CHARACTER",
  1893. "RK_SWITCH", "RK_CASE", "RK_DEFAULT", "RK_CONST",
  1894. "RK_FUNCTION", "RK_RETURN", "RK_FOR", "RK_FOR_ALT",
  1895. "RK_FOR_FROM", "RK_FOR_TO", "RK_FOR_PASS",
  1896. "RK_BREAK", "RK_DO", "RK_DO_UNTIL", "RK_WHILE",
  1897. "RK_WHILE_ALT", "RK_IF", "RK_ELSE", "RK_FALSE",
  1898. "RK_TRUE", "RK_LOGICAL_NOT", "RK_LOGICAL_AND",
  1899. "RK_LOGICAL_OR", "RK_REFERENCE", "OPEN_PARENTHESIS",
  1900. "CLOSE_PARENTHESIS", "OPEN_BRACE", "CLOSE_BRACE",
  1901. "OPEN_CURLY", "CLOSE_CURLY", "COMMA", "EQUAL",
  1902. "SUM_OP", "MULTI_OP", "AND_OPERATOR", "OR_OPERATOR",
  1903. "RELATIONAL_OPERATOR", "COLON", "NOT_OPERATOR",
  1904. "ID", "LIB_ID", "INTEGER", "REAL", "ExponentPart",
  1905. "STRING", "STRING_CHARACTER", "CHARACTER",
  1906. "WHITESPACE", "SEMICOLON", "EOS", "HEX_DIGIT",
  1907. "OCTAL_DIGIT", "ESC_SEQ", "ESC_OCTAL", "ESC_UNICODE",
  1908. "COMMENTS" ];
  1909. ivprog.prototype.grammarFileName = "ivprog.g4";
  1910. exports.ivprog = ivprog;
  1911. /***/ }),
  1912. /* 1 */
  1913. /***/ (function(module, exports, __webpack_require__) {
  1914. module.exports = {
  1915. ivprog: __webpack_require__(0).ivprog
  1916. };
  1917. /***/ }),
  1918. /* 2 */
  1919. /***/ (function(module, exports) {
  1920. module.exports = __webpack_require__(/*! antlr4/index */ "./node_modules/antlr4/index.js");
  1921. /***/ })
  1922. /******/ ]);
  1923. /***/ }),
  1924. /***/ "./grammar/pt/langFunctions.js":
  1925. /*!*************************************!*\
  1926. !*** ./grammar/pt/langFunctions.js ***!
  1927. \*************************************/
  1928. /*! exports provided: default */
  1929. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1930. "use strict";
  1931. __webpack_require__.r(__webpack_exports__);
  1932. /* This is a dictionary of the language defined functions
  1933. **/
  1934. /* harmony default export */ __webpack_exports__["default"] = ({
  1935. main_function: "inicio",
  1936. $read: "leia",
  1937. $write: "escreva",
  1938. $numElements: "total_de_elementos",
  1939. $matrixLines: "total_de_linhas",
  1940. $matrixColumns: "total_de_colunas",
  1941. $substring: "subcadeia",
  1942. $length: "comprimento",
  1943. $uppercase: "caixa_alta",
  1944. $lowercase: "caixa_baixa",
  1945. $charAt: "caractere_na_posicao",
  1946. $isReal: "e_real",
  1947. $isInt: "e_inteiro",
  1948. $isBool: "e_logico",
  1949. $castReal: "como_real",
  1950. $castInt: "como_inteiro",
  1951. $castBool: "como_logico",
  1952. $castString: "como_cadeia",
  1953. $castChar: "como_caractere",
  1954. $sin: "seno",
  1955. $cos: "cosseno",
  1956. $tan: "tangente",
  1957. $sqrt: "raiz_quadrada",
  1958. $pow: "potencia",
  1959. $log: "logaritmo",
  1960. $abs: "modulo",
  1961. $negate: "trocar_sinal",
  1962. $invert: "inverter_valor",
  1963. $max: "maximo",
  1964. $min: "minimo",
  1965. $rand: "numero_aleatorio"
  1966. });
  1967. /***/ }),
  1968. /***/ "./grammar/pt/langLibs.js":
  1969. /*!********************************!*\
  1970. !*** ./grammar/pt/langLibs.js ***!
  1971. \********************************/
  1972. /*! exports provided: default */
  1973. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1974. "use strict";
  1975. __webpack_require__.r(__webpack_exports__);
  1976. /**
  1977. * This is the dictionary of the language defined libraries
  1978. */
  1979. /* harmony default export */ __webpack_exports__["default"] = ({
  1980. $mathLib: "Matematica",
  1981. $ioLib: "ES",
  1982. $strLib: "Texto",
  1983. $arrayLib: "Arranjo",
  1984. $langLib: "Conversao"
  1985. });
  1986. /***/ }),
  1987. /***/ "./i18n/error.csv":
  1988. /*!************************!*\
  1989. !*** ./i18n/error.csv ***!
  1990. \************************/
  1991. /*! no static exports found */
  1992. /***/ (function(module, exports) {
  1993. 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":" ","token_missing_two":" ","eos_missing":" ","invalid_type":" ","invalid_array_dimension":" ","invalid_array_size":" ","extra_lines":" ","invalid_main_return":" ","invalid_var_declaration":" ","invalid_break_command":" ","invalid_terminal":" ","const_not_init":" ","id_missing":" ","invalid_id_format":" ","main_missing":" ","invalid_global_var":" ","not_implemented":" ","function_missing":" ","function_missing_full":" ","invalid_parameters_size_full":" ","invalid_parameters_size":" ","invalid_ref_full":" ","invalid_ref":" ","invalid_parameter_type_full":" ","invalid_parameter_type":" ","unknown_command_full":" ","unknown_command":" ","loop_condition_type_full":" ","loop_condition_type":" ","endless_loop_full":" ","endless_loop":" ","for_condition_type_full":" ","for_condition_type":" ","if_condition_type_full":" ","if_condition_type":" ","invalid_return_type_full":" ","invalid_return_type":" ","invalid_void_return_full":" ","invalid_void_return":" ","unexpected_break_command_full":" ","unexpected_break_command":" ","invalid_dimension":" ","void_in_expression_full":" ","void_in_expression":" ","invalid_array_access_full":" ","invalid_array_access":" ","invalid_matrix_access_full":" ","invalid_matrix_access":" ","matrix_column_outbounds_full":" ","matrix_column_outbounds":" ","matrix_line_outbounds_full":" ","matrix_line_outbounds":" ","vector_line_outbounds_full":" ","vector_line_outbounds":" ","vector_not_matrix_full":" ","vector_not_matrix":" ","invalid_infix_op_full":" ","invalid_infix_op":" ","invalid_unary_op_full":" ","invalid_unary_op":" ","unknown_op":" ","duplicate_function":" ","duplicate_variable":" ","main_parameters":" ","symbol_not_found_full":" ","symbol_not_found":" ","array_dimension_not_int_full":" ","array_dimension_not_int":" ","array_dimension_not_positive_full":" ","array_dimension_not_positive":" ","incompatible_types_full":" ","incompatible_types":" ","incompatible_types_array_full":" ","incompatible_types_array":" ","invalid_case_type_full":" ","invalid_case_type":" ","function_no_return":" ","invalid_array_literal_type_full":" ","invalid_array_literal_type":" ","invalid_array_literal_line_full":" ","invalid_array_literal_line":" ","invalid_array_literal_column_full":" ","invalid_array_literal_column":" ","exceeded_input_request":" ","test_case_few_reads":" ","test_case_failed":" ","test_case_failed_exception":" ","test_case_exception":" ","invalid_type_conversion":" ","invalid_read_type":" ","invalid_read_type_array":" ","inform_valid_identifier":" ","inform_valid_global_duplicated":" ","inform_valid_variable_duplicated":" ","inform_valid_function_duplicated":" ","inform_valid_param_duplicated":" ","invalid_character":" ","annonymous_array_literal":" ","invalid_matrix_literal_line":" ","cannot_infer_matrix_line":" ","cannot_infer_matrix_column":" ","cannot_infer_vector_size":" ","matrix_to_vector_literal_attr":" ","vector_to_matrix_literal_attr":" ","invalid_const_ref_full":" ","invalid_const_ref":" ","invalid_const_assignment_full":" ","invalid_const_assignment":" ","array_init_not_literal":" ","array_exceeds_2d":" ","invalid_matrix_id_dimension":" ","invalid_vector_init":" ","invalid_matrix_init":" ","invalid_vector_assignment_full":" ","invalid_vector_assignment":" ","invalid_matrix_assignment_full":" ","invalid_matrix_assignment":" ","matrix_to_vector_attr":" ","vector_to_matrix_attr":" ","invalid_matrix_index_assign_full":" ","invalid_matrix_index_assign":" ","invalid_number_elements_vector":" ","invalid_number_lines_matrix":" ","divsion_by_zero_full":" ","divsion_by_zero":" ","undefined_tanget_value":" ","negative_log_value":" ","invalid_string_index":" ","negative_sqrt_value":" ","exceeded_recursive_calls":" ","invalid_for_variable":"","invalid_for_from":"","invalid_for_to":"","invalid_for_pass":"","exceed_max_instructions":""}}
  1994. /***/ }),
  1995. /***/ "./i18n/index.ts":
  1996. /*!***********************!*\
  1997. !*** ./i18n/index.ts ***!
  1998. \***********************/
  1999. /*! no static exports found */
  2000. /***/ (function(module, exports, __webpack_require__) {
  2001. "use strict";
  2002. Object.defineProperty(exports, "__esModule", { value: true });
  2003. const Messages = __webpack_require__(/*! ./message.csv */ "./i18n/message.csv");
  2004. const UI = __webpack_require__(/*! ./ui.csv */ "./i18n/ui.csv");
  2005. const Errors = __webpack_require__(/*! ./error.csv */ "./i18n/error.csv");
  2006. const MessagesObj = Messages;
  2007. const UIObj = UI;
  2008. const ErrorsObj = Errors;
  2009. const i18n_data = {};
  2010. for (const key in UIObj) {
  2011. const data = {};
  2012. data['error'] = ErrorsObj[key];
  2013. data['message'] = MessagesObj[key];
  2014. data['ui'] = UIObj[key];
  2015. i18n_data[key] = data;
  2016. }
  2017. exports.default = i18n_data;
  2018. /***/ }),
  2019. /***/ "./i18n/message.csv":
  2020. /*!**************************!*\
  2021. !*** ./i18n/message.csv ***!
  2022. \**************************/
  2023. /*! no static exports found */
  2024. /***/ (function(module, exports) {
  2025. 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":"O caso de teste $0 possui mais entradas do que as leituras feitas no programa.","testcase_autogen_empty":"O caso de teste $0 não gerou qualquer saída.","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 test case $0 has more inputs than output than the number of reads present in the algorithm.","testcase_autogen_empty":"The test case $0 did not generate any output.","success_execution":"Program execution finished!","aborted_execution":"Program execution was aborted!","unexpected_execution_error":"Unexpected error during program execution."},"es":{"test_case_success":" ","test_case_duration":" ","test_suite_grade":" ","awaiting_input_message":" ","assessment-empty-expected-tooltip":" ","assessment-empty-generated-tooltip":" ","testcase_autogen_unused_input":" ","testcase_autogen_empty":" ","success_execution":"","aborted_execution":"","unexpected_execution_error":""}}
  2026. /***/ }),
  2027. /***/ "./i18n/ui.csv":
  2028. /*!*********************!*\
  2029. !*** ./i18n/ui.csv ***!
  2030. \*********************/
  2031. /*! no static exports found */
  2032. /***/ (function(module, exports) {
  2033. module.exports = {"pt":{"function":"funcao","btn_clear":"Limpar","btn_function":"Função","btn_arithmetic_plus":"Adição","btn_arithmetic_minus":"Subtração","btn_arithmetic_multiplication":"Multiplicação","btn_arithmetic_division":"Divisão","btn_arithmetic_module":"Módulo","btn_break":"Pare","btn_case":"Caso","start":"inicio","type_void":"vazio","type_integer":"inteiro","logic_operator_and":"E","logic_operator_or":"OU","logic_operator_not":"nao","type_real":"real","program":"programa","type_text":"cadeia","textvar_default_value":"texto","type_boolean":"logico","logic_value_true":"verdadeiro","logic_value_false":"falso","variable":"Variável","command":"Comando","new_parameter":"parametro","new_variable":"variavel","new_global":"global","new_function":"nova_funcao","matrix":"matriz","vector":"vetor","text_comment_start":"Comentário inicial da função...","text_comment_main":"Esta é a função principal...","text_read_var":"Entrada/Leitura de dados","text_write_var":"Saída/Escrita de dados","text_command_read":"leia","text_command_write":"escreva","text_return":"devolva","text_btn_return":"Devolver","text_comment":"Comentário","string_join_or":"ou","matrix_info_string":"matriz de $0","vector_info_string":"vetor de $0","text_attribution":"Atribuição","text_if":"se","text_break":"pare","text_else":"senao","text_for":"repita_para","text_code_while":"repita_enquanto","text_code_do":"repita","text_code_do_until":"ate_que","text_command_do":"repita","text_command_while":"repita enquanto","text_command_do_until":"até que","text_code_switch":"escolha","text_code_case":"caso","text_config_programming":"Programação","text_config_programming_both":"Visual e textual","text_config_programming_textual":"Textual","text_config_programming_visual":"Visual","text_logic_expression":"Lógicos","text_arithmetic_expression":"Aritméticos","text_iftrue":"Se verdadeiro então","text_message_error_activity_file":"Aconteceu um erro ao processar a atividade. <br> Recarregue a página para tentar novamente.","text_message_error_activity_reload":"Recarregar","text_repeatNtimes":"Repita N vezes","text_receives":"recebe","text_whiletrue":"Enquanto verdadeiro","text_dowhiletrue":"Repita até que verdadeiro","text_switch":"Escolha","text_functioncall":"Chamada de função","text_value":"Valor","text_operator":"Operador","text_parentheses":"Parênteses","text_change":"Alterar","text_teacher_algorithm":"Algoritmo","text_teacher_algorithm_include":"Incluir o algoritmo abaixo no exercício","text_teacher_test_case":"Casos de teste","text_teacher_config":"Configurações","text_teacher_data_types":"Tipos de dados","text_teacher_commands":"Comandos","text_teacher_functions":"Funções","text_teacher_create_functions":"Criar novas funções","text_teacher_create_movement_functions":"Movimentar funções","text_teacher_test_case_input":"Entrada","text_teacher_test_case_output":"Saída","text_teacher_test_case_actions":"Ações","text_teacher_test_case_add":"Adicionar caso de teste","text_header_ivprog_functions":"Funções do iVProg","text_menu_functions_math":"Matemática","text_menu_functions_text":"Texto","text_menu_functions_array":"Arranjo","text_menu_functions_conversion":"Conversão","text_no_variable":"Nenhuma variável declarada","text_no_variable_instruction":"Antes de utilizar uma variável, é necessário criá-la","text_ivprog_description":"Programação Visual interativa na Internet","tooltip_visual":"Programação visual","tooltip_textual":"Programação textual","tooltip_upload":"Upload de código fonte","tooltip_download":"Download do código fonte","tooltip_undo":"Desfazer","tooltip_redo":"Refazer","tooltip_run":"Executar o programa","tooltip_evaluate":"Avaliar o programa","tooltip_help":"Ajuda","tooltip_add_global":"Adicionar variável global","tooltip_hide_function":"Ocultar os elementos da função","var_menu_select_var":"Selecione uma variável","var_menu_select_all":"Selecione","var_menu_select_function":"Selecione uma função","expression_menu_select":"Construir uma expressão lógica","inform_valid_content":"Informe o conteúdo!","inform_valid_expression":"Construa uma expressão lógica!","tooltip_terminal_clear":"Limpa o terminal removendo todos os textos já escritos e os pendentes.","tooltip_terminal_show":"Exibe o terminal caso esteja escondido","tooltip_terminal_hide":"Esconde o terminal caso não esteja escondido","text_ivprog_version":"Versão","text_teacher_filter":"Filtro","text_teacher_filter_active":"Ativado","text_teacher_filter_help":"Ao ativar o filtro, as modificações do iVProg estarão bloqueadas.","text_join_assessment_outputs":" ; ","assessment-detail-time-label":"Duração","assessment-detail-grade-label":"Nota","assessment-detail-input-label":"Entradas","assessment-detail-output-label":"Saídas","assessment-detail-expected-label":"Esperava","assessment-detail-generated-label":"Gerou","assessment-detail-result-label":"Resultado","assessment-detail-title":"Caso de Teste $0","text_teacher_generate_outputs":"Gerar saídas","text_teacher_generate_outputs_algorithm":"Antes de gerar as saídas, elabore um algoritmo!","text_code_for_from":"de","text_code_for_to":"ate","text_code_for_pass":"passo","text_for_from":"de","text_for_to":"até","text_for_pass":"passo","text_relational_expression":"Relacionais","write_command_newline_on":"Quebra de linha ativada","write_command_newline_off":" Quebra de linha desativada","write_seprator_menu_text":"Vírgula","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"},"en":{"function":"function","btn_clear":"Clean","btn_function":"Function","btn_arithmetic_plus":"Addition","btn_arithmetic_minus":"Subtraction","btn_arithmetic_multiplication":"Multiplication","btn_arithmetic_division":"Division","btn_arithmetic_module":"Remainder","btn_break":"break","btn_case":"Case","start":"main","type_void":"void","type_integer":"int","logic_operator_and":"AND","logic_operator_or":"OR","logic_operator_not":"not","type_real":"real","program":"program","type_text":"string","textvar_default_value":"text","type_boolean":"bool","logic_value_true":"true","logic_value_false":"false","variable":"Variable","command":"Command","new_parameter":"parameter","new_variable":"variable","new_global":"global","new_function":"new_function","matrix":"matrix","vector":"vector","text_comment_start":"Function initial comment","text_comment_main":"This is the main funcion","text_read_var":"Input/Read data","text_write_var":"Output/Write data","text_command_read":"read","text_command_write":"write","text_return":"return","text_btn_return":"Return","text_comment":"Comment","string_join_or":"or","matrix_info_string":"matrix of $0","vector_info_string":"vector of $0","text_attribution":"Assignment","text_if":"if","text_break":"break","text_else":"else","text_for":"repeat_for","text_code_while":"repeat_while","text_code_do":"repeat","text_code_do_until":"until","text_command_do":"repeat","text_command_while":"repeat while","text_command_do_until":"until","text_code_switch":"switch","text_code_case":"case","text_config_programming":"Programming","text_config_programming_both":"Visual & Textual","text_config_programming_textual":"Textual","text_config_programming_visual":"Visual","text_logic_expression":"Logic","text_arithmetic_expression":"Arithmetics","text_iftrue":"If true then","text_message_error_activity_file":"There was an error processing the activity.<br> Reload the page to try again.","text_message_error_activity_reload":"Reload","text_repeatNtimes":"Repeat N times","text_receives":"receives","text_whiletrue":"While true","text_dowhiletrue":"Repeat until true","text_switch":"Switch","text_functioncall":"Function call","text_value":"Value","text_operator":"Operator","text_parentheses":"Parentheses","text_change":"Modify","text_teacher_algorithm":"Algorithm","text_teacher_algorithm_include":"Include the algorithm below in the activity","text_teacher_test_case":"Test cases","text_teacher_config":"Configurations","text_teacher_data_types":"Data types","text_teacher_commands":"Commands","text_teacher_functions":"Functions","text_teacher_create_functions":"Create new functions","text_teacher_create_movement_functions":"Move functions","text_teacher_test_case_input":"Input","text_teacher_test_case_output":"Output","text_teacher_test_case_actions":"Actions","text_teacher_test_case_add":"Add test case","text_header_ivprog_functions":"iVProg Functions","text_menu_functions_math":"Math","text_menu_functions_text":"Text","text_menu_functions_array":"Array","text_menu_functions_conversion":"Conversion","text_no_variable":"No variable declared","text_no_variable_instruction":"Before using a variable, you need to create it","text_ivprog_description":"Interactive and Visual Programming on the Internet","tooltip_visual":"Visual programming","tooltip_textual":"Textual programming","tooltip_upload":"Upload source code","tooltip_download":"Download source code","tooltip_undo":"Undo","tooltip_redo":"Redo","tooltip_run":"Run the program","tooltip_evaluate":"Evaluate the program","tooltip_help":"Help","tooltip_add_global":"Add a global variable","tooltip_hide_function":"Hide function elements","var_menu_select_var":"Select a variable","var_menu_select_all":"Select","var_menu_select_function":"Select a function","expression_menu_select":"Construct a logic expression","inform_valid_content":"Provide some data","inform_valid_expression":"Construct a logic expression","tooltip_terminal_clear":"Clears the terminal by removing all wrriten and pending text.","tooltip_terminal_show":"Shows the terminal if it is hidden","tooltip_terminal_hide":"Hides the terminal if it is not on display","text_ivprog_version":"Version","text_teacher_filter":"Filter","text_teacher_filter_active":"Activated","text_teacher_filter_help":"By activating the filter modifications in iVProg will be blocked","text_join_assessment_outputs":" ; ","assessment-detail-time-label":"Duration","assessment-detail-grade-label":"Grade","assessment-detail-input-label":"Inputs","assessment-detail-output-label":"Outputs","assessment-detail-expected-label":"Expected","assessment-detail-generated-label":"Generated","assessment-detail-result-label":"Result","assessment-detail-title":"Test Case $0","text_teacher_generate_outputs":"Generate outputs","text_teacher_generate_outputs_algorithm":"Before generating the outputs you need to create an algorithm","text_code_for_from":"from","text_code_for_to":"to","text_code_for_pass":"pass","text_for_from":"from","text_for_to":"to","text_for_pass":"pass","text_relational_expression":"Relational","write_command_newline_on":" Line break is on","write_command_newline_off":" Line break is off","write_seprator_menu_text":"Comma","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"},"es":{"function":"funccion","btn_clear":"","btn_function":"","btn_arithmetic_plus":"","btn_arithmetic_minus":"","btn_arithmetic_multiplication":"","btn_arithmetic_division":"","btn_arithmetic_module":"","btn_break":"","btn_case":"","start":"","type_void":"","type_integer":"","logic_operator_and":"","logic_operator_or":"","logic_operator_not":"","type_real":"","program":"","type_text":"","textvar_default_value":"","type_boolean":"","logic_value_true":"","logic_value_false":"","variable":"","command":"","new_parameter":"","new_variable":"","new_global":"","new_function":"","matrix":"","vector":"","text_comment_start":"","text_comment_main":"","text_read_var":"","text_write_var":"","text_command_read":"","text_command_write":"","text_return":"","text_btn_return":"","text_comment":"","string_join_or":"","matrix_info_string":"","vector_info_string":"","text_attribution":"","text_if":"","text_break":"","text_else":"","text_for":"","text_code_while":"","text_code_do":"","text_code_do_until":"","text_command_do":"","text_command_while":"","text_command_do_until":"","text_code_switch":"","text_code_case":"","text_config_programming":"","text_config_programming_both":"","text_config_programming_textual":"","text_config_programming_visual":"","text_logic_expression":"","text_arithmetic_expression":"","text_iftrue":"","text_message_error_activity_file":"","text_message_error_activity_reload":"","text_repeatNtimes":"","text_receives":"","text_whiletrue":"","text_dowhiletrue":"","text_switch":"","text_functioncall":"","text_value":"","text_operator":"","text_parentheses":"","text_change":"","text_teacher_algorithm":"","text_teacher_algorithm_include":"","text_teacher_test_case":"","text_teacher_config":"","text_teacher_data_types":"","text_teacher_commands":"","text_teacher_functions":"","text_teacher_create_functions":"","text_teacher_create_movement_functions":"","text_teacher_test_case_input":"","text_teacher_test_case_output":"","text_teacher_test_case_actions":"","text_teacher_test_case_add":"","text_header_ivprog_functions":"","text_menu_functions_math":"","text_menu_functions_text":"","text_menu_functions_array":"","text_menu_functions_conversion":"","text_no_variable":"","text_no_variable_instruction":"","text_ivprog_description":"","tooltip_visual":"","tooltip_textual":"","tooltip_upload":"","tooltip_download":"","tooltip_undo":"","tooltip_redo":"","tooltip_run":"","tooltip_evaluate":"","tooltip_help":"","tooltip_add_global":"","tooltip_hide_function":"","var_menu_select_var":"","var_menu_select_all":"","var_menu_select_function":"","expression_menu_select":"","inform_valid_content":"","inform_valid_expression":"","tooltip_terminal_clear":"","tooltip_terminal_show":"","tooltip_terminal_hide":"","text_ivprog_version":"","text_teacher_filter":"","text_teacher_filter_active":"","text_teacher_filter_help":"","text_join_assessment_outputs":"","assessment-detail-time-label":"","assessment-detail-grade-label":"","assessment-detail-input-label":"","assessment-detail-output-label":"","assessment-detail-expected-label":"","assessment-detail-generated-label":"","assessment-detail-result-label":"","assessment-detail-title":"","text_teacher_generate_outputs":"","text_teacher_generate_outputs_algorithm":"","text_code_for_from":"","text_code_for_to":"","text_code_for_pass":"","text_for_from":"","text_for_to":"","text_for_pass":"","text_relational_expression":"","write_command_newline_on":"","write_command_newline_off":"","write_seprator_menu_text":"","initial_program_code":"","type_char":"","charvar_default_value":"A"}}
  2034. /***/ }),
  2035. /***/ "./js/assessment/ivprogAssessment.js":
  2036. /*!*******************************************!*\
  2037. !*** ./js/assessment/ivprogAssessment.js ***!
  2038. \*******************************************/
  2039. /*! exports provided: IVProgAssessment */
  2040. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2041. "use strict";
  2042. __webpack_require__.r(__webpack_exports__);
  2043. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IVProgAssessment", function() { return IVProgAssessment; });
  2044. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2045. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2046. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2047. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2048. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  2049. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  2050. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../io/domConsole */ "./js/io/domConsole.js");
  2051. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  2052. /* harmony import */ var _output_matching_output_matching__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./output_matching/output_matching */ "./js/assessment/output_matching/output_matching.js");
  2053. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
  2054. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_7__);
  2055. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_5__["getInstance"]();
  2056. var StringTypes = line_i18n__WEBPACK_IMPORTED_MODULE_2__["default"].StringTypes;
  2057. var AssessmentConfig = {
  2058. max_instruction_count: 350250,
  2059. suspend_threshold: 200
  2060. };
  2061. var IVProgAssessment = /*#__PURE__*/function () {
  2062. function IVProgAssessment(ast_code, testCases, domConsole) {
  2063. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IVProgAssessment);
  2064. this.ast_code = ast_code;
  2065. this.testCases = testCases;
  2066. this.domConsole = domConsole;
  2067. this.old_config = JSON.parse(JSON.stringify(_util_config__WEBPACK_IMPORTED_MODULE_7__["Config"]));
  2068. _util_config__WEBPACK_IMPORTED_MODULE_7__["Config"].setConfig(AssessmentConfig);
  2069. }
  2070. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IVProgAssessment, [{
  2071. key: "runTest",
  2072. value: function runTest() {
  2073. var _this = this;
  2074. try {
  2075. // loop test cases and show messages through domconsole
  2076. var partialTests = this.testCases.map(function (t, name) {
  2077. 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);
  2078. });
  2079. var testResult = partialTests.map(function (om) {
  2080. return om.eval();
  2081. });
  2082. return Promise.all(testResult).then(function (results) {
  2083. var grade = 0;
  2084. for (var i = 0; i < results.length; i += 1) {
  2085. var result = results[i];
  2086. grade += result.grade;
  2087. if (result.grade == 1) {
  2088. _this.writeToConsole(_io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].INFO, StringTypes.MESSAGE, 'test_case_success', result.name + 1, result.generateOutput());
  2089. } else if (result.status == 1) {
  2090. _this.writeToConsole(_io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].ERR, StringTypes.ERROR, 'test_case_failed_exception', result.name + 1, result.error_msg, result.generateOutput());
  2091. } else {
  2092. _this.writeToConsole(_io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].ERR, StringTypes.ERROR, 'test_case_failed', result.name + 1, result.generateOutput());
  2093. }
  2094. }
  2095. grade /= results.length;
  2096. var channel = grade == 1 ? _io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].INFO : _io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].ERR;
  2097. _this.writeToConsole(channel, StringTypes.MESSAGE, "test_suite_grade", (grade * 100).toFixed(2));
  2098. return grade;
  2099. }); // return testResult.then(function (total) {
  2100. // const grade = total / this.testCases.length;
  2101. // const channel = grade == 1 ? DOMConsole.INFO : DOMConsole.ERR;
  2102. // this.writeToConsole(channel, StringTypes.MESSAGE, "test_suite_grade", (grade * 100).toFixed(2));
  2103. // return Promise.resolve(grade)
  2104. // }).catch(err => {
  2105. // this.domConsole.err("Erro inesperado durante o cálculo da nota.");// try and show error messages through domconsole
  2106. // this.domConsole.err(err.message);
  2107. // return Promise.resolve(0);
  2108. // });
  2109. } catch (error) {
  2110. this.showErrorMessage(_io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].ERR, StringTypes.MESSAGE, "unexpected_execution_error");
  2111. this.domConsole.err(error.message);
  2112. return Promise.resolve(0);
  2113. } finally {
  2114. _util_config__WEBPACK_IMPORTED_MODULE_7__["Config"].setConfig(this.old_config);
  2115. }
  2116. }
  2117. }, {
  2118. key: "showErrorMessage",
  2119. value: function showErrorMessage(errorID) {
  2120. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  2121. args[_key - 1] = arguments[_key];
  2122. }
  2123. this.domConsole.err(LocalizedStrings.getError(errorID, args));
  2124. }
  2125. }, {
  2126. key: "showInfoMessage",
  2127. value: function showInfoMessage(msgID) {
  2128. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  2129. args[_key2 - 1] = arguments[_key2];
  2130. }
  2131. this.domConsole.info(LocalizedStrings.getMessage(msgID, args));
  2132. }
  2133. }, {
  2134. key: "writeToConsole",
  2135. value: function writeToConsole(channel, msgType, msgID) {
  2136. var msg = LocalizedStrings.getString(msgID, msgType);
  2137. for (var _len3 = arguments.length, args = new Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) {
  2138. args[_key3 - 3] = arguments[_key3];
  2139. }
  2140. msg = LocalizedStrings.processString(msg, args);
  2141. switch (channel) {
  2142. case _io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].ERR:
  2143. {
  2144. this.domConsole.err(msg);
  2145. break;
  2146. }
  2147. case _io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].INFO:
  2148. {
  2149. this.domConsole.info(msg);
  2150. break;
  2151. }
  2152. case _io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].USER:
  2153. {
  2154. this.domConsole.write(msg);
  2155. break;
  2156. }
  2157. }
  2158. }
  2159. }]);
  2160. return IVProgAssessment;
  2161. }();
  2162. /***/ }),
  2163. /***/ "./js/assessment/output_matching/assessment_result.js":
  2164. /*!************************************************************!*\
  2165. !*** ./js/assessment/output_matching/assessment_result.js ***!
  2166. \************************************************************/
  2167. /*! exports provided: OutputAssessmentResult */
  2168. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2169. "use strict";
  2170. __webpack_require__.r(__webpack_exports__);
  2171. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputAssessmentResult", function() { return OutputAssessmentResult; });
  2172. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2173. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2174. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2175. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2176. /* harmony import */ var _util_string_diff__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../util/string_diff */ "./js/util/string_diff.js");
  2177. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  2178. var OutputAssessmentResult = /*#__PURE__*/function () {
  2179. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputAssessmentResult, null, [{
  2180. key: "PAGE_TEMPLATE",
  2181. get: function get() {
  2182. 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>";
  2183. }
  2184. }, {
  2185. key: "DETAIL_TEMPLATE",
  2186. get: function get() {
  2187. 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>";
  2188. }
  2189. }, {
  2190. key: "OUPUT_TABLE_TEMPLATE",
  2191. get: function get() {
  2192. 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>";
  2193. }
  2194. }, {
  2195. key: "OUTPUT_TEMPLATE",
  2196. get: function get() {
  2197. return "<tr><td class=':class-expected:'>$0</td>\n <td class=':class-generated:'>$1</td>\n <td class=':class-result:'>$2</td></tr>";
  2198. }
  2199. }, {
  2200. key: "EMPTY_OUTPUT_TEMPLATE",
  2201. get: function get() {
  2202. return "<div class='assessment-popup'><img class='assessment-empty-output' src='img/empty.svg'>\n <span class='assessment-popuptext'>$0</span></div>";
  2203. }
  2204. }, {
  2205. key: "FAILED_TEMPLATE",
  2206. get: function get() {
  2207. return "<p class='assessment-failed-execution'><span class='assessment-failed-case'>\u2717</span>$0</p>";
  2208. }
  2209. }, {
  2210. key: "INPUT_INFO_TEMPLATE",
  2211. get: function get() {
  2212. return "<span class='$0'>$1</span>";
  2213. } // Status code - it is not grade related!
  2214. // 0 - Succesful execution
  2215. // 1 - failed execution
  2216. }]);
  2217. function OutputAssessmentResult(name, status, inputs, result, store, time) {
  2218. var error_msg = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : '';
  2219. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, OutputAssessmentResult);
  2220. this.name = name;
  2221. this.status = status;
  2222. this.inputs = inputs;
  2223. this.results = result;
  2224. this.store = store;
  2225. this.time = time;
  2226. this.error_msg = error_msg;
  2227. }
  2228. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputAssessmentResult, [{
  2229. key: "prepareResults",
  2230. value: function prepareResults() {
  2231. var _this = this;
  2232. var template = OutputAssessmentResult.DETAIL_TEMPLATE;
  2233. var grade = (this.grade * 100).toFixed(2);
  2234. var time = this.time || "-";
  2235. template = template.replace(':test-name:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-title', [this.name + 1]));
  2236. template = template.replace(':time-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-time-label'));
  2237. template = template.replace(':time:', time);
  2238. template = template.replace(':grade-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-grade-label'));
  2239. template = template.replace(':grade:', grade);
  2240. var input_spans = this.prepareInputList(this.inputs);
  2241. template = template.replace(':input-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-input-label'));
  2242. template = template.replace(':input-list:', input_spans);
  2243. template = template.replace(':output-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-output-label'));
  2244. if (this.status == 0) {
  2245. var output_rows = this.results.map(function (result) {
  2246. if (result.type == "string") {
  2247. return _this.formatString(result);
  2248. } else if (result.type == "number") {
  2249. return _this.formatNumber(result);
  2250. } else {
  2251. return _this.formatBool(result);
  2252. }
  2253. }, this);
  2254. template = template.replace(':output-result:', this.prepareOutputTable(output_rows));
  2255. } else {
  2256. var failed_text = OutputAssessmentResult.FAILED_TEMPLATE;
  2257. failed_text = failed_text.replace("$0", this.error_msg);
  2258. template = template.replace(":output-result:", failed_text);
  2259. }
  2260. return template;
  2261. }
  2262. }, {
  2263. key: "prepareInputList",
  2264. value: function prepareInputList(input_list) {
  2265. var list = input_list.map(function (input) {
  2266. var template = OutputAssessmentResult.INPUT_INFO_TEMPLATE;
  2267. template = template.replace("$1", input.value);
  2268. if (input.read) {
  2269. template = template.replace("$0", "assessment-input-read");
  2270. } else {
  2271. template = template.replace("$0", "assessment-input-unread");
  2272. }
  2273. return template;
  2274. }, this);
  2275. return list.join(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('text_join_assessment_outputs'));
  2276. }
  2277. }, {
  2278. key: "prepareOutputTable",
  2279. value: function prepareOutputTable(output_rows) {
  2280. var template = OutputAssessmentResult.OUPUT_TABLE_TEMPLATE;
  2281. template = template.replace(':expected-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-expected-label'));
  2282. template = template.replace(':generated-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-generated-label'));
  2283. template = template.replace(':result-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-result-label'));
  2284. template = template.replace(':results:', output_rows.join(''));
  2285. return template;
  2286. }
  2287. }, {
  2288. key: "generateOutput",
  2289. value: function generateOutput() {
  2290. var assessment_result = this.prepareResults();
  2291. var page = OutputAssessmentResult.PAGE_TEMPLATE;
  2292. page = page.replace(':assessment-result:', assessment_result);
  2293. page = page.replace(/(\r|\n|\t)/gm, '').replace(/> *</g, '><');
  2294. return page;
  2295. }
  2296. }, {
  2297. key: "formatNumber",
  2298. value: function formatNumber(result) {
  2299. var result_class = result.grade == 1 ? 'assessment-number-result' : 'assessment-number-result-failed';
  2300. var template = this.formatOutput('assessment-number-expected', 'assessment-number-generated', result_class, result);
  2301. return template;
  2302. }
  2303. }, {
  2304. key: "formatBool",
  2305. value: function formatBool(result) {
  2306. var result_class = result.grade == 1 ? 'assessment-bool-result' : 'assessment-bool-result-failed';
  2307. var template = this.formatOutput('assessment-bool-expected', 'assessment-bool-generated', result_class, result);
  2308. return template;
  2309. }
  2310. }, {
  2311. key: "formatOutput",
  2312. value: function formatOutput(expected_class, generated_class, result_class, result) {
  2313. var template = OutputAssessmentResult.OUTPUT_TEMPLATE;
  2314. template = template.replace(":class-expected:", expected_class);
  2315. template = template.replace(":class-generated:", generated_class);
  2316. template = template.replace(":class-result:", result_class);
  2317. var expected_tmpl = result.expected;
  2318. var generated_tmpl = result.generated;
  2319. if (expected_tmpl == null) {
  2320. expected_tmpl = OutputAssessmentResult.EMPTY_OUTPUT_TEMPLATE.replace('$0', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getMessage('assessment-empty-expected-tooltip'));
  2321. } else if (generated_tmpl == null) {
  2322. generated_tmpl = OutputAssessmentResult.EMPTY_OUTPUT_TEMPLATE.replace('$0', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getMessage('assessment-empty-generated-tooltip'));
  2323. }
  2324. template = template.replace("$0", expected_tmpl);
  2325. template = template.replace("$1", generated_tmpl);
  2326. var final_result = result.grade == 1 ? "✓" : "✗";
  2327. template = template.replace("$2", final_result);
  2328. return template;
  2329. }
  2330. }, {
  2331. key: "formatString",
  2332. value: function formatString(result) {
  2333. var _this2 = this;
  2334. var expected_class = 'assessment-string-expected';
  2335. var generated_class = 'assessment-string-generated'; //const result_class = 'assessment-string-result';
  2336. var template = OutputAssessmentResult.OUTPUT_TEMPLATE;
  2337. template = template.replace(":class-expected:", expected_class);
  2338. template = template.replace(":class-generated:", generated_class); //template = template.replace(":class-result:", result_class);
  2339. var g_string = result.generated || "";
  2340. var e_string = result.expected || ""; // console.log("generated: ", g_string,"expected: ", e_string);
  2341. var g_string_tmpl = g_string;
  2342. var e_string_tmpl = e_string;
  2343. if (result.generated == null) {
  2344. g_string_tmpl = OutputAssessmentResult.EMPTY_OUTPUT_TEMPLATE.replace('$0', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getMessage('assessment-empty-generated-tooltip'));
  2345. } else if (result.expected == null) {
  2346. e_string_tmpl = OutputAssessmentResult.EMPTY_OUTPUT_TEMPLATE.replace('$0', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getMessage('assessment-empty-expected-tooltip'));
  2347. }
  2348. template = template.replace("$0", e_string_tmpl);
  2349. template = template.replace("$1", g_string_tmpl);
  2350. if (result.grade == 1) {
  2351. template = template.replace("$2", "✓");
  2352. template = template.replace(":class-result:", 'assessment-string-result');
  2353. } else {
  2354. var diff = Object(_util_string_diff__WEBPACK_IMPORTED_MODULE_2__["default"])(g_string, e_string); // console.log(diff);
  2355. var diff_vec = diff.map(function (part) {
  2356. return _this2.getDiffStringStyle(part[1], part[0]);
  2357. }, this);
  2358. var diff_string = diff_vec.reduce(function (prev, actual) {
  2359. return prev + actual;
  2360. }, "");
  2361. template = template.replace("$2", "<span class='assessment-failed-case'>✗</span>" + diff_string);
  2362. template = template.replace(":class-result:", "assessment-string-diff");
  2363. }
  2364. return template;
  2365. }
  2366. }, {
  2367. key: "getDiffStringStyle",
  2368. value: function getDiffStringStyle(text, action) {
  2369. var template = "<span class='$0'>$1</span>"; // Fix missing whitespace when its a single element
  2370. text = text.replace(/\s/g, "&#160;");
  2371. switch (action) {
  2372. case _util_string_diff__WEBPACK_IMPORTED_MODULE_2__["default"].INSERT:
  2373. return template.replace("$0", "stringdiff-insert").replace("$1", text);
  2374. case _util_string_diff__WEBPACK_IMPORTED_MODULE_2__["default"].DELETE:
  2375. return template.replace("$0", "stringdiff-delete").replace("$1", text);
  2376. case _util_string_diff__WEBPACK_IMPORTED_MODULE_2__["default"].EQUAL:
  2377. return template.replace("$0", "stringdiff-equal").replace("$1", text);
  2378. }
  2379. }
  2380. }, {
  2381. key: "grade",
  2382. get: function get() {
  2383. if (this.results == null) {
  2384. return 0;
  2385. }
  2386. return this.results.reduce(function (prev, val) {
  2387. return prev + val.grade;
  2388. }, 0) / this.results.length;
  2389. }
  2390. }]);
  2391. return OutputAssessmentResult;
  2392. }();
  2393. /***/ }),
  2394. /***/ "./js/assessment/output_matching/output_matching.js":
  2395. /*!**********************************************************!*\
  2396. !*** ./js/assessment/output_matching/output_matching.js ***!
  2397. \**********************************************************/
  2398. /*! exports provided: OutputMatching */
  2399. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2400. "use strict";
  2401. __webpack_require__.r(__webpack_exports__);
  2402. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputMatching", function() { return OutputMatching; });
  2403. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2404. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2405. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2406. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2407. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! decimal.js */ "./node_modules/decimal.js/decimal.js");
  2408. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(decimal_js__WEBPACK_IMPORTED_MODULE_2__);
  2409. /* harmony import */ var _util_input_assessment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/input_assessment */ "./js/util/input_assessment.js");
  2410. /* harmony import */ var _util_outputTest__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/outputTest */ "./js/util/outputTest.js");
  2411. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/config */ "./js/util/config.ts");
  2412. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_5__);
  2413. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/utils */ "./js/util/utils.js");
  2414. /* harmony import */ var _assessment_result__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./assessment_result */ "./js/assessment/output_matching/assessment_result.js");
  2415. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  2416. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  2417. /* harmony import */ var _output_result__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./output_result */ "./js/assessment/output_matching/output_result.js");
  2418. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_9__["getInstance"]();
  2419. var OutputMatching = /*#__PURE__*/function () {
  2420. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputMatching, null, [{
  2421. key: "NUM_REGEX",
  2422. get: function get() {
  2423. return /^[+-]?([0-9]+([.][0-9]*)?(e[+-]?[0-9]+)?)$/;
  2424. }
  2425. }, {
  2426. key: "NUM_IN_STRING_REGEX",
  2427. get: function get() {
  2428. return /[+-]?([0-9]+([.][0-9]*)?(e[+-]?[0-9]+)?)/g;
  2429. }
  2430. }, {
  2431. key: "BOOLEAN_REGEX",
  2432. get: function get() {
  2433. var str = "^(".concat(LocalizedStrings.getUI("logic_value_true"), "|").concat(LocalizedStrings.getUI("logic_value_false"), ")$");
  2434. return new RegExp(str);
  2435. }
  2436. }, {
  2437. key: "BOOLEAN_IN_STRING_REGEX",
  2438. get: function get() {
  2439. var str = "(".concat(LocalizedStrings.getUI("logic_value_true"), "|").concat(LocalizedStrings.getUI("logic_value_false"), ")");
  2440. return new RegExp(str, 'g');
  2441. }
  2442. }]);
  2443. function OutputMatching(program, input_list, expected_output, test_name) {
  2444. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, OutputMatching);
  2445. this.program = program;
  2446. this.name = test_name;
  2447. this.input_list = input_list;
  2448. this.expected_output = expected_output;
  2449. }
  2450. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputMatching, [{
  2451. key: "eval",
  2452. value: function _eval() {
  2453. var _this = this;
  2454. var refThis = this;
  2455. var input = new _util_input_assessment__WEBPACK_IMPORTED_MODULE_3__["InputAssessment"](this.input_list);
  2456. var gen_output = new _util_outputTest__WEBPACK_IMPORTED_MODULE_4__["OutputTest"]();
  2457. this.program.registerInput(input);
  2458. this.program.registerOutput(gen_output);
  2459. var start_time = Date.now();
  2460. return this.program.interpretAST().then(function (sto) {
  2461. var final_time = Date.now() - start_time;
  2462. if (input.isInputAvailable()) {
  2463. 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));
  2464. }
  2465. var result = gen_output.list.map(function (g_out, i) {
  2466. if (i >= _this.expected_output.length) {
  2467. return new _output_result__WEBPACK_IMPORTED_MODULE_10__["OutputMatchResult"](null, g_out, 0, _this.getPotentialOutputType(g_out));
  2468. }
  2469. return _this.outputMatch(g_out, _this.expected_output[i]);
  2470. }, _this);
  2471. if (_this.expected_output.length > gen_output.list.length) {
  2472. console.log("Saída insuficientes!", _this.expected_output.length, gen_output.list.length);
  2473. for (var i = gen_output.list.length; i < _this.expected_output.length; ++i) {
  2474. var e_out = _this.expected_output[i];
  2475. result.push(new _output_result__WEBPACK_IMPORTED_MODULE_10__["OutputMatchResult"](e_out, null, 0, _this.getPotentialOutputType(e_out)));
  2476. }
  2477. } else if (_this.expected_output.length == 0 && _this.expected_output.length == gen_output.list.length) {
  2478. // no output expected....
  2479. result.push(new _output_result__WEBPACK_IMPORTED_MODULE_10__["OutputMatchResult"]("", "", 1, "string"));
  2480. }
  2481. return new _assessment_result__WEBPACK_IMPORTED_MODULE_7__["OutputAssessmentResult"](_this.name, 0, input.input_list, result, sto, final_time);
  2482. })["catch"](function (error) {
  2483. 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));
  2484. });
  2485. }
  2486. }, {
  2487. key: "getPotentialOutputType",
  2488. value: function getPotentialOutputType(output) {
  2489. if (OutputMatching.NUM_REGEX.test(output)) {
  2490. return "number";
  2491. } else if (OutputMatching.BOOLEAN_REGEX.test(output)) {
  2492. return "bool";
  2493. } else {
  2494. return "string";
  2495. }
  2496. }
  2497. }, {
  2498. key: "outputMatch",
  2499. value: function outputMatch(g_output, e_output) {
  2500. if (OutputMatching.NUM_REGEX.test(e_output)) {
  2501. if (!OutputMatching.NUM_REGEX.test(g_output)) {
  2502. return this.checkStrings(g_output, e_output);
  2503. }
  2504. var g_num = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](g_output);
  2505. var e_num = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](e_output);
  2506. return this.checkNumbers(g_num, e_num);
  2507. } else if (OutputMatching.BOOLEAN_REGEX.test(e_output)) {
  2508. if (!OutputMatching.BOOLEAN_REGEX.test(g_output)) {
  2509. return this.checkStrings(g_output, e_output);
  2510. }
  2511. var g_bool = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["toBool"](g_output);
  2512. var e_bool = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["toBool"](e_output);
  2513. return this.checkBoolean(g_bool, e_bool);
  2514. } else {
  2515. return this.checkStrings(g_output, e_output);
  2516. }
  2517. }
  2518. }, {
  2519. key: "checkNumbers",
  2520. value: function checkNumbers(g_num, e_num) {
  2521. var decimalPlaces = Math.min(e_num.dp(), _util_config__WEBPACK_IMPORTED_MODULE_5__["Config"].decimalPlaces);
  2522. g_num = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](g_num.toFixed(decimalPlaces, decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"].ROUND_FLOOR));
  2523. e_num = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](e_num.toFixed(decimalPlaces, decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"].ROUND_FLOOR));
  2524. var result = g_num.eq(e_num);
  2525. var grade = result ? 1 : 0;
  2526. return _output_result__WEBPACK_IMPORTED_MODULE_10__["createNumberResult"](e_num.toNumber(), g_num.toNumber(), grade);
  2527. }
  2528. }, {
  2529. key: "checkBoolean",
  2530. value: function checkBoolean(g_bool, e_bool) {
  2531. var grade = g_bool == e_bool ? 1 : 0;
  2532. var g_bool_text = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["convertBoolToString"](g_bool);
  2533. var e_bool_text = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["convertBoolToString"](e_bool);
  2534. return _output_result__WEBPACK_IMPORTED_MODULE_10__["createBoolResult"](e_bool_text, g_bool_text, grade);
  2535. }
  2536. }, {
  2537. key: "checkStrings",
  2538. value: function checkStrings(g_output, e_ouput) {
  2539. var _this2 = this;
  2540. var assessmentList = [];
  2541. var e_output_clean = e_ouput.trim();
  2542. var g_output_clean = g_output.trim();
  2543. if (OutputMatching.NUM_IN_STRING_REGEX.test(e_ouput)) {
  2544. var expected_numbers = e_ouput.match(OutputMatching.NUM_IN_STRING_REGEX);
  2545. var generated_numbers = g_output.match(OutputMatching.NUM_IN_STRING_REGEX) || [];
  2546. var result = generated_numbers.map(function (val, i) {
  2547. if (i >= expected_numbers.length) {
  2548. return _output_result__WEBPACK_IMPORTED_MODULE_10__["createNumberResult"](null, val, 0);
  2549. }
  2550. var g_val = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](val);
  2551. var e_val = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](expected_numbers[i]);
  2552. return _this2.checkNumbers(g_val, e_val);
  2553. }, this);
  2554. if (expected_numbers.length > generated_numbers.length) {
  2555. for (var i = generated_numbers.length; i < expected_numbers.length; ++i) {
  2556. result.push(_output_result__WEBPACK_IMPORTED_MODULE_10__["createNumberResult"](expected_numbers[i], null, 0));
  2557. }
  2558. }
  2559. e_output_clean = e_output_clean.replace(OutputMatching.NUM_IN_STRING_REGEX, '');
  2560. g_output_clean = g_output_clean.replace(OutputMatching.NUM_IN_STRING_REGEX, '');
  2561. var numberGrade = result.reduce(function (prev, r) {
  2562. return prev + r.grade;
  2563. }, 0) / result.length;
  2564. assessmentList.push(numberGrade);
  2565. }
  2566. if (OutputMatching.BOOLEAN_IN_STRING_REGEX.test(e_ouput)) {
  2567. var expected_bools = e_ouput.match(OutputMatching.BOOLEAN_IN_STRING_REGEX);
  2568. var generated_bools = g_output.match(OutputMatching.BOOLEAN_IN_STRING_REGEX) || [];
  2569. var _result = generated_bools.map(function (val, i) {
  2570. if (i >= expected_bools.length) {
  2571. return _output_result__WEBPACK_IMPORTED_MODULE_10__["createBoolResult"](null, val, 0);
  2572. }
  2573. var g_bool = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["toBool"](val);
  2574. var e_bool = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["toBool"](expected_bools[i]);
  2575. return _this2.checkBoolean(g_bool, e_bool);
  2576. }, this);
  2577. if (expected_bools.length > generated_bools.length) {
  2578. for (var _i = generated_bools.length; _i < expected_bools.length; ++_i) {
  2579. _result.push(_output_result__WEBPACK_IMPORTED_MODULE_10__["createBoolResult"](expected_bools[_i], null, 0));
  2580. }
  2581. }
  2582. e_output_clean = e_output_clean.replace(OutputMatching.BOOLEAN_IN_STRING_REGEX, '');
  2583. g_output_clean = g_output_clean.replace(OutputMatching.BOOLEAN_IN_STRING_REGEX, '');
  2584. var boolGrade = _result.reduce(function (prev, r) {
  2585. return prev + r.grade;
  2586. }, 0) / _result.length;
  2587. assessmentList.push(boolGrade);
  2588. }
  2589. var dist = Object(_util_utils__WEBPACK_IMPORTED_MODULE_6__["levenshteinDistance"])(g_output_clean, e_output_clean);
  2590. var gradeDiff = Math.max(0, e_output_clean.length - dist) / e_output_clean.length;
  2591. gradeDiff = Number.isNaN(gradeDiff) ? 0 : gradeDiff;
  2592. var assessment_size = assessmentList.length + 1;
  2593. var gradeAcc = assessmentList.reduce(function (prev, val) {
  2594. return prev + val / assessment_size;
  2595. }, 0);
  2596. var finalGrade = 1 * (gradeDiff / assessment_size + gradeAcc);
  2597. return _output_result__WEBPACK_IMPORTED_MODULE_10__["createStringResult"](e_ouput, g_output, finalGrade);
  2598. }
  2599. }, {
  2600. key: "getErrorMessage",
  2601. value: function getErrorMessage(errorID) {
  2602. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  2603. args[_key - 1] = arguments[_key];
  2604. }
  2605. return LocalizedStrings.getError(errorID, args);
  2606. }
  2607. }]);
  2608. return OutputMatching;
  2609. }();
  2610. /***/ }),
  2611. /***/ "./js/assessment/output_matching/output_result.js":
  2612. /*!********************************************************!*\
  2613. !*** ./js/assessment/output_matching/output_result.js ***!
  2614. \********************************************************/
  2615. /*! exports provided: createNumberResult, createBoolResult, createStringResult, OutputMatchResult */
  2616. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2617. "use strict";
  2618. __webpack_require__.r(__webpack_exports__);
  2619. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNumberResult", function() { return createNumberResult; });
  2620. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createBoolResult", function() { return createBoolResult; });
  2621. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createStringResult", function() { return createStringResult; });
  2622. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputMatchResult", function() { return OutputMatchResult; });
  2623. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2624. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2625. function createNumberResult(expected, generated, grade) {
  2626. return new OutputMatchResult(expected, generated, grade, "number");
  2627. }
  2628. function createBoolResult(expected, generated, grade) {
  2629. return new OutputMatchResult(expected, generated, grade, "bool");
  2630. }
  2631. function createStringResult(expected, generated, grade) {
  2632. return new OutputMatchResult(expected, generated, grade, "string");
  2633. }
  2634. var OutputMatchResult = function OutputMatchResult(expected, generated, grade, type) {
  2635. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, OutputMatchResult);
  2636. this.expected = expected;
  2637. this.generated = generated;
  2638. this.grade = grade;
  2639. this.type = type;
  2640. };
  2641. /***/ }),
  2642. /***/ "./js/ast/ast_helpers.js":
  2643. /*!*******************************!*\
  2644. !*** ./js/ast/ast_helpers.js ***!
  2645. \*******************************/
  2646. /*! exports provided: recover */
  2647. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2648. "use strict";
  2649. __webpack_require__.r(__webpack_exports__);
  2650. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recover", function() { return recover; });
  2651. /* harmony import */ var _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./error/syntaxErrorFactory */ "./js/ast/error/syntaxErrorFactory.js");
  2652. function recover(_) {
  2653. var start = this._tokenStartCharIndex;
  2654. var stop = this._input.index;
  2655. var text = this._input.getText(start, stop);
  2656. text = this.getErrorDisplay(text);
  2657. var line = this._tokenStartLine;
  2658. var column = this._tokenStartColumn;
  2659. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_0__["SyntaxErrorFactory"].invalid_character(text, line, column);
  2660. }
  2661. /***/ }),
  2662. /***/ "./js/ast/commands/arrayAssign.js":
  2663. /*!****************************************!*\
  2664. !*** ./js/ast/commands/arrayAssign.js ***!
  2665. \****************************************/
  2666. /*! exports provided: ArrayIndexAssign */
  2667. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2668. "use strict";
  2669. __webpack_require__.r(__webpack_exports__);
  2670. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayIndexAssign", function() { return ArrayIndexAssign; });
  2671. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2672. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2673. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2674. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  2675. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2676. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  2677. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2678. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  2679. /* harmony import */ var _assign__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./assign */ "./js/ast/commands/assign.js");
  2680. 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); }; }
  2681. 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; } }
  2682. var ArrayIndexAssign = /*#__PURE__*/function (_Assign) {
  2683. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(ArrayIndexAssign, _Assign);
  2684. var _super = _createSuper(ArrayIndexAssign);
  2685. function ArrayIndexAssign(id, lineExpression, columnExpression, expression) {
  2686. var _this;
  2687. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ArrayIndexAssign);
  2688. _this = _super.call(this, id, expression);
  2689. _this.line = lineExpression;
  2690. _this.column = columnExpression;
  2691. return _this;
  2692. }
  2693. return ArrayIndexAssign;
  2694. }(_assign__WEBPACK_IMPORTED_MODULE_4__["Assign"]);
  2695. /***/ }),
  2696. /***/ "./js/ast/commands/arrayDeclaration.js":
  2697. /*!*********************************************!*\
  2698. !*** ./js/ast/commands/arrayDeclaration.js ***!
  2699. \*********************************************/
  2700. /*! exports provided: ArrayDeclaration */
  2701. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2702. "use strict";
  2703. __webpack_require__.r(__webpack_exports__);
  2704. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayDeclaration", function() { return ArrayDeclaration; });
  2705. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2706. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2707. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2708. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2709. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2710. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  2711. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2712. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  2713. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2714. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  2715. /* harmony import */ var _declaration__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./declaration */ "./js/ast/commands/declaration.js");
  2716. 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); }; }
  2717. 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; } }
  2718. var ArrayDeclaration = /*#__PURE__*/function (_Declaration) {
  2719. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(ArrayDeclaration, _Declaration);
  2720. var _super = _createSuper(ArrayDeclaration);
  2721. function ArrayDeclaration(id, type, lines, columns, initial, isConst) {
  2722. var _this;
  2723. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ArrayDeclaration);
  2724. _this = _super.call(this, id, type, initial, isConst);
  2725. _this.lines = lines;
  2726. _this.columns = columns;
  2727. return _this;
  2728. }
  2729. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ArrayDeclaration, [{
  2730. key: "isVector",
  2731. get: function get() {
  2732. return this.columns == null;
  2733. }
  2734. }]);
  2735. return ArrayDeclaration;
  2736. }(_declaration__WEBPACK_IMPORTED_MODULE_5__["Declaration"]);
  2737. /***/ }),
  2738. /***/ "./js/ast/commands/assign.js":
  2739. /*!***********************************!*\
  2740. !*** ./js/ast/commands/assign.js ***!
  2741. \***********************************/
  2742. /*! exports provided: Assign */
  2743. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2744. "use strict";
  2745. __webpack_require__.r(__webpack_exports__);
  2746. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Assign", function() { return Assign; });
  2747. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2748. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2749. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2750. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  2751. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2752. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  2753. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2754. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  2755. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2756. 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); }; }
  2757. 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; } }
  2758. var Assign = /*#__PURE__*/function (_Command) {
  2759. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Assign, _Command);
  2760. var _super = _createSuper(Assign);
  2761. function Assign(id, expression) {
  2762. var _this;
  2763. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Assign);
  2764. _this = _super.call(this);
  2765. _this.id = id;
  2766. _this.expression = expression;
  2767. return _this;
  2768. }
  2769. return Assign;
  2770. }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
  2771. /***/ }),
  2772. /***/ "./js/ast/commands/break.js":
  2773. /*!**********************************!*\
  2774. !*** ./js/ast/commands/break.js ***!
  2775. \**********************************/
  2776. /*! exports provided: Break */
  2777. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2778. "use strict";
  2779. __webpack_require__.r(__webpack_exports__);
  2780. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Break", function() { return Break; });
  2781. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2782. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2783. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2784. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  2785. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2786. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  2787. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2788. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  2789. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2790. 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); }; }
  2791. 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; } }
  2792. var Break = /*#__PURE__*/function (_Command) {
  2793. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Break, _Command);
  2794. var _super = _createSuper(Break);
  2795. function Break() {
  2796. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Break);
  2797. return _super.call(this);
  2798. }
  2799. return Break;
  2800. }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
  2801. /***/ }),
  2802. /***/ "./js/ast/commands/case.js":
  2803. /*!*********************************!*\
  2804. !*** ./js/ast/commands/case.js ***!
  2805. \*********************************/
  2806. /*! exports provided: Case */
  2807. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2808. "use strict";
  2809. __webpack_require__.r(__webpack_exports__);
  2810. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Case", function() { return Case; });
  2811. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2812. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2813. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2814. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2815. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2816. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  2817. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2818. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  2819. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2820. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  2821. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2822. 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); }; }
  2823. 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; } }
  2824. var Case = /*#__PURE__*/function (_Command) {
  2825. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(Case, _Command);
  2826. var _super = _createSuper(Case);
  2827. function Case(expression) {
  2828. var _this;
  2829. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Case);
  2830. _this = _super.call(this);
  2831. _this.expression = expression;
  2832. /**
  2833. * @type {Command[]}
  2834. */
  2835. _this.commands = [];
  2836. return _this;
  2837. }
  2838. /**
  2839. *
  2840. * @param {Command[]} commands
  2841. */
  2842. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Case, [{
  2843. key: "setCommands",
  2844. value: function setCommands(commands) {
  2845. this.commands = commands;
  2846. }
  2847. }, {
  2848. key: "isDefault",
  2849. get: function get() {
  2850. return this.expression === null;
  2851. }
  2852. }]);
  2853. return Case;
  2854. }(_command__WEBPACK_IMPORTED_MODULE_5__["Command"]);
  2855. /***/ }),
  2856. /***/ "./js/ast/commands/command.js":
  2857. /*!************************************!*\
  2858. !*** ./js/ast/commands/command.js ***!
  2859. \************************************/
  2860. /*! exports provided: Command */
  2861. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2862. "use strict";
  2863. __webpack_require__.r(__webpack_exports__);
  2864. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return Command; });
  2865. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2866. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2867. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2868. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2869. var Command = /*#__PURE__*/function () {
  2870. function Command() {
  2871. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Command);
  2872. this._sourceInfo = null;
  2873. }
  2874. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Command, [{
  2875. key: "sourceInfo",
  2876. set: function set(sourceInfo) {
  2877. this._sourceInfo = sourceInfo;
  2878. },
  2879. get: function get() {
  2880. return this._sourceInfo;
  2881. }
  2882. }]);
  2883. return Command;
  2884. }();
  2885. /***/ }),
  2886. /***/ "./js/ast/commands/commandBlock.js":
  2887. /*!*****************************************!*\
  2888. !*** ./js/ast/commands/commandBlock.js ***!
  2889. \*****************************************/
  2890. /*! exports provided: CommandBlock */
  2891. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2892. "use strict";
  2893. __webpack_require__.r(__webpack_exports__);
  2894. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CommandBlock", function() { return CommandBlock; });
  2895. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2896. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2897. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2898. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2899. var CommandBlock = /*#__PURE__*/function () {
  2900. function CommandBlock(variables, commands) {
  2901. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CommandBlock);
  2902. this.variables = variables;
  2903. this.commands = commands;
  2904. this._sourceInfo = null;
  2905. }
  2906. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(CommandBlock, [{
  2907. key: "sourceInfo",
  2908. set: function set(sourceInfo) {
  2909. this._sourceInfo = sourceInfo;
  2910. },
  2911. get: function get() {
  2912. return this._sourceInfo;
  2913. }
  2914. }]);
  2915. return CommandBlock;
  2916. }();
  2917. /***/ }),
  2918. /***/ "./js/ast/commands/declaration.js":
  2919. /*!****************************************!*\
  2920. !*** ./js/ast/commands/declaration.js ***!
  2921. \****************************************/
  2922. /*! exports provided: Declaration */
  2923. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2924. "use strict";
  2925. __webpack_require__.r(__webpack_exports__);
  2926. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Declaration", function() { return Declaration; });
  2927. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2928. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2929. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2930. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  2931. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2932. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  2933. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2934. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  2935. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2936. 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); }; }
  2937. 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; } }
  2938. var Declaration = /*#__PURE__*/function (_Command) {
  2939. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Declaration, _Command);
  2940. var _super = _createSuper(Declaration);
  2941. function Declaration(id, type, initial, isConst) {
  2942. var _this;
  2943. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Declaration);
  2944. _this = _super.call(this);
  2945. _this.id = id;
  2946. _this.type = type;
  2947. _this.initial = initial;
  2948. _this.isConst = isConst;
  2949. return _this;
  2950. }
  2951. return Declaration;
  2952. }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
  2953. /***/ }),
  2954. /***/ "./js/ast/commands/for.js":
  2955. /*!********************************!*\
  2956. !*** ./js/ast/commands/for.js ***!
  2957. \********************************/
  2958. /*! exports provided: For */
  2959. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2960. "use strict";
  2961. __webpack_require__.r(__webpack_exports__);
  2962. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "For", function() { return For; });
  2963. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  2964. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  2965. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  2966. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  2967. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  2968. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  2969. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  2970. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  2971. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  2972. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  2973. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2974. 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); }; }
  2975. 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; } }
  2976. var For = /*#__PURE__*/function (_Command) {
  2977. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(For, _Command);
  2978. var _super = _createSuper(For);
  2979. function For(for_id, for_from, for_to, for_pass, commandBlock) {
  2980. var _this;
  2981. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, For);
  2982. _this = _super.call(this);
  2983. _this.for_id = for_id;
  2984. _this.for_from = for_from;
  2985. _this.for_to = for_to;
  2986. _this.for_pass = for_pass;
  2987. _this.commandBlock = commandBlock;
  2988. return _this;
  2989. }
  2990. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(For, [{
  2991. key: "commands",
  2992. get: function get() {
  2993. return this.commandBlock.commands;
  2994. }
  2995. }]);
  2996. return For;
  2997. }(_command__WEBPACK_IMPORTED_MODULE_5__["Command"]);
  2998. /***/ }),
  2999. /***/ "./js/ast/commands/formalParameter.js":
  3000. /*!********************************************!*\
  3001. !*** ./js/ast/commands/formalParameter.js ***!
  3002. \********************************************/
  3003. /*! exports provided: FormalParameter */
  3004. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3005. "use strict";
  3006. __webpack_require__.r(__webpack_exports__);
  3007. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormalParameter", function() { return FormalParameter; });
  3008. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3009. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3010. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3011. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3012. var FormalParameter = /*#__PURE__*/function () {
  3013. function FormalParameter(type, id) {
  3014. var byRef = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  3015. var variadic = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  3016. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, FormalParameter);
  3017. this.type = type;
  3018. this.id = id;
  3019. this.byRef = byRef;
  3020. this.variadic = variadic;
  3021. this._sourceInfo = null;
  3022. }
  3023. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(FormalParameter, [{
  3024. key: "sourceInfo",
  3025. set: function set(sourceInfo) {
  3026. this._sourceInfo = sourceInfo;
  3027. },
  3028. get: function get() {
  3029. return this._sourceInfo;
  3030. }
  3031. }]);
  3032. return FormalParameter;
  3033. }();
  3034. /***/ }),
  3035. /***/ "./js/ast/commands/function.js":
  3036. /*!*************************************!*\
  3037. !*** ./js/ast/commands/function.js ***!
  3038. \*************************************/
  3039. /*! exports provided: Function */
  3040. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3041. "use strict";
  3042. __webpack_require__.r(__webpack_exports__);
  3043. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Function", function() { return Function; });
  3044. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3045. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3046. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3047. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3048. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3049. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_2__);
  3050. var Function = /*#__PURE__*/function () {
  3051. /**
  3052. *
  3053. * @param {string} name
  3054. * @param {import('./../../typeSystem/itype').IType} returnType
  3055. * @param {import('./formalParameter').FormalParameter[]} formalParameters
  3056. * @param {import('./commandBlock').CommandBlock} commandBlock
  3057. */
  3058. function Function(name, returnType, formalParameters, commandBlock) {
  3059. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Function);
  3060. this.name = name;
  3061. this.returnType = returnType;
  3062. this.formalParameters = formalParameters;
  3063. this.commandBlock = commandBlock;
  3064. this._sourceInfo = null;
  3065. }
  3066. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Function, [{
  3067. key: "hasVariadic",
  3068. value: function hasVariadic() {
  3069. return this.formalParameters.some(function (p) {
  3070. return p.variadic;
  3071. });
  3072. }
  3073. }, {
  3074. key: "isMain",
  3075. get: function get() {
  3076. return this.name === null && this.returnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_2__["Types"].VOID);
  3077. }
  3078. }, {
  3079. key: "commands",
  3080. get: function get() {
  3081. return this.commandBlock.commands;
  3082. }
  3083. }, {
  3084. key: "variablesDeclarations",
  3085. get: function get() {
  3086. return this.commandBlock.variables;
  3087. }
  3088. }, {
  3089. key: "sourceInfo",
  3090. set: function set(sourceInfo) {
  3091. this._sourceInfo = sourceInfo;
  3092. },
  3093. get: function get() {
  3094. return this._sourceInfo;
  3095. }
  3096. }]);
  3097. return Function;
  3098. }();
  3099. /***/ }),
  3100. /***/ "./js/ast/commands/ifThenElse.js":
  3101. /*!***************************************!*\
  3102. !*** ./js/ast/commands/ifThenElse.js ***!
  3103. \***************************************/
  3104. /*! exports provided: IfThenElse */
  3105. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3106. "use strict";
  3107. __webpack_require__.r(__webpack_exports__);
  3108. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IfThenElse", function() { return IfThenElse; });
  3109. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3110. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3111. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3112. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  3113. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3114. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  3115. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3116. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  3117. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  3118. 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); }; }
  3119. 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; } }
  3120. var IfThenElse = /*#__PURE__*/function (_Command) {
  3121. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(IfThenElse, _Command);
  3122. var _super = _createSuper(IfThenElse);
  3123. function IfThenElse(condition, ifTrue, ifFalse) {
  3124. var _this;
  3125. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IfThenElse);
  3126. _this = _super.call(this);
  3127. _this.condition = condition;
  3128. _this.ifTrue = ifTrue;
  3129. _this.ifFalse = ifFalse;
  3130. return _this;
  3131. }
  3132. return IfThenElse;
  3133. }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
  3134. /***/ }),
  3135. /***/ "./js/ast/commands/index.js":
  3136. /*!**********************************!*\
  3137. !*** ./js/ast/commands/index.js ***!
  3138. \**********************************/
  3139. /*! exports provided: Break, Return, Assign, ArrayIndexAssign, Declaration, ArrayDeclaration, While, For, Function, IfThenElse, CommandBlock, RepeatUntil, Switch, Case, SysCall, FormalParameter, FunctionCall */
  3140. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3141. "use strict";
  3142. __webpack_require__.r(__webpack_exports__);
  3143. /* harmony import */ var _break__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./break */ "./js/ast/commands/break.js");
  3144. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Break", function() { return _break__WEBPACK_IMPORTED_MODULE_0__["Break"]; });
  3145. /* harmony import */ var _return__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./return */ "./js/ast/commands/return.js");
  3146. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Return", function() { return _return__WEBPACK_IMPORTED_MODULE_1__["Return"]; });
  3147. /* harmony import */ var _assign__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./assign */ "./js/ast/commands/assign.js");
  3148. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Assign", function() { return _assign__WEBPACK_IMPORTED_MODULE_2__["Assign"]; });
  3149. /* harmony import */ var _arrayAssign__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./arrayAssign */ "./js/ast/commands/arrayAssign.js");
  3150. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayIndexAssign", function() { return _arrayAssign__WEBPACK_IMPORTED_MODULE_3__["ArrayIndexAssign"]; });
  3151. /* harmony import */ var _declaration__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./declaration */ "./js/ast/commands/declaration.js");
  3152. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Declaration", function() { return _declaration__WEBPACK_IMPORTED_MODULE_4__["Declaration"]; });
  3153. /* harmony import */ var _arrayDeclaration__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./arrayDeclaration */ "./js/ast/commands/arrayDeclaration.js");
  3154. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayDeclaration", function() { return _arrayDeclaration__WEBPACK_IMPORTED_MODULE_5__["ArrayDeclaration"]; });
  3155. /* harmony import */ var _while__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./while */ "./js/ast/commands/while.js");
  3156. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "While", function() { return _while__WEBPACK_IMPORTED_MODULE_6__["While"]; });
  3157. /* harmony import */ var _for__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./for */ "./js/ast/commands/for.js");
  3158. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "For", function() { return _for__WEBPACK_IMPORTED_MODULE_7__["For"]; });
  3159. /* harmony import */ var _function__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./function */ "./js/ast/commands/function.js");
  3160. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Function", function() { return _function__WEBPACK_IMPORTED_MODULE_8__["Function"]; });
  3161. /* harmony import */ var _ifThenElse__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ifThenElse */ "./js/ast/commands/ifThenElse.js");
  3162. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IfThenElse", function() { return _ifThenElse__WEBPACK_IMPORTED_MODULE_9__["IfThenElse"]; });
  3163. /* harmony import */ var _commandBlock__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./commandBlock */ "./js/ast/commands/commandBlock.js");
  3164. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CommandBlock", function() { return _commandBlock__WEBPACK_IMPORTED_MODULE_10__["CommandBlock"]; });
  3165. /* harmony import */ var _repeatUntil__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./repeatUntil */ "./js/ast/commands/repeatUntil.js");
  3166. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RepeatUntil", function() { return _repeatUntil__WEBPACK_IMPORTED_MODULE_11__["RepeatUntil"]; });
  3167. /* harmony import */ var _switch__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./switch */ "./js/ast/commands/switch.js");
  3168. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return _switch__WEBPACK_IMPORTED_MODULE_12__["Switch"]; });
  3169. /* harmony import */ var _case__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./case */ "./js/ast/commands/case.js");
  3170. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Case", function() { return _case__WEBPACK_IMPORTED_MODULE_13__["Case"]; });
  3171. /* harmony import */ var _sysCall__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./sysCall */ "./js/ast/commands/sysCall.js");
  3172. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SysCall", function() { return _sysCall__WEBPACK_IMPORTED_MODULE_14__["SysCall"]; });
  3173. /* harmony import */ var _formalParameter__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./formalParameter */ "./js/ast/commands/formalParameter.js");
  3174. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormalParameter", function() { return _formalParameter__WEBPACK_IMPORTED_MODULE_15__["FormalParameter"]; });
  3175. /* harmony import */ var _expressions_functionCall__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../expressions/functionCall */ "./js/ast/expressions/functionCall.js");
  3176. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return _expressions_functionCall__WEBPACK_IMPORTED_MODULE_16__["FunctionCall"]; });
  3177. //Proxy to expression since they do exatcly the same thing
  3178. /***/ }),
  3179. /***/ "./js/ast/commands/repeatUntil.js":
  3180. /*!****************************************!*\
  3181. !*** ./js/ast/commands/repeatUntil.js ***!
  3182. \****************************************/
  3183. /*! exports provided: RepeatUntil */
  3184. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3185. "use strict";
  3186. __webpack_require__.r(__webpack_exports__);
  3187. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RepeatUntil", function() { return RepeatUntil; });
  3188. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3189. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3190. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3191. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3192. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3193. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3194. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3195. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3196. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3197. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3198. /* harmony import */ var _while__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./while */ "./js/ast/commands/while.js");
  3199. 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); }; }
  3200. 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; } }
  3201. var RepeatUntil = /*#__PURE__*/function (_While) {
  3202. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(RepeatUntil, _While);
  3203. var _super = _createSuper(RepeatUntil);
  3204. function RepeatUntil(condition, commandBlock) {
  3205. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, RepeatUntil);
  3206. return _super.call(this, condition, commandBlock);
  3207. }
  3208. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(RepeatUntil, [{
  3209. key: "testFirst",
  3210. get: function get() {
  3211. return false;
  3212. }
  3213. }]);
  3214. return RepeatUntil;
  3215. }(_while__WEBPACK_IMPORTED_MODULE_5__["While"]);
  3216. /***/ }),
  3217. /***/ "./js/ast/commands/return.js":
  3218. /*!***********************************!*\
  3219. !*** ./js/ast/commands/return.js ***!
  3220. \***********************************/
  3221. /*! exports provided: Return */
  3222. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3223. "use strict";
  3224. __webpack_require__.r(__webpack_exports__);
  3225. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Return", function() { return Return; });
  3226. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3227. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3228. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3229. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  3230. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3231. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  3232. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3233. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  3234. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  3235. 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); }; }
  3236. 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; } }
  3237. var Return = /*#__PURE__*/function (_Command) {
  3238. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Return, _Command);
  3239. var _super = _createSuper(Return);
  3240. function Return(expression) {
  3241. var _this;
  3242. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Return);
  3243. _this = _super.call(this);
  3244. _this.expression = expression;
  3245. return _this;
  3246. }
  3247. return Return;
  3248. }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
  3249. /***/ }),
  3250. /***/ "./js/ast/commands/switch.js":
  3251. /*!***********************************!*\
  3252. !*** ./js/ast/commands/switch.js ***!
  3253. \***********************************/
  3254. /*! exports provided: Switch */
  3255. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3256. "use strict";
  3257. __webpack_require__.r(__webpack_exports__);
  3258. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return Switch; });
  3259. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3260. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3261. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3262. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  3263. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3264. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  3265. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3266. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  3267. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  3268. /* harmony import */ var _expressions_expression__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../expressions/expression */ "./js/ast/expressions/expression.js");
  3269. /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! . */ "./js/ast/commands/index.js");
  3270. 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); }; }
  3271. 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; } }
  3272. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  3273. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  3274. var Switch = /*#__PURE__*/function (_Command) {
  3275. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Switch, _Command);
  3276. var _super = _createSuper(Switch);
  3277. /**
  3278. *
  3279. * @param {Expression} expression
  3280. * @param {Case[]} cases
  3281. */
  3282. function Switch(expression, cases) {
  3283. var _this;
  3284. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Switch);
  3285. _this = _super.call(this);
  3286. _this.expression = expression;
  3287. _this.cases = cases;
  3288. return _this;
  3289. }
  3290. return Switch;
  3291. }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
  3292. /***/ }),
  3293. /***/ "./js/ast/commands/sysCall.js":
  3294. /*!************************************!*\
  3295. !*** ./js/ast/commands/sysCall.js ***!
  3296. \************************************/
  3297. /*! exports provided: SysCall */
  3298. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3299. "use strict";
  3300. __webpack_require__.r(__webpack_exports__);
  3301. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SysCall", function() { return SysCall; });
  3302. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3303. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3304. /**
  3305. * This class represents all the language defined functions.
  3306. * The language processor uses the id provided here to properly execute the desired function.
  3307. * The function is actually implemented inside the language processor.
  3308. * All the functions can be found at: js/processor/definedFunctions.js
  3309. */
  3310. var SysCall = function SysCall(langFunc) {
  3311. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SysCall);
  3312. this.langFunc = langFunc;
  3313. };
  3314. /***/ }),
  3315. /***/ "./js/ast/commands/while.js":
  3316. /*!**********************************!*\
  3317. !*** ./js/ast/commands/while.js ***!
  3318. \**********************************/
  3319. /*! exports provided: While */
  3320. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3321. "use strict";
  3322. __webpack_require__.r(__webpack_exports__);
  3323. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "While", function() { return While; });
  3324. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3325. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3326. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3327. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3328. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3329. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3330. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3331. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3332. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3333. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3334. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  3335. 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); }; }
  3336. 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; } }
  3337. var While = /*#__PURE__*/function (_Command) {
  3338. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(While, _Command);
  3339. var _super = _createSuper(While);
  3340. function While(expression, commandBlock) {
  3341. var _this;
  3342. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, While);
  3343. _this = _super.call(this);
  3344. _this.expression = expression;
  3345. _this.commandBlock = commandBlock;
  3346. return _this;
  3347. }
  3348. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(While, [{
  3349. key: "commands",
  3350. get: function get() {
  3351. return this.commandBlock.commands;
  3352. }
  3353. }, {
  3354. key: "testFirst",
  3355. get: function get() {
  3356. return true;
  3357. }
  3358. }]);
  3359. return While;
  3360. }(_command__WEBPACK_IMPORTED_MODULE_5__["Command"]);
  3361. /***/ }),
  3362. /***/ "./js/ast/error/syntaxError.js":
  3363. /*!*************************************!*\
  3364. !*** ./js/ast/error/syntaxError.js ***!
  3365. \*************************************/
  3366. /*! exports provided: SyntaxError */
  3367. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3368. "use strict";
  3369. __webpack_require__.r(__webpack_exports__);
  3370. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SyntaxError", function() { return SyntaxError; });
  3371. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3372. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3373. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
  3374. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__);
  3375. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3376. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3377. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3378. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3379. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3380. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3381. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "./node_modules/@babel/runtime/helpers/wrapNativeSuper.js");
  3382. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__);
  3383. 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); }; }
  3384. 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; } }
  3385. var SyntaxError = /*#__PURE__*/function (_Error) {
  3386. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(SyntaxError, _Error);
  3387. var _super = _createSuper(SyntaxError);
  3388. function SyntaxError() {
  3389. var _this;
  3390. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SyntaxError);
  3391. for (var _len = arguments.length, msg = new Array(_len), _key = 0; _key < _len; _key++) {
  3392. msg[_key] = arguments[_key];
  3393. }
  3394. _this = _super.call.apply(_super, [this].concat(msg));
  3395. if (Error.captureStackTrace) Error.captureStackTrace(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default()(_this), SyntaxError);
  3396. return _this;
  3397. }
  3398. return SyntaxError;
  3399. }( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default()(Error));
  3400. /***/ }),
  3401. /***/ "./js/ast/error/syntaxErrorFactory.js":
  3402. /*!********************************************!*\
  3403. !*** ./js/ast/error/syntaxErrorFactory.js ***!
  3404. \********************************************/
  3405. /*! exports provided: SyntaxErrorFactory */
  3406. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3407. "use strict";
  3408. __webpack_require__.r(__webpack_exports__);
  3409. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SyntaxErrorFactory", function() { return SyntaxErrorFactory; });
  3410. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  3411. /* harmony import */ var _syntaxError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./syntaxError */ "./js/ast/error/syntaxError.js");
  3412. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["getInstance"]();
  3413. function createError(message_id) {
  3414. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  3415. return new _syntaxError__WEBPACK_IMPORTED_MODULE_1__["SyntaxError"](LocalizedStrings.getError(message_id, context));
  3416. }
  3417. var SyntaxErrorFactory = Object.freeze({
  3418. extra_lines: function extra_lines() {
  3419. return new _syntaxError__WEBPACK_IMPORTED_MODULE_1__["SyntaxError"](LocalizedStrings.getError("extra_lines"));
  3420. },
  3421. token_missing_one: function token_missing_one(expected, token) {
  3422. var context = [expected, token.text, token.line, token.column];
  3423. return createError("token_missing_one", context);
  3424. },
  3425. token_missing_list: function token_missing_list(expectedList, token) {
  3426. var line = expectedList.join(LocalizedStrings.getOR());
  3427. return SyntaxErrorFactory.token_missing_one(line, token);
  3428. },
  3429. id_missing: function id_missing(token) {
  3430. var context = [token.text, token.line, token.column];
  3431. return createError("id_missing", context);
  3432. },
  3433. eos_missing: function eos_missing(token) {
  3434. var context = [token.line, token.column];
  3435. return createError("eos_missing", context);
  3436. },
  3437. invalid_array_dimension: function invalid_array_dimension(typeName, token) {
  3438. var context = [token.line, token.column, typeName];
  3439. return createError("invalid_array_dimension", context);
  3440. },
  3441. invalid_array_size: function invalid_array_size(token) {
  3442. var context = [token.line];
  3443. return createError("invalid_array_size", context);
  3444. },
  3445. invalid_main_return: function invalid_main_return(name, typeName, token) {
  3446. var context = [name, typeName, token.line];
  3447. return createError("invalid_main_return", context);
  3448. },
  3449. invalid_var_declaration: function invalid_var_declaration(token) {
  3450. var context = [token.line];
  3451. return createError("invalid_var_declaration", context);
  3452. },
  3453. invalid_break_command: function invalid_break_command(cmdName, token) {
  3454. var context = [token.line, cmdName];
  3455. return createError("invalid_break_command", context);
  3456. },
  3457. invalid_terminal: function invalid_terminal(token) {
  3458. var context = [token.text, token.line, token.column];
  3459. return createError('invalid_terminal', context);
  3460. },
  3461. invalid_type: function invalid_type(list, token) {
  3462. var line = list.join(LocalizedStrings.getOR());
  3463. var context = [token.text, token.line, token.column, line];
  3464. return createError("invalid_type", context);
  3465. },
  3466. const_not_init: function const_not_init(token) {
  3467. var context = [token.line, token.column];
  3468. return createError("const_not_init", context);
  3469. },
  3470. invalid_id_format: function invalid_id_format(token) {
  3471. var context = [token.text, token.line, token.column];
  3472. return createError("invalid_id_format", context);
  3473. },
  3474. duplicate_function: function duplicate_function(token) {
  3475. var context = [token.text, token.line, token.column];
  3476. return createError("duplicate_function", context);
  3477. },
  3478. main_parameters: function main_parameters() {
  3479. return createError("main_parameters");
  3480. },
  3481. duplicate_variable: function duplicate_variable(token) {
  3482. var context = [token.text, token.line, token.column];
  3483. return createError("duplicate_variable", context);
  3484. },
  3485. invalid_character: function invalid_character(text, line, _column) {
  3486. var context = [text, line];
  3487. return createError("invalid_character", context);
  3488. },
  3489. annonymous_array_literal: function annonymous_array_literal(token) {
  3490. var context = [token.line];
  3491. return createError("annonymous_array_literal", context);
  3492. },
  3493. invalid_matrix_literal_line: function invalid_matrix_literal_line(exp, sourceInfo) {
  3494. var context = [exp, sourceInfo.line];
  3495. return createError("invalid_matrix_literal_line", context);
  3496. },
  3497. cannot_infer_matrix_line: function cannot_infer_matrix_line(name, sourceInfo) {
  3498. var context = [name, sourceInfo.line];
  3499. return createError("cannot_infer_matrix_line", context);
  3500. },
  3501. cannot_infer_matrix_column: function cannot_infer_matrix_column(name, sourceInfo) {
  3502. var context = [name, sourceInfo.line];
  3503. return createError("cannot_infer_matrix_column", context);
  3504. },
  3505. cannot_infer_vector_size: function cannot_infer_vector_size(name, sourceInfo) {
  3506. var context = [name, sourceInfo.line];
  3507. return createError("cannot_infer_vector_size", context);
  3508. },
  3509. matrix_to_vector_literal_attr: function matrix_to_vector_literal_attr(name, exp, sourceInfo) {
  3510. var context = [sourceInfo.line, exp, name];
  3511. return createError("matrix_to_vector_literal_attr", context);
  3512. },
  3513. vector_to_matrix_literal_attr: function vector_to_matrix_literal_attr(name, exp, sourceInfo) {
  3514. var context = [sourceInfo.line, exp, name];
  3515. return createError("vector_to_matrix_literal_attr", context);
  3516. },
  3517. array_init_not_literal: function array_init_not_literal(sourceInfo) {
  3518. var context = [sourceInfo.line];
  3519. return createError("array_init_not_literal", context);
  3520. },
  3521. array_exceeds_2d: function array_exceeds_2d(sourceInfo) {
  3522. var context = [sourceInfo.line];
  3523. return createError("array_exceeds_2d", context);
  3524. },
  3525. invalid_matrix_id_dimension: function invalid_matrix_id_dimension(sourceInfo) {
  3526. var context = [sourceInfo.line];
  3527. return createError("invalid_matrix_id_dimension", context);
  3528. },
  3529. invalid_vector_init: function invalid_vector_init(sourceInfo) {
  3530. var context = [sourceInfo.line];
  3531. return createError("invalid_vector_init", context);
  3532. },
  3533. invalid_matrix_init: function invalid_matrix_init(sourceInfo) {
  3534. var context = [sourceInfo.line];
  3535. return createError("invalid_matrix_init", context);
  3536. }
  3537. });
  3538. /***/ }),
  3539. /***/ "./js/ast/expressions/arrayAccess.js":
  3540. /*!*******************************************!*\
  3541. !*** ./js/ast/expressions/arrayAccess.js ***!
  3542. \*******************************************/
  3543. /*! exports provided: ArrayAccess */
  3544. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3545. "use strict";
  3546. __webpack_require__.r(__webpack_exports__);
  3547. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayAccess", function() { return ArrayAccess; });
  3548. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3549. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3550. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3551. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3552. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3553. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3554. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3555. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3556. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3557. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3558. /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
  3559. 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); }; }
  3560. 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; } }
  3561. var ArrayAccess = /*#__PURE__*/function (_Expression) {
  3562. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(ArrayAccess, _Expression);
  3563. var _super = _createSuper(ArrayAccess);
  3564. function ArrayAccess(id, line, column) {
  3565. var _this;
  3566. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ArrayAccess);
  3567. _this = _super.call(this);
  3568. _this.id = id;
  3569. _this.line = line;
  3570. _this.column = column;
  3571. return _this;
  3572. }
  3573. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ArrayAccess, [{
  3574. key: "toString",
  3575. value: function toString() {
  3576. var strLine = this.line.toString();
  3577. var strColumn = null;
  3578. if (this.column) {
  3579. strColumn = this.column.toString();
  3580. }
  3581. var text = null;
  3582. if (strColumn) {
  3583. text = "".concat(this.id, "[").concat(strLine, "][").concat(strColumn, "]");
  3584. } else {
  3585. text = "".concat(this.id, "[").concat(strLine, "]");
  3586. }
  3587. if (this.parenthesis) {
  3588. return "(".concat(text, ")");
  3589. } else {
  3590. return text;
  3591. }
  3592. }
  3593. }]);
  3594. return ArrayAccess;
  3595. }(_expression__WEBPACK_IMPORTED_MODULE_5__["Expression"]);
  3596. /***/ }),
  3597. /***/ "./js/ast/expressions/arrayLiteral.js":
  3598. /*!********************************************!*\
  3599. !*** ./js/ast/expressions/arrayLiteral.js ***!
  3600. \********************************************/
  3601. /*! exports provided: ArrayLiteral */
  3602. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3603. "use strict";
  3604. __webpack_require__.r(__webpack_exports__);
  3605. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayLiteral", function() { return ArrayLiteral; });
  3606. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3607. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3608. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3609. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3610. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3611. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3612. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3613. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3614. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3615. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3616. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3617. 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); }; }
  3618. 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; } }
  3619. var ArrayLiteral = /*#__PURE__*/function (_Literal) {
  3620. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(ArrayLiteral, _Literal);
  3621. var _super = _createSuper(ArrayLiteral);
  3622. /**
  3623. *
  3624. * @param {import('../../typeSystem/itype').IType} type
  3625. * @param {import('./expression').Expression[]} value
  3626. */
  3627. function ArrayLiteral(type, value) {
  3628. var _this;
  3629. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ArrayLiteral);
  3630. _this = _super.call(this, type);
  3631. _this.value = value;
  3632. return _this;
  3633. }
  3634. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ArrayLiteral, [{
  3635. key: "validateType",
  3636. value: function validateType() {
  3637. var valid = true; // const subtype = this.subtype;
  3638. // if(this.columns !== null) {
  3639. // const len = this.lines;
  3640. // const len2 = this.columns;
  3641. // for (let i = len - 1; i >= 0 && valid; --i) {
  3642. // for (let j = len2 - 1; j >= 0 && valid; --j) {
  3643. // if(!this.value[i].value[j].type.isCompatilbe(subtype)) {
  3644. // valid = false;
  3645. // break;
  3646. // }
  3647. // }
  3648. // }
  3649. // } else {
  3650. // const len = this.lines;
  3651. // for (var i = len - 1; i >= 0 && valid; i--) {
  3652. // if(!this.value[i].type.isCompatilbe(subtype)) {
  3653. // valid = false;
  3654. // break;
  3655. // }
  3656. // }
  3657. // }
  3658. // Cannot validate type since no information on variables literals are available
  3659. return valid;
  3660. }
  3661. }, {
  3662. key: "validateSize",
  3663. value: function validateSize() {
  3664. var valid = true; // if(this.columns !== null) {
  3665. // const equalityTest = this.value.map(v => v.value.length)
  3666. // .reduce((old, next) => {
  3667. // console.log(next);
  3668. // if (old == null) {
  3669. // return next;
  3670. // } else if (old === next) {
  3671. // return old
  3672. // } else {
  3673. // return -1;
  3674. // }
  3675. // }, null);
  3676. // valid = equalityTest !== -1;
  3677. // }
  3678. // check is now made inside IVProgParser.parseVectorList(...)
  3679. return valid;
  3680. }
  3681. }, {
  3682. key: "toString",
  3683. value: function toString() {
  3684. var strList = this.value.map(function (arrayLiteral) {
  3685. return arrayLiteral.toString();
  3686. });
  3687. var text = "{" + strList.join(',') + "}";
  3688. if (this.parenthesis) {
  3689. return "(".concat(text, ")");
  3690. } else {
  3691. return text;
  3692. }
  3693. }
  3694. }, {
  3695. key: "subtype",
  3696. get: function get() {
  3697. var element = this.value[0];
  3698. if (element instanceof ArrayLiteral) {
  3699. return element.value[0].type;
  3700. } else {
  3701. return element.type;
  3702. }
  3703. }
  3704. }, {
  3705. key: "lines",
  3706. get: function get() {
  3707. return this.value.length;
  3708. }
  3709. }, {
  3710. key: "columns",
  3711. get: function get() {
  3712. var element = this.value[0];
  3713. if (!(element instanceof ArrayLiteral)) {
  3714. return null;
  3715. } else {
  3716. return element.value.length;
  3717. }
  3718. }
  3719. }, {
  3720. key: "isVector",
  3721. get: function get() {
  3722. return this.columns === null;
  3723. }
  3724. }, {
  3725. key: "isValid",
  3726. get: function get() {
  3727. return this.validateSize() && this.validateType();
  3728. }
  3729. }]);
  3730. return ArrayLiteral;
  3731. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3732. /***/ }),
  3733. /***/ "./js/ast/expressions/boolLiteral.js":
  3734. /*!*******************************************!*\
  3735. !*** ./js/ast/expressions/boolLiteral.js ***!
  3736. \*******************************************/
  3737. /*! exports provided: BoolLiteral */
  3738. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3739. "use strict";
  3740. __webpack_require__.r(__webpack_exports__);
  3741. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BoolLiteral", function() { return BoolLiteral; });
  3742. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3743. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3744. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3745. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3746. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3747. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3748. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3749. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3750. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3751. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3752. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3753. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3754. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  3755. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  3756. 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); }; }
  3757. 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; } }
  3758. var BoolLiteral = /*#__PURE__*/function (_Literal) {
  3759. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(BoolLiteral, _Literal);
  3760. var _super = _createSuper(BoolLiteral);
  3761. function BoolLiteral(value) {
  3762. var _this;
  3763. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, BoolLiteral);
  3764. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].BOOLEAN);
  3765. _this.value = value;
  3766. return _this;
  3767. }
  3768. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(BoolLiteral, [{
  3769. key: "toString",
  3770. value: function toString() {
  3771. var text = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__["convertBoolToString"])(this.value);
  3772. if (this.parenthesis) {
  3773. return "(".concat(text, ")");
  3774. } else {
  3775. return text;
  3776. }
  3777. }
  3778. }]);
  3779. return BoolLiteral;
  3780. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3781. /***/ }),
  3782. /***/ "./js/ast/expressions/charLiteral.js":
  3783. /*!*******************************************!*\
  3784. !*** ./js/ast/expressions/charLiteral.js ***!
  3785. \*******************************************/
  3786. /*! exports provided: CharLiteral */
  3787. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3788. "use strict";
  3789. __webpack_require__.r(__webpack_exports__);
  3790. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharLiteral", function() { return CharLiteral; });
  3791. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3792. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3793. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3794. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3795. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3796. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3797. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3798. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3799. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3800. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3801. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3802. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3803. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  3804. 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); }; }
  3805. 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; } }
  3806. var CharLiteral = /*#__PURE__*/function (_Literal) {
  3807. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(CharLiteral, _Literal);
  3808. var _super = _createSuper(CharLiteral);
  3809. function CharLiteral(value) {
  3810. var _this;
  3811. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CharLiteral);
  3812. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].CHAR);
  3813. _this.value = value;
  3814. return _this;
  3815. }
  3816. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(CharLiteral, [{
  3817. key: "toString",
  3818. value: function toString() {
  3819. var text = "'".concat(this.value, "'");
  3820. if (this.parenthesis) {
  3821. return "(".concat(text, ")");
  3822. } else {
  3823. return text;
  3824. }
  3825. }
  3826. }]);
  3827. return CharLiteral;
  3828. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  3829. /***/ }),
  3830. /***/ "./js/ast/expressions/expression.js":
  3831. /*!******************************************!*\
  3832. !*** ./js/ast/expressions/expression.js ***!
  3833. \******************************************/
  3834. /*! exports provided: Expression */
  3835. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3836. "use strict";
  3837. __webpack_require__.r(__webpack_exports__);
  3838. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Expression", function() { return Expression; });
  3839. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3840. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3841. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3842. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3843. var Expression = /*#__PURE__*/function () {
  3844. function Expression() {
  3845. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Expression);
  3846. this._sourceInfo = null;
  3847. this._parenthesis = false;
  3848. }
  3849. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Expression, [{
  3850. key: "sourceInfo",
  3851. set: function set(sourceInfo) {
  3852. this._sourceInfo = sourceInfo;
  3853. },
  3854. get: function get() {
  3855. return this._sourceInfo;
  3856. }
  3857. }, {
  3858. key: "parenthesis",
  3859. set: function set(flag) {
  3860. this._parenthesis = flag;
  3861. },
  3862. get: function get() {
  3863. return this._parenthesis;
  3864. }
  3865. }]);
  3866. return Expression;
  3867. }();
  3868. /***/ }),
  3869. /***/ "./js/ast/expressions/functionCall.js":
  3870. /*!********************************************!*\
  3871. !*** ./js/ast/expressions/functionCall.js ***!
  3872. \********************************************/
  3873. /*! exports provided: FunctionCall */
  3874. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3875. "use strict";
  3876. __webpack_require__.r(__webpack_exports__);
  3877. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return FunctionCall; });
  3878. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3879. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3880. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3881. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3882. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3883. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3884. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3885. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3886. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3887. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3888. /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
  3889. /* harmony import */ var _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../processor/definedFunctions */ "./js/processor/definedFunctions.js");
  3890. 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); }; }
  3891. 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; } }
  3892. var FunctionCall = /*#__PURE__*/function (_Expression) {
  3893. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(FunctionCall, _Expression);
  3894. var _super = _createSuper(FunctionCall);
  3895. /**
  3896. *
  3897. * @param {string} id
  3898. * @param {Expression[]} actualParameters
  3899. */
  3900. function FunctionCall(id, actualParameters) {
  3901. var _this;
  3902. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, FunctionCall);
  3903. _this = _super.call(this);
  3904. _this.id = id;
  3905. _this.actualParameters = actualParameters;
  3906. return _this;
  3907. }
  3908. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(FunctionCall, [{
  3909. key: "toString",
  3910. value: function toString() {
  3911. var name = null;
  3912. if (this.isMainCall) {
  3913. name = _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_6__["LanguageDefinedFunction"].getMainFunctionName();
  3914. } else {
  3915. name = _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_6__["LanguageDefinedFunction"].getLocalName(this.id);
  3916. }
  3917. var params = null;
  3918. if (this.actualParameters.length == 0) {
  3919. params = "()";
  3920. } else {
  3921. var strParams = this.actualParameters.map(function (v) {
  3922. return v.toString();
  3923. });
  3924. params = "(" + strParams.join(",") + ")";
  3925. }
  3926. if (this.parenthesis) {
  3927. return "(".concat(name + params, ")");
  3928. } else {
  3929. return name + params;
  3930. }
  3931. }
  3932. }, {
  3933. key: "isMainCall",
  3934. get: function get() {
  3935. return this.id === null;
  3936. }
  3937. }, {
  3938. key: "parametersSize",
  3939. get: function get() {
  3940. return this.actualParameters.length;
  3941. }
  3942. }]);
  3943. return FunctionCall;
  3944. }(_expression__WEBPACK_IMPORTED_MODULE_5__["Expression"]);
  3945. /***/ }),
  3946. /***/ "./js/ast/expressions/index.js":
  3947. /*!*************************************!*\
  3948. !*** ./js/ast/expressions/index.js ***!
  3949. \*************************************/
  3950. /*! exports provided: ArrayAccess, FunctionCall, IntLiteral, RealLiteral, BoolLiteral, CharLiteral, StringLiteral, ArrayLiteral, VariableLiteral, InfixApp, UnaryApp */
  3951. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3952. "use strict";
  3953. __webpack_require__.r(__webpack_exports__);
  3954. /* harmony import */ var _arrayAccess__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayAccess */ "./js/ast/expressions/arrayAccess.js");
  3955. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayAccess", function() { return _arrayAccess__WEBPACK_IMPORTED_MODULE_0__["ArrayAccess"]; });
  3956. /* harmony import */ var _functionCall__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functionCall */ "./js/ast/expressions/functionCall.js");
  3957. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return _functionCall__WEBPACK_IMPORTED_MODULE_1__["FunctionCall"]; });
  3958. /* harmony import */ var _intLiteral__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./intLiteral */ "./js/ast/expressions/intLiteral.js");
  3959. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IntLiteral", function() { return _intLiteral__WEBPACK_IMPORTED_MODULE_2__["IntLiteral"]; });
  3960. /* harmony import */ var _realLiteral__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./realLiteral */ "./js/ast/expressions/realLiteral.js");
  3961. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RealLiteral", function() { return _realLiteral__WEBPACK_IMPORTED_MODULE_3__["RealLiteral"]; });
  3962. /* harmony import */ var _boolLiteral__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./boolLiteral */ "./js/ast/expressions/boolLiteral.js");
  3963. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BoolLiteral", function() { return _boolLiteral__WEBPACK_IMPORTED_MODULE_4__["BoolLiteral"]; });
  3964. /* harmony import */ var _charLiteral__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./charLiteral */ "./js/ast/expressions/charLiteral.js");
  3965. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CharLiteral", function() { return _charLiteral__WEBPACK_IMPORTED_MODULE_5__["CharLiteral"]; });
  3966. /* harmony import */ var _stringLiteral__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./stringLiteral */ "./js/ast/expressions/stringLiteral.js");
  3967. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StringLiteral", function() { return _stringLiteral__WEBPACK_IMPORTED_MODULE_6__["StringLiteral"]; });
  3968. /* harmony import */ var _arrayLiteral__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./arrayLiteral */ "./js/ast/expressions/arrayLiteral.js");
  3969. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayLiteral", function() { return _arrayLiteral__WEBPACK_IMPORTED_MODULE_7__["ArrayLiteral"]; });
  3970. /* harmony import */ var _variableLiteral__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./variableLiteral */ "./js/ast/expressions/variableLiteral.js");
  3971. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VariableLiteral", function() { return _variableLiteral__WEBPACK_IMPORTED_MODULE_8__["VariableLiteral"]; });
  3972. /* harmony import */ var _infixApp__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./infixApp */ "./js/ast/expressions/infixApp.js");
  3973. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InfixApp", function() { return _infixApp__WEBPACK_IMPORTED_MODULE_9__["InfixApp"]; });
  3974. /* harmony import */ var _unaryApp__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./unaryApp */ "./js/ast/expressions/unaryApp.js");
  3975. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UnaryApp", function() { return _unaryApp__WEBPACK_IMPORTED_MODULE_10__["UnaryApp"]; });
  3976. /***/ }),
  3977. /***/ "./js/ast/expressions/infixApp.js":
  3978. /*!****************************************!*\
  3979. !*** ./js/ast/expressions/infixApp.js ***!
  3980. \****************************************/
  3981. /*! exports provided: InfixApp */
  3982. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3983. "use strict";
  3984. __webpack_require__.r(__webpack_exports__);
  3985. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InfixApp", function() { return InfixApp; });
  3986. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  3987. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  3988. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  3989. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  3990. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  3991. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  3992. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  3993. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  3994. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  3995. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  3996. /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
  3997. 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); }; }
  3998. 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; } }
  3999. var InfixApp = /*#__PURE__*/function (_Expression) {
  4000. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(InfixApp, _Expression);
  4001. var _super = _createSuper(InfixApp);
  4002. function InfixApp(op, left, right) {
  4003. var _this;
  4004. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, InfixApp);
  4005. _this = _super.call(this);
  4006. _this.op = op;
  4007. _this.left = left;
  4008. _this.right = right;
  4009. return _this;
  4010. }
  4011. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(InfixApp, [{
  4012. key: "toString",
  4013. value: function toString() {
  4014. var l = this.left.toString();
  4015. var op = this.op.value;
  4016. var r = this.right.toString();
  4017. if (this.parenthesis) {
  4018. return "(".concat(l + op + r, ")");
  4019. } else {
  4020. return l + op + r;
  4021. }
  4022. }
  4023. }]);
  4024. return InfixApp;
  4025. }(_expression__WEBPACK_IMPORTED_MODULE_5__["Expression"]);
  4026. /***/ }),
  4027. /***/ "./js/ast/expressions/intLiteral.js":
  4028. /*!******************************************!*\
  4029. !*** ./js/ast/expressions/intLiteral.js ***!
  4030. \******************************************/
  4031. /*! exports provided: IntLiteral */
  4032. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4033. "use strict";
  4034. __webpack_require__.r(__webpack_exports__);
  4035. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IntLiteral", function() { return IntLiteral; });
  4036. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  4037. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  4038. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  4039. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  4040. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  4041. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  4042. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  4043. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  4044. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  4045. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  4046. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  4047. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  4048. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  4049. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  4050. 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); }; }
  4051. 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; } }
  4052. var IntLiteral = /*#__PURE__*/function (_Literal) {
  4053. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(IntLiteral, _Literal);
  4054. var _super = _createSuper(IntLiteral);
  4055. function IntLiteral(value) {
  4056. var _this;
  4057. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IntLiteral);
  4058. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].INTEGER);
  4059. _this.value = value;
  4060. return _this;
  4061. }
  4062. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IntLiteral, [{
  4063. key: "toString",
  4064. value: function toString() {
  4065. var text = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__["convertToString"])(this.value, this.type);
  4066. if (this.parenthesis) {
  4067. return "(".concat(text, ")");
  4068. } else {
  4069. return text;
  4070. }
  4071. }
  4072. }]);
  4073. return IntLiteral;
  4074. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  4075. /***/ }),
  4076. /***/ "./js/ast/expressions/literal.js":
  4077. /*!***************************************!*\
  4078. !*** ./js/ast/expressions/literal.js ***!
  4079. \***************************************/
  4080. /*! exports provided: Literal */
  4081. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4082. "use strict";
  4083. __webpack_require__.r(__webpack_exports__);
  4084. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Literal", function() { return Literal; });
  4085. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  4086. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  4087. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  4088. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
  4089. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  4090. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
  4091. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  4092. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
  4093. /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
  4094. 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); }; }
  4095. 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; } }
  4096. var Literal = /*#__PURE__*/function (_Expression) {
  4097. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Literal, _Expression);
  4098. var _super = _createSuper(Literal);
  4099. function Literal(type) {
  4100. var _this;
  4101. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Literal);
  4102. _this = _super.call(this);
  4103. _this.type = type;
  4104. return _this;
  4105. }
  4106. return Literal;
  4107. }(_expression__WEBPACK_IMPORTED_MODULE_4__["Expression"]);
  4108. /***/ }),
  4109. /***/ "./js/ast/expressions/realLiteral.js":
  4110. /*!*******************************************!*\
  4111. !*** ./js/ast/expressions/realLiteral.js ***!
  4112. \*******************************************/
  4113. /*! exports provided: RealLiteral */
  4114. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4115. "use strict";
  4116. __webpack_require__.r(__webpack_exports__);
  4117. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RealLiteral", function() { return RealLiteral; });
  4118. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  4119. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  4120. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  4121. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  4122. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  4123. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  4124. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  4125. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  4126. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  4127. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  4128. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  4129. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  4130. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  4131. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  4132. 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); }; }
  4133. 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; } }
  4134. var RealLiteral = /*#__PURE__*/function (_Literal) {
  4135. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(RealLiteral, _Literal);
  4136. var _super = _createSuper(RealLiteral);
  4137. function RealLiteral(value) {
  4138. var _this;
  4139. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, RealLiteral);
  4140. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].REAL);
  4141. _this.value = value;
  4142. return _this;
  4143. }
  4144. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(RealLiteral, [{
  4145. key: "toString",
  4146. value: function toString() {
  4147. var text = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__["convertToString"])(this.value, this.type);
  4148. if (this.parenthesis) {
  4149. return "(".concat(text, ")");
  4150. } else {
  4151. return text;
  4152. }
  4153. }
  4154. }]);
  4155. return RealLiteral;
  4156. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  4157. /***/ }),
  4158. /***/ "./js/ast/expressions/stringLiteral.js":
  4159. /*!*********************************************!*\
  4160. !*** ./js/ast/expressions/stringLiteral.js ***!
  4161. \*********************************************/
  4162. /*! exports provided: StringLiteral */
  4163. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4164. "use strict";
  4165. __webpack_require__.r(__webpack_exports__);
  4166. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StringLiteral", function() { return StringLiteral; });
  4167. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  4168. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  4169. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  4170. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  4171. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  4172. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  4173. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  4174. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  4175. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  4176. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  4177. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  4178. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  4179. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  4180. 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); }; }
  4181. 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; } }
  4182. var StringLiteral = /*#__PURE__*/function (_Literal) {
  4183. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(StringLiteral, _Literal);
  4184. var _super = _createSuper(StringLiteral);
  4185. function StringLiteral(value) {
  4186. var _this;
  4187. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, StringLiteral);
  4188. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].STRING);
  4189. _this.value = value;
  4190. return _this;
  4191. }
  4192. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(StringLiteral, [{
  4193. key: "toString",
  4194. value: function toString() {
  4195. var text = '"' + this.value + '"';
  4196. if (this.parenthesis) {
  4197. return "(".concat(text, ")");
  4198. } else {
  4199. return text;
  4200. }
  4201. }
  4202. }]);
  4203. return StringLiteral;
  4204. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  4205. /***/ }),
  4206. /***/ "./js/ast/expressions/unaryApp.js":
  4207. /*!****************************************!*\
  4208. !*** ./js/ast/expressions/unaryApp.js ***!
  4209. \****************************************/
  4210. /*! exports provided: UnaryApp */
  4211. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4212. "use strict";
  4213. __webpack_require__.r(__webpack_exports__);
  4214. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnaryApp", function() { return UnaryApp; });
  4215. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  4216. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  4217. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  4218. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  4219. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  4220. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  4221. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  4222. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  4223. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  4224. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  4225. /* harmony import */ var _infixApp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./infixApp */ "./js/ast/expressions/infixApp.js");
  4226. 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); }; }
  4227. 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; } }
  4228. var UnaryApp = /*#__PURE__*/function (_InfixApp) {
  4229. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(UnaryApp, _InfixApp);
  4230. var _super = _createSuper(UnaryApp);
  4231. function UnaryApp(op, left) {
  4232. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, UnaryApp);
  4233. return _super.call(this, op, left, null);
  4234. }
  4235. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(UnaryApp, [{
  4236. key: "toString",
  4237. value: function toString() {
  4238. var l = this.left.toString();
  4239. var op = this.op.value;
  4240. if (this.parenthesis) {
  4241. return "(".concat(op + l, ")");
  4242. } else {
  4243. return op + l;
  4244. }
  4245. }
  4246. }]);
  4247. return UnaryApp;
  4248. }(_infixApp__WEBPACK_IMPORTED_MODULE_5__["InfixApp"]);
  4249. /***/ }),
  4250. /***/ "./js/ast/expressions/variableLiteral.js":
  4251. /*!***********************************************!*\
  4252. !*** ./js/ast/expressions/variableLiteral.js ***!
  4253. \***********************************************/
  4254. /*! exports provided: VariableLiteral */
  4255. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4256. "use strict";
  4257. __webpack_require__.r(__webpack_exports__);
  4258. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VariableLiteral", function() { return VariableLiteral; });
  4259. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  4260. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  4261. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  4262. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  4263. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  4264. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  4265. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  4266. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  4267. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  4268. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  4269. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  4270. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  4271. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
  4272. 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); }; }
  4273. 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; } }
  4274. var VariableLiteral = /*#__PURE__*/function (_Literal) {
  4275. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(VariableLiteral, _Literal);
  4276. var _super = _createSuper(VariableLiteral);
  4277. function VariableLiteral(id) {
  4278. var _this;
  4279. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, VariableLiteral);
  4280. _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].UNDEFINED);
  4281. _this.id = id;
  4282. return _this;
  4283. }
  4284. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(VariableLiteral, [{
  4285. key: "toString",
  4286. value: function toString() {
  4287. if (this.parenthesis) {
  4288. return "(".concat(this.id, ")");
  4289. } else {
  4290. return this.id;
  4291. }
  4292. }
  4293. }]);
  4294. return VariableLiteral;
  4295. }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
  4296. /***/ }),
  4297. /***/ "./js/ast/ivprogParser.js":
  4298. /*!********************************!*\
  4299. !*** ./js/ast/ivprogParser.js ***!
  4300. \********************************/
  4301. /*! exports provided: IVProgParser */
  4302. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4303. "use strict";
  4304. __webpack_require__.r(__webpack_exports__);
  4305. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IVProgParser", function() { return IVProgParser; });
  4306. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  4307. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  4308. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  4309. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  4310. /* harmony import */ var antlr4_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antlr4/index */ "./node_modules/antlr4/index.js");
  4311. /* harmony import */ var antlr4_index__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(antlr4_index__WEBPACK_IMPORTED_MODULE_2__);
  4312. /* harmony import */ var _expressions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./expressions */ "./js/ast/expressions/index.js");
  4313. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./commands */ "./js/ast/commands/index.js");
  4314. /* harmony import */ var _ast_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ast_helpers */ "./js/ast/ast_helpers.js");
  4315. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  4316. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../typeSystem/types */ "./js/typeSystem/types.ts");
  4317. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__);
  4318. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  4319. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__);
  4320. /* harmony import */ var _sourceInfo__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./sourceInfo */ "./js/ast/sourceInfo.js");
  4321. /* harmony import */ var _operators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./operators */ "./js/ast/operators.ts");
  4322. /* harmony import */ var _operators__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_operators__WEBPACK_IMPORTED_MODULE_10__);
  4323. /* harmony import */ var _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./error/syntaxErrorFactory */ "./js/ast/error/syntaxErrorFactory.js");
  4324. /* harmony import */ var _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../processor/definedFunctions */ "./js/processor/definedFunctions.js");
  4325. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../services/languageService */ "./js/services/languageService.js");
  4326. var IVProgParser = /*#__PURE__*/function () {
  4327. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IVProgParser, null, [{
  4328. key: "createParser",
  4329. value: function createParser(input) {
  4330. var lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_13__["LanguageService"].getCurrentLexer();
  4331. return new IVProgParser(input, lexerClass);
  4332. } // <BEGIN scope consts>
  4333. }, {
  4334. key: "BASE",
  4335. get: function get() {
  4336. return 0;
  4337. }
  4338. }, {
  4339. key: "FUNCTION",
  4340. get: function get() {
  4341. return 1;
  4342. }
  4343. }, {
  4344. key: "COMMAND",
  4345. get: function get() {
  4346. return 2;
  4347. }
  4348. }, {
  4349. key: "BREAKABLE",
  4350. get: function get() {
  4351. return 4;
  4352. } // </ END scope consts>
  4353. }]);
  4354. function IVProgParser(input, lexerClass) {
  4355. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IVProgParser);
  4356. this.lexerClass = lexerClass;
  4357. this.inputStream = new antlr4_index__WEBPACK_IMPORTED_MODULE_2__["InputStream"](input);
  4358. this.lexer = new lexerClass(this.inputStream);
  4359. this.lexer.recover = _ast_helpers__WEBPACK_IMPORTED_MODULE_5__["recover"].bind(this.lexer);
  4360. this.tokenStream = new antlr4_index__WEBPACK_IMPORTED_MODULE_2__["CommonTokenStream"](this.lexer);
  4361. this.tokenStream.fill();
  4362. this.pos = 1;
  4363. this.variableTypes = [this.lexerClass.RK_INTEGER, this.lexerClass.RK_REAL, this.lexerClass.RK_BOOLEAN, this.lexerClass.RK_STRING, this.lexerClass.RK_CHARACTER];
  4364. this.functionTypes = this.variableTypes.concat(this.lexerClass.RK_VOID);
  4365. this.parsingArrayDimension = 0;
  4366. this.scope = [];
  4367. this.langFuncs = _services_languageService__WEBPACK_IMPORTED_MODULE_13__["LanguageService"].getCurrentLangFuncs();
  4368. this.definedFuncsNameList = [];
  4369. this.definedVariablesStack = [];
  4370. }
  4371. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IVProgParser, [{
  4372. key: "parseTree",
  4373. value: function parseTree() {
  4374. return this.parseProgram();
  4375. }
  4376. }, {
  4377. key: "getToken",
  4378. value: function getToken() {
  4379. var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.pos;
  4380. // if(index === null)
  4381. // index = this.pos;
  4382. return this.tokenStream.LT(index);
  4383. }
  4384. }, {
  4385. key: "insideScope",
  4386. value: function insideScope(scope) {
  4387. if (this.scope.length <= 0) {
  4388. return IVProgParser.BASE === scope;
  4389. } else {
  4390. return this.scope[this.scope.length - 1] === scope;
  4391. }
  4392. }
  4393. }, {
  4394. key: "pushScope",
  4395. value: function pushScope(scope) {
  4396. this.scope.push(scope);
  4397. }
  4398. }, {
  4399. key: "pushVariableStack",
  4400. value: function pushVariableStack() {
  4401. this.definedVariablesStack.push([]);
  4402. }
  4403. }, {
  4404. key: "popScope",
  4405. value: function popScope() {
  4406. return this.scope.pop();
  4407. }
  4408. }, {
  4409. key: "popVariableStack",
  4410. value: function popVariableStack() {
  4411. return this.definedVariablesStack.pop();
  4412. }
  4413. }, {
  4414. key: "getCurrentVariableStack",
  4415. value: function getCurrentVariableStack() {
  4416. return this.definedVariablesStack[this.definedVariablesStack.length - 1];
  4417. }
  4418. }, {
  4419. key: "isEOF",
  4420. value: function isEOF() {
  4421. this.getToken(this.pos);
  4422. return this.tokenStream.fetchedEOF;
  4423. }
  4424. }, {
  4425. key: "parseProgram",
  4426. value: function parseProgram() {
  4427. this.consumeNewLines();
  4428. var token = this.getToken();
  4429. var globalVars = [];
  4430. var functions = [];
  4431. if (this.lexerClass.RK_PROGRAM === token.type) {
  4432. this.pos++;
  4433. this.consumeNewLines();
  4434. this.checkOpenCurly();
  4435. this.pos++;
  4436. this.pushVariableStack();
  4437. for (;;) {
  4438. this.consumeNewLines();
  4439. var _token = this.getToken();
  4440. if (_token.type === this.lexerClass.RK_CONST || this.isVariableType(_token)) {
  4441. globalVars = globalVars.concat(this.parseGlobalVariables());
  4442. } else if (_token.type === this.lexerClass.RK_FUNCTION) {
  4443. this.pushVariableStack();
  4444. functions = functions.concat(this.parseFunction());
  4445. this.popVariableStack();
  4446. } else {
  4447. break;
  4448. }
  4449. }
  4450. this.consumeNewLines();
  4451. this.checkCloseCurly();
  4452. this.pos++;
  4453. this.consumeNewLines();
  4454. if (!this.isEOF()) {
  4455. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].extra_lines();
  4456. }
  4457. this.popVariableStack();
  4458. return {
  4459. global: globalVars,
  4460. functions: functions
  4461. };
  4462. } else {
  4463. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(this.lexer.literalNames[this.lexerClass.RK_PROGRAM], token);
  4464. }
  4465. }
  4466. }, {
  4467. key: "checkOpenCurly",
  4468. value: function checkOpenCurly() {
  4469. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4470. var token = this.getToken();
  4471. if (this.lexerClass.OPEN_CURLY !== token.type) {
  4472. if (!attempt) throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one('{', token);else return false;
  4473. }
  4474. return true;
  4475. }
  4476. }, {
  4477. key: "checkCloseCurly",
  4478. value: function checkCloseCurly() {
  4479. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4480. var token = this.getToken();
  4481. if (this.lexerClass.CLOSE_CURLY !== token.type) {
  4482. if (!attempt) throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one('}', token);else return false;
  4483. }
  4484. return true;
  4485. }
  4486. /* It checks if the current token at position pos is a ']'.
  4487. * As a check function it doesn't increment pos.
  4488. *
  4489. * @params bool:attempt, indicates that the token is optional. Defaults: false
  4490. *
  4491. * @returns true if the attempt is true and current token is '[',
  4492. * false is attempt is true and current token is not '['
  4493. **/
  4494. }, {
  4495. key: "checkOpenBrace",
  4496. value: function checkOpenBrace() {
  4497. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4498. var token = this.getToken();
  4499. if (this.lexerClass.OPEN_BRACE !== token.type) {
  4500. if (!attempt) {
  4501. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one('[', token);
  4502. } else {
  4503. return false;
  4504. }
  4505. }
  4506. return true;
  4507. }
  4508. }, {
  4509. key: "checkCloseBrace",
  4510. value: function checkCloseBrace() {
  4511. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4512. var token = this.getToken();
  4513. if (this.lexerClass.CLOSE_BRACE !== token.type) {
  4514. if (!attempt) {
  4515. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(']', token);
  4516. } else {
  4517. return false;
  4518. }
  4519. }
  4520. return true;
  4521. }
  4522. }, {
  4523. key: "checkOpenParenthesis",
  4524. value: function checkOpenParenthesis() {
  4525. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4526. var token = this.getToken();
  4527. if (this.lexerClass.OPEN_PARENTHESIS !== token.type) {
  4528. if (!attempt) {
  4529. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one('(', token);
  4530. } else {
  4531. return false;
  4532. }
  4533. }
  4534. return true;
  4535. }
  4536. }, {
  4537. key: "checkCloseParenthesis",
  4538. value: function checkCloseParenthesis() {
  4539. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4540. var token = this.getToken();
  4541. if (this.lexerClass.CLOSE_PARENTHESIS !== token.type) {
  4542. if (!attempt) {
  4543. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(')', token);
  4544. } else {
  4545. return false;
  4546. }
  4547. }
  4548. return true;
  4549. }
  4550. }, {
  4551. key: "checkEOS",
  4552. value: function checkEOS() {
  4553. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4554. var eosToken = this.getToken();
  4555. if (eosToken.type !== this.lexerClass.EOS) {
  4556. if (!attempt) throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].eos_missing(eosToken);else return false;
  4557. }
  4558. return true;
  4559. }
  4560. }, {
  4561. key: "checkFunctionDuplicate",
  4562. value: function checkFunctionDuplicate(functionID, funcIDToken) {
  4563. var id = functionID === null ? "$main" : functionID;
  4564. var index = this.definedFuncsNameList.indexOf(id);
  4565. if (index !== -1) {
  4566. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].duplicate_function(funcIDToken);
  4567. }
  4568. this.definedFuncsNameList.push(id);
  4569. }
  4570. }, {
  4571. key: "checkVariableDuplicate",
  4572. value: function checkVariableDuplicate(variableID, sourceInfo) {
  4573. var index = this.getCurrentVariableStack().indexOf(variableID);
  4574. if (index !== -1) {
  4575. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].duplicate_variable(sourceInfo);
  4576. }
  4577. this.getCurrentVariableStack().push(variableID);
  4578. }
  4579. }, {
  4580. key: "consumeForSemiColon",
  4581. value: function consumeForSemiColon() {
  4582. var eosToken = this.getToken();
  4583. if (eosToken.type === this.lexerClass.EOS && eosToken.text.match(';')) {
  4584. this.pos++;
  4585. return;
  4586. }
  4587. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(';', eosToken);
  4588. }
  4589. }, {
  4590. key: "parseGlobalVariables",
  4591. value: function parseGlobalVariables() {
  4592. var decl = this.parseMaybeConst();
  4593. this.checkEOS();
  4594. this.pos++;
  4595. return decl;
  4596. }
  4597. /*
  4598. * Checks if the next token is PR_CONST. It's only available
  4599. * at global variables declaration level
  4600. * @returns Declararion(const, type, id, initVal?)
  4601. **/
  4602. }, {
  4603. key: "parseMaybeConst",
  4604. value: function parseMaybeConst() {
  4605. var constToken = this.getToken();
  4606. if (constToken.type === this.lexerClass.RK_CONST) {
  4607. this.pos++;
  4608. var typeString = this.parseType();
  4609. return this.parseDeclaration(typeString, true);
  4610. } else if (this.isVariableType(constToken)) {
  4611. var _typeString = this.parseType();
  4612. return this.parseDeclaration(_typeString);
  4613. } else {
  4614. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_list([this.lexer.literalNames[this.lexerClass.RK_CONST]].concat(this.getTypeArray()), constToken);
  4615. }
  4616. }
  4617. /*
  4618. * Parses a declarion of the form: type --- id --- (= --- EAnd)?
  4619. * @returns a list of Declararion(const, type, id, initVal?)
  4620. **/
  4621. }, {
  4622. key: "parseDeclaration",
  4623. value: function parseDeclaration(typeString) {
  4624. var isConst = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  4625. var initial = null;
  4626. var dim1 = null;
  4627. var dim2 = null;
  4628. var dimensions = 0;
  4629. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(this.getToken());
  4630. var idString = this.parseID();
  4631. this.checkVariableDuplicate(idString, sourceInfo); // Check for array or vector
  4632. // ID[int/IDi?][int/IDj?]
  4633. if (this.checkOpenBrace(true)) {
  4634. this.pos += 1;
  4635. this.consumeNewLines();
  4636. dim1 = this.parseArrayDimension();
  4637. this.consumeNewLines();
  4638. this.checkCloseBrace();
  4639. this.pos += 1;
  4640. dimensions += 1;
  4641. if (this.checkOpenBrace(true)) {
  4642. this.pos += 1;
  4643. this.consumeNewLines();
  4644. dim2 = this.parseArrayDimension();
  4645. this.consumeNewLines();
  4646. this.checkCloseBrace();
  4647. this.pos += 1;
  4648. dimensions += 1;
  4649. }
  4650. return this.parseArrayDeclaration(typeString, isConst, idString, sourceInfo, dimensions, dim1, dim2);
  4651. } else {
  4652. var equalsToken = this.getToken();
  4653. if (isConst && equalsToken.type !== this.lexerClass.EQUAL) {
  4654. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].const_not_init(sourceInfo);
  4655. }
  4656. if (equalsToken.type === this.lexerClass.EQUAL) {
  4657. this.pos++;
  4658. initial = this.parseExpressionOR();
  4659. }
  4660. var declaration = new _commands__WEBPACK_IMPORTED_MODULE_4__["Declaration"](idString, typeString, initial, isConst);
  4661. declaration.sourceInfo = sourceInfo;
  4662. var commaToken = this.getToken();
  4663. if (commaToken.type === this.lexerClass.COMMA) {
  4664. this.pos++;
  4665. this.consumeNewLines();
  4666. return [declaration].concat(this.parseDeclaration(typeString, isConst));
  4667. } else {
  4668. return [declaration];
  4669. }
  4670. }
  4671. }
  4672. }, {
  4673. key: "parseArrayDeclaration",
  4674. value: function parseArrayDeclaration(typeString, isConst, idString, sourceInfo, dimensions, dim1, dim2) {
  4675. var equalsToken = this.getToken();
  4676. var n_lines = dim1;
  4677. var n_columns = dim2;
  4678. var initial = null;
  4679. var dim_is_id = false;
  4680. if (dim1 instanceof _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"] || dim2 instanceof _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"]) {
  4681. dim_is_id = true;
  4682. if (dimensions > 1 && (dim1 == null || dim2 == null)) {
  4683. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_matrix_id_dimension(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalsToken));
  4684. }
  4685. }
  4686. if (isConst && equalsToken.type !== this.lexerClass.EQUAL) {
  4687. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].const_not_init(sourceInfo);
  4688. }
  4689. if (equalsToken.type === this.lexerClass.EQUAL) {
  4690. if (dim_is_id) {
  4691. if (dimensions == 1) {
  4692. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_vector_init(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalsToken));
  4693. } else {
  4694. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_matrix_init(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalsToken));
  4695. }
  4696. }
  4697. this.pos += 1;
  4698. initial = this.parseArrayLiteral(typeString);
  4699. }
  4700. if (initial == null && dim1 == null) {
  4701. if (dimensions > 1) {
  4702. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].cannot_infer_matrix_line(idString, sourceInfo);
  4703. }
  4704. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].cannot_infer_vector_size(idString, sourceInfo);
  4705. }
  4706. if (dimensions > 1) {
  4707. if (initial == null && dim2 == null) {
  4708. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].cannot_infer_matrix_column(idString, sourceInfo);
  4709. }
  4710. }
  4711. if (dimensions === 1 && initial != null && !initial.isVector) {
  4712. var expString = initial.toString();
  4713. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].matrix_to_vector_literal_attr(idString, expString, initial.sourceInfo);
  4714. } else if (dimensions > 1 && initial != null && initial.isVector) {
  4715. var _expString = initial.toString();
  4716. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].vector_to_matrix_literal_attr(idString, _expString, initial.sourceInfo);
  4717. }
  4718. if (dim1 == null) {
  4719. n_lines = new _expressions__WEBPACK_IMPORTED_MODULE_3__["IntLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toInt"](initial.lines));
  4720. n_lines.sourceInfo = sourceInfo;
  4721. }
  4722. if (dimensions > 1) {
  4723. if (dim2 == null) {
  4724. n_columns = new _expressions__WEBPACK_IMPORTED_MODULE_3__["IntLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toInt"](initial.columns));
  4725. n_columns.sourceInfo = sourceInfo;
  4726. }
  4727. }
  4728. 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);
  4729. declaration.sourceInfo = sourceInfo;
  4730. var commaToken = this.getToken();
  4731. if (commaToken.type === this.lexerClass.COMMA) {
  4732. this.pos++;
  4733. this.consumeNewLines();
  4734. return [declaration].concat(this.parseDeclaration(typeString, isConst));
  4735. } else {
  4736. return [declaration];
  4737. }
  4738. }
  4739. }, {
  4740. key: "consumeNewLines",
  4741. value: function consumeNewLines() {
  4742. var token = this.getToken();
  4743. while (token.type === this.lexerClass.EOS && token.text.match('[\r\n]+')) {
  4744. this.pos++;
  4745. token = this.getToken();
  4746. }
  4747. }
  4748. }, {
  4749. key: "isVariableType",
  4750. value: function isVariableType(token) {
  4751. return this.variableTypes.find(function (v) {
  4752. return v === token.type;
  4753. });
  4754. }
  4755. /*
  4756. * Reads the next token of the stream to check if it is a Integer or an ID.
  4757. * @returns Integer | ID
  4758. **/
  4759. }, {
  4760. key: "parseArrayDimension",
  4761. value: function parseArrayDimension() {
  4762. var dimToken = this.getToken();
  4763. if (dimToken.type === this.lexerClass.INTEGER) {
  4764. //parse as int literal
  4765. this.pos++;
  4766. return this.getIntLiteral(dimToken);
  4767. } else if (dimToken.type === this.lexerClass.ID) {
  4768. //parse as variable
  4769. this.pos++;
  4770. return this.parseVariable(dimToken);
  4771. } else if (dimToken.type === this.lexerClass.CLOSE_BRACE) {
  4772. return null;
  4773. } else {
  4774. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_array_dimension(this.lexer.literalNames[this.lexerClass.RK_INTEGER], dimToken);
  4775. }
  4776. }
  4777. /*
  4778. * Returns an object {type: 'int', value: value}.
  4779. * It checks for binary and hexadecimal integers.
  4780. * @returns object with fields type and value
  4781. **/
  4782. }, {
  4783. key: "getIntLiteral",
  4784. value: function getIntLiteral(token) {
  4785. var text = token.text;
  4786. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4787. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["IntLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toInt"](text));
  4788. exp.sourceInfo = sourceInfo;
  4789. return exp;
  4790. }
  4791. }, {
  4792. key: "getRealLiteral",
  4793. value: function getRealLiteral(token) {
  4794. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4795. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["RealLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toReal"](token.text));
  4796. exp.sourceInfo = sourceInfo;
  4797. return exp;
  4798. }
  4799. }, {
  4800. key: "getStringLiteral",
  4801. value: function getStringLiteral(token) {
  4802. var text = token.text;
  4803. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4804. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["StringLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toString"](text));
  4805. exp.sourceInfo = sourceInfo;
  4806. return exp;
  4807. }
  4808. }, {
  4809. key: "getCharLiteral",
  4810. value: function getCharLiteral(token) {
  4811. var text = token.text;
  4812. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["CharLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toChar"](text));
  4813. exp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4814. return exp;
  4815. }
  4816. }, {
  4817. key: "getBoolLiteral",
  4818. value: function getBoolLiteral(token) {
  4819. var val = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toBool"](token.text);
  4820. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["BoolLiteral"](val);
  4821. exp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4822. return exp;
  4823. }
  4824. }, {
  4825. key: "parseArrayLiteral",
  4826. value: function parseArrayLiteral(typeString) {
  4827. var openCurly = this.checkOpenCurly(true);
  4828. if (!openCurly) {
  4829. var invalid_token = this.getToken();
  4830. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].array_init_not_literal(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(invalid_token));
  4831. }
  4832. var beginArray = this.getToken();
  4833. if (this.parsingArrayDimension >= 2) {
  4834. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].array_exceeds_2d(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(beginArray));
  4835. }
  4836. this.pos += 1;
  4837. this.parsingArrayDimension += 1;
  4838. this.consumeNewLines();
  4839. var data = null;
  4840. var maybeCurlyOpen = this.checkOpenCurly(true);
  4841. if (maybeCurlyOpen) {
  4842. // This is potentially a list of vectors
  4843. data = this.parseVectorList(typeString);
  4844. } else {
  4845. data = this.parseExpressionList();
  4846. }
  4847. this.consumeNewLines();
  4848. this.checkCloseCurly();
  4849. var endArray = this.getToken();
  4850. this.pos += 1;
  4851. this.parsingArrayDimension -= 1;
  4852. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(beginArray, endArray);
  4853. var dataDim = 1;
  4854. if (data[0] instanceof _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayLiteral"]) {
  4855. dataDim += 1;
  4856. } else if (data.length == 1) {
  4857. console.log("Talvez uma variável seja uma melhor opção");
  4858. }
  4859. var type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](typeString, dataDim);
  4860. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayLiteral"](type, data);
  4861. exp.sourceInfo = sourceInfo;
  4862. return exp;
  4863. }
  4864. /**
  4865. * Returns a list of ArrayLiterals. Helper function for parsing matrices
  4866. */
  4867. }, {
  4868. key: "parseVectorList",
  4869. value: function parseVectorList(typeString) {
  4870. var list = [];
  4871. var lastSize = null;
  4872. for (;;) {
  4873. this.checkOpenCurly();
  4874. var beginArray = this.getToken();
  4875. if (this.parsingArrayDimension >= 2) {
  4876. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].array_exceeds_2d(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(beginArray));
  4877. }
  4878. this.pos += 1;
  4879. this.parsingArrayDimension += 1;
  4880. this.consumeNewLines();
  4881. var data = this.parseExpressionList();
  4882. this.consumeNewLines();
  4883. this.checkCloseCurly();
  4884. var endArray = this.getToken();
  4885. this.pos += 1;
  4886. this.parsingArrayDimension -= 1;
  4887. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(beginArray, endArray);
  4888. if (lastSize == null) {
  4889. lastSize = data.length;
  4890. } else if (lastSize !== data.length) {
  4891. var expString = this.inputStream.getText(beginArray.start, endArray.stop);
  4892. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_matrix_literal_line(expString, sourceInfo);
  4893. }
  4894. var type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](typeString, 1);
  4895. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayLiteral"](type, data);
  4896. exp.sourceInfo = sourceInfo;
  4897. list.push(exp);
  4898. var commaToken = this.getToken();
  4899. if (commaToken.type !== this.lexerClass.COMMA) {
  4900. break;
  4901. }
  4902. this.pos += 1;
  4903. this.consumeNewLines();
  4904. }
  4905. if (list.length == 1) {
  4906. console.log("Talvez um vetor seja uma melhor opção");
  4907. }
  4908. return list;
  4909. }
  4910. /*
  4911. * Returns an object {type: 'variable', value: value}.
  4912. * @returns object with fields type and value
  4913. **/
  4914. }, {
  4915. key: "parseVariable",
  4916. value: function parseVariable(token) {
  4917. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  4918. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](token.text);
  4919. exp.sourceInfo = sourceInfo;
  4920. return exp;
  4921. }
  4922. /*
  4923. * Returns an object representing a function. It has
  4924. * four attributes: returnType, id, formalParams and block.
  4925. * The block object has two attributes: declarations and commands
  4926. **/
  4927. }, {
  4928. key: "parseFunction",
  4929. value: function parseFunction() {
  4930. this.pushScope(IVProgParser.FUNCTION);
  4931. var formalParams = [];
  4932. var token = this.getToken();
  4933. if (token.type !== this.lexerClass.RK_FUNCTION) {
  4934. //throw SyntaxError.createError(this.lexer.literalNames[this.lexerClass.PR_FUNCAO], token);
  4935. return null;
  4936. }
  4937. this.pos++;
  4938. var funType = this.parseType();
  4939. var dimensions = 0;
  4940. if (this.checkOpenBrace(true)) {
  4941. this.pos++;
  4942. this.checkCloseBrace();
  4943. this.pos++;
  4944. dimensions++;
  4945. if (this.checkOpenBrace(true)) {
  4946. this.pos++;
  4947. this.checkCloseBrace();
  4948. this.pos++;
  4949. dimensions++;
  4950. }
  4951. }
  4952. var funcIDToken = this.getToken();
  4953. var functionID = this.parseID();
  4954. this.checkFunctionDuplicate(functionID, funcIDToken);
  4955. this.checkOpenParenthesis();
  4956. this.pos++;
  4957. this.consumeNewLines();
  4958. if (!this.checkCloseParenthesis(true)) {
  4959. formalParams = this.parseFormalParameters(); // formal parameters
  4960. this.consumeNewLines();
  4961. this.checkCloseParenthesis();
  4962. this.pos++;
  4963. } else {
  4964. this.pos++;
  4965. }
  4966. this.consumeNewLines();
  4967. var commandsBlock = this.parseCommandBlock();
  4968. var returnType = funType;
  4969. if (dimensions > 0) {
  4970. returnType = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](funType, dimensions);
  4971. }
  4972. var func = new _commands__WEBPACK_IMPORTED_MODULE_4__["Function"](functionID, returnType, formalParams, commandsBlock);
  4973. if (functionID === null && !func.isMain) {
  4974. 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);
  4975. } else if (func.isMain && formalParams.length !== 0) {
  4976. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].main_parameters();
  4977. }
  4978. this.popScope();
  4979. return func;
  4980. }
  4981. /*
  4982. * Parse the formal parameters of a function.
  4983. * @returns a list of objects with the following attributes: type, id and dimensions.
  4984. **/
  4985. }, {
  4986. key: "parseFormalParameters",
  4987. value: function parseFormalParameters() {
  4988. var list = [];
  4989. for (;;) {
  4990. var dimensions = 0;
  4991. var reference = false;
  4992. var typeString = this.parseType();
  4993. var maybeIDToken = this.getToken();
  4994. if (maybeIDToken.type === this.lexerClass.RK_REFERENCE) {
  4995. reference = true;
  4996. this.pos += 1;
  4997. maybeIDToken = this.getToken();
  4998. }
  4999. var idString = this.parseID();
  5000. this.checkVariableDuplicate(idString, maybeIDToken);
  5001. if (this.checkOpenBrace(true)) {
  5002. this.pos += 1;
  5003. dimensions += 1;
  5004. this.checkCloseBrace();
  5005. this.pos += 1;
  5006. if (this.checkOpenBrace(true)) {
  5007. this.pos += 1;
  5008. dimensions += 1;
  5009. this.checkCloseBrace();
  5010. this.pos += 1;
  5011. }
  5012. }
  5013. var type = null;
  5014. if (dimensions > 0) {
  5015. type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](typeString, dimensions);
  5016. } else {
  5017. type = typeString;
  5018. }
  5019. var parameter = new _commands__WEBPACK_IMPORTED_MODULE_4__["FormalParameter"](type, idString, reference);
  5020. parameter.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(maybeIDToken);
  5021. list.push(parameter);
  5022. var commaToken = this.getToken();
  5023. if (commaToken.type !== this.lexerClass.COMMA) break;
  5024. this.pos++;
  5025. this.consumeNewLines();
  5026. }
  5027. return list;
  5028. }
  5029. }, {
  5030. key: "parseID",
  5031. value: function parseID() {
  5032. var token = this.getToken();
  5033. if (token.type !== this.lexerClass.ID) {
  5034. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].id_missing(token);
  5035. }
  5036. this.pos++;
  5037. if (this.insideScope(IVProgParser.FUNCTION)) {
  5038. if (token.text === _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__["LanguageDefinedFunction"].getMainFunctionName()) {
  5039. return null;
  5040. }
  5041. }
  5042. return token.text;
  5043. }
  5044. }, {
  5045. key: "parseMaybeLibID",
  5046. value: function parseMaybeLibID() {
  5047. var token = this.getToken();
  5048. if (token.type !== this.lexerClass.ID && token.type !== this.lexerClass.LIB_ID) {
  5049. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].id_missing(token);
  5050. }
  5051. this.pos++;
  5052. return token.text;
  5053. }
  5054. }, {
  5055. key: "parseType",
  5056. value: function parseType() {
  5057. var token = this.getToken();
  5058. if (token.type === this.lexerClass.ID && this.insideScope(IVProgParser.FUNCTION)) {
  5059. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].VOID;
  5060. } else if (token.type === this.lexerClass.RK_VOID && this.insideScope(IVProgParser.FUNCTION)) {
  5061. this.pos++;
  5062. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].VOID;
  5063. } else if (this.isVariableType(token)) {
  5064. this.pos++;
  5065. switch (token.type) {
  5066. case this.lexerClass.RK_INTEGER:
  5067. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].INTEGER;
  5068. case this.lexerClass.RK_BOOLEAN:
  5069. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].BOOLEAN;
  5070. case this.lexerClass.RK_REAL:
  5071. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].REAL;
  5072. case this.lexerClass.RK_STRING:
  5073. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].STRING;
  5074. case this.lexerClass.RK_CHARACTER:
  5075. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].CHAR;
  5076. default:
  5077. break;
  5078. }
  5079. }
  5080. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_type(this.getTypeArray(), token);
  5081. }
  5082. }, {
  5083. key: "parseCommandBlock",
  5084. value: function parseCommandBlock() {
  5085. var optionalCurly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  5086. var variablesDecl = [];
  5087. var commands = [];
  5088. var hasOpen = false;
  5089. if (this.checkOpenCurly(optionalCurly)) {
  5090. this.pos++;
  5091. hasOpen = true;
  5092. }
  5093. this.consumeNewLines();
  5094. var parsedCommand = false;
  5095. for (;;) {
  5096. var cmd = this.parseCommand();
  5097. if (cmd === null) break;
  5098. if (cmd !== -1) {
  5099. if (cmd instanceof Array) {
  5100. if (parsedCommand) {
  5101. var lastToken = this.getToken(this.pos - 1);
  5102. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_var_declaration(lastToken);
  5103. }
  5104. variablesDecl = variablesDecl.concat(cmd);
  5105. } else {
  5106. parsedCommand = true;
  5107. commands.push(cmd);
  5108. }
  5109. }
  5110. }
  5111. this.consumeNewLines();
  5112. if (hasOpen) {
  5113. this.checkCloseCurly();
  5114. this.pos++;
  5115. this.consumeNewLines();
  5116. }
  5117. return new _commands__WEBPACK_IMPORTED_MODULE_4__["CommandBlock"](variablesDecl, commands);
  5118. }
  5119. }, {
  5120. key: "parseCommand",
  5121. value: function parseCommand() {
  5122. var token = this.getToken();
  5123. if (this.isVariableType(token)) {
  5124. if (!this.insideScope(IVProgParser.FUNCTION)) {
  5125. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_var_declaration(token);
  5126. }
  5127. this.pushScope(IVProgParser.BASE);
  5128. var varType = this.parseType();
  5129. this.popScope();
  5130. var cmd = this.parseDeclaration(varType);
  5131. this.checkEOS();
  5132. this.pos++;
  5133. return cmd;
  5134. } else if (token.type === this.lexerClass.ID) {
  5135. return this.parseIDCommand();
  5136. } else if (token.type === this.lexerClass.LIB_ID) {
  5137. return this.parseIDCommand();
  5138. } else if (token.type === this.lexerClass.RK_RETURN) {
  5139. return this.parseReturn();
  5140. } else if (token.type === this.lexerClass.RK_WHILE || token.type === this.lexerClass.RK_WHILE_ALT) {
  5141. return this.parseWhile();
  5142. } else if (token.type === this.lexerClass.RK_FOR || token.type === this.lexerClass.RK_FOR_ALT) {
  5143. return this.parseFor();
  5144. } else if (token.type === this.lexerClass.RK_BREAK) {
  5145. if (!this.insideScope(IVProgParser.BREAKABLE)) {
  5146. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_break_command(this.lexer.literalNames[this.lexerClass.RK_BREAK], token);
  5147. }
  5148. return this.parseBreak();
  5149. } else if (token.type === this.lexerClass.RK_SWITCH) {
  5150. return this.parseSwitchCase();
  5151. } else if (token.type === this.lexerClass.RK_DO) {
  5152. return this.parseRepeatUntil();
  5153. } else if (token.type === this.lexerClass.RK_IF) {
  5154. return this.parseIfThenElse();
  5155. } else if (this.checkEOS(true)) {
  5156. this.pos++;
  5157. return -1;
  5158. } else {
  5159. return null;
  5160. }
  5161. }
  5162. }, {
  5163. key: "parseSwitchCase",
  5164. value: function parseSwitchCase() {
  5165. this.pushScope(IVProgParser.BREAKABLE);
  5166. this.pos++;
  5167. this.checkOpenParenthesis();
  5168. this.pos++;
  5169. this.consumeNewLines();
  5170. var exp = this.parseExpressionOR();
  5171. this.consumeNewLines();
  5172. this.checkCloseParenthesis();
  5173. this.pos++;
  5174. this.consumeNewLines();
  5175. this.checkOpenCurly();
  5176. this.pos++;
  5177. this.consumeNewLines();
  5178. var casesList = this.parseCases();
  5179. this.consumeNewLines();
  5180. this.checkCloseCurly();
  5181. this.pos++;
  5182. this.consumeNewLines();
  5183. this.popScope();
  5184. return new _commands__WEBPACK_IMPORTED_MODULE_4__["Switch"](exp, casesList);
  5185. }
  5186. }, {
  5187. key: "parseRepeatUntil",
  5188. value: function parseRepeatUntil() {
  5189. this.pos++;
  5190. this.consumeNewLines();
  5191. this.pushScope(IVProgParser.BREAKABLE);
  5192. var commandsBlock = this.parseCommandBlock();
  5193. this.consumeNewLines(); //Maybe not...
  5194. var whileToken = this.getToken();
  5195. if (whileToken.type !== this.lexerClass.RK_DO_UNTIL) {
  5196. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(this.lexer.literalNames[this.lexerClass.RK_DO_UNTIL], whileToken);
  5197. }
  5198. this.pos++;
  5199. this.checkOpenParenthesis();
  5200. this.pos++;
  5201. this.consumeNewLines();
  5202. var condition = this.parseExpressionOR();
  5203. this.consumeNewLines();
  5204. this.checkCloseParenthesis();
  5205. this.pos++;
  5206. this.checkEOS();
  5207. this.popScope();
  5208. return new _commands__WEBPACK_IMPORTED_MODULE_4__["RepeatUntil"](condition, commandsBlock);
  5209. }
  5210. }, {
  5211. key: "parseIfThenElse",
  5212. value: function parseIfThenElse() {
  5213. if (this.insideScope(IVProgParser.BREAKABLE)) {
  5214. this.pushScope(IVProgParser.BREAKABLE);
  5215. } else {
  5216. this.pushScope(IVProgParser.COMMAND);
  5217. }
  5218. var token = this.getToken();
  5219. this.pos++;
  5220. this.checkOpenParenthesis();
  5221. this.pos++;
  5222. this.consumeNewLines();
  5223. var logicalExpression = this.parseExpressionOR();
  5224. this.consumeNewLines();
  5225. this.checkCloseParenthesis();
  5226. this.pos++;
  5227. this.consumeNewLines();
  5228. var cmdBlocks = this.parseCommandBlock();
  5229. var maybeElse = this.getToken();
  5230. if (maybeElse.type === this.lexerClass.RK_ELSE) {
  5231. this.pos++;
  5232. this.consumeNewLines();
  5233. var maybeIf = this.getToken();
  5234. var elseBlock = null;
  5235. if (this.checkOpenCurly(true)) {
  5236. elseBlock = this.parseCommandBlock();
  5237. } else if (maybeIf.type === this.lexerClass.RK_IF) {
  5238. elseBlock = this.parseIfThenElse();
  5239. } else {
  5240. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_list([this.lexer.literalNames[this.lexerClass.RK_IF], '{'], maybeIf);
  5241. }
  5242. this.popScope();
  5243. var _cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["IfThenElse"](logicalExpression, cmdBlocks, elseBlock);
  5244. _cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  5245. return _cmd;
  5246. }
  5247. this.popScope();
  5248. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["IfThenElse"](logicalExpression, cmdBlocks, null);
  5249. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  5250. return cmd;
  5251. }
  5252. }, {
  5253. key: "parseFor",
  5254. value: function parseFor() {
  5255. this.pushScope(IVProgParser.BREAKABLE);
  5256. var for_token = this.getToken();
  5257. this.pos += 1; // parse ID
  5258. var id_token = this.getToken();
  5259. var id = this.parseID();
  5260. var for_id = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](id);
  5261. for_id.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(id_token); // END parse ID
  5262. var for_from = this.parseForParameters(this.lexerClass.RK_FOR_FROM);
  5263. var for_to = this.parseForParameters(this.lexerClass.RK_FOR_TO);
  5264. var maybePass = this.parseForParameters(this.lexerClass.RK_FOR_PASS);
  5265. this.consumeNewLines();
  5266. var commandsBlock = this.parseCommandBlock();
  5267. this.popScope();
  5268. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["For"](for_id, for_from, for_to, maybePass, commandsBlock);
  5269. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(for_token);
  5270. return cmd;
  5271. }
  5272. }, {
  5273. key: "parseWhile",
  5274. value: function parseWhile() {
  5275. this.pushScope(IVProgParser.BREAKABLE);
  5276. var token = this.getToken();
  5277. this.pos++;
  5278. this.checkOpenParenthesis();
  5279. this.pos++;
  5280. this.consumeNewLines();
  5281. var logicalExpression = this.parseExpressionOR();
  5282. this.consumeNewLines();
  5283. this.checkCloseParenthesis();
  5284. this.pos++;
  5285. this.consumeNewLines();
  5286. var cmdBlocks = this.parseCommandBlock();
  5287. this.popScope();
  5288. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["While"](logicalExpression, cmdBlocks);
  5289. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  5290. return cmd;
  5291. }
  5292. }, {
  5293. key: "parseBreak",
  5294. value: function parseBreak() {
  5295. this.pos++;
  5296. this.checkEOS();
  5297. this.pos++;
  5298. return new _commands__WEBPACK_IMPORTED_MODULE_4__["Break"]();
  5299. }
  5300. }, {
  5301. key: "parseReturn",
  5302. value: function parseReturn() {
  5303. this.pos++;
  5304. var exp = null;
  5305. if (!this.checkEOS(true)) {
  5306. exp = this.parseExpressionOR();
  5307. this.checkEOS();
  5308. }
  5309. this.pos++;
  5310. return new _commands__WEBPACK_IMPORTED_MODULE_4__["Return"](exp);
  5311. }
  5312. }, {
  5313. key: "parseIDCommand",
  5314. value: function parseIDCommand() {
  5315. var refToken = this.getToken();
  5316. var isID = refToken.type === this.lexerClass.ID;
  5317. var id = this.parseMaybeLibID();
  5318. if (this.checkOpenBrace(true)) {
  5319. this.pos++;
  5320. var lineExpression = null;
  5321. var columnExpression = null;
  5322. this.consumeNewLines();
  5323. lineExpression = this.parseExpression();
  5324. this.consumeNewLines();
  5325. this.checkCloseBrace();
  5326. this.pos++;
  5327. if (this.checkOpenBrace(true)) {
  5328. this.pos++;
  5329. this.consumeNewLines();
  5330. columnExpression = this.parseExpression();
  5331. this.consumeNewLines();
  5332. this.checkCloseBrace();
  5333. this.pos++;
  5334. }
  5335. var equalToken = this.getToken();
  5336. if (equalToken.type !== this.lexerClass.EQUAL) {
  5337. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one('=', equalToken);
  5338. }
  5339. this.pos++;
  5340. var exp = this.parseExpressionOR();
  5341. this.checkEOS();
  5342. this.pos++;
  5343. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["ArrayIndexAssign"](id, lineExpression, columnExpression, exp);
  5344. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalToken);
  5345. return cmd;
  5346. }
  5347. var equalOrParenthesis = this.getToken();
  5348. if (isID && equalOrParenthesis.type === this.lexerClass.EQUAL) {
  5349. this.pos++;
  5350. var _exp = this.parseExpressionOR();
  5351. this.checkEOS();
  5352. this.pos++;
  5353. var _cmd2 = new _commands__WEBPACK_IMPORTED_MODULE_4__["Assign"](id, _exp);
  5354. _cmd2.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalOrParenthesis);
  5355. return _cmd2;
  5356. } else if (equalOrParenthesis.type === this.lexerClass.OPEN_PARENTHESIS) {
  5357. var funcCall = this.parseFunctionCallCommand(id);
  5358. this.checkEOS();
  5359. this.pos++;
  5360. return funcCall;
  5361. } else if (isID) {
  5362. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_list(['=', '('], equalOrParenthesis);
  5363. } else {
  5364. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_id_format(refToken);
  5365. }
  5366. }
  5367. }, {
  5368. key: "parseForParameters",
  5369. value: function parseForParameters(keyword_code) {
  5370. if (keyword_code === this.lexerClass.RK_FOR_PASS) {
  5371. if (this.checkOpenCurly(true)) {
  5372. return null;
  5373. }
  5374. }
  5375. var from_token = this.getToken();
  5376. if (from_token.type !== keyword_code) {
  5377. // TODO better error message
  5378. var keyword = this.lexer.literalNames[keyword_code];
  5379. throw new Error("Error de sintaxe no comando repita_para: esperava-se " + keyword + " mas encontrou " + from_token.text);
  5380. }
  5381. this.pos += 1;
  5382. var int_or_id = this.getToken();
  5383. var is_unary_op = false;
  5384. var op = null;
  5385. if (int_or_id.type === this.lexerClass.SUM_OP) {
  5386. is_unary_op = true;
  5387. op = int_or_id.text;
  5388. this.pos += 1;
  5389. int_or_id = this.getToken();
  5390. }
  5391. var for_from = null;
  5392. if (int_or_id.type === this.lexerClass.ID) {
  5393. for_from = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](this.parseID());
  5394. for_from.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(int_or_id);
  5395. } else if (int_or_id.type === this.lexerClass.INTEGER) {
  5396. this.pos += 1;
  5397. for_from = this.getIntLiteral(int_or_id);
  5398. }
  5399. if (for_from == null) {
  5400. // TODO better error message
  5401. var _keyword = this.lexer.literalNames[keyword_code];
  5402. 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.");
  5403. }
  5404. if (is_unary_op) {
  5405. for_from = new _expressions__WEBPACK_IMPORTED_MODULE_3__["UnaryApp"](Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(op), for_from);
  5406. }
  5407. return for_from;
  5408. }
  5409. }, {
  5410. key: "parseCases",
  5411. value: function parseCases() {
  5412. var token = this.getToken();
  5413. if (token.type !== this.lexerClass.RK_CASE) {
  5414. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(this.lexer.literalNames[this.lexerClass.RK_CASE], token);
  5415. }
  5416. this.pos++;
  5417. var nextToken = this.getToken();
  5418. if (nextToken.type === this.lexerClass.RK_DEFAULT) {
  5419. this.pos++;
  5420. var colonToken = this.getToken();
  5421. if (colonToken.type !== this.lexerClass.COLON) {
  5422. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(':', colonToken);
  5423. }
  5424. this.pos++;
  5425. this.consumeNewLines();
  5426. var block = this.parseCommandBlock(true);
  5427. var defaultCase = new _commands__WEBPACK_IMPORTED_MODULE_4__["Case"](null);
  5428. defaultCase.setCommands(block.commands);
  5429. return [defaultCase];
  5430. } else {
  5431. var exp = this.parseExpressionOR();
  5432. var _colonToken = this.getToken();
  5433. if (_colonToken.type !== this.lexerClass.COLON) {
  5434. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(':', _colonToken);
  5435. }
  5436. this.pos++;
  5437. this.consumeNewLines();
  5438. var _block = this.parseCommandBlock(true);
  5439. var aCase = new _commands__WEBPACK_IMPORTED_MODULE_4__["Case"](exp);
  5440. aCase.setCommands(_block.commands);
  5441. var caseToken = this.getToken();
  5442. if (caseToken.type === this.lexerClass.RK_CASE) {
  5443. return [aCase].concat(this.parseCases());
  5444. } else {
  5445. return [aCase];
  5446. }
  5447. }
  5448. }
  5449. /*
  5450. * Parses an Expression following the structure:
  5451. *
  5452. * EOR => EAnd ( 'or' EOR)? #expression and
  5453. *
  5454. * EOR => ENot ('and' EOR)? #expression or
  5455. *
  5456. * ENot => 'not'? ER #expression not
  5457. *
  5458. * ER => E ((>=, <=, ==, >, <) E)? #expression relational
  5459. *
  5460. * E => factor ((+, -) E)? #expression
  5461. *
  5462. * factor=> term ((*, /, %) factor)?
  5463. *
  5464. * term => literal || arrayAccess || FuncCall || ID || '('EAnd')'
  5465. **/
  5466. }, {
  5467. key: "parseExpressionOR",
  5468. value: function parseExpressionOR() {
  5469. var exp1 = this.parseExpressionAND();
  5470. while (this.getToken().type === this.lexerClass.OR_OPERATOR) {
  5471. var opToken = this.getToken();
  5472. this.pos++;
  5473. var or = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])('or');
  5474. this.consumeNewLines();
  5475. var exp2 = this.parseExpressionAND();
  5476. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](or, exp1, exp2);
  5477. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(opToken);
  5478. exp1 = finalExp;
  5479. }
  5480. return exp1;
  5481. }
  5482. }, {
  5483. key: "parseExpressionAND",
  5484. value: function parseExpressionAND() {
  5485. var exp1 = this.parseExpressionNot();
  5486. while (this.getToken().type === this.lexerClass.AND_OPERATOR) {
  5487. var opToken = this.getToken();
  5488. this.pos++;
  5489. var and = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])('and');
  5490. this.consumeNewLines();
  5491. var exp2 = this.parseExpressionNot();
  5492. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](and, exp1, exp2);
  5493. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(opToken);
  5494. exp1 = finalExp;
  5495. }
  5496. return exp1;
  5497. }
  5498. }, {
  5499. key: "parseExpressionNot",
  5500. value: function parseExpressionNot() {
  5501. var maybeNotToken = this.getToken();
  5502. if (maybeNotToken.type === this.lexerClass.NOT_OPERATOR) {
  5503. var opToken = this.getToken();
  5504. this.pos++;
  5505. var not = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])('not');
  5506. var exp1 = this.parseExpressionRel();
  5507. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["UnaryApp"](not, exp1);
  5508. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(opToken);
  5509. return finalExp;
  5510. } else {
  5511. return this.parseExpressionRel();
  5512. }
  5513. }
  5514. }, {
  5515. key: "parseExpressionRel",
  5516. value: function parseExpressionRel() {
  5517. var exp1 = this.parseExpression();
  5518. while (this.getToken().type === this.lexerClass.RELATIONAL_OPERATOR) {
  5519. var relToken = this.getToken();
  5520. this.pos++;
  5521. var rel = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(relToken.text);
  5522. var exp2 = this.parseExpression();
  5523. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](rel, exp1, exp2);
  5524. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(relToken);
  5525. exp1 = finalExp;
  5526. }
  5527. return exp1;
  5528. }
  5529. }, {
  5530. key: "parseExpression",
  5531. value: function parseExpression() {
  5532. var factor = this.parseFactor();
  5533. while (this.getToken().type === this.lexerClass.SUM_OP) {
  5534. var sumOpToken = this.getToken();
  5535. this.pos++;
  5536. var op = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(sumOpToken.text);
  5537. var factor2 = this.parseFactor();
  5538. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](op, factor, factor2);
  5539. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(sumOpToken);
  5540. factor = finalExp;
  5541. }
  5542. return factor;
  5543. }
  5544. }, {
  5545. key: "parseFactor",
  5546. value: function parseFactor() {
  5547. var term = this.parseTerm();
  5548. while (this.getToken().type === this.lexerClass.MULTI_OP) {
  5549. var multOpToken = this.getToken();
  5550. this.pos++;
  5551. var op = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(multOpToken.text);
  5552. var term2 = this.parseTerm();
  5553. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](op, term, term2);
  5554. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(multOpToken);
  5555. term = finalExp;
  5556. }
  5557. return term;
  5558. }
  5559. }, {
  5560. key: "parseTerm",
  5561. value: function parseTerm() {
  5562. var token = this.getToken();
  5563. var sourceInfo = null;
  5564. var exp = null;
  5565. switch (token.type) {
  5566. case this.lexerClass.SUM_OP:
  5567. this.pos++;
  5568. sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
  5569. exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["UnaryApp"](Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(token.text), this.parseTerm());
  5570. exp.sourceInfo = sourceInfo;
  5571. return exp;
  5572. case this.lexerClass.INTEGER:
  5573. this.pos++;
  5574. return this.getIntLiteral(token);
  5575. case this.lexerClass.REAL:
  5576. this.pos++;
  5577. return this.getRealLiteral(token);
  5578. case this.lexerClass.STRING:
  5579. this.pos++;
  5580. return this.getStringLiteral(token);
  5581. case this.lexerClass.CHARACTER:
  5582. this.pos++;
  5583. return this.getCharLiteral(token);
  5584. case this.lexerClass.RK_TRUE:
  5585. case this.lexerClass.RK_FALSE:
  5586. this.pos++;
  5587. return this.getBoolLiteral(token);
  5588. case this.lexerClass.OPEN_CURLY:
  5589. // No more annonymous array
  5590. // return this.parseArrayLiteral();
  5591. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].annonymous_array_literal(token);
  5592. case this.lexerClass.ID:
  5593. case this.lexerClass.LIB_ID:
  5594. return this.parseIDTerm();
  5595. case this.lexerClass.OPEN_PARENTHESIS:
  5596. return this.parseParenthesisExp();
  5597. default:
  5598. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_terminal(token);
  5599. }
  5600. }
  5601. }, {
  5602. key: "parseIDTerm",
  5603. value: function parseIDTerm() {
  5604. var tokenA = this.getToken();
  5605. var id = this.parseMaybeLibID();
  5606. var isID = tokenA.type === this.lexerClass.ID;
  5607. if (isID && this.checkOpenBrace(true)) {
  5608. var tokenB = null;
  5609. this.pos++;
  5610. var firstIndex = this.parseExpression();
  5611. var secondIndex = null;
  5612. this.consumeNewLines();
  5613. this.checkCloseBrace();
  5614. tokenB = this.getToken();
  5615. this.pos++;
  5616. if (this.checkOpenBrace(true)) {
  5617. this.pos++;
  5618. secondIndex = this.parseExpression();
  5619. this.consumeNewLines();
  5620. this.checkCloseBrace();
  5621. tokenB = this.getToken();
  5622. this.pos++;
  5623. }
  5624. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
  5625. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayAccess"](id, firstIndex, secondIndex);
  5626. exp.sourceInfo = sourceInfo;
  5627. return exp;
  5628. } else if (this.checkOpenParenthesis(true)) {
  5629. return this.parseFunctionCallExpression(id);
  5630. } else if (isID) {
  5631. var _sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(tokenA);
  5632. var _exp2 = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](id);
  5633. _exp2.sourceInfo = _sourceInfo;
  5634. return _exp2;
  5635. } else {
  5636. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_id_format(tokenA);
  5637. }
  5638. }
  5639. }, {
  5640. key: "getFunctionName",
  5641. value: function getFunctionName(id) {
  5642. var name = _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__["LanguageDefinedFunction"].getInternalName(id);
  5643. if (name === null) {
  5644. if (id === _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__["LanguageDefinedFunction"].getMainFunctionName()) {
  5645. return null;
  5646. }
  5647. return id;
  5648. } else {
  5649. return name;
  5650. }
  5651. }
  5652. }, {
  5653. key: "parseFunctionCallExpression",
  5654. value: function parseFunctionCallExpression(id) {
  5655. var tokenA = this.getToken(this.pos - 1);
  5656. var actualParameters = this.parseActualParameters();
  5657. var tokenB = this.getToken(this.pos - 1);
  5658. var funcName = this.getFunctionName(id);
  5659. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
  5660. var cmd = new _expressions__WEBPACK_IMPORTED_MODULE_3__["FunctionCall"](funcName, actualParameters);
  5661. cmd.sourceInfo = sourceInfo;
  5662. return cmd;
  5663. }
  5664. }, {
  5665. key: "parseFunctionCallCommand",
  5666. value: function parseFunctionCallCommand(id) {
  5667. return this.parseFunctionCallExpression(id);
  5668. }
  5669. }, {
  5670. key: "parseParenthesisExp",
  5671. value: function parseParenthesisExp() {
  5672. this.checkOpenParenthesis();
  5673. var tokenA = this.getToken();
  5674. this.pos += 1;
  5675. this.consumeNewLines();
  5676. var exp = this.parseExpressionOR();
  5677. this.consumeNewLines();
  5678. this.checkCloseParenthesis();
  5679. var tokenB = this.getToken();
  5680. this.pos += 1;
  5681. exp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
  5682. exp.parenthesis = true;
  5683. return exp;
  5684. }
  5685. }, {
  5686. key: "parseActualParameters",
  5687. value: function parseActualParameters() {
  5688. this.checkOpenParenthesis();
  5689. this.pos++;
  5690. if (this.checkCloseParenthesis(true)) {
  5691. this.pos++;
  5692. return [];
  5693. }
  5694. this.consumeNewLines();
  5695. var list = this.parseExpressionList();
  5696. this.consumeNewLines();
  5697. this.checkCloseParenthesis();
  5698. this.pos++;
  5699. return list;
  5700. }
  5701. }, {
  5702. key: "parseExpressionList",
  5703. value: function parseExpressionList() {
  5704. var list = [];
  5705. for (;;) {
  5706. var exp = this.parseExpressionOR();
  5707. list.push(exp);
  5708. var maybeToken = this.getToken();
  5709. if (maybeToken.type !== this.lexerClass.COMMA) {
  5710. break;
  5711. } else {
  5712. this.pos++;
  5713. this.consumeNewLines();
  5714. }
  5715. }
  5716. return list;
  5717. }
  5718. }, {
  5719. key: "getTypeArray",
  5720. value: function getTypeArray() {
  5721. var _this = this;
  5722. var types = this.insideScope(IVProgParser.FUNCTION) ? this.functionTypes : this.variableTypes;
  5723. return types.map(function (x) {
  5724. return _this.lexer.literalNames[x];
  5725. });
  5726. }
  5727. }]);
  5728. return IVProgParser;
  5729. }();
  5730. /***/ }),
  5731. /***/ "./js/ast/operators.ts":
  5732. /*!*****************************!*\
  5733. !*** ./js/ast/operators.ts ***!
  5734. \*****************************/
  5735. /*! no static exports found */
  5736. /***/ (function(module, exports, __webpack_require__) {
  5737. "use strict";
  5738. Object.defineProperty(exports, "__esModule", { value: true });
  5739. exports.convertFromString = exports.Operators = void 0;
  5740. exports.Operators = Object.freeze({
  5741. ADD: { ord: 0, value: "+" },
  5742. SUB: { ord: 1, value: "-" },
  5743. MULT: { ord: 2, value: '*' },
  5744. DIV: { ord: 3, value: '/' },
  5745. MOD: { ord: 4, value: '%' },
  5746. GT: { ord: 5, value: '>' },
  5747. GE: { ord: 6, value: '>=' },
  5748. LT: { ord: 7, value: '<' },
  5749. LE: { ord: 8, value: '<=' },
  5750. EQ: { ord: 9, value: '==' },
  5751. NEQ: { ord: 10, value: '!=' },
  5752. AND: { ord: 11, value: 'and' },
  5753. OR: { ord: 12, value: 'or' },
  5754. NOT: { ord: 13, value: 'not' }
  5755. });
  5756. function convertFromString(op) {
  5757. switch (op) {
  5758. case '+': return exports.Operators.ADD;
  5759. case '-': return exports.Operators.SUB;
  5760. case '*': return exports.Operators.MULT;
  5761. case '/': return exports.Operators.DIV;
  5762. case '%': return exports.Operators.MOD;
  5763. case '>': return exports.Operators.GT;
  5764. case '>=': return exports.Operators.GE;
  5765. case '<': return exports.Operators.LT;
  5766. case '<=': return exports.Operators.LE;
  5767. case '==': return exports.Operators.EQ;
  5768. case '!=': return exports.Operators.NEQ;
  5769. case 'and': return exports.Operators.AND;
  5770. case 'or': return exports.Operators.OR;
  5771. case 'not': return exports.Operators.NOT;
  5772. }
  5773. return null;
  5774. }
  5775. exports.convertFromString = convertFromString;
  5776. /***/ }),
  5777. /***/ "./js/ast/sourceInfo.js":
  5778. /*!******************************!*\
  5779. !*** ./js/ast/sourceInfo.js ***!
  5780. \******************************/
  5781. /*! exports provided: SourceInfo */
  5782. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5783. "use strict";
  5784. __webpack_require__.r(__webpack_exports__);
  5785. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SourceInfo", function() { return SourceInfo; });
  5786. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  5787. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  5788. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  5789. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  5790. var SourceInfo = /*#__PURE__*/function () {
  5791. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SourceInfo, null, [{
  5792. key: "createSourceInfo",
  5793. value: function createSourceInfo(token) {
  5794. return new SourceInfo(token.line, token.column, token.text, token.text.length);
  5795. }
  5796. }, {
  5797. key: "createSourceInfoFromList",
  5798. value: function createSourceInfoFromList(tokenA, tokenB) {
  5799. var line = tokenA.line;
  5800. 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
  5801. // No idea why...
  5802. var size = tokenB.tokenIndex + 1 - tokenA.tokenIndex;
  5803. return new SourceInfo(line, column, "", size);
  5804. }
  5805. }]);
  5806. function SourceInfo(line, column, text, size) {
  5807. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SourceInfo);
  5808. this.line = line;
  5809. this.column = column;
  5810. this.text = text;
  5811. this.size = size;
  5812. }
  5813. return SourceInfo;
  5814. }();
  5815. /***/ }),
  5816. /***/ "./js/io/domConsole.js":
  5817. /*!*****************************!*\
  5818. !*** ./js/io/domConsole.js ***!
  5819. \*****************************/
  5820. /*! exports provided: DOMConsole */
  5821. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5822. "use strict";
  5823. __webpack_require__.r(__webpack_exports__);
  5824. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOMConsole", function() { return DOMConsole; });
  5825. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  5826. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  5827. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  5828. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  5829. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  5830. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__);
  5831. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  5832. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__);
  5833. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  5834. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  5835. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../util/config */ "./js/util/config.ts");
  5836. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_6__);
  5837. var DOMConsole = /*#__PURE__*/function () {
  5838. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(DOMConsole, null, [{
  5839. key: "BASH_TEMPLATE",
  5840. get: function get() {
  5841. 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>";
  5842. }
  5843. }, {
  5844. key: "INPUT_CARET_TEMPLATE",
  5845. get: function get() {
  5846. return "\n <div id=\"cmd\">\n <span></span>\n <div id=\"cursor\"></div>\n </div>";
  5847. }
  5848. }, {
  5849. key: "USER",
  5850. get: function get() {
  5851. return 0;
  5852. }
  5853. }, {
  5854. key: "INFO",
  5855. get: function get() {
  5856. return 1;
  5857. }
  5858. }, {
  5859. key: "ERR",
  5860. get: function get() {
  5861. return 2;
  5862. }
  5863. }, {
  5864. key: "INPUT",
  5865. get: function get() {
  5866. return 3;
  5867. }
  5868. }]);
  5869. function DOMConsole(elementID) {
  5870. var disableMarginTop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  5871. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, DOMConsole);
  5872. this.disableMarginTop = disableMarginTop;
  5873. this.input = null;
  5874. this.cursorInterval = null;
  5875. this.idleInterval = null;
  5876. this.inputDiv = null;
  5877. this.inputCMD = null;
  5878. this.inputSpan = null;
  5879. this.cursorRef = null;
  5880. this.needInput = false;
  5881. this.clearBtn = null;
  5882. this.hideBtn = null;
  5883. this.showBtn = null;
  5884. this.termDiv = null;
  5885. this.anyKey = false;
  5886. var actualID = elementID;
  5887. if (elementID[0] === '#') {
  5888. actualID = elementID.substring(1);
  5889. }
  5890. this.parent = document.getElementById(actualID);
  5891. this.setup();
  5892. this.inputListeners = [];
  5893. this.hideInput();
  5894. this.pending_writes = [];
  5895. this.last_clear = -1;
  5896. }
  5897. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(DOMConsole, [{
  5898. key: "setup",
  5899. value: function setup() {
  5900. this._setupDom();
  5901. this._setupEvents();
  5902. }
  5903. }, {
  5904. key: "_setupEvents",
  5905. value: function _setupEvents() {
  5906. this.input.addEventListener('keydown', this.registerInput.bind(this));
  5907. this.clearBtn.addEventListener('click', this.clearBtnClick.bind(this));
  5908. this.hideBtn.addEventListener('click', this.hideBtnClick.bind(this));
  5909. this.showBtn.addEventListener('click', this.showBtnClick.bind(this));
  5910. }
  5911. }, {
  5912. key: "registerInput",
  5913. value: function registerInput(event) {
  5914. if (!this.needInput) {
  5915. return;
  5916. }
  5917. var keyCode = event.which;
  5918. if (keyCode === 13 || this.anyKey) {
  5919. if (this.idleInterval != null) {
  5920. clearInterval(this.idleInterval);
  5921. this.idleInterval = null;
  5922. }
  5923. var text = this.input.value;
  5924. text = text.replace('[\n\r]+', '');
  5925. this.notifyListeners(text);
  5926. this._appendUserInput(text);
  5927. this.input.value = '';
  5928. this.inputSpan.innerHTML = '';
  5929. this.currentLine = null;
  5930. }
  5931. }
  5932. }, {
  5933. key: "_setupDom",
  5934. value: function _setupDom() {
  5935. var bashNode = document.createElement('div');
  5936. bashNode.classList.add('bash');
  5937. bashNode.innerHTML = DOMConsole.BASH_TEMPLATE;
  5938. this.termDiv = bashNode.querySelector("#ivprog-term");
  5939. this.termDiv.classList.add("ivprog-term-div");
  5940. this.inputDiv = document.createElement("div");
  5941. this.inputDiv.id = "ivprog-terminal-inputdiv";
  5942. this.inputDiv.innerHTML = DOMConsole.INPUT_CARET_TEMPLATE;
  5943. this.input = document.createElement("input");
  5944. this.input.setAttribute("name", "command");
  5945. this.input.setAttribute("value", "");
  5946. this.input.setAttribute("type", "text");
  5947. this.inputDiv.append(this.input);
  5948. this.termDiv.append(this.inputDiv);
  5949. bashNode.append(this.termDiv);
  5950. this.parent.append(bashNode);
  5951. this.inputCMD = this.inputDiv.querySelector("#cmd");
  5952. this.cursorRef = this.inputCMD.querySelector("#cursor");
  5953. this.inputSpan = this.inputCMD.querySelector('span');
  5954. this.clearBtn = bashNode.querySelector('#ivprog-console-clearbtn');
  5955. this.hideBtn = bashNode.querySelector('#ivprog-console-hidebtn');
  5956. this.showBtn = bashNode.querySelector('#ivprog-console-showbtn');
  5957. this._setupCursor(); //Jquery tooltips....
  5958. window.$(this.clearBtn).popup({
  5959. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI("tooltip_terminal_clear")
  5960. });
  5961. window.$(this.showBtn).popup({
  5962. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI("tooltip_terminal_show")
  5963. });
  5964. window.$(this.hideBtn).popup({
  5965. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI("tooltip_terminal_hide")
  5966. });
  5967. }
  5968. }, {
  5969. key: "_setupCursor",
  5970. value: function _setupCursor() {
  5971. this.inputCMD.addEventListener('click', this.blinkCaretAndFocus.bind(this)); //this.inputCMD.click();
  5972. this.input.addEventListener('keyup', this.updateSpanText.bind(this));
  5973. this.input.addEventListener('blur', this.stopBlinkCaret.bind(this));
  5974. }
  5975. }, {
  5976. key: "blinkCaretAndFocus",
  5977. value: function blinkCaretAndFocus() {
  5978. var _this = this;
  5979. if (this.cursorInterval != null) {
  5980. return;
  5981. }
  5982. this.input.focus();
  5983. this.cursorInterval = window.setInterval(function () {
  5984. if (_this.cursorRef.style.visibility === 'visible') {
  5985. _this.cursorRef.style.visibility = 'hidden';
  5986. } else {
  5987. _this.cursorRef.style.visibility = 'visible';
  5988. }
  5989. }, 500);
  5990. }
  5991. }, {
  5992. key: "updateSpanText",
  5993. value: function updateSpanText() {
  5994. this.inputSpan.innerHTML = this.input.value;
  5995. if (this.idleInterval != null) window.clearInterval(this.idleInterval);
  5996. this.scheduleNotify();
  5997. }
  5998. }, {
  5999. key: "stopBlinkCaret",
  6000. value: function stopBlinkCaret() {
  6001. clearInterval(this.cursorInterval);
  6002. this.cursorInterval = null;
  6003. this.cursorRef.style.visibility = 'visible';
  6004. }
  6005. }, {
  6006. key: "notifyListeners",
  6007. value: function notifyListeners(text) {
  6008. this.inputListeners.forEach(function (resolve) {
  6009. return resolve(text);
  6010. });
  6011. this.inputListeners.splice(0, this.inputListeners.length);
  6012. this.hideInput();
  6013. this.anyKey = false;
  6014. }
  6015. }, {
  6016. key: "write",
  6017. value: function write(text) {
  6018. var newLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  6019. this._appendText(text, DOMConsole.USER, newLine);
  6020. }
  6021. }, {
  6022. key: "info",
  6023. value: function info(text) {
  6024. this._appendTextLn(text, DOMConsole.INFO);
  6025. }
  6026. }, {
  6027. key: "err",
  6028. value: function err(text) {
  6029. this._appendTextLn(text, DOMConsole.ERR);
  6030. }
  6031. }, {
  6032. key: "_appendText",
  6033. value: function () {
  6034. 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) {
  6035. var newLine,
  6036. write_time,
  6037. divClass,
  6038. textDiv,
  6039. _args = arguments;
  6040. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  6041. while (1) {
  6042. switch (_context.prev = _context.next) {
  6043. case 0:
  6044. newLine = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
  6045. write_time = Date.now();
  6046. this.pending_writes.push(0);
  6047. _context.next = 5;
  6048. return _util_utils__WEBPACK_IMPORTED_MODULE_5__["sleep"](5);
  6049. case 5:
  6050. this.pending_writes.pop();
  6051. if (!(this.last_clear >= write_time)) {
  6052. _context.next = 8;
  6053. break;
  6054. }
  6055. return _context.abrupt("return");
  6056. case 8:
  6057. if (this.currentLine == null) {
  6058. divClass = this.getClassForType(type);
  6059. textDiv = document.createElement('div');
  6060. textDiv.classList.add(divClass);
  6061. this.termDiv.insertBefore(textDiv, this.inputDiv);
  6062. this.currentLine = textDiv;
  6063. }
  6064. this.currentLine.innerHTML += this.getOutputText(text);
  6065. if (newLine) {
  6066. console.debug("append newline");
  6067. this.currentLine = null;
  6068. }
  6069. this.scrollTerm();
  6070. case 12:
  6071. case "end":
  6072. return _context.stop();
  6073. }
  6074. }
  6075. }, _callee, this);
  6076. }));
  6077. function _appendText(_x, _x2) {
  6078. return _appendText2.apply(this, arguments);
  6079. }
  6080. return _appendText;
  6081. }()
  6082. }, {
  6083. key: "_appendTextLn",
  6084. value: function () {
  6085. 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) {
  6086. var filter,
  6087. write_time,
  6088. divClass,
  6089. textDiv,
  6090. _args2 = arguments;
  6091. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  6092. while (1) {
  6093. switch (_context2.prev = _context2.next) {
  6094. case 0:
  6095. filter = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : true;
  6096. write_time = Date.now();
  6097. this.pending_writes.push(0);
  6098. _context2.next = 5;
  6099. return _util_utils__WEBPACK_IMPORTED_MODULE_5__["sleep"](5);
  6100. case 5:
  6101. this.pending_writes.pop();
  6102. if (!(this.last_clear >= write_time)) {
  6103. _context2.next = 8;
  6104. break;
  6105. }
  6106. return _context2.abrupt("return");
  6107. case 8:
  6108. divClass = this.getClassForType(type);
  6109. textDiv = document.createElement('div');
  6110. textDiv.classList.add(divClass);
  6111. if (filter) textDiv.innerHTML = this.getOutputText(text);else textDiv.innerHTML = "<span>".concat(text, "</span>");
  6112. this.termDiv.insertBefore(textDiv, this.inputDiv);
  6113. this.currentLine = null;
  6114. this.scrollTerm();
  6115. case 15:
  6116. case "end":
  6117. return _context2.stop();
  6118. }
  6119. }
  6120. }, _callee2, this);
  6121. }));
  6122. function _appendTextLn(_x3, _x4) {
  6123. return _appendTextLn2.apply(this, arguments);
  6124. }
  6125. return _appendTextLn;
  6126. }()
  6127. }, {
  6128. key: "_appendUserInput",
  6129. value: function () {
  6130. 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) {
  6131. var write_time, divClass, textDiv;
  6132. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
  6133. while (1) {
  6134. switch (_context3.prev = _context3.next) {
  6135. case 0:
  6136. write_time = Date.now();
  6137. this.pending_writes.push(0);
  6138. _context3.next = 4;
  6139. return _util_utils__WEBPACK_IMPORTED_MODULE_5__["sleep"](5);
  6140. case 4:
  6141. this.pending_writes.pop();
  6142. if (!(this.last_clear >= write_time)) {
  6143. _context3.next = 7;
  6144. break;
  6145. }
  6146. return _context3.abrupt("return");
  6147. case 7:
  6148. divClass = this.getClassForType(DOMConsole.INPUT);
  6149. textDiv = document.createElement('div');
  6150. textDiv.innerHTML = this.getUserInputText(text);
  6151. textDiv.classList.add(divClass);
  6152. this.termDiv.insertBefore(textDiv, this.inputDiv);
  6153. this.currentLine = null;
  6154. this.scrollTerm();
  6155. case 14:
  6156. case "end":
  6157. return _context3.stop();
  6158. }
  6159. }
  6160. }, _callee3, this);
  6161. }));
  6162. function _appendUserInput(_x5) {
  6163. return _appendUserInput2.apply(this, arguments);
  6164. }
  6165. return _appendUserInput;
  6166. }()
  6167. }, {
  6168. key: "getOutputText",
  6169. value: function getOutputText(text) {
  6170. text = text.replace(/\s/g, "&#160;");
  6171. return "<span>".concat(text, "</span>");
  6172. }
  6173. }, {
  6174. key: "getUserInputText",
  6175. value: function getUserInputText(text) {
  6176. if (text.trim().length == 0) {
  6177. text = "&nbsp;";
  6178. }
  6179. return "<i class=\"icon keyboard outline\" style=\"float:left\"></i><span>".concat(text, "</span>");
  6180. }
  6181. }, {
  6182. key: "scrollTerm",
  6183. value: function scrollTerm() {
  6184. //scrollIt(this.inputDiv.previousSibling,200);
  6185. this.termDiv.scrollTop = this.termDiv.scrollHeight;
  6186. }
  6187. }, {
  6188. key: "focus",
  6189. value: function focus() {
  6190. this.termDiv.style.display = 'block'; // Is in draggable mode?
  6191. if (!this.disableMarginTop && this.parent.style.top.length == 0) {
  6192. this.parent.style.marginTop = "-160px";
  6193. }
  6194. if (this.needInput) {
  6195. this.showInput();
  6196. this.scheduleNotify();
  6197. }
  6198. if (!_util_utils__WEBPACK_IMPORTED_MODULE_5__["isElementInViewport"](this.termDiv)) this.termDiv.scrollIntoView(false);
  6199. this.scrollTerm();
  6200. }
  6201. }, {
  6202. key: "hide",
  6203. value: function hide() {
  6204. if (this.needInput) {
  6205. clearInterval(this.idleInterval);
  6206. this.hideInput();
  6207. this.needInput = true;
  6208. } // Is in draggable mode?
  6209. if (!this.disableMarginTop && this.parent.style.top.length == 0) {
  6210. this.parent.style.marginTop = "0";
  6211. }
  6212. this.termDiv.style.display = 'none';
  6213. }
  6214. }, {
  6215. key: "getClassForType",
  6216. value: function getClassForType(type) {
  6217. switch (type) {
  6218. case DOMConsole.INPUT:
  6219. return "ivprog-term-userInput";
  6220. case DOMConsole.USER:
  6221. return "ivprog-term-userText";
  6222. case DOMConsole.INFO:
  6223. return "ivprog-term-info";
  6224. case DOMConsole.ERR:
  6225. return "ivprog-term-error";
  6226. }
  6227. }
  6228. }, {
  6229. key: "dispose",
  6230. value: function dispose() {
  6231. this.input.removeEventListener('keyup', this.updateSpanText.bind(this));
  6232. this.input.removeEventListener('blur', this.stopBlinkCaret.bind(this));
  6233. this.input.removeEventListener('keydown', this.registerInput.bind(this));
  6234. this.inputCMD.removeEventListener('click', this.blinkCaretAndFocus.bind(this));
  6235. this.clearBtn.removeEventListener('click', this.clearBtnClick.bind(this));
  6236. this.hideBtn.removeEventListener('click', this.hideBtnClick.bind(this));
  6237. this.showBtn.removeEventListener('click', this.showBtnClick.bind(this));
  6238. this.input = null;
  6239. this.inputCMD = null;
  6240. this.inputDiv = null;
  6241. this.termDiv = null;
  6242. this.inputSpan = null;
  6243. this.cursorRef = null;
  6244. this.clearBtn = null;
  6245. this.hideBtn = null;
  6246. this.showBtn = null;
  6247. this.currentLine = null;
  6248. var cNode = this.parent.cloneNode(false);
  6249. this.parent.parentNode.replaceChild(cNode, this.parent);
  6250. if (this.cursorInterval != null) {
  6251. clearInterval(this.cursorInterval);
  6252. }
  6253. if (this.idleInterval != null) {
  6254. clearInterval(this.idleInterval);
  6255. }
  6256. }
  6257. }, {
  6258. key: "showInput",
  6259. value: function showInput() {
  6260. this.needInput = true;
  6261. this.inputDiv.style.display = 'block';
  6262. this.inputCMD.click(); //this.inputCMD.scrollIntoView();
  6263. this.scrollTerm();
  6264. }
  6265. }, {
  6266. key: "hideInput",
  6267. value: function hideInput() {
  6268. this.needInput = false;
  6269. this.inputDiv.style.display = ' none';
  6270. clearInterval(this.cursorInterval);
  6271. this.cursorInterval = null;
  6272. }
  6273. }, {
  6274. key: "requestInput",
  6275. value: function requestInput() {
  6276. var _this2 = this;
  6277. var anyKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  6278. var promise = new Promise(function (resolve, _) {
  6279. _this2.inputListeners.push(resolve);
  6280. _this2.anyKey = anyKey;
  6281. if (_this2.idleInterval == null) _this2.scheduleNotify();
  6282. _this2.showInput();
  6283. });
  6284. return promise;
  6285. }
  6286. }, {
  6287. key: "sendOutput",
  6288. value: function sendOutput(text) {
  6289. console.debug(text);
  6290. var output = "" + text;
  6291. if (output.indexOf('\n') !== -1) {
  6292. console.debug("newline");
  6293. var outputList = output.split('\n');
  6294. var i = 0;
  6295. for (; i < outputList.length - 1; i += 1) {
  6296. console.debug("newline write");
  6297. var _t = outputList[i];
  6298. _t = _t.replace(/\t/g, '&#x0020;&#x0020;');
  6299. _t = _t.replace(/\s/g, "&#x0020;");
  6300. if (_t.length == 0) _t = "&nbsp;";
  6301. this.write(_t, true);
  6302. }
  6303. var t = outputList[i];
  6304. t = t.replace(/\t/g, '&#x0020;&#x0020;');
  6305. t = t.replace(/\s/g, "&#x0020;");
  6306. if (t.length != 0) this.write(t);
  6307. } else {
  6308. console.debug("no newline");
  6309. output = output.replace(/\t/g, '&#x0020;&#x0020;');
  6310. output = output.replace(/\s/g, "&#x0020;");
  6311. this.write(output);
  6312. }
  6313. }
  6314. }, {
  6315. key: "clearPendingWrites",
  6316. value: function clearPendingWrites() {
  6317. this.last_clear = Date.now();
  6318. }
  6319. }, {
  6320. key: "clear",
  6321. value: function clear() {
  6322. this.clearPendingWrites();
  6323. while (this.inputDiv.parentElement.childNodes.length > 1) {
  6324. this.inputDiv.parentElement.removeChild(this.inputDiv.parentElement.firstChild);
  6325. }
  6326. this.input.value = '';
  6327. this.inputSpan.innerHTML = '';
  6328. this.currentLine = null;
  6329. }
  6330. }, {
  6331. key: "clearBtnClick",
  6332. value: function clearBtnClick() {
  6333. this.clear();
  6334. }
  6335. }, {
  6336. key: "showBtnClick",
  6337. value: function showBtnClick() {
  6338. this.focus();
  6339. }
  6340. }, {
  6341. key: "hideBtnClick",
  6342. value: function hideBtnClick() {
  6343. this.hide();
  6344. }
  6345. }, {
  6346. key: "notifyIdle",
  6347. value: function notifyIdle() {
  6348. this.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getMessage('awaiting_input_message'));
  6349. this.inputCMD.click();
  6350. }
  6351. }, {
  6352. key: "scheduleNotify",
  6353. value: function scheduleNotify() {
  6354. this.idleInterval = window.setInterval(this.notifyIdle.bind(this), _util_config__WEBPACK_IMPORTED_MODULE_6__["Config"].idle_input_interval);
  6355. }
  6356. }, {
  6357. key: "cancelPendingInputRequests",
  6358. value: function cancelPendingInputRequests() {
  6359. this.inputListeners.forEach(function (resolve) {
  6360. return resolve('');
  6361. });
  6362. this.inputListeners.splice(0, this.inputListeners.length);
  6363. if (this.idleInterval != null) {
  6364. clearInterval(this.idleInterval);
  6365. this.idleInterval = null;
  6366. }
  6367. this.input.value = '';
  6368. this.inputSpan.innerHTML = '';
  6369. this.currentLine = null;
  6370. this.hideInput();
  6371. this.anyKey = false;
  6372. }
  6373. }]);
  6374. return DOMConsole;
  6375. }();
  6376. /***/ }),
  6377. /***/ "./js/io/input.js":
  6378. /*!************************!*\
  6379. !*** ./js/io/input.js ***!
  6380. \************************/
  6381. /*! exports provided: Input */
  6382. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6383. "use strict";
  6384. __webpack_require__.r(__webpack_exports__);
  6385. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return Input; });
  6386. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  6387. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  6388. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  6389. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  6390. var Input = /*#__PURE__*/function () {
  6391. function Input() {
  6392. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Input);
  6393. }
  6394. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Input, [{
  6395. key: "requestInput",
  6396. value: function requestInput() {
  6397. throw new Error("Must be implemented");
  6398. }
  6399. }, {
  6400. key: "cancelPendingInputRequests",
  6401. value: function cancelPendingInputRequests() {
  6402. throw new Error("Must be implemented");
  6403. }
  6404. }]);
  6405. return Input;
  6406. }();
  6407. /***/ }),
  6408. /***/ "./js/io/output.js":
  6409. /*!*************************!*\
  6410. !*** ./js/io/output.js ***!
  6411. \*************************/
  6412. /*! exports provided: Output */
  6413. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6414. "use strict";
  6415. __webpack_require__.r(__webpack_exports__);
  6416. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Output", function() { return Output; });
  6417. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  6418. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  6419. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  6420. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  6421. var Output = /*#__PURE__*/function () {
  6422. function Output() {
  6423. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Output);
  6424. }
  6425. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Output, [{
  6426. key: "sendOutput",
  6427. value: function sendOutput(text) {
  6428. throw new Error("Must be implemented");
  6429. }
  6430. }]);
  6431. return Output;
  6432. }();
  6433. /***/ }),
  6434. /***/ "./js/main.js":
  6435. /*!********************!*\
  6436. !*** ./js/main.js ***!
  6437. \********************/
  6438. /*! exports provided: runner, initVisualUI, addFunctionChangeListener, addGlobalChangeListener, removeFunctionListener, removeGlobalListener, getTestCases, autoEval, prepareActivityToStudentHelper, LocalizedStrings, i18n, getLogs, getLogsAsString, registerClick, registerUserEvent, parseLogs, ActionTypes, CodeEditor, openAssessmentDetail, autoGenerateTestCaseOutput, Config */
  6439. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6440. "use strict";
  6441. __webpack_require__.r(__webpack_exports__);
  6442. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocalizedStrings", function() { return LocalizedStrings; });
  6443. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i18n", function() { return i18n; });
  6444. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeEditor", function() { return CodeEditor; });
  6445. /* harmony import */ var _runner__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./runner */ "./js/runner.js");
  6446. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "runner", function() { return _runner__WEBPACK_IMPORTED_MODULE_0__["runner"]; });
  6447. /* harmony import */ var _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./visualUI/functions */ "./js/visualUI/functions.js");
  6448. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initVisualUI", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["initVisualUI"]; });
  6449. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addFunctionChangeListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["addFunctionChangeListener"]; });
  6450. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addGlobalChangeListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["addGlobalChangeListener"]; });
  6451. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeFunctionListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["removeFunctionListener"]; });
  6452. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeGlobalListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["removeGlobalListener"]; });
  6453. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getTestCases", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["getTestCases"]; });
  6454. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./services/localizedStringsService */ "./js/services/localizedStringsService.js");
  6455. /* harmony import */ var _services_i18nHelper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/i18nHelper */ "./js/services/i18nHelper.js");
  6456. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./services/userLog */ "./js/services/userLog.js");
  6457. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLogs", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["getLogs"]; });
  6458. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLogsAsString", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["getLogsAsString"]; });
  6459. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerClick", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerClick"]; });
  6460. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerUserEvent", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"]; });
  6461. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseLogs", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["parseLogs"]; });
  6462. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ActionTypes", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"]; });
  6463. /* harmony import */ var _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util/iassignHelpers */ "./js/util/iassignHelpers.js");
  6464. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autoEval", function() { return _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__["autoEval"]; });
  6465. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareActivityToStudentHelper", function() { return _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__["prepareActivityToStudentHelper"]; });
  6466. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util/utils */ "./js/util/utils.js");
  6467. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "openAssessmentDetail", function() { return _util_utils__WEBPACK_IMPORTED_MODULE_6__["openAssessmentDetail"]; });
  6468. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./util/config */ "./js/util/config.ts");
  6469. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_7__);
  6470. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Config", function() { return _util_config__WEBPACK_IMPORTED_MODULE_7__["Config"]; });
  6471. /* harmony import */ var _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./visualUI/text_editor */ "./js/visualUI/text_editor.js");
  6472. /* harmony import */ var _util_auto_gen_output__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./util/auto_gen_output */ "./js/util/auto_gen_output.js");
  6473. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autoGenerateTestCaseOutput", function() { return _util_auto_gen_output__WEBPACK_IMPORTED_MODULE_9__["autoGenerateTestCaseOutput"]; });
  6474. var CodeEditor = {
  6475. initTextEditor: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__["initTextEditor"],
  6476. setCode: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__["setCode"],
  6477. getCode: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__["getCode"],
  6478. updateEditor: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__["updateEditor"],
  6479. disable: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__["disable"]
  6480. };
  6481. var i18n = _services_i18nHelper__WEBPACK_IMPORTED_MODULE_3__["i18nHelper"].i18n;
  6482. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["getInstance"]();
  6483. /***/ }),
  6484. /***/ "./js/memory/address.ts":
  6485. /*!******************************!*\
  6486. !*** ./js/memory/address.ts ***!
  6487. \******************************/
  6488. /*! no static exports found */
  6489. /***/ (function(module, exports, __webpack_require__) {
  6490. "use strict";
  6491. Object.defineProperty(exports, "__esModule", { value: true });
  6492. exports.Address = void 0;
  6493. class Address {
  6494. /**
  6495. *
  6496. * @param {Number} id the address id
  6497. * @param {never} value the value stored at this address
  6498. */
  6499. constructor(id, value) {
  6500. this.id = id;
  6501. this.value = value;
  6502. }
  6503. }
  6504. exports.Address = Address;
  6505. /***/ }),
  6506. /***/ "./js/memory/location.ts":
  6507. /*!*******************************!*\
  6508. !*** ./js/memory/location.ts ***!
  6509. \*******************************/
  6510. /*! no static exports found */
  6511. /***/ (function(module, exports, __webpack_require__) {
  6512. "use strict";
  6513. Object.defineProperty(exports, "__esModule", { value: true });
  6514. exports.Location = void 0;
  6515. const address_1 = __webpack_require__(/*! ./address */ "./js/memory/address.ts");
  6516. class LocationHolder {
  6517. constructor() {
  6518. this.data = [];
  6519. this.address_id = 0;
  6520. }
  6521. /**
  6522. *
  6523. * @param {never} value the value to be allocated
  6524. * @returns {number} - the address id
  6525. */
  6526. allocate(value) {
  6527. const id = this.address_id;
  6528. // console.log("Allocation address "+ id);
  6529. const address = new address_1.Address(id, value);
  6530. this.data.push(address);
  6531. this.address_id += 1;
  6532. return id;
  6533. }
  6534. /**
  6535. *
  6536. * @param {number} id
  6537. */
  6538. deallocate(id) {
  6539. const index = this.findIndex(id);
  6540. // console.log("Deallocation address "+ id);
  6541. if (index !== -1) {
  6542. this.data.splice(index, 1);
  6543. return true;
  6544. }
  6545. return false;
  6546. }
  6547. /**
  6548. *
  6549. * @param {number} id
  6550. * @returns {Address} the address identified by id
  6551. */
  6552. find(id) {
  6553. let beg = 0;
  6554. let end = this.data.length;
  6555. // console.log("Finding address "+id);
  6556. while (beg < end) {
  6557. const med = Math.floor((beg + end) / 2);
  6558. const address = this.getAddressAt(med);
  6559. if (address.id === id) {
  6560. return address;
  6561. }
  6562. else if (id > address.id) {
  6563. beg = med;
  6564. }
  6565. else {
  6566. end = med;
  6567. }
  6568. }
  6569. return undefined;
  6570. }
  6571. getAddressAt(pos) {
  6572. return this.data[pos];
  6573. }
  6574. /**
  6575. *
  6576. * @param {number} id address id
  6577. * @returns {number} the index of the address identified by id
  6578. */
  6579. findIndex(id) {
  6580. let beg = 0;
  6581. let end = this.data.length;
  6582. while (beg < end) {
  6583. const med = Math.floor((beg + end) / 2);
  6584. const address = this.getAddressAt(med);
  6585. if (address.id === id) {
  6586. return med;
  6587. }
  6588. else if (id > address.id) {
  6589. beg = med;
  6590. }
  6591. else {
  6592. end = med;
  6593. }
  6594. }
  6595. return -1;
  6596. }
  6597. updateAddress(id, value) {
  6598. const index = this.findIndex(id);
  6599. if (index === -1) {
  6600. throw new Error("Invalid address..." + id);
  6601. }
  6602. this.data[index].value = value;
  6603. }
  6604. clear() {
  6605. for (let i = 0; i < this.data.length; i += 1) {
  6606. delete this.data[i];
  6607. }
  6608. this.data = [];
  6609. this.address_id = 0;
  6610. }
  6611. }
  6612. const inner_ref = new LocationHolder();
  6613. exports.Location = Object.freeze({
  6614. allocate: inner_ref.allocate.bind(inner_ref),
  6615. deallocate: inner_ref.deallocate.bind(inner_ref),
  6616. find: inner_ref.find.bind(inner_ref),
  6617. updateAddress: inner_ref.updateAddress.bind(inner_ref),
  6618. clear: inner_ref.clear.bind(inner_ref),
  6619. size: () => inner_ref.data.length
  6620. });
  6621. /***/ }),
  6622. /***/ "./js/processor/compatibilityTable.ts":
  6623. /*!********************************************!*\
  6624. !*** ./js/processor/compatibilityTable.ts ***!
  6625. \********************************************/
  6626. /*! no static exports found */
  6627. /***/ (function(module, exports, __webpack_require__) {
  6628. "use strict";
  6629. Object.defineProperty(exports, "__esModule", { value: true });
  6630. exports.resultTypeAfterUnaryOp = exports.resultTypeAfterInfixOp = void 0;
  6631. const types_1 = __webpack_require__(/*! ../typeSystem/types */ "./js/typeSystem/types.ts");
  6632. const operators_1 = __webpack_require__(/*! ../ast/operators */ "./js/ast/operators.ts");
  6633. const multiType_1 = __webpack_require__(/*! ../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  6634. const config_1 = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
  6635. function buildInfixAddTable() {
  6636. const table = [[], [], [], [], []];
  6637. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
  6638. table[types_1.Types.INTEGER.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
  6639. table[types_1.Types.INTEGER.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
  6640. table[types_1.Types.REAL.ord][types_1.Types.INTEGER.ord] = types_1.Types.REAL;
  6641. table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
  6642. table[types_1.Types.REAL.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
  6643. table[types_1.Types.STRING.ord][types_1.Types.INTEGER.ord] = types_1.Types.STRING;
  6644. table[types_1.Types.STRING.ord][types_1.Types.REAL.ord] = types_1.Types.STRING;
  6645. table[types_1.Types.STRING.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
  6646. table[types_1.Types.STRING.ord][types_1.Types.BOOLEAN.ord] = types_1.Types.STRING;
  6647. table[types_1.Types.STRING.ord][types_1.Types.CHAR.ord] = types_1.Types.STRING;
  6648. table[types_1.Types.CHAR.ord][types_1.Types.CHAR.ord] = types_1.Types.STRING;
  6649. table[types_1.Types.CHAR.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
  6650. return table;
  6651. }
  6652. function buildInfixMultiDivSubTable() {
  6653. const table = [[], []];
  6654. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
  6655. table[types_1.Types.INTEGER.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
  6656. table[types_1.Types.REAL.ord][types_1.Types.INTEGER.ord] = types_1.Types.REAL;
  6657. table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
  6658. return table;
  6659. }
  6660. function buildInfixEqualityInequalityTable() {
  6661. const table = [[], [], [], [], []];
  6662. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.BOOLEAN;
  6663. table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.BOOLEAN;
  6664. table[types_1.Types.BOOLEAN.ord][types_1.Types.BOOLEAN.ord] = types_1.Types.BOOLEAN;
  6665. table[types_1.Types.STRING.ord][types_1.Types.STRING.ord] = types_1.Types.BOOLEAN;
  6666. table[types_1.Types.CHAR.ord][types_1.Types.CHAR.ord] = types_1.Types.BOOLEAN;
  6667. return table;
  6668. }
  6669. function buildInfixRelationalTable() {
  6670. const table = [[], [], [], [], []];
  6671. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.BOOLEAN;
  6672. table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.BOOLEAN;
  6673. table[types_1.Types.STRING.ord][types_1.Types.STRING.ord] = types_1.Types.BOOLEAN;
  6674. table[types_1.Types.CHAR.ord][types_1.Types.CHAR.ord] = types_1.Types.BOOLEAN;
  6675. return table;
  6676. }
  6677. function buildInfixAndOrTable() {
  6678. const table = [[], [], [], []];
  6679. table[types_1.Types.BOOLEAN.ord][types_1.Types.BOOLEAN.ord] = types_1.Types.BOOLEAN;
  6680. return table;
  6681. }
  6682. function buildInfixModTable() {
  6683. const table = [[]];
  6684. table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
  6685. return table;
  6686. }
  6687. function buildUnarySumSubList() {
  6688. const list = [];
  6689. list[types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
  6690. list[types_1.Types.REAL.ord] = types_1.Types.REAL;
  6691. return list;
  6692. }
  6693. function buildUnaryNegList() {
  6694. const list = [];
  6695. list[types_1.Types.BOOLEAN.ord] = types_1.Types.BOOLEAN;
  6696. return list;
  6697. }
  6698. function buildInfixCompatibilityTable() {
  6699. const compatibilityMap = new WeakMap();
  6700. compatibilityMap.set(operators_1.Operators.ADD, buildInfixAddTable());
  6701. compatibilityMap.set(operators_1.Operators.SUB, buildInfixMultiDivSubTable());
  6702. compatibilityMap.set(operators_1.Operators.MULT, buildInfixMultiDivSubTable());
  6703. compatibilityMap.set(operators_1.Operators.DIV, buildInfixMultiDivSubTable());
  6704. compatibilityMap.set(operators_1.Operators.EQ, buildInfixEqualityInequalityTable());
  6705. compatibilityMap.set(operators_1.Operators.NEQ, buildInfixEqualityInequalityTable());
  6706. compatibilityMap.set(operators_1.Operators.GE, buildInfixRelationalTable());
  6707. compatibilityMap.set(operators_1.Operators.GT, buildInfixRelationalTable());
  6708. compatibilityMap.set(operators_1.Operators.LE, buildInfixRelationalTable());
  6709. compatibilityMap.set(operators_1.Operators.LT, buildInfixRelationalTable());
  6710. compatibilityMap.set(operators_1.Operators.OR, buildInfixAndOrTable());
  6711. compatibilityMap.set(operators_1.Operators.AND, buildInfixAndOrTable());
  6712. compatibilityMap.set(operators_1.Operators.MOD, buildInfixModTable());
  6713. return compatibilityMap;
  6714. }
  6715. function buildUnaryCompatibilityTable() {
  6716. const compatibilityMap = new WeakMap();
  6717. compatibilityMap.set(operators_1.Operators.ADD, buildUnarySumSubList());
  6718. compatibilityMap.set(operators_1.Operators.SUB, buildUnarySumSubList());
  6719. compatibilityMap.set(operators_1.Operators.NOT, buildUnaryNegList());
  6720. return compatibilityMap;
  6721. }
  6722. const infixMap = buildInfixCompatibilityTable();
  6723. const unaryMap = buildUnaryCompatibilityTable();
  6724. function resultTypeAfterInfixOp(operator, leftExpressionType, rightExpressionType) {
  6725. try {
  6726. if (leftExpressionType instanceof multiType_1.MultiType && rightExpressionType instanceof multiType_1.MultiType) {
  6727. let newMulti = [];
  6728. for (let i = 0; i < leftExpressionType.types.length; ++i) {
  6729. const typeA = leftExpressionType.types[i];
  6730. for (let j = 0; j < rightExpressionType.types.length; ++i) {
  6731. const typeB = rightExpressionType.types[j];
  6732. newMulti.push(resultTypeAfterInfixOp(operator, typeA, typeB));
  6733. }
  6734. }
  6735. newMulti = newMulti.filter(x => !x.isCompatible(types_1.Types.UNDEFINED));
  6736. if (newMulti.length <= 0) {
  6737. if (config_1.Config.enable_type_casting) {
  6738. if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
  6739. if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
  6740. return new multiType_1.MultiType([types_1.Types.INTEGER, types_1.Types.REAL]);
  6741. }
  6742. }
  6743. }
  6744. return types_1.Types.UNDEFINED;
  6745. }
  6746. else {
  6747. return new multiType_1.MultiType(newMulti);
  6748. }
  6749. }
  6750. else if (leftExpressionType instanceof multiType_1.MultiType) {
  6751. if (leftExpressionType.isCompatible(rightExpressionType)) {
  6752. return resultTypeAfterInfixOp(operator, rightExpressionType, rightExpressionType);
  6753. }
  6754. else {
  6755. if (config_1.Config.enable_type_casting) {
  6756. if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
  6757. if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
  6758. return rightExpressionType;
  6759. }
  6760. }
  6761. }
  6762. return types_1.Types.UNDEFINED;
  6763. }
  6764. }
  6765. else if (rightExpressionType instanceof multiType_1.MultiType) {
  6766. if (rightExpressionType.isCompatible(leftExpressionType)) {
  6767. return resultTypeAfterInfixOp(operator, leftExpressionType, leftExpressionType);
  6768. }
  6769. else {
  6770. if (config_1.Config.enable_type_casting) {
  6771. if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
  6772. if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
  6773. return leftExpressionType;
  6774. }
  6775. }
  6776. }
  6777. return types_1.Types.UNDEFINED;
  6778. }
  6779. }
  6780. const resultTable = infixMap.get(operator) || [];
  6781. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  6782. const resultType = resultTable[leftExpressionType.ord][rightExpressionType.ord];
  6783. if (resultType === null || resultType === undefined) {
  6784. if (config_1.Config.enable_type_casting) {
  6785. if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
  6786. if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
  6787. if (operator === operators_1.Operators.MOD) {
  6788. return types_1.Types.INTEGER;
  6789. }
  6790. else if (operator.ord >= 5 && operator.ord <= 10) {
  6791. return types_1.Types.BOOLEAN;
  6792. }
  6793. }
  6794. }
  6795. }
  6796. return types_1.Types.UNDEFINED;
  6797. }
  6798. return resultType;
  6799. }
  6800. catch (e) {
  6801. if (e instanceof TypeError) {
  6802. return types_1.Types.UNDEFINED;
  6803. }
  6804. else {
  6805. throw e;
  6806. }
  6807. }
  6808. }
  6809. exports.resultTypeAfterInfixOp = resultTypeAfterInfixOp;
  6810. function resultTypeAfterUnaryOp(operator, leftExpressionType) {
  6811. try {
  6812. if (leftExpressionType instanceof multiType_1.MultiType) {
  6813. let newMulti = [];
  6814. for (let i = 0; i < leftExpressionType.types.length; ++i) {
  6815. const type = leftExpressionType.types[i];
  6816. newMulti.push(resultTypeAfterUnaryOp(operator, type));
  6817. }
  6818. newMulti = newMulti.filter(x => !x.isCompatible(types_1.Types.UNDEFINED));
  6819. if (newMulti.length <= 0) {
  6820. return types_1.Types.UNDEFINED;
  6821. }
  6822. return new multiType_1.MultiType(newMulti);
  6823. }
  6824. const resultTable = unaryMap.get(operator) || [];
  6825. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  6826. const resultType = resultTable[leftExpressionType.ord];
  6827. if (resultType == null) {
  6828. return types_1.Types.UNDEFINED;
  6829. }
  6830. return resultType;
  6831. }
  6832. catch (e) {
  6833. if (e instanceof TypeError) {
  6834. return types_1.Types.UNDEFINED;
  6835. }
  6836. else {
  6837. throw e;
  6838. }
  6839. }
  6840. }
  6841. exports.resultTypeAfterUnaryOp = resultTypeAfterUnaryOp;
  6842. /***/ }),
  6843. /***/ "./js/processor/context.ts":
  6844. /*!*********************************!*\
  6845. !*** ./js/processor/context.ts ***!
  6846. \*********************************/
  6847. /*! no static exports found */
  6848. /***/ (function(module, exports, __webpack_require__) {
  6849. "use strict";
  6850. Object.defineProperty(exports, "__esModule", { value: true });
  6851. exports.Context = void 0;
  6852. exports.Context = Object.freeze({
  6853. BASE: Symbol('context:base'),
  6854. BREAKABLE: Symbol('context:breakable'),
  6855. FUNCTION: Symbol('context:function')
  6856. });
  6857. /***/ }),
  6858. /***/ "./js/processor/definedFunctions.js":
  6859. /*!******************************************!*\
  6860. !*** ./js/processor/definedFunctions.js ***!
  6861. \******************************************/
  6862. /*! exports provided: LanguageDefinedFunction */
  6863. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6864. "use strict";
  6865. __webpack_require__.r(__webpack_exports__);
  6866. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LanguageDefinedFunction", function() { return LanguageDefinedFunction; });
  6867. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../services/languageService */ "./js/services/languageService.js");
  6868. /* harmony import */ var _lib_io__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/io */ "./js/processor/lib/io.js");
  6869. /* harmony import */ var _lib_strings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/strings */ "./js/processor/lib/strings.js");
  6870. /* harmony import */ var _lib_arrays__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/arrays */ "./js/processor/lib/arrays.js");
  6871. /* harmony import */ var _lib_lang__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/lang */ "./js/processor/lib/lang.js");
  6872. /* harmony import */ var _lib_math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/math */ "./js/processor/lib/math.js");
  6873. function valueToKey(value, object) {
  6874. for (var key in object) {
  6875. if (Object.prototype.hasOwnProperty.call(object, key)) {
  6876. if (object[key] === value) {
  6877. return key;
  6878. }
  6879. }
  6880. }
  6881. return null;
  6882. }
  6883. function concatObjects() {
  6884. var result = {};
  6885. for (var i = 0; i < arguments.length; i++) {
  6886. var obj = i < 0 || arguments.length <= i ? undefined : arguments[i];
  6887. for (var key in obj) {
  6888. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  6889. result[key] = obj[key];
  6890. }
  6891. }
  6892. }
  6893. return result;
  6894. }
  6895. var libsObject = {
  6896. $mathLib: {
  6897. $sin: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createSinFun"])(),
  6898. $cos: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createCosFun"])(),
  6899. $tan: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createTanFun"])(),
  6900. $sqrt: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createSqrtFun"])(),
  6901. $pow: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createPowFun"])(),
  6902. $log: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createLogFun"])(),
  6903. $abs: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createAbsFun"])(),
  6904. $negate: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createNegateFun"])(),
  6905. $invert: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createInvertFun"])(),
  6906. $max: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createMaxFun"])(),
  6907. $min: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createMinFun"])(),
  6908. $rand: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createRandFun"])()
  6909. },
  6910. $ioLib: {
  6911. $read: Object(_lib_io__WEBPACK_IMPORTED_MODULE_1__["createInputFun"])(),
  6912. $write: Object(_lib_io__WEBPACK_IMPORTED_MODULE_1__["createOutputFun"])()
  6913. },
  6914. $strLib: {
  6915. $substring: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createSubstringFun"])(),
  6916. $length: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createLengthFun"])(),
  6917. $uppercase: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createUppercaseFun"])(),
  6918. $lowercase: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createLowercaseFun"])(),
  6919. $charAt: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createrCharAtFun"])()
  6920. },
  6921. $arrayLib: {
  6922. $numElements: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createNumElementsFun"])(),
  6923. $matrixLines: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createMatrixLinesFun"])(),
  6924. $matrixColumns: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createMatrixColumnsFun"])()
  6925. },
  6926. $langLib: {
  6927. $isReal: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsRealFun"])(),
  6928. $isInt: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsIntFun"])(),
  6929. $isBool: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsBoolFun"])(),
  6930. $castReal: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastRealFun"])(),
  6931. $castInt: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastIntFun"])(),
  6932. $castBool: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastBoolFun"])(),
  6933. $castString: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastStringFun"])(),
  6934. $castChar: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastCharFun"])()
  6935. }
  6936. };
  6937. var funcsObject = concatObjects(libsObject.$ioLib, libsObject.$langLib, libsObject.$strLib, libsObject.$arrayLib);
  6938. var LanguageDefinedFunction = Object.freeze({
  6939. getMainFunctionName: function getMainFunctionName() {
  6940. return _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs().main_function;
  6941. },
  6942. getInternalName: function getInternalName(localName) {
  6943. if (localName.indexOf(".") !== -1) {
  6944. var names = localName.split(".");
  6945. var lib = valueToKey(names[0], _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangLibs());
  6946. var internalName = valueToKey(names[1], _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs());
  6947. if (lib === null || internalName === null) {
  6948. return null;
  6949. }
  6950. return lib + "." + internalName;
  6951. }
  6952. var funcName = valueToKey(localName, _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs());
  6953. if (funcName !== null) {
  6954. if (funcsObject[funcName]) {
  6955. return funcName;
  6956. }
  6957. }
  6958. return null;
  6959. },
  6960. getFunction: function getFunction(internalName) {
  6961. if (internalName.indexOf(".") !== -1) {
  6962. var names = internalName.split(".");
  6963. var libName = names[0];
  6964. var funName = names[1];
  6965. return libsObject[libName][funName];
  6966. }
  6967. return funcsObject[internalName];
  6968. },
  6969. getLocalName: function getLocalName(internalName) {
  6970. if (internalName.indexOf(".") !== -1) {
  6971. var names = internalName.split(".");
  6972. var libName = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangLibs()[names[0]];
  6973. var funName = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[names[1]];
  6974. return "".concat(libName, ".").concat(funName);
  6975. } else if (_services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[internalName]) {
  6976. return _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[internalName];
  6977. } else {
  6978. return internalName;
  6979. }
  6980. }
  6981. });
  6982. /***/ }),
  6983. /***/ "./js/processor/error/processorErrorFactory.js":
  6984. /*!*****************************************************!*\
  6985. !*** ./js/processor/error/processorErrorFactory.js ***!
  6986. \*****************************************************/
  6987. /*! exports provided: ProcessorErrorFactory */
  6988. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6989. "use strict";
  6990. __webpack_require__.r(__webpack_exports__);
  6991. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ProcessorErrorFactory", function() { return ProcessorErrorFactory; });
  6992. /* harmony import */ var _runtimeError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./runtimeError */ "./js/processor/error/runtimeError.js");
  6993. /* harmony import */ var _semanticError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./semanticError */ "./js/processor/error/semanticError.js");
  6994. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  6995. /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../definedFunctions */ "./js/processor/definedFunctions.js");
  6996. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["getInstance"]();
  6997. function createRuntimeError(i18n_id) {
  6998. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  6999. return new _runtimeError__WEBPACK_IMPORTED_MODULE_0__["RuntimeError"](LocalizedStrings.getError(i18n_id, context));
  7000. }
  7001. function createSemanticError(i18n_id) {
  7002. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  7003. return new _semanticError__WEBPACK_IMPORTED_MODULE_1__["SemanticError"](LocalizedStrings.getError(i18n_id, context));
  7004. }
  7005. var ProcessorErrorFactory = Object.freeze({
  7006. symbol_not_found_full: function symbol_not_found_full(id, sourceInfo) {
  7007. if (sourceInfo) {
  7008. var context = [id, sourceInfo.line, sourceInfo.column];
  7009. return createSemanticError("symbol_not_found_full", context);
  7010. } else {
  7011. return ProcessorErrorFactory.symbol_not_found(id);
  7012. }
  7013. },
  7014. symbol_not_found: function symbol_not_found(id) {
  7015. var context = [id];
  7016. return createSemanticError("symbol_not_found", context);
  7017. },
  7018. function_missing_full: function function_missing_full(id, sourceInfo) {
  7019. if (sourceInfo) {
  7020. var context = [id, sourceInfo.line, sourceInfo.column];
  7021. return createSemanticError("function_missing_full", context);
  7022. } else {
  7023. return ProcessorErrorFactory.function_missing(id);
  7024. }
  7025. },
  7026. function_missing: function function_missing(id) {
  7027. var context = [id];
  7028. return createSemanticError("function_missing", context);
  7029. },
  7030. main_missing: function main_missing() {
  7031. return createSemanticError("main_missing");
  7032. },
  7033. array_dimension_not_int_full: function array_dimension_not_int_full(sourceInfo) {
  7034. if (sourceInfo) {
  7035. var context = [sourceInfo.line];
  7036. return createSemanticError("array_dimension_not_int_full", context);
  7037. } else {
  7038. return ProcessorErrorFactory.array_dimension_not_int();
  7039. }
  7040. },
  7041. array_dimension_not_int: function array_dimension_not_int() {
  7042. return createSemanticError("array_dimension_not_int");
  7043. },
  7044. unknown_command_full: function unknown_command_full(sourceInfo) {
  7045. if (sourceInfo) {
  7046. var context = [sourceInfo.line];
  7047. return createRuntimeError("unknown_command_full", context);
  7048. } else {
  7049. return ProcessorErrorFactory.unknown_command();
  7050. }
  7051. },
  7052. unknown_command: function unknown_command() {
  7053. return createRuntimeError("unknown_command");
  7054. },
  7055. incompatible_types_full: function incompatible_types_full(left_type, left_dim, right_type, right_dim, exp, source_info) {
  7056. if (source_info) {
  7057. var context = [LocalizedStrings.translateType(left_type, left_dim), exp, source_info.line, LocalizedStrings.translateType(right_type, right_dim)];
  7058. return createSemanticError("incompatible_types_full", context);
  7059. } else {
  7060. return ProcessorErrorFactory.incompatible_types(left_type, left_dim, right_type, right_dim, exp);
  7061. }
  7062. },
  7063. incompatible_types: function incompatible_types(left_type, left_dim, right_type, right_dim, exp) {
  7064. var context = [LocalizedStrings.translateType(left_type, left_dim), exp, LocalizedStrings.translateType(right_type, right_dim)];
  7065. return createSemanticError("incompatible_types", context);
  7066. },
  7067. incompatible_types_array_full: function incompatible_types_array_full(exp, type, dim, sourceInfo) {
  7068. if (sourceInfo) {
  7069. var context = [exp, LocalizedStrings.translateType(type, dim), sourceInfo.line, sourceInfo.column];
  7070. return createSemanticError("incompatible_types_array_full", context);
  7071. } else {
  7072. return ProcessorErrorFactory.incompatible_types_array(exp, type, dim);
  7073. }
  7074. },
  7075. incompatible_types_array: function incompatible_types_array(exp, type, dim) {
  7076. var context = [exp, LocalizedStrings.translateType(type, dim)];
  7077. return createSemanticError("incompatible_types_array", context);
  7078. },
  7079. loop_condition_type_full: function loop_condition_type_full(exp, sourceInfo) {
  7080. if (sourceInfo) {
  7081. var context = [sourceInfo.line, sourceInfo.column, exp];
  7082. return createSemanticError("loop_condition_type_full", context);
  7083. } else {
  7084. return ProcessorErrorFactory.loop_condition_type(exp);
  7085. }
  7086. },
  7087. loop_condition_type: function loop_condition_type(exp) {
  7088. var context = [exp];
  7089. return createSemanticError("loop_condition_type", context);
  7090. },
  7091. /**
  7092. * @deprecated 01/10/2019
  7093. */
  7094. endless_loop_full: function endless_loop_full(sourceInfo) {
  7095. if (sourceInfo) {
  7096. var context = [sourceInfo.line];
  7097. return createSemanticError("endless_loop_full", context);
  7098. } else {
  7099. return ProcessorErrorFactory.endless_loop();
  7100. }
  7101. },
  7102. endless_loop: function endless_loop() {
  7103. return createSemanticError("endless_loop");
  7104. },
  7105. if_condition_type_full: function if_condition_type_full(exp, sourceInfo) {
  7106. if (sourceInfo) {
  7107. var context = [sourceInfo.line, sourceInfo.column, exp];
  7108. return createSemanticError("if_condition_type_full", context);
  7109. } else {
  7110. return ProcessorErrorFactory.if_condition_type(exp);
  7111. }
  7112. },
  7113. if_condition_type: function if_condition_type(exp) {
  7114. var context = [exp];
  7115. return createSemanticError("if_condition_type", context);
  7116. },
  7117. invalid_global_var: function invalid_global_var() {
  7118. return createRuntimeError("invalid_global_var");
  7119. },
  7120. not_implemented: function not_implemented(id) {
  7121. var context = [id];
  7122. return createRuntimeError("not_implemented", context);
  7123. },
  7124. invalid_case_type_full: function invalid_case_type_full(exp, type, dim, sourceInfo) {
  7125. if (sourceInfo) {
  7126. var context = [exp, LocalizedStrings.translateType(type, dim), sourceInfo.line, sourceInfo.column];
  7127. return createSemanticError("invalid_case_type_full", context);
  7128. } else {
  7129. return ProcessorErrorFactory.invalid_case_type(exp, type, dim);
  7130. }
  7131. },
  7132. invalid_case_type: function invalid_case_type(exp, type, dim) {
  7133. var context = [exp, LocalizedStrings.translateType(type, dim)];
  7134. return createSemanticError("invalid_case_type", context);
  7135. },
  7136. void_in_expression_full: function void_in_expression_full(id, sourceInfo) {
  7137. if (sourceInfo) {
  7138. var context = [sourceInfo.line, sourceInfo.column, id];
  7139. return createSemanticError("void_in_expression_full", context);
  7140. } else {
  7141. return ProcessorErrorFactory.void_in_expression(id);
  7142. }
  7143. },
  7144. void_in_expression: function void_in_expression(id) {
  7145. var context = [id];
  7146. return createSemanticError("void_in_expression", context);
  7147. },
  7148. invalid_array_access_full: function invalid_array_access_full(id, sourceInfo) {
  7149. if (sourceInfo) {
  7150. var context = [id, sourceInfo.line, sourceInfo.column];
  7151. return createSemanticError("invalid_array_access_full", context);
  7152. } else {
  7153. return ProcessorErrorFactory.invalid_array_access(id);
  7154. }
  7155. },
  7156. invalid_array_access: function invalid_array_access(id) {
  7157. var context = [id];
  7158. return createSemanticError("invalid_array_access", context);
  7159. },
  7160. invalid_matrix_access_full: function invalid_matrix_access_full(id, sourceInfo) {
  7161. if (sourceInfo) {
  7162. var context = [id, sourceInfo.line, sourceInfo.column];
  7163. return createSemanticError("invalid_matrix_access_full", context);
  7164. } else {
  7165. return ProcessorErrorFactory.invalid_matrix_access(id);
  7166. }
  7167. },
  7168. invalid_matrix_access: function invalid_matrix_access(id) {
  7169. var context = [id];
  7170. return createSemanticError("invalid_matrix_access", context);
  7171. },
  7172. matrix_column_outbounds_full: function matrix_column_outbounds_full(id, value, columns, sourceInfo) {
  7173. if (sourceInfo) {
  7174. var context = [sourceInfo.line, value, id, columns];
  7175. return createRuntimeError("matrix_column_outbounds_full", context);
  7176. } else {
  7177. return ProcessorErrorFactory.matrix_column_outbounds(id, value, columns);
  7178. }
  7179. },
  7180. matrix_column_outbounds: function matrix_column_outbounds(id, value, columns) {
  7181. var context = [value, id, columns];
  7182. return createRuntimeError("matrix_column_outbounds", context);
  7183. },
  7184. matrix_line_outbounds_full: function matrix_line_outbounds_full(id, value, lines, sourceInfo) {
  7185. if (sourceInfo) {
  7186. var context = [sourceInfo.line, value, id, lines];
  7187. return createRuntimeError("matrix_line_outbounds_full", context);
  7188. } else {
  7189. return ProcessorErrorFactory.matrix_line_outbounds(id, value, lines);
  7190. }
  7191. },
  7192. matrix_line_outbounds: function matrix_line_outbounds(id, value, lines) {
  7193. var context = [value, id, lines];
  7194. return createRuntimeError("matrix_line_outbounds", context);
  7195. },
  7196. vector_line_outbounds_full: function vector_line_outbounds_full(id, value, lines, sourceInfo) {
  7197. if (sourceInfo) {
  7198. var context = [sourceInfo.line, value, id, lines];
  7199. return createRuntimeError("vector_line_outbounds_full", context);
  7200. } else {
  7201. return ProcessorErrorFactory.vector_line_outbounds(id, value, lines);
  7202. }
  7203. },
  7204. vector_line_outbounds: function vector_line_outbounds(id, value, lines) {
  7205. var context = [value, id, lines];
  7206. return createRuntimeError("vector_line_outbounds", context);
  7207. },
  7208. vector_not_matrix_full: function vector_not_matrix_full(id, sourceInfo) {
  7209. if (sourceInfo) {
  7210. var context = [sourceInfo.line, id];
  7211. return createRuntimeError("vector_not_matrix_full", context);
  7212. } else {
  7213. return ProcessorErrorFactory.vector_not_matrix(id);
  7214. }
  7215. },
  7216. vector_not_matrix: function vector_not_matrix(id) {
  7217. var context = [id];
  7218. return createRuntimeError("vector_not_matrix", context);
  7219. },
  7220. function_no_return: function function_no_return(id) {
  7221. var context = [id];
  7222. return createSemanticError("function_no_return", context);
  7223. },
  7224. invalid_void_return_full: function invalid_void_return_full(id, type, dim, sourceInfo) {
  7225. if (sourceInfo) {
  7226. var context = [sourceInfo.line, id, LocalizedStrings.translateType(type, dim)];
  7227. return createSemanticError("invalid_void_return_full", context);
  7228. } else {
  7229. return ProcessorErrorFactory.invalid_void_return(id, type, dim);
  7230. }
  7231. },
  7232. invalid_void_return: function invalid_void_return(id, type, dim) {
  7233. var context = [id, LocalizedStrings.translateType(type, dim)];
  7234. return createSemanticError("invalid_void_return_full", context);
  7235. },
  7236. invalid_return_type_full: function invalid_return_type_full(id, type, dim, sourceInfo) {
  7237. if (sourceInfo) {
  7238. var context = [sourceInfo.line, id, LocalizedStrings.translateType(type, dim)];
  7239. return createSemanticError("invalid_return_type_full", context);
  7240. } else {
  7241. return ProcessorErrorFactory.invalid_return_type(id, type, dim);
  7242. }
  7243. },
  7244. invalid_return_type: function invalid_return_type(id, type, dim) {
  7245. var context = [id, LocalizedStrings.translateType(type, dim)];
  7246. return createSemanticError("invalid_return_type", context);
  7247. },
  7248. invalid_parameters_size_full: function invalid_parameters_size_full(id, expected, actual, sourceInfo) {
  7249. if (sourceInfo) {
  7250. var context = [sourceInfo.line, id, expected, actual];
  7251. return createSemanticError("invalid_parameters_size_full", context);
  7252. } else {
  7253. return ProcessorErrorFactory.invalid_parameters_size(id, expected, actual);
  7254. }
  7255. },
  7256. invalid_parameters_size: function invalid_parameters_size(id, expected, actual) {
  7257. var context = [id, expected, actual];
  7258. return createSemanticError("invalid_parameters_size", context);
  7259. },
  7260. invalid_parameter_type_full: function invalid_parameter_type_full(fun_name, exp, sourceInfo) {
  7261. if (sourceInfo) {
  7262. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name), sourceInfo.line];
  7263. return createSemanticError("invalid_parameter_type_full", context);
  7264. } else {
  7265. return ProcessorErrorFactory.invalid_parameter_type(fun_name, exp);
  7266. }
  7267. },
  7268. invalid_parameter_type: function invalid_parameter_type(fun_name, exp) {
  7269. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name)];
  7270. return createSemanticError("invalid_parameter_type_full", context);
  7271. },
  7272. invalid_ref_full: function invalid_ref_full(id, exp, sourceInfo) {
  7273. if (sourceInfo) {
  7274. var context = [exp, id, sourceInfo.line];
  7275. return createSemanticError("invalid_ref_full", context);
  7276. } else {
  7277. return ProcessorErrorFactory.invalid_ref(id, exp);
  7278. }
  7279. },
  7280. invalid_ref: function invalid_ref(id, exp) {
  7281. var context = [exp, id];
  7282. return createSemanticError("invalid_ref", context);
  7283. },
  7284. unexpected_break_command_full: function unexpected_break_command_full(sourceInfo) {
  7285. if (sourceInfo) {
  7286. var context = [sourceInfo.line];
  7287. return createRuntimeError("unexpected_break_command_full", context);
  7288. } else {
  7289. return ProcessorErrorFactory.unexpected_break_command();
  7290. }
  7291. },
  7292. unexpected_break_command: function unexpected_break_command() {
  7293. return createRuntimeError("unexpected_break_command");
  7294. },
  7295. invalid_array_literal_type_full: function invalid_array_literal_type_full(exp, sourceInfo) {
  7296. if (sourceInfo) {
  7297. var context = [sourceInfo.line, exp];
  7298. return createRuntimeError("invalid_array_literal_type_full", context);
  7299. } else {
  7300. return ProcessorErrorFactory.invalid_array_literal_type(exp);
  7301. }
  7302. },
  7303. invalid_array_literal_type: function invalid_array_literal_type(exp) {
  7304. var context = [exp];
  7305. return createRuntimeError("invalid_array_literal_type", context);
  7306. },
  7307. invalid_array_literal_line_full: function invalid_array_literal_line_full(expected, actual, sourceInfo) {
  7308. if (sourceInfo) {
  7309. var context = [sourceInfo.line, expected, actual];
  7310. return createRuntimeError("invalid_array_literal_line_full", context);
  7311. } else {
  7312. return ProcessorErrorFactory.invalid_array_literal_type(expected, actual);
  7313. }
  7314. },
  7315. invalid_array_literal_line: function invalid_array_literal_line(expected, actual) {
  7316. var context = [expected, actual];
  7317. return createRuntimeError("invalid_array_literal_line", context);
  7318. },
  7319. invalid_array_literal_column_full: function invalid_array_literal_column_full(expected, actual, sourceInfo) {
  7320. if (sourceInfo) {
  7321. var context = [sourceInfo.line, expected, actual];
  7322. return createRuntimeError("invalid_array_literal_column_full", context);
  7323. } else {
  7324. return ProcessorErrorFactory.invalid_array_literal_column(expected, actual);
  7325. }
  7326. },
  7327. invalid_array_literal_column: function invalid_array_literal_column(expected, actual) {
  7328. var context = [expected, actual];
  7329. return createRuntimeError("invalid_array_literal_column", context);
  7330. },
  7331. invalid_unary_op_full: function invalid_unary_op_full(expString, opName, type, dim, sourceInfo) {
  7332. if (sourceInfo) {
  7333. var context = [sourceInfo.line, expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(type, dim)];
  7334. return createRuntimeError("invalid_unary_op_full", context);
  7335. } else {
  7336. return ProcessorErrorFactory.invalid_unary_op(opName, type, dim);
  7337. }
  7338. },
  7339. invalid_unary_op: function invalid_unary_op(expString, opName, type, dim) {
  7340. var context = [expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(type, dim)];
  7341. return createRuntimeError("invalid_unary_op", context);
  7342. },
  7343. invalid_infix_op_full: function invalid_infix_op_full(expString, opName, typeLeft, dimLeft, typeRight, dimRight, sourceInfo) {
  7344. if (sourceInfo) {
  7345. var context = [sourceInfo.line, expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(typeLeft, dimLeft), LocalizedStrings.translateType(typeRight, dimRight)];
  7346. return createRuntimeError("invalid_infix_op_full", context);
  7347. } else {
  7348. return ProcessorErrorFactory.invalid_infix_op(opName, typeLeft, dimLeft, typeRight, dimRight);
  7349. }
  7350. },
  7351. invalid_infix_op: function invalid_infix_op(expString, opName, typeLeft, dimLeft, typeRight, dimRight) {
  7352. var context = [expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(typeLeft, dimLeft), LocalizedStrings.translateType(typeRight, dimRight)];
  7353. return createRuntimeError("invalid_infix_op", context);
  7354. },
  7355. array_dimension_not_positive_full: function array_dimension_not_positive_full(sourceInfo) {
  7356. if (sourceInfo) {
  7357. var context = [sourceInfo.line];
  7358. return createSemanticError("array_dimension_not_positive_full", context);
  7359. } else {
  7360. return ProcessorErrorFactory.array_dimension_not_positive();
  7361. }
  7362. },
  7363. array_dimension_not_positive: function array_dimension_not_positive() {
  7364. return createSemanticError("array_dimension_not_positive");
  7365. },
  7366. invalid_type_conversion: function invalid_type_conversion(value, type, dim) {
  7367. var context = [value, LocalizedStrings.translateType(type, dim)];
  7368. return createRuntimeError("invalid_type_conversion", context);
  7369. },
  7370. invalid_read_type: function invalid_read_type(exp, type, dim, name, source_info) {
  7371. var context = [source_info.line, exp, LocalizedStrings.translateType(type, dim), name];
  7372. return createRuntimeError("invalid_read_type", context);
  7373. },
  7374. invalid_read_type_array: function invalid_read_type_array(exp, typePos, dimPos, name, typeArray, dimArray, sourceInfo) {
  7375. var context = [sourceInfo.line, exp, LocalizedStrings.translateType(typePos, dimPos), name, LocalizedStrings.translateType(typeArray, dimArray)];
  7376. return createRuntimeError("invalid_read_type_array", context);
  7377. },
  7378. invalid_const_ref_full: function invalid_const_ref_full(fun_name, exp, sourceInfo) {
  7379. if (sourceInfo) {
  7380. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name), sourceInfo.line];
  7381. return createSemanticError("invalid_const_ref_full", context);
  7382. } else {
  7383. return ProcessorErrorFactory.invalid_const_ref(fun_name, exp);
  7384. }
  7385. },
  7386. invalid_const_ref: function invalid_const_ref(fun_name, exp) {
  7387. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name)];
  7388. return createSemanticError("invalid_const_ref", context);
  7389. },
  7390. invalid_const_assignment_full: function invalid_const_assignment_full(var_id, source_info) {
  7391. if (source_info) {
  7392. var context = [source_info.line, var_id];
  7393. return createSemanticError("invalid_const_assignment_full", context);
  7394. } else {
  7395. return ProcessorErrorFactory.invalid_const_assignment(var_id);
  7396. }
  7397. },
  7398. invalid_const_assignment: function invalid_const_assignment(var_id) {
  7399. var context = [var_id];
  7400. return createSemanticError("invalid_const_assignment", context);
  7401. },
  7402. invalid_vector_assignment_full: function invalid_vector_assignment_full(left_id, left_size, right_id, right_size, source_info) {
  7403. if (source_info) {
  7404. var context = [source_info.line, left_id, left_size, right_id, right_size];
  7405. return createRuntimeError("invalid_vector_assignment_full", context);
  7406. } else {
  7407. return ProcessorErrorFactory.invalid_vector_assignment(left_id, left_size, right_id, right_size);
  7408. }
  7409. },
  7410. invalid_vector_assignment: function invalid_vector_assignment(left_id, left_size, right_id, right_size) {
  7411. var context = [left_id, left_size, right_id, right_size];
  7412. return createRuntimeError("invalid_vector_assignment", context);
  7413. },
  7414. invalid_matrix_assignment_full: function invalid_matrix_assignment_full(left_id, left_line, left_column, right_id, right_line, right_column, source_info) {
  7415. if (source_info) {
  7416. var context = [source_info.line, left_id, left_line, left_column, right_id, right_line, right_column];
  7417. return createRuntimeError("invalid_matrix_assignment_full", context);
  7418. } else {
  7419. return ProcessorErrorFactory.invalid_matrix_assignment(left_id, left_line, left_column, right_id, right_line, right_column);
  7420. }
  7421. },
  7422. invalid_matrix_assignment: function invalid_matrix_assignment(left_id, left_line, left_column, right_id, right_line, right_column) {
  7423. var context = [left_id, left_line, left_column, right_id, right_line, right_column];
  7424. return createRuntimeError("invalid_matrix_assignment", context);
  7425. },
  7426. matrix_to_vector_attr: function matrix_to_vector_attr(left_id, right_id, source_info) {
  7427. // SourceInfo have to be valid...
  7428. var context = [source_info.line, right_id, left_id];
  7429. return createSemanticError("matrix_to_vector_attr", context);
  7430. },
  7431. vector_to_matrix_attr: function vector_to_matrix_attr(left_id, right_id, source_info) {
  7432. // SourceInfo have to be valid...
  7433. var context = [source_info.line, right_id, left_id];
  7434. return createSemanticError("vector_to_matrix_attr", context);
  7435. },
  7436. invalid_matrix_index_assign_full: function invalid_matrix_index_assign_full(mat_id, mat_line, mat_size, exp, exp_size, source_info) {
  7437. if (source_info) {
  7438. var context = [source_info.line, mat_line, mat_id, mat_size, exp, exp_size];
  7439. return createRuntimeError("invalid_matrix_index_assign_full", context);
  7440. } else {
  7441. return ProcessorErrorFactory.invalid_matrix_index_assign(mat_id, mat_line, mat_size, exp, exp_size);
  7442. }
  7443. },
  7444. invalid_matrix_index_assign: function invalid_matrix_index_assign(mat_id, mat_line, mat_size, exp, exp_size) {
  7445. var context = [mat_line, mat_id, mat_size, exp, exp_size];
  7446. return createRuntimeError("invalid_matrix_index_assign", context);
  7447. },
  7448. invalid_number_elements_vector: function invalid_number_elements_vector(expected_num, exp, actual_num, source_info) {
  7449. // SourceInfo have to be valid...
  7450. var context = [expected_num, source_info.line, exp, actual_num];
  7451. return createRuntimeError("invalid_number_elements_vector", context);
  7452. },
  7453. invalid_number_lines_matrix: function invalid_number_lines_matrix(expected_num, exp, actual_num, source_info) {
  7454. // SourceInfo have to be valid...
  7455. var context = [expected_num, source_info.line, exp, actual_num];
  7456. return createRuntimeError("invalid_number_lines_matrix", context);
  7457. },
  7458. divsion_by_zero_full: function divsion_by_zero_full(exp, source_info) {
  7459. if (source_info) {
  7460. var context = [source_info.line, exp];
  7461. return createRuntimeError("divsion_by_zero_full", context);
  7462. } else {
  7463. return ProcessorErrorFactory.divsion_by_zero(exp);
  7464. }
  7465. },
  7466. divsion_by_zero: function divsion_by_zero(exp) {
  7467. var context = [exp];
  7468. return createRuntimeError("divsion_by_zero", context);
  7469. },
  7470. undefined_tanget_value: function undefined_tanget_value(value, source_info) {
  7471. var context = [source_info.line, value];
  7472. return createRuntimeError("undefined_tanget_value", context);
  7473. },
  7474. negative_log_value: function negative_log_value(source_info) {
  7475. return createRuntimeError("negative_log_value", [source_info.line]);
  7476. },
  7477. invalid_string_index: function invalid_string_index(index, str, source_info) {
  7478. var local_fun_name = _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName("$charAt");
  7479. var context = [source_info.line, local_fun_name, index, str, str.length - 1];
  7480. return createRuntimeError("invalid_string_index", context);
  7481. },
  7482. negative_sqrt_value: function negative_sqrt_value(source_info) {
  7483. return createRuntimeError("negative_sqrt_value", [source_info.line]);
  7484. },
  7485. /**
  7486. * @deprecated 01/10/2019
  7487. */
  7488. exceeded_recursive_calls: function exceeded_recursive_calls(source_info) {
  7489. var context = [source_info.line];
  7490. return createRuntimeError("exceeded_recursive_calls", context);
  7491. },
  7492. invalid_for_variable: function invalid_for_variable(id, source_info) {
  7493. var context = [source_info.line, id];
  7494. return createSemanticError("invalid_for_variable", context);
  7495. },
  7496. invalid_for_from: function invalid_for_from(exp, source_info) {
  7497. var context = [source_info.line, exp];
  7498. return createSemanticError("invalid_for_from", context);
  7499. },
  7500. invalid_for_to: function invalid_for_to(exp, source_info) {
  7501. var context = [source_info.line, exp];
  7502. return createSemanticError("invalid_for_to", context);
  7503. },
  7504. invalid_for_pass: function invalid_for_pass(exp, source_info) {
  7505. var context = [source_info.line, exp];
  7506. return createSemanticError("invalid_for_pass", context);
  7507. },
  7508. exceed_max_instructions: function exceed_max_instructions() {
  7509. return createRuntimeError('exceed_max_instructions');
  7510. }
  7511. });
  7512. /***/ }),
  7513. /***/ "./js/processor/error/runtimeError.js":
  7514. /*!********************************************!*\
  7515. !*** ./js/processor/error/runtimeError.js ***!
  7516. \********************************************/
  7517. /*! exports provided: RuntimeError */
  7518. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7519. "use strict";
  7520. __webpack_require__.r(__webpack_exports__);
  7521. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RuntimeError", function() { return RuntimeError; });
  7522. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  7523. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  7524. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
  7525. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__);
  7526. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  7527. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  7528. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  7529. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  7530. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  7531. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  7532. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "./node_modules/@babel/runtime/helpers/wrapNativeSuper.js");
  7533. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__);
  7534. 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); }; }
  7535. 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; } }
  7536. var RuntimeError = /*#__PURE__*/function (_Error) {
  7537. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(RuntimeError, _Error);
  7538. var _super = _createSuper(RuntimeError);
  7539. function RuntimeError() {
  7540. var _this;
  7541. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, RuntimeError);
  7542. for (var _len = arguments.length, msg = new Array(_len), _key = 0; _key < _len; _key++) {
  7543. msg[_key] = arguments[_key];
  7544. }
  7545. _this = _super.call.apply(_super, [this].concat(msg));
  7546. if (Error.captureStackTrace) Error.captureStackTrace(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default()(_this), RuntimeError);
  7547. return _this;
  7548. }
  7549. return RuntimeError;
  7550. }( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default()(Error));
  7551. /***/ }),
  7552. /***/ "./js/processor/error/semanticError.js":
  7553. /*!*********************************************!*\
  7554. !*** ./js/processor/error/semanticError.js ***!
  7555. \*********************************************/
  7556. /*! exports provided: SemanticError */
  7557. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7558. "use strict";
  7559. __webpack_require__.r(__webpack_exports__);
  7560. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SemanticError", function() { return SemanticError; });
  7561. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  7562. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  7563. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
  7564. /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__);
  7565. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  7566. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  7567. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  7568. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  7569. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  7570. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  7571. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "./node_modules/@babel/runtime/helpers/wrapNativeSuper.js");
  7572. /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__);
  7573. 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); }; }
  7574. 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; } }
  7575. var SemanticError = /*#__PURE__*/function (_Error) {
  7576. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(SemanticError, _Error);
  7577. var _super = _createSuper(SemanticError);
  7578. function SemanticError() {
  7579. var _this;
  7580. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SemanticError);
  7581. for (var _len = arguments.length, msg = new Array(_len), _key = 0; _key < _len; _key++) {
  7582. msg[_key] = arguments[_key];
  7583. }
  7584. _this = _super.call.apply(_super, [this].concat(msg));
  7585. if (Error.captureStackTrace) Error.captureStackTrace(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default()(_this), SemanticError);
  7586. return _this;
  7587. }
  7588. return SemanticError;
  7589. }( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default()(Error));
  7590. /***/ }),
  7591. /***/ "./js/processor/ivprogProcessor.js":
  7592. /*!*****************************************!*\
  7593. !*** ./js/processor/ivprogProcessor.js ***!
  7594. \*****************************************/
  7595. /*! exports provided: IVProgProcessor */
  7596. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7597. "use strict";
  7598. __webpack_require__.r(__webpack_exports__);
  7599. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IVProgProcessor", function() { return IVProgProcessor; });
  7600. /* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/slicedToArray.js");
  7601. /* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);
  7602. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  7603. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
  7604. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  7605. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);
  7606. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  7607. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);
  7608. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  7609. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);
  7610. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./store/store */ "./js/processor/store/store.ts");
  7611. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_store_store__WEBPACK_IMPORTED_MODULE_5__);
  7612. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modes */ "./js/processor/modes.ts");
  7613. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_6__);
  7614. /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./context */ "./js/processor/context.ts");
  7615. /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_context__WEBPACK_IMPORTED_MODULE_7__);
  7616. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../typeSystem/types */ "./js/typeSystem/types.ts");
  7617. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__);
  7618. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.ts");
  7619. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_ast_operators__WEBPACK_IMPORTED_MODULE_9__);
  7620. /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./definedFunctions */ "./js/processor/definedFunctions.js");
  7621. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./compatibilityTable */ "./js/processor/compatibilityTable.ts");
  7622. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_compatibilityTable__WEBPACK_IMPORTED_MODULE_11__);
  7623. /* harmony import */ var _ast_commands___WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./../ast/commands/ */ "./js/ast/commands/index.js");
  7624. /* harmony import */ var _ast_commands_command__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./../ast/commands/command */ "./js/ast/commands/command.js");
  7625. /* harmony import */ var _ast_expressions___WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./../ast/expressions/ */ "./js/ast/expressions/index.js");
  7626. /* harmony import */ var _ast_expressions_expression__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../ast/expressions/expression */ "./js/ast/expressions/expression.js");
  7627. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  7628. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  7629. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__);
  7630. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  7631. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
  7632. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_19__);
  7633. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  7634. /* harmony import */ var _error_runtimeError__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./error/runtimeError */ "./js/processor/error/runtimeError.js");
  7635. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../memory/location */ "./js/memory/location.ts");
  7636. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_memory_location__WEBPACK_IMPORTED_MODULE_22__);
  7637. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./store/value/store_value */ "./js/processor/store/value/store_value.ts");
  7638. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_23__);
  7639. /* 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");
  7640. /* 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__);
  7641. /* 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");
  7642. /* 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__);
  7643. /* 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");
  7644. /* 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__);
  7645. /* 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");
  7646. /* 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__);
  7647. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  7648. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  7649. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  7650. var IVProgProcessor = /*#__PURE__*/function () {
  7651. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(IVProgProcessor, null, [{
  7652. key: "MAIN_INTERNAL_ID",
  7653. get: function get() {
  7654. return "$main";
  7655. }
  7656. }]);
  7657. function IVProgProcessor(ast) {
  7658. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, IVProgProcessor);
  7659. this.ast = ast;
  7660. this.globalStore = new _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"]("$global");
  7661. this.stores = [this.globalStore];
  7662. this.context = [_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BASE];
  7663. this.input = null;
  7664. this.forceKill = false;
  7665. this.output = null;
  7666. this.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  7667. /**
  7668. * Stores the sourceInfo of every function call, command or expression
  7669. */
  7670. this.function_call_stack = [];
  7671. this.instruction_count = 0;
  7672. this.function_call_count = 0;
  7673. }
  7674. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(IVProgProcessor, [{
  7675. key: "registerInput",
  7676. value: function registerInput(input) {
  7677. if (this.input !== null) this.input = null;
  7678. this.input = input;
  7679. }
  7680. }, {
  7681. key: "registerOutput",
  7682. value: function registerOutput(output) {
  7683. if (this.output !== null) this.output = null;
  7684. this.output = output;
  7685. }
  7686. }, {
  7687. key: "checkContext",
  7688. value: function checkContext(context) {
  7689. return this.context[this.context.length - 1] === context;
  7690. }
  7691. }, {
  7692. key: "ignoreSwitchCases",
  7693. value: function ignoreSwitchCases(store) {
  7694. if (store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN) {
  7695. return true;
  7696. } else if (store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK) {
  7697. return true;
  7698. } else {
  7699. return false;
  7700. }
  7701. }
  7702. }, {
  7703. key: "prepareState",
  7704. value: function prepareState() {
  7705. if (this.stores !== null) {
  7706. for (var i = 0; i < this.stores.length; i++) {
  7707. delete this.stores[i];
  7708. }
  7709. this.stores = null;
  7710. }
  7711. if (this.globalStore !== null) this.globalStore = null;
  7712. this.globalStore = new _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"]("$global");
  7713. this.stores = [this.globalStore];
  7714. this.context = [_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BASE];
  7715. this.instruction_count = 0;
  7716. this.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  7717. }
  7718. }, {
  7719. key: "interpretAST",
  7720. value: function () {
  7721. var _interpretAST = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee() {
  7722. var mainFunc;
  7723. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {
  7724. while (1) {
  7725. switch (_context.prev = _context.next) {
  7726. case 0:
  7727. this.prepareState();
  7728. _memory_location__WEBPACK_IMPORTED_MODULE_22__["Location"].clear();
  7729. _context.next = 4;
  7730. return this.initGlobal();
  7731. case 4:
  7732. mainFunc = this.findMainFunction();
  7733. if (!(mainFunc === null)) {
  7734. _context.next = 7;
  7735. break;
  7736. }
  7737. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].main_missing();
  7738. case 7:
  7739. return _context.abrupt("return", this.runFunction(mainFunc, [], this.globalStore));
  7740. case 8:
  7741. case "end":
  7742. return _context.stop();
  7743. }
  7744. }
  7745. }, _callee, this);
  7746. }));
  7747. function interpretAST() {
  7748. return _interpretAST.apply(this, arguments);
  7749. }
  7750. return interpretAST;
  7751. }()
  7752. }, {
  7753. key: "initGlobal",
  7754. value: function () {
  7755. var _initGlobal = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee2() {
  7756. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee2$(_context2) {
  7757. while (1) {
  7758. switch (_context2.prev = _context2.next) {
  7759. case 0:
  7760. if (this.checkContext(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BASE)) {
  7761. _context2.next = 2;
  7762. break;
  7763. }
  7764. return _context2.abrupt("return", _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_global_var());
  7765. case 2:
  7766. return _context2.abrupt("return", this.executeCommands(this.globalStore, this.ast.global));
  7767. case 3:
  7768. case "end":
  7769. return _context2.stop();
  7770. }
  7771. }
  7772. }, _callee2, this);
  7773. }));
  7774. function initGlobal() {
  7775. return _initGlobal.apply(this, arguments);
  7776. }
  7777. return initGlobal;
  7778. }()
  7779. }, {
  7780. key: "findMainFunction",
  7781. value: function findMainFunction() {
  7782. return this.ast.functions.find(function (v) {
  7783. return v.isMain;
  7784. });
  7785. }
  7786. }, {
  7787. key: "findFunction",
  7788. value: function findFunction(name) {
  7789. if (name.match(/^\$.+$/)) {
  7790. if (name === IVProgProcessor.MAIN_INTERNAL_ID) {
  7791. return this.findMainFunction();
  7792. }
  7793. var fun = _definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getFunction(name);
  7794. if (!fun) {
  7795. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].not_implemented(name);
  7796. }
  7797. return fun;
  7798. } else {
  7799. var val = this.ast.functions.find(function (v) {
  7800. return v.name === name;
  7801. });
  7802. if (!val) {
  7803. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].function_missing(name);
  7804. }
  7805. return val;
  7806. }
  7807. }
  7808. }, {
  7809. key: "runFunction",
  7810. value: function () {
  7811. 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) {
  7812. var funcName, funcStore, stoWithVars, finalSto;
  7813. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee3$(_context3) {
  7814. while (1) {
  7815. switch (_context3.prev = _context3.next) {
  7816. case 0:
  7817. funcName = func.isMain ? IVProgProcessor.MAIN_INTERNAL_ID : func.name;
  7818. funcStore = new _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"](funcName);
  7819. funcStore.extendStore(this.globalStore);
  7820. _context3.next = 5;
  7821. return this.associateParameters(func.formalParameters, actualParameters, store, funcStore);
  7822. case 5:
  7823. this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].FUNCTION);
  7824. this.stores.push(funcStore);
  7825. _context3.next = 9;
  7826. return this.executeCommands(funcStore, func.variablesDeclarations);
  7827. case 9:
  7828. stoWithVars = _context3.sent;
  7829. finalSto = this.executeCommands(stoWithVars, func.commands);
  7830. this.stores.pop();
  7831. this.context.pop();
  7832. return _context3.abrupt("return", finalSto);
  7833. case 14:
  7834. case "end":
  7835. return _context3.stop();
  7836. }
  7837. }
  7838. }, _callee3, this);
  7839. }));
  7840. function runFunction(_x, _x2, _x3) {
  7841. return _runFunction.apply(this, arguments);
  7842. }
  7843. return runFunction;
  7844. }()
  7845. /**
  7846. *
  7847. * @param {import('./../ast/commands/formalParameter').FormalParameter[]} formal_params
  7848. * @param {Expression[]} effective_params
  7849. * @param {Store} caller_store
  7850. * @param {Store} callee_store
  7851. */
  7852. }, {
  7853. key: "associateParameters",
  7854. value: function () {
  7855. 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) {
  7856. var funcName, hasVariadic, i, j, formalParameter, _yield$this$associate, _yield$this$associate2, actualParam;
  7857. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee4$(_context4) {
  7858. while (1) {
  7859. switch (_context4.prev = _context4.next) {
  7860. case 0:
  7861. funcName = callee_store.name === IVProgProcessor.MAIN_INTERNAL_ID ? _definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName() : callee_store.name;
  7862. hasVariadic = formal_params.some(function (p) {
  7863. return p.variadic;
  7864. });
  7865. if (!(formal_params.length != effective_params.length && !hasVariadic || formal_params.length > effective_params.length)) {
  7866. _context4.next = 4;
  7867. break;
  7868. }
  7869. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_parameters_size(funcName, formal_params.length, effective_params.length);
  7870. case 4:
  7871. i = 0, j = 0;
  7872. case 5:
  7873. if (!(i < formal_params.length && j < effective_params.length)) {
  7874. _context4.next = 23;
  7875. break;
  7876. }
  7877. formalParameter = formal_params[i];
  7878. if (!formalParameter.variadic) {
  7879. _context4.next = 16;
  7880. break;
  7881. }
  7882. _context4.next = 10;
  7883. return this.associateVariadicParameter(funcName, formalParameter, j, effective_params, caller_store, callee_store);
  7884. case 10:
  7885. _yield$this$associate = _context4.sent;
  7886. _yield$this$associate2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_yield$this$associate, 2);
  7887. j = _yield$this$associate2[0];
  7888. callee_store = _yield$this$associate2[1];
  7889. _context4.next = 20;
  7890. break;
  7891. case 16:
  7892. actualParam = effective_params[i];
  7893. _context4.next = 19;
  7894. return this.associateParameter(funcName, formalParameter, actualParam, caller_store, callee_store);
  7895. case 19:
  7896. callee_store = _context4.sent;
  7897. case 20:
  7898. i += 1, j += 1;
  7899. _context4.next = 5;
  7900. break;
  7901. case 23:
  7902. return _context4.abrupt("return", callee_store);
  7903. case 24:
  7904. case "end":
  7905. return _context4.stop();
  7906. }
  7907. }
  7908. }, _callee4, this);
  7909. }));
  7910. function associateParameters(_x4, _x5, _x6, _x7) {
  7911. return _associateParameters.apply(this, arguments);
  7912. }
  7913. return associateParameters;
  7914. }()
  7915. /**
  7916. *
  7917. * @param {string} funcName
  7918. * @param {import('./../ast/commands/formalParameter').FormalParameter} formalParameter
  7919. * @param {number} index
  7920. * @param {Expression[]} effective_params
  7921. * @param {Store} caller_store
  7922. * @param {Store} callee_store
  7923. */
  7924. }, {
  7925. key: "associateVariadicParameter",
  7926. value: function () {
  7927. 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) {
  7928. var i, count, actualParam, variadicCount;
  7929. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee5$(_context5) {
  7930. while (1) {
  7931. switch (_context5.prev = _context5.next) {
  7932. case 0:
  7933. count = 1;
  7934. i = index;
  7935. case 2:
  7936. if (!(i < effective_params.length)) {
  7937. _context5.next = 11;
  7938. break;
  7939. }
  7940. actualParam = effective_params[i];
  7941. _context5.next = 6;
  7942. return this.associateParameter(funcName, formalParameter, actualParam, caller_store, callee_store, count);
  7943. case 6:
  7944. callee_store = _context5.sent;
  7945. count += 1;
  7946. case 8:
  7947. i += 1;
  7948. _context5.next = 2;
  7949. break;
  7950. case 11:
  7951. variadicCount = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER, count, undefined, true);
  7952. callee_store.insertStore("".concat(formalParameter.id, ".0"), variadicCount);
  7953. return _context5.abrupt("return", [i - 1, callee_store]);
  7954. case 14:
  7955. case "end":
  7956. return _context5.stop();
  7957. }
  7958. }
  7959. }, _callee5, this);
  7960. }));
  7961. function associateVariadicParameter(_x8, _x9, _x10, _x11, _x12, _x13) {
  7962. return _associateVariadicParameter.apply(this, arguments);
  7963. }
  7964. return associateVariadicParameter;
  7965. }()
  7966. /**
  7967. *
  7968. * @param {string} funcName
  7969. * @param {import('./../ast/commands/formalParameter').FormalParameter} formalParameter
  7970. * @param {Expression} actualParameter
  7971. * @param {Store} callerStore
  7972. * @param {Store} calleeStore
  7973. * @param {number} variadicCount The number of the current value being assigned to the variadic parameter, default 0
  7974. */
  7975. }, {
  7976. key: "associateParameter",
  7977. value: function () {
  7978. 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) {
  7979. var variadicCount,
  7980. actualValue,
  7981. shouldTypeCast,
  7982. realObj,
  7983. ref,
  7984. values,
  7985. array_type,
  7986. addresses,
  7987. columns,
  7988. line,
  7989. column,
  7990. varID,
  7991. realValue,
  7992. _varID,
  7993. _args6 = arguments;
  7994. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee6$(_context6) {
  7995. while (1) {
  7996. switch (_context6.prev = _context6.next) {
  7997. case 0:
  7998. variadicCount = _args6.length > 5 && _args6[5] !== undefined ? _args6[5] : 0;
  7999. _context6.next = 3;
  8000. return this.evaluateExpression(callerStore, actualParameter);
  8001. case 3:
  8002. actualValue = _context6.sent;
  8003. shouldTypeCast = false;
  8004. if (formalParameter.type.isCompatible(actualValue.type)) {
  8005. _context6.next = 11;
  8006. break;
  8007. }
  8008. 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))) {
  8009. _context6.next = 10;
  8010. break;
  8011. }
  8012. shouldTypeCast = true;
  8013. _context6.next = 11;
  8014. break;
  8015. case 10:
  8016. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_parameter_type(funcName, actualParameter.toString());
  8017. case 11:
  8018. if (!(formalParameter.byRef && !actualValue.inStore())) {
  8019. _context6.next = 13;
  8020. break;
  8021. }
  8022. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_ref(funcName, actualParameter.toString());
  8023. case 13:
  8024. if (formalParameter.byRef) {
  8025. realObj = callerStore.getStoreObject(actualValue.id);
  8026. ref = null;
  8027. if (actualValue instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"]) {
  8028. // it's a vector or matrix...
  8029. values = actualValue.get();
  8030. array_type = actualValue.type;
  8031. addresses = values.map(function (v) {
  8032. return realObj.getLocAddressOf(v.line, v.column);
  8033. });
  8034. columns = actualValue.isVector() ? 0 : actualValue.columns;
  8035. ref = new _store_value_array_store_value_ref__WEBPACK_IMPORTED_MODULE_26__["ArrayStoreValueRef"](array_type, values, addresses, actualValue.lines, columns, realObj.id);
  8036. } else {
  8037. if (actualValue instanceof _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__["StoreValueAddress"]) {
  8038. line = actualValue.line;
  8039. column = actualValue.column;
  8040. ref = new _store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_24__["StoreValueRef"](actualValue.type, actualValue.get(), realObj.getLocAddressOf(line, column), realObj.id);
  8041. ref.setReferenceDimension(realObj.type.dimensions);
  8042. } else {
  8043. ref = new _store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_24__["StoreValueRef"](actualValue.type, actualValue.get(), realObj.locAddress, realObj.id);
  8044. }
  8045. }
  8046. varID = formalParameter.id;
  8047. if (formalParameter.variadic) varID = "".concat(varID, ".").concat(variadicCount);
  8048. calleeStore.insertStore(varID, ref);
  8049. } else {
  8050. realValue = actualValue;
  8051. if (shouldTypeCast) {
  8052. realValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(formalParameter.type, realValue);
  8053. }
  8054. _varID = formalParameter.id;
  8055. if (formalParameter.variadic) _varID = "".concat(_varID, ".").concat(variadicCount);
  8056. calleeStore.insertStore(_varID, realValue);
  8057. }
  8058. return _context6.abrupt("return", calleeStore);
  8059. case 15:
  8060. case "end":
  8061. return _context6.stop();
  8062. }
  8063. }
  8064. }, _callee6, this);
  8065. }));
  8066. function associateParameter(_x14, _x15, _x16, _x17, _x18) {
  8067. return _associateParameter.apply(this, arguments);
  8068. }
  8069. return associateParameter;
  8070. }()
  8071. /**
  8072. *
  8073. * @param {Store} store
  8074. * @param {Command[]} cmds
  8075. *
  8076. * @returns {Promise<Store>}
  8077. */
  8078. }, {
  8079. key: "executeCommands",
  8080. value: function () {
  8081. 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) {
  8082. var sto, i;
  8083. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee7$(_context7) {
  8084. while (1) {
  8085. switch (_context7.prev = _context7.next) {
  8086. case 0:
  8087. // helper to partially apply a function, in this case executeCommand
  8088. sto = store;
  8089. i = 0;
  8090. case 2:
  8091. if (!(i < cmds.length)) {
  8092. _context7.next = 9;
  8093. break;
  8094. }
  8095. _context7.next = 5;
  8096. return this.executeCommand(sto, cmds[i]);
  8097. case 5:
  8098. sto = _context7.sent;
  8099. case 6:
  8100. i += 1;
  8101. _context7.next = 2;
  8102. break;
  8103. case 9:
  8104. return _context7.abrupt("return", sto);
  8105. case 10:
  8106. case "end":
  8107. return _context7.stop();
  8108. }
  8109. }
  8110. }, _callee7, this);
  8111. }));
  8112. function executeCommands(_x19, _x20) {
  8113. return _executeCommands.apply(this, arguments);
  8114. }
  8115. return executeCommands;
  8116. }()
  8117. /**
  8118. *
  8119. * @param {Store} store
  8120. * @param {Command} cmd
  8121. *
  8122. * @returns {Promise<Store>}
  8123. */
  8124. }, {
  8125. key: "executeCommand",
  8126. value: function () {
  8127. 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) {
  8128. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee8$(_context8) {
  8129. while (1) {
  8130. switch (_context8.prev = _context8.next) {
  8131. case 0:
  8132. this.instruction_count += 1;
  8133. if (!(this.instruction_count % _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].suspend_threshold == 0)) {
  8134. _context8.next = 4;
  8135. break;
  8136. }
  8137. _context8.next = 4;
  8138. return _util_utils__WEBPACK_IMPORTED_MODULE_16__["sleep"](5);
  8139. case 4:
  8140. if (!(this.instruction_count >= _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].max_instruction_count)) {
  8141. _context8.next = 8;
  8142. break;
  8143. }
  8144. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].exceed_max_instructions();
  8145. case 8:
  8146. if (!this.forceKill) {
  8147. _context8.next = 12;
  8148. break;
  8149. }
  8150. throw "FORCED_KILL!";
  8151. case 12:
  8152. if (!(store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].PAUSE)) {
  8153. _context8.next = 16;
  8154. break;
  8155. }
  8156. return _context8.abrupt("return", this.executeCommand(store, cmd));
  8157. case 16:
  8158. if (!(store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN)) {
  8159. _context8.next = 20;
  8160. break;
  8161. }
  8162. return _context8.abrupt("return", store);
  8163. case 20:
  8164. if (!(this.checkContext(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE) && store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK)) {
  8165. _context8.next = 24;
  8166. break;
  8167. }
  8168. return _context8.abrupt("return", store);
  8169. case 24:
  8170. if (!(this.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].ABORT)) {
  8171. _context8.next = 26;
  8172. break;
  8173. }
  8174. throw _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_28__["LocalizedStrings"].getMessage("aborted_execution");
  8175. case 26:
  8176. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Declaration"])) {
  8177. _context8.next = 30;
  8178. break;
  8179. }
  8180. return _context8.abrupt("return", this.executeDeclaration(store, cmd));
  8181. case 30:
  8182. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["ArrayIndexAssign"])) {
  8183. _context8.next = 34;
  8184. break;
  8185. }
  8186. return _context8.abrupt("return", this.executeArrayIndexAssign(store, cmd));
  8187. case 34:
  8188. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Assign"])) {
  8189. _context8.next = 38;
  8190. break;
  8191. }
  8192. return _context8.abrupt("return", this.executeAssign(store, cmd));
  8193. case 38:
  8194. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Break"])) {
  8195. _context8.next = 42;
  8196. break;
  8197. }
  8198. return _context8.abrupt("return", this.executeBreak(store, cmd));
  8199. case 42:
  8200. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Return"])) {
  8201. _context8.next = 46;
  8202. break;
  8203. }
  8204. return _context8.abrupt("return", this.executeReturn(store, cmd));
  8205. case 46:
  8206. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["IfThenElse"])) {
  8207. _context8.next = 50;
  8208. break;
  8209. }
  8210. return _context8.abrupt("return", this.executeIfThenElse(store, cmd));
  8211. case 50:
  8212. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["RepeatUntil"])) {
  8213. _context8.next = 54;
  8214. break;
  8215. }
  8216. return _context8.abrupt("return", this.executeRepeatUntil(store, cmd));
  8217. case 54:
  8218. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["While"])) {
  8219. _context8.next = 58;
  8220. break;
  8221. }
  8222. return _context8.abrupt("return", this.executeWhile(store, cmd));
  8223. case 58:
  8224. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["For"])) {
  8225. _context8.next = 62;
  8226. break;
  8227. }
  8228. return _context8.abrupt("return", this.executeFor(store, cmd));
  8229. case 62:
  8230. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Switch"])) {
  8231. _context8.next = 66;
  8232. break;
  8233. }
  8234. return _context8.abrupt("return", this.executeSwitch(store, cmd));
  8235. case 66:
  8236. if (!(cmd instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["FunctionCall"])) {
  8237. _context8.next = 70;
  8238. break;
  8239. }
  8240. return _context8.abrupt("return", this.executeFunctionCall(store, cmd));
  8241. case 70:
  8242. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["SysCall"])) {
  8243. _context8.next = 74;
  8244. break;
  8245. }
  8246. return _context8.abrupt("return", this.executeSysCall(store, cmd));
  8247. case 74:
  8248. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].unknown_command(cmd.sourceInfo);
  8249. case 75:
  8250. case "end":
  8251. return _context8.stop();
  8252. }
  8253. }
  8254. }, _callee8, this);
  8255. }));
  8256. function executeCommand(_x21, _x22) {
  8257. return _executeCommand.apply(this, arguments);
  8258. }
  8259. return executeCommand;
  8260. }()
  8261. /**
  8262. *
  8263. * @param {Store} store
  8264. * @param {Commands.SysCall} cmd
  8265. *
  8266. * @returns {Promise<Store>}
  8267. */
  8268. }, {
  8269. key: "executeSysCall",
  8270. value: function () {
  8271. 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) {
  8272. var func;
  8273. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee9$(_context9) {
  8274. while (1) {
  8275. switch (_context9.prev = _context9.next) {
  8276. case 0:
  8277. func = cmd.langFunc.bind(this);
  8278. return _context9.abrupt("return", func(store, cmd));
  8279. case 2:
  8280. case "end":
  8281. return _context9.stop();
  8282. }
  8283. }
  8284. }, _callee9, this);
  8285. }));
  8286. function executeSysCall(_x23, _x24) {
  8287. return _executeSysCall.apply(this, arguments);
  8288. }
  8289. return executeSysCall;
  8290. }()
  8291. /**
  8292. *
  8293. * @param {Store} store
  8294. * @param {Commands.FunctionCall} cmd
  8295. *
  8296. * @returns {Promise<Store>}
  8297. */
  8298. }, {
  8299. key: "executeFunctionCall",
  8300. value: function () {
  8301. 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) {
  8302. var func, sto, funcName;
  8303. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee10$(_context10) {
  8304. while (1) {
  8305. switch (_context10.prev = _context10.next) {
  8306. case 0:
  8307. func = null;
  8308. if (cmd.isMainCall) {
  8309. func = this.findMainFunction();
  8310. } else {
  8311. func = this.findFunction(cmd.id);
  8312. }
  8313. this.function_call_stack.push(cmd.sourceInfo);
  8314. _context10.next = 5;
  8315. return this.runFunction(func, cmd.actualParameters, store);
  8316. case 5:
  8317. sto = _context10.sent;
  8318. sto.destroy();
  8319. if (!(!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].VOID.isCompatible(func.returnType) && sto.mode !== _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN)) {
  8320. _context10.next = 12;
  8321. break;
  8322. }
  8323. funcName = func.name === IVProgProcessor.MAIN_INTERNAL_ID ? _definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName() : func.name;
  8324. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].function_no_return(funcName);
  8325. case 12:
  8326. this.function_call_stack.pop();
  8327. return _context10.abrupt("return", store);
  8328. case 14:
  8329. case "end":
  8330. return _context10.stop();
  8331. }
  8332. }
  8333. }, _callee10, this);
  8334. }));
  8335. function executeFunctionCall(_x25, _x26) {
  8336. return _executeFunctionCall.apply(this, arguments);
  8337. }
  8338. return executeFunctionCall;
  8339. }()
  8340. /**
  8341. *
  8342. * @param {Store} store
  8343. * @param {Commands.Switch} cmd
  8344. *
  8345. * @returns {Promise<Store>}
  8346. */
  8347. }, {
  8348. key: "executeSwitch",
  8349. value: function () {
  8350. 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) {
  8351. var switchCases, lastStore, lastCaseCheckResult, i, switchCase, equalityInfixApp, result;
  8352. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee11$(_context11) {
  8353. while (1) {
  8354. switch (_context11.prev = _context11.next) {
  8355. case 0:
  8356. this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE);
  8357. switchCases = cmd.cases;
  8358. lastStore = store;
  8359. lastCaseCheckResult = false;
  8360. i = 0;
  8361. case 5:
  8362. if (!(i < switchCases.length && !this.ignoreSwitchCases(lastStore))) {
  8363. _context11.next = 26;
  8364. break;
  8365. }
  8366. switchCase = switchCases[i];
  8367. if (!(lastCaseCheckResult || switchCase.isDefault)) {
  8368. _context11.next = 13;
  8369. break;
  8370. }
  8371. _context11.next = 10;
  8372. return this.executeCommands(lastStore, switchCase.commands);
  8373. case 10:
  8374. lastStore = _context11.sent;
  8375. _context11.next = 23;
  8376. break;
  8377. case 13:
  8378. equalityInfixApp = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].EQ, cmd.expression, switchCase.expression);
  8379. equalityInfixApp.sourceInfo = switchCase.sourceInfo;
  8380. _context11.next = 17;
  8381. return this.evaluateExpression(lastStore, equalityInfixApp);
  8382. case 17:
  8383. result = _context11.sent;
  8384. if (!result.get()) {
  8385. _context11.next = 22;
  8386. break;
  8387. }
  8388. _context11.next = 21;
  8389. return this.executeCommands(lastStore, switchCase.commands);
  8390. case 21:
  8391. lastStore = _context11.sent;
  8392. case 22:
  8393. lastCaseCheckResult = result.get();
  8394. case 23:
  8395. i += 1;
  8396. _context11.next = 5;
  8397. break;
  8398. case 26:
  8399. this.context.pop();
  8400. if (lastStore.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK) {
  8401. lastStore.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  8402. }
  8403. return _context11.abrupt("return", lastStore);
  8404. case 29:
  8405. case "end":
  8406. return _context11.stop();
  8407. }
  8408. }
  8409. }, _callee11, this);
  8410. }));
  8411. function executeSwitch(_x27, _x28) {
  8412. return _executeSwitch.apply(this, arguments);
  8413. }
  8414. return executeSwitch;
  8415. }()
  8416. /**
  8417. *
  8418. * @param {Store} store
  8419. * @param {Commands.For} cmd
  8420. *
  8421. * @returns {Promise<Store>}
  8422. */
  8423. }, {
  8424. key: "executeFor",
  8425. value: function () {
  8426. 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) {
  8427. var initCmd, passValue, condition, checkEndGTBegin, isForward, increment, whileBlock, forAsWhile, newCmdList;
  8428. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee12$(_context12) {
  8429. while (1) {
  8430. switch (_context12.prev = _context12.next) {
  8431. case 0:
  8432. //BEGIN for -> while rewrite
  8433. initCmd = new _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Assign"](cmd.for_id.id, cmd.for_from);
  8434. initCmd.sourceInfo = cmd.sourceInfo; // Assume for is iterating forward and that pass is not missing
  8435. passValue = cmd.for_pass;
  8436. condition = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].LT, cmd.for_id, cmd.for_to);
  8437. if (!(cmd.for_pass == null)) {
  8438. _context12.next = 12;
  8439. break;
  8440. }
  8441. passValue = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["IntLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["toInt"])(1));
  8442. _context12.next = 8;
  8443. 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));
  8444. case 8:
  8445. checkEndGTBegin = _context12.sent;
  8446. if (!checkEndGTBegin.get()) {
  8447. passValue = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["IntLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["toInt"])(-1));
  8448. condition = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].GT, cmd.for_id, cmd.for_to);
  8449. }
  8450. _context12.next = 16;
  8451. break;
  8452. case 12:
  8453. _context12.next = 14;
  8454. 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))));
  8455. case 14:
  8456. isForward = _context12.sent;
  8457. if (!isForward.get()) {
  8458. condition = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].GT, cmd.for_id, cmd.for_to);
  8459. }
  8460. case 16:
  8461. condition.sourceInfo = cmd.sourceInfo;
  8462. 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));
  8463. increment.sourceInfo = cmd.sourceInfo;
  8464. whileBlock = new _ast_commands___WEBPACK_IMPORTED_MODULE_12__["CommandBlock"]([], cmd.commands.concat(increment));
  8465. forAsWhile = new _ast_commands___WEBPACK_IMPORTED_MODULE_12__["While"](condition, whileBlock);
  8466. forAsWhile.sourceInfo = cmd.sourceInfo; //END for -> while rewrite
  8467. newCmdList = [initCmd, forAsWhile];
  8468. return _context12.abrupt("return", this.executeCommands(store, newCmdList));
  8469. case 24:
  8470. case "end":
  8471. return _context12.stop();
  8472. }
  8473. }
  8474. }, _callee12, this);
  8475. }));
  8476. function executeFor(_x29, _x30) {
  8477. return _executeFor.apply(this, arguments);
  8478. }
  8479. return executeFor;
  8480. }()
  8481. /**
  8482. *
  8483. * @param {Store} store
  8484. * @param {Commands.RepeatUntil} cmd
  8485. *
  8486. * @returns {Promise<Store>}
  8487. */
  8488. }, {
  8489. key: "executeRepeatUntil",
  8490. value: function () {
  8491. 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) {
  8492. var sto, checkCondition;
  8493. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee13$(_context13) {
  8494. while (1) {
  8495. switch (_context13.prev = _context13.next) {
  8496. case 0:
  8497. this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE);
  8498. _context13.next = 3;
  8499. return this.executeCommands(store, cmd.commands);
  8500. case 3:
  8501. sto = _context13.sent;
  8502. if (!(sto.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK)) {
  8503. _context13.next = 8;
  8504. break;
  8505. }
  8506. this.context.pop();
  8507. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  8508. return _context13.abrupt("return", sto);
  8509. case 8:
  8510. _context13.next = 10;
  8511. return this.evaluateExpression(sto, cmd.expression);
  8512. case 10:
  8513. checkCondition = _context13.sent;
  8514. if (checkCondition.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN)) {
  8515. _context13.next = 13;
  8516. break;
  8517. }
  8518. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].loop_condition_type_full(cmd.sourceInfo);
  8519. case 13:
  8520. this.context.pop();
  8521. if (!checkCondition.get()) {
  8522. _context13.next = 18;
  8523. break;
  8524. }
  8525. return _context13.abrupt("return", sto);
  8526. case 18:
  8527. return _context13.abrupt("return", this.executeCommand(sto, cmd));
  8528. case 19:
  8529. case "end":
  8530. return _context13.stop();
  8531. }
  8532. }
  8533. }, _callee13, this);
  8534. }));
  8535. function executeRepeatUntil(_x31, _x32) {
  8536. return _executeRepeatUntil.apply(this, arguments);
  8537. }
  8538. return executeRepeatUntil;
  8539. }()
  8540. /**
  8541. *
  8542. * @param {Store} store
  8543. * @param {Commands.While} cmd
  8544. *
  8545. * @returns {Promise<Store>}
  8546. */
  8547. }, {
  8548. key: "executeWhile",
  8549. value: function () {
  8550. 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) {
  8551. var checkCondition, sto;
  8552. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee14$(_context14) {
  8553. while (1) {
  8554. switch (_context14.prev = _context14.next) {
  8555. case 0:
  8556. this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE);
  8557. _context14.next = 3;
  8558. return this.evaluateExpression(store, cmd.expression);
  8559. case 3:
  8560. checkCondition = _context14.sent;
  8561. if (checkCondition.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN)) {
  8562. _context14.next = 6;
  8563. break;
  8564. }
  8565. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].loop_condition_type_full(cmd.expression.toString(), cmd.sourceInfo);
  8566. case 6:
  8567. if (!checkCondition.get()) {
  8568. _context14.next = 17;
  8569. break;
  8570. }
  8571. _context14.next = 9;
  8572. return this.executeCommands(store, cmd.commands);
  8573. case 9:
  8574. sto = _context14.sent;
  8575. this.context.pop();
  8576. if (!(sto.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK)) {
  8577. _context14.next = 14;
  8578. break;
  8579. }
  8580. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
  8581. return _context14.abrupt("return", sto);
  8582. case 14:
  8583. return _context14.abrupt("return", this.executeCommand(sto, cmd));
  8584. case 17:
  8585. this.context.pop();
  8586. return _context14.abrupt("return", store);
  8587. case 19:
  8588. case "end":
  8589. return _context14.stop();
  8590. }
  8591. }
  8592. }, _callee14, this);
  8593. }));
  8594. function executeWhile(_x33, _x34) {
  8595. return _executeWhile.apply(this, arguments);
  8596. }
  8597. return executeWhile;
  8598. }()
  8599. /**
  8600. *
  8601. * @param {Store} store
  8602. * @param {Commands.IfThenElse} cmd
  8603. *
  8604. * @returns {Promise<Store>}
  8605. */
  8606. }, {
  8607. key: "executeIfThenElse",
  8608. value: function () {
  8609. 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) {
  8610. var isTrue;
  8611. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee15$(_context15) {
  8612. while (1) {
  8613. switch (_context15.prev = _context15.next) {
  8614. case 0:
  8615. _context15.next = 2;
  8616. return this.evaluateExpression(store, cmd.condition);
  8617. case 2:
  8618. isTrue = _context15.sent;
  8619. if (isTrue.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN)) {
  8620. _context15.next = 5;
  8621. break;
  8622. }
  8623. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].if_condition_type_full(cmd.condition.toString(), cmd.sourceInfo);
  8624. case 5:
  8625. if (!isTrue.get()) {
  8626. _context15.next = 9;
  8627. break;
  8628. }
  8629. return _context15.abrupt("return", this.executeCommands(store, cmd.ifTrue.commands));
  8630. case 9:
  8631. if (!(cmd.ifFalse !== null)) {
  8632. _context15.next = 17;
  8633. break;
  8634. }
  8635. if (!(cmd.ifFalse instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["IfThenElse"])) {
  8636. _context15.next = 14;
  8637. break;
  8638. }
  8639. return _context15.abrupt("return", this.executeCommand(store, cmd.ifFalse));
  8640. case 14:
  8641. return _context15.abrupt("return", this.executeCommands(store, cmd.ifFalse.commands));
  8642. case 15:
  8643. _context15.next = 18;
  8644. break;
  8645. case 17:
  8646. return _context15.abrupt("return", store);
  8647. case 18:
  8648. case "end":
  8649. return _context15.stop();
  8650. }
  8651. }
  8652. }, _callee15, this);
  8653. }));
  8654. function executeIfThenElse(_x35, _x36) {
  8655. return _executeIfThenElse.apply(this, arguments);
  8656. }
  8657. return executeIfThenElse;
  8658. }()
  8659. /**
  8660. *
  8661. * @param {Store} store
  8662. * @param {Commands.Return} cmd
  8663. *
  8664. * @returns {Promise<Store>}
  8665. */
  8666. }, {
  8667. key: "executeReturn",
  8668. value: function () {
  8669. 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) {
  8670. var funcName, func, funcType, value, real_value, stringInfo, info;
  8671. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee16$(_context16) {
  8672. while (1) {
  8673. switch (_context16.prev = _context16.next) {
  8674. case 0:
  8675. 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);
  8676. func = this.findFunction(store.name);
  8677. funcType = func.returnType;
  8678. _context16.next = 5;
  8679. return this.evaluateExpression(store, cmd.expression);
  8680. case 5:
  8681. value = _context16.sent;
  8682. if (!(value === null && funcType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].VOID))) {
  8683. _context16.next = 9;
  8684. break;
  8685. }
  8686. store.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  8687. return _context16.abrupt("return", store);
  8688. case 9:
  8689. real_value = value;
  8690. if (!(value === null || !funcType.isCompatible(value.type))) {
  8691. _context16.next = 16;
  8692. break;
  8693. }
  8694. if (!(!_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(funcType, value.type))) {
  8695. _context16.next = 15;
  8696. break;
  8697. }
  8698. stringInfo = funcType.stringInfo();
  8699. info = stringInfo[0];
  8700. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_return_type_full(funcName, info.type, info.dim, cmd.sourceInfo);
  8701. case 15:
  8702. real_value = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(funcType, value);
  8703. case 16:
  8704. store.insertStore("$", real_value);
  8705. store.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  8706. return _context16.abrupt("return", store);
  8707. case 19:
  8708. case "end":
  8709. return _context16.stop();
  8710. }
  8711. }
  8712. }, _callee16, this);
  8713. }));
  8714. function executeReturn(_x37, _x38) {
  8715. return _executeReturn.apply(this, arguments);
  8716. }
  8717. return executeReturn;
  8718. }()
  8719. /**
  8720. *
  8721. * @param {Store} store
  8722. * @param {Commands.Break} cmd
  8723. *
  8724. * @returns {Promise<Store>}
  8725. */
  8726. }, {
  8727. key: "executeBreak",
  8728. value: function () {
  8729. 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) {
  8730. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee17$(_context17) {
  8731. while (1) {
  8732. switch (_context17.prev = _context17.next) {
  8733. case 0:
  8734. if (!this.checkContext(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE)) {
  8735. _context17.next = 5;
  8736. break;
  8737. }
  8738. store.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK;
  8739. return _context17.abrupt("return", store);
  8740. case 5:
  8741. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].unexpected_break_command_full(cmd.sourceInfo);
  8742. case 6:
  8743. case "end":
  8744. return _context17.stop();
  8745. }
  8746. }
  8747. }, _callee17, this);
  8748. }));
  8749. function executeBreak(_x39, _x40) {
  8750. return _executeBreak.apply(this, arguments);
  8751. }
  8752. return executeBreak;
  8753. }()
  8754. /**
  8755. *
  8756. * @param {Store} store
  8757. * @param {Commands.Assign} cmd
  8758. *
  8759. * @returns {Promise<Store>}
  8760. */
  8761. }, {
  8762. key: "executeAssign",
  8763. value: function () {
  8764. 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) {
  8765. var inStore, value, realValue, stringInfo, info, exp_type_string_info, exp_type_info, exp, columns, _exp;
  8766. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee18$(_context18) {
  8767. while (1) {
  8768. switch (_context18.prev = _context18.next) {
  8769. case 0:
  8770. inStore = store.applyStore(cmd.id);
  8771. if (!inStore.isConst) {
  8772. _context18.next = 3;
  8773. break;
  8774. }
  8775. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  8776. case 3:
  8777. _context18.next = 5;
  8778. return this.evaluateExpression(store, cmd.expression);
  8779. case 5:
  8780. value = _context18.sent;
  8781. realValue = value;
  8782. if (inStore.type.isCompatible(realValue.type)) {
  8783. _context18.next = 18;
  8784. break;
  8785. }
  8786. if (!(_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(inStore.type, value.type))) {
  8787. _context18.next = 12;
  8788. break;
  8789. }
  8790. realValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(inStore.type, realValue);
  8791. _context18.next = 18;
  8792. break;
  8793. case 12:
  8794. stringInfo = inStore.type.stringInfo();
  8795. info = stringInfo[0];
  8796. exp_type_string_info = value.type.stringInfo();
  8797. exp_type_info = exp_type_string_info[0];
  8798. exp = cmd.expression.toString();
  8799. 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);
  8800. case 18:
  8801. if (!(inStore instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"])) {
  8802. _context18.next = 27;
  8803. break;
  8804. }
  8805. columns = realValue.columns == null ? 0 : realValue.columns;
  8806. if (!(inStore.lines !== realValue.lines || inStore.columns !== columns)) {
  8807. _context18.next = 27;
  8808. break;
  8809. }
  8810. _exp = cmd.expression.toString();
  8811. if (!inStore.isVector()) {
  8812. _context18.next = 26;
  8813. break;
  8814. }
  8815. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_vector_assignment_full(cmd.id, inStore.lines, _exp, realValue.lines, cmd.sourceInfo);
  8816. case 26:
  8817. 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);
  8818. case 27:
  8819. store.updateStore(cmd.id, realValue);
  8820. return _context18.abrupt("return", store);
  8821. case 29:
  8822. case "end":
  8823. return _context18.stop();
  8824. }
  8825. }
  8826. }, _callee18, this);
  8827. }));
  8828. function executeAssign(_x41, _x42) {
  8829. return _executeAssign.apply(this, arguments);
  8830. }
  8831. return executeAssign;
  8832. }()
  8833. /**
  8834. *
  8835. * @param {Store} store
  8836. * @param {Commands.ArrayIndexAssign} cmd
  8837. *
  8838. * @returns {Promise<Store>}
  8839. */
  8840. }, {
  8841. key: "executeArrayIndexAssign",
  8842. value: function () {
  8843. 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) {
  8844. var mustBeArray, used_dims, lineSV, line, columnSV, column, value, actualValue, type, stringInfo, info, exp_type_string_info, exp_type_info, exp, current_value, _exp2;
  8845. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee19$(_context19) {
  8846. while (1) {
  8847. switch (_context19.prev = _context19.next) {
  8848. case 0:
  8849. mustBeArray = store.applyStore(cmd.id);
  8850. used_dims = 0;
  8851. if (!mustBeArray.isConst) {
  8852. _context19.next = 4;
  8853. break;
  8854. }
  8855. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  8856. case 4:
  8857. if (mustBeArray.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__["ArrayType"]) {
  8858. _context19.next = 6;
  8859. break;
  8860. }
  8861. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_array_access_full(cmd.id, cmd.sourceInfo);
  8862. case 6:
  8863. _context19.next = 8;
  8864. return this.evaluateExpression(store, cmd.line);
  8865. case 8:
  8866. lineSV = _context19.sent;
  8867. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(lineSV.type)) {
  8868. _context19.next = 11;
  8869. break;
  8870. }
  8871. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  8872. case 11:
  8873. used_dims += 1;
  8874. line = lineSV.get().toNumber();
  8875. _context19.next = 15;
  8876. return this.evaluateExpression(store, cmd.column);
  8877. case 15:
  8878. columnSV = _context19.sent;
  8879. column = null;
  8880. if (!(columnSV != null)) {
  8881. _context19.next = 22;
  8882. break;
  8883. }
  8884. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(columnSV.type)) {
  8885. _context19.next = 20;
  8886. break;
  8887. }
  8888. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  8889. case 20:
  8890. column = columnSV.get().toNumber();
  8891. used_dims += 1;
  8892. case 22:
  8893. _context19.next = 24;
  8894. return this.evaluateExpression(store, cmd.expression);
  8895. case 24:
  8896. value = _context19.sent;
  8897. actualValue = value;
  8898. if (!(line >= mustBeArray.lines)) {
  8899. _context19.next = 34;
  8900. break;
  8901. }
  8902. if (!mustBeArray.isVector) {
  8903. _context19.next = 31;
  8904. break;
  8905. }
  8906. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_line_outbounds_full(cmd.id, line, mustBeArray.lines, cmd.sourceInfo);
  8907. case 31:
  8908. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_line_outbounds_full(cmd.id, line, mustBeArray.lines, cmd.sourceInfo);
  8909. case 32:
  8910. _context19.next = 36;
  8911. break;
  8912. case 34:
  8913. if (!(line < 0)) {
  8914. _context19.next = 36;
  8915. break;
  8916. }
  8917. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo);
  8918. case 36:
  8919. if (!(column != null && mustBeArray.columns === 0)) {
  8920. _context19.next = 38;
  8921. break;
  8922. }
  8923. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_not_matrix_full(cmd.id, cmd.sourceInfo);
  8924. case 38:
  8925. if (!(column != null)) {
  8926. _context19.next = 45;
  8927. break;
  8928. }
  8929. if (!(column >= mustBeArray.columns)) {
  8930. _context19.next = 43;
  8931. break;
  8932. }
  8933. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_column_outbounds_full(cmd.id, column, mustBeArray.columns, cmd.sourceInfo);
  8934. case 43:
  8935. if (!(column < 0)) {
  8936. _context19.next = 45;
  8937. break;
  8938. }
  8939. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo);
  8940. case 45:
  8941. if (mustBeArray.type.canAccept(value.type, used_dims)) {
  8942. _context19.next = 55;
  8943. break;
  8944. }
  8945. if (!(!_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(mustBeArray.type.innerType, value.type))) {
  8946. _context19.next = 54;
  8947. break;
  8948. }
  8949. type = mustBeArray.type.innerType;
  8950. stringInfo = type.stringInfo();
  8951. info = stringInfo[0];
  8952. exp_type_string_info = value.type.stringInfo();
  8953. exp_type_info = exp_type_string_info[0];
  8954. exp = cmd.expression.toString();
  8955. 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);
  8956. case 54:
  8957. actualValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(mustBeArray.type.innerType, value);
  8958. case 55:
  8959. current_value = mustBeArray.getAt(line, column);
  8960. if (!(current_value instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"])) {
  8961. _context19.next = 60;
  8962. break;
  8963. }
  8964. if (!(current_value.lines !== actualValue.lines || current_value.columns !== actualValue.columns)) {
  8965. _context19.next = 60;
  8966. break;
  8967. }
  8968. _exp2 = cmd.expression.toString();
  8969. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_matrix_index_assign_full(cmd.id, line, current_value.lines, _exp2, actualValue.lines, cmd.sourceInfo);
  8970. case 60:
  8971. return _context19.abrupt("return", store.updateStoreArray(cmd.id, actualValue, line, column));
  8972. case 61:
  8973. case "end":
  8974. return _context19.stop();
  8975. }
  8976. }
  8977. }, _callee19, this);
  8978. }));
  8979. function executeArrayIndexAssign(_x43, _x44) {
  8980. return _executeArrayIndexAssign.apply(this, arguments);
  8981. }
  8982. return executeArrayIndexAssign;
  8983. }()
  8984. /**
  8985. *
  8986. * @param {Store} store
  8987. * @param {Commands.Declaration} cmd
  8988. *
  8989. * @returns {Promise<Store>}
  8990. */
  8991. }, {
  8992. key: "executeDeclaration",
  8993. value: function () {
  8994. 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) {
  8995. var temp, value, realValue, stringInfo, info, exp_type_string_info, exp_type_info, exp;
  8996. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee20$(_context20) {
  8997. while (1) {
  8998. switch (_context20.prev = _context20.next) {
  8999. case 0:
  9000. if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["ArrayDeclaration"])) {
  9001. _context20.next = 4;
  9002. break;
  9003. }
  9004. return _context20.abrupt("return", this.executeArrayDeclaration(store, cmd));
  9005. case 4:
  9006. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](cmd.type, null, null, cmd.isConst);
  9007. if (!(cmd.initial !== null)) {
  9008. _context20.next = 22;
  9009. break;
  9010. }
  9011. _context20.next = 8;
  9012. return this.evaluateExpression(store, cmd.initial);
  9013. case 8:
  9014. value = _context20.sent;
  9015. realValue = value;
  9016. if (value.type.isCompatible(cmd.type)) {
  9017. _context20.next = 21;
  9018. break;
  9019. }
  9020. if (!(_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(cmd.type, value.type))) {
  9021. _context20.next = 15;
  9022. break;
  9023. }
  9024. realValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(cmd.type, realValue);
  9025. _context20.next = 21;
  9026. break;
  9027. case 15:
  9028. stringInfo = value.type.stringInfo();
  9029. info = stringInfo[0];
  9030. exp_type_string_info = value.type.stringInfo();
  9031. exp_type_info = exp_type_string_info[0];
  9032. exp = cmd.expression.toString();
  9033. 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);
  9034. case 21:
  9035. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](cmd.type, realValue.get(), null, cmd.isConst);
  9036. case 22:
  9037. store.insertStore(cmd.id, temp);
  9038. return _context20.abrupt("return", store);
  9039. case 24:
  9040. case "end":
  9041. return _context20.stop();
  9042. }
  9043. }
  9044. }, _callee20, this);
  9045. }));
  9046. function executeDeclaration(_x45, _x46) {
  9047. return _executeDeclaration.apply(this, arguments);
  9048. }
  9049. return executeDeclaration;
  9050. }()
  9051. /**
  9052. *
  9053. * @param {Store} store
  9054. * @param {Commands.ArrayDeclaration} cmd
  9055. *
  9056. * @returns {Promise<Store>}
  9057. */
  9058. }, {
  9059. key: "executeArrayDeclaration",
  9060. value: function () {
  9061. 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) {
  9062. var linesSV, line, columnsSV, column, temp, valueList;
  9063. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee21$(_context21) {
  9064. while (1) {
  9065. switch (_context21.prev = _context21.next) {
  9066. case 0:
  9067. _context21.next = 2;
  9068. return this.evaluateExpression(store, cmd.lines);
  9069. case 2:
  9070. linesSV = _context21.sent;
  9071. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(linesSV.type)) {
  9072. _context21.next = 5;
  9073. break;
  9074. }
  9075. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  9076. case 5:
  9077. line = linesSV.get().toNumber();
  9078. _context21.next = 8;
  9079. return this.evaluateExpression(store, cmd.columns);
  9080. case 8:
  9081. columnsSV = _context21.sent;
  9082. column = null;
  9083. if (!(columnsSV !== null)) {
  9084. _context21.next = 16;
  9085. break;
  9086. }
  9087. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(columnsSV.type)) {
  9088. _context21.next = 13;
  9089. break;
  9090. }
  9091. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  9092. case 13:
  9093. column = columnsSV.get().toNumber();
  9094. if (!(column < 0)) {
  9095. _context21.next = 16;
  9096. break;
  9097. }
  9098. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo);
  9099. case 16:
  9100. temp = new _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"](cmd.type, [], line, column, null, cmd.isConst);
  9101. if (!(cmd.initial !== null)) {
  9102. _context21.next = 22;
  9103. break;
  9104. }
  9105. _context21.next = 20;
  9106. return this.evaluateArrayLiteral(store, cmd.initial, cmd.type, line, column);
  9107. case 20:
  9108. valueList = _context21.sent;
  9109. temp = new _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"](cmd.type, valueList, line, column, null, cmd.isConst);
  9110. case 22:
  9111. store.insertStore(cmd.id, temp);
  9112. return _context21.abrupt("return", store);
  9113. case 24:
  9114. case "end":
  9115. return _context21.stop();
  9116. }
  9117. }
  9118. }, _callee21, this);
  9119. }));
  9120. function executeArrayDeclaration(_x47, _x48) {
  9121. return _executeArrayDeclaration.apply(this, arguments);
  9122. }
  9123. return executeArrayDeclaration;
  9124. }()
  9125. /**
  9126. *
  9127. * @param {Store} store
  9128. * @param {Expression} exp
  9129. *
  9130. * @returns {Promise<import('./store/value/istore_value').IStoreValue>}
  9131. */
  9132. }, {
  9133. key: "evaluateExpression",
  9134. value: function () {
  9135. 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) {
  9136. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee22$(_context22) {
  9137. while (1) {
  9138. switch (_context22.prev = _context22.next) {
  9139. case 0:
  9140. this.instruction_count += 1;
  9141. if (!(this.instruction_count % _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].suspend_threshold == 0)) {
  9142. _context22.next = 4;
  9143. break;
  9144. }
  9145. _context22.next = 4;
  9146. return _util_utils__WEBPACK_IMPORTED_MODULE_16__["sleep"](5);
  9147. case 4:
  9148. if (!(this.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].ABORT)) {
  9149. _context22.next = 6;
  9150. break;
  9151. }
  9152. throw _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_28__["LocalizedStrings"].getMessage("aborted_execution");
  9153. case 6:
  9154. if (!(this.instruction_count >= _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].max_instruction_count)) {
  9155. _context22.next = 8;
  9156. break;
  9157. }
  9158. 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.");
  9159. case 8:
  9160. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["UnaryApp"])) {
  9161. _context22.next = 12;
  9162. break;
  9163. }
  9164. return _context22.abrupt("return", this.evaluateUnaryApp(store, exp));
  9165. case 12:
  9166. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"])) {
  9167. _context22.next = 16;
  9168. break;
  9169. }
  9170. return _context22.abrupt("return", this.evaluateInfixApp(store, exp));
  9171. case 16:
  9172. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["ArrayAccess"])) {
  9173. _context22.next = 20;
  9174. break;
  9175. }
  9176. return _context22.abrupt("return", this.evaluateArrayAccess(store, exp));
  9177. case 20:
  9178. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["VariableLiteral"])) {
  9179. _context22.next = 24;
  9180. break;
  9181. }
  9182. return _context22.abrupt("return", this.evaluateVariableLiteral(store, exp));
  9183. case 24:
  9184. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["IntLiteral"])) {
  9185. _context22.next = 28;
  9186. break;
  9187. }
  9188. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  9189. case 28:
  9190. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["RealLiteral"])) {
  9191. _context22.next = 32;
  9192. break;
  9193. }
  9194. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  9195. case 32:
  9196. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["BoolLiteral"])) {
  9197. _context22.next = 36;
  9198. break;
  9199. }
  9200. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  9201. case 36:
  9202. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["StringLiteral"])) {
  9203. _context22.next = 40;
  9204. break;
  9205. }
  9206. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  9207. case 40:
  9208. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["CharLiteral"])) {
  9209. _context22.next = 44;
  9210. break;
  9211. }
  9212. return _context22.abrupt("return", this.evaluateLiteral(store, exp));
  9213. case 44:
  9214. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["ArrayLiteral"])) {
  9215. _context22.next = 48;
  9216. break;
  9217. }
  9218. throw new Error("Internal Error: The system should not eval an array literal.");
  9219. case 48:
  9220. if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["FunctionCall"])) {
  9221. _context22.next = 50;
  9222. break;
  9223. }
  9224. return _context22.abrupt("return", this.evaluateFunctionCall(store, exp));
  9225. case 50:
  9226. return _context22.abrupt("return", null);
  9227. case 51:
  9228. case "end":
  9229. return _context22.stop();
  9230. }
  9231. }
  9232. }, _callee22, this);
  9233. }));
  9234. function evaluateExpression(_x49, _x50) {
  9235. return _evaluateExpression.apply(this, arguments);
  9236. }
  9237. return evaluateExpression;
  9238. }()
  9239. }, {
  9240. key: "evaluateFunctionCall",
  9241. value: function () {
  9242. 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) {
  9243. var func, sto, val;
  9244. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee23$(_context23) {
  9245. while (1) {
  9246. switch (_context23.prev = _context23.next) {
  9247. case 0:
  9248. if (!exp.isMainCall) {
  9249. _context23.next = 2;
  9250. break;
  9251. }
  9252. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].void_in_expression_full(_definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName(), exp.sourceInfo);
  9253. case 2:
  9254. func = this.findFunction(exp.id);
  9255. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].VOID.isCompatible(func.returnType)) {
  9256. _context23.next = 5;
  9257. break;
  9258. }
  9259. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].void_in_expression_full(exp.id, exp.sourceInfo);
  9260. case 5:
  9261. if (!(this.function_call_stack.length >= _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].max_call_stack)) {
  9262. _context23.next = 7;
  9263. break;
  9264. }
  9265. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].exceeded_recursive_calls(exp.sourceInfo);
  9266. case 7:
  9267. this.function_call_stack.push(exp.sourceInfo);
  9268. _context23.next = 10;
  9269. return this.runFunction(func, exp.actualParameters, store);
  9270. case 10:
  9271. sto = _context23.sent;
  9272. if (!(sto.mode !== _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN)) {
  9273. _context23.next = 13;
  9274. break;
  9275. }
  9276. 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);
  9277. case 13:
  9278. val = sto.applyStore("$");
  9279. sto.destroy();
  9280. this.function_call_stack.pop();
  9281. return _context23.abrupt("return", val);
  9282. case 17:
  9283. case "end":
  9284. return _context23.stop();
  9285. }
  9286. }
  9287. }, _callee23, this);
  9288. }));
  9289. function evaluateFunctionCall(_x51, _x52) {
  9290. return _evaluateFunctionCall.apply(this, arguments);
  9291. }
  9292. return evaluateFunctionCall;
  9293. }()
  9294. /**
  9295. *
  9296. * @param {Store} store
  9297. * @param {Expressions.ArrayLiteral} exp
  9298. * @param {ArrayType} type
  9299. *
  9300. * @returns {Promise<StoreValue[]>}
  9301. */
  9302. }, {
  9303. key: "evaluateArrayLiteral",
  9304. value: function () {
  9305. 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) {
  9306. var storeValueMatrix;
  9307. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee24$(_context24) {
  9308. while (1) {
  9309. switch (_context24.prev = _context24.next) {
  9310. case 0:
  9311. if (exp.isVector) {
  9312. _context24.next = 9;
  9313. break;
  9314. }
  9315. if (!(columns == null)) {
  9316. _context24.next = 3;
  9317. break;
  9318. }
  9319. throw new Error("This should never happen: Vector cannot be initialized by a matrix");
  9320. case 3:
  9321. _context24.next = 5;
  9322. return this.evaluateMatrix(store, exp, type, lines, columns);
  9323. case 5:
  9324. storeValueMatrix = _context24.sent;
  9325. return _context24.abrupt("return", storeValueMatrix.reduce(function (prev, next) {
  9326. return prev.concat(next);
  9327. }, []));
  9328. case 9:
  9329. if (!(columns != null)) {
  9330. _context24.next = 11;
  9331. break;
  9332. }
  9333. throw new Error("This should never happen: Matrix cannot be initialized by a vector");
  9334. case 11:
  9335. return _context24.abrupt("return", this.evaluateVector(store, exp, type, lines));
  9336. case 12:
  9337. case "end":
  9338. return _context24.stop();
  9339. }
  9340. }
  9341. }, _callee24, this);
  9342. }));
  9343. function evaluateArrayLiteral(_x53, _x54, _x55, _x56, _x57) {
  9344. return _evaluateArrayLiteral.apply(this, arguments);
  9345. }
  9346. return evaluateArrayLiteral;
  9347. }()
  9348. /**
  9349. * Evalautes a list of literals and expression composing the vector
  9350. * @param {Store} store
  9351. * @param {Expressions.ArrayLiteral} exps
  9352. * @param {ArrayType} type
  9353. * @param {number} n_elements
  9354. *
  9355. * @returns {Promise<StoreValue[]>} store object list
  9356. */
  9357. }, {
  9358. key: "evaluateVector",
  9359. value: function () {
  9360. 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) {
  9361. var _this = this;
  9362. var values, actualValues;
  9363. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee25$(_context25) {
  9364. while (1) {
  9365. switch (_context25.prev = _context25.next) {
  9366. case 0:
  9367. values = exps.value;
  9368. if (!(n_elements !== values.length)) {
  9369. _context25.next = 3;
  9370. break;
  9371. }
  9372. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_number_elements_vector(n_elements, exps.toString(), values.length, exps.sourceInfo);
  9373. case 3:
  9374. _context25.next = 5;
  9375. return Promise.all(values.map(function (exp) {
  9376. return _this.evaluateExpression(store, exp);
  9377. }));
  9378. case 5:
  9379. actualValues = _context25.sent;
  9380. return _context25.abrupt("return", actualValues.map(function (v, index) {
  9381. if (!type.canAccept(v.type, 1)) {
  9382. if (!_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(type.innerType, v.type)) {
  9383. // const stringInfo = v.type.stringInfo();
  9384. // const info = stringInfo[0];
  9385. var exp_str = values[index].toString(); // TODO - fix error message
  9386. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_array_literal_type_full(exp_str, values[index].sourceInfo);
  9387. }
  9388. var newValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(type.innerType, v);
  9389. return newValue;
  9390. }
  9391. return v;
  9392. }));
  9393. case 7:
  9394. case "end":
  9395. return _context25.stop();
  9396. }
  9397. }
  9398. }, _callee25);
  9399. }));
  9400. function evaluateVector(_x58, _x59, _x60, _x61) {
  9401. return _evaluateVector.apply(this, arguments);
  9402. }
  9403. return evaluateVector;
  9404. }()
  9405. /**
  9406. * Evaluates a list of array literals composing the matrix
  9407. * @param {Store} store
  9408. * @param {Expressions.ArrayLiteral} exps
  9409. * @param {ArrayType} type
  9410. *
  9411. * @returns {Promise<StoreValue[][]>}
  9412. */
  9413. }, {
  9414. key: "evaluateMatrix",
  9415. value: function () {
  9416. 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) {
  9417. var _this2 = this;
  9418. var values, vectors;
  9419. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee26$(_context26) {
  9420. while (1) {
  9421. switch (_context26.prev = _context26.next) {
  9422. case 0:
  9423. values = exps.value;
  9424. if (!(values.length !== lines)) {
  9425. _context26.next = 3;
  9426. break;
  9427. }
  9428. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_number_lines_matrix(lines, exps.toString(), values.length, exps.sourceInfo);
  9429. case 3:
  9430. vectors = values.map(function (vector) {
  9431. var vec_type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__["ArrayType"](type.innerType, 1);
  9432. return _this2.evaluateVector(store, vector, vec_type, columns);
  9433. });
  9434. _context26.next = 6;
  9435. return Promise.all(vectors);
  9436. case 6:
  9437. return _context26.abrupt("return", _context26.sent);
  9438. case 7:
  9439. case "end":
  9440. return _context26.stop();
  9441. }
  9442. }
  9443. }, _callee26);
  9444. }));
  9445. function evaluateMatrix(_x62, _x63, _x64, _x65, _x66) {
  9446. return _evaluateMatrix.apply(this, arguments);
  9447. }
  9448. return evaluateMatrix;
  9449. }()
  9450. /**
  9451. *
  9452. * @param {Store} _
  9453. * @param {import('../ast/expressions/literal').Literal} exp
  9454. *
  9455. * @returns {import('./store/value/istore_value').IStoreValue}
  9456. */
  9457. }, {
  9458. key: "evaluateLiteral",
  9459. value: function () {
  9460. 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) {
  9461. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee27$(_context27) {
  9462. while (1) {
  9463. switch (_context27.prev = _context27.next) {
  9464. case 0:
  9465. return _context27.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](exp.type, exp.value));
  9466. case 1:
  9467. case "end":
  9468. return _context27.stop();
  9469. }
  9470. }
  9471. }, _callee27);
  9472. }));
  9473. function evaluateLiteral(_x67, _x68) {
  9474. return _evaluateLiteral.apply(this, arguments);
  9475. }
  9476. return evaluateLiteral;
  9477. }()
  9478. /**
  9479. *
  9480. * @param {Store} store
  9481. * @param {Expressions.VariableLiteral} exp
  9482. *
  9483. * @returns {import('./store/value/istore_value').IStoreValue}
  9484. */
  9485. }, {
  9486. key: "evaluateVariableLiteral",
  9487. value: function () {
  9488. 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) {
  9489. var val;
  9490. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee28$(_context28) {
  9491. while (1) {
  9492. switch (_context28.prev = _context28.next) {
  9493. case 0:
  9494. val = store.applyStore(exp.id);
  9495. return _context28.abrupt("return", val);
  9496. case 2:
  9497. case "end":
  9498. return _context28.stop();
  9499. }
  9500. }
  9501. }, _callee28);
  9502. }));
  9503. function evaluateVariableLiteral(_x69, _x70) {
  9504. return _evaluateVariableLiteral.apply(this, arguments);
  9505. }
  9506. return evaluateVariableLiteral;
  9507. }()
  9508. /**
  9509. *
  9510. * @param {Store} store
  9511. * @param {Expressions.ArrayAccess} exp
  9512. *
  9513. * @returns {import('./store/value/istore_value').IStoreValue}
  9514. */
  9515. }, {
  9516. key: "evaluateArrayAccess",
  9517. value: function () {
  9518. 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) {
  9519. var mustBeArray, lineSV, line, columnSV, column, result, type, values;
  9520. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee29$(_context29) {
  9521. while (1) {
  9522. switch (_context29.prev = _context29.next) {
  9523. case 0:
  9524. mustBeArray = store.getStoreObject(exp.id);
  9525. if (mustBeArray.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__["ArrayType"]) {
  9526. _context29.next = 3;
  9527. break;
  9528. }
  9529. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_array_access_full(exp.id, exp.sourceInfo);
  9530. case 3:
  9531. _context29.next = 5;
  9532. return this.evaluateExpression(store, exp.line);
  9533. case 5:
  9534. lineSV = _context29.sent;
  9535. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(lineSV.type)) {
  9536. _context29.next = 8;
  9537. break;
  9538. }
  9539. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(exp.sourceInfo);
  9540. case 8:
  9541. line = lineSV.get().toNumber();
  9542. _context29.next = 11;
  9543. return this.evaluateExpression(store, exp.column);
  9544. case 11:
  9545. columnSV = _context29.sent;
  9546. column = null;
  9547. if (!(columnSV !== null)) {
  9548. _context29.next = 17;
  9549. break;
  9550. }
  9551. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(columnSV.type)) {
  9552. _context29.next = 16;
  9553. break;
  9554. }
  9555. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(exp.sourceInfo);
  9556. case 16:
  9557. column = columnSV.get().toNumber();
  9558. case 17:
  9559. if (!(line >= mustBeArray.lines)) {
  9560. _context29.next = 25;
  9561. break;
  9562. }
  9563. if (!mustBeArray.isVector) {
  9564. _context29.next = 22;
  9565. break;
  9566. }
  9567. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_line_outbounds_full(exp.id, line, mustBeArray.lines, exp.sourceInfo);
  9568. case 22:
  9569. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_line_outbounds_full(exp.id, line, mustBeArray.lines, exp.sourceInfo);
  9570. case 23:
  9571. _context29.next = 27;
  9572. break;
  9573. case 25:
  9574. if (!(line < 0)) {
  9575. _context29.next = 27;
  9576. break;
  9577. }
  9578. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(exp.sourceInfo);
  9579. case 27:
  9580. if (!(column !== null && mustBeArray.columns === 0)) {
  9581. _context29.next = 29;
  9582. break;
  9583. }
  9584. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_not_matrix_full(exp.id, exp.sourceInfo);
  9585. case 29:
  9586. if (!(column !== null)) {
  9587. _context29.next = 36;
  9588. break;
  9589. }
  9590. if (!(column >= mustBeArray.columns)) {
  9591. _context29.next = 34;
  9592. break;
  9593. }
  9594. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_column_outbounds_full(exp.id, column, mustBeArray.columns, exp.sourceInfo);
  9595. case 34:
  9596. if (!(column < 0)) {
  9597. _context29.next = 36;
  9598. break;
  9599. }
  9600. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(exp.sourceInfo);
  9601. case 36:
  9602. result = mustBeArray.getAt(line, column);
  9603. type = mustBeArray.type.innerType;
  9604. if (!Array.isArray(result)) {
  9605. _context29.next = 43;
  9606. break;
  9607. }
  9608. values = result.map(function (val, col) {
  9609. return new _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__["StoreValueAddress"](type, val, line, col, mustBeArray.id, mustBeArray.readOnly);
  9610. });
  9611. 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));
  9612. case 43:
  9613. return _context29.abrupt("return", new _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__["StoreValueAddress"](type, result, line, column, mustBeArray.id, mustBeArray.readOnly));
  9614. case 44:
  9615. case "end":
  9616. return _context29.stop();
  9617. }
  9618. }
  9619. }, _callee29, this);
  9620. }));
  9621. function evaluateArrayAccess(_x71, _x72) {
  9622. return _evaluateArrayAccess.apply(this, arguments);
  9623. }
  9624. return evaluateArrayAccess;
  9625. }()
  9626. /**
  9627. *
  9628. * @param {Store} store
  9629. * @param {Expressions.UnaryApp} unaryApp
  9630. *
  9631. * @returns {import('./store/value/istore_value').IStoreValue}
  9632. */
  9633. }, {
  9634. key: "evaluateUnaryApp",
  9635. value: function () {
  9636. 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) {
  9637. var left, resultType, stringInfo, info;
  9638. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee30$(_context30) {
  9639. while (1) {
  9640. switch (_context30.prev = _context30.next) {
  9641. case 0:
  9642. _context30.next = 2;
  9643. return this.evaluateExpression(store, unaryApp.left);
  9644. case 2:
  9645. left = _context30.sent;
  9646. resultType = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_11__["resultTypeAfterUnaryOp"])(unaryApp.op, left.type);
  9647. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].UNDEFINED.isCompatible(resultType)) {
  9648. _context30.next = 8;
  9649. break;
  9650. }
  9651. stringInfo = left.type.stringInfo();
  9652. info = stringInfo[0];
  9653. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_unary_op_full(unaryApp.op, info.type, info.dim, unaryApp.sourceInfo);
  9654. case 8:
  9655. _context30.t0 = unaryApp.op.ord;
  9656. _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;
  9657. break;
  9658. case 11:
  9659. return _context30.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get()));
  9660. case 12:
  9661. return _context30.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get().negated()));
  9662. case 13:
  9663. return _context30.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, !left.get()));
  9664. case 14:
  9665. throw new _error_runtimeError__WEBPACK_IMPORTED_MODULE_21__["RuntimeError"]("!!!Critical Invalid UnaryApp " + unaryApp.op);
  9666. case 15:
  9667. case "end":
  9668. return _context30.stop();
  9669. }
  9670. }
  9671. }, _callee30, this);
  9672. }));
  9673. function evaluateUnaryApp(_x73, _x74) {
  9674. return _evaluateUnaryApp.apply(this, arguments);
  9675. }
  9676. return evaluateUnaryApp;
  9677. }()
  9678. /**
  9679. *
  9680. * @param {Store} store
  9681. * @param {Expressions.InfixApp} infixApp
  9682. *
  9683. * @returns {import('./store/value/istore_value').IStoreValue}
  9684. */
  9685. }, {
  9686. key: "evaluateInfixApp",
  9687. value: function () {
  9688. 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) {
  9689. 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;
  9690. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee31$(_context31) {
  9691. while (1) {
  9692. switch (_context31.prev = _context31.next) {
  9693. case 0:
  9694. _context31.next = 2;
  9695. return this.evaluateExpression(store, infixApp.left);
  9696. case 2:
  9697. left = _context31.sent;
  9698. _context31.next = 5;
  9699. return this.evaluateExpression(store, infixApp.right);
  9700. case 5:
  9701. right = _context31.sent;
  9702. shouldImplicitCast = false;
  9703. resultType = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_11__["resultTypeAfterInfixOp"])(infixApp.op, left.type, right.type);
  9704. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].UNDEFINED.isCompatible(resultType)) {
  9705. _context31.next = 18;
  9706. break;
  9707. }
  9708. if (!(_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(left.type, right.type))) {
  9709. _context31.next = 13;
  9710. break;
  9711. }
  9712. shouldImplicitCast = true;
  9713. _context31.next = 18;
  9714. break;
  9715. case 13:
  9716. stringInfoLeft = left.type.stringInfo();
  9717. infoLeft = stringInfoLeft[0];
  9718. stringInfoRight = right.type.stringInfo();
  9719. infoRight = stringInfoRight[0];
  9720. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_infix_op_full(infixApp.op, infoLeft.type, infoLeft.dim, infoRight.type, infoRight.dim, infixApp.sourceInfo);
  9721. case 18:
  9722. result = null;
  9723. _context31.t0 = infixApp.op.ord;
  9724. _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;
  9725. break;
  9726. case 22:
  9727. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9728. _context31.next = 27;
  9729. break;
  9730. }
  9731. rightStr = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(right.get(), right.type);
  9732. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get() + rightStr));
  9733. case 27:
  9734. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(right.type)) {
  9735. _context31.next = 32;
  9736. break;
  9737. }
  9738. leftStr = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(left.get(), left.type);
  9739. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, leftStr + right.get()));
  9740. case 32:
  9741. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9742. _context31.next = 38;
  9743. break;
  9744. }
  9745. strLeft = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(left.get(), left.type);
  9746. strRight = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(right.get(), right.type);
  9747. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, strLeft + strRight));
  9748. case 38:
  9749. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get().plus(right.get())));
  9750. case 39:
  9751. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get().minus(right.get())));
  9752. case 40:
  9753. result = left.get().times(right.get());
  9754. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9755. case 42:
  9756. if (!(right.get() == 0)) {
  9757. _context31.next = 44;
  9758. break;
  9759. }
  9760. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].divsion_by_zero_full(infixApp.toString(), infixApp.sourceInfo);
  9761. case 44:
  9762. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(resultType)) result = left.get().divToInt(right.get());else result = left.get().div(right.get());
  9763. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9764. case 46:
  9765. leftValue = left.get();
  9766. rightValue = right.get();
  9767. if (shouldImplicitCast) {
  9768. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER;
  9769. leftValue = leftValue.trunc();
  9770. rightValue = rightValue.trunc();
  9771. }
  9772. result = leftValue.modulo(rightValue);
  9773. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9774. case 51:
  9775. _leftValue = left.get();
  9776. _rightValue = right.get();
  9777. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9778. result = _leftValue.length > _rightValue.length;
  9779. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9780. result = _leftValue.charCodeAt(0) > _rightValue.charCodeAt(0);
  9781. } else {
  9782. if (shouldImplicitCast) {
  9783. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9784. _leftValue = _leftValue.trunc();
  9785. _rightValue = _rightValue.trunc();
  9786. }
  9787. result = _leftValue.gt(_rightValue);
  9788. }
  9789. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9790. case 55:
  9791. _leftValue2 = left.get();
  9792. _rightValue2 = right.get();
  9793. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9794. result = _leftValue2.length >= _rightValue2.length;
  9795. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9796. result = _leftValue2.charCodeAt(0) >= _rightValue2.charCodeAt(0);
  9797. } else {
  9798. if (shouldImplicitCast) {
  9799. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9800. _leftValue2 = _leftValue2.trunc();
  9801. _rightValue2 = _rightValue2.trunc();
  9802. }
  9803. result = _leftValue2.gte(_rightValue2);
  9804. }
  9805. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9806. case 59:
  9807. _leftValue3 = left.get();
  9808. _rightValue3 = right.get();
  9809. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9810. result = _leftValue3.length < _rightValue3.length;
  9811. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9812. result = _leftValue3.charCodeAt(0) < _rightValue3.charCodeAt(0);
  9813. } else {
  9814. if (shouldImplicitCast) {
  9815. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9816. _leftValue3 = _leftValue3.trunc();
  9817. _rightValue3 = _rightValue3.trunc();
  9818. }
  9819. result = _leftValue3.lt(_rightValue3);
  9820. }
  9821. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9822. case 63:
  9823. _leftValue4 = left.get();
  9824. _rightValue4 = right.get();
  9825. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
  9826. result = _leftValue4.length <= _rightValue4.length;
  9827. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
  9828. result = _leftValue4.charCodeAt(0) <= _rightValue4.charCodeAt(0);
  9829. } else {
  9830. if (shouldImplicitCast) {
  9831. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9832. _leftValue4 = _leftValue4.trunc();
  9833. _rightValue4 = _rightValue4.trunc();
  9834. }
  9835. result = _leftValue4.lte(_rightValue4);
  9836. }
  9837. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9838. case 67:
  9839. _leftValue5 = left.get();
  9840. _rightValue5 = right.get();
  9841. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(left.type) || _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].REAL.isCompatible(left.type)) {
  9842. if (shouldImplicitCast) {
  9843. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9844. _leftValue5 = _leftValue5.trunc();
  9845. _rightValue5 = _rightValue5.trunc();
  9846. }
  9847. result = _leftValue5.eq(_rightValue5);
  9848. } else {
  9849. result = _leftValue5 === _rightValue5;
  9850. }
  9851. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9852. case 71:
  9853. _leftValue6 = left.get();
  9854. _rightValue6 = right.get();
  9855. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(left.type) || _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].REAL.isCompatible(left.type)) {
  9856. if (shouldImplicitCast) {
  9857. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
  9858. _leftValue6 = _leftValue6.trunc();
  9859. _rightValue6 = _rightValue6.trunc();
  9860. }
  9861. result = !_leftValue6.eq(_rightValue6);
  9862. } else {
  9863. result = _leftValue6 !== _rightValue6;
  9864. }
  9865. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
  9866. case 75:
  9867. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get() && right.get()));
  9868. case 76:
  9869. return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get() || right.get()));
  9870. case 77:
  9871. throw new _error_runtimeError__WEBPACK_IMPORTED_MODULE_21__["RuntimeError"]("!!!Critical Invalid InfixApp " + infixApp.op);
  9872. case 78:
  9873. case "end":
  9874. return _context31.stop();
  9875. }
  9876. }
  9877. }, _callee31, this);
  9878. }));
  9879. function evaluateInfixApp(_x75, _x76) {
  9880. return _evaluateInfixApp.apply(this, arguments);
  9881. }
  9882. return evaluateInfixApp;
  9883. }()
  9884. }]);
  9885. return IVProgProcessor;
  9886. }();
  9887. /***/ }),
  9888. /***/ "./js/processor/lib/arrays.js":
  9889. /*!************************************!*\
  9890. !*** ./js/processor/lib/arrays.js ***!
  9891. \************************************/
  9892. /*! exports provided: createNumElementsFun, createMatrixLinesFun, createMatrixColumnsFun */
  9893. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9894. "use strict";
  9895. __webpack_require__.r(__webpack_exports__);
  9896. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNumElementsFun", function() { return createNumElementsFun; });
  9897. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMatrixLinesFun", function() { return createMatrixLinesFun; });
  9898. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMatrixColumnsFun", function() { return createMatrixColumnsFun; });
  9899. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  9900. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  9901. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  9902. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  9903. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  9904. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  9905. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
  9906. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  9907. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  9908. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__);
  9909. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  9910. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_6__);
  9911. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  9912. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_7__);
  9913. /**
  9914. * num_elements
  9915. * matrix_lines
  9916. * matrix_columns
  9917. */
  9918. function createNumElementsFun() {
  9919. var numElementsFun = /*#__PURE__*/function () {
  9920. 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, _) {
  9921. var vector, temp;
  9922. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  9923. while (1) {
  9924. switch (_context.prev = _context.next) {
  9925. case 0:
  9926. vector = sto.applyStore("vector");
  9927. 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));
  9928. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9929. sto.insertStore("$", temp);
  9930. return _context.abrupt("return", sto);
  9931. case 5:
  9932. case "end":
  9933. return _context.stop();
  9934. }
  9935. }
  9936. }, _callee);
  9937. }));
  9938. return function numElementsFun(_x, _x2) {
  9939. return _ref.apply(this, arguments);
  9940. };
  9941. }();
  9942. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](numElementsFun)]);
  9943. 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);
  9944. return func;
  9945. }
  9946. function createMatrixLinesFun() {
  9947. var matrixLinesFun = /*#__PURE__*/function () {
  9948. 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, _) {
  9949. var matrix, temp;
  9950. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  9951. while (1) {
  9952. switch (_context2.prev = _context2.next) {
  9953. case 0:
  9954. matrix = sto.applyStore("matrix");
  9955. 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));
  9956. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9957. sto.insertStore("$", temp);
  9958. return _context2.abrupt("return", sto);
  9959. case 5:
  9960. case "end":
  9961. return _context2.stop();
  9962. }
  9963. }
  9964. }, _callee2);
  9965. }));
  9966. return function matrixLinesFun(_x3, _x4) {
  9967. return _ref2.apply(this, arguments);
  9968. };
  9969. }();
  9970. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](matrixLinesFun)]);
  9971. 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);
  9972. return func;
  9973. }
  9974. function createMatrixColumnsFun() {
  9975. var matrixColumnsFun = /*#__PURE__*/function () {
  9976. 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, _) {
  9977. var matrix, temp;
  9978. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
  9979. while (1) {
  9980. switch (_context3.prev = _context3.next) {
  9981. case 0:
  9982. matrix = sto.applyStore("matrix");
  9983. 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));
  9984. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9985. sto.insertStore("$", temp);
  9986. return _context3.abrupt("return", sto);
  9987. case 5:
  9988. case "end":
  9989. return _context3.stop();
  9990. }
  9991. }
  9992. }, _callee3);
  9993. }));
  9994. return function matrixColumnsFun(_x5, _x6) {
  9995. return _ref3.apply(this, arguments);
  9996. };
  9997. }();
  9998. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](matrixColumnsFun)]);
  9999. 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);
  10000. return func;
  10001. }
  10002. /***/ }),
  10003. /***/ "./js/processor/lib/io.js":
  10004. /*!********************************!*\
  10005. !*** ./js/processor/lib/io.js ***!
  10006. \********************************/
  10007. /*! exports provided: createOutputFun, createInputFun */
  10008. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10009. "use strict";
  10010. __webpack_require__.r(__webpack_exports__);
  10011. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createOutputFun", function() { return createOutputFun; });
  10012. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createInputFun", function() { return createInputFun; });
  10013. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  10014. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  10015. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  10016. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  10017. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  10018. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  10019. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_3__);
  10020. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  10021. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  10022. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__);
  10023. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  10024. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  10025. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_7__);
  10026. function createOutputFun() {
  10027. var writeFunction = /*#__PURE__*/function () {
  10028. 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, _) {
  10029. var totalSV, total, i, val;
  10030. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  10031. while (1) {
  10032. switch (_context.prev = _context.next) {
  10033. case 0:
  10034. totalSV = store.applyStore('p1.0');
  10035. total = totalSV.get();
  10036. for (i = 1; i < total; i += 1) {
  10037. val = store.applyStore("p1.".concat(i));
  10038. this.output.sendOutput(Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["convertToString"])(val.get(), val.type));
  10039. }
  10040. store.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
  10041. return _context.abrupt("return", store);
  10042. case 5:
  10043. case "end":
  10044. return _context.stop();
  10045. }
  10046. }
  10047. }, _callee, this);
  10048. }));
  10049. return function writeFunction(_x, _x2) {
  10050. return _ref.apply(this, arguments);
  10051. };
  10052. }();
  10053. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](writeFunction)]);
  10054. 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);
  10055. return func;
  10056. }
  10057. function createInputFun() {
  10058. var readFunction = /*#__PURE__*/function () {
  10059. 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, _) {
  10060. var text, typeToConvert, type, result, stringInfo, realObject, arrayInfo, dim, stoValue;
  10061. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  10062. while (1) {
  10063. switch (_context2.prev = _context2.next) {
  10064. case 0:
  10065. _context2.next = 2;
  10066. return this.input.requestInput();
  10067. case 2:
  10068. text = _context2.sent;
  10069. typeToConvert = store.applyStore('p1').type;
  10070. type = null;
  10071. result = null;
  10072. _context2.prev = 6;
  10073. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].INTEGER)) {
  10074. _context2.next = 12;
  10075. break;
  10076. }
  10077. result = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toInt"])(text.trim()).trunc();
  10078. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].INTEGER;
  10079. _context2.next = 28;
  10080. break;
  10081. case 12:
  10082. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].REAL)) {
  10083. _context2.next = 17;
  10084. break;
  10085. }
  10086. result = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toReal"])(text.trim());
  10087. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].REAL;
  10088. _context2.next = 28;
  10089. break;
  10090. case 17:
  10091. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].BOOLEAN)) {
  10092. _context2.next = 22;
  10093. break;
  10094. }
  10095. result = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toBool"])(text.trim());
  10096. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].BOOLEAN;
  10097. _context2.next = 28;
  10098. break;
  10099. case 22:
  10100. if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].STRING)) {
  10101. _context2.next = 27;
  10102. break;
  10103. }
  10104. result = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toString"])(text);
  10105. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].STRING;
  10106. _context2.next = 28;
  10107. break;
  10108. case 27:
  10109. throw new Error("!!!!Critical error: Unknown type in readFunction!!!!");
  10110. case 28:
  10111. _context2.next = 42;
  10112. break;
  10113. case 30:
  10114. _context2.prev = 30;
  10115. _context2.t0 = _context2["catch"](6);
  10116. if (!(this.mode == _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].ABORT)) {
  10117. _context2.next = 35;
  10118. break;
  10119. }
  10120. store.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
  10121. return _context2.abrupt("return", store);
  10122. case 35:
  10123. stringInfo = typeToConvert.stringInfo()[0];
  10124. realObject = store.getStoreObject("p1");
  10125. if (!(realObject.getReferenceDimension() > 0)) {
  10126. _context2.next = 41;
  10127. break;
  10128. }
  10129. arrayInfo = realObject.type.stringInfo()[0];
  10130. dim = realObject.getReferenceDimension();
  10131. 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());
  10132. case 41:
  10133. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_6__["ProcessorErrorFactory"].invalid_read_type(text, stringInfo.type, stringInfo.dim, realObject.getRefObj(), this.function_call_stack.pop());
  10134. case 42:
  10135. stoValue = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](type, result);
  10136. store.updateStore('p1', stoValue);
  10137. store.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
  10138. return _context2.abrupt("return", store);
  10139. case 46:
  10140. case "end":
  10141. return _context2.stop();
  10142. }
  10143. }
  10144. }, _callee2, this, [[6, 30]]);
  10145. }));
  10146. return function readFunction(_x3, _x4) {
  10147. return _ref2.apply(this, arguments);
  10148. };
  10149. }();
  10150. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](readFunction)]);
  10151. 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);
  10152. return func;
  10153. }
  10154. /***/ }),
  10155. /***/ "./js/processor/lib/lang.js":
  10156. /*!**********************************!*\
  10157. !*** ./js/processor/lib/lang.js ***!
  10158. \**********************************/
  10159. /*! exports provided: createIsRealFun, createIsIntFun, createIsBoolFun, createCastRealFun, createCastIntFun, createCastBoolFun, createCastStringFun, createCastCharFun */
  10160. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10161. "use strict";
  10162. __webpack_require__.r(__webpack_exports__);
  10163. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsRealFun", function() { return createIsRealFun; });
  10164. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsIntFun", function() { return createIsIntFun; });
  10165. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsBoolFun", function() { return createIsBoolFun; });
  10166. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastRealFun", function() { return createCastRealFun; });
  10167. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastIntFun", function() { return createCastIntFun; });
  10168. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastBoolFun", function() { return createCastBoolFun; });
  10169. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastStringFun", function() { return createCastStringFun; });
  10170. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastCharFun", function() { return createCastCharFun; });
  10171. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  10172. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  10173. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  10174. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  10175. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  10176. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  10177. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
  10178. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  10179. /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ast/ivprogParser */ "./js/ast/ivprogParser.js");
  10180. /* harmony import */ var _ast_expressions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../ast/expressions */ "./js/ast/expressions/index.js");
  10181. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  10182. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_7__);
  10183. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  10184. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8__);
  10185. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  10186. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  10187. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_10__);
  10188. /**
  10189. *
  10190. * is_real
  10191. * is_int
  10192. * is_bool
  10193. * cast_real
  10194. * cast_int
  10195. * cast_bool
  10196. * cast_string
  10197. * cast_char
  10198. */
  10199. function createIsRealFun() {
  10200. var isRealFun = /*#__PURE__*/function () {
  10201. 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, _) {
  10202. var str, parser, result, val, temp;
  10203. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  10204. while (1) {
  10205. switch (_context.prev = _context.next) {
  10206. case 0:
  10207. str = sto.applyStore("str");
  10208. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(str.get());
  10209. result = false;
  10210. try {
  10211. val = parser.parseTerm();
  10212. if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["RealLiteral"]) {
  10213. result = true;
  10214. }
  10215. } catch (error) {// ignore
  10216. }
  10217. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, result);
  10218. sto.insertStore("$", temp);
  10219. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10220. return _context.abrupt("return", sto);
  10221. case 8:
  10222. case "end":
  10223. return _context.stop();
  10224. }
  10225. }
  10226. }, _callee);
  10227. }));
  10228. return function isRealFun(_x, _x2) {
  10229. return _ref.apply(this, arguments);
  10230. };
  10231. }();
  10232. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](isRealFun)]);
  10233. 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);
  10234. return func;
  10235. }
  10236. function createIsIntFun() {
  10237. var isIntFun = /*#__PURE__*/function () {
  10238. 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, _) {
  10239. var str, parser, result, val, temp;
  10240. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  10241. while (1) {
  10242. switch (_context2.prev = _context2.next) {
  10243. case 0:
  10244. str = sto.applyStore("str");
  10245. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(str.get());
  10246. result = false;
  10247. try {
  10248. val = parser.parseTerm();
  10249. if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["IntLiteral"]) {
  10250. result = true;
  10251. }
  10252. } catch (_unused) {// ignore
  10253. }
  10254. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, result);
  10255. sto.insertStore("$", temp);
  10256. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10257. return _context2.abrupt("return", sto);
  10258. case 8:
  10259. case "end":
  10260. return _context2.stop();
  10261. }
  10262. }
  10263. }, _callee2);
  10264. }));
  10265. return function isIntFun(_x3, _x4) {
  10266. return _ref2.apply(this, arguments);
  10267. };
  10268. }();
  10269. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](isIntFun)]);
  10270. 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);
  10271. return func;
  10272. }
  10273. function createIsBoolFun() {
  10274. var isBoolFun = function isBoolFun(sto, _) {
  10275. var str = sto.applyStore("str");
  10276. var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(str.get());
  10277. var result = false;
  10278. try {
  10279. var val = parser.parseTerm();
  10280. if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["BoolLiteral"]) {
  10281. result = true;
  10282. }
  10283. } catch (error) {// ignore
  10284. }
  10285. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, result);
  10286. sto.insertStore("$", temp);
  10287. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10288. return sto;
  10289. };
  10290. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](isBoolFun)]);
  10291. 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);
  10292. return func;
  10293. }
  10294. function createCastRealFun() {
  10295. var castRealFun = /*#__PURE__*/function () {
  10296. 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, _) {
  10297. var val, value, temp, parser, result, _temp, typeStringInfoArray, typeInfo;
  10298. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
  10299. while (1) {
  10300. switch (_context3.prev = _context3.next) {
  10301. case 0:
  10302. val = sto.applyStore("val");
  10303. value = val.get();
  10304. _context3.t0 = val.type.ord;
  10305. _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;
  10306. break;
  10307. case 5:
  10308. value = value.toNumber();
  10309. 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));
  10310. sto.insertStore("$", temp);
  10311. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10312. return _context3.abrupt("return", sto);
  10313. case 10:
  10314. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(value);
  10315. _context3.prev = 11;
  10316. result = parser.parseTerm();
  10317. if (!(result instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["RealLiteral"])) {
  10318. _context3.next = 18;
  10319. break;
  10320. }
  10321. _temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL, result.value);
  10322. sto.insertStore("$", _temp);
  10323. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10324. return _context3.abrupt("return", sto);
  10325. case 18:
  10326. _context3.next = 22;
  10327. break;
  10328. case 20:
  10329. _context3.prev = 20;
  10330. _context3.t1 = _context3["catch"](11);
  10331. case 22:
  10332. typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL.stringInfo();
  10333. typeInfo = typeStringInfoArray[0];
  10334. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim);
  10335. case 25:
  10336. case "end":
  10337. return _context3.stop();
  10338. }
  10339. }
  10340. }, _callee3, null, [[11, 20]]);
  10341. }));
  10342. return function castRealFun(_x5, _x6) {
  10343. return _ref3.apply(this, arguments);
  10344. };
  10345. }();
  10346. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castRealFun)]);
  10347. 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);
  10348. return func;
  10349. }
  10350. function createCastIntFun() {
  10351. var castIntFun = /*#__PURE__*/function () {
  10352. 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, _) {
  10353. var val, value, temp, _temp2, parser, result, _temp3, typeStringInfoArray, typeInfo;
  10354. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee4$(_context4) {
  10355. while (1) {
  10356. switch (_context4.prev = _context4.next) {
  10357. case 0:
  10358. val = sto.applyStore("val");
  10359. value = val.get();
  10360. _context4.t0 = val.type.ord;
  10361. _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;
  10362. break;
  10363. case 5:
  10364. value = value.toNumber();
  10365. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, Math.floor(value));
  10366. sto.insertStore("$", temp);
  10367. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10368. return _context4.abrupt("return", sto);
  10369. case 10:
  10370. _temp2 = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, value.charCodeAt(0));
  10371. sto.insertStore("$", _temp2);
  10372. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10373. return _context4.abrupt("return", sto);
  10374. case 14:
  10375. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(value);
  10376. _context4.prev = 15;
  10377. result = parser.parseTerm();
  10378. if (!(result instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["IntLiteral"])) {
  10379. _context4.next = 22;
  10380. break;
  10381. }
  10382. _temp3 = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, result.value);
  10383. sto.insertStore("$", _temp3);
  10384. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10385. return _context4.abrupt("return", sto);
  10386. case 22:
  10387. _context4.next = 26;
  10388. break;
  10389. case 24:
  10390. _context4.prev = 24;
  10391. _context4.t1 = _context4["catch"](15);
  10392. case 26:
  10393. typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER.stringInfo();
  10394. typeInfo = typeStringInfoArray[0];
  10395. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim);
  10396. case 29:
  10397. case "end":
  10398. return _context4.stop();
  10399. }
  10400. }
  10401. }, _callee4, null, [[15, 24]]);
  10402. }));
  10403. return function castIntFun(_x7, _x8) {
  10404. return _ref4.apply(this, arguments);
  10405. };
  10406. }();
  10407. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castIntFun)]);
  10408. 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);
  10409. return func;
  10410. }
  10411. function createCastBoolFun() {
  10412. var castBoolFun = /*#__PURE__*/function () {
  10413. 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, _) {
  10414. var str, value, parser, val, temp, typeStringInfoArray, typeInfo;
  10415. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee5$(_context5) {
  10416. while (1) {
  10417. switch (_context5.prev = _context5.next) {
  10418. case 0:
  10419. str = sto.applyStore("str");
  10420. value = str.get();
  10421. parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(value);
  10422. _context5.prev = 3;
  10423. val = parser.parseTerm();
  10424. if (!(val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["BoolLiteral"])) {
  10425. _context5.next = 10;
  10426. break;
  10427. }
  10428. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, val.value);
  10429. sto.insertStore("$", temp);
  10430. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10431. return _context5.abrupt("return", sto);
  10432. case 10:
  10433. _context5.next = 14;
  10434. break;
  10435. case 12:
  10436. _context5.prev = 12;
  10437. _context5.t0 = _context5["catch"](3);
  10438. case 14:
  10439. typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN.stringInfo();
  10440. typeInfo = typeStringInfoArray[0];
  10441. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim);
  10442. case 17:
  10443. case "end":
  10444. return _context5.stop();
  10445. }
  10446. }
  10447. }, _callee5, null, [[3, 12]]);
  10448. }));
  10449. return function castBoolFun(_x9, _x10) {
  10450. return _ref5.apply(this, arguments);
  10451. };
  10452. }();
  10453. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castBoolFun)]);
  10454. 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);
  10455. return func;
  10456. }
  10457. function createCastStringFun() {
  10458. var castStringFun = /*#__PURE__*/function () {
  10459. 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, _) {
  10460. var val, result, temp;
  10461. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee6$(_context6) {
  10462. while (1) {
  10463. switch (_context6.prev = _context6.next) {
  10464. case 0:
  10465. val = store.applyStore('str');
  10466. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["convertToString"](val.get(), val.type);
  10467. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, result);
  10468. store.insertStore("$", temp);
  10469. store.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10470. return _context6.abrupt("return", store);
  10471. case 6:
  10472. case "end":
  10473. return _context6.stop();
  10474. }
  10475. }
  10476. }, _callee6);
  10477. }));
  10478. return function castStringFun(_x11, _x12) {
  10479. return _ref6.apply(this, arguments);
  10480. };
  10481. }();
  10482. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castStringFun)]);
  10483. 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);
  10484. return func;
  10485. }
  10486. function createCastCharFun() {
  10487. var castCharFun = function castCharFun(store, _) {
  10488. var valSV = store.applyStore('charCode'); // Force the int value to the range [0, 255]
  10489. var value = valSV.get().toNumber() & 0xFF;
  10490. var result = String.fromCharCode(value);
  10491. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].CHAR, result);
  10492. store.insertStore("$", temp);
  10493. store.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
  10494. return store;
  10495. };
  10496. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castCharFun)]);
  10497. 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);
  10498. return func;
  10499. }
  10500. /***/ }),
  10501. /***/ "./js/processor/lib/math.js":
  10502. /*!**********************************!*\
  10503. !*** ./js/processor/lib/math.js ***!
  10504. \**********************************/
  10505. /*! exports provided: createSinFun, createCosFun, createTanFun, createSqrtFun, createPowFun, createLogFun, createAbsFun, createNegateFun, createInvertFun, createMaxFun, createMinFun, createRandFun, createSetSeedFun */
  10506. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10507. "use strict";
  10508. __webpack_require__.r(__webpack_exports__);
  10509. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSinFun", function() { return createSinFun; });
  10510. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCosFun", function() { return createCosFun; });
  10511. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createTanFun", function() { return createTanFun; });
  10512. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSqrtFun", function() { return createSqrtFun; });
  10513. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPowFun", function() { return createPowFun; });
  10514. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLogFun", function() { return createLogFun; });
  10515. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createAbsFun", function() { return createAbsFun; });
  10516. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNegateFun", function() { return createNegateFun; });
  10517. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createInvertFun", function() { return createInvertFun; });
  10518. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMaxFun", function() { return createMaxFun; });
  10519. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMinFun", function() { return createMinFun; });
  10520. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRandFun", function() { return createRandFun; });
  10521. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSetSeedFun", function() { return createSetSeedFun; });
  10522. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
  10523. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
  10524. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  10525. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
  10526. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  10527. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);
  10528. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  10529. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  10530. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__);
  10531. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  10532. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! decimal.js */ "./node_modules/decimal.js/decimal.js");
  10533. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(decimal_js__WEBPACK_IMPORTED_MODULE_6__);
  10534. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  10535. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__);
  10536. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  10537. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__);
  10538. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  10539. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_9__);
  10540. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  10541. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_10__);
  10542. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  10543. /**
  10544. * sin
  10545. * cos
  10546. * tan
  10547. * sqrt
  10548. * pow
  10549. * log
  10550. * abs
  10551. * negate
  10552. * invert
  10553. * max
  10554. * min
  10555. */
  10556. function convertToRadians(degrees) {
  10557. return degrees.times(decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].acos(-1)).div(180);
  10558. }
  10559. function createSinFun() {
  10560. var sinFun = /*#__PURE__*/function () {
  10561. 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, _) {
  10562. var x, angle, result, temp;
  10563. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {
  10564. while (1) {
  10565. switch (_context.prev = _context.next) {
  10566. case 0:
  10567. x = sto.applyStore('x');
  10568. angle = x.get().mod(360);
  10569. result = null;
  10570. if (angle.eq(90)) {
  10571. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](1);
  10572. } else if (angle.eq(180)) {
  10573. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](0);
  10574. } else if (angle.eq(270)) {
  10575. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](-1);
  10576. } else {
  10577. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].sin(convertToRadians(angle));
  10578. }
  10579. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10580. sto.insertStore("$", temp);
  10581. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10582. return _context.abrupt("return", sto);
  10583. case 8:
  10584. case "end":
  10585. return _context.stop();
  10586. }
  10587. }
  10588. }, _callee);
  10589. }));
  10590. return function sinFun(_x, _x2) {
  10591. return _ref.apply(this, arguments);
  10592. };
  10593. }();
  10594. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](sinFun)]);
  10595. 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);
  10596. return func;
  10597. }
  10598. function createCosFun() {
  10599. var cosFun = /*#__PURE__*/function () {
  10600. 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, _) {
  10601. var x, angle, result, temp;
  10602. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee2$(_context2) {
  10603. while (1) {
  10604. switch (_context2.prev = _context2.next) {
  10605. case 0:
  10606. x = sto.applyStore('x');
  10607. angle = x.get().mod(360);
  10608. result = null;
  10609. if (angle.eq(90)) {
  10610. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](0);
  10611. } else if (angle.eq(180)) {
  10612. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](-1);
  10613. } else if (angle.eq(270)) {
  10614. result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](0);
  10615. }
  10616. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].cos(convertToRadians(angle));
  10617. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10618. sto.insertStore("$", temp);
  10619. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10620. return _context2.abrupt("return", sto);
  10621. case 9:
  10622. case "end":
  10623. return _context2.stop();
  10624. }
  10625. }
  10626. }, _callee2);
  10627. }));
  10628. return function cosFun(_x3, _x4) {
  10629. return _ref2.apply(this, arguments);
  10630. };
  10631. }();
  10632. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](cosFun)]);
  10633. 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);
  10634. return func;
  10635. }
  10636. function createTanFun() {
  10637. var tanFun = /*#__PURE__*/function () {
  10638. 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, _) {
  10639. var x, angle, result, temp;
  10640. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee3$(_context3) {
  10641. while (1) {
  10642. switch (_context3.prev = _context3.next) {
  10643. case 0:
  10644. x = sto.applyStore('x');
  10645. angle = x.get().mod(360);
  10646. if (!(angle.eq(90) || angle.eq(270))) {
  10647. _context3.next = 4;
  10648. break;
  10649. }
  10650. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__["ProcessorErrorFactory"].undefined_tanget_value(x.get().toNumber(), this.function_call_stack.pop());
  10651. case 4:
  10652. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].tan(convertToRadians(angle));
  10653. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10654. sto.insertStore("$", temp);
  10655. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10656. return _context3.abrupt("return", sto);
  10657. case 9:
  10658. case "end":
  10659. return _context3.stop();
  10660. }
  10661. }
  10662. }, _callee3, this);
  10663. }));
  10664. return function tanFun(_x5, _x6) {
  10665. return _ref3.apply(this, arguments);
  10666. };
  10667. }();
  10668. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](tanFun)]);
  10669. 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);
  10670. return func;
  10671. }
  10672. function createSqrtFun() {
  10673. var sqrtFun = /*#__PURE__*/function () {
  10674. 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, _) {
  10675. var x, result, temp;
  10676. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee4$(_context4) {
  10677. while (1) {
  10678. switch (_context4.prev = _context4.next) {
  10679. case 0:
  10680. x = sto.applyStore('x');
  10681. if (!x.get().isNeg()) {
  10682. _context4.next = 3;
  10683. break;
  10684. }
  10685. return _context4.abrupt("return", Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__["ProcessorErrorFactory"].negative_sqrt_value(this.function_call_stack.pop())));
  10686. case 3:
  10687. result = x.get().sqrt();
  10688. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10689. sto.insertStore("$", temp);
  10690. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10691. return _context4.abrupt("return", sto);
  10692. case 8:
  10693. case "end":
  10694. return _context4.stop();
  10695. }
  10696. }
  10697. }, _callee4, this);
  10698. }));
  10699. return function sqrtFun(_x7, _x8) {
  10700. return _ref4.apply(this, arguments);
  10701. };
  10702. }();
  10703. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](sqrtFun)]);
  10704. 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);
  10705. return func;
  10706. }
  10707. function createPowFun() {
  10708. var powFun = /*#__PURE__*/function () {
  10709. 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, _) {
  10710. var x, y, result, temp;
  10711. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee5$(_context5) {
  10712. while (1) {
  10713. switch (_context5.prev = _context5.next) {
  10714. case 0:
  10715. x = sto.applyStore('x');
  10716. y = sto.applyStore('y');
  10717. result = x.get().pow(y.get());
  10718. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10719. sto.insertStore("$", temp);
  10720. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10721. return _context5.abrupt("return", sto);
  10722. case 7:
  10723. case "end":
  10724. return _context5.stop();
  10725. }
  10726. }
  10727. }, _callee5);
  10728. }));
  10729. return function powFun(_x9, _x10) {
  10730. return _ref5.apply(this, arguments);
  10731. };
  10732. }();
  10733. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](powFun)]);
  10734. 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);
  10735. return func;
  10736. }
  10737. function createLogFun() {
  10738. var logFun = /*#__PURE__*/function () {
  10739. 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, _) {
  10740. var x, result, temp;
  10741. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee6$(_context6) {
  10742. while (1) {
  10743. switch (_context6.prev = _context6.next) {
  10744. case 0:
  10745. x = sto.applyStore('x');
  10746. if (!x.get().isNegative()) {
  10747. _context6.next = 3;
  10748. break;
  10749. }
  10750. return _context6.abrupt("return", Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__["ProcessorErrorFactory"].negative_log_value(this.function_call_stack.pop())));
  10751. case 3:
  10752. result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].log10(x.get());
  10753. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10754. sto.insertStore("$", temp);
  10755. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10756. return _context6.abrupt("return", sto);
  10757. case 8:
  10758. case "end":
  10759. return _context6.stop();
  10760. }
  10761. }
  10762. }, _callee6, this);
  10763. }));
  10764. return function logFun(_x11, _x12) {
  10765. return _ref6.apply(this, arguments);
  10766. };
  10767. }();
  10768. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](logFun)]);
  10769. 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);
  10770. return func;
  10771. }
  10772. function createAbsFun() {
  10773. var absFun = /*#__PURE__*/function () {
  10774. 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, _) {
  10775. var x, result, temp;
  10776. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee7$(_context7) {
  10777. while (1) {
  10778. switch (_context7.prev = _context7.next) {
  10779. case 0:
  10780. x = sto.applyStore('x');
  10781. result = x.get().abs();
  10782. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type, result);
  10783. sto.insertStore("$", temp);
  10784. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10785. return _context7.abrupt("return", sto);
  10786. case 6:
  10787. case "end":
  10788. return _context7.stop();
  10789. }
  10790. }
  10791. }, _callee7);
  10792. }));
  10793. return function absFun(_x13, _x14) {
  10794. return _ref7.apply(this, arguments);
  10795. };
  10796. }();
  10797. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](absFun)]);
  10798. 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);
  10799. return func;
  10800. }
  10801. function createNegateFun() {
  10802. var negateFun = /*#__PURE__*/function () {
  10803. 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, _) {
  10804. var x, result, temp;
  10805. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee8$(_context8) {
  10806. while (1) {
  10807. switch (_context8.prev = _context8.next) {
  10808. case 0:
  10809. x = sto.applyStore('x');
  10810. result = x.get().negated();
  10811. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type, result);
  10812. sto.insertStore("$", temp);
  10813. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10814. return _context8.abrupt("return", sto);
  10815. case 6:
  10816. case "end":
  10817. return _context8.stop();
  10818. }
  10819. }
  10820. }, _callee8);
  10821. }));
  10822. return function negateFun(_x15, _x16) {
  10823. return _ref8.apply(this, arguments);
  10824. };
  10825. }();
  10826. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](negateFun)]);
  10827. 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);
  10828. return func;
  10829. }
  10830. function createInvertFun() {
  10831. var invertFun = /*#__PURE__*/function () {
  10832. 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, _) {
  10833. var x, result, temp;
  10834. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee9$(_context9) {
  10835. while (1) {
  10836. switch (_context9.prev = _context9.next) {
  10837. case 0:
  10838. x = sto.applyStore('x');
  10839. result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_5__["toReal"](1).dividedBy(x.get());
  10840. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
  10841. sto.insertStore("$", temp);
  10842. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10843. return _context9.abrupt("return", sto);
  10844. case 6:
  10845. case "end":
  10846. return _context9.stop();
  10847. }
  10848. }
  10849. }, _callee9);
  10850. }));
  10851. return function invertFun(_x17, _x18) {
  10852. return _ref9.apply(this, arguments);
  10853. };
  10854. }();
  10855. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](invertFun)]);
  10856. 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);
  10857. return func;
  10858. }
  10859. function createMaxFun() {
  10860. var maxFun = /*#__PURE__*/function () {
  10861. 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, _) {
  10862. var x, numbers, result, temp;
  10863. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee10$(_context10) {
  10864. while (1) {
  10865. switch (_context10.prev = _context10.next) {
  10866. case 0:
  10867. x = sto.applyStore('x');
  10868. numbers = x.get().map(function (sto_addrs) {
  10869. return sto_addrs.get();
  10870. });
  10871. 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));
  10872. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type.innerType, result);
  10873. sto.insertStore("$", temp);
  10874. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10875. return _context10.abrupt("return", sto);
  10876. case 7:
  10877. case "end":
  10878. return _context10.stop();
  10879. }
  10880. }
  10881. }, _callee10);
  10882. }));
  10883. return function maxFun(_x19, _x20) {
  10884. return _ref10.apply(this, arguments);
  10885. };
  10886. }();
  10887. 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);
  10888. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](maxFun)]);
  10889. 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);
  10890. return func;
  10891. }
  10892. function createMinFun() {
  10893. var minFun = /*#__PURE__*/function () {
  10894. 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, _) {
  10895. var x, numbers, result, temp;
  10896. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee11$(_context11) {
  10897. while (1) {
  10898. switch (_context11.prev = _context11.next) {
  10899. case 0:
  10900. x = sto.applyStore('x');
  10901. numbers = x.get().map(function (sto_addrs) {
  10902. return sto_addrs.get();
  10903. });
  10904. 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));
  10905. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type.innerType, result);
  10906. sto.insertStore("$", temp);
  10907. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10908. return _context11.abrupt("return", sto);
  10909. case 7:
  10910. case "end":
  10911. return _context11.stop();
  10912. }
  10913. }
  10914. }, _callee11);
  10915. }));
  10916. return function minFun(_x21, _x22) {
  10917. return _ref11.apply(this, arguments);
  10918. };
  10919. }();
  10920. 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);
  10921. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](minFun)]);
  10922. 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);
  10923. return func;
  10924. }
  10925. var seed = Date.now();
  10926. function createRandFun() {
  10927. var a = 16807;
  10928. var m = 2147483647;
  10929. var c = 12345;
  10930. var randFun = /*#__PURE__*/function () {
  10931. 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, _) {
  10932. var val, temp;
  10933. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee12$(_context12) {
  10934. while (1) {
  10935. switch (_context12.prev = _context12.next) {
  10936. case 0:
  10937. seed = (a * seed + c) % m;
  10938. val = seed / (m - 1);
  10939. 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));
  10940. sto.insertStore("$", temp);
  10941. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10942. return _context12.abrupt("return", sto);
  10943. case 6:
  10944. case "end":
  10945. return _context12.stop();
  10946. }
  10947. }
  10948. }, _callee12);
  10949. }));
  10950. return function randFun(_x23, _x24) {
  10951. return _ref12.apply(this, arguments);
  10952. };
  10953. }();
  10954. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](randFun)]);
  10955. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$rand", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, [], block);
  10956. return func;
  10957. }
  10958. function createSetSeedFun() {
  10959. var setSeedFun = /*#__PURE__*/function () {
  10960. 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, _) {
  10961. var value;
  10962. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee13$(_context13) {
  10963. while (1) {
  10964. switch (_context13.prev = _context13.next) {
  10965. case 0:
  10966. value = sto.applyStore("x");
  10967. seed = value.get().toNumber();
  10968. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
  10969. return _context13.abrupt("return", sto);
  10970. case 4:
  10971. case "end":
  10972. return _context13.stop();
  10973. }
  10974. }
  10975. }, _callee13);
  10976. }));
  10977. return function setSeedFun(_x25, _x26) {
  10978. return _ref13.apply(this, arguments);
  10979. };
  10980. }();
  10981. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](setSeedFun)]);
  10982. 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);
  10983. return func;
  10984. }
  10985. /***/ }),
  10986. /***/ "./js/processor/lib/strings.js":
  10987. /*!*************************************!*\
  10988. !*** ./js/processor/lib/strings.js ***!
  10989. \*************************************/
  10990. /*! exports provided: createSubstringFun, createLengthFun, createUppercaseFun, createLowercaseFun, createrCharAtFun */
  10991. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10992. "use strict";
  10993. __webpack_require__.r(__webpack_exports__);
  10994. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSubstringFun", function() { return createSubstringFun; });
  10995. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLengthFun", function() { return createLengthFun; });
  10996. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUppercaseFun", function() { return createUppercaseFun; });
  10997. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLowercaseFun", function() { return createLowercaseFun; });
  10998. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createrCharAtFun", function() { return createrCharAtFun; });
  10999. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  11000. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  11001. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  11002. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  11003. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  11004. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  11005. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
  11006. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  11007. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  11008. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_5__);
  11009. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  11010. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_6__);
  11011. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  11012. /*
  11013. * substring
  11014. * length
  11015. * uppercase
  11016. * lowercase
  11017. * charAt
  11018. **/
  11019. function createSubstringFun() {
  11020. var substringFun = /*#__PURE__*/function () {
  11021. 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, _) {
  11022. var str, start, end, result, temp;
  11023. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  11024. while (1) {
  11025. switch (_context.prev = _context.next) {
  11026. case 0:
  11027. str = sto.applyStore("str");
  11028. start = sto.applyStore("start");
  11029. end = sto.applyStore("end");
  11030. result = str.get().substring(start.get(), end.get());
  11031. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, result);
  11032. sto.insertStore("$", temp);
  11033. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  11034. return _context.abrupt("return", sto);
  11035. case 8:
  11036. case "end":
  11037. return _context.stop();
  11038. }
  11039. }
  11040. }, _callee);
  11041. }));
  11042. return function substringFun(_x, _x2) {
  11043. return _ref.apply(this, arguments);
  11044. };
  11045. }();
  11046. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](substringFun)]);
  11047. 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);
  11048. return func;
  11049. }
  11050. function createLengthFun() {
  11051. var lengthFun = /*#__PURE__*/function () {
  11052. 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, _) {
  11053. var str, temp;
  11054. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
  11055. while (1) {
  11056. switch (_context2.prev = _context2.next) {
  11057. case 0:
  11058. str = sto.applyStore("str");
  11059. 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));
  11060. sto.insertStore("$", temp);
  11061. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  11062. return _context2.abrupt("return", sto);
  11063. case 5:
  11064. case "end":
  11065. return _context2.stop();
  11066. }
  11067. }
  11068. }, _callee2);
  11069. }));
  11070. return function lengthFun(_x3, _x4) {
  11071. return _ref2.apply(this, arguments);
  11072. };
  11073. }();
  11074. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](lengthFun)]);
  11075. 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);
  11076. return func;
  11077. }
  11078. function createUppercaseFun() {
  11079. var uppercaseFun = /*#__PURE__*/function () {
  11080. 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, _) {
  11081. var str, temp;
  11082. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
  11083. while (1) {
  11084. switch (_context3.prev = _context3.next) {
  11085. case 0:
  11086. str = sto.applyStore("str");
  11087. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, str.get().toUpperCase());
  11088. sto.insertStore("$", temp);
  11089. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  11090. return _context3.abrupt("return", sto);
  11091. case 5:
  11092. case "end":
  11093. return _context3.stop();
  11094. }
  11095. }
  11096. }, _callee3);
  11097. }));
  11098. return function uppercaseFun(_x5, _x6) {
  11099. return _ref3.apply(this, arguments);
  11100. };
  11101. }();
  11102. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](uppercaseFun)]);
  11103. 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);
  11104. return func;
  11105. }
  11106. function createLowercaseFun() {
  11107. var lowercaseFun = /*#__PURE__*/function () {
  11108. 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, _) {
  11109. var str, temp;
  11110. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee4$(_context4) {
  11111. while (1) {
  11112. switch (_context4.prev = _context4.next) {
  11113. case 0:
  11114. str = sto.applyStore("str");
  11115. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, str.get().toLowerCase());
  11116. sto.insertStore("$", temp);
  11117. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  11118. return _context4.abrupt("return", sto);
  11119. case 5:
  11120. case "end":
  11121. return _context4.stop();
  11122. }
  11123. }
  11124. }, _callee4);
  11125. }));
  11126. return function lowercaseFun(_x7, _x8) {
  11127. return _ref4.apply(this, arguments);
  11128. };
  11129. }();
  11130. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](lowercaseFun)]);
  11131. 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);
  11132. return func;
  11133. }
  11134. function createrCharAtFun() {
  11135. var charAtFun = /*#__PURE__*/function () {
  11136. 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, _) {
  11137. var str, idx, temp;
  11138. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee5$(_context5) {
  11139. while (1) {
  11140. switch (_context5.prev = _context5.next) {
  11141. case 0:
  11142. str = sto.applyStore("str");
  11143. idx = sto.applyStore("index");
  11144. if (!(idx.get().toNumber() < 0 || idx.get().toNumber() >= str.get().length)) {
  11145. _context5.next = 4;
  11146. break;
  11147. }
  11148. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_7__["ProcessorErrorFactory"].invalid_string_index(idx.get().toNumber(), str.get(), this.function_call_stack.pop());
  11149. case 4:
  11150. 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()));
  11151. sto.insertStore("$", temp);
  11152. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  11153. return _context5.abrupt("return", sto);
  11154. case 8:
  11155. case "end":
  11156. return _context5.stop();
  11157. }
  11158. }
  11159. }, _callee5, this);
  11160. }));
  11161. return function charAtFun(_x9, _x10) {
  11162. return _ref5.apply(this, arguments);
  11163. };
  11164. }();
  11165. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](charAtFun)]);
  11166. 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);
  11167. return func;
  11168. }
  11169. /***/ }),
  11170. /***/ "./js/processor/modes.ts":
  11171. /*!*******************************!*\
  11172. !*** ./js/processor/modes.ts ***!
  11173. \*******************************/
  11174. /*! no static exports found */
  11175. /***/ (function(module, exports, __webpack_require__) {
  11176. "use strict";
  11177. Object.defineProperty(exports, "__esModule", { value: true });
  11178. exports.Modes = void 0;
  11179. exports.Modes = Object.freeze({
  11180. RETURN: Symbol('mode:return'),
  11181. BREAK: Symbol('mode:break'),
  11182. PAUSE: Symbol('mode:pause'),
  11183. RUN: Symbol('mode:run'),
  11184. ABORT: Symbol('mode:abort')
  11185. });
  11186. /***/ }),
  11187. /***/ "./js/processor/semantic/semanticAnalyser.js":
  11188. /*!***************************************************!*\
  11189. !*** ./js/processor/semantic/semanticAnalyser.js ***!
  11190. \***************************************************/
  11191. /*! exports provided: SemanticAnalyser */
  11192. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11193. "use strict";
  11194. __webpack_require__.r(__webpack_exports__);
  11195. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SemanticAnalyser", function() { return SemanticAnalyser; });
  11196. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  11197. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  11198. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  11199. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  11200. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  11201. /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../definedFunctions */ "./js/processor/definedFunctions.js");
  11202. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../services/languageService */ "./js/services/languageService.js");
  11203. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ast/commands */ "./js/ast/commands/index.js");
  11204. /* harmony import */ var _ast_expressions_expression__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../ast/expressions/expression */ "./js/ast/expressions/expression.js");
  11205. /* harmony import */ var _ast_expressions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../ast/expressions */ "./js/ast/expressions/index.js");
  11206. /* harmony import */ var _ast_expressions_literal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../ast/expressions/literal */ "./js/ast/expressions/literal.js");
  11207. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../compatibilityTable */ "./js/processor/compatibilityTable.ts");
  11208. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_compatibilityTable__WEBPACK_IMPORTED_MODULE_9__);
  11209. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../typeSystem/types */ "./js/typeSystem/types.ts");
  11210. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__);
  11211. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  11212. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__);
  11213. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  11214. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__);
  11215. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../util/config */ "./js/util/config.ts");
  11216. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_13__);
  11217. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../store/store */ "./js/processor/store/store.ts");
  11218. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_store_store__WEBPACK_IMPORTED_MODULE_14__);
  11219. /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../ast/ivprogParser */ "./js/ast/ivprogParser.js");
  11220. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  11221. var SemanticAnalyser = /*#__PURE__*/function () {
  11222. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SemanticAnalyser, null, [{
  11223. key: "analyseFromSource",
  11224. value: function analyseFromSource(stringCode) {
  11225. var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_15__["IVProgParser"].createParser(stringCode);
  11226. var semantic = new SemanticAnalyser(parser.parseTree());
  11227. return semantic.analyseTree();
  11228. }
  11229. }]);
  11230. function SemanticAnalyser(ast) {
  11231. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SemanticAnalyser);
  11232. this.ast = ast;
  11233. this.lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_4__["LanguageService"].getCurrentLexer();
  11234. var lexer = new this.lexerClass(null);
  11235. this.literalNames = lexer.literalNames;
  11236. this.symbolMap = null;
  11237. this.currentFunction = null;
  11238. }
  11239. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SemanticAnalyser, [{
  11240. key: "pushMap",
  11241. value: function pushMap() {
  11242. if (this.symbolMap === null) {
  11243. this.symbolMap = {
  11244. map: {},
  11245. next: null
  11246. };
  11247. } else {
  11248. var n = {
  11249. map: {},
  11250. next: this.symbolMap
  11251. };
  11252. this.symbolMap = n;
  11253. }
  11254. }
  11255. }, {
  11256. key: "popMap",
  11257. value: function popMap() {
  11258. if (this.symbolMap !== null) {
  11259. this.symbolMap = this.symbolMap.next;
  11260. }
  11261. }
  11262. }, {
  11263. key: "insertSymbol",
  11264. value: function insertSymbol(id, typeInfo) {
  11265. this.symbolMap.map[id] = typeInfo;
  11266. }
  11267. }, {
  11268. key: "findSymbol",
  11269. value: function findSymbol(id, symbol_map) {
  11270. if (!symbol_map.map[id]) {
  11271. if (symbol_map.next) {
  11272. return this.findSymbol(id, symbol_map.next);
  11273. }
  11274. return null;
  11275. } else {
  11276. return symbol_map.map[id];
  11277. }
  11278. }
  11279. }, {
  11280. key: "getMainFunction",
  11281. value: function getMainFunction() {
  11282. return this.ast.functions.find(function (v) {
  11283. return v.isMain;
  11284. });
  11285. }
  11286. }, {
  11287. key: "findFunction",
  11288. value: function findFunction(name) {
  11289. if (name.match(/^\$.+$/)) {
  11290. var fun = _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getFunction(name);
  11291. if (!fun) {
  11292. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].not_implemented(name);
  11293. }
  11294. return fun;
  11295. } else {
  11296. var val = this.ast.functions.find(function (v) {
  11297. return v.name === name;
  11298. });
  11299. if (!val) {
  11300. return null;
  11301. }
  11302. return val;
  11303. }
  11304. }
  11305. }, {
  11306. key: "analyseTree",
  11307. value: function analyseTree() {
  11308. var globalVars = this.ast.global;
  11309. this.pushMap();
  11310. this.assertDeclarations(globalVars);
  11311. var functions = this.ast.functions;
  11312. var mainFunc = functions.filter(function (f) {
  11313. return f.name === null;
  11314. });
  11315. if (mainFunc.length <= 0) {
  11316. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].main_missing();
  11317. }
  11318. for (var i = 0; i < functions.length; i++) {
  11319. var fun = functions[i];
  11320. this.assertFunction(fun);
  11321. }
  11322. return this.ast;
  11323. }
  11324. }, {
  11325. key: "assertDeclarations",
  11326. value: function assertDeclarations(list) {
  11327. for (var i = 0; i < list.length; i++) {
  11328. this.assertDeclaration(list[i]);
  11329. }
  11330. }
  11331. }, {
  11332. key: "assertDeclaration",
  11333. value: function assertDeclaration(declaration) {
  11334. if (declaration instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["ArrayDeclaration"]) {
  11335. this.assertArrayDeclaration(declaration);
  11336. this.insertSymbol(declaration.id, {
  11337. id: declaration.id,
  11338. lines: declaration.lines,
  11339. columns: declaration.columns,
  11340. type: declaration.type,
  11341. isConst: declaration.isConst
  11342. });
  11343. } else {
  11344. if (declaration.initial === null) {
  11345. this.insertSymbol(declaration.id, {
  11346. id: declaration.id,
  11347. type: declaration.type,
  11348. isConst: declaration.isConst
  11349. });
  11350. return;
  11351. }
  11352. var resultType = this.evaluateExpressionType(declaration.initial);
  11353. if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11354. if (!resultType.isCompatible(declaration.type)) {
  11355. var stringInfo = declaration.type.stringInfo();
  11356. var info = stringInfo[0];
  11357. var result_string_info = resultType.stringInfo();
  11358. var result_info = result_string_info[0];
  11359. var exp = declaration.initial;
  11360. 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);
  11361. }
  11362. this.insertSymbol(declaration.id, {
  11363. id: declaration.id,
  11364. type: declaration.type,
  11365. isConst: declaration.isConst
  11366. });
  11367. } 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)) {
  11368. var _stringInfo = declaration.type.stringInfo();
  11369. var _info = _stringInfo[0];
  11370. var _result_string_info = resultType.stringInfo();
  11371. var _result_info = _result_string_info[0];
  11372. var _exp = declaration.initial;
  11373. 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);
  11374. } else {
  11375. this.insertSymbol(declaration.id, {
  11376. id: declaration.id,
  11377. type: declaration.type,
  11378. isConst: declaration.isConst
  11379. });
  11380. }
  11381. }
  11382. }
  11383. }, {
  11384. key: "assertArrayDeclaration",
  11385. value: function assertArrayDeclaration(declaration) {
  11386. if (declaration.initial === null) {
  11387. var lineType = this.evaluateExpressionType(declaration.lines);
  11388. if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11389. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(declaration.sourceInfo);
  11390. }
  11391. if (declaration.columns !== null) {
  11392. var columnType = this.evaluateExpressionType(declaration.columns);
  11393. if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11394. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(declaration.sourceInfo);
  11395. }
  11396. }
  11397. } else {
  11398. this.evaluateArrayLiteral(declaration);
  11399. }
  11400. this.insertSymbol(declaration.id, {
  11401. id: declaration.id,
  11402. lines: declaration.lines,
  11403. columns: declaration.columns,
  11404. type: declaration.type
  11405. });
  11406. return;
  11407. }
  11408. }, {
  11409. key: "evaluateExpressionType",
  11410. value: function evaluateExpressionType(expression) {
  11411. // TODO: Throw operator error in case type == UNDEFINED
  11412. if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["UnaryApp"]) {
  11413. var op = expression.op;
  11414. var resultType = this.evaluateExpressionType(expression.left);
  11415. var finalResult = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_9__["resultTypeAfterUnaryOp"])(op, resultType);
  11416. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].UNDEFINED.isCompatible(finalResult)) {
  11417. var stringInfo = resultType.stringInfo();
  11418. var info = stringInfo[0];
  11419. var expString = expression.toString();
  11420. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_unary_op_full(expString, op, info.type, info.dim, expression.sourceInfo);
  11421. }
  11422. return finalResult;
  11423. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["InfixApp"]) {
  11424. var _op = expression.op;
  11425. var resultTypeLeft = this.evaluateExpressionType(expression.left);
  11426. var resultTypeRight = this.evaluateExpressionType(expression.right);
  11427. var _finalResult = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_9__["resultTypeAfterInfixOp"])(_op, resultTypeLeft, resultTypeRight);
  11428. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].UNDEFINED.isCompatible(_finalResult)) {
  11429. var stringInfoLeft = resultTypeLeft.stringInfo();
  11430. var infoLeft = stringInfoLeft[0];
  11431. var stringInfoRight = resultTypeRight.stringInfo();
  11432. var infoRight = stringInfoRight[0];
  11433. var _expString = expression.toString();
  11434. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_infix_op_full(_expString, _op, infoLeft.type, infoLeft.dim, infoRight.type, infoRight.dim, expression.sourceInfo);
  11435. }
  11436. return _finalResult;
  11437. } else if (expression instanceof _ast_expressions_literal__WEBPACK_IMPORTED_MODULE_8__["Literal"]) {
  11438. return this.evaluateLiteralType(expression);
  11439. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["FunctionCall"]) {
  11440. if (expression.isMainCall) {
  11441. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].void_in_expression_full(_definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getMainFunctionName(), expression.sourceInfo);
  11442. }
  11443. var fun = this.findFunction(expression.id);
  11444. if (fun === null) {
  11445. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].function_missing_full(expression.id, expression.sourceInfo);
  11446. }
  11447. if (fun.returnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].VOID)) {
  11448. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].void_in_expression_full(expression.id, expression.sourceInfo);
  11449. }
  11450. this.assertParameters(fun, expression.actualParameters);
  11451. return fun.returnType;
  11452. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["ArrayAccess"]) {
  11453. var arrayTypeInfo = this.findSymbol(expression.id, this.symbolMap);
  11454. if (arrayTypeInfo === null) {
  11455. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(expression.id, expression.sourceInfo);
  11456. }
  11457. if (!(arrayTypeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"])) {
  11458. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_array_access_full(expression.id, expression.sourceInfo);
  11459. }
  11460. var lineType = this.evaluateExpressionType(expression.line);
  11461. if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11462. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(expression.sourceInfo);
  11463. }
  11464. if (expression.column !== null) {
  11465. if (arrayTypeInfo.columns === null) {
  11466. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_matrix_access_full(expression.id, expression.sourceInfo);
  11467. }
  11468. var columnType = this.evaluateExpressionType(expression.column);
  11469. if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11470. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(expression.sourceInfo);
  11471. }
  11472. }
  11473. var arrType = arrayTypeInfo.type;
  11474. if (expression.column !== null) {
  11475. // indexing matrix
  11476. return arrType.innerType;
  11477. } else {
  11478. if (arrayTypeInfo.columns === null) {
  11479. return arrType.innerType;
  11480. }
  11481. return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](arrType.innerType, 1);
  11482. }
  11483. }
  11484. }
  11485. }, {
  11486. key: "evaluateLiteralType",
  11487. value: function evaluateLiteralType(literal) {
  11488. if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["IntLiteral"]) {
  11489. return literal.type;
  11490. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["RealLiteral"]) {
  11491. return literal.type;
  11492. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["StringLiteral"]) {
  11493. return literal.type;
  11494. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["BoolLiteral"]) {
  11495. return literal.type;
  11496. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["CharLiteral"]) {
  11497. return literal.type;
  11498. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["VariableLiteral"]) {
  11499. var typeInfo = this.findSymbol(literal.id, this.symbolMap);
  11500. if (typeInfo === null) {
  11501. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(literal.id, literal.sourceInfo);
  11502. }
  11503. if (typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
  11504. return typeInfo.type;
  11505. }
  11506. return typeInfo.type;
  11507. } else {
  11508. // console.warn("Evaluating type only for an array literal...");
  11509. var last = null;
  11510. if (literal.value.length === 1) {
  11511. last = this.evaluateExpressionType(literal.value[0]);
  11512. } else {
  11513. for (var i = 0; i < literal.value.length; i++) {
  11514. var e = this.evaluateExpressionType(literal.value[i]);
  11515. if (last === null) {
  11516. last = e;
  11517. } else if (!last.isCompatible(e)) {
  11518. var strInfo = last.stringInfo();
  11519. var info = strInfo[0];
  11520. var strExp = literal.toString();
  11521. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_array_full(strExp, info.type, info.dim, literal.sourceInfo);
  11522. }
  11523. }
  11524. }
  11525. if (last instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
  11526. return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](last.innerType, last.dimensions + 1);
  11527. }
  11528. return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](last, 1);
  11529. }
  11530. }
  11531. }, {
  11532. key: "evaluateArrayLiteral",
  11533. value: function evaluateArrayLiteral(arrayDeclaration) {
  11534. var type = arrayDeclaration.type;
  11535. var literal = arrayDeclaration.initial; // console.log(arrayDeclaration);
  11536. if (arrayDeclaration.isVector) {
  11537. this.evaluateVectorLiteralType(literal, type);
  11538. } else {
  11539. // TODO matrix type check
  11540. for (var i = 0; i < literal.lines; ++i) {
  11541. var line_literal = literal.value[i];
  11542. this.evaluateVectorLiteralType(line_literal, new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](type.innerType, 1));
  11543. }
  11544. }
  11545. return true;
  11546. }
  11547. }, {
  11548. key: "assertFunction",
  11549. value: function assertFunction(fun) {
  11550. var _this = this;
  11551. this.pushMap();
  11552. this.currentFunction = fun;
  11553. fun.formalParameters.forEach(function (formalParam) {
  11554. if (formalParam.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
  11555. if (formalParam.type.dimensions > 1) {
  11556. _this.insertSymbol(formalParam.id, {
  11557. id: formalParam.id,
  11558. lines: -1,
  11559. columns: -1,
  11560. type: formalParam.type
  11561. });
  11562. } else {
  11563. _this.insertSymbol(formalParam.id, {
  11564. id: formalParam.id,
  11565. lines: -1,
  11566. columns: null,
  11567. type: formalParam.type
  11568. });
  11569. }
  11570. } else {
  11571. _this.insertSymbol(formalParam.id, {
  11572. id: formalParam.id,
  11573. type: formalParam.type
  11574. });
  11575. }
  11576. });
  11577. this.assertDeclarations(fun.variablesDeclarations);
  11578. var optional = fun.returnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].VOID);
  11579. var valid = this.assertReturn(fun, optional);
  11580. if (!valid) {
  11581. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].function_no_return(fun.name);
  11582. }
  11583. this.popMap();
  11584. }
  11585. }, {
  11586. key: "assertReturn",
  11587. value: function assertReturn(fun, optional) {
  11588. var _this2 = this;
  11589. return fun.commands.reduce(function (last, next) {
  11590. return _this2.checkCommand(fun.returnType, next, optional) || last;
  11591. }, optional);
  11592. }
  11593. }, {
  11594. key: "checkCommand",
  11595. value: function checkCommand(type, cmd, optional) {
  11596. if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["While"]) {
  11597. var resultType = this.evaluateExpressionType(cmd.expression);
  11598. if (!resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].BOOLEAN)) {
  11599. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].loop_condition_type_full(cmd.expression.toString(), cmd.sourceInfo);
  11600. }
  11601. this.checkCommands(type, cmd.commands, optional);
  11602. return false;
  11603. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["For"]) {
  11604. var var_type = this.evaluateExpressionType(cmd.for_id);
  11605. if (!var_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11606. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_variable(cmd.for_id, cmd.sourceInfo);
  11607. }
  11608. var from_type = this.evaluateExpressionType(cmd.for_from);
  11609. if (!from_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11610. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_from(cmd.for_from, cmd.sourceInfo);
  11611. }
  11612. var to_type = this.evaluateExpressionType(cmd.for_to);
  11613. if (!to_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11614. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_to(cmd.for_to, cmd.sourceInfo);
  11615. }
  11616. if (cmd.for_pass != null) {
  11617. var pass_type = this.evaluateExpressionType(cmd.for_pass);
  11618. if (!pass_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11619. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_pass(cmd.for_pass, cmd.sourceInfo);
  11620. }
  11621. }
  11622. this.checkCommands(type, cmd.commands, optional);
  11623. return false;
  11624. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Switch"]) {
  11625. var sType = this.evaluateExpressionType(cmd.expression);
  11626. var result = optional;
  11627. var hasDefault = false;
  11628. for (var i = 0; i < cmd.cases.length; i++) {
  11629. var aCase = cmd.cases[i];
  11630. if (aCase.expression !== null) {
  11631. var caseType = this.evaluateExpressionType(aCase.expression);
  11632. if (!sType.isCompatible(caseType)) {
  11633. var strInfo = sType.stringInfo();
  11634. var info = strInfo[0];
  11635. var strExp = aCase.expression.toString();
  11636. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_case_type_full(strExp, info.type, info.dim, aCase.sourceInfo);
  11637. }
  11638. } else {
  11639. hasDefault = true;
  11640. }
  11641. result = result && this.checkCommands(type, aCase.commands, result);
  11642. }
  11643. return result && hasDefault;
  11644. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["ArrayIndexAssign"]) {
  11645. // TODO - rework!!!!!
  11646. var used_dims = 0;
  11647. var typeInfo = this.findSymbol(cmd.id, this.symbolMap);
  11648. if (typeInfo === null) {
  11649. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(cmd.id, cmd.sourceInfo);
  11650. }
  11651. if (typeInfo.isConst) {
  11652. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  11653. }
  11654. if (!(typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"])) {
  11655. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_array_access_full(cmd.id, cmd.sourceInfo);
  11656. }
  11657. var exp = cmd.expression;
  11658. var lineExp = cmd.line;
  11659. var lineType = this.evaluateExpressionType(lineExp);
  11660. if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11661. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  11662. }
  11663. used_dims += 1;
  11664. var columnExp = cmd.column;
  11665. if (typeInfo.columns === null && columnExp !== null) {
  11666. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_matrix_access_full(cmd.id, cmd.sourceInfo);
  11667. } else if (columnExp !== null) {
  11668. var columnType = this.evaluateExpressionType(columnExp);
  11669. if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
  11670. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  11671. }
  11672. used_dims += 1;
  11673. } // exp a single value exp or an array access
  11674. var exp_type = this.evaluateExpressionType(exp);
  11675. var access_type = typeInfo.type;
  11676. var compatible = false;
  11677. if (exp_type instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11678. var _type = access_type;
  11679. if (access_type.dimensions - used_dims == 0) {
  11680. _type = access_type.innerType;
  11681. } else {
  11682. _type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](access_type.innerType, Math.max(0, access_type.dimensions - used_dims));
  11683. }
  11684. compatible = exp_type.isCompatible(_type);
  11685. } else {
  11686. compatible = access_type.canAccept(exp_type, used_dims);
  11687. }
  11688. if (!compatible) {
  11689. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(access_type, exp_type)) {
  11690. var access_type_string_info = access_type.stringInfo();
  11691. var access_type_info = access_type_string_info[0];
  11692. var exp_type_string_info = exp_type.stringInfo();
  11693. var exp_type_info = exp_type_string_info[0];
  11694. 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);
  11695. }
  11696. }
  11697. return optional;
  11698. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Assign"]) {
  11699. // TODO - rework since there is no literal array assignment
  11700. var _typeInfo = this.findSymbol(cmd.id, this.symbolMap);
  11701. if (_typeInfo === null) {
  11702. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(cmd.id, cmd.sourceInfo);
  11703. }
  11704. if (_typeInfo.isConst) {
  11705. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  11706. }
  11707. var _exp2 = cmd.expression;
  11708. var _exp_type = this.evaluateExpressionType(_exp2);
  11709. if (_exp_type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
  11710. if (!(_typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"])) {
  11711. // TODO better error message
  11712. throw new Error("Cannot assign an array to a non-array variable ");
  11713. } // Both are arrays...
  11714. // if both don't have same dimensions and type, cannot perform assignment
  11715. if (!_exp_type.isCompatible(_typeInfo.type)) {
  11716. if (_exp_type.dimensions === _typeInfo.type.dimensions && !_exp_type.innerType.isCompatible(_typeInfo.type.innerType)) {
  11717. 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)) {
  11718. var stringInfo = _typeInfo.type.stringInfo();
  11719. var _info2 = stringInfo[0];
  11720. var _exp_type_string_info = _exp_type.stringInfo();
  11721. var _exp_type_info = _exp_type_string_info[0];
  11722. 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);
  11723. }
  11724. } else {
  11725. switch (_exp_type.dimensions) {
  11726. case 1:
  11727. {
  11728. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].vector_to_matrix_attr(cmd.id, _exp2.toString(), cmd.sourceInfo);
  11729. }
  11730. case 2:
  11731. {
  11732. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].matrix_to_vector_attr(cmd.id, _exp2.toString(), cmd.sourceInfo);
  11733. }
  11734. }
  11735. }
  11736. }
  11737. } else if (!_exp_type.isCompatible(_typeInfo.type)) {
  11738. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(_typeInfo.type, _exp_type)) {
  11739. var _stringInfo2 = _typeInfo.type.stringInfo();
  11740. var _info3 = _stringInfo2[0];
  11741. var _exp_type_string_info2 = _exp_type.stringInfo();
  11742. var _exp_type_info2 = _exp_type_string_info2[0];
  11743. 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);
  11744. }
  11745. }
  11746. return optional;
  11747. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Break"]) {
  11748. return optional;
  11749. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["IfThenElse"]) {
  11750. var _resultType = this.evaluateExpressionType(cmd.condition);
  11751. if (!_resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].BOOLEAN)) {
  11752. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].if_condition_type_full(cmd.condition.toString(), cmd.sourceInfo);
  11753. }
  11754. if (cmd.ifFalse instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["IfThenElse"]) {
  11755. return this.checkCommands(type, cmd.ifTrue.commands, optional) && this.checkCommand(type, cmd.ifFalse, optional);
  11756. } else if (cmd.ifFalse != null) {
  11757. return this.checkCommands(type, cmd.ifTrue.commands, optional) && this.checkCommands(type, cmd.ifFalse.commands, optional);
  11758. } else {
  11759. return this.checkCommands(type, cmd.ifTrue.commands, optional);
  11760. }
  11761. } else if (cmd instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["FunctionCall"]) {
  11762. var fun = null;
  11763. if (cmd.isMainCall) {
  11764. fun = this.getMainFunction();
  11765. } else {
  11766. fun = this.findFunction(cmd.id);
  11767. }
  11768. if (fun === null) {
  11769. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].function_missing_full(cmd.id, cmd.sourceInfo);
  11770. }
  11771. this.assertParameters(fun, cmd.actualParameters);
  11772. return optional;
  11773. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Return"]) {
  11774. var funcName = this.currentFunction.isMain ? _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getMainFunctionName() : this.currentFunction.name;
  11775. if (cmd.expression === null && !type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].VOID)) {
  11776. var _stringInfo3 = type.stringInfo();
  11777. var _info4 = _stringInfo3[0];
  11778. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_void_return_full(funcName, _info4.type, _info4.dim, cmd.sourceInfo);
  11779. } else if (cmd.expression !== null) {
  11780. var _resultType2 = this.evaluateExpressionType(cmd.expression);
  11781. if (!type.isCompatible(_resultType2)) {
  11782. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(type, _resultType2)) {
  11783. var _stringInfo4 = type.stringInfo();
  11784. var _info5 = _stringInfo4[0];
  11785. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_return_type_full(funcName, _info5.type, _info5.dim, cmd.sourceInfo);
  11786. }
  11787. }
  11788. return true;
  11789. } else {
  11790. return true;
  11791. }
  11792. }
  11793. }
  11794. }, {
  11795. key: "checkCommands",
  11796. value: function checkCommands(type, cmds, optional) {
  11797. var _this3 = this;
  11798. return cmds.reduce(function (last, next) {
  11799. return _this3.checkCommand(type, next, optional) || last;
  11800. }, optional);
  11801. }
  11802. /**
  11803. *
  11804. * @param {import('./../../ast/commands/function').Function} fun
  11805. * @param {Expression[]} actualParametersList
  11806. */
  11807. }, {
  11808. key: "assertParameters",
  11809. value: function assertParameters(fun, actualParametersList) {
  11810. var parameterList = fun.formalParameters;
  11811. if (parameterList.length > actualParametersList.length || parameterList.length !== actualParametersList.length && !fun.hasVariadic()) {
  11812. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameters_size_full(fun.name, actualParametersList.length, fun.formalParameters.length, null);
  11813. }
  11814. for (var i = 0, j = 0; i < parameterList.length && j < actualParametersList.length; i += 1, j += 1) {
  11815. var formalParam = parameterList[i];
  11816. if (formalParam.variadic && i + 1 !== parameterList.length) {
  11817. throw "A function variadic parameter must be its last parameter!";
  11818. }
  11819. if (formalParam.variadic) {
  11820. j = this.assertVariadicParameter(fun, formalParam, j, actualParametersList);
  11821. } else {
  11822. var param = actualParametersList[j];
  11823. this.assertParameter(fun, formalParam, param);
  11824. }
  11825. }
  11826. }
  11827. }, {
  11828. key: "evaluateVectorLiteralType",
  11829. value: function evaluateVectorLiteralType(literal, type) {
  11830. // console.log(literal);
  11831. for (var i = 0; i < literal.value.length; i += 1) {
  11832. var exp = literal.value[i];
  11833. var expType = this.evaluateExpressionType(exp);
  11834. var compatible = false;
  11835. if (expType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11836. compatible = expType.isCompatible(type.innerType);
  11837. } else {
  11838. compatible = type.canAccept(expType, 1);
  11839. }
  11840. if (!compatible) {
  11841. if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(type.innerType, expType)) {
  11842. var stringInfo = type.stringInfo();
  11843. var info = stringInfo[0];
  11844. var result_string_info = expType.stringInfo();
  11845. var result_info = result_string_info[0];
  11846. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_full(info.type, 0, result_info.type, result_info.dim, exp.toString(), literal.sourceInfo);
  11847. }
  11848. }
  11849. }
  11850. return type;
  11851. }
  11852. /**
  11853. *
  11854. * @param {import('./../../ast/commands/function').Function} fun
  11855. * @param {import('./../../ast/commands/formalParameter').FormalParameter} formalParam
  11856. * @param {number} index
  11857. * @param {Expression[]} actualParametersList
  11858. */
  11859. }, {
  11860. key: "assertVariadicParameter",
  11861. value: function assertVariadicParameter(fun, formalParam, index, actualParametersList) {
  11862. var i;
  11863. for (i = index; i < actualParametersList.length; i += 1) {
  11864. this.assertParameter(fun, formalParam, actualParametersList[i]);
  11865. }
  11866. return i - 1;
  11867. }
  11868. /**
  11869. *
  11870. * @param {import('./../../ast/commands/function').Function} fun
  11871. * @param {import('./../../ast/commands/formalParameter').FormalParameter} formalParam
  11872. * @param {Expression} actualParameter
  11873. */
  11874. }, {
  11875. key: "assertParameter",
  11876. value: function assertParameter(fun, formalParam, actualParameter) {
  11877. // const id = formalParam.id;
  11878. if (formalParam.byRef) {
  11879. if (actualParameter instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["VariableLiteral"]) {
  11880. var variable = this.findSymbol(actualParameter.id, this.symbolMap);
  11881. if (variable.isConst) {
  11882. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_const_ref_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11883. }
  11884. } else if (!(actualParameter instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["VariableLiteral"] || actualParameter instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["ArrayAccess"])) {
  11885. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11886. }
  11887. }
  11888. var resultType = this.evaluateExpressionType(actualParameter);
  11889. if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"] && formalParam.type instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11890. var shared = 0;
  11891. for (var j = 0; j < resultType.types.length; ++j) {
  11892. var element = resultType.types[j];
  11893. if (formalParam.type.types.indexOf(element) !== -1) {
  11894. shared += 1;
  11895. }
  11896. }
  11897. if (shared <= 0) {
  11898. if (_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting && !formalParam.byRef) {
  11899. 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)) {
  11900. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11901. }
  11902. }
  11903. }
  11904. } else if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
  11905. if (!resultType.isCompatible(formalParam.type)) {
  11906. if (_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting && !formalParam.byRef) {
  11907. 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)) {
  11908. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11909. }
  11910. }
  11911. }
  11912. } else if (!formalParam.type.isCompatible(resultType)) {
  11913. if (_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting && !formalParam.byRef) {
  11914. if (!_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(formalParam.type, resultType)) {
  11915. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
  11916. }
  11917. }
  11918. }
  11919. }
  11920. }]);
  11921. return SemanticAnalyser;
  11922. }();
  11923. /***/ }),
  11924. /***/ "./js/processor/store/store.ts":
  11925. /*!*************************************!*\
  11926. !*** ./js/processor/store/store.ts ***!
  11927. \*************************************/
  11928. /*! no static exports found */
  11929. /***/ (function(module, exports, __webpack_require__) {
  11930. "use strict";
  11931. Object.defineProperty(exports, "__esModule", { value: true });
  11932. exports.Store = void 0;
  11933. /* eslint-disable @typescript-eslint/no-non-null-assertion */
  11934. const modes_1 = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  11935. const types_1 = __webpack_require__(/*! ../../typeSystem/types */ "./js/typeSystem/types.ts");
  11936. const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
  11937. const storeObjectRef_1 = __webpack_require__(/*! ./storeObjectRef */ "./js/processor/store/storeObjectRef.ts");
  11938. const array_type_1 = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  11939. const array_store_value_1 = __webpack_require__(/*! ./value/array_store_value */ "./js/processor/store/value/array_store_value.ts");
  11940. const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
  11941. const storeObjectArray_1 = __webpack_require__(/*! ./storeObjectArray */ "./js/processor/store/storeObjectArray.ts");
  11942. const store_value_1 = __webpack_require__(/*! ./value/store_value */ "./js/processor/store/value/store_value.ts");
  11943. const store_value_address_1 = __webpack_require__(/*! ./value/store_value_address */ "./js/processor/store/value/store_value_address.ts");
  11944. const store_value_ref_1 = __webpack_require__(/*! ./value/store_value_ref */ "./js/processor/store/value/store_value_ref.ts");
  11945. const array_store_value_ref_1 = __webpack_require__(/*! ./value/array_store_value_ref */ "./js/processor/store/value/array_store_value_ref.ts");
  11946. const store_object_array_ref_1 = __webpack_require__(/*! ./store_object_array_ref */ "./js/processor/store/store_object_array_ref.ts");
  11947. class Store {
  11948. constructor(name) {
  11949. this.name = name;
  11950. this.store = new Map();
  11951. this.mode = modes_1.Modes.RUN;
  11952. }
  11953. static canImplicitTypeCast(castType, sourceType) {
  11954. if (castType.isCompatible(types_1.Types.INTEGER) || castType.isCompatible(types_1.Types.REAL)) {
  11955. if (sourceType.isCompatible(types_1.Types.INTEGER) || sourceType.isCompatible(types_1.Types.REAL)) {
  11956. return true;
  11957. }
  11958. }
  11959. return false;
  11960. }
  11961. static doImplicitCasting(castType, stoObj) {
  11962. if (!Store.canImplicitTypeCast(castType, stoObj.type)) {
  11963. throw new Error("!!!Critical error: attempted to type cast invalid types");
  11964. }
  11965. if (castType.isCompatible(types_1.Types.INTEGER)) {
  11966. return new store_value_1.StoreValue(types_1.Types.INTEGER, stoObj.get().trunc());
  11967. }
  11968. else {
  11969. return new store_value_1.StoreValue(types_1.Types.REAL, stoObj.get());
  11970. }
  11971. }
  11972. extendStore(nextStore) {
  11973. this.nextStore = nextStore;
  11974. }
  11975. applyStore(id) {
  11976. if (!this.store.has(id)) {
  11977. if (this.nextStore != null) {
  11978. return this.nextStore.applyStore(id);
  11979. }
  11980. else {
  11981. throw new Error(`Variable ${id} not found.`);
  11982. }
  11983. }
  11984. const val = this.store.get(id);
  11985. let result = null;
  11986. if (val.type instanceof array_type_1.ArrayType) {
  11987. const array = val;
  11988. const array_type = array.type;
  11989. let l = 0, c = 0;
  11990. const values = array.value.map(v => {
  11991. if (array.isVector) {
  11992. return new store_value_address_1.StoreValueAddress(array_type.innerType, v, l++, undefined, array.id, array.readOnly);
  11993. }
  11994. else {
  11995. if (c >= array.columns) {
  11996. c = 0;
  11997. l += 1;
  11998. }
  11999. return new store_value_address_1.StoreValueAddress(array_type.innerType, v, l, c++, array.id, array.readOnly);
  12000. }
  12001. });
  12002. result = new array_store_value_1.ArrayStoreValue(array_type, values, array.lines, array.columns, val.id, val.readOnly);
  12003. }
  12004. else {
  12005. result = new store_value_1.StoreValue(val.type, val.value, val.id, val.readOnly);
  12006. }
  12007. return result;
  12008. }
  12009. updateStore(id, stoValue) {
  12010. if (!this.store.has(id)) {
  12011. if (this.nextStore != null) {
  12012. this.nextStore.updateStore(id, stoValue);
  12013. return this;
  12014. }
  12015. else {
  12016. // TODO: better error message
  12017. throw new Error(`Variable ${id} not found.`);
  12018. }
  12019. }
  12020. else {
  12021. const oldObj = this.store.get(id);
  12022. if (oldObj.readOnly) {
  12023. // TODO: better error message
  12024. throw new Error("Cannot change value of a read only variable: " + id);
  12025. }
  12026. if (oldObj instanceof storeObjectArray_1.StoreObjectArray) {
  12027. const array_value = stoValue;
  12028. if (oldObj.isCompatible(array_value)) {
  12029. if (oldObj.isVector) {
  12030. array_value.get().forEach((val, index) => {
  12031. oldObj.setAt(val, index, undefined);
  12032. });
  12033. }
  12034. else {
  12035. let line = 0;
  12036. let column = 0;
  12037. array_value.get().forEach((val) => {
  12038. oldObj.setAt(val, line, column);
  12039. column += 1;
  12040. if (column >= oldObj.columns) {
  12041. line += 1;
  12042. column = 0;
  12043. }
  12044. });
  12045. }
  12046. return this;
  12047. }
  12048. }
  12049. else if (oldObj.isCompatible(stoValue)) {
  12050. const loc_address = oldObj.locAddress;
  12051. location_1.Location.updateAddress(loc_address, stoValue.get());
  12052. return this;
  12053. }
  12054. const oldType = oldObj.type;
  12055. const stoType = stoValue.type;
  12056. // TODO: better error message
  12057. throw new Error(`${oldType.value} is not compatible with type ${stoType.value} given`);
  12058. }
  12059. }
  12060. /**
  12061. * Method used to update regions of an array (vector or matrix). The should only be used when update an specific
  12062. * possition since it will only update the required addresses.
  12063. * @param {string} id the variable id to be updated
  12064. * @param {IStoreValue} sto_value the value to be used in the update process
  12065. * @param {number} line the line address of the vector/matrix
  12066. * @param {number} column the matrix column, which can be undefined
  12067. */
  12068. updateStoreArray(id, sto_value, line, column) {
  12069. if (!this.store.has(id)) {
  12070. if (this.nextStore != null) {
  12071. this.nextStore.updateStoreArray(id, sto_value, line, column);
  12072. return this;
  12073. }
  12074. else {
  12075. // TODO: better error message
  12076. throw new Error(`Variable ${id} not found.`);
  12077. }
  12078. }
  12079. else {
  12080. const oldObj = this.store.get(id);
  12081. if (oldObj.readOnly) {
  12082. // TODO: better error message
  12083. throw new Error("Cannot change value of a read only variable: " + id);
  12084. }
  12085. if (oldObj instanceof storeObjectArray_1.StoreObjectArray) {
  12086. if (sto_value instanceof array_store_value_1.ArrayStoreValue) {
  12087. // this must be a vector or matrix line update
  12088. const actual_values = sto_value.get();
  12089. if (oldObj.isVector && sto_value.isVector()) {
  12090. for (let i = 0; i < sto_value.lines; i += 1) {
  12091. const val = actual_values[i];
  12092. oldObj.setAt(val, i, undefined);
  12093. }
  12094. }
  12095. else if (!oldObj.isVector && column == null && sto_value.isVector()) {
  12096. for (let i = 0; i < oldObj.columns; i += 1) {
  12097. const val = actual_values[i];
  12098. oldObj.setAt(val, line, i);
  12099. }
  12100. }
  12101. else {
  12102. // TODO: better error message
  12103. throw new Error(`Attempting to assign an invalid value to array ${id}`);
  12104. }
  12105. }
  12106. else {
  12107. if (!oldObj.isVector && column == null) {
  12108. // TODO: better error message
  12109. throw new Error(`Attempting to assign an invalid value to array ${id}`);
  12110. }
  12111. oldObj.setAt(sto_value, line, column);
  12112. }
  12113. }
  12114. else {
  12115. throw new Error("Cannot update a non-array variable using updateStoreArray");
  12116. }
  12117. // const oldType = oldObj.type;
  12118. // const stoType = sto_value.type;
  12119. // // TODO: better error message
  12120. // throw new Error(`${oldType.value} is not compatible with type ${stoType.value} given`);
  12121. return this;
  12122. }
  12123. }
  12124. /**
  12125. * Inserts a new variable into the Store. This method should be used when declaring a new variable,
  12126. * including the special return variable $.
  12127. * @param id variable id
  12128. * @param stoValue the value to be used as the initial value of id
  12129. */
  12130. insertStore(id, stoValue) {
  12131. if (this.store.has(id)) {
  12132. // TODO: better error message
  12133. throw new Error(`${id} is already defined`);
  12134. }
  12135. // TODO check for array....
  12136. let newObj;
  12137. if (stoValue instanceof store_value_ref_1.StoreValueRef) {
  12138. newObj = new storeObjectRef_1.StoreObjectRef(stoValue);
  12139. }
  12140. else if (stoValue instanceof array_store_value_ref_1.ArrayStoreValueRef) {
  12141. newObj = new store_object_array_ref_1.StoreObjectArrayRef(stoValue, stoValue.lines, stoValue.columns);
  12142. }
  12143. else if (stoValue instanceof array_store_value_1.ArrayStoreValue) {
  12144. const columns = stoValue.isVector() ? 0 : stoValue.columns;
  12145. const addresses = [];
  12146. const all_values = stoValue.get();
  12147. if (all_values.length > 0) {
  12148. for (let i = 0; i < stoValue.get().length; i += 1) {
  12149. const val = all_values[i].get();
  12150. addresses.push(location_1.Location.allocate(val));
  12151. }
  12152. }
  12153. else {
  12154. let total = stoValue.lines;
  12155. total = stoValue.isVector() ? total : total * columns;
  12156. for (let i = 0; i < total; i += 1) {
  12157. addresses.push(location_1.Location.allocate(null));
  12158. }
  12159. }
  12160. newObj = new storeObjectArray_1.StoreObjectArray(stoValue.type, stoValue.lines, columns, addresses, stoValue.isConst);
  12161. }
  12162. else {
  12163. const loc_address = location_1.Location.allocate(stoValue.get());
  12164. newObj = new storeObject_1.StoreObject(stoValue.type, loc_address, stoValue.isConst);
  12165. }
  12166. newObj.setID(id);
  12167. this.store.set(id, newObj);
  12168. return this;
  12169. }
  12170. /**
  12171. * Helper function similar to applyStore. But it returns the actual object in the store be it ref or not
  12172. * applyStore will return the refferenced object if the object in the store is a ref
  12173. */
  12174. getStoreObject(id) {
  12175. if (!this.store.has(id)) {
  12176. if (this.nextStore != null) {
  12177. return this.nextStore.getStoreObject(id);
  12178. }
  12179. else {
  12180. throw new Error(`Variable ${id} not found.`);
  12181. }
  12182. }
  12183. return this.store.get(id);
  12184. }
  12185. destroy() {
  12186. this.store.forEach(sto => sto.destroy(), this);
  12187. }
  12188. isDefined(id) {
  12189. if (!this.store.has(id)) {
  12190. if (this.nextStore != null) {
  12191. return this.nextStore.isDefined(id);
  12192. }
  12193. else {
  12194. return false;
  12195. }
  12196. }
  12197. return true;
  12198. }
  12199. }
  12200. exports.Store = Store;
  12201. /***/ }),
  12202. /***/ "./js/processor/store/storeObject.ts":
  12203. /*!*******************************************!*\
  12204. !*** ./js/processor/store/storeObject.ts ***!
  12205. \*******************************************/
  12206. /*! no static exports found */
  12207. /***/ (function(module, exports, __webpack_require__) {
  12208. "use strict";
  12209. Object.defineProperty(exports, "__esModule", { value: true });
  12210. exports.StoreObject = void 0;
  12211. const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
  12212. class StoreObject {
  12213. /**
  12214. *
  12215. * @param {Type} type
  12216. * @param {Number} loc_address
  12217. * @param {Boolean} readOnly
  12218. */
  12219. constructor(type, loc_address, readOnly = false) {
  12220. this._loc_address = loc_address;
  12221. this._type = type;
  12222. this._readOnly = readOnly;
  12223. this._id = undefined;
  12224. }
  12225. setID(id) {
  12226. this._id = id;
  12227. }
  12228. get id() {
  12229. return this._id;
  12230. }
  12231. get inStore() {
  12232. return this.id !== null;
  12233. }
  12234. get type() {
  12235. return this._type;
  12236. }
  12237. /**
  12238. * Returns the actual value stored at the loccation address present in this object.
  12239. * The returned value is compatible with @prop{StoreObject.type}
  12240. */
  12241. get value() {
  12242. const address = location_1.Location.find(this._loc_address);
  12243. if (address != null) {
  12244. return address.value;
  12245. }
  12246. else {
  12247. throw new Error("!!!Critical Error: variable " + this.id + " does not have a valid address. Loc-Address " + this.locAddress);
  12248. }
  12249. }
  12250. get number() {
  12251. throw new Error("DOT NOT USE THIS PROPERTY!");
  12252. }
  12253. get readOnly() {
  12254. return this._readOnly;
  12255. }
  12256. set readOnly(value) {
  12257. this._readOnly = value;
  12258. }
  12259. isCompatible(another) {
  12260. return this.type.isCompatible(another.type);
  12261. }
  12262. destroy() {
  12263. return location_1.Location.deallocate(this._loc_address);
  12264. }
  12265. get locAddress() {
  12266. return this._loc_address;
  12267. }
  12268. }
  12269. exports.StoreObject = StoreObject;
  12270. /***/ }),
  12271. /***/ "./js/processor/store/storeObjectArray.ts":
  12272. /*!************************************************!*\
  12273. !*** ./js/processor/store/storeObjectArray.ts ***!
  12274. \************************************************/
  12275. /*! no static exports found */
  12276. /***/ (function(module, exports, __webpack_require__) {
  12277. "use strict";
  12278. Object.defineProperty(exports, "__esModule", { value: true });
  12279. exports.StoreObjectArray = void 0;
  12280. const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
  12281. const array_store_value_1 = __webpack_require__(/*! ./value/array_store_value */ "./js/processor/store/value/array_store_value.ts");
  12282. const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
  12283. class StoreObjectArray extends storeObject_1.StoreObject {
  12284. constructor(type, _lines, _columns, loc_addresses, readOnly = false) {
  12285. super(type, -1, readOnly);
  12286. this._lines = _lines;
  12287. this._columns = _columns;
  12288. this.loc_addresses = loc_addresses;
  12289. }
  12290. get lines() {
  12291. return this._lines;
  12292. }
  12293. get columns() {
  12294. return this._columns;
  12295. }
  12296. isCompatible(another) {
  12297. if (another instanceof array_store_value_1.ArrayStoreValue) {
  12298. const cols = another.columns == null ? 0 : another.columns;
  12299. if (this.lines === another.lines && this.columns === cols) {
  12300. return super.isCompatible(another);
  12301. }
  12302. }
  12303. return false;
  12304. }
  12305. get isVector() {
  12306. return this.type.dimensions === 1;
  12307. }
  12308. /**@override
  12309. * Returns the list of values stored by this array.
  12310. * All returned values are compatible with @prop{StoreObject.type}
  12311. */
  12312. get value() {
  12313. const values = [];
  12314. for (let i = 0; i < this.addresses.length; i += 1) {
  12315. const address = location_1.Location.find(this.addresses[i]);
  12316. if (address != null) {
  12317. values.push(address.value);
  12318. }
  12319. else {
  12320. throw new Error("!!!Critical Error: variable " + this.id + " does not have a valid address. Loc-Address " + this.locAddress);
  12321. }
  12322. }
  12323. return values;
  12324. }
  12325. destroy() {
  12326. let bool = true;
  12327. for (let i = 0; i < this.addresses.length; i += 1) {
  12328. bool = bool && location_1.Location.deallocate(this.addresses[i]);
  12329. }
  12330. return bool;
  12331. }
  12332. /**
  12333. * @override
  12334. *
  12335. * Returns the address that contains a list of all addresses of the values present in the array
  12336. */
  12337. get locAddress() {
  12338. throw new Error("!!!Internal Error: Cannot invoke locAddress on StoreObjectArray");
  12339. }
  12340. get addresses() {
  12341. return this.loc_addresses;
  12342. }
  12343. getAt(line, column) {
  12344. if (this.isVector) {
  12345. if (column != null) {
  12346. throw new Error(this.id + " is not a matrix!");
  12347. }
  12348. column = line;
  12349. line = 0;
  12350. }
  12351. else if (column == null) {
  12352. // this is a whole line...
  12353. const values = [];
  12354. for (let col = 0; col < this.columns; col += 1) {
  12355. const index = this.getIndexOf(line, col);
  12356. const address = location_1.Location.find(this.addresses[index]);
  12357. values.push(address.value);
  12358. }
  12359. return values;
  12360. }
  12361. const index = this.getIndexOf(line, column);
  12362. const address = location_1.Location.find(this.addresses[index]);
  12363. return address.value;
  12364. }
  12365. setAt(value, line, column) {
  12366. let used_dims = 1;
  12367. if (column != null) {
  12368. used_dims += 1;
  12369. }
  12370. if (!this.type.canAccept(value.type, used_dims)) {
  12371. throw new Error("!!!Internal Error: Attempting to insert an invalid value inside array " + this.id);
  12372. }
  12373. if (this.isVector) {
  12374. if (column != null) {
  12375. throw new Error(this.id + " is not a matrix!");
  12376. }
  12377. column = line;
  12378. line = 0;
  12379. }
  12380. else if (column == null) {
  12381. throw new Error("!!!Internal Error: Attempting to insert a line into matrix " + this.id);
  12382. }
  12383. const pos = this.getIndexOf(line, column);
  12384. location_1.Location.updateAddress(this.addresses[pos], value.get());
  12385. }
  12386. getIndexOf(line, column) {
  12387. return line * this.columns + column;
  12388. }
  12389. getLocAddressOf(line, column) {
  12390. if (this.isVector) {
  12391. if (column != null) {
  12392. throw new Error(this.id + " is not a matrix!");
  12393. }
  12394. column = line;
  12395. line = 0;
  12396. }
  12397. else if (column == null) {
  12398. // this is a whole line...
  12399. const values = [];
  12400. for (let col = 0; col < this.columns; col += 1) {
  12401. const index = this.getIndexOf(line, col);
  12402. values.push(this.addresses[index]);
  12403. }
  12404. return values;
  12405. }
  12406. const index = this.getIndexOf(line, column);
  12407. return this.addresses[index];
  12408. }
  12409. }
  12410. exports.StoreObjectArray = StoreObjectArray;
  12411. /***/ }),
  12412. /***/ "./js/processor/store/storeObjectRef.ts":
  12413. /*!**********************************************!*\
  12414. !*** ./js/processor/store/storeObjectRef.ts ***!
  12415. \**********************************************/
  12416. /*! no static exports found */
  12417. /***/ (function(module, exports, __webpack_require__) {
  12418. "use strict";
  12419. Object.defineProperty(exports, "__esModule", { value: true });
  12420. exports.StoreObjectRef = void 0;
  12421. const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
  12422. class StoreObjectRef extends storeObject_1.StoreObject {
  12423. /**
  12424. *
  12425. * @param {StoreObject} stoValue
  12426. */
  12427. constructor(stoValue) {
  12428. super(stoValue.type, stoValue.getRefAddress(), false);
  12429. this.refObj = stoValue.id;
  12430. this.reference_dimension = stoValue.getReferenceDimension();
  12431. }
  12432. get isRef() {
  12433. return true;
  12434. }
  12435. getRefObj() {
  12436. return this.refObj;
  12437. }
  12438. getReferenceDimension() {
  12439. return this.reference_dimension;
  12440. }
  12441. destroy() {
  12442. return false;
  12443. }
  12444. }
  12445. exports.StoreObjectRef = StoreObjectRef;
  12446. /***/ }),
  12447. /***/ "./js/processor/store/store_object_array_ref.ts":
  12448. /*!******************************************************!*\
  12449. !*** ./js/processor/store/store_object_array_ref.ts ***!
  12450. \******************************************************/
  12451. /*! no static exports found */
  12452. /***/ (function(module, exports, __webpack_require__) {
  12453. "use strict";
  12454. Object.defineProperty(exports, "__esModule", { value: true });
  12455. exports.StoreObjectArrayRef = void 0;
  12456. const storeObjectArray_1 = __webpack_require__(/*! ./storeObjectArray */ "./js/processor/store/storeObjectArray.ts");
  12457. class StoreObjectArrayRef extends storeObjectArray_1.StoreObjectArray {
  12458. constructor(stoValue, lines, columns) {
  12459. super(stoValue.type, lines, columns, stoValue.getAddresses(), false);
  12460. this.refObj = stoValue.id;
  12461. }
  12462. get isRef() {
  12463. return true;
  12464. }
  12465. getRefObj() {
  12466. return this.refObj;
  12467. }
  12468. destroy() {
  12469. return false;
  12470. }
  12471. }
  12472. exports.StoreObjectArrayRef = StoreObjectArrayRef;
  12473. /***/ }),
  12474. /***/ "./js/processor/store/value/array_store_value.ts":
  12475. /*!*******************************************************!*\
  12476. !*** ./js/processor/store/value/array_store_value.ts ***!
  12477. \*******************************************************/
  12478. /*! no static exports found */
  12479. /***/ (function(module, exports, __webpack_require__) {
  12480. "use strict";
  12481. Object.defineProperty(exports, "__esModule", { value: true });
  12482. exports.ArrayStoreValue = void 0;
  12483. const array_type_1 = __webpack_require__(/*! ../../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  12484. const store_value_address_1 = __webpack_require__(/*! ./store_value_address */ "./js/processor/store/value/store_value_address.ts");
  12485. class ArrayStoreValue {
  12486. constructor(type, values, lines, columns, id, isConst = false) {
  12487. this.type = type;
  12488. this.id = id;
  12489. this.isConst = isConst;
  12490. this.values = values;
  12491. this.lines = lines;
  12492. this.columns = columns;
  12493. }
  12494. get() {
  12495. return this.values;
  12496. }
  12497. /**
  12498. * @deprecated
  12499. * Potential not necessary since array access is occuring directly in the StoreObject
  12500. * @param line
  12501. * @param column
  12502. */
  12503. getAt(line, column) {
  12504. console.log("Column ", column);
  12505. if (this.isVector()) {
  12506. if (column != null) {
  12507. throw new Error(this.id + " is not a matrix!");
  12508. }
  12509. column = line;
  12510. line = 0;
  12511. }
  12512. else if (column == null) {
  12513. const values = [];
  12514. for (let col = 0; col < this.columns; col += 1) {
  12515. const index = line * this.lines + col;
  12516. values.push(this.values[index]);
  12517. }
  12518. const array_type = this.type;
  12519. const vector_type = new array_type_1.ArrayType(array_type.innerType, array_type.dimensions - 1);
  12520. return new ArrayStoreValue(vector_type, values, this.columns, 0, this.id, this.isConst);
  12521. }
  12522. const index = line * this.lines + column;
  12523. console.log("Get at: ", index);
  12524. return this.values[index];
  12525. }
  12526. setAt(value, line, column) {
  12527. let used_dims = 1;
  12528. if (column != null) {
  12529. used_dims += 1;
  12530. }
  12531. let actual_line = line;
  12532. let actual_column = column;
  12533. if (!this.type.canAccept(value.type, used_dims)) {
  12534. throw new Error("!!!Internal Error: Attempting to insert an invalid value inside array " + this.id);
  12535. }
  12536. if (this.isVector()) {
  12537. if (column != null) {
  12538. throw new Error(this.id + " is not a matrix!");
  12539. }
  12540. actual_column = actual_line;
  12541. actual_line = 0;
  12542. }
  12543. else if (column == null) {
  12544. if (!(value instanceof ArrayStoreValue)) {
  12545. throw new Error("Attempting to insert a single value as a line of matrix " + this.id);
  12546. }
  12547. const actual_values = value.get();
  12548. for (let i = 0; i < this.columns; i += 1) {
  12549. const pos = actual_line * this.columns + i;
  12550. const val = actual_values[i];
  12551. this.values[pos] = new store_value_address_1.StoreValueAddress(value.type, val.get(), actual_line, i, this.id, this.isConst);
  12552. }
  12553. }
  12554. const columns = this.columns == null ? 0 : this.columns;
  12555. const pos = actual_line * columns + actual_column;
  12556. this.values[pos] = new store_value_address_1.StoreValueAddress(value.type, value.get(), line, column, this.id, this.isConst);
  12557. }
  12558. inStore() {
  12559. return this.id != null;
  12560. }
  12561. isVector() {
  12562. return this.type.dimensions == 1;
  12563. }
  12564. }
  12565. exports.ArrayStoreValue = ArrayStoreValue;
  12566. /***/ }),
  12567. /***/ "./js/processor/store/value/array_store_value_ref.ts":
  12568. /*!***********************************************************!*\
  12569. !*** ./js/processor/store/value/array_store_value_ref.ts ***!
  12570. \***********************************************************/
  12571. /*! no static exports found */
  12572. /***/ (function(module, exports, __webpack_require__) {
  12573. "use strict";
  12574. Object.defineProperty(exports, "__esModule", { value: true });
  12575. exports.ArrayStoreValueRef = void 0;
  12576. class ArrayStoreValueRef {
  12577. constructor(type, values, addresses, lines, columns, id) {
  12578. this.type = type;
  12579. this.values = values;
  12580. this.addresses = addresses;
  12581. this.lines = lines;
  12582. this.columns = columns;
  12583. this.id = id;
  12584. this.isConst = false;
  12585. }
  12586. get() {
  12587. return this.values;
  12588. }
  12589. getAddresses() {
  12590. return this.addresses;
  12591. }
  12592. inStore() {
  12593. return this.id != null;
  12594. }
  12595. }
  12596. exports.ArrayStoreValueRef = ArrayStoreValueRef;
  12597. /***/ }),
  12598. /***/ "./js/processor/store/value/store_value.ts":
  12599. /*!*************************************************!*\
  12600. !*** ./js/processor/store/value/store_value.ts ***!
  12601. \*************************************************/
  12602. /*! no static exports found */
  12603. /***/ (function(module, exports, __webpack_require__) {
  12604. "use strict";
  12605. Object.defineProperty(exports, "__esModule", { value: true });
  12606. exports.StoreValue = void 0;
  12607. class StoreValue {
  12608. constructor(type, value, id, isConst = false) {
  12609. this.type = type;
  12610. this.id = id;
  12611. this.isConst = isConst;
  12612. this.value = value;
  12613. }
  12614. get() {
  12615. return this.value;
  12616. }
  12617. inStore() {
  12618. return this.id != null;
  12619. }
  12620. }
  12621. exports.StoreValue = StoreValue;
  12622. /***/ }),
  12623. /***/ "./js/processor/store/value/store_value_address.ts":
  12624. /*!*********************************************************!*\
  12625. !*** ./js/processor/store/value/store_value_address.ts ***!
  12626. \*********************************************************/
  12627. /*! no static exports found */
  12628. /***/ (function(module, exports, __webpack_require__) {
  12629. "use strict";
  12630. Object.defineProperty(exports, "__esModule", { value: true });
  12631. exports.StoreValueAddress = void 0;
  12632. const store_value_1 = __webpack_require__(/*! ./store_value */ "./js/processor/store/value/store_value.ts");
  12633. class StoreValueAddress extends store_value_1.StoreValue {
  12634. constructor(type, value, line, column, id, isConst = false) {
  12635. super(type, value, id, isConst);
  12636. this.line = line;
  12637. this.column = column;
  12638. }
  12639. }
  12640. exports.StoreValueAddress = StoreValueAddress;
  12641. /***/ }),
  12642. /***/ "./js/processor/store/value/store_value_ref.ts":
  12643. /*!*****************************************************!*\
  12644. !*** ./js/processor/store/value/store_value_ref.ts ***!
  12645. \*****************************************************/
  12646. /*! no static exports found */
  12647. /***/ (function(module, exports, __webpack_require__) {
  12648. "use strict";
  12649. Object.defineProperty(exports, "__esModule", { value: true });
  12650. exports.StoreValueRef = void 0;
  12651. class StoreValueRef {
  12652. constructor(type, value, loc_address, id) {
  12653. this.type = type;
  12654. this.value = value;
  12655. this.loc_address = loc_address;
  12656. this.id = id;
  12657. this.isConst = false;
  12658. this.reference_dimesion = 0;
  12659. }
  12660. get() {
  12661. return this.value;
  12662. }
  12663. getRefAddress() {
  12664. return this.loc_address;
  12665. }
  12666. inStore() {
  12667. return this.id != null;
  12668. }
  12669. getReferenceDimension() {
  12670. return this.reference_dimesion;
  12671. }
  12672. setReferenceDimension(dimension) {
  12673. this.reference_dimesion = dimension;
  12674. }
  12675. }
  12676. exports.StoreValueRef = StoreValueRef;
  12677. /***/ }),
  12678. /***/ "./js/runner.js":
  12679. /*!**********************!*\
  12680. !*** ./js/runner.js ***!
  12681. \**********************/
  12682. /*! exports provided: runner */
  12683. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12684. "use strict";
  12685. __webpack_require__.r(__webpack_exports__);
  12686. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runner", function() { return runner; });
  12687. /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ast/ivprogParser */ "./js/ast/ivprogParser.js");
  12688. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  12689. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./io/domConsole */ "./js/io/domConsole.js");
  12690. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/languageService */ "./js/services/languageService.js");
  12691. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  12692. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./memory/location */ "./js/memory/location.ts");
  12693. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_memory_location__WEBPACK_IMPORTED_MODULE_5__);
  12694. function runner() {
  12695. var ivprogLexer = _services_languageService__WEBPACK_IMPORTED_MODULE_3__["LanguageService"].getCurrentLexer(); // const lexer = new ivprogLexer(new InputStream(input));
  12696. // const stream = new CommonTokenStream(lexer);
  12697. // stream.fill();
  12698. // let i = 1;
  12699. // let token = null;
  12700. // while ((token = stream.LT(i)).type !== ivprogLexer.EOF && token.type !== ivprogLexer.WHITESPACE) {
  12701. // console.log(`${token.type}-${token.text}`);
  12702. // console.log('\n')
  12703. // i++;
  12704. // }
  12705. // const anaSin = new IVProgParser(input, ivprogLexer);
  12706. var editor = new window.JsonEditor('#json-renderer', {});
  12707. var domConsole = new _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"]("#console", true);
  12708. domConsole.hide(); // proc.interpretAST().then( sto => {
  12709. // console.log(sto.applyStore('a'));
  12710. // }).catch(e => console.log(e));
  12711. try {
  12712. window.$('#btn').click(function () {
  12713. var input = window.$('#input').val();
  12714. var analiser = new _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_0__["IVProgParser"](input, ivprogLexer);
  12715. try {
  12716. var data = analiser.parseTree();
  12717. var semAna = new _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_4__["SemanticAnalyser"](data);
  12718. var proc = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__["IVProgProcessor"](semAna.analyseTree());
  12719. proc.registerInput(domConsole);
  12720. domConsole.clear();
  12721. proc.registerOutput(domConsole);
  12722. proc.interpretAST().then(function (sto) {
  12723. console.log(sto);
  12724. editor.load(sto.store);
  12725. console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
  12726. })["catch"](function (e) {
  12727. alert(e);
  12728. console.log(e);
  12729. console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
  12730. });
  12731. } catch (error) {
  12732. alert(error);
  12733. console.log(error);
  12734. console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
  12735. }
  12736. });
  12737. } catch (a) {
  12738. console.log(a);
  12739. }
  12740. }
  12741. /***/ }),
  12742. /***/ "./js/services/i18nHelper.js":
  12743. /*!***********************************!*\
  12744. !*** ./js/services/i18nHelper.js ***!
  12745. \***********************************/
  12746. /*! exports provided: i18nHelper */
  12747. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12748. "use strict";
  12749. __webpack_require__.r(__webpack_exports__);
  12750. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i18nHelper", function() { return i18nHelper; });
  12751. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  12752. /* harmony import */ var _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./localizedStringsService */ "./js/services/localizedStringsService.js");
  12753. var StringTypes = line_i18n__WEBPACK_IMPORTED_MODULE_0__["default"].StringTypes;
  12754. var i18nHelper = Object.freeze({
  12755. i18n: function i18n(identifier) {
  12756. var opts = identifier.split(':');
  12757. var type = opts[0].toLowerCase();
  12758. var id = opts[1];
  12759. if (StringTypes.ERROR === type) {
  12760. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getError(id);
  12761. } else if (StringTypes.MESSAGE === type) {
  12762. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getMessage(id);
  12763. } else if (StringTypes.UI === type) {
  12764. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI(id);
  12765. } else {
  12766. console.warn("A string has been passed to the i18n helper function that was not in the form type:id -> " + identifier);
  12767. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getString(identifier, type);
  12768. }
  12769. }
  12770. });
  12771. /***/ }),
  12772. /***/ "./js/services/languageService.js":
  12773. /*!****************************************!*\
  12774. !*** ./js/services/languageService.js ***!
  12775. \****************************************/
  12776. /*! exports provided: LanguageService */
  12777. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12778. "use strict";
  12779. __webpack_require__.r(__webpack_exports__);
  12780. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LanguageService", function() { return LanguageService; });
  12781. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  12782. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  12783. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  12784. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  12785. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  12786. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  12787. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  12788. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  12789. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  12790. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  12791. /* harmony import */ var _grammar___WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../../grammar/ */ "./grammar/index.js");
  12792. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  12793. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../util/config */ "./js/util/config.ts");
  12794. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_7__);
  12795. 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); }; }
  12796. 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; } }
  12797. var LanguageServiceExtended = /*#__PURE__*/function (_line_i18n$LanguageSe) {
  12798. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(LanguageServiceExtended, _line_i18n$LanguageSe);
  12799. var _super = _createSuper(LanguageServiceExtended);
  12800. function LanguageServiceExtended() {
  12801. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, LanguageServiceExtended);
  12802. return _super.call(this, typeof iLMparameters === 'undefined' ? _util_config__WEBPACK_IMPORTED_MODULE_7__["Config"].default_lang : iLMparameters.lang);
  12803. }
  12804. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(LanguageServiceExtended, [{
  12805. key: "getDefaultLang",
  12806. value: function getDefaultLang() {
  12807. return "pt";
  12808. }
  12809. }, {
  12810. key: "getCurrentLexer",
  12811. value: function getCurrentLexer() {
  12812. var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getLang()];
  12813. if (langInfo === null || langInfo === undefined) {
  12814. return _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getDefaultLang()].lexer;
  12815. } else {
  12816. return langInfo.lexer;
  12817. }
  12818. }
  12819. }, {
  12820. key: "getCurrentLangFuncs",
  12821. value: function getCurrentLangFuncs() {
  12822. var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getLang()];
  12823. if (langInfo === null || langInfo === undefined) {
  12824. return _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getDefaultLang()].langFuncs;
  12825. } else {
  12826. return langInfo.langFuncs;
  12827. }
  12828. }
  12829. }, {
  12830. key: "getCurrentLangLibs",
  12831. value: function getCurrentLangLibs() {
  12832. var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getLang()];
  12833. if (langInfo === null || langInfo === undefined) {
  12834. return _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getDefaultLang()].langLibs;
  12835. }
  12836. return langInfo.langLibs;
  12837. }
  12838. }]);
  12839. return LanguageServiceExtended;
  12840. }(line_i18n__WEBPACK_IMPORTED_MODULE_6__["default"].LanguageServiceNoLS);
  12841. var LanguageService = new LanguageServiceExtended();
  12842. /***/ }),
  12843. /***/ "./js/services/localizedStringsService.js":
  12844. /*!************************************************!*\
  12845. !*** ./js/services/localizedStringsService.js ***!
  12846. \************************************************/
  12847. /*! exports provided: LocalizedStrings, getInstance */
  12848. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12849. "use strict";
  12850. __webpack_require__.r(__webpack_exports__);
  12851. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocalizedStrings", function() { return LocalizedStrings; });
  12852. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getInstance", function() { return getInstance; });
  12853. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  12854. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  12855. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  12856. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  12857. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  12858. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  12859. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  12860. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  12861. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  12862. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  12863. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  12864. /* harmony import */ var _languageService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./languageService */ "./js/services/languageService.js");
  12865. /* harmony import */ var _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../processor/definedFunctions */ "./js/processor/definedFunctions.js");
  12866. /* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../../i18n */ "./i18n/index.ts");
  12867. /* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_i18n__WEBPACK_IMPORTED_MODULE_8__);
  12868. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.ts");
  12869. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_ast_operators__WEBPACK_IMPORTED_MODULE_9__);
  12870. 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); }; }
  12871. 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; } }
  12872. var IVProgLocalizedStrings = /*#__PURE__*/function (_line_i18n$LocalizedS) {
  12873. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(IVProgLocalizedStrings, _line_i18n$LocalizedS);
  12874. var _super = _createSuper(IVProgLocalizedStrings);
  12875. function IVProgLocalizedStrings(langService, langsJsons) {
  12876. var shouldListenToChange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  12877. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IVProgLocalizedStrings);
  12878. return _super.call(this, langService, langsJsons, shouldListenToChange);
  12879. }
  12880. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IVProgLocalizedStrings, [{
  12881. key: "translateType",
  12882. value: function translateType(type, dim) {
  12883. var type_string = this.getUI("type_".concat(type));
  12884. switch (dim) {
  12885. case 0:
  12886. return type_string;
  12887. default:
  12888. if (dim > 1) return this.getUI("matrix_info_string", [type_string]);else return this.getUI("vector_info_string", [type_string]);
  12889. }
  12890. }
  12891. }, {
  12892. key: "translateOp",
  12893. value: function translateOp(op) {
  12894. switch (op.ord) {
  12895. case _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].AND.ord:
  12896. case _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].OR.ord:
  12897. case _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].NOT.ord:
  12898. return this.getUI("logic_operator_".concat(op.value));
  12899. default:
  12900. return op.value;
  12901. }
  12902. }
  12903. }, {
  12904. key: "translateInternalFunction",
  12905. value: function translateInternalFunction(name) {
  12906. var category = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  12907. if (category == null) {
  12908. return _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_7__["LanguageDefinedFunction"].getLocalName(name);
  12909. } else {
  12910. return _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_7__["LanguageDefinedFunction"].getLocalName("".concat(category, ".").concat(name));
  12911. }
  12912. }
  12913. }]);
  12914. return IVProgLocalizedStrings;
  12915. }(line_i18n__WEBPACK_IMPORTED_MODULE_5__["default"].LocalizedStrings);
  12916. var LocalizedStrings = Object.freeze(new IVProgLocalizedStrings(_languageService__WEBPACK_IMPORTED_MODULE_6__["LanguageService"], _i18n__WEBPACK_IMPORTED_MODULE_8___default.a, true));
  12917. var _instance = null;
  12918. function getInstance() {
  12919. if (_instance == null) {
  12920. _instance = new IVProgLocalizedStrings(_languageService__WEBPACK_IMPORTED_MODULE_6__["LanguageService"], _i18n__WEBPACK_IMPORTED_MODULE_8___default.a);
  12921. }
  12922. return _instance;
  12923. }
  12924. /***/ }),
  12925. /***/ "./js/services/userLog.js":
  12926. /*!********************************!*\
  12927. !*** ./js/services/userLog.js ***!
  12928. \********************************/
  12929. /*! exports provided: ActionTypes, registerClick, registerUserEvent, registerSystemEvent, getLogs, setRebuildMode, getLogsAsString, parseLogs */
  12930. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12931. "use strict";
  12932. __webpack_require__.r(__webpack_exports__);
  12933. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActionTypes", function() { return ActionTypes; });
  12934. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerClick", function() { return registerClick; });
  12935. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerUserEvent", function() { return registerUserEvent; });
  12936. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerSystemEvent", function() { return registerSystemEvent; });
  12937. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLogs", function() { return getLogs; });
  12938. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setRebuildMode", function() { return setRebuildMode; });
  12939. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLogsAsString", function() { return getLogsAsString; });
  12940. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseLogs", function() { return parseLogs; });
  12941. var clicks = [];
  12942. var inRebuildMode = false;
  12943. var ActionTypes = Object.freeze({
  12944. // registerUserEvent payload:
  12945. // (function_name, insert action)
  12946. INSERT_FUNCTION: "INSERT_FUNCTION",
  12947. // (function_name, remove action)
  12948. REMOVE_FUNCTION: "REMOVE_FUNCTION",
  12949. // (var_name,insert action, type, dim)
  12950. INSERT_GLOBAL_VAR: "INSERT_GLOBAL_VAR",
  12951. // (var name, remove action)
  12952. REMOVE_GLOBAL_VAR: "REMOVE_GLOBAL_VAR",
  12953. // (old function name, rename action, new function name)
  12954. RENAME_FUNCTION: "RENAME_FUNCTION",
  12955. // (old var name, rename action. new var name)
  12956. RENAME_GLOBAL_VAR: "RENAME_GLOBAL_VAR",
  12957. // (var name, set const action)
  12958. SET_GLOBAL_CONST: "SET_GLOBAL_CONST",
  12959. // (function name, change return action, type, dim)
  12960. CHANGE_FUNCTION_RETURN: "CHANGE_FUNCTION_RETURN",
  12961. // (var name, change type action, type, dim, rows?, columns?)
  12962. CHANGE_GLOBAL_TYPE: "CHANGE_GLOBAL_TYPE",
  12963. // (var name, change value action, value)
  12964. CHANGE_GLOBAL_VALUE: "CHANGE_GLOBAL_VALUE",
  12965. // (function name, insert param action, param varname, type, dim)
  12966. INSERT_FUNCTION_PARAM: "INSERT_FUNCTION_PARAM",
  12967. // (function name, remove param action, param varname)
  12968. REMOVE_FUNCTION_PARAM: "REMOVE_FUNCTION_PARAM",
  12969. // (function name, change param type action, type, dim)
  12970. CHANGE_PARAM_TYPE: "CHANGE_PARAM_TYPE",
  12971. // (function name, rename param action, old param name, new param name)
  12972. RENAME_FUNCTION_PARAM: "RENAME_FUNCTION_PARAM",
  12973. // (function name, insert var action, var name, type, dim)
  12974. INSERT_FUNCTION_VAR: "INSERT_FUCNTION_VAR",
  12975. // (function name, remove var action, var name)
  12976. REMOVE_FUNCTION_VAR: "REMOVE_FUNCTION_VAR",
  12977. // (function name, rename var action, old var name, new var name)
  12978. RENAME_FUNCTION_VAR: "RENAME_FUNCTION_VAR",
  12979. // (function name, change var type action, var name, type, dim, rows?, columns?)
  12980. CHANGE_VAR_TYPE: "CHANGE_VAR_TYPE",
  12981. // (function name, change var value action, var name, value)
  12982. CHANGE_VAR_VALUE: "CHANGE_VAR_VALUE",
  12983. // (function name, insert command action, command, path)
  12984. INSERT_COMMAND: "INSERT_COMMAND",
  12985. // (function name, remove command action, path)
  12986. REMOVE_COMMAND: "REMOVE_COMMAND",
  12987. // (function name, change command exp action, path, exp)
  12988. CHANGE_COMMAND_EXP: "CHANGE_COMMAND_EXP",
  12989. // (function name, change attrib exp action, path, exp)
  12990. CHANGE_ATTRIB_EXP: "CHANGE_ATTRIB_EXP",
  12991. // (function name, change attrib var action, path, var name, row_exp?, column_exp?)
  12992. CHANGE_ATTRIB_VAR: "CHANGE_ATTRIB_VAR",
  12993. // (function name, move command action, old path, new path)
  12994. MOVE_COMMAND: "MOVE_COMMAND",
  12995. // (function name, enter change name action, var name)
  12996. ENTER_CHANGE_VAR_NAME: 'ENTER_CHANGE_VAR_NAME',
  12997. // (function name, enter change value action, var name)
  12998. ENTER_CHANGE_VAR_VALUE: 'ENTER_CHANGE_VAR_VALUE',
  12999. // (var name, enter change name action)
  13000. ENTER_CHANGE_GLOBAL_NAME: 'ENTER_CHANGE_GLOBAL_NAME',
  13001. // (var name, enter change value action)
  13002. ENTER_CHANGE_GLOBAL_VALUE: 'ENTER_CHANGE_GLOBAL_VALUE',
  13003. // (function name, enter change name action, param name)
  13004. ENTER_CHANGE_PARAM_NAME: 'ENTER_CHANGE_PARAM_NAME'
  13005. });
  13006. function registerClick(x, y, details) {
  13007. if (inRebuildMode) {
  13008. return;
  13009. }
  13010. clicks.push([x, y, Date.now(), details]);
  13011. }
  13012. function registerUserEvent(command, action) {
  13013. for (var _len = arguments.length, params = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  13014. params[_key - 2] = arguments[_key];
  13015. }
  13016. registerEvent('user_event', command, action, params);
  13017. }
  13018. function registerSystemEvent(command, action) {
  13019. for (var _len2 = arguments.length, params = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
  13020. params[_key2 - 2] = arguments[_key2];
  13021. }
  13022. registerEvent('system_event', command, action, params);
  13023. }
  13024. function registerEvent(tag, command, action, params) {
  13025. if (inRebuildMode) {
  13026. return;
  13027. }
  13028. var event = {
  13029. context: command,
  13030. action: action,
  13031. params: params
  13032. };
  13033. clicks.push([tag, Date.now(), event]);
  13034. }
  13035. function getLogs() {
  13036. return clicks;
  13037. }
  13038. function setRebuildMode(flag) {
  13039. inRebuildMode = flag;
  13040. }
  13041. function getLogsAsString() {
  13042. return JSON.stringify(clicks);
  13043. }
  13044. function parseLogs(logData) {
  13045. clicks = JSON.parse(logData);
  13046. }
  13047. /***/ }),
  13048. /***/ "./js/typeSystem/array_type.ts":
  13049. /*!*************************************!*\
  13050. !*** ./js/typeSystem/array_type.ts ***!
  13051. \*************************************/
  13052. /*! no static exports found */
  13053. /***/ (function(module, exports, __webpack_require__) {
  13054. "use strict";
  13055. Object.defineProperty(exports, "__esModule", { value: true });
  13056. exports.ArrayType = void 0;
  13057. class ArrayType {
  13058. constructor(type, dimensions) {
  13059. this.dimensions = dimensions;
  13060. this.innerType = type;
  13061. }
  13062. get isVector() {
  13063. return this.dimensions == 1;
  13064. }
  13065. isCompatible(another) {
  13066. if (another instanceof ArrayType) {
  13067. if (this.dimensions !== another.dimensions) {
  13068. return false;
  13069. }
  13070. return this.innerType.isCompatible(another.innerType);
  13071. }
  13072. return false;
  13073. }
  13074. stringInfo() {
  13075. const list = this.innerType.stringInfo();
  13076. list.forEach(v => {
  13077. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  13078. const tmp = v;
  13079. tmp.dim = this.dimensions;
  13080. });
  13081. return list;
  13082. }
  13083. get value() {
  13084. return undefined;
  13085. }
  13086. get ord() {
  13087. return undefined;
  13088. }
  13089. canAccept(another, used_dims) {
  13090. const free_dims = this.dimensions - used_dims;
  13091. if (another instanceof ArrayType) {
  13092. return free_dims == another.dimensions && this.innerType.isCompatible(another.innerType);
  13093. }
  13094. else {
  13095. return free_dims == 0 && this.innerType.isCompatible(another);
  13096. }
  13097. }
  13098. }
  13099. exports.ArrayType = ArrayType;
  13100. /***/ }),
  13101. /***/ "./js/typeSystem/multiType.ts":
  13102. /*!************************************!*\
  13103. !*** ./js/typeSystem/multiType.ts ***!
  13104. \************************************/
  13105. /*! no static exports found */
  13106. /***/ (function(module, exports, __webpack_require__) {
  13107. "use strict";
  13108. Object.defineProperty(exports, "__esModule", { value: true });
  13109. exports.MultiType = void 0;
  13110. class MultiType {
  13111. constructor(types) {
  13112. this.types = types;
  13113. }
  13114. get value() {
  13115. return undefined;
  13116. }
  13117. get ord() {
  13118. return undefined;
  13119. }
  13120. stringInfo() {
  13121. let list = [];
  13122. for (let i = 0; i < this.types.length; i++) {
  13123. const t = this.types[i];
  13124. list = list.concat(t.stringInfo());
  13125. }
  13126. return list;
  13127. }
  13128. isCompatible(another) {
  13129. for (let i = 0; i < this.types.length; i++) {
  13130. const t = this.types[i];
  13131. if (another.isCompatible(t)) {
  13132. return true;
  13133. }
  13134. }
  13135. return false;
  13136. }
  13137. }
  13138. exports.MultiType = MultiType;
  13139. /***/ }),
  13140. /***/ "./js/typeSystem/parsers.js":
  13141. /*!**********************************!*\
  13142. !*** ./js/typeSystem/parsers.js ***!
  13143. \**********************************/
  13144. /*! exports provided: toInt, toString, toChar, toReal, toBool, convertBoolToString, convertToString */
  13145. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13146. "use strict";
  13147. __webpack_require__.r(__webpack_exports__);
  13148. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toInt", function() { return toInt; });
  13149. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toString", function() { return toString; });
  13150. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toChar", function() { return toChar; });
  13151. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toReal", function() { return toReal; });
  13152. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toBool", function() { return toBool; });
  13153. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertBoolToString", function() { return convertBoolToString; });
  13154. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToString", function() { return convertToString; });
  13155. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../services/languageService */ "./js/services/languageService.js");
  13156. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./types */ "./js/typeSystem/types.ts");
  13157. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_types__WEBPACK_IMPORTED_MODULE_1__);
  13158. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! decimal.js */ "./node_modules/decimal.js/decimal.js");
  13159. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(decimal_js__WEBPACK_IMPORTED_MODULE_2__);
  13160. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
  13161. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_3__);
  13162. function toInt(str) {
  13163. return new decimal_js__WEBPACK_IMPORTED_MODULE_2___default.a(str);
  13164. }
  13165. function toString(str) {
  13166. var value = str.replace(/^"/, '');
  13167. value = value.replace(/"$/, '');
  13168. value = value.replace(/\\b/g, "\b");
  13169. value = value.replace(/\\t/g, "\t");
  13170. value = value.replace(/\\n/g, "\n");
  13171. value = value.replace(/\\r/g, "\r");
  13172. value = value.replace(/\\"/g, "\"");
  13173. value = value.replace(/\\'/g, '\'');
  13174. value = value.replace(/\\\\/g, "\\");
  13175. return value;
  13176. }
  13177. function toChar(str) {
  13178. var value = str.replace(/^'/, '');
  13179. value = value.replace(/'$/, '');
  13180. return value;
  13181. }
  13182. function toReal(value) {
  13183. return new decimal_js__WEBPACK_IMPORTED_MODULE_2___default.a(value);
  13184. }
  13185. function toBool(str) {
  13186. var val = "'" + str + "'";
  13187. var lexer = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLexer();
  13188. var instance = new lexer(null);
  13189. if (instance.literalNames[lexer.RK_TRUE] === val) {
  13190. return true;
  13191. } else if (instance.literalNames[lexer.RK_FALSE] === val) {
  13192. return false;
  13193. } else {
  13194. // TODO: better error message
  13195. throw new Error(str + "not a valid boolean");
  13196. }
  13197. }
  13198. function convertBoolToString(bool) {
  13199. var lexer = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLexer();
  13200. var instance = new lexer(null);
  13201. var result = null;
  13202. if (bool) {
  13203. result = instance.literalNames[lexer.RK_TRUE];
  13204. } else {
  13205. result = instance.literalNames[lexer.RK_FALSE];
  13206. }
  13207. return result.replace(/'/g, "");
  13208. }
  13209. function convertToString(value, type) {
  13210. switch (type.ord) {
  13211. case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER.ord:
  13212. return value.toString();
  13213. case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL.ord:
  13214. {
  13215. if (value.dp() <= 0) {
  13216. return value.toFixed(1);
  13217. } else {
  13218. return value.toFixed(_util_config__WEBPACK_IMPORTED_MODULE_3__["Config"].decimalPlaces);
  13219. }
  13220. }
  13221. case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].BOOLEAN.ord:
  13222. return convertBoolToString(value);
  13223. default:
  13224. return value;
  13225. }
  13226. }
  13227. /***/ }),
  13228. /***/ "./js/typeSystem/type.ts":
  13229. /*!*******************************!*\
  13230. !*** ./js/typeSystem/type.ts ***!
  13231. \*******************************/
  13232. /*! no static exports found */
  13233. /***/ (function(module, exports, __webpack_require__) {
  13234. "use strict";
  13235. Object.defineProperty(exports, "__esModule", { value: true });
  13236. exports.Type = void 0;
  13237. class Type {
  13238. constructor(value, ord) {
  13239. this.value = value;
  13240. this.ord = ord;
  13241. }
  13242. stringInfo() {
  13243. return [{ type: this.value, dim: 0 }];
  13244. }
  13245. isCompatible(another) {
  13246. return this.value === another.value && this.ord === another.ord;
  13247. }
  13248. }
  13249. exports.Type = Type;
  13250. /***/ }),
  13251. /***/ "./js/typeSystem/types.ts":
  13252. /*!********************************!*\
  13253. !*** ./js/typeSystem/types.ts ***!
  13254. \********************************/
  13255. /*! no static exports found */
  13256. /***/ (function(module, exports, __webpack_require__) {
  13257. "use strict";
  13258. Object.defineProperty(exports, "__esModule", { value: true });
  13259. exports.fromOrdToType = exports.Types = void 0;
  13260. const type_1 = __webpack_require__(/*! ./type */ "./js/typeSystem/type.ts");
  13261. const multiType_1 = __webpack_require__(/*! ./multiType */ "./js/typeSystem/multiType.ts");
  13262. const maybe_1 = __webpack_require__(/*! ../util/maybe */ "./js/util/maybe.ts");
  13263. const INTEGER = new type_1.Type("integer", 0);
  13264. const REAL = new type_1.Type("real", 1);
  13265. const STRING = new type_1.Type("text", 2);
  13266. const BOOLEAN = new type_1.Type("boolean", 3);
  13267. const CHAR = new type_1.Type("char", 4);
  13268. const VOID = new type_1.Type("void", 5);
  13269. const UNDEFINED = new type_1.Type("undefined", 6);
  13270. const ALL = new multiType_1.MultiType([INTEGER, REAL, STRING, CHAR, BOOLEAN]);
  13271. exports.Types = Object.freeze({
  13272. INTEGER: INTEGER,
  13273. REAL: REAL,
  13274. STRING: STRING,
  13275. CHAR: CHAR,
  13276. BOOLEAN: BOOLEAN,
  13277. VOID: VOID,
  13278. UNDEFINED: UNDEFINED,
  13279. ALL: ALL
  13280. });
  13281. function fromOrdToType(ord) {
  13282. const typeMap = exports.Types;
  13283. for (const t in typeMap) {
  13284. if (typeMap[t].ord && typeMap[t].ord === ord) {
  13285. return maybe_1.Maybe.some(typeMap[t]);
  13286. }
  13287. }
  13288. return maybe_1.Maybe.none();
  13289. }
  13290. exports.fromOrdToType = fromOrdToType;
  13291. /***/ }),
  13292. /***/ "./js/util/auto_gen_output.js":
  13293. /*!************************************!*\
  13294. !*** ./js/util/auto_gen_output.js ***!
  13295. \************************************/
  13296. /*! exports provided: autoGenerateTestCaseOutput */
  13297. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13298. "use strict";
  13299. __webpack_require__.r(__webpack_exports__);
  13300. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoGenerateTestCaseOutput", function() { return autoGenerateTestCaseOutput; });
  13301. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  13302. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  13303. /* harmony import */ var _inputTest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./inputTest */ "./js/util/inputTest.js");
  13304. /* harmony import */ var _outputTest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./outputTest */ "./js/util/outputTest.js");
  13305. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  13306. function autoGenerateTestCaseOutput(program_text, testCases) {
  13307. var copyTestCases = testCases.map(function (test) {
  13308. return Object.assign({}, test);
  13309. });
  13310. try {
  13311. var program = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_0__["SemanticAnalyser"].analyseFromSource(program_text);
  13312. var resultList = testCases.map(function (test, id) {
  13313. var input = new _inputTest__WEBPACK_IMPORTED_MODULE_2__["InputTest"](test.input);
  13314. var output = new _outputTest__WEBPACK_IMPORTED_MODULE_3__["OutputTest"]();
  13315. var exec = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__["IVProgProcessor"](program);
  13316. exec.registerInput(input);
  13317. exec.registerOutput(output);
  13318. return exec.interpretAST().then(function (_) {
  13319. return {
  13320. id: id,
  13321. program: exec
  13322. };
  13323. });
  13324. });
  13325. return Promise.all(resultList).then(function (result_final) {
  13326. for (var i = 0; i < result_final.length; ++i) {
  13327. var result = result_final[i];
  13328. var output = result.program.output.list;
  13329. var input = result.program.input;
  13330. if (input.index != input.inputList.length) {
  13331. window.showAlert(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getMessage("testcase_autogen_unused_input", [result.id + 1]));
  13332. return Promise.resolve(false);
  13333. }
  13334. if (output.length == 0) {
  13335. window.showAlert(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getMessage("testcase_autogen_empty", [result.id + 1]));
  13336. }
  13337. copyTestCases[result.id].output = output;
  13338. }
  13339. window.outputGenerated(copyTestCases);
  13340. return Promise.resolve(true);
  13341. });
  13342. } catch (error) {
  13343. return Promise.reject(error);
  13344. }
  13345. }
  13346. /***/ }),
  13347. /***/ "./js/util/config.ts":
  13348. /*!***************************!*\
  13349. !*** ./js/util/config.ts ***!
  13350. \***************************/
  13351. /*! no static exports found */
  13352. /***/ (function(module, exports, __webpack_require__) {
  13353. "use strict";
  13354. Object.defineProperty(exports, "__esModule", { value: true });
  13355. exports.Config = void 0;
  13356. class ConfigObject {
  13357. constructor() {
  13358. this.decimalPlaces = 8;
  13359. this.intConvertRoundMode = 2;
  13360. this.default_lang = 'pt';
  13361. this.enable_type_casting = true;
  13362. this.idle_input_interval = 5000;
  13363. this.suspend_threshold = 100;
  13364. // this.max_instruction_count = 350250; - automated evaluation limit
  13365. this.max_instruction_count = Number.MAX_SAFE_INTEGER;
  13366. }
  13367. setConfig(opts) {
  13368. const otherConfig = opts;
  13369. for (const key in otherConfig) {
  13370. if (Object.prototype.hasOwnProperty.call(this, key)) {
  13371. this[key] = otherConfig[key];
  13372. }
  13373. }
  13374. }
  13375. }
  13376. const config = new ConfigObject();
  13377. exports.Config = config;
  13378. /***/ }),
  13379. /***/ "./js/util/editorMode2.js":
  13380. /*!********************************!*\
  13381. !*** ./js/util/editorMode2.js ***!
  13382. \********************************/
  13383. /*! exports provided: CodeEditorMode */
  13384. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13385. "use strict";
  13386. __webpack_require__.r(__webpack_exports__);
  13387. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeEditorMode", function() { return CodeEditorMode; });
  13388. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./js/util/utils.js");
  13389. /**
  13390. * Source: https://raw.githubusercontent.com/codemirror/CodeMirror/master/mode/clike/clike.js
  13391. * @author arijn Haverbeke and others
  13392. * @author Lucas de Souza
  13393. * @param {CodeMirror} CodeMirror
  13394. */
  13395. function CodeEditorMode(CodeMirror) {
  13396. "use strict";
  13397. function Context(indented, column, type, info, align, prev) {
  13398. this.indented = indented;
  13399. this.column = column;
  13400. this.type = type;
  13401. this.info = info;
  13402. this.align = align;
  13403. this.prev = prev;
  13404. }
  13405. function pushContext(state, col, type, info) {
  13406. var indent = state.indented;
  13407. if (state.context && state.context.type == "statement" && type != "statement") indent = state.context.indented;
  13408. return state.context = new Context(indent, col, type, info, null, state.context);
  13409. }
  13410. function popContext(state) {
  13411. var t = state.context.type;
  13412. if (t == ")" || t == "]" || t == "}") state.indented = state.context.indented;
  13413. return state.context = state.context.prev;
  13414. }
  13415. function typeBefore(stream, state, pos) {
  13416. if (state.prevToken == "variable" || state.prevToken == "type") return true;
  13417. if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, pos))) return true;
  13418. if (state.typeAtEndOfLine && stream.column() == stream.indentation()) return true;
  13419. }
  13420. function isTopScope(context) {
  13421. for (;;) {
  13422. if (!context || context.type == "top") return true;
  13423. if (context.type == "}" && context.prev.info != "namespace") return false;
  13424. context = context.prev;
  13425. }
  13426. }
  13427. function contains(words, word) {
  13428. if (typeof words === "function") {
  13429. return words(word);
  13430. } else {
  13431. return Object.propertyIsEnumerable.call(words, word);
  13432. }
  13433. }
  13434. function tokenComment(stream, state) {
  13435. var maybeEnd = false,
  13436. ch;
  13437. while (ch = stream.next()) {
  13438. if (ch == "/" && maybeEnd) {
  13439. state.tokenize = null;
  13440. break;
  13441. }
  13442. maybeEnd = ch == "*";
  13443. }
  13444. return "comment";
  13445. }
  13446. CodeMirror.defineMode("ivprog", function (config, parserConfig) {
  13447. var indentUnit = config.indentUnit,
  13448. statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
  13449. dontAlignCalls = parserConfig.dontAlignCalls,
  13450. keywords = parserConfig.keywords || {},
  13451. switchKeyword = parserConfig.switchKeyword,
  13452. caseKeyword = parserConfig.caseKeyword,
  13453. defaultKeyword = parserConfig.defaultKeyword,
  13454. caseRegex = new RegExp("^\\s*(?:".concat(caseKeyword, " .*?:|").concat(defaultKeyword, ":|\\{\\}?|\\})$")),
  13455. ////,
  13456. types = parserConfig.types || {},
  13457. builtin = parserConfig.builtin || {},
  13458. blockKeywords = parserConfig.blockKeywords || {},
  13459. defKeywords = parserConfig.defKeywords || {},
  13460. atoms = parserConfig.atoms || {},
  13461. hooks = parserConfig.hooks || {},
  13462. multiLineStrings = parserConfig.multiLineStrings,
  13463. indentStatements = false,
  13464. namespaceSeparator = null,
  13465. isPunctuationChar = /[[\]{}(),;:\n]/,
  13466. numberStart = /[\d.]/,
  13467. number = /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)$/i,
  13468. isOperatorChar = /[+\-*%=<>!/&]/,
  13469. isIdentifierChar = /[a-zA-Z0-9_]/,
  13470. // An optional function that takes a {string} token and returns true if it
  13471. // should be treated as a builtin.
  13472. isReservedIdentifier = parserConfig.isReservedIdentifier || false;
  13473. var curPunc, isDefKeyword;
  13474. var tokenString = function tokenString() {
  13475. /*SKIP*/
  13476. };
  13477. function tokenBase(stream, state) {
  13478. var ch = stream.next();
  13479. if (hooks[ch]) {
  13480. var result = hooks[ch](stream, state);
  13481. if (result !== false) return result;
  13482. }
  13483. if (ch == '"') {
  13484. state.tokenize = tokenString(ch);
  13485. return state.tokenize(stream, state);
  13486. }
  13487. if (isPunctuationChar.test(ch)) {
  13488. curPunc = ch;
  13489. return null;
  13490. }
  13491. if (numberStart.test(ch)) {
  13492. stream.backUp(1);
  13493. if (stream.match(number)) return "number";
  13494. stream.next();
  13495. }
  13496. if (ch == "/") {
  13497. if (stream.eat("*")) {
  13498. state.tokenize = tokenComment;
  13499. return tokenComment(stream, state);
  13500. }
  13501. if (stream.eat("/")) {
  13502. stream.skipToEnd();
  13503. return "comment";
  13504. }
  13505. }
  13506. if (isOperatorChar.test(ch)) {
  13507. while (!stream.match(/^\/[/*]/, false) && stream.eat(isOperatorChar)) {
  13508. /* SKIP */
  13509. }
  13510. return "operator";
  13511. }
  13512. stream.eatWhile(isIdentifierChar);
  13513. if (namespaceSeparator) while (stream.match(namespaceSeparator)) {
  13514. stream.eatWhile(isIdentifierChar);
  13515. }
  13516. var cur = stream.current();
  13517. if (contains(keywords, cur)) {
  13518. if (contains(blockKeywords, cur)) curPunc = "newstatement";
  13519. if (contains(defKeywords, cur)) isDefKeyword = true;
  13520. return "keyword";
  13521. }
  13522. if (contains(types, cur)) return "type";
  13523. if (contains(builtin, cur) || isReservedIdentifier && isReservedIdentifier(cur)) {
  13524. if (contains(blockKeywords, cur)) curPunc = "newstatement";
  13525. return "builtin";
  13526. }
  13527. if (contains(atoms, cur)) return "atom";
  13528. return "variable";
  13529. }
  13530. tokenString = function tokenString(quote) {
  13531. return function (stream, state) {
  13532. var escaped = false,
  13533. next,
  13534. end = false;
  13535. while ((next = stream.next()) != null) {
  13536. if (next == quote && !escaped) {
  13537. end = true;
  13538. break;
  13539. }
  13540. escaped = !escaped && next == "\\";
  13541. }
  13542. if (end || !(escaped || multiLineStrings)) state.tokenize = null;
  13543. return "string";
  13544. };
  13545. };
  13546. function maybeEOL(stream, state) {
  13547. if (parserConfig.typeFirstDefinitions && stream.eol() && isTopScope(state.context)) state.typeAtEndOfLine = typeBefore(stream, state, stream.pos);
  13548. } // Interface
  13549. return {
  13550. startState: function startState(basecolumn) {
  13551. return {
  13552. tokenize: null,
  13553. context: new Context((basecolumn || 0) - indentUnit, 0, "top", null, false),
  13554. indented: 0,
  13555. startOfLine: true,
  13556. prevToken: null
  13557. };
  13558. },
  13559. token: function token(stream, state) {
  13560. var ctx = state.context;
  13561. if (stream.sol()) {
  13562. if (ctx.align == null) ctx.align = false;
  13563. state.indented = stream.indentation();
  13564. state.startOfLine = true;
  13565. }
  13566. if (stream.eatSpace()) {
  13567. maybeEOL(stream, state);
  13568. return null;
  13569. }
  13570. curPunc = isDefKeyword = null;
  13571. var style = (state.tokenize || tokenBase)(stream, state);
  13572. if (style == "comment" || style == "meta") return style;
  13573. if (ctx.align == null) ctx.align = true;
  13574. if (curPunc == ";" || curPunc == ":" || curPunc == "," && stream.match(/^\s*(?:\/\/.*)?$/, false)) while (state.context.type == "statement") {
  13575. popContext(state);
  13576. } else if (curPunc == "{") pushContext(state, stream.column(), "}");else if (curPunc == "[") pushContext(state, stream.column(), "]");else if (curPunc == "(") pushContext(state, stream.column(), ")");else if (curPunc == "}") {
  13577. while (ctx.type == "statement") {
  13578. ctx = popContext(state);
  13579. }
  13580. if (ctx.type == "}") ctx = popContext(state);
  13581. while (ctx.type == "statement") {
  13582. ctx = popContext(state);
  13583. }
  13584. } else if (curPunc == ctx.type) popContext(state);else if (indentStatements && ((ctx.type == "}" || ctx.type == "top") && curPunc != ";" || ctx.type == "statement" && curPunc == "newstatement")) {
  13585. pushContext(state, stream.column(), "statement", stream.current());
  13586. }
  13587. if (style == "variable" && (state.prevToken == "def" || parserConfig.typeFirstDefinitions && typeBefore(stream, state, stream.start) && isTopScope(state.context) && stream.match(/^\s*\(/, false))) style = "def";
  13588. if (hooks.token) {
  13589. var result = hooks.token(stream, state, style);
  13590. if (result !== undefined) style = result;
  13591. }
  13592. if (style == "def" && parserConfig.styleDefs === false) style = "variable";
  13593. state.startOfLine = false;
  13594. state.prevToken = isDefKeyword ? "def" : style || curPunc;
  13595. maybeEOL(stream, state);
  13596. return style;
  13597. },
  13598. indent: function indent(state, textAfter) {
  13599. if (state.tokenize != tokenBase && state.tokenize != null || state.typeAtEndOfLine) return CodeMirror.Pass;
  13600. var ctx = state.context;
  13601. var firstChar = textAfter && textAfter.charAt(0);
  13602. var closing = firstChar == ctx.type;
  13603. if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
  13604. if (parserConfig.dontIndentStatements) while (ctx.type == "statement" && parserConfig.dontIndentStatements.test(ctx.info)) {
  13605. ctx = ctx.prev;
  13606. }
  13607. if (hooks.indent) {
  13608. var hook = hooks.indent(state, ctx, textAfter, indentUnit);
  13609. if (typeof hook == "number") return hook;
  13610. }
  13611. var switchBlock = ctx.prev && ctx.prev.info == switchKeyword;
  13612. if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
  13613. while (ctx.type != "top" && ctx.type != "}") {
  13614. ctx = ctx.prev;
  13615. }
  13616. return ctx.indented;
  13617. }
  13618. if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
  13619. if (ctx.align && (!dontAlignCalls || ctx.type != ")")) return ctx.column + (closing ? 0 : 1);
  13620. if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit;
  13621. var caseTestRegex = new RegExp("^(?:".concat(caseKeyword, "|").concat(defaultKeyword, ")\b"));
  13622. return ctx.indented + (closing ? 0 : indentUnit) + (!closing && switchBlock && !caseTestRegex.test(textAfter) ? indentUnit : 0);
  13623. },
  13624. electricInput: caseRegex,
  13625. blockCommentStart: "/*",
  13626. blockCommentEnd: "*/",
  13627. blockCommentContinue: " * ",
  13628. lineComment: "//",
  13629. fold: "brace"
  13630. };
  13631. });
  13632. function words(str) {
  13633. var obj = {},
  13634. words = str.split(" ");
  13635. for (var i = 0; i < words.length; ++i) {
  13636. obj[words[i]] = true;
  13637. }
  13638. return obj;
  13639. }
  13640. var codeConfig = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getCodeEditorModeConfig"])();
  13641. var ivprogKeywords = codeConfig.keywords.join(" ");
  13642. var basicTypes = words(codeConfig.types.join(" "));
  13643. function ivprogTypes(identifier) {
  13644. return contains(basicTypes, identifier);
  13645. }
  13646. var ivprogBlockKeywords = codeConfig.blocks.join(" ");
  13647. var ivprogDefKeywords = "funcao const";
  13648. function def(mimes, mode) {
  13649. if (typeof mimes == "string") mimes = [mimes];
  13650. var words = [];
  13651. function add(obj) {
  13652. if (obj) {
  13653. for (var prop in obj) {
  13654. if (Object.hasOwnProperty.call(obj, prop)) {
  13655. words.push(prop);
  13656. }
  13657. }
  13658. }
  13659. }
  13660. add(mode.keywords);
  13661. add(mode.types);
  13662. add(mode.builtin);
  13663. add(mode.atoms);
  13664. if (words.length) {
  13665. mode.helperType = mimes[0];
  13666. CodeMirror.registerHelper("hintWords", mimes[0], words);
  13667. }
  13668. for (var i = 0; i < mimes.length; ++i) {
  13669. CodeMirror.defineMIME(mimes[i], mode);
  13670. }
  13671. }
  13672. def(["text/x-ivprog"], {
  13673. name: "ivprog",
  13674. keywords: words(ivprogKeywords),
  13675. types: ivprogTypes,
  13676. blockKeywords: words(ivprogBlockKeywords),
  13677. defKeywords: words(ivprogDefKeywords),
  13678. typeFirstDefinitions: true,
  13679. atoms: words(codeConfig.atoms.join(" ")),
  13680. switchKeyword: codeConfig.switchString,
  13681. caseKeyword: codeConfig.case_default[0],
  13682. defaultKeyword: codeConfig.case_default[1],
  13683. modeProps: {
  13684. fold: ["brace"]
  13685. }
  13686. });
  13687. }
  13688. /***/ }),
  13689. /***/ "./js/util/iassignHelpers.js":
  13690. /*!***********************************!*\
  13691. !*** ./js/util/iassignHelpers.js ***!
  13692. \***********************************/
  13693. /*! exports provided: prepareActivityToStudentHelper, autoEval */
  13694. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13695. "use strict";
  13696. __webpack_require__.r(__webpack_exports__);
  13697. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prepareActivityToStudentHelper", function() { return prepareActivityToStudentHelper; });
  13698. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoEval", function() { return autoEval; });
  13699. /* harmony import */ var _visualUI_functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../visualUI/functions */ "./js/visualUI/functions.js");
  13700. /* harmony import */ var _visualUI_code_generator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../visualUI/code_generator */ "./js/visualUI/code_generator.js");
  13701. /* harmony import */ var _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../assessment/ivprogAssessment */ "./js/assessment/ivprogAssessment.js");
  13702. /* harmony import */ var _testConsole__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./testConsole */ "./js/util/testConsole.js");
  13703. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  13704. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  13705. /* harmony import */ var _maybe__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./maybe */ "./js/util/maybe.ts");
  13706. /* harmony import */ var _maybe__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_maybe__WEBPACK_IMPORTED_MODULE_6__);
  13707. function parseActivityData(data) {
  13708. var algorithm_in_ilm = null;
  13709. if (data.split('\n::algorithm::')[1]) {
  13710. algorithm_in_ilm = data.split('\n::algorithm::')[1].split('\n::logs::')[0];
  13711. var logs = data.split('\n::algorithm::')[1].split('\n::logs::')[1];
  13712. if (logs != null) {
  13713. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["parseLogs"])(logs);
  13714. }
  13715. }
  13716. var content;
  13717. try {
  13718. content = JSON.parse(data.split('\n::algorithm::')[0]);
  13719. content['algorithm_in_ilm'] = algorithm_in_ilm;
  13720. } catch (e) {
  13721. console.error(e);
  13722. return _maybe__WEBPACK_IMPORTED_MODULE_6__["Maybe"].none();
  13723. }
  13724. return _maybe__WEBPACK_IMPORTED_MODULE_6__["Maybe"].some(content);
  13725. }
  13726. function prepareActivityToStudentHelper(ilm_cont) {
  13727. var maybe_content = parseActivityData(ilm_cont);
  13728. return maybe_content.map(function (content) {
  13729. var testCases = content.testcases;
  13730. Object(_visualUI_functions__WEBPACK_IMPORTED_MODULE_0__["setTestCases"])(testCases);
  13731. var prog_type = null;
  13732. if (content.settings_programming_type) {
  13733. prog_type = content.settings_programming_type[0].value;
  13734. } else {
  13735. prog_type = "visual";
  13736. }
  13737. return {
  13738. settingsProgrammingType: prog_type,
  13739. settingsDataTypes: content.settings_data_types,
  13740. settingsCommands: content.settings_commands,
  13741. settingsFunctions: content.settings_functions,
  13742. algorithmInIlm: content.algorithm_in_ilm,
  13743. settingsFilter: content.settings_filter
  13744. };
  13745. });
  13746. }
  13747. function compareArray(a, b) {
  13748. for (var i = 0; i < a.length; ++i) {
  13749. var elementA = a[i];
  13750. var elementB = b[i];
  13751. if (elementA != elementB) {
  13752. return false;
  13753. }
  13754. }
  13755. return true;
  13756. }
  13757. function compareTestcases(original, student) {
  13758. if (original.length != student.length) {
  13759. return false;
  13760. }
  13761. for (var i = 0; i < original.length; ++i) {
  13762. var elementO = original[i];
  13763. var elementS = student[i];
  13764. if (!compareArray(elementO.input, elementS.input)) {
  13765. return false;
  13766. }
  13767. if (!compareArray(elementO.output, elementS.output)) {
  13768. return false;
  13769. }
  13770. }
  13771. return true;
  13772. }
  13773. function autoEval(originalData, callback) {
  13774. var code = Object(_visualUI_code_generator__WEBPACK_IMPORTED_MODULE_1__["generate"])();
  13775. var original = parseActivityData(originalData).getOrElse(undefined);
  13776. if (original == null) {
  13777. alert("iAssign did not provide the original activity data!");
  13778. return callback(null);
  13779. }
  13780. if (code == null) {
  13781. return callback(-1); // @FeedbackConvention Casos de teste vazios
  13782. } else {
  13783. if (!compareTestcases(original.testcases, Object(_visualUI_functions__WEBPACK_IMPORTED_MODULE_0__["getTestCases"])())) {
  13784. return callback(-2); // @FeedbackConvention Casos de teste alterados pelo aluno
  13785. }
  13786. var ast_code = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_5__["SemanticAnalyser"].analyseFromSource(code);
  13787. var autoAssessment = new _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_2__["IVProgAssessment"](ast_code, Object(_visualUI_functions__WEBPACK_IMPORTED_MODULE_0__["getTestCases"])(), new _testConsole__WEBPACK_IMPORTED_MODULE_3__["TestConsole"]([]));
  13788. autoAssessment.runTest().then(function (grade) {
  13789. return callback(grade);
  13790. })["catch"](function (err) {
  13791. console.log(err);
  13792. callback(-5); // @FeedbackConvention Falha na execução
  13793. });
  13794. }
  13795. }
  13796. /***/ }),
  13797. /***/ "./js/util/inputTest.js":
  13798. /*!******************************!*\
  13799. !*** ./js/util/inputTest.js ***!
  13800. \******************************/
  13801. /*! exports provided: InputTest */
  13802. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13803. "use strict";
  13804. __webpack_require__.r(__webpack_exports__);
  13805. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputTest", function() { return InputTest; });
  13806. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  13807. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  13808. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  13809. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  13810. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  13811. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  13812. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  13813. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  13814. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  13815. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  13816. /* harmony import */ var _io_input__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../io/input */ "./js/io/input.js");
  13817. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  13818. 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); }; }
  13819. 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; } }
  13820. var InputTest = /*#__PURE__*/function (_Input) {
  13821. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(InputTest, _Input);
  13822. var _super = _createSuper(InputTest);
  13823. function InputTest(inputList) {
  13824. var _this;
  13825. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, InputTest);
  13826. _this = _super.call(this);
  13827. _this.index = 0;
  13828. _this.inputList = inputList;
  13829. return _this;
  13830. }
  13831. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(InputTest, [{
  13832. key: "requestInput",
  13833. value: function requestInput() {
  13834. var _this2 = this;
  13835. var promise = new Promise(function (resolve, reject) {
  13836. if (_this2.index < _this2.inputList.length) {
  13837. resolve(_this2.inputList[_this2.index]);
  13838. _this2.index++;
  13839. } else {
  13840. reject(new Error(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__["LocalizedStrings"].getError("exceeded_input_request")));
  13841. }
  13842. });
  13843. return promise;
  13844. }
  13845. }]);
  13846. return InputTest;
  13847. }(_io_input__WEBPACK_IMPORTED_MODULE_5__["Input"]);
  13848. /***/ }),
  13849. /***/ "./js/util/input_assessment.js":
  13850. /*!*************************************!*\
  13851. !*** ./js/util/input_assessment.js ***!
  13852. \*************************************/
  13853. /*! exports provided: InputAssessment */
  13854. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13855. "use strict";
  13856. __webpack_require__.r(__webpack_exports__);
  13857. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputAssessment", function() { return InputAssessment; });
  13858. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  13859. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  13860. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  13861. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  13862. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  13863. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  13864. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  13865. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  13866. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  13867. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  13868. /* harmony import */ var _io_input__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../io/input */ "./js/io/input.js");
  13869. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  13870. 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); }; }
  13871. 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; } }
  13872. var InputAssessment = /*#__PURE__*/function (_Input) {
  13873. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(InputAssessment, _Input);
  13874. var _super = _createSuper(InputAssessment);
  13875. function InputAssessment(input_list) {
  13876. var _this;
  13877. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, InputAssessment);
  13878. _this = _super.call(this);
  13879. _this.index = 0;
  13880. _this.input_list = input_list.map(function (val) {
  13881. return {
  13882. "value": val,
  13883. "read": false
  13884. };
  13885. });
  13886. return _this;
  13887. }
  13888. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(InputAssessment, [{
  13889. key: "requestInput",
  13890. value: function requestInput() {
  13891. var _this2 = this;
  13892. var promise = new Promise(function (resolve, reject) {
  13893. if (_this2.index < _this2.input_list.length) {
  13894. var input = _this2.input_list[_this2.index];
  13895. input.read = true;
  13896. _this2.index += 1;
  13897. resolve(input.value);
  13898. } else {
  13899. reject(new Error(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__["LocalizedStrings"].getError("exceeded_input_request")));
  13900. }
  13901. });
  13902. return promise;
  13903. }
  13904. }, {
  13905. key: "isInputAvailable",
  13906. value: function isInputAvailable() {
  13907. return this.index < this.input_list.length;
  13908. }
  13909. }]);
  13910. return InputAssessment;
  13911. }(_io_input__WEBPACK_IMPORTED_MODULE_5__["Input"]);
  13912. /***/ }),
  13913. /***/ "./js/util/maybe.ts":
  13914. /*!**************************!*\
  13915. !*** ./js/util/maybe.ts ***!
  13916. \**************************/
  13917. /*! no static exports found */
  13918. /***/ (function(module, exports, __webpack_require__) {
  13919. "use strict";
  13920. Object.defineProperty(exports, "__esModule", { value: true });
  13921. exports.Maybe = void 0;
  13922. /**
  13923. *
  13924. * Maybe Monad
  13925. * @Source: https://codewithstyle.info/advanced-functional-programming-in-typescript-maybe-monad/
  13926. * @Modified by: @lucascalion - 28/08/2019
  13927. *
  13928. **/
  13929. class Maybe {
  13930. constructor(value) {
  13931. this.value = value;
  13932. }
  13933. static some(value) {
  13934. if (!value) {
  13935. throw Error("Provided value must not be empty");
  13936. }
  13937. return new Maybe(value);
  13938. }
  13939. static none() {
  13940. return new Maybe(null);
  13941. }
  13942. static fromValue(value) {
  13943. return value ? Maybe.some(value) : Maybe.none();
  13944. }
  13945. getOrElse(defaultValue) {
  13946. return this.value === null ? defaultValue : this.value;
  13947. }
  13948. map(f) {
  13949. if (this.value === null) {
  13950. return Maybe.none();
  13951. }
  13952. else {
  13953. return Maybe.fromValue(f(this.value));
  13954. }
  13955. }
  13956. }
  13957. exports.Maybe = Maybe;
  13958. /***/ }),
  13959. /***/ "./js/util/outputTest.js":
  13960. /*!*******************************!*\
  13961. !*** ./js/util/outputTest.js ***!
  13962. \*******************************/
  13963. /*! exports provided: OutputTest */
  13964. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13965. "use strict";
  13966. __webpack_require__.r(__webpack_exports__);
  13967. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputTest", function() { return OutputTest; });
  13968. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  13969. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  13970. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  13971. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  13972. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
  13973. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
  13974. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
  13975. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  13976. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
  13977. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
  13978. /* harmony import */ var _io_output__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../io/output */ "./js/io/output.js");
  13979. 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); }; }
  13980. 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; } }
  13981. var OutputTest = /*#__PURE__*/function (_Output) {
  13982. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(OutputTest, _Output);
  13983. var _super = _createSuper(OutputTest);
  13984. function OutputTest() {
  13985. var _this;
  13986. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, OutputTest);
  13987. _this = _super.call(this);
  13988. _this.list = [];
  13989. _this.currentLine = null;
  13990. return _this;
  13991. }
  13992. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputTest, [{
  13993. key: "write",
  13994. value: function write(text) {
  13995. var newLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  13996. if (this.currentLine == null) {
  13997. this.currentLine = this.list.push('') - 1;
  13998. }
  13999. this.list[this.currentLine] += text;
  14000. if (newLine) {
  14001. this.currentLine = null;
  14002. }
  14003. }
  14004. }, {
  14005. key: "sendOutput",
  14006. value: function sendOutput(text) {
  14007. var _this2 = this;
  14008. var output = '' + text;
  14009. if (output.indexOf('\n') !== -1) {
  14010. var outputList = output.split('\n');
  14011. var last = outputList.pop();
  14012. outputList.forEach(function (t) {
  14013. t = t.replace(/\t/g, '&#x0020;&#x0020;');
  14014. t = t.replace(/\s/g, "&#x0020;");
  14015. if (t.length == 0) t = "&nbsp;";
  14016. _this2.write(t, true);
  14017. });
  14018. last = last.replace(/\t/g, '&#x0020;&#x0020;');
  14019. last = last.replace(/\s/g, "&#x0020;");
  14020. if (last.length != 0) this.write(last);
  14021. } else {
  14022. output = output.replace(/\t/g, '&#x0020;&#x0020;');
  14023. output = output.replace(/\s/g, "&#x0020;");
  14024. this.write(output);
  14025. }
  14026. }
  14027. }]);
  14028. return OutputTest;
  14029. }(_io_output__WEBPACK_IMPORTED_MODULE_5__["Output"]);
  14030. /***/ }),
  14031. /***/ "./js/util/string_diff.js":
  14032. /*!********************************!*\
  14033. !*** ./js/util/string_diff.js ***!
  14034. \********************************/
  14035. /*! exports provided: default */
  14036. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14037. "use strict";
  14038. __webpack_require__.r(__webpack_exports__);
  14039. /**
  14040. * Author: @jhchen - https://github.com/jhchen
  14041. * Modified by: @lucascalion - 23/07/2019
  14042. * This library modifies the diff-patch-match library by Neil Fraser
  14043. * by removing the patch and match functionality and certain advanced
  14044. * options in the diff function. The original license is as follows:
  14045. *
  14046. * ===
  14047. *
  14048. * Diff Match and Patch
  14049. *
  14050. * Copyright 2006 Google Inc.
  14051. * http://code.google.com/p/google-diff-match-patch/
  14052. *
  14053. * Licensed under the Apache License, Version 2.0 (the "License");
  14054. * you may not use this file except in compliance with the License.
  14055. * You may obtain a copy of the License at
  14056. *
  14057. * http://www.apache.org/licenses/LICENSE-2.0
  14058. *
  14059. * Unless required by applicable law or agreed to in writing, software
  14060. * distributed under the License is distributed on an "AS IS" BASIS,
  14061. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14062. * See the License for the specific language governing permissions and
  14063. * limitations under the License.
  14064. */
  14065. /**
  14066. * The data structure representing a diff is an array of tuples:
  14067. * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]
  14068. * which means: delete 'Hello', add 'Goodbye' and keep ' world.'
  14069. */
  14070. var DIFF_DELETE = -1;
  14071. var DIFF_INSERT = 1;
  14072. var DIFF_EQUAL = 0;
  14073. /**
  14074. * Find the differences between two texts. Simplifies the problem by stripping
  14075. * any common prefix or suffix off the texts before diffing.
  14076. * @param {string} text1 Old string to be diffed.
  14077. * @param {string} text2 New string to be diffed.
  14078. * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info
  14079. * @return {Array} Array of diff tuples.
  14080. */
  14081. function diff_main(text1, text2, cursor_pos, _fix_unicode) {
  14082. // Check for equality
  14083. if (text1 === text2) {
  14084. if (text1) {
  14085. return [[DIFF_EQUAL, text1]];
  14086. }
  14087. return [];
  14088. }
  14089. if (cursor_pos != null) {
  14090. var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);
  14091. if (editdiff) {
  14092. return editdiff;
  14093. }
  14094. } // Trim off common prefix (speedup).
  14095. var commonlength = diff_commonPrefix(text1, text2);
  14096. var commonprefix = text1.substring(0, commonlength);
  14097. text1 = text1.substring(commonlength);
  14098. text2 = text2.substring(commonlength); // Trim off common suffix (speedup).
  14099. commonlength = diff_commonSuffix(text1, text2);
  14100. var commonsuffix = text1.substring(text1.length - commonlength);
  14101. text1 = text1.substring(0, text1.length - commonlength);
  14102. text2 = text2.substring(0, text2.length - commonlength); // Compute the diff on the middle block.
  14103. var diffs = diff_compute_(text1, text2); // Restore the prefix and suffix.
  14104. if (commonprefix) {
  14105. diffs.unshift([DIFF_EQUAL, commonprefix]);
  14106. }
  14107. if (commonsuffix) {
  14108. diffs.push([DIFF_EQUAL, commonsuffix]);
  14109. }
  14110. diff_cleanupMerge(diffs, _fix_unicode);
  14111. return diffs;
  14112. }
  14113. /**
  14114. * Find the differences between two texts. Assumes that the texts do not
  14115. * have any common prefix or suffix.
  14116. * @param {string} text1 Old string to be diffed.
  14117. * @param {string} text2 New string to be diffed.
  14118. * @return {Array} Array of diff tuples.
  14119. */
  14120. function diff_compute_(text1, text2) {
  14121. var diffs;
  14122. if (!text1) {
  14123. // Just add some text (speedup).
  14124. return [[DIFF_INSERT, text2]];
  14125. }
  14126. if (!text2) {
  14127. // Just delete some text (speedup).
  14128. return [[DIFF_DELETE, text1]];
  14129. }
  14130. var longtext = text1.length > text2.length ? text1 : text2;
  14131. var shorttext = text1.length > text2.length ? text2 : text1;
  14132. var i = longtext.indexOf(shorttext);
  14133. if (i !== -1) {
  14134. // Shorter text is inside the longer text (speedup).
  14135. 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.
  14136. if (text1.length > text2.length) {
  14137. diffs[0][0] = diffs[2][0] = DIFF_DELETE;
  14138. }
  14139. return diffs;
  14140. }
  14141. if (shorttext.length === 1) {
  14142. // Single character string.
  14143. // After the previous speedup, the character can't be an equality.
  14144. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
  14145. } // Check to see if the problem can be split in two.
  14146. var hm = diff_halfMatch_(text1, text2);
  14147. if (hm) {
  14148. // A half-match was found, sort out the return data.
  14149. var text1_a = hm[0];
  14150. var text1_b = hm[1];
  14151. var text2_a = hm[2];
  14152. var text2_b = hm[3];
  14153. var mid_common = hm[4]; // Send both pairs off for separate processing.
  14154. var diffs_a = diff_main(text1_a, text2_a);
  14155. var diffs_b = diff_main(text1_b, text2_b); // Merge the results.
  14156. return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);
  14157. }
  14158. return diff_bisect_(text1, text2);
  14159. }
  14160. /**
  14161. * Find the 'middle snake' of a diff, split the problem in two
  14162. * and return the recursively constructed diff.
  14163. * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.
  14164. * @param {string} text1 Old string to be diffed.
  14165. * @param {string} text2 New string to be diffed.
  14166. * @return {Array} Array of diff tuples.
  14167. * @private
  14168. */
  14169. function diff_bisect_(text1, text2) {
  14170. // Cache the text lengths to prevent multiple calls.
  14171. var text1_length = text1.length;
  14172. var text2_length = text2.length;
  14173. var max_d = Math.ceil((text1_length + text2_length) / 2);
  14174. var v_offset = max_d;
  14175. var v_length = 2 * max_d;
  14176. var v1 = new Array(v_length);
  14177. var v2 = new Array(v_length); // Setting all elements to -1 is faster in Chrome & Firefox than mixing
  14178. // integers and undefined.
  14179. for (var x = 0; x < v_length; x++) {
  14180. v1[x] = -1;
  14181. v2[x] = -1;
  14182. }
  14183. v1[v_offset + 1] = 0;
  14184. v2[v_offset + 1] = 0;
  14185. var delta = text1_length - text2_length; // If the total number of characters is odd, then the front path will collide
  14186. // with the reverse path.
  14187. var front = delta % 2 !== 0; // Offsets for start and end of k loop.
  14188. // Prevents mapping of space beyond the grid.
  14189. var k1start = 0;
  14190. var k1end = 0;
  14191. var k2start = 0;
  14192. var k2end = 0;
  14193. for (var d = 0; d < max_d; d++) {
  14194. // Walk the front path one step.
  14195. for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {
  14196. var k1_offset = v_offset + k1;
  14197. var x1 = void 0;
  14198. if (k1 === -d || k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1]) {
  14199. x1 = v1[k1_offset + 1];
  14200. } else {
  14201. x1 = v1[k1_offset - 1] + 1;
  14202. }
  14203. var y1 = x1 - k1;
  14204. while (x1 < text1_length && y1 < text2_length && text1.charAt(x1) === text2.charAt(y1)) {
  14205. x1++;
  14206. y1++;
  14207. }
  14208. v1[k1_offset] = x1;
  14209. if (x1 > text1_length) {
  14210. // Ran off the right of the graph.
  14211. k1end += 2;
  14212. } else if (y1 > text2_length) {
  14213. // Ran off the bottom of the graph.
  14214. k1start += 2;
  14215. } else if (front) {
  14216. var k2_offset = v_offset + delta - k1;
  14217. if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {
  14218. // Mirror x2 onto top-left coordinate system.
  14219. var x2 = text1_length - v2[k2_offset];
  14220. if (x1 >= x2) {
  14221. // Overlap detfrontected.
  14222. return diff_bisectSplit_(text1, text2, x1, y1);
  14223. }
  14224. }
  14225. }
  14226. } // Walk the reverse path one step.
  14227. for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {
  14228. var _k2_offset = v_offset + k2;
  14229. var _x = void 0;
  14230. if (k2 === -d || k2 !== d && v2[_k2_offset - 1] < v2[_k2_offset + 1]) {
  14231. _x = v2[_k2_offset + 1];
  14232. } else {
  14233. _x = v2[_k2_offset - 1] + 1;
  14234. }
  14235. var y2 = _x - k2;
  14236. while (_x < text1_length && y2 < text2_length && text1.charAt(text1_length - _x - 1) === text2.charAt(text2_length - y2 - 1)) {
  14237. _x++;
  14238. y2++;
  14239. }
  14240. v2[_k2_offset] = _x;
  14241. if (_x > text1_length) {
  14242. // Ran off the left of the graph.
  14243. k2end += 2;
  14244. } else if (y2 > text2_length) {
  14245. // Ran off the top of the graph.
  14246. k2start += 2;
  14247. } else if (!front) {
  14248. var _k1_offset = v_offset + delta - k2;
  14249. if (_k1_offset >= 0 && _k1_offset < v_length && v1[_k1_offset] !== -1) {
  14250. var _x2 = v1[_k1_offset];
  14251. var _y = v_offset + _x2 - _k1_offset; // Mirror x2 onto top-left coordinate system.
  14252. _x = text1_length - _x;
  14253. if (_x2 >= _x) {
  14254. // Overlap detected.
  14255. return diff_bisectSplit_(text1, text2, _x2, _y);
  14256. }
  14257. }
  14258. }
  14259. }
  14260. } // Diff took too long and hit the deadline or
  14261. // number of diffs equals number of characters, no commonality at all.
  14262. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
  14263. }
  14264. /**
  14265. * Given the location of the 'middle snake', split the diff in two parts
  14266. * and recurse.
  14267. * @param {string} text1 Old string to be diffed.
  14268. * @param {string} text2 New string to be diffed.
  14269. * @param {number} x Index of split point in text1.
  14270. * @param {number} y Index of split point in text2.
  14271. * @return {Array} Array of diff tuples.
  14272. */
  14273. function diff_bisectSplit_(text1, text2, x, y) {
  14274. var text1a = text1.substring(0, x);
  14275. var text2a = text2.substring(0, y);
  14276. var text1b = text1.substring(x);
  14277. var text2b = text2.substring(y); // Compute both diffs serially.
  14278. var diffs = diff_main(text1a, text2a);
  14279. var diffsb = diff_main(text1b, text2b);
  14280. return diffs.concat(diffsb);
  14281. }
  14282. /**
  14283. * Determine the common prefix of two strings.
  14284. * @param {string} text1 First string.
  14285. * @param {string} text2 Second string.
  14286. * @return {number} The number of characters common to the start of each
  14287. * string.
  14288. */
  14289. function diff_commonPrefix(text1, text2) {
  14290. // Quick check for common null cases.
  14291. if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {
  14292. return 0;
  14293. } // Binary search.
  14294. // Performance analysis: http://neil.fraser.name/news/2007/10/09/
  14295. var pointermin = 0;
  14296. var pointermax = Math.min(text1.length, text2.length);
  14297. var pointermid = pointermax;
  14298. var pointerstart = 0;
  14299. while (pointermin < pointermid) {
  14300. if (text1.substring(pointerstart, pointermid) == text2.substring(pointerstart, pointermid)) {
  14301. pointermin = pointermid;
  14302. pointerstart = pointermin;
  14303. } else {
  14304. pointermax = pointermid;
  14305. }
  14306. pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
  14307. }
  14308. if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {
  14309. pointermid--;
  14310. }
  14311. return pointermid;
  14312. }
  14313. /**
  14314. * Determine the common suffix of two strings.
  14315. * @param {string} text1 First string.
  14316. * @param {string} text2 Second string.
  14317. * @return {number} The number of characters common to the end of each string.
  14318. */
  14319. function diff_commonSuffix(text1, text2) {
  14320. // Quick check for common null cases.
  14321. if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {
  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 pointerend = 0;
  14329. while (pointermin < pointermid) {
  14330. if (text1.substring(text1.length - pointermid, text1.length - pointerend) == text2.substring(text2.length - pointermid, text2.length - pointerend)) {
  14331. pointermin = pointermid;
  14332. pointerend = pointermin;
  14333. } else {
  14334. pointermax = pointermid;
  14335. }
  14336. pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
  14337. }
  14338. if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {
  14339. pointermid--;
  14340. }
  14341. return pointermid;
  14342. }
  14343. /**
  14344. * Do the two texts share a substring which is at least half the length of the
  14345. * longer text?
  14346. * This speedup can produce non-minimal diffs.
  14347. * @param {string} text1 First string.
  14348. * @param {string} text2 Second string.
  14349. * @return {Array.<string>} Five element Array, containing the prefix of
  14350. * text1, the suffix of text1, the prefix of text2, the suffix of
  14351. * text2 and the common middle. Or null if there was no match.
  14352. */
  14353. function diff_halfMatch_(text1, text2) {
  14354. var longtext = text1.length > text2.length ? text1 : text2;
  14355. var shorttext = text1.length > text2.length ? text2 : text1;
  14356. if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {
  14357. return null; // Pointless.
  14358. }
  14359. /**
  14360. * Does a substring of shorttext exist within longtext such that the substring
  14361. * is at least half the length of longtext?
  14362. * Closure, but does not reference any external variables.
  14363. * @param {string} longtext Longer string.
  14364. * @param {string} shorttext Shorter string.
  14365. * @param {number} i Start index of quarter length substring within longtext.
  14366. * @return {Array.<string>} Five element Array, containing the prefix of
  14367. * longtext, the suffix of longtext, the prefix of shorttext, the suffix
  14368. * of shorttext and the common middle. Or null if there was no match.
  14369. * @private
  14370. */
  14371. function diff_halfMatchI_(longtext, shorttext, i) {
  14372. // Start with a 1/4 length substring at position i as a seed.
  14373. var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));
  14374. var j = -1;
  14375. var best_common = '';
  14376. var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
  14377. while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {
  14378. var prefixLength = diff_commonPrefix(longtext.substring(i), shorttext.substring(j));
  14379. var suffixLength = diff_commonSuffix(longtext.substring(0, i), shorttext.substring(0, j));
  14380. if (best_common.length < suffixLength + prefixLength) {
  14381. best_common = shorttext.substring(j - suffixLength, j) + shorttext.substring(j, j + prefixLength);
  14382. best_longtext_a = longtext.substring(0, i - suffixLength);
  14383. best_longtext_b = longtext.substring(i + prefixLength);
  14384. best_shorttext_a = shorttext.substring(0, j - suffixLength);
  14385. best_shorttext_b = shorttext.substring(j + prefixLength);
  14386. }
  14387. }
  14388. if (best_common.length * 2 >= longtext.length) {
  14389. return [best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b, best_common];
  14390. } else {
  14391. return null;
  14392. }
  14393. } // First check if the second quarter is the seed for a half-match.
  14394. var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4)); // Check again based on the third quarter.
  14395. var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));
  14396. var hm;
  14397. if (!hm1 && !hm2) {
  14398. return null;
  14399. } else if (!hm2) {
  14400. hm = hm1;
  14401. } else if (!hm1) {
  14402. hm = hm2;
  14403. } else {
  14404. // Both matched. Select the longest.
  14405. hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
  14406. } // A half-match was found, sort out the return data.
  14407. var text1_a, text1_b, text2_a, text2_b;
  14408. if (text1.length > text2.length) {
  14409. text1_a = hm[0];
  14410. text1_b = hm[1];
  14411. text2_a = hm[2];
  14412. text2_b = hm[3];
  14413. } else {
  14414. text2_a = hm[0];
  14415. text2_b = hm[1];
  14416. text1_a = hm[2];
  14417. text1_b = hm[3];
  14418. }
  14419. var mid_common = hm[4];
  14420. return [text1_a, text1_b, text2_a, text2_b, mid_common];
  14421. }
  14422. /**
  14423. * Reorder and merge like edit sections. Merge equalities.
  14424. * Any edit section can move as long as it doesn't cross an equality.
  14425. * @param {Array} diffs Array of diff tuples.
  14426. * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff
  14427. */
  14428. function diff_cleanupMerge(diffs, fix_unicode) {
  14429. diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.
  14430. var pointer = 0;
  14431. var count_delete = 0;
  14432. var count_insert = 0;
  14433. var text_delete = '';
  14434. var text_insert = '';
  14435. var commonlength;
  14436. var previous_equality;
  14437. while (pointer < diffs.length) {
  14438. if (pointer < diffs.length - 1 && !diffs[pointer][1]) {
  14439. diffs.splice(pointer, 1);
  14440. continue;
  14441. }
  14442. switch (diffs[pointer][0]) {
  14443. case DIFF_INSERT:
  14444. count_insert++;
  14445. text_insert += diffs[pointer][1];
  14446. pointer++;
  14447. break;
  14448. case DIFF_DELETE:
  14449. count_delete++;
  14450. text_delete += diffs[pointer][1];
  14451. pointer++;
  14452. break;
  14453. case DIFF_EQUAL:
  14454. previous_equality = pointer - count_insert - count_delete - 1;
  14455. if (fix_unicode) {
  14456. // prevent splitting of unicode surrogate pairs. when fix_unicode is true,
  14457. // we assume that the old and new text in the diff are complete and correct
  14458. // unicode-encoded JS strings, but the tuple boundaries may fall between
  14459. // surrogate pairs. we fix this by shaving off stray surrogates from the end
  14460. // of the previous equality and the beginning of this equality. this may create
  14461. // empty equalities or a common prefix or suffix. for example, if AB and AC are
  14462. // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and
  14463. // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this
  14464. // particular case, both equalities go away, we absorb any previous inequalities,
  14465. // and we keep scanning for the next equality before rewriting the tuples.
  14466. if (previous_equality >= 0 && ends_with_pair_start(diffs[previous_equality][1])) {
  14467. var stray = diffs[previous_equality][1].slice(-1);
  14468. diffs[previous_equality][1] = diffs[previous_equality][1].slice(0, -1);
  14469. text_delete = stray + text_delete;
  14470. text_insert = stray + text_insert;
  14471. if (!diffs[previous_equality][1]) {
  14472. // emptied out previous equality, so delete it and include previous delete/insert
  14473. diffs.splice(previous_equality, 1);
  14474. pointer--;
  14475. var k = previous_equality - 1;
  14476. if (diffs[k] && diffs[k][0] === DIFF_INSERT) {
  14477. count_insert++;
  14478. text_insert = diffs[k][1] + text_insert;
  14479. k--;
  14480. }
  14481. if (diffs[k] && diffs[k][0] === DIFF_DELETE) {
  14482. count_delete++;
  14483. text_delete = diffs[k][1] + text_delete;
  14484. k--;
  14485. }
  14486. previous_equality = k;
  14487. }
  14488. }
  14489. if (starts_with_pair_end(diffs[pointer][1])) {
  14490. var _stray = diffs[pointer][1].charAt(0);
  14491. diffs[pointer][1] = diffs[pointer][1].slice(1);
  14492. text_delete += _stray;
  14493. text_insert += _stray;
  14494. }
  14495. }
  14496. if (pointer < diffs.length - 1 && !diffs[pointer][1]) {
  14497. // for empty equality not at end, wait for next equality
  14498. diffs.splice(pointer, 1);
  14499. break;
  14500. }
  14501. if (text_delete.length > 0 || text_insert.length > 0) {
  14502. // note that diff_commonPrefix and diff_commonSuffix are unicode-aware
  14503. if (text_delete.length > 0 && text_insert.length > 0) {
  14504. // Factor out any common prefixes.
  14505. commonlength = diff_commonPrefix(text_insert, text_delete);
  14506. if (commonlength !== 0) {
  14507. if (previous_equality >= 0) {
  14508. diffs[previous_equality][1] += text_insert.substring(0, commonlength);
  14509. } else {
  14510. diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]);
  14511. pointer++;
  14512. }
  14513. text_insert = text_insert.substring(commonlength);
  14514. text_delete = text_delete.substring(commonlength);
  14515. } // Factor out any common suffixes.
  14516. commonlength = diff_commonSuffix(text_insert, text_delete);
  14517. if (commonlength !== 0) {
  14518. diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];
  14519. text_insert = text_insert.substring(0, text_insert.length - commonlength);
  14520. text_delete = text_delete.substring(0, text_delete.length - commonlength);
  14521. }
  14522. } // Delete the offending records and add the merged ones.
  14523. var n = count_insert + count_delete;
  14524. if (text_delete.length === 0 && text_insert.length === 0) {
  14525. diffs.splice(pointer - n, n);
  14526. pointer = pointer - n;
  14527. } else if (text_delete.length === 0) {
  14528. diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);
  14529. pointer = pointer - n + 1;
  14530. } else if (text_insert.length === 0) {
  14531. diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);
  14532. pointer = pointer - n + 1;
  14533. } else {
  14534. diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]);
  14535. pointer = pointer - n + 2;
  14536. }
  14537. }
  14538. if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {
  14539. // Merge this equality with the previous one.
  14540. diffs[pointer - 1][1] += diffs[pointer][1];
  14541. diffs.splice(pointer, 1);
  14542. } else {
  14543. pointer++;
  14544. }
  14545. count_insert = 0;
  14546. count_delete = 0;
  14547. text_delete = '';
  14548. text_insert = '';
  14549. break;
  14550. }
  14551. }
  14552. if (diffs[diffs.length - 1][1] === '') {
  14553. diffs.pop(); // Remove the dummy entry at the end.
  14554. } // Second pass: look for single edits surrounded on both sides by equalities
  14555. // which can be shifted sideways to eliminate an equality.
  14556. // e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC
  14557. var changes = false;
  14558. pointer = 1; // Intentionally ignore the first and last element (don't need checking).
  14559. while (pointer < diffs.length - 1) {
  14560. if (diffs[pointer - 1][0] === DIFF_EQUAL && diffs[pointer + 1][0] === DIFF_EQUAL) {
  14561. // This is a single edit surrounded by equalities.
  14562. if (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {
  14563. // Shift the edit over the previous equality.
  14564. diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length);
  14565. diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
  14566. diffs.splice(pointer - 1, 1);
  14567. changes = true;
  14568. } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == diffs[pointer + 1][1]) {
  14569. // Shift the edit over the next equality.
  14570. diffs[pointer - 1][1] += diffs[pointer + 1][1];
  14571. diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1];
  14572. diffs.splice(pointer + 1, 1);
  14573. changes = true;
  14574. }
  14575. }
  14576. pointer++;
  14577. } // If shifts were made, the diff needs reordering and another shift sweep.
  14578. if (changes) {
  14579. diff_cleanupMerge(diffs, fix_unicode);
  14580. }
  14581. }
  14582. function is_surrogate_pair_start(charCode) {
  14583. return charCode >= 0xD800 && charCode <= 0xDBFF;
  14584. }
  14585. function is_surrogate_pair_end(charCode) {
  14586. return charCode >= 0xDC00 && charCode <= 0xDFFF;
  14587. }
  14588. function starts_with_pair_end(str) {
  14589. return is_surrogate_pair_end(str.charCodeAt(0));
  14590. }
  14591. function ends_with_pair_start(str) {
  14592. return is_surrogate_pair_start(str.charCodeAt(str.length - 1));
  14593. }
  14594. function remove_empty_tuples(tuples) {
  14595. var ret = [];
  14596. for (var i = 0; i < tuples.length; i++) {
  14597. if (tuples[i][1].length > 0) {
  14598. ret.push(tuples[i]);
  14599. }
  14600. }
  14601. return ret;
  14602. }
  14603. function make_edit_splice(before, oldMiddle, newMiddle, after) {
  14604. if (ends_with_pair_start(before) || starts_with_pair_end(after)) {
  14605. return null;
  14606. }
  14607. return remove_empty_tuples([[DIFF_EQUAL, before], [DIFF_DELETE, oldMiddle], [DIFF_INSERT, newMiddle], [DIFF_EQUAL, after]]);
  14608. }
  14609. function find_cursor_edit_diff(oldText, newText, cursor_pos) {
  14610. // note: this runs after equality check has ruled out exact equality
  14611. var oldRange = typeof cursor_pos === 'number' ? {
  14612. index: cursor_pos,
  14613. length: 0
  14614. } : cursor_pos.oldRange;
  14615. var newRange = typeof cursor_pos === 'number' ? null : cursor_pos.newRange; // take into account the old and new selection to generate the best diff
  14616. // possible for a text edit. for example, a text change from "xxx" to "xx"
  14617. // could be a delete or forwards-delete of any one of the x's, or the
  14618. // result of selecting two of the x's and typing "x".
  14619. var oldLength = oldText.length;
  14620. var newLength = newText.length;
  14621. if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {
  14622. // see if we have an insert or delete before or after cursor
  14623. var oldCursor = oldRange.index;
  14624. var oldBefore = oldText.slice(0, oldCursor);
  14625. var oldAfter = oldText.slice(oldCursor);
  14626. var maybeNewCursor = newRange ? newRange.index : null;
  14627. editBefore: {
  14628. // is this an insert or delete right before oldCursor?
  14629. var newCursor = oldCursor + newLength - oldLength;
  14630. if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {
  14631. break editBefore;
  14632. }
  14633. if (newCursor < 0 || newCursor > newLength) {
  14634. break editBefore;
  14635. }
  14636. var newBefore = newText.slice(0, newCursor);
  14637. var newAfter = newText.slice(newCursor);
  14638. if (newAfter !== oldAfter) {
  14639. break editBefore;
  14640. }
  14641. var prefixLength = Math.min(oldCursor, newCursor);
  14642. var oldPrefix = oldBefore.slice(0, prefixLength);
  14643. var newPrefix = newBefore.slice(0, prefixLength);
  14644. if (oldPrefix !== newPrefix) {
  14645. break editBefore;
  14646. }
  14647. var oldMiddle = oldBefore.slice(prefixLength);
  14648. var newMiddle = newBefore.slice(prefixLength);
  14649. return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);
  14650. }
  14651. editAfter: {
  14652. // is this an insert or delete right after oldCursor?
  14653. if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {
  14654. break editAfter;
  14655. }
  14656. var cursor = oldCursor;
  14657. var _newBefore = newText.slice(0, cursor);
  14658. var _newAfter = newText.slice(cursor);
  14659. if (_newBefore !== oldBefore) {
  14660. break editAfter;
  14661. }
  14662. var suffixLength = Math.min(oldLength - cursor, newLength - cursor);
  14663. var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);
  14664. var newSuffix = _newAfter.slice(_newAfter.length - suffixLength);
  14665. if (oldSuffix !== newSuffix) {
  14666. break editAfter;
  14667. }
  14668. var _oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);
  14669. var _newMiddle = _newAfter.slice(0, _newAfter.length - suffixLength);
  14670. return make_edit_splice(oldBefore, _oldMiddle, _newMiddle, oldSuffix);
  14671. }
  14672. }
  14673. if (oldRange.length > 0 && newRange && newRange.length === 0) {
  14674. replaceRange: {
  14675. // see if diff could be a splice of the old selection range
  14676. var _oldPrefix = oldText.slice(0, oldRange.index);
  14677. var _oldSuffix = oldText.slice(oldRange.index + oldRange.length);
  14678. var _prefixLength = _oldPrefix.length;
  14679. var _suffixLength = _oldSuffix.length;
  14680. if (newLength < _prefixLength + _suffixLength) {
  14681. break replaceRange;
  14682. }
  14683. var _newPrefix = newText.slice(0, _prefixLength);
  14684. var _newSuffix = newText.slice(newLength - _suffixLength);
  14685. if (_oldPrefix !== _newPrefix || _oldSuffix !== _newSuffix) {
  14686. break replaceRange;
  14687. }
  14688. var _oldMiddle2 = oldText.slice(_prefixLength, oldLength - _suffixLength);
  14689. var _newMiddle2 = newText.slice(_prefixLength, newLength - _suffixLength);
  14690. return make_edit_splice(_oldPrefix, _oldMiddle2, _newMiddle2, _oldSuffix);
  14691. }
  14692. }
  14693. return null;
  14694. }
  14695. function diff(text1, text2, cursor_pos) {
  14696. // only pass fix_unicode=true at the top level, not when diff_main is
  14697. // recursively invoked
  14698. return diff_main(text1, text2, cursor_pos, true);
  14699. }
  14700. diff.INSERT = DIFF_INSERT;
  14701. diff.DELETE = DIFF_DELETE;
  14702. diff.EQUAL = DIFF_EQUAL;
  14703. /* harmony default export */ __webpack_exports__["default"] = (diff);
  14704. /***/ }),
  14705. /***/ "./js/util/testConsole.js":
  14706. /*!********************************!*\
  14707. !*** ./js/util/testConsole.js ***!
  14708. \********************************/
  14709. /*! exports provided: TestConsole */
  14710. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14711. "use strict";
  14712. __webpack_require__.r(__webpack_exports__);
  14713. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TestConsole", function() { return TestConsole; });
  14714. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  14715. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
  14716. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  14717. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
  14718. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../io/domConsole */ "./js/io/domConsole.js");
  14719. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  14720. var LocalizedStrings = Object(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["getInstance"])();
  14721. var TestConsole = /*#__PURE__*/function () {
  14722. function TestConsole(inputList) {
  14723. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, TestConsole);
  14724. this.index = 0;
  14725. this.inputList = inputList;
  14726. this.list = [];
  14727. this.currentLine = null;
  14728. }
  14729. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(TestConsole, [{
  14730. key: "write",
  14731. value: function write(text) {
  14732. var newLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  14733. this._appendText(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].USER, newLine);
  14734. }
  14735. }, {
  14736. key: "info",
  14737. value: function info(text) {
  14738. this._appendTextLn(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].INFO);
  14739. }
  14740. }, {
  14741. key: "err",
  14742. value: function err(text) {
  14743. this._appendTextLn(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].ERR);
  14744. }
  14745. }, {
  14746. key: "_appendText",
  14747. value: function _appendText(text, type) {
  14748. var newLine = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  14749. if (this.currentLine == null) {
  14750. this.currentLine = this.list.push('') - 1;
  14751. }
  14752. this.list[this.currentLine] += text;
  14753. if (newLine) {
  14754. this.currentLine = null;
  14755. }
  14756. }
  14757. }, {
  14758. key: "_appendTextLn",
  14759. value: function _appendTextLn(text) {
  14760. this.list.push(text);
  14761. this.currentLine = null;
  14762. }
  14763. }, {
  14764. key: "getClassForType",
  14765. value: function getClassForType(type) {
  14766. switch (type) {
  14767. case _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].USER:
  14768. return "ivprog-term-userText";
  14769. case _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].INFO:
  14770. return "ivprog-term-info";
  14771. case _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].ERR:
  14772. return "ivprog-term-error";
  14773. }
  14774. }
  14775. }, {
  14776. key: "requestInput",
  14777. value: function requestInput() {
  14778. var _this = this;
  14779. var promise = new Promise(function (resolve, reject) {
  14780. if (_this.index < _this.inputList.length) {
  14781. resolve(_this.inputList[_this.index]);
  14782. _this.index++;
  14783. } else {
  14784. reject(new Error(LocalizedStrings.getError("exceeded_input_request")));
  14785. }
  14786. });
  14787. return promise;
  14788. }
  14789. }, {
  14790. key: "sendOutput",
  14791. value: function sendOutput(text) {
  14792. var _this2 = this;
  14793. var output = '' + text;
  14794. if (output.indexOf('\n') !== -1) {
  14795. var outputList = output.split('\n');
  14796. var last = outputList.pop();
  14797. outputList.forEach(function (t) {
  14798. t = t.replace(/\t/g, '&#x0020;&#x0020;');
  14799. t = t.replace(/\s/g, "&#x0020;");
  14800. if (t.length == 0) t = "&nbsp;";
  14801. _this2.write(t, true);
  14802. });
  14803. last = last.replace(/\t/g, '&#x0020;&#x0020;');
  14804. last = last.replace(/\s/g, "&#x0020;");
  14805. if (last.length != 0) this.write(last);
  14806. } else {
  14807. output = output.replace(/\t/g, '&#x0020;&#x0020;');
  14808. output = output.replace(/\s/g, "&#x0020;");
  14809. this.write(output);
  14810. }
  14811. }
  14812. }]);
  14813. return TestConsole;
  14814. }();
  14815. /***/ }),
  14816. /***/ "./js/util/utils.js":
  14817. /*!**************************!*\
  14818. !*** ./js/util/utils.js ***!
  14819. \**************************/
  14820. /*! exports provided: scrollIt, isElementInViewport, isKeyword, isValidIdentifier, getCodeEditorModeConfig, levenshteinDistance, openAssessmentDetail, range, sleep */
  14821. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14822. "use strict";
  14823. __webpack_require__.r(__webpack_exports__);
  14824. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollIt", function() { return scrollIt; });
  14825. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isElementInViewport", function() { return isElementInViewport; });
  14826. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isKeyword", function() { return isKeyword; });
  14827. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidIdentifier", function() { return isValidIdentifier; });
  14828. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCodeEditorModeConfig", function() { return getCodeEditorModeConfig; });
  14829. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "levenshteinDistance", function() { return levenshteinDistance; });
  14830. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "openAssessmentDetail", function() { return openAssessmentDetail; });
  14831. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return range; });
  14832. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sleep", function() { return sleep; });
  14833. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
  14834. /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
  14835. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
  14836. /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
  14837. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
  14838. /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__);
  14839. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../services/languageService */ "./js/services/languageService.js");
  14840. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  14841. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.ts");
  14842. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_ast_operators__WEBPACK_IMPORTED_MODULE_5__);
  14843. /**
  14844. * source: https://pawelgrzybek.com/page-scroll-in-vanilla-javascript/
  14845. *
  14846. */
  14847. function scrollIt(destination) {
  14848. var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
  14849. var easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'linear';
  14850. var callback = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  14851. var easings = {
  14852. linear: function linear(t) {
  14853. return t;
  14854. },
  14855. easeInQuad: function easeInQuad(t) {
  14856. return t * t;
  14857. },
  14858. easeOutQuad: function easeOutQuad(t) {
  14859. return t * (2 - t);
  14860. },
  14861. easeInOutQuad: function easeInOutQuad(t) {
  14862. return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
  14863. },
  14864. easeInCubic: function easeInCubic(t) {
  14865. return t * t * t;
  14866. },
  14867. easeOutCubic: function easeOutCubic(t) {
  14868. return --t * t * t + 1;
  14869. },
  14870. easeInOutCubic: function easeInOutCubic(t) {
  14871. return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
  14872. },
  14873. easeInQuart: function easeInQuart(t) {
  14874. return t * t * t * t;
  14875. },
  14876. easeOutQuart: function easeOutQuart(t) {
  14877. return 1 - --t * t * t * t;
  14878. },
  14879. easeInOutQuart: function easeInOutQuart(t) {
  14880. return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
  14881. },
  14882. easeInQuint: function easeInQuint(t) {
  14883. return t * t * t * t * t;
  14884. },
  14885. easeOutQuint: function easeOutQuint(t) {
  14886. return 1 + --t * t * t * t * t;
  14887. },
  14888. easeInOutQuint: function easeInOutQuint(t) {
  14889. return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;
  14890. }
  14891. };
  14892. var start = window.pageYOffset;
  14893. var startTime = 'now' in window.performance ? performance.now() : new Date().getTime();
  14894. var documentHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);
  14895. var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;
  14896. var destinationOffset = typeof destination === 'number' ? destination : destination.offsetTop;
  14897. var destinationOffsetToScroll = Math.round(documentHeight - destinationOffset < windowHeight ? documentHeight - windowHeight : destinationOffset);
  14898. if ('requestAnimationFrame' in window === false) {
  14899. window.scroll(0, destinationOffsetToScroll);
  14900. if (callback) {
  14901. callback();
  14902. }
  14903. return;
  14904. }
  14905. function scroll() {
  14906. var now = 'now' in window.performance ? performance.now() : new Date().getTime();
  14907. var time = Math.min(1, (now - startTime) / duration);
  14908. var timeFunction = easings[easing](time);
  14909. window.scroll(0, Math.ceil(timeFunction * (destinationOffsetToScroll - start) + start));
  14910. if (window.pageYOffset === destinationOffsetToScroll) {
  14911. if (callback) {
  14912. callback();
  14913. }
  14914. return;
  14915. }
  14916. requestAnimationFrame(scroll);
  14917. }
  14918. scroll();
  14919. }
  14920. /**
  14921. *
  14922. * source: https://stackoverflow.com/a/16270434
  14923. */
  14924. function isElementInViewport(el) {
  14925. var rect = el.getBoundingClientRect();
  14926. return rect.bottom > 0 && rect.right > 0 && rect.left < (window.innerWidth || document.documentElement.clientWidth) && rect.top < (window.innerHeight || document.documentElement.clientHeight);
  14927. }
  14928. var cacheMainList = null;
  14929. var cacheOp = null;
  14930. function fillCache() {
  14931. if (cacheMainList == null) {
  14932. cacheMainList = [];
  14933. 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"];
  14934. var lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_3__["LanguageService"].getCurrentLexer();
  14935. var nullLexer = new lexerClass();
  14936. for (var key = 0; key < mainList.length; ++key) {
  14937. var word = mainList[key];
  14938. var keyword = nullLexer.literalNames[lexerClass[word]];
  14939. cacheMainList.push(keyword.substring(1, keyword.length - 1));
  14940. }
  14941. }
  14942. if (cacheOp == null) {
  14943. cacheOp = [];
  14944. 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];
  14945. for (var op = 0; op < logicOpList.length; ++op) {
  14946. var lOp = "logic_operator_".concat(logicOpList[op]);
  14947. cacheOp.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI(lOp));
  14948. }
  14949. }
  14950. }
  14951. function isKeyword(text) {
  14952. fillCache();
  14953. for (var key = 0; key < cacheMainList.length; ++key) {
  14954. var keyword = cacheMainList[key];
  14955. if (keyword == text) {
  14956. return true;
  14957. }
  14958. } // not in main list, check op
  14959. for (var op = 0; op < cacheOp.length; op++) {
  14960. var lOp = cacheOp[op];
  14961. if (lOp == text) {
  14962. return true;
  14963. }
  14964. }
  14965. return false;
  14966. }
  14967. function isValidIdentifier(identifier_str) {
  14968. var validRegex = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier_str);
  14969. if (!validRegex) {
  14970. return false;
  14971. }
  14972. return !isKeyword(identifier_str);
  14973. }
  14974. function getCodeEditorModeConfig() {
  14975. 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"];
  14976. var keywordsList = ["RK_CONST", "RK_RETURN", "RK_BREAK", "RK_FOR_FROM", "RK_FOR_TO", "RK_FOR_PASS", "RK_DO_UNTIL"];
  14977. var typeList = ["RK_REAL", "RK_VOID", "RK_BOOLEAN", "RK_STRING", "RK_INTEGER", "RK_CHARACTER"];
  14978. var atomList = ["RK_FALSE", "RK_TRUE"];
  14979. var case_default = [];
  14980. var blocks = [];
  14981. var keywords = [];
  14982. var types = [];
  14983. var atoms = [];
  14984. var switchString = "";
  14985. cacheMainList = [];
  14986. var lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_3__["LanguageService"].getCurrentLexer();
  14987. var nullLexer = new lexerClass();
  14988. blockList.forEach(function (v) {
  14989. var keyword = nullLexer.literalNames[lexerClass[v]];
  14990. var value = keyword.substring(1, keyword.length - 1);
  14991. cacheMainList.push(value);
  14992. keywords.push(value);
  14993. blocks.push(value);
  14994. if (v == "RK_SWITCH") {
  14995. switchString = value;
  14996. } else if (v == "RK_CASE" || v == "RK_DEFAULT") {
  14997. case_default.push(value);
  14998. }
  14999. });
  15000. keywordsList.forEach(function (v) {
  15001. var keyword = nullLexer.literalNames[lexerClass[v]];
  15002. var value = keyword.substring(1, keyword.length - 1);
  15003. cacheMainList.push(value);
  15004. keywords.push(value);
  15005. });
  15006. typeList.forEach(function (v) {
  15007. var keyword = nullLexer.literalNames[lexerClass[v]];
  15008. var value = keyword.substring(1, keyword.length - 1);
  15009. cacheMainList.push(value);
  15010. types.push(value);
  15011. });
  15012. atomList.forEach(function (v) {
  15013. var keyword = nullLexer.literalNames[lexerClass[v]];
  15014. var value = keyword.substring(1, keyword.length - 1);
  15015. cacheMainList.push(value);
  15016. atoms.push(value);
  15017. });
  15018. cacheOp = [];
  15019. 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];
  15020. for (var op = 0; op < logicOpList.length; ++op) {
  15021. var lOp = "logic_operator_".concat(logicOpList[op]);
  15022. var value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI(lOp);
  15023. cacheOp.push(value);
  15024. keywords.push(value);
  15025. }
  15026. return {
  15027. case_default: case_default,
  15028. atoms: atoms,
  15029. keywords: keywords,
  15030. switchString: switchString,
  15031. types: types,
  15032. blocks: blocks
  15033. };
  15034. }
  15035. /**
  15036. * Source: https://gist.github.com/andrei-m/982927
  15037. * @param {string} a
  15038. * @param {string} b
  15039. */
  15040. function levenshteinDistance(a, b) {
  15041. if (a.length == 0) return b.length;
  15042. if (b.length == 0) return a.length;
  15043. var matrix = []; // increment along the first column of each row
  15044. var i;
  15045. for (i = 0; i <= b.length; i++) {
  15046. matrix[i] = [i];
  15047. } // increment each column in the first row
  15048. var j;
  15049. for (j = 0; j <= a.length; j++) {
  15050. matrix[0][j] = j;
  15051. } // Fill in the rest of the matrix
  15052. for (i = 1; i <= b.length; i++) {
  15053. for (j = 1; j <= a.length; j++) {
  15054. if (b.charCodeAt(i - 1) == a.charCodeAt(j - 1)) {
  15055. matrix[i][j] = matrix[i - 1][j - 1];
  15056. } else {
  15057. matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution
  15058. Math.min(matrix[i][j - 1] + 1, // insertion
  15059. matrix[i - 1][j] + 1)); // deletion
  15060. }
  15061. }
  15062. }
  15063. return matrix[b.length][a.length];
  15064. }
  15065. var win = null;
  15066. function openAssessmentDetail(event) {
  15067. event.preventDefault();
  15068. var page_code = event.currentTarget.dataset.page;
  15069. if (win != null) {
  15070. win.close();
  15071. }
  15072. win = window.open("", "DetailWindow", "width=550,height=600");
  15073. win.document.open();
  15074. win.document.write(page_code);
  15075. win.document.close();
  15076. }
  15077. function range(size) {
  15078. var startAt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  15079. return _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(Array(size).keys()).map(function (i) {
  15080. return i + startAt;
  15081. });
  15082. }
  15083. /**
  15084. *
  15085. * @param {number} ms
  15086. */
  15087. function sleep(_x) {
  15088. return _sleep.apply(this, arguments);
  15089. }
  15090. function _sleep() {
  15091. _sleep = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(ms) {
  15092. return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
  15093. while (1) {
  15094. switch (_context.prev = _context.next) {
  15095. case 0:
  15096. return _context.abrupt("return", new Promise(function (res, _) {
  15097. return setTimeout(res, ms);
  15098. }));
  15099. case 1:
  15100. case "end":
  15101. return _context.stop();
  15102. }
  15103. }
  15104. }, _callee);
  15105. }));
  15106. return _sleep.apply(this, arguments);
  15107. }
  15108. /***/ }),
  15109. /***/ "./js/visualUI/algorithm.js":
  15110. /*!**********************************!*\
  15111. !*** ./js/visualUI/algorithm.js ***!
  15112. \**********************************/
  15113. /*! exports provided: renderAlgorithm */
  15114. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15115. "use strict";
  15116. __webpack_require__.r(__webpack_exports__);
  15117. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderAlgorithm", function() { return renderAlgorithm; });
  15118. /* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./globals */ "./js/visualUI/globals.js");
  15119. /* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functions */ "./js/visualUI/functions.js");
  15120. window.block_render = false;
  15121. function renderAlgorithm() {
  15122. if (window.block_render) {
  15123. return;
  15124. }
  15125. if (window.draging) {
  15126. return;
  15127. }
  15128. window.block_render = true;
  15129. console.log('rendering algorithm');
  15130. $('.all_functions').children().off();
  15131. $('.all_functions').empty();
  15132. $('.list_globals').children().off();
  15133. $('.list_globals').empty();
  15134. for (var i = 0; i < window.program_obj.functions.length; i++) {
  15135. _functions__WEBPACK_IMPORTED_MODULE_1__["renderFunction"](window.program_obj.functions[i]);
  15136. }
  15137. for (var i = 0; i < window.program_obj.globals.length; i++) {
  15138. _globals__WEBPACK_IMPORTED_MODULE_0__["renderGlobal"](window.program_obj.globals[i]);
  15139. }
  15140. setTimeout(function () {
  15141. window.block_render = false;
  15142. }, 100);
  15143. console.log('fim do render');
  15144. if (settingsFilter && settingsFilter[0]) {
  15145. blockAllEditingOptions();
  15146. }
  15147. }
  15148. /***/ }),
  15149. /***/ "./js/visualUI/code_generator.js":
  15150. /*!***************************************!*\
  15151. !*** ./js/visualUI/code_generator.js ***!
  15152. \***************************************/
  15153. /*! exports provided: generate */
  15154. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15155. "use strict";
  15156. __webpack_require__.r(__webpack_exports__);
  15157. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return generate; });
  15158. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  15159. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  15160. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  15161. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  15162. /* eslint-disable @typescript-eslint/no-use-before-define */
  15163. /* globals $*/
  15164. function generate() {
  15165. $(".ivprog_visual_panel").find(".error_icon").remove();
  15166. var code = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("program") + " { ";
  15167. code += globalsCode();
  15168. code += "\n";
  15169. var has_error = false;
  15170. for (var i = 0; i < window.program_obj.functions.length; i++) {
  15171. var n_code = functionsCode(window.program_obj.functions[i]);
  15172. if (n_code == null) {
  15173. has_error = true;
  15174. }
  15175. code += n_code;
  15176. code += "\n";
  15177. }
  15178. code += "\n}";
  15179. if (has_error) {
  15180. return null;
  15181. } else {
  15182. return code;
  15183. }
  15184. }
  15185. function functionsCode(function_obj) {
  15186. var ret = "\n\t" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("function") + " ";
  15187. var has_error = false;
  15188. switch (function_obj.return_type) {
  15189. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15190. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer");
  15191. break;
  15192. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15193. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real");
  15194. break;
  15195. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15196. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text");
  15197. break;
  15198. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15199. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean");
  15200. break;
  15201. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15202. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char");
  15203. break;
  15204. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID:
  15205. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_void");
  15206. break;
  15207. }
  15208. ret += " ";
  15209. if (function_obj.return_dimensions == 1) {
  15210. ret += "[] ";
  15211. } else if (function_obj.return_dimensions == 2) {
  15212. ret += "[][] ";
  15213. }
  15214. ret += function_obj.name + " ( ";
  15215. for (var j = 0; j < function_obj.parameters_list.length; j++) {
  15216. ret += parametersCode(function_obj.parameters_list[j]);
  15217. if (j + 1 < function_obj.parameters_list.length) {
  15218. ret += ", ";
  15219. }
  15220. }
  15221. ret += " ) {";
  15222. for (var _j = 0; _j < function_obj.variables_list.length; _j++) {
  15223. ret += variablesCode(function_obj.variables_list[_j]);
  15224. }
  15225. for (var _j2 = 0; _j2 < function_obj.commands.length; _j2++) {
  15226. //try {
  15227. ret += commandsCode(function_obj.commands[_j2]);
  15228. /*} catch (err) {
  15229. has_error = true;
  15230. console.error(err.message);
  15231. var todos = $('body').find('.command_container');
  15232. for (var i = 0; i < todos.length; i++) {
  15233. if ($(todos[i]).data('command') == function_obj.commands[j]) {
  15234. $( todos[i] ).prepend( ' <i class="ui icon red exclamation triangle error_icon"></i> ' );
  15235. break;
  15236. }
  15237. }
  15238. }*/
  15239. }
  15240. ret += "\n\t}";
  15241. if (has_error) {
  15242. return null;
  15243. } else {
  15244. return ret;
  15245. }
  15246. }
  15247. function commandsCode(command_obj) {
  15248. var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  15249. switch (command_obj.type) {
  15250. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["break"]:
  15251. return breaksCode(command_obj, indentation);
  15252. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].comment:
  15253. return commentsCode(command_obj, indentation);
  15254. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].reader:
  15255. return readersCode(command_obj, indentation);
  15256. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].writer:
  15257. return writersCode(command_obj, indentation);
  15258. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].functioncall:
  15259. return functioncallsCode(command_obj, indentation);
  15260. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].attribution:
  15261. return attributionsCode(command_obj, indentation);
  15262. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].whiletrue:
  15263. return whiletruesCode(command_obj, indentation);
  15264. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].dowhiletrue:
  15265. return doWhilesCode(command_obj, indentation);
  15266. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].iftrue:
  15267. return iftruesCode(command_obj, indentation);
  15268. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].repeatNtimes:
  15269. return repeatNtimesCode(command_obj, indentation);
  15270. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["switch"]:
  15271. return switchsCode(command_obj, indentation);
  15272. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["return"]:
  15273. return returnsCode(command_obj, indentation);
  15274. }
  15275. }
  15276. function returnsCode(command_obj, indentation) {
  15277. var ret = "\n";
  15278. for (var i = 0; i < indentation; i++) {
  15279. ret += "\t";
  15280. }
  15281. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_return");
  15282. if (command_obj.variable_value_menu) {
  15283. try {
  15284. ret += " " + elementExpressionCode(command_obj.variable_value_menu); //ret += ' ' + variableValueMenuCode(command_obj.variable_value_menu, true);
  15285. } catch (err) {//Empty block
  15286. }
  15287. }
  15288. return ret;
  15289. }
  15290. function breaksCode(_command_obj, indentation) {
  15291. var ret = "\n";
  15292. for (var i = 0; i < indentation; i++) {
  15293. ret += "\t";
  15294. }
  15295. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_break");
  15296. return ret;
  15297. }
  15298. function switchsCode(command_obj, indentation) {
  15299. var ret = "\n";
  15300. for (var i = 0; i < indentation; i++) {
  15301. ret += "\t";
  15302. }
  15303. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_switch") + " ( ";
  15304. ret += variableValueMenuCode(command_obj.variable);
  15305. ret += " ) { ";
  15306. if (command_obj.cases) {
  15307. for (var _i = 0; _i < command_obj.cases.length; _i++) {
  15308. ret += switchcasesCode(command_obj.cases[_i], indentation + 1);
  15309. }
  15310. }
  15311. ret += "\n";
  15312. for (var _i2 = 0; _i2 < indentation; _i2++) {
  15313. ret += "\t";
  15314. }
  15315. ret += "} ";
  15316. return ret;
  15317. }
  15318. function switchcasesCode(switchcase, indentation) {
  15319. var ret = "\n";
  15320. for (var i = 0; i < indentation; i++) {
  15321. ret += "\t";
  15322. }
  15323. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_case") + " ";
  15324. ret += variableValueMenuCode(switchcase.variable_value_menu);
  15325. ret += " :";
  15326. if (switchcase.commands_block) {
  15327. for (var _i3 = 0; _i3 < switchcase.commands_block.length; _i3++) {
  15328. ret += commandsCode(switchcase.commands_block[_i3], indentation + 1);
  15329. }
  15330. }
  15331. return ret;
  15332. }
  15333. function repeatNtimesCode(command_obj, indentation) {
  15334. var ret = "\n";
  15335. for (var i = 0; i < indentation; i++) {
  15336. ret += "\t";
  15337. }
  15338. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_for") + " ";
  15339. if (command_obj.var_attribution) {
  15340. ret += variableValueMenuCode(command_obj.var_attribution);
  15341. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_from"), " ");
  15342. ret += variableValueMenuCode(command_obj.expression1);
  15343. }
  15344. if (command_obj.expression2) {
  15345. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_to"), " ");
  15346. ret += variableValueMenuCode(command_obj.expression2);
  15347. }
  15348. if (command_obj.expression3) {
  15349. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_pass"), " ");
  15350. switch (command_obj.expression3.itens[1]) {
  15351. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus:
  15352. ret += " +";
  15353. break;
  15354. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus:
  15355. ret += " -";
  15356. break;
  15357. }
  15358. ret += variableValueMenuCode(command_obj.expression3.itens[2]);
  15359. }
  15360. /*if (command_obj.var_incrementation) {
  15361. ret += variableValueMenuCode(command_obj.var_incrementation);
  15362. ret += ' <- ';
  15363. ret += variableValueMenuCode(command_obj.expression3.itens[0]);
  15364. switch (command_obj.expression3.itens[1]) {
  15365. case Models.ARITHMETIC_TYPES.plus:
  15366. ret += ' + ';
  15367. break;
  15368. case Models.ARITHMETIC_TYPES.minus:
  15369. ret += ' - ';
  15370. break;
  15371. case Models.ARITHMETIC_TYPES.multiplication:
  15372. ret += ' * ';
  15373. break;
  15374. case Models.ARITHMETIC_TYPES.division:
  15375. ret += ' / ';
  15376. break;
  15377. case Models.ARITHMETIC_TYPES.module:
  15378. ret += ' % ';
  15379. break;
  15380. }
  15381. ret += variableValueMenuCode(command_obj.expression3.itens[2]);
  15382. }*/
  15383. ret += " { ";
  15384. if (command_obj.commands_block) {
  15385. for (var _i4 = 0; _i4 < command_obj.commands_block.length; _i4++) {
  15386. ret += commandsCode(command_obj.commands_block[_i4], indentation + 1);
  15387. }
  15388. }
  15389. ret += "\n";
  15390. for (var _i5 = 0; _i5 < indentation; _i5++) {
  15391. ret += "\t";
  15392. }
  15393. ret += "}";
  15394. return ret;
  15395. }
  15396. function iftruesCode(command_obj, indentation) {
  15397. var ret = "\n";
  15398. for (var i = 0; i < indentation; i++) {
  15399. ret += "\t";
  15400. }
  15401. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_if");
  15402. if (!command_obj.expression) {
  15403. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
  15404. } else {
  15405. ret += " ( ";
  15406. ret += elementExpressionCode(command_obj.expression);
  15407. ret += " ) ";
  15408. }
  15409. /*switch (command_obj.expression.expression.type) {
  15410. case Models.EXPRESSION_TYPES.exp_logic:
  15411. ret += logicExpressionCode(command_obj.expression.expression);
  15412. break;
  15413. case Models.EXPRESSION_TYPES.exp_arithmetic:
  15414. ret += arithmeticExpressionCode(command_obj.expression.expression);
  15415. break;
  15416. }*/
  15417. ret += " { ";
  15418. if (command_obj.commands_block) {
  15419. for (var _i6 = 0; _i6 < command_obj.commands_block.length; _i6++) {
  15420. ret += commandsCode(command_obj.commands_block[_i6], indentation + 1);
  15421. }
  15422. }
  15423. ret += "\n";
  15424. for (var _i7 = 0; _i7 < indentation; _i7++) {
  15425. ret += "\t";
  15426. }
  15427. ret += "} " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_else") + " {";
  15428. if (command_obj.commands_else) {
  15429. for (var _i8 = 0; _i8 < command_obj.commands_else.length; _i8++) {
  15430. ret += commandsCode(command_obj.commands_else[_i8], indentation + 1);
  15431. }
  15432. }
  15433. ret += "\n";
  15434. for (var _i9 = 0; _i9 < indentation; _i9++) {
  15435. ret += "\t";
  15436. }
  15437. ret += "}";
  15438. return ret;
  15439. }
  15440. function doWhilesCode(command_obj, indentation) {
  15441. var ret = "\n";
  15442. for (var i = 0; i < indentation; i++) {
  15443. ret += "\t";
  15444. }
  15445. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_do") + " { ";
  15446. if (command_obj.commands_block) {
  15447. for (var _i10 = 0; _i10 < command_obj.commands_block.length; _i10++) {
  15448. ret += commandsCode(command_obj.commands_block[_i10], indentation + 1);
  15449. }
  15450. }
  15451. ret += "\n";
  15452. for (var _i11 = 0; _i11 < indentation; _i11++) {
  15453. ret += "\t";
  15454. }
  15455. ret += "} " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_do_until");
  15456. if (!command_obj.expression) {
  15457. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
  15458. }
  15459. /*switch (command_obj.expression.expression.type) {
  15460. case Models.EXPRESSION_TYPES.exp_logic:
  15461. ret += logicExpressionCode(command_obj.expression.expression);
  15462. break;
  15463. case Models.EXPRESSION_TYPES.exp_arithmetic:
  15464. ret += arithmeticExpressionCode(command_obj.expression.expression);
  15465. break;
  15466. }*/
  15467. if (command_obj.expression) {
  15468. ret += " ( ";
  15469. ret += elementExpressionCode(command_obj.expression);
  15470. ret += " ) ";
  15471. }
  15472. return ret;
  15473. }
  15474. function whiletruesCode(command_obj, indentation) {
  15475. var ret = "\n";
  15476. for (var i = 0; i < indentation; i++) {
  15477. ret += "\t";
  15478. }
  15479. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_while");
  15480. if (!command_obj.expression) {
  15481. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
  15482. }
  15483. /*switch (command_obj.expression.expression.type) {
  15484. case Models.EXPRESSION_TYPES.exp_logic:
  15485. ret += logicExpressionCode(command_obj.expression.expression);
  15486. break;
  15487. case Models.EXPRESSION_TYPES.exp_arithmetic:
  15488. ret += arithmeticExpressionCode(command_obj.expression.expression);
  15489. break;
  15490. }*/
  15491. if (command_obj.expression) {
  15492. ret += " ( ";
  15493. ret += elementExpressionCode(command_obj.expression);
  15494. ret += " ) ";
  15495. }
  15496. ret += " { ";
  15497. if (command_obj.commands_block) {
  15498. for (var _i12 = 0; _i12 < command_obj.commands_block.length; _i12++) {
  15499. ret += commandsCode(command_obj.commands_block[_i12], indentation + 1);
  15500. }
  15501. }
  15502. ret += "\n";
  15503. for (var _i13 = 0; _i13 < indentation; _i13++) {
  15504. ret += "\t";
  15505. }
  15506. ret += "}";
  15507. return ret;
  15508. }
  15509. function logicExpressionCode(expression) {
  15510. var ret = " ( ";
  15511. if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  15512. ret += logicExpressionCode(expression.first_operand);
  15513. } else if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  15514. ret += arithmeticExpressionCode(expression.first_operand);
  15515. } else {
  15516. ret += variableValueMenuCode(expression.first_operand);
  15517. }
  15518. if (expression.operator) {
  15519. switch (expression.operator) {
  15520. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to:
  15521. ret += " == ";
  15522. break;
  15523. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not_equals_to:
  15524. ret += " != ";
  15525. break;
  15526. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].and:
  15527. ret += " && ";
  15528. break;
  15529. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].or:
  15530. ret += " || ";
  15531. break;
  15532. }
  15533. if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  15534. ret += logicExpressionCode(expression.second_operand);
  15535. } else if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  15536. ret += arithmeticExpressionCode(expression.second_operand);
  15537. } else {
  15538. ret += variableValueMenuCode(expression.second_operand);
  15539. }
  15540. }
  15541. ret += " ) ";
  15542. return ret;
  15543. }
  15544. function arithmeticExpressionCode(expression) {
  15545. var ret = " ( ";
  15546. if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  15547. ret += logicExpressionCode(expression.first_operand);
  15548. } else if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  15549. ret += arithmeticExpressionCode(expression.first_operand);
  15550. } else {
  15551. ret += variableValueMenuCode(expression.first_operand);
  15552. }
  15553. switch (expression.operator) {
  15554. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than:
  15555. ret += " > ";
  15556. break;
  15557. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than:
  15558. ret += " < ";
  15559. break;
  15560. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].equals_to:
  15561. ret += " == ";
  15562. break;
  15563. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].not_equals_to:
  15564. ret += " != ";
  15565. break;
  15566. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to:
  15567. ret += " >= ";
  15568. break;
  15569. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than_or_equals_to:
  15570. ret += " <= ";
  15571. break;
  15572. }
  15573. if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  15574. ret += logicExpressionCode(expression.second_operand);
  15575. } else if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  15576. ret += arithmeticExpressionCode(expression.second_operand);
  15577. } else {
  15578. ret += variableValueMenuCode(expression.second_operand);
  15579. }
  15580. ret += " ) ";
  15581. return ret;
  15582. }
  15583. function attributionsCode(command_obj, indentation) {
  15584. var ret = "\n";
  15585. for (var i = 0; i < indentation; i++) {
  15586. ret += "\t";
  15587. }
  15588. ret += variableValueMenuCode(command_obj.variable) + " <- ";
  15589. /*for (var i = 0; i < command_obj.expression.length; i++) {
  15590. ret += elementExpressionCode(command_obj.expression[i]);
  15591. }*/
  15592. ret += elementExpressionCode(command_obj.expression);
  15593. return ret;
  15594. }
  15595. function elementExpressionCode(expression_obj) {
  15596. var ret = "";
  15597. for (var i = 0; i < expression_obj.length; i++) {
  15598. if (expression_obj[i].type) {
  15599. ret += variableValueMenuCode(expression_obj[i]);
  15600. } else if (expression_obj[i].type_op) {
  15601. switch (expression_obj[i].item) {
  15602. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus:
  15603. ret += " + ";
  15604. break;
  15605. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus:
  15606. ret += " - ";
  15607. break;
  15608. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].multiplication:
  15609. ret += " * ";
  15610. break;
  15611. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].division:
  15612. ret += " / ";
  15613. break;
  15614. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].module:
  15615. ret += " % ";
  15616. break;
  15617. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to:
  15618. ret += " == ";
  15619. break;
  15620. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not_equals_to:
  15621. ret += " != ";
  15622. break;
  15623. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].and:
  15624. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_and") + " ";
  15625. break;
  15626. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].or:
  15627. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_or") + " ";
  15628. break;
  15629. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not:
  15630. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_not") + " ";
  15631. break;
  15632. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than:
  15633. ret += " > ";
  15634. break;
  15635. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than:
  15636. ret += " < ";
  15637. break;
  15638. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to:
  15639. ret += " >= ";
  15640. break;
  15641. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than_or_equals_to:
  15642. ret += " <= ";
  15643. break;
  15644. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep:
  15645. ret += ", ";
  15646. break;
  15647. }
  15648. } else {
  15649. ret += " " + expression_obj[i] + " ";
  15650. }
  15651. }
  15652. return ret;
  15653. }
  15654. function functioncallsCode(command_obj, indentation) {
  15655. var ret = "\n";
  15656. for (var i = 0; i < indentation; i++) {
  15657. ret += "\t";
  15658. }
  15659. ret += variableValueMenuCode(command_obj.function_called);
  15660. return ret;
  15661. }
  15662. function readersCode(command_obj, indentation) {
  15663. var ret = "\n";
  15664. for (var i = 0; i < indentation; i++) {
  15665. ret += "\t";
  15666. }
  15667. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_command_read") + " ( ";
  15668. ret += variableValueMenuCode(command_obj.variable_value_menu);
  15669. ret += " ) ";
  15670. return ret;
  15671. }
  15672. function variableValueMenuCode(variable_obj) {
  15673. var is_return = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  15674. var ret = "";
  15675. try {
  15676. if (variable_obj.function_called) {
  15677. if (variable_obj.function_called.name) {
  15678. ret += variable_obj.function_called.name + " ( ";
  15679. } else {
  15680. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].translateInternalFunction(variable_obj.function_called.identifier, variable_obj.function_called.category) + " ( ";
  15681. }
  15682. if (variable_obj.parameters_list) {
  15683. for (var i = 0; i < variable_obj.parameters_list.length; i++) {
  15684. ret += variableValueMenuCode(variable_obj.parameters_list[i]);
  15685. if (i + 1 < variable_obj.parameters_list.length) {
  15686. ret += ", ";
  15687. }
  15688. }
  15689. }
  15690. ret += " )";
  15691. } else if (variable_obj.content.type) {
  15692. ret += variable_obj.content.name;
  15693. if (variable_obj.content.dimensions == 1 && variable_obj.dimensions != 1) {
  15694. ret += " [ " + variableValueMenuCode(variable_obj.column) + " ] ";
  15695. }
  15696. if (variable_obj.content.dimensions == 2 && variable_obj.dimensions != 2) {
  15697. ret += " [ " + variableValueMenuCode(variable_obj.row) + " ] ";
  15698. ret += " [ " + variableValueMenuCode(variable_obj.column) + " ] ";
  15699. }
  15700. } else {
  15701. if (isNaN(variable_obj.content)) {
  15702. ret += '"' + variable_obj.content + '"';
  15703. } else {
  15704. ret += variable_obj.content;
  15705. }
  15706. }
  15707. } catch (err) {
  15708. if (!is_return) {
  15709. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](variable_obj.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_content"));
  15710. throw err;
  15711. }
  15712. }
  15713. return ret;
  15714. }
  15715. function writersCode(command_obj, indentation) {
  15716. var ret = "\n";
  15717. for (var i = 0; i < indentation; i++) {
  15718. ret += "\t";
  15719. }
  15720. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_command_write") + " ( ";
  15721. /*for (var i = 0; i < command_obj.content.length; i++) {
  15722. ret += variableValueMenuCode(command_obj.content[i]);
  15723. if ((i + 1) < command_obj.content.length) {
  15724. ret += ' + ';
  15725. }
  15726. }*/
  15727. ret += elementExpressionCode(command_obj.content);
  15728. if (command_obj.newline) {
  15729. ret += ', "\\n"';
  15730. }
  15731. ret += " ) ";
  15732. return ret;
  15733. }
  15734. function commentsCode(command_obj, indentation) {
  15735. var ret = "\n";
  15736. for (var i = 0; i < indentation; i++) {
  15737. ret += "\t";
  15738. }
  15739. ret += "// ";
  15740. ret += command_obj.comment_text.content;
  15741. return ret;
  15742. }
  15743. function parametersCode(parameter_obj) {
  15744. var ret = "";
  15745. switch (parameter_obj.type) {
  15746. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15747. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer") + " ";
  15748. break;
  15749. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15750. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real") + " ";
  15751. break;
  15752. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15753. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text") + " ";
  15754. break;
  15755. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15756. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean") + " ";
  15757. break;
  15758. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15759. ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char") + " ";
  15760. break;
  15761. }
  15762. ret += parameter_obj.name + "";
  15763. if (parameter_obj.dimensions == 1) {
  15764. ret += " []";
  15765. } else if (parameter_obj.dimensions == 2) {
  15766. ret += " [][]";
  15767. }
  15768. return ret;
  15769. }
  15770. function variablesCode(variable_obj) {
  15771. var ret = "";
  15772. var temp = variable_obj;
  15773. ret += "\n\t\t";
  15774. if (temp.is_constant) {
  15775. ret += "const ";
  15776. }
  15777. switch (temp.type) {
  15778. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15779. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer") + " ";
  15780. break;
  15781. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15782. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real") + " ";
  15783. break;
  15784. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15785. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text") + " ";
  15786. break;
  15787. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15788. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean") + " ";
  15789. break;
  15790. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15791. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char") + " ";
  15792. break;
  15793. }
  15794. ret += temp.name + " ";
  15795. if (temp.dimensions == 1) {
  15796. ret += "[" + temp.columns + "] ";
  15797. switch (temp.type) {
  15798. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15799. ret += "<- {";
  15800. for (var j = 0; j < temp.value.length; j++) {
  15801. ret += temp.value[j];
  15802. if (j + 1 < temp.value.length) {
  15803. ret += ", ";
  15804. }
  15805. }
  15806. ret += "}";
  15807. break;
  15808. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15809. ret += "<- {";
  15810. for (var _j3 = 0; _j3 < temp.value.length; _j3++) {
  15811. ret += temp.value[_j3].toFixed(2);
  15812. if (_j3 + 1 < temp.value.length) {
  15813. ret += ", ";
  15814. }
  15815. }
  15816. ret += "}";
  15817. break;
  15818. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15819. ret += "<- {";
  15820. for (var _j4 = 0; _j4 < temp.value.length; _j4++) {
  15821. ret += '"' + temp.value[_j4] + '"';
  15822. if (_j4 + 1 < temp.value.length) {
  15823. ret += ", ";
  15824. }
  15825. }
  15826. ret += "}";
  15827. break;
  15828. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15829. ret += "<- {";
  15830. for (var _j5 = 0; _j5 < temp.value.length; _j5++) {
  15831. if (temp.value[_j5]) {
  15832. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15833. } else {
  15834. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15835. }
  15836. if (_j5 + 1 < temp.value.length) {
  15837. ret += ", ";
  15838. }
  15839. }
  15840. ret += "}";
  15841. break;
  15842. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15843. ret += "<- {";
  15844. for (var _j6 = 0; _j6 < temp.value.length; _j6++) {
  15845. ret += "'" + temp.value[_j6] + "'";
  15846. if (_j6 + 1 < temp.value.length) {
  15847. ret += ", ";
  15848. }
  15849. }
  15850. ret += "}";
  15851. break;
  15852. }
  15853. } else if (temp.dimensions == 2) {
  15854. ret += "[" + temp.rows + "][" + temp.columns + "] ";
  15855. switch (temp.type) {
  15856. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15857. ret += "<- {";
  15858. for (var _j7 = 0; _j7 < temp.rows; _j7++) {
  15859. ret += "{";
  15860. for (var k = 0; k < temp.columns; k++) {
  15861. ret += temp.value[_j7][k];
  15862. if (k + 1 < temp.columns) {
  15863. ret += ", ";
  15864. }
  15865. }
  15866. ret += "}";
  15867. if (_j7 + 1 < temp.rows) {
  15868. ret += ", ";
  15869. }
  15870. }
  15871. ret += "}";
  15872. break;
  15873. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15874. ret += "<- {";
  15875. for (var _j8 = 0; _j8 < temp.rows; _j8++) {
  15876. ret += "{";
  15877. for (var _k = 0; _k < temp.columns; _k++) {
  15878. ret += temp.value[_j8][_k].toFixed(2);
  15879. if (_k + 1 < temp.columns) {
  15880. ret += ", ";
  15881. }
  15882. }
  15883. ret += "}";
  15884. if (_j8 + 1 < temp.rows) {
  15885. ret += ", ";
  15886. }
  15887. }
  15888. ret += "}";
  15889. break;
  15890. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15891. ret += "<- {";
  15892. for (var _j9 = 0; _j9 < temp.rows; _j9++) {
  15893. ret += "{";
  15894. for (var _k2 = 0; _k2 < temp.columns; _k2++) {
  15895. ret += '"' + temp.value[_j9][_k2] + '"';
  15896. if (_k2 + 1 < temp.columns) {
  15897. ret += ", ";
  15898. }
  15899. }
  15900. ret += "}";
  15901. if (_j9 + 1 < temp.rows) {
  15902. ret += ", ";
  15903. }
  15904. }
  15905. ret += "}";
  15906. break;
  15907. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15908. ret += "<- {";
  15909. for (var _j10 = 0; _j10 < temp.rows; _j10++) {
  15910. ret += "{";
  15911. for (var _k3 = 0; _k3 < temp.columns; _k3++) {
  15912. if (temp.value[_j10][_k3]) {
  15913. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15914. } else {
  15915. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15916. }
  15917. if (_k3 + 1 < temp.columns) {
  15918. ret += ", ";
  15919. }
  15920. }
  15921. ret += "}";
  15922. if (_j10 + 1 < temp.rows) {
  15923. ret += ", ";
  15924. }
  15925. }
  15926. ret += "}";
  15927. break;
  15928. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15929. ret += "<- {";
  15930. for (var _j11 = 0; _j11 < temp.rows; _j11++) {
  15931. ret += "{";
  15932. for (var _k4 = 0; _k4 < temp.columns; _k4++) {
  15933. ret += "'" + temp.value[_j11][_k4] + "'";
  15934. if (_k4 + 1 < temp.columns) {
  15935. ret += ", ";
  15936. }
  15937. }
  15938. ret += "}";
  15939. if (_j11 + 1 < temp.rows) {
  15940. ret += ", ";
  15941. }
  15942. }
  15943. ret += "}";
  15944. break;
  15945. }
  15946. } else {
  15947. switch (temp.type) {
  15948. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15949. ret += "<- " + temp.value;
  15950. break;
  15951. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15952. ret += "<- " + temp.value.toFixed(2);
  15953. break;
  15954. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15955. ret += '<- "' + temp.value + '"';
  15956. break;
  15957. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15958. ret += "<- ";
  15959. if (temp.value) {
  15960. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  15961. } else {
  15962. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  15963. }
  15964. break;
  15965. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15966. ret += "<- '" + temp.value + "'";
  15967. break;
  15968. }
  15969. }
  15970. return ret;
  15971. }
  15972. function globalsCode() {
  15973. var ret = "";
  15974. if (window.program_obj.globals) {
  15975. for (var i = 0; i < window.program_obj.globals.length; i++) {
  15976. var temp = window.program_obj.globals[i];
  15977. ret += "\n\t";
  15978. if (temp.is_constant) {
  15979. ret += "const ";
  15980. }
  15981. switch (temp.type) {
  15982. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  15983. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer");
  15984. break;
  15985. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  15986. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real");
  15987. break;
  15988. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  15989. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text");
  15990. break;
  15991. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  15992. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean");
  15993. break;
  15994. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  15995. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char");
  15996. break;
  15997. }
  15998. ret += " " + temp.name + " ";
  15999. if (temp.dimensions == 1) {
  16000. ret += "[" + temp.columns + "] ";
  16001. switch (temp.type) {
  16002. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  16003. ret += "<- {";
  16004. for (var j = 0; j < temp.value.length; j++) {
  16005. ret += temp.value[j];
  16006. if (j + 1 < temp.value.length) {
  16007. ret += ", ";
  16008. }
  16009. }
  16010. ret += "}";
  16011. break;
  16012. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  16013. ret += "<- {";
  16014. for (var _j12 = 0; _j12 < temp.value.length; _j12++) {
  16015. ret += temp.value[_j12].toFixed(2);
  16016. if (_j12 + 1 < temp.value.length) {
  16017. ret += ", ";
  16018. }
  16019. }
  16020. ret += "}";
  16021. break;
  16022. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  16023. ret += "<- {";
  16024. for (var _j13 = 0; _j13 < temp.value.length; _j13++) {
  16025. ret += '"' + temp.value[_j13] + '"';
  16026. if (_j13 + 1 < temp.value.length) {
  16027. ret += ", ";
  16028. }
  16029. }
  16030. ret += "}";
  16031. break;
  16032. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  16033. ret += "<- {";
  16034. for (var _j14 = 0; _j14 < temp.value.length; _j14++) {
  16035. if (temp.value[_j14]) {
  16036. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  16037. } else {
  16038. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  16039. }
  16040. if (_j14 + 1 < temp.value.length) {
  16041. ret += ", ";
  16042. }
  16043. }
  16044. ret += "}";
  16045. break;
  16046. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  16047. ret += "<- {";
  16048. for (var _j15 = 0; _j15 < temp.value.length; _j15++) {
  16049. ret += "'" + temp.value[_j15] + "'";
  16050. if (_j15 + 1 < temp.value.length) {
  16051. ret += ", ";
  16052. }
  16053. }
  16054. ret += "}";
  16055. break;
  16056. }
  16057. } else if (temp.dimensions == 2) {
  16058. ret += "[" + temp.rows + "][" + temp.columns + "] ";
  16059. switch (temp.type) {
  16060. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  16061. ret += "<- {";
  16062. for (var _j16 = 0; _j16 < temp.rows; _j16++) {
  16063. ret += "{";
  16064. for (var k = 0; k < temp.columns; k++) {
  16065. ret += temp.value[_j16][k];
  16066. if (k + 1 < temp.columns) {
  16067. ret += ", ";
  16068. }
  16069. }
  16070. ret += "}";
  16071. if (_j16 + 1 < temp.rows) {
  16072. ret += ", ";
  16073. }
  16074. }
  16075. ret += "}";
  16076. break;
  16077. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  16078. ret += "<- {";
  16079. for (var _j17 = 0; _j17 < temp.rows; _j17++) {
  16080. ret += "{";
  16081. for (var _k5 = 0; _k5 < temp.columns; _k5++) {
  16082. ret += temp.value[_j17][_k5].toFixed(2);
  16083. if (_k5 + 1 < temp.columns) {
  16084. ret += ", ";
  16085. }
  16086. }
  16087. ret += "}";
  16088. if (_j17 + 1 < temp.rows) {
  16089. ret += ", ";
  16090. }
  16091. }
  16092. ret += "}";
  16093. break;
  16094. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  16095. ret += "<- {";
  16096. for (var _j18 = 0; _j18 < temp.rows; _j18++) {
  16097. ret += "{";
  16098. for (var _k6 = 0; _k6 < temp.columns; _k6++) {
  16099. ret += '"' + temp.value[_j18][_k6] + '"';
  16100. if (_k6 + 1 < temp.columns) {
  16101. ret += ", ";
  16102. }
  16103. }
  16104. ret += "}";
  16105. if (_j18 + 1 < temp.rows) {
  16106. ret += ", ";
  16107. }
  16108. }
  16109. ret += "}";
  16110. break;
  16111. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  16112. ret += "<- {";
  16113. for (var _j19 = 0; _j19 < temp.rows; _j19++) {
  16114. ret += "{";
  16115. for (var _k7 = 0; _k7 < temp.columns; _k7++) {
  16116. if (temp.value[_j19][_k7]) {
  16117. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  16118. } else {
  16119. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  16120. }
  16121. if (_k7 + 1 < temp.columns) {
  16122. ret += ", ";
  16123. }
  16124. }
  16125. ret += "}";
  16126. if (_j19 + 1 < temp.rows) {
  16127. ret += ", ";
  16128. }
  16129. }
  16130. ret += "}";
  16131. break;
  16132. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  16133. ret += "<- {";
  16134. for (var _j20 = 0; _j20 < temp.rows; _j20++) {
  16135. ret += "{";
  16136. for (var _k8 = 0; _k8 < temp.columns; _k8++) {
  16137. ret += "'" + temp.value[_j20][_k8] + "'";
  16138. if (_k8 + 1 < temp.columns) {
  16139. ret += ", ";
  16140. }
  16141. }
  16142. ret += "}";
  16143. if (_j20 + 1 < temp.rows) {
  16144. ret += ", ";
  16145. }
  16146. }
  16147. ret += "}";
  16148. break;
  16149. }
  16150. } else {
  16151. switch (temp.type) {
  16152. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  16153. ret += "<- " + temp.value;
  16154. break;
  16155. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  16156. ret += "<- " + temp.value.toFixed(2);
  16157. break;
  16158. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  16159. ret += '<- "' + temp.value + '"';
  16160. break;
  16161. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  16162. ret += "<- ";
  16163. if (temp.value) {
  16164. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
  16165. } else {
  16166. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
  16167. }
  16168. break;
  16169. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
  16170. ret += "<- '" + temp.value + "'";
  16171. break;
  16172. }
  16173. }
  16174. }
  16175. }
  16176. return ret;
  16177. }
  16178. /***/ }),
  16179. /***/ "./js/visualUI/commands.js":
  16180. /*!*********************************!*\
  16181. !*** ./js/visualUI/commands.js ***!
  16182. \*********************************/
  16183. /*! exports provided: removeCommand, createFloatingCommand, renderCommand, genericCreateCommand */
  16184. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16185. "use strict";
  16186. __webpack_require__.r(__webpack_exports__);
  16187. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeCommand", function() { return removeCommand; });
  16188. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  16189. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  16190. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "genericCreateCommand", function() { return genericCreateCommand; });
  16191. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  16192. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  16193. /* harmony import */ var _commands_comment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commands/comment */ "./js/visualUI/commands/comment.js");
  16194. /* harmony import */ var _commands_reader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./commands/reader */ "./js/visualUI/commands/reader.js");
  16195. /* harmony import */ var _commands_writer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./commands/writer */ "./js/visualUI/commands/writer.js");
  16196. /* harmony import */ var _commands_attribution__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./commands/attribution */ "./js/visualUI/commands/attribution.js");
  16197. /* harmony import */ var _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./commands/iftrue */ "./js/visualUI/commands/iftrue.js");
  16198. /* harmony import */ var _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./commands/repeatNtimes */ "./js/visualUI/commands/repeatNtimes.js");
  16199. /* harmony import */ var _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./commands/whiletrue */ "./js/visualUI/commands/whiletrue.js");
  16200. /* harmony import */ var _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./commands/dowhiletrue */ "./js/visualUI/commands/dowhiletrue.js");
  16201. /* harmony import */ var _commands_switch__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./commands/switch */ "./js/visualUI/commands/switch.js");
  16202. /* harmony import */ var _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./commands/functioncall */ "./js/visualUI/commands/functioncall.js");
  16203. /* harmony import */ var _commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./commands/variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  16204. /* harmony import */ var _commands_break__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./commands/break */ "./js/visualUI/commands/break.js");
  16205. /* harmony import */ var _commands_return__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./commands/return */ "./js/visualUI/commands/return.js");
  16206. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  16207. // let has_element_created_draged = false;
  16208. // let which_element_is_draged = null;
  16209. function removeCommand(command, function_obj, dom_obj) {
  16210. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_COMMAND, command.type, '/', 0);
  16211. if (function_obj.commands.indexOf(command) > -1) {
  16212. function_obj.commands.splice(function_obj.commands.indexOf(command), 1);
  16213. return true;
  16214. } // Utilize dois parantNode, pois o primeiro é o div de comandos
  16215. try {
  16216. if (dom_obj.parent().parent().data('command').commands_block.indexOf(command) > -1) {
  16217. dom_obj.parent().parent().data('command').commands_block.splice(dom_obj.parent().parent().data('command').commands_block.indexOf(command), 1);
  16218. return true;
  16219. }
  16220. } catch (err) {}
  16221. try {
  16222. if (dom_obj.parent().parent().data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  16223. if (dom_obj.parent().parent().data('command').commands_else.indexOf(command) > -1) {
  16224. dom_obj.parent().parent().data('command').commands_else.splice(dom_obj.parent().parent().data('command').commands_else.indexOf(command), 1);
  16225. return true;
  16226. }
  16227. }
  16228. } catch (err) {}
  16229. if (dom_obj.parent().data('switchcase')) {
  16230. console.log("o que encontrei: ");
  16231. console.log(dom_obj.parent().data('switchcase'));
  16232. dom_obj.parent().data('switchcase').commands_block.splice(dom_obj.parent().data('switchcase').commands_block.indexOf(command), 1);
  16233. return true;
  16234. }
  16235. return false;
  16236. }
  16237. window.function_container_active = null;
  16238. function createFloatingCommand(function_obj, function_container, command_type, mouse_event) {
  16239. var floatingObject;
  16240. switch (command_type) {
  16241. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  16242. floatingObject = _commands_break__WEBPACK_IMPORTED_MODULE_13__["createFloatingCommand"]();
  16243. break;
  16244. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  16245. floatingObject = _commands_comment__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"]();
  16246. break;
  16247. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  16248. floatingObject = _commands_reader__WEBPACK_IMPORTED_MODULE_3__["createFloatingCommand"]();
  16249. break;
  16250. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  16251. floatingObject = _commands_writer__WEBPACK_IMPORTED_MODULE_4__["createFloatingCommand"]();
  16252. break;
  16253. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  16254. floatingObject = _commands_attribution__WEBPACK_IMPORTED_MODULE_5__["createFloatingCommand"]();
  16255. break;
  16256. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  16257. floatingObject = _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__["createFloatingCommand"]();
  16258. break;
  16259. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  16260. floatingObject = _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__["createFloatingCommand"]();
  16261. break;
  16262. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  16263. floatingObject = _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__["createFloatingCommand"]();
  16264. break;
  16265. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  16266. floatingObject = _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__["createFloatingCommand"]();
  16267. break;
  16268. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  16269. floatingObject = _commands_switch__WEBPACK_IMPORTED_MODULE_10__["createFloatingCommand"]();
  16270. break;
  16271. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  16272. floatingObject = _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__["createFloatingCommand"]();
  16273. break;
  16274. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  16275. floatingObject = _commands_return__WEBPACK_IMPORTED_MODULE_14__["createFloatingCommand"]();
  16276. break;
  16277. }
  16278. floatingObject.draggable().appendTo("body");
  16279. $('body').mouseup(function (evt) {
  16280. manageCommand(function_obj, function_container, evt, command_type);
  16281. $('body').off('mouseup');
  16282. $('body').off('mouseover');
  16283. });
  16284. if (!function_container.hasClass('function_div') || function_container.length < 1) {
  16285. window.mouse_event = mouse_event;
  16286. function_container = $(mouse_event.originalEvent.srcElement.closest('.function_div'));
  16287. }
  16288. console.log('function_container', function_container);
  16289. function_container_active = function_container;
  16290. function_container.find('.commands_list_div').on('mousemove', function (evt) {
  16291. addGhostDiv(evt);
  16292. });
  16293. function_container.find('.commands_list_div').find("*").on('mousemove', function (evt) {
  16294. addGhostDiv(evt);
  16295. });
  16296. function_container.on('mouseout', function (event) {
  16297. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  16298. if (el.closest('.commands_list_div').length < 1) {
  16299. window.ghostDiv.remove();
  16300. }
  16301. });
  16302. floatingObject.css("position", "absolute");
  16303. mouse_event.type = "mousedown.draggable";
  16304. mouse_event.target = floatingObject[0];
  16305. floatingObject.css("left", mouse_event.pageX - window.divx);
  16306. floatingObject.css("top", mouse_event.pageY);
  16307. floatingObject.trigger(mouse_event);
  16308. }
  16309. window.divx = 100;
  16310. window.ghostDiv = $('<div class="ghost_div">');
  16311. window.active_container = null;
  16312. function addGhostToEmptyBlock(element, evt) {
  16313. $('.ghost_div').remove();
  16314. var container = element.closest('.command_container');
  16315. if (container.hasClass('switch')) {
  16316. container = $(evt.target).closest('.case_div');
  16317. }
  16318. if (!container.hasClass('dowhiletrue') && !container.hasClass('iftrue') && !container.hasClass('repeatNtimes') && !container.hasClass('case_div') && !container.hasClass('whiletrue')) {
  16319. addGhostToNotEmptyBlock(element, evt);
  16320. return;
  16321. }
  16322. if (window.active_container != null) {
  16323. if (window.active_container.is(container)) {
  16324. console.log('é o mesmo, não mudou!');
  16325. } else {
  16326. if (container.length < 1) {
  16327. container = element.closest('.commands_list_div');
  16328. if (window.active_container.is(container)) {
  16329. console.log('é o mesmo command list');
  16330. } else {
  16331. console.log('mudou para um command list');
  16332. window.active_container = container;
  16333. }
  16334. } else {
  16335. console.log('mudou para um outro container?');
  16336. }
  16337. }
  16338. }
  16339. window.active_container = container;
  16340. if (container.hasClass('iftrue')) {
  16341. var containerIf = container.find('.commands_if').get(0);
  16342. var containerElse = container.find('.commands_else').get(0);
  16343. var topIfDistance = Math.abs(evt.clientY - containerIf.getBoundingClientRect().top);
  16344. var bottomIfDistance = Math.abs(containerIf.getBoundingClientRect().top + containerIf.getBoundingClientRect().height - evt.clientY);
  16345. var topElseDistance = Math.abs(evt.clientY - containerElse.getBoundingClientRect().top);
  16346. var bottomElseDistance = Math.abs(containerElse.getBoundingClientRect().top + containerElse.getBoundingClientRect().height - evt.clientY);
  16347. if (topIfDistance < topElseDistance && topIfDistance < bottomElseDistance) {
  16348. $(containerIf).append(window.ghostDiv);
  16349. } else {
  16350. $(containerElse).append(window.ghostDiv);
  16351. }
  16352. } else if (container.hasClass('case_div')) {
  16353. container.find('.case_commands_block').append(window.ghostDiv);
  16354. } else {
  16355. container.find('.block_commands').append(window.ghostDiv);
  16356. }
  16357. }
  16358. function addGhostToNotEmptyBlock(element, evt) {
  16359. $('.ghost_div').remove();
  16360. var container = element.closest('.dowhiletrue, .iftrue, .repeatNtimes, .case_div, .whiletrue'); //console.log("\n\nNOT EMPTY: ", container);
  16361. //if (window.active_container != null) {
  16362. //}
  16363. if (container.length < 1) {
  16364. container = element.closest('.commands_list_div');
  16365. window.active_container = container;
  16366. addGhostToFunctionArea(element, evt);
  16367. } else {//console.log('mudou para um outro container?');
  16368. }
  16369. window.active_container = container; // quem está mais próximo? // Essa regra se aplica somente quando o over está sobre um comando
  16370. var allfilhos;
  16371. console.log('olha o container: ', container);
  16372. if (container.hasClass('iftrue')) {
  16373. if ($(evt.target).closest('.data_block_if').length > 0) {
  16374. allfilhos = container.find('.commands_if').children('.command_container');
  16375. } else if ($(evt.target).closest('.data_block_else').length > 0) {
  16376. allfilhos = container.find('.commands_else').children('.command_container');
  16377. } else {
  16378. var containerIf = container.find('.commands_if').get(0);
  16379. var containerElse = container.find('.commands_else').get(0);
  16380. var topIfDistance = Math.abs(evt.clientY - containerIf.getBoundingClientRect().top);
  16381. var bottomIfDistance = Math.abs(containerIf.getBoundingClientRect().top + containerIf.getBoundingClientRect().height - evt.clientY);
  16382. var topElseDistance = Math.abs(evt.clientY - containerElse.getBoundingClientRect().top);
  16383. var bottomElseDistance = Math.abs(containerElse.getBoundingClientRect().top + containerElse.getBoundingClientRect().height - evt.clientY);
  16384. if (topIfDistance < topElseDistance && topIfDistance < bottomElseDistance) {
  16385. allfilhos = $(containerIf).children('.command_container');
  16386. } else {
  16387. allfilhos = $(containerElse).children('.command_container');
  16388. }
  16389. }
  16390. } else if (container.hasClass('case_div')) {
  16391. allfilhos = container.children('.case_commands_block').children('.command_container');
  16392. } else if (container.hasClass('commands_list_div')) {
  16393. allfilhos = container.children('.command_container');
  16394. } else {
  16395. allfilhos = container.children('.block_commands').children('.command_container');
  16396. }
  16397. var topDistances = [];
  16398. var bottomDistances = [];
  16399. for (var i = 0; i < allfilhos.length; i++) {
  16400. var topD = Math.abs(evt.clientY - allfilhos.get(i).getBoundingClientRect().top);
  16401. topDistances.push(topD);
  16402. var botD = Math.abs(allfilhos.get(i).getBoundingClientRect().top + allfilhos.get(i).getBoundingClientRect().height - evt.clientY);
  16403. bottomDistances.push(botD);
  16404. }
  16405. console.log('topDistances\n', topDistances, '\nbottomDistances\n', bottomDistances);
  16406. var menorTop = Math.min.apply(null, topDistances);
  16407. var indiceTop = topDistances.indexOf(menorTop);
  16408. var menorBot = Math.min.apply(null, bottomDistances);
  16409. var indiceBot = bottomDistances.indexOf(menorBot);
  16410. if (menorTop < menorBot) {
  16411. window.ghostDiv.insertBefore($(allfilhos.get(indiceTop)));
  16412. } else {
  16413. window.ghostDiv.insertAfter($(allfilhos.get(indiceBot)));
  16414. }
  16415. console.log('distancias: menorTop ', menorTop, ' menorBot ', menorBot);
  16416. }
  16417. function addGhostToFunctionArea(undermouse, evt) {
  16418. $('.ghost_div').remove();
  16419. var allfilhos = undermouse.closest('.commands_list_div').children('.command_container');
  16420. var topDistances = [];
  16421. var bottomDistances = [];
  16422. for (var i = 0; i < allfilhos.length; i++) {
  16423. var topD = Math.abs(evt.clientY - allfilhos.get(i).getBoundingClientRect().top);
  16424. topDistances.push(topD);
  16425. var botD = Math.abs(allfilhos.get(i).getBoundingClientRect().top + allfilhos.get(i).getBoundingClientRect().height - evt.clientY);
  16426. bottomDistances.push(botD);
  16427. }
  16428. var menorTop = Math.min.apply(null, topDistances);
  16429. var indiceTop = topDistances.indexOf(menorTop);
  16430. var menorBot = Math.min.apply(null, bottomDistances);
  16431. var indiceBot = bottomDistances.indexOf(menorBot);
  16432. if (menorTop < menorBot) {
  16433. window.ghostDiv.insertBefore($(allfilhos.get(indiceTop)));
  16434. } else {
  16435. window.ghostDiv.insertAfter($(allfilhos.get(indiceBot)));
  16436. }
  16437. }
  16438. function addGhostDiv(evt) {
  16439. var undermouse = $(evt.target);
  16440. if (undermouse.hasClass('ghost_div')) {
  16441. return;
  16442. } else if (undermouse.hasClass('commands_list_div')) {
  16443. addGhostToFunctionArea(undermouse, evt);
  16444. return;
  16445. } else if (undermouse.hasClass('block_commands')) {
  16446. if (undermouse.find('.command_container').length > 0) {
  16447. addGhostToNotEmptyBlock(undermouse, evt);
  16448. } else {
  16449. addGhostToEmptyBlock(undermouse, evt);
  16450. }
  16451. } else if (undermouse.hasClass('case_div')) {
  16452. if (undermouse.find('.case_commands_block').find('.command_container').length > 0) {
  16453. addGhostToNotEmptyBlock(undermouse, evt);
  16454. } else {
  16455. addGhostToEmptyBlock(undermouse, evt);
  16456. }
  16457. } else {
  16458. addGhostToNotEmptyBlock(undermouse, evt);
  16459. }
  16460. }
  16461. function borderMouseDragCommand(function_obj, function_container, evt) {
  16462. function_container.find('.over_command_drag').each(function (index) {
  16463. $(this).removeClass('over_command_drag');
  16464. });
  16465. var prev = null;
  16466. function_container.find('.commands_list_div').each(function (index) {
  16467. prev = $(this);
  16468. if (prev) {
  16469. var objLeft = prev.offset().left;
  16470. var objTop = prev.offset().top;
  16471. var objRight = objLeft + prev.width();
  16472. var objBottom = objTop + prev.height();
  16473. if (evt.pageX > objLeft && evt.pageX < objRight && evt.pageY > objTop && evt.pageY < objBottom) {
  16474. prev.addClass("over_command_drag");
  16475. }
  16476. }
  16477. });
  16478. function_container.find('.command_container').each(function (index) {
  16479. var obj = $(this);
  16480. var objLeft = obj.offset().left;
  16481. var objTop = obj.offset().top;
  16482. var objRight = objLeft + obj.width();
  16483. var objBottom = objTop + obj.height();
  16484. if (evt.pageX > objLeft && evt.pageX < objRight && evt.pageY > objTop && evt.pageY < objBottom) {
  16485. if (prev) {
  16486. prev.removeClass('over_command_drag');
  16487. }
  16488. obj.addClass("over_command_drag");
  16489. return;
  16490. }
  16491. });
  16492. } // before_after_inside: 1 -> before, 2 -> after, 3 -> inside
  16493. function renderCommand(command, element_reference, before_after_inside, function_obj) {
  16494. var createdElement;
  16495. switch (command.type) {
  16496. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  16497. createdElement = _commands_comment__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](command, function_obj);
  16498. break;
  16499. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  16500. createdElement = _commands_break__WEBPACK_IMPORTED_MODULE_13__["renderCommand"](command, function_obj);
  16501. break;
  16502. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  16503. createdElement = _commands_reader__WEBPACK_IMPORTED_MODULE_3__["renderCommand"](command, function_obj);
  16504. break;
  16505. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  16506. createdElement = _commands_writer__WEBPACK_IMPORTED_MODULE_4__["renderCommand"](command, function_obj);
  16507. break;
  16508. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  16509. createdElement = _commands_attribution__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](command, function_obj);
  16510. break;
  16511. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  16512. createdElement = _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__["renderCommand"](command, function_obj);
  16513. break;
  16514. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  16515. createdElement = _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__["renderCommand"](command, function_obj);
  16516. break;
  16517. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  16518. createdElement = _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__["renderCommand"](command, function_obj);
  16519. break;
  16520. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  16521. createdElement = _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__["renderCommand"](command, function_obj);
  16522. break;
  16523. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  16524. createdElement = _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__["renderCommand"](command, function_obj);
  16525. break;
  16526. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  16527. createdElement = _commands_switch__WEBPACK_IMPORTED_MODULE_10__["renderCommand"](command, function_obj);
  16528. break;
  16529. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  16530. createdElement = _commands_return__WEBPACK_IMPORTED_MODULE_14__["renderCommand"](command, function_obj);
  16531. break;
  16532. }
  16533. switch (before_after_inside) {
  16534. case 1:
  16535. createdElement.insertBefore(element_reference);
  16536. break;
  16537. case 2:
  16538. createdElement.insertAfter(element_reference);
  16539. break;
  16540. case 3:
  16541. element_reference.append(createdElement);
  16542. break;
  16543. }
  16544. }
  16545. function genericCreateCommand(command_type) {
  16546. switch (command_type) {
  16547. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  16548. return new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["Break"]();
  16549. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  16550. 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));
  16551. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  16552. 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));
  16553. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  16554. 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)]);
  16555. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  16556. 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), []);
  16557. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  16558. 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);
  16559. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  16560. 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)]);
  16561. //(var_attribution, var_incrementation, expression1, expression2, expression3, commands_block)
  16562. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  16563. 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);
  16564. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  16565. 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);
  16566. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  16567. 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);
  16568. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  16569. 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))];
  16570. 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);
  16571. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  16572. 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)]);
  16573. }
  16574. }
  16575. function dragTrash(event) {
  16576. $('.ghost_div').remove();
  16577. var trash = $('<i class="ui icon trash alternate outline"></i>');
  16578. $('body').append(trash);
  16579. trash.css('position', 'absolute');
  16580. trash.css('top', event.clientY);
  16581. trash.css('left', event.clientX - 20);
  16582. trash.css('font-size', '3em');
  16583. trash.css('display', 'none');
  16584. function_container_active.find('.commands_list_div').off('mousemove');
  16585. function_container_active.find('.commands_list_div').find("*").off('mousemove');
  16586. trash.fadeIn(200, function () {
  16587. trash.fadeOut(200, function () {
  16588. trash.remove();
  16589. });
  16590. });
  16591. }
  16592. function findSingleElement(searching, query) {
  16593. if (!searching || !query) {
  16594. return '';
  16595. }
  16596. 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) {
  16597. if (searching.commands_block) {
  16598. return '' + searching.commands_block.indexOf(query);
  16599. } else {
  16600. return '0';
  16601. }
  16602. } else if (searching.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  16603. if (searching.commands_block == null) {
  16604. searching.commands_block = [];
  16605. }
  16606. if (searching.commands_else == null) {
  16607. searching.commands_else = [];
  16608. }
  16609. console.log('\n\nveja onde: ', searching.commands_block, ' \n\nquery: ', query);
  16610. if (searching.commands_block.indexOf(query) >= 0) {
  16611. return 'if[' + searching.commands_block.indexOf(query) + ']';
  16612. } else {
  16613. return 'else[' + searching.commands_else.indexOf(query) + ']';
  16614. }
  16615. } else if (searching.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]) {
  16616. for (var i = 0; i < searching.cases.length; i++) {
  16617. if (searching.cases[i].commands_block.indexOf(query) >= 0) {
  16618. return 'case[' + searching.cases[i].commands_block.indexOf(query) + ']';
  16619. }
  16620. }
  16621. }
  16622. }
  16623. function findPathRecursive(starter_index, hierarquia_bottom_up, function_obj) {
  16624. var index_command = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1;
  16625. var actual = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  16626. var full_path = '';
  16627. for (var i = 0; i <= hierarquia_bottom_up.length; i++) {
  16628. console.log('\n\n:: ', i, ':\n', hierarquia_bottom_up[i]);
  16629. full_path += findSingleElement(hierarquia_bottom_up[i], hierarquia_bottom_up[i + 1]) + '-';
  16630. }
  16631. return full_path;
  16632. }
  16633. function manageCommand(function_obj, function_container, event, command_type) {
  16634. $(".created_element").each(function (index) {
  16635. $(this).remove();
  16636. });
  16637. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  16638. if (el.hasClass('ghost_div')) {
  16639. if (el.closest('.command_container').length < 1) {
  16640. console.log('\n\nvou tentar!!!!');
  16641. console.log(el.closest('.commands_list_div'), '\n\n');
  16642. el.closest('.commands_list_div').css('height', el.closest('.commands_list_div').css('height') + 30); //$('.ghost_div').remove();
  16643. el = el.closest('.commands_list_div');
  16644. }
  16645. }
  16646. console.log('soltou no: ');
  16647. console.log(el);
  16648. console.log(el.data('fun')); // Primeiro verificar se ele soltou no espaço da função correta:
  16649. var hier = el.parentsUntil(".all_functions");
  16650. var esta_correto = false;
  16651. var esta_na_div_correta = false;
  16652. if (el.hasClass("commands_list_div")) {
  16653. esta_na_div_correta = true;
  16654. }
  16655. for (var i = 0; i < hier.length; i++) {
  16656. var temp = $(hier[i]);
  16657. if (temp.hasClass("commands_list_div")) {
  16658. esta_na_div_correta = true;
  16659. }
  16660. if (temp.data('fun') == function_obj) {
  16661. esta_correto = true;
  16662. break;
  16663. }
  16664. }
  16665. if (!esta_correto) {
  16666. // has_element_created_draged = false;
  16667. // which_element_is_draged = null;
  16668. dragTrash(event);
  16669. return;
  16670. } else {
  16671. if (!esta_na_div_correta) {
  16672. // has_element_created_draged = false;
  16673. // which_element_is_draged = null;
  16674. dragTrash(event);
  16675. return;
  16676. }
  16677. }
  16678. var hierarquia_bottom_up = null; // Agora é descobrir qual o escopo para adicionar o comando:
  16679. console.log('ev0'); // Se o elemento clicado possuir o atributo "fun", então, é direto na div dos comandos:
  16680. if (typeof el.data('fun') !== 'undefined') {
  16681. // Se a lista de comandos estiver vazia, então é o primeiro.
  16682. // Portanto, ele deve soltar o elemento obrigatoriamente no objeto vazio
  16683. if (el.data('fun').commands == null || el.data('fun').commands.length == 0) {
  16684. // pode adicionar
  16685. el.data('fun').commands = [];
  16686. var new_cmd = genericCreateCommand(command_type);
  16687. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', 0);
  16688. el.data('fun').commands.push(new_cmd);
  16689. renderCommand(new_cmd, $(function_container).find('.commands_list_div'), 3, function_obj);
  16690. } else {
  16691. // Entra nesse else, caso já existam outros comandos no bloco:
  16692. findNearbyCommandToAddInFunctionScope(el, event, $(function_container).find('.commands_list_div'), function_obj, command_type);
  16693. }
  16694. } else {
  16695. console.log("soltou em um comando"); // descobrir em qual comando ele soltou:
  16696. var hier_find = el.parentsUntil(".commands_list_div");
  16697. hierarquia_bottom_up = [];
  16698. if (typeof el.data('command') !== 'undefined') {
  16699. hierarquia_bottom_up.push(el.data('command'));
  16700. }
  16701. for (var i = 0; i < hier_find.length; i++) {
  16702. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  16703. hierarquia_bottom_up.push($(hier_find[i]).data('command'));
  16704. }
  16705. }
  16706. console.log("comando em que soltou: ");
  16707. console.log(hierarquia_bottom_up[0]);
  16708. console.log("hierarquia de baixo para cima na árvore, de onde ele soltou: ");
  16709. for (var i = 0; i < hierarquia_bottom_up.length; i++) {
  16710. console.log(hierarquia_bottom_up[i]);
  16711. } // Se for do tipo break, verificar se está no contexto correto:
  16712. // Caso não esteja no contexto, apenas retorna sem dar continuidade:
  16713. var is_correct_context = false;
  16714. if (command_type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]) {
  16715. for (var i = 0; i < hierarquia_bottom_up.length; i++) {
  16716. 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"]) {
  16717. is_correct_context = true;
  16718. break;
  16719. }
  16720. }
  16721. if (!is_correct_context) {
  16722. console.error("Context not allowed to insert BREAK COMMAND!");
  16723. return;
  16724. }
  16725. } // se a hierarquia possuir apenas um elemento, então está na raiz dos comandos:
  16726. if (hierarquia_bottom_up.length == 1) {
  16727. console.log('QQ1');
  16728. var sub_elemento = false;
  16729. for (var i = 0; i < hier_find.length; i++) {
  16730. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  16731. console.log('QQ2');
  16732. findBeforeOrAfterCommandToAdd(hier_find[i], event, function_obj, command_type);
  16733. sub_elemento = true;
  16734. break;
  16735. }
  16736. }
  16737. if (!sub_elemento) {
  16738. console.log('QQ3');
  16739. findBeforeOrAfterCommandToAdd(el[0], event, function_obj, command_type);
  16740. }
  16741. } else {
  16742. console.log('QQ4'); // caso exista mais de um elemento na hierarquia:
  16743. if (typeof $(el).data('command') !== 'undefined') {
  16744. console.log('QQ5');
  16745. console.log("PPP1");
  16746. insertCommandInBlockHierar(el[0], event, function_obj, command_type, hier_find, hierarquia_bottom_up);
  16747. } else {
  16748. console.log('QQ6');
  16749. var sub_elemento = false;
  16750. for (var i = 0; i < hier_find.length; i++) {
  16751. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  16752. console.log('QQ7');
  16753. insertCommandInBlockHierar(hier_find[i], event, function_obj, command_type, hier_find, hierarquia_bottom_up);
  16754. sub_elemento = true;
  16755. break;
  16756. }
  16757. }
  16758. }
  16759. }
  16760. } // has_element_created_draged = false;
  16761. // which_element_is_draged = null;
  16762. if (hierarquia_bottom_up) {
  16763. console.log('\n\n:::índices::\n\n');
  16764. var i = hierarquia_bottom_up.length - 1;
  16765. var starter_index = window.program_obj.functions[window.program_obj.functions.indexOf(function_obj)].commands.indexOf(hierarquia_bottom_up[i]);
  16766. var all_str_path = starter_index + '-' + findPathRecursive(starter_index, hierarquia_bottom_up, function_obj);
  16767. 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);
  16768. console.log('\n\nfull path: \n\n', all_str_path);
  16769. console.log('fim dos índices');
  16770. }
  16771. renderAlgorithm();
  16772. }
  16773. function insertCommandInBlockHierar(el, event, function_obj, command_type, hier_dom, hier_obj) {
  16774. var el_jq = $(el);
  16775. var command_parent = el_jq.data('command');
  16776. 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"]) {
  16777. console.log('QQ17');
  16778. 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) {
  16779. console.log('QQ18'); // Se não tiver outro comando ainda no bloco, só adiciona:
  16780. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16781. command_parent.commands_block = [];
  16782. var recentComand = genericCreateCommand(command_type);
  16783. command_parent.commands_block.push(recentComand);
  16784. 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);
  16785. renderCommand(recentComand, el_jq.find('.block_commands'), 3, function_obj);
  16786. } else {
  16787. // Se já tem algum comando no bloco:
  16788. findNearbyCommandToAddInBlockScope(el, event, el, function_obj, command_type, command_parent);
  16789. }
  16790. } else {
  16791. // QUANDO FOR BLOCO DO TIPO IF OU SWITCH/CASE:
  16792. addCommandToSwitchCase(event, function_obj, command_type);
  16793. }
  16794. } else {
  16795. console.log('QQ19'); // entra neste bloco, se soltou o comando sobre outro comando dentro de um subbloco:
  16796. findBeforeOrAfterCommandToAddInsertBlock(el, event, function_obj, command_type);
  16797. }
  16798. }
  16799. function findNearbyCommandToAddInBlockScope(el, event, node_list_commands, function_obj, command_type, command_parent) {
  16800. console.log("\n\n\n::COMANDOS:\n\n", el, event, node_list_commands, function_obj, command_type, command_parent);
  16801. var all_sub = $(node_list_commands).find('div.command_container');
  16802. var menor_distancia = 999999999;
  16803. var elemento_menor_distancia = null;
  16804. var antes = true;
  16805. var t_bot;
  16806. var t_top; // Descobrindo o elemento mais próximo:
  16807. for (var i = 0; i < all_sub.length; i++) {
  16808. t_top = all_sub[i].getBoundingClientRect().top;
  16809. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  16810. if (t_top - event.clientY < menor_distancia) {
  16811. menor_distancia = event.clientY - t_top;
  16812. elemento_menor_distancia = all_sub[i];
  16813. }
  16814. }
  16815. 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:
  16816. if (borda_inferior - event.clientY < menor_distancia) {
  16817. var recentComand = genericCreateCommand(command_type);
  16818. command_parent.commands_block.push(recentComand); //
  16819. renderCommand(recentComand, node_list_commands, 3, function_obj);
  16820. } else {
  16821. var recentComand = genericCreateCommand(command_type);
  16822. var index = command_parent.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  16823. if (index > -1) {
  16824. command_parent.commands_block.splice(index, 0, recentComand);
  16825. }
  16826. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  16827. }
  16828. }
  16829. function findBeforeOrAfterCommandToAddInsertBlock(el, event, function_obj, command_type) {
  16830. var el_jq = $(el);
  16831. var command_parent = $(el.parentNode.parentNode).data('command');
  16832. var command_target = el_jq.data('command');
  16833. var temp_parent = $(el.parentNode.parentNode);
  16834. var is_in_else = false;
  16835. if (!command_parent) {
  16836. command_parent = el_jq.data('command');
  16837. temp_parent = el_jq;
  16838. var hier = el_jq.parentsUntil(".command_container");
  16839. for (var i = 0; i < hier.length; i++) {
  16840. var temp = $(hier[i]);
  16841. if (typeof temp.data('else') != 'undefined') {
  16842. is_in_else = true;
  16843. }
  16844. if (typeof temp.data('command') != 'undefined') {
  16845. command_parent = temp.data('command');
  16846. temp_parent = temp;
  16847. }
  16848. }
  16849. }
  16850. var hier = el_jq.parentsUntil(".command_container");
  16851. for (var i = 0; i < hier.length; i++) {
  16852. var temp = $(hier[i]);
  16853. if (typeof temp.data('else') != 'undefined') {
  16854. is_in_else = true;
  16855. }
  16856. }
  16857. if (command_parent == command_target) {
  16858. var hier = el_jq.parentsUntil(".command_container");
  16859. for (var i = 0; i < hier.length; i++) {
  16860. var temp = $(hier[i]);
  16861. if (typeof temp.data('else') !== 'undefined') {
  16862. is_in_else = true;
  16863. break;
  16864. }
  16865. }
  16866. }
  16867. 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"]) {
  16868. var hier = temp_parent.parentsUntil(".all_cases_div");
  16869. console.log("vou procurar!!");
  16870. for (var i = 0; i < hier.length; i++) {
  16871. console.log("estou vasculhando...");
  16872. var temp = $(hier[i]);
  16873. if (typeof temp.data('switchcase') !== 'undefined') {
  16874. console.log("encontrei");
  16875. command_parent = temp.data('switchcase');
  16876. is_in_else = false;
  16877. break;
  16878. }
  16879. }
  16880. }
  16881. console.log('debugging:');
  16882. console.log('el_jq');
  16883. console.log(el_jq);
  16884. console.log('command_parent');
  16885. console.log(command_parent);
  16886. console.log('command_target');
  16887. console.log(command_target);
  16888. var menor_distancia = 999999999;
  16889. var antes = true;
  16890. var t_bot;
  16891. var t_top;
  16892. t_top = el.getBoundingClientRect().top;
  16893. t_bot = el.getBoundingClientRect().top + el.getBoundingClientRect().height;
  16894. var d_top = event.clientY - t_top; // distancia topo
  16895. var d_bot = t_bot - event.clientY; // distancia baixo
  16896. // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  16897. if (d_top < d_bot) {
  16898. var recentComand = genericCreateCommand(command_type);
  16899. console.log('MMM1');
  16900. if (is_in_else) {
  16901. console.log('MMM2');
  16902. if (command_parent == command_target) {
  16903. console.log('MMM3');
  16904. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  16905. command_parent.commands_else = [];
  16906. var recentComand = genericCreateCommand(command_type);
  16907. command_parent.commands_else.push(recentComand);
  16908. renderCommand(recentComand, el_jq, 3, function_obj);
  16909. } else {
  16910. // Se já tem algum comando no bloco:
  16911. findInBlockCorrectPlace(el_jq, event, function_obj, command_type, true);
  16912. }
  16913. return;
  16914. }
  16915. console.log('MMM7');
  16916. var index = command_parent.commands_else.indexOf(command_target);
  16917. if (index > -1) {
  16918. command_parent.commands_else.splice(index, 0, recentComand);
  16919. }
  16920. renderCommand(recentComand, el, 1, function_obj);
  16921. } else {
  16922. console.log('MMM4');
  16923. if (command_parent == command_target) {
  16924. console.log('Nxxxx5');
  16925. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16926. command_parent.commands_block = [];
  16927. console.log('SSS4');
  16928. var recentComand = genericCreateCommand(command_type);
  16929. command_parent.commands_block.push(recentComand);
  16930. renderCommand(recentComand, el_jq, 3, function_obj);
  16931. } else {
  16932. console.log('SSS5');
  16933. findInBlockCorrectPlace(el_jq, event, function_obj, command_type);
  16934. }
  16935. return;
  16936. }
  16937. console.log('MMM6');
  16938. var index = command_parent.commands_block.indexOf(command_target);
  16939. if (index > -1) {
  16940. command_parent.commands_block.splice(index, 0, recentComand);
  16941. }
  16942. renderCommand(recentComand, el, 1, function_obj);
  16943. }
  16944. } else {
  16945. console.log('XXX1');
  16946. var recentComand = genericCreateCommand(command_type);
  16947. if (is_in_else) {
  16948. if (command_parent == command_target) {
  16949. console.log('MMM3');
  16950. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  16951. command_parent.commands_else = [];
  16952. console.log('SSS1');
  16953. var recentComand = genericCreateCommand(command_type);
  16954. command_parent.commands_else.push(recentComand);
  16955. renderCommand(recentComand, el_jq, 3, function_obj);
  16956. } else {
  16957. // Se já tem algum comando no bloco:
  16958. console.log('SSS2');
  16959. findInBlockCorrectPlace(el_jq, event, function_obj, command_type, true);
  16960. }
  16961. return;
  16962. }
  16963. console.log('XXX2');
  16964. var index = command_parent.commands_else.indexOf(command_target);
  16965. if (index > -1) {
  16966. command_parent.commands_else.splice(index + 1, 0, recentComand);
  16967. }
  16968. renderCommand(recentComand, el, 2, function_obj);
  16969. } else {
  16970. if (command_parent == command_target) {
  16971. console.log('Nxxxx78');
  16972. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16973. command_parent.commands_block = [];
  16974. var recentComand = genericCreateCommand(command_type);
  16975. command_parent.commands_block.push(recentComand);
  16976. console.log('SSS6');
  16977. renderCommand(recentComand, el_jq, 3, function_obj);
  16978. } else {
  16979. console.log('SSS7');
  16980. findInBlockCorrectPlace(el_jq, event, function_obj, command_type);
  16981. }
  16982. return;
  16983. }
  16984. console.log('XXX3');
  16985. var index = command_parent.commands_block.indexOf(command_target);
  16986. if (index > -1) {
  16987. command_parent.commands_block.splice(index + 1, 0, recentComand);
  16988. }
  16989. renderCommand(recentComand, el, 2, function_obj);
  16990. }
  16991. }
  16992. }
  16993. function insertCommandInBlock(el, event, function_obj, command_type) {
  16994. var el_jq = $(el);
  16995. var command_parent = el_jq.data('command');
  16996. 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) {
  16997. // Se não tiver outro comando ainda no bloco, só adiciona:
  16998. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  16999. command_parent.commands_block = [];
  17000. var recentComand = genericCreateCommand(command_type);
  17001. command_parent.commands_block.push(recentComand);
  17002. renderCommand(recentComand, el_jq.find('.block_commands'), 3, function_obj);
  17003. } else {
  17004. // Se já tem algum comando no bloco:
  17005. findInBlockCorrectPlace(el, event, function_obj, command_type);
  17006. }
  17007. } else if (el_jq.data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  17008. console.log('QQ9'); // no if ou no else?
  17009. var correct_div = $(document.elementFromPoint(event.pageX, event.pageY));
  17010. var is_in_if = true;
  17011. if (correct_div.data('if')) {
  17012. is_in_if = true;
  17013. } else if (correct_div.data('else')) {
  17014. is_in_if = false;
  17015. } else {
  17016. var hier = correct_div.parentsUntil(".command_container");
  17017. for (var i = 0; i < hier.length; i++) {
  17018. var temp = $(hier[i]);
  17019. if (typeof temp.data('if') !== 'undefined') {
  17020. is_in_if = true;
  17021. break;
  17022. }
  17023. if (typeof temp.data('else') !== 'undefined') {
  17024. is_in_if = false;
  17025. break;
  17026. }
  17027. }
  17028. }
  17029. if (is_in_if) {
  17030. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  17031. command_parent.commands_block = [];
  17032. var recentComand = genericCreateCommand(command_type);
  17033. command_parent.commands_block.push(recentComand);
  17034. renderCommand(recentComand, el_jq.find('.commands_if'), 3, function_obj);
  17035. } else {
  17036. // Se já tem algum comando no bloco:
  17037. findInBlockCorrectPlace(el_jq.find('.commands_if'), event, function_obj, command_type);
  17038. }
  17039. } else {
  17040. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  17041. command_parent.commands_else = [];
  17042. var recentComand = genericCreateCommand(command_type);
  17043. command_parent.commands_else.push(recentComand);
  17044. renderCommand(recentComand, el_jq.find('.commands_else'), 3, function_obj);
  17045. } else {
  17046. // Se já tem algum comando no bloco:
  17047. findInBlockCorrectPlace(el_jq.find('.commands_else'), event, function_obj, command_type, true);
  17048. }
  17049. }
  17050. } else {
  17051. // é do tipo switch
  17052. console.log("está tentando inserir em um switch que está na raiz!");
  17053. addCommandToSwitchCase(event, function_obj, command_type);
  17054. }
  17055. }
  17056. function addCommandToSwitchCase(event, function_obj, command_type) {
  17057. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  17058. var which_case = el.data('switchcase');
  17059. var case_div = el;
  17060. if (!which_case) {
  17061. var hier_find = el.parentsUntil(".all_cases_div");
  17062. for (var i = 0; i < hier_find.length; i++) {
  17063. if (typeof $(hier_find[i]).data('switchcase') !== 'undefined') {
  17064. which_case = $(hier_find[i]).data('switchcase');
  17065. case_div = $(hier_find[i]);
  17066. break;
  17067. }
  17068. }
  17069. }
  17070. if (which_case.commands_block == null || which_case.commands_block.length < 1) {
  17071. which_case.commands_block = [];
  17072. var recentComand = genericCreateCommand(command_type);
  17073. which_case.commands_block.push(recentComand);
  17074. renderCommand(recentComand, case_div.find('.case_commands_block'), 3, function_obj);
  17075. } else {
  17076. findInBlockCorrectPlaceInSwitchCase(which_case, case_div, event, function_obj, command_type);
  17077. }
  17078. }
  17079. function findInBlockCorrectPlaceInSwitchCase(which_case, case_div, event, function_obj, command_type) {
  17080. var all_sub = case_div.find('div.command_container');
  17081. var menor_distancia = 999999999;
  17082. var elemento_menor_distancia = null;
  17083. var antes = true;
  17084. var t_bot;
  17085. var t_top; // Descobrindo o elemento mais próximo:
  17086. for (var i = 0; i < all_sub.length; i++) {
  17087. t_top = all_sub[i].getBoundingClientRect().top;
  17088. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  17089. if (t_top - event.clientY < menor_distancia) {
  17090. menor_distancia = event.clientY - t_top;
  17091. elemento_menor_distancia = all_sub[i];
  17092. }
  17093. }
  17094. 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:
  17095. if (borda_inferior - event.clientY < menor_distancia) {
  17096. var recentComand = genericCreateCommand(command_type);
  17097. which_case.commands_block.push(recentComand);
  17098. renderCommand(recentComand, $(case_div.find('.case_commands_block')[0]), 3, function_obj);
  17099. } else {
  17100. var recentComand = genericCreateCommand(command_type);
  17101. var index = which_case.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  17102. if (index > -1) {
  17103. which_case.commands_block.splice(index, 0, recentComand);
  17104. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  17105. }
  17106. }
  17107. }
  17108. function findInBlockCorrectPlace(el, event, function_obj, command_type) {
  17109. var is_in_else = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  17110. var el_jq = $(el);
  17111. var all_sub = el_jq.find('div.command_container');
  17112. var menor_distancia = 999999999;
  17113. var elemento_menor_distancia = null;
  17114. var antes = true;
  17115. var t_bot;
  17116. var t_top; // Descobrindo o elemento mais próximo:
  17117. for (var i = 0; i < all_sub.length; i++) {
  17118. t_top = all_sub[i].getBoundingClientRect().top;
  17119. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  17120. if (t_top - event.clientY < menor_distancia) {
  17121. menor_distancia = event.clientY - t_top;
  17122. elemento_menor_distancia = all_sub[i];
  17123. }
  17124. }
  17125. var borda_inferior = elemento_menor_distancia.parentNode.getBoundingClientRect().top + elemento_menor_distancia.parentNode.getBoundingClientRect().height;
  17126. console.log("menor_distancia: ");
  17127. console.log(elemento_menor_distancia); // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  17128. if (borda_inferior - event.clientY < menor_distancia) {
  17129. console.log('QQ11');
  17130. var recentComand = genericCreateCommand(command_type);
  17131. var command_parent = el_jq.data('command');
  17132. if (is_in_else) {
  17133. console.log('QQ15');
  17134. command_parent.commands_else.push(recentComand);
  17135. console.log('el_jq');
  17136. console.log(el_jq);
  17137. console.log("$(el_jq.find('.commands_else')[0]):: ");
  17138. console.log($(el_jq.find('.commands_else')[0]));
  17139. renderCommand(recentComand, el_jq, 3, function_obj);
  17140. } else {
  17141. console.log('QQ16');
  17142. command_parent.commands_block.push(recentComand);
  17143. renderCommand(recentComand, $(el_jq.find('.block_commands')[0]), 3, function_obj);
  17144. }
  17145. } else {
  17146. console.log('QQ12');
  17147. var recentComand = genericCreateCommand(command_type);
  17148. var command_parent = el_jq.data('command');
  17149. if (is_in_else) {
  17150. var index = command_parent.commands_else.indexOf($(elemento_menor_distancia).data('command'));
  17151. if (index > -1) {
  17152. command_parent.commands_else.splice(index, 0, recentComand);
  17153. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  17154. }
  17155. } else {
  17156. var index = command_parent.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  17157. if (index > -1) {
  17158. command_parent.commands_block.splice(index, 0, recentComand);
  17159. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  17160. }
  17161. }
  17162. }
  17163. }
  17164. function findBeforeOrAfterCommandToAdd(el, event, function_obj, command_type) {
  17165. switch ($(el).data('command').type) {
  17166. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  17167. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  17168. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  17169. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  17170. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  17171. insertCommandInBlock(el, event, function_obj, command_type);
  17172. return;
  17173. }
  17174. var menor_distancia = 999999999;
  17175. var antes = true;
  17176. var t_bot;
  17177. var t_top;
  17178. t_top = el.getBoundingClientRect().top;
  17179. t_bot = el.getBoundingClientRect().top + el.getBoundingClientRect().height;
  17180. var d_top = event.clientY - t_top; // distancia topo
  17181. var d_bot = t_bot - event.clientY; // distancia baixo
  17182. // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  17183. if (d_top < d_bot) {
  17184. var recentComand = genericCreateCommand(command_type);
  17185. var index = function_obj.commands.indexOf($(el).data('command'));
  17186. if (index > -1) {
  17187. function_obj.commands.splice(index, 0, recentComand);
  17188. }
  17189. renderCommand(recentComand, el, 1, function_obj);
  17190. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  17191. } else {
  17192. var recentComand = genericCreateCommand(command_type);
  17193. var index = function_obj.commands.indexOf($(el).data('command'));
  17194. if (index > -1) {
  17195. function_obj.commands.splice(index + 1, 0, recentComand);
  17196. }
  17197. renderCommand(recentComand, el, 2, function_obj);
  17198. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  17199. }
  17200. }
  17201. function findNearbyCommandToAddInFunctionScope(el, event, node_list_commands, function_obj, command_type) {
  17202. var all_sub = $(node_list_commands).find('div.command_container');
  17203. var menor_distancia = 999999999;
  17204. var elemento_menor_distancia = null;
  17205. var antes = true;
  17206. var t_bot;
  17207. var t_top; // Descobrindo o elemento mais próximo:
  17208. for (var i = 0; i < all_sub.length; i++) {
  17209. t_top = all_sub[i].getBoundingClientRect().top;
  17210. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  17211. if (t_top - event.clientY < menor_distancia) {
  17212. menor_distancia = event.clientY - t_top;
  17213. elemento_menor_distancia = all_sub[i];
  17214. }
  17215. }
  17216. 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:
  17217. if (borda_inferior - event.clientY < menor_distancia) {
  17218. var recentComand = genericCreateCommand(command_type);
  17219. function_obj.commands.push(recentComand); //
  17220. renderCommand(recentComand, node_list_commands, 3, function_obj);
  17221. 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);
  17222. } else {
  17223. var recentComand = genericCreateCommand(command_type);
  17224. var index = function_obj.commands.indexOf($(elemento_menor_distancia).data('command'));
  17225. if (index > -1) {
  17226. function_obj.commands.splice(index, 0, recentComand);
  17227. }
  17228. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  17229. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  17230. }
  17231. }
  17232. /***/ }),
  17233. /***/ "./js/visualUI/commands/attribution.js":
  17234. /*!*********************************************!*\
  17235. !*** ./js/visualUI/commands/attribution.js ***!
  17236. \*********************************************/
  17237. /*! exports provided: createFloatingCommand, renderCommand, manageExpressionElements, renderMenuOperations */
  17238. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17239. "use strict";
  17240. __webpack_require__.r(__webpack_exports__);
  17241. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17242. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17243. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageExpressionElements", function() { return manageExpressionElements; });
  17244. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenuOperations", function() { return renderMenuOperations; });
  17245. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17246. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17247. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17248. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17249. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  17250. function createFloatingCommand() {
  17251. return $('<div class="ui attribution created_element"> <i class="ui icon small arrow left"></i> <span> x <&#8212; 1 + 1 </span></div>');
  17252. }
  17253. function renderCommand(command, function_obj) {
  17254. var el = $('<div class="ui attribution command_container"><i class="ui icon small arrow left command_drag"></i> <i class="ui icon times red button_remove_command"></i> <div class="var_attributed"></div> <span class="text_attr_receives span_command_spec">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_receives') + '</span> ' + '<div class="expression_elements"></div> </div>');
  17255. el.data('command', command);
  17256. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.variable, el.find('.var_attributed'), function_obj);
  17257. if (!command.expression || command.expression.length < 1) {
  17258. var exp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["VAR_OR_VALUE_TYPES"].all, null, null, null, true);
  17259. command.expression.push(exp);
  17260. }
  17261. addHandlers(command, function_obj, el);
  17262. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.expression_elements'), command.expression); //renderExpressionElements(command, function_obj, el);
  17263. return el;
  17264. }
  17265. function manageExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, selectedItem, expression_element) {
  17266. var index_to_move = expression_element.itens.indexOf(ref_object);
  17267. switch (selectedItem.data('exp')) {
  17268. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  17269. 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)]);
  17270. expression_element.itens[index_to_move] = exp;
  17271. break;
  17272. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  17273. 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]]);
  17274. expression_element.itens[index_to_move] = exp;
  17275. break;
  17276. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  17277. 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]]);
  17278. expression_element.itens[index_to_move] = exp;
  17279. break;
  17280. }
  17281. renderExpressionElements(command, function_obj, dom_object);
  17282. }
  17283. function renderExpressionElements(command, function_obj, el) {
  17284. var expression_div = el.find('.expression_elements');
  17285. var command_container;
  17286. if (el.hasClass("command_container") == false) {
  17287. var hier = el.parentsUntil(".command_container");
  17288. for (var i = 0; i < hier.length; i++) {
  17289. if ($(hier[i]).hasClass("command_container")) {
  17290. command_container = $(hier[i]);
  17291. break;
  17292. }
  17293. if ($(hier[i]).hasClass("expression_elements")) {
  17294. expression_div = $(hier[i]);
  17295. break;
  17296. }
  17297. }
  17298. }
  17299. if (command_container) {
  17300. expression_div = command_container.find('.expression_elements');
  17301. }
  17302. expression_div.text('');
  17303. for (var i = 0; i < command.expression.length; i++) {
  17304. var temp = $('<div class="expression_element"></div>');
  17305. temp.data('ref_element', command.expression[i]);
  17306. temp.data('ref_index', i);
  17307. expression_div.append(temp);
  17308. renderElement(command, function_obj, temp, command.expression[i]);
  17309. }
  17310. }
  17311. function renderOperator(command, function_obj, temp_op, expression_element, index_op) {
  17312. var context_menu = '<div class="ui dropdown"><div class="text">';
  17313. switch (expression_element.itens[index_op]) {
  17314. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus:
  17315. context_menu += '+';
  17316. break;
  17317. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus:
  17318. context_menu += '-';
  17319. break;
  17320. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication:
  17321. context_menu += '*';
  17322. break;
  17323. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division:
  17324. context_menu += '/';
  17325. break;
  17326. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module:
  17327. context_menu += '%';
  17328. break;
  17329. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].none:
  17330. context_menu += '...';
  17331. break;
  17332. }
  17333. context_menu += '</div><div class="menu">';
  17334. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus + '">+</div>';
  17335. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus + '">-</div>';
  17336. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication + '">*</div>';
  17337. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division + '">/</div>';
  17338. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module + '">%</div>';
  17339. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].none + '" data-text="...">Nenhum</div>';
  17340. context_menu += '</div></div>';
  17341. context_menu = $(context_menu);
  17342. temp_op.append(context_menu);
  17343. context_menu.dropdown({
  17344. onChange: function onChange(value, text, $selectedItem) {
  17345. expression_element.itens[index_op] = value;
  17346. }
  17347. });
  17348. }
  17349. function renderMenuAddExpression(command, function_obj, el, dom_append_menu, expression_append_new_expression) {
  17350. if (el.hasClass("command_container") == false) {
  17351. var hier = el.parentsUntil(".commands_list_div");
  17352. for (var i = 0; i < hier.length; i++) {
  17353. if ($(hier[i]).hasClass("command_container")) {
  17354. el = $(hier[i]);
  17355. break;
  17356. }
  17357. }
  17358. }
  17359. if (dom_append_menu.hasClass("expression_elements") == false) {
  17360. var hier = el.parentsUntil(".commands_list_div");
  17361. for (var i = 0; i < hier.length; i++) {
  17362. if ($(hier[i]).hasClass("expression_elements")) {
  17363. dom_append_menu = $(hier[i]);
  17364. break;
  17365. }
  17366. }
  17367. }
  17368. var context_menu = '<div class="ui dropdown"><div class="text"></div><i class="ui icon arrow alternate circle right outline"></i><div class="menu">';
  17369. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp + '">EXP OP EXP</div>';
  17370. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp + '">OP EXP</div>';
  17371. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par + '">( EXP )</div>';
  17372. context_menu += '</div></div>';
  17373. context_menu = $(context_menu);
  17374. dom_append_menu.append(context_menu);
  17375. context_menu.dropdown({
  17376. onChange: function onChange(value, text, $selectedItem) {
  17377. switch (value) {
  17378. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  17379. 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)]);
  17380. expression_append_new_expression.push(exp);
  17381. break;
  17382. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  17383. 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)]);
  17384. expression_append_new_expression.push(exp);
  17385. break;
  17386. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  17387. 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)]);
  17388. expression_append_new_expression.push(exp);
  17389. break;
  17390. }
  17391. renderExpressionElements(command, function_obj, el);
  17392. }
  17393. });
  17394. }
  17395. function renderElement(command, function_obj, el, expression_element) {
  17396. switch (expression_element.type_exp) {
  17397. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  17398. var temp_op = $('<div class="component_element"></div>');
  17399. var temp_exp_1 = $('<div class="component_element"></div>');
  17400. var temp_exp_2 = $('<div class="component_element"></div>');
  17401. el.append(temp_exp_1);
  17402. el.append(temp_op);
  17403. el.append(temp_exp_2);
  17404. if (expression_element.itens[0].type) {
  17405. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[0], temp_exp_1, function_obj, 2, expression_element);
  17406. } else {
  17407. renderElement(command, function_obj, temp_exp_1, expression_element.itens[0]);
  17408. }
  17409. renderOperator(command, function_obj, temp_op, expression_element, 1);
  17410. if (expression_element.itens[2].type) {
  17411. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[2], temp_exp_2, function_obj, 2, expression_element);
  17412. } else {
  17413. renderElement(command, function_obj, temp_exp_2, expression_element.itens[2]);
  17414. }
  17415. break;
  17416. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  17417. var temp_op = $('<div class="component_element"></div>');
  17418. var temp_exp = $('<div class="component_element"></div>');
  17419. el.append(temp_op);
  17420. el.append(temp_exp);
  17421. renderOperator(command, function_obj, temp_op, expression_element, 0);
  17422. if (expression_element.itens[1].type) {
  17423. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[1], temp_exp, function_obj, 2, expression_element);
  17424. } else {
  17425. renderElement(command, function_obj, temp_exp, expression_element.itens[1]);
  17426. }
  17427. break;
  17428. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  17429. var temp_par_1 = $('<div class="component_element"> ( </div>');
  17430. var temp_exp = $('<div class="component_element"></div>');
  17431. var temp_par_2 = $('<div class="component_element"> ) </div>');
  17432. el.append(temp_par_1);
  17433. el.append(temp_exp);
  17434. for (var j = 0; j < expression_element.itens.length; j++) {
  17435. if (expression_element.itens[j].type) {
  17436. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[j], temp_exp, function_obj, 2, expression_element);
  17437. } else {
  17438. renderElement(command, function_obj, temp_exp, expression_element.itens[j]);
  17439. }
  17440. } //renderMenuAddExpression(command, function_obj, el, el, expression_element.itens);
  17441. el.append(temp_par_2);
  17442. break;
  17443. }
  17444. }
  17445. function renderExpression(command, function_obj, el) {
  17446. var expression_div = el.find('.expression_elements');
  17447. expression_div.text('');
  17448. var menu_add_item = $('<div class="menu_add_item"></div>');
  17449. menu_add_item.data('index_add', 0);
  17450. expression_div.append(menu_add_item);
  17451. for (var i = 0; i < command.expression.length; i++) {
  17452. if (command.expression[i].type) {
  17453. var temp = $('<div class="expression_element"></div>');
  17454. temp.data('ref_element', command.expression[i]);
  17455. temp.data('ref_index', i);
  17456. expression_div.append(temp);
  17457. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.expression[i], temp, function_obj);
  17458. } else if (command.expression[i] == "(" || command.expression[i] == ")") {
  17459. var temp = $('<div class="expression_element">' + command.expression[i] + '</div>');
  17460. temp.data('ref_element', command.expression[i]);
  17461. temp.data('ref_index', i);
  17462. expression_div.append(temp);
  17463. } else {
  17464. var temp = '<div class="expression_element">';
  17465. switch (command.expression[i]) {
  17466. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus:
  17467. temp += '+';
  17468. break;
  17469. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus:
  17470. temp += '-';
  17471. break;
  17472. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication:
  17473. temp += '*';
  17474. break;
  17475. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division:
  17476. temp += '/';
  17477. break;
  17478. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module:
  17479. temp += '%';
  17480. break;
  17481. }
  17482. temp += '</div>';
  17483. temp = $(temp);
  17484. temp.data('ref_element', command.expression[i]);
  17485. temp.data('ref_index', i);
  17486. expression_div.append(temp);
  17487. }
  17488. var menu_add_item_seq = $('<div class="menu_add_item"></div>');
  17489. var index_temp = i + 1;
  17490. menu_add_item_seq.data('index_add', index_temp);
  17491. expression_div.append(menu_add_item_seq);
  17492. }
  17493. addMenuItens(command, function_obj, el);
  17494. }
  17495. function addMenuItens(command, function_obj, expression_div) {
  17496. var divs_expression = expression_div.find('.menu_add_item');
  17497. for (var i = 0; i < divs_expression.length; i++) {
  17498. var temp = $(divs_expression[i]).data('index_add');
  17499. var context_menu = '<div class="ui dropdown context_menu_clear"><i class="ui icon plus square outline"></i><div class="menu">';
  17500. context_menu += '<div class="item" data-option="value" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_value') + '</div>';
  17501. context_menu += '<div class="item" data-option="operator" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_operator') + '</div>';
  17502. context_menu += '<div class="item" data-option="parentheses" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_parentheses') + '</div>';
  17503. context_menu += '</div></div>';
  17504. context_menu = $(context_menu);
  17505. $(divs_expression[i]).append(context_menu);
  17506. context_menu.dropdown({
  17507. on: 'hover',
  17508. onChange: function onChange(value, text, $selectedItem) {
  17509. switch ($selectedItem.data('option')) {
  17510. case "value":
  17511. 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));
  17512. renderExpression(command, function_obj, expression_div);
  17513. break;
  17514. case "operator":
  17515. command.expression.splice($selectedItem.data('index'), 0, _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus);
  17516. renderExpression(command, function_obj, expression_div);
  17517. break;
  17518. case "parentheses":
  17519. command.expression.splice($selectedItem.data('index'), 0, "(");
  17520. 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));
  17521. command.expression.splice($selectedItem.data('index') + 2, 0, ")");
  17522. renderExpression(command, function_obj, expression_div);
  17523. break;
  17524. }
  17525. }
  17526. });
  17527. }
  17528. }
  17529. function addHandlers(command, function_obj, attribution_dom) {
  17530. attribution_dom.find('.button_remove_command').on('click', function () {
  17531. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, attribution_dom)) {
  17532. attribution_dom.fadeOut(400, function () {
  17533. attribution_dom.remove();
  17534. });
  17535. }
  17536. });
  17537. attribution_dom.find('.button_refresh_attribution').on('click', function () {
  17538. renderExpressionElements(command, function_obj, attribution_dom);
  17539. });
  17540. }
  17541. function renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected) {
  17542. /*console.log("recebido o seguinte DOM: ");
  17543. console.log(dom_object);
  17544. if (dom_object.hasClass('var_attributed')) {
  17545. return;
  17546. } else {
  17547. var hier = dom_object.parentsUntil(".command_container");
  17548. for (var i = 0; i < hier.length; i++) {
  17549. if ($(hier[i]).hasClass('var_attributed') || $(hier[i]).hasClass('parameters_function_called')) {
  17550. return;
  17551. }
  17552. }
  17553. }
  17554. dom_object.find('.context_menu_clear').remove();
  17555. var menu_operations = '<div class="ui dropdown menu_operations"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  17556. for (var tm in Models.ARITHMETIC_TYPES) {
  17557. menu_operations += '<div class="item" data-option="'+tm+'">'+LocalizedStrings.getUI('btn_arithmetic_' + tm)+'</div>';
  17558. }
  17559. menu_operations += '<div class="item" data-option="clear">'+LocalizedStrings.getUI('btn_clear')+'</div>';
  17560. menu_operations += '</div></div>';
  17561. menu_operations = $(menu_operations);
  17562. dom_object.append(menu_operations);
  17563. menu_operations.dropdown({
  17564. onChange: function(value, text, $selectedItem) {
  17565. switch ($($selectedItem).data('option')) {
  17566. case "clear":
  17567. $(dom_object).text('');
  17568. VariableValueMenu.renderMenu(command, ref_object, dom_object, function_obj);
  17569. break;
  17570. default:
  17571. createExpressionAround(command, ref_object, dom_object, function_obj);
  17572. menu_operations.find('.text').text('');
  17573. }
  17574. }
  17575. });*/
  17576. }
  17577. function createExpressionAround(command, ref_object, dom_object, function_obj) {
  17578. $('<span> ( </span>').insertBefore(dom_object);
  17579. $('<span> ) </span>').insertAfter(dom_object);
  17580. _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);
  17581. }
  17582. /***/ }),
  17583. /***/ "./js/visualUI/commands/break.js":
  17584. /*!***************************************!*\
  17585. !*** ./js/visualUI/commands/break.js ***!
  17586. \***************************************/
  17587. /*! exports provided: createFloatingCommand, renderCommand */
  17588. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17589. "use strict";
  17590. __webpack_require__.r(__webpack_exports__);
  17591. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17592. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17593. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17594. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17595. function createFloatingCommand() {
  17596. return $('<div class="ui comment created_element"> <i class="ui icon small quote left"></i> <span> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_break') + ' </span></div>');
  17597. }
  17598. function renderCommand(command, function_obj) {
  17599. var el = $('<div class="ui comment command_container"> <i class="ui icon small quote left"></i> <i class="ui icon times red button_remove_command"></i> <span>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_break') + '</span> </div>');
  17600. el.data('command', command);
  17601. addHandlers(command, function_obj, el);
  17602. return el;
  17603. }
  17604. function addHandlers(command, function_obj, break_dom) {
  17605. break_dom.find('.button_remove_command').on('click', function () {
  17606. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, break_dom)) {
  17607. break_dom.fadeOut(400, function () {
  17608. break_dom.remove();
  17609. });
  17610. }
  17611. });
  17612. }
  17613. /***/ }),
  17614. /***/ "./js/visualUI/commands/comment.js":
  17615. /*!*****************************************!*\
  17616. !*** ./js/visualUI/commands/comment.js ***!
  17617. \*****************************************/
  17618. /*! exports provided: createFloatingCommand, renderCommand */
  17619. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17620. "use strict";
  17621. __webpack_require__.r(__webpack_exports__);
  17622. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17623. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17624. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17625. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17626. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17627. function createFloatingCommand() {
  17628. 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>');
  17629. }
  17630. function renderCommand(command, function_obj) {
  17631. 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>');
  17632. el.data('command', command);
  17633. addHandlers(command, function_obj, el);
  17634. renderTextComment(command, function_obj, el);
  17635. return el;
  17636. }
  17637. function renderTextComment(command, function_obj, el) {
  17638. _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__["renderMenu"](command, command.comment_text, el.find('.var_value_menu_div'), function_obj, 20);
  17639. }
  17640. function addHandlers(command, function_obj, comment_dom) {
  17641. comment_dom.find('.button_remove_command').on('click', function () {
  17642. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, comment_dom)) {
  17643. comment_dom.fadeOut(400, function () {
  17644. comment_dom.remove();
  17645. });
  17646. }
  17647. });
  17648. }
  17649. /***/ }),
  17650. /***/ "./js/visualUI/commands/conditional_expression.js":
  17651. /*!********************************************************!*\
  17652. !*** ./js/visualUI/commands/conditional_expression.js ***!
  17653. \********************************************************/
  17654. /*! exports provided: renderExpression */
  17655. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17656. "use strict";
  17657. __webpack_require__.r(__webpack_exports__);
  17658. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderExpression", function() { return renderExpression; });
  17659. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17660. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17661. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17662. function renderExpression(command, expression, function_obj, initial_el_to_render) {
  17663. expression.dom_object = initial_el_to_render;
  17664. if (expression.expression == null || expression.expression.length < 1) {
  17665. renderStartMenu(command, expression, function_obj, initial_el_to_render);
  17666. } else {
  17667. var main_div = $('<div class="expression_elements"></div>');
  17668. switch (expression.expression.type) {
  17669. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic:
  17670. renderLogicExpression(command, expression, expression.expression, function_obj, main_div, initial_el_to_render);
  17671. break;
  17672. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic:
  17673. renderArithmeticExpression(command, expression, expression.expression, function_obj, main_div);
  17674. break;
  17675. }
  17676. initial_el_to_render.append(main_div);
  17677. var restartMenu = $('<div class="ui restart_expression"><i class="ui icon undo"></i></div>');
  17678. initial_el_to_render.append(restartMenu);
  17679. restartMenu.on('click', function (e) {
  17680. expression.expression = null;
  17681. initial_el_to_render.empty();
  17682. renderExpression(command, expression, function_obj, initial_el_to_render);
  17683. });
  17684. }
  17685. }
  17686. function renderArithmeticOperator(command, all_expression, expression_arithmetic, arithmetic_operator, function_obj, element_to_append) {
  17687. var menu_operator = $('<div class="ui dropdown"><div class="text"></div><i class="dropdown icon"></i></div>');
  17688. menu_operator.dropdown({
  17689. values: [{
  17690. name: '>',
  17691. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than,
  17692. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than
  17693. }, {
  17694. name: '<',
  17695. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than,
  17696. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than
  17697. }, {
  17698. name: '==',
  17699. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].equals_to,
  17700. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].equals_to
  17701. }, {
  17702. name: '!=',
  17703. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].not_equals_to,
  17704. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].not_equals_to
  17705. }, {
  17706. name: '>=',
  17707. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to,
  17708. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to
  17709. }, {
  17710. name: '<=',
  17711. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than_or_equals_to,
  17712. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than_or_equals_to
  17713. }],
  17714. onChange: function onChange(value, text, $selectedItem) {
  17715. expression_arithmetic.operator = value;
  17716. }
  17717. });
  17718. element_to_append.append(menu_operator);
  17719. }
  17720. function renderLogicOperator(command, all_expression, expression_logic, logic_operator, function_obj, element_to_append, initial_el_to_render) {
  17721. var menu_operator = $('<div class="ui dropdown"><div class="text"></div><i class="dropdown icon"></i></div>');
  17722. menu_operator.dropdown({
  17723. values: [{
  17724. name: '==',
  17725. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].equals_to,
  17726. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].equals_to
  17727. }, {
  17728. name: '!=',
  17729. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].not_equals_to,
  17730. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].not_equals_to
  17731. }, {
  17732. name: '&&',
  17733. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].and,
  17734. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].and
  17735. }, {
  17736. name: '||',
  17737. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].or,
  17738. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].or
  17739. }],
  17740. onChange: function onChange(value, text, $selectedItem) {
  17741. if ($selectedItem) {
  17742. expression_logic.operator = value;
  17743. if (expression_logic.second_operand == null) {
  17744. 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);
  17745. initial_el_to_render.empty();
  17746. renderExpression(command, all_expression, function_obj, initial_el_to_render);
  17747. }
  17748. }
  17749. }
  17750. });
  17751. element_to_append.append(menu_operator);
  17752. }
  17753. function renderLogicExpression(command, all_expression, expression_logic, function_obj, element_to_append, initial_el_to_render) {
  17754. var exp_el_par_1 = $(' <span class="span_command_spec"> </span> ');
  17755. var exp_el_expr_el_1 = $('<div class="expression_element"></div>');
  17756. var exp_el_expr_operand = $('<div class="expression_element"></div>');
  17757. var exp_el_expr_el_2 = $('<div class="expression_element"></div>');
  17758. var exp_el_par_2 = $(' <span class="span_command_spec"> </span> ');
  17759. if (expression_logic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17760. renderLogicExpression(command, all_expression, expression_logic.first_operand, function_obj, exp_el_expr_el_1);
  17761. } else if (expression_logic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17762. renderArithmeticExpression(command, all_expression, expression_logic.first_operand, function_obj, exp_el_expr_el_1);
  17763. } else {
  17764. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_logic.first_operand, exp_el_expr_el_1, function_obj);
  17765. }
  17766. element_to_append.append(exp_el_par_1);
  17767. element_to_append.append(exp_el_expr_el_1);
  17768. renderLogicOperator(command, all_expression, expression_logic, expression_logic.operator, function_obj, exp_el_expr_operand, initial_el_to_render);
  17769. element_to_append.append(exp_el_expr_operand);
  17770. if (expression_logic.second_operand) {
  17771. if (expression_logic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17772. renderLogicExpression(command, all_expression, expression_logic.second_operand, function_obj, exp_el_expr_el_2);
  17773. } else if (expression_logic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17774. renderArithmeticExpression(command, all_expression, expression_logic.second_operand, function_obj, exp_el_expr_el_2);
  17775. } else {
  17776. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_logic.second_operand, exp_el_expr_el_2, function_obj);
  17777. }
  17778. element_to_append.append(exp_el_expr_el_2);
  17779. }
  17780. element_to_append.append(exp_el_par_2);
  17781. }
  17782. function renderArithmeticExpression(command, all_expression, expression_arithmetic, function_obj, element_to_append) {
  17783. var exp_el_par_1 = $(' <span class="span_command_spec"> </span> ');
  17784. var exp_el_expr_el_1 = $('<div class="expression_element"></div>');
  17785. var exp_el_expr_operand = $('<div class="expression_element"></div>');
  17786. var exp_el_expr_el_2 = $('<div class="expression_element"></div>');
  17787. var exp_el_par_2 = $(' <span class="span_command_spec"> </span> ');
  17788. if (expression_arithmetic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17789. renderLogicExpression(command, all_expression, expression_arithmetic.first_operand, function_obj, exp_el_expr_el_1);
  17790. } else if (expression_arithmetic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17791. renderArithmeticExpression(command, all_expression, expression_arithmetic.first_operand, function_obj, exp_el_expr_el_1);
  17792. } else {
  17793. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_arithmetic.first_operand, exp_el_expr_el_1, function_obj);
  17794. }
  17795. if (expression_arithmetic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  17796. renderLogicExpression(command, all_expression, expression_arithmetic.second_operand, function_obj, exp_el_expr_el_2);
  17797. } else if (expression_arithmetic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  17798. renderArithmeticExpression(command, all_expression, expression_arithmetic.second_operand, function_obj, exp_el_expr_el_2);
  17799. } else {
  17800. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_arithmetic.second_operand, exp_el_expr_el_2, function_obj);
  17801. }
  17802. renderArithmeticOperator(command, all_expression, expression_arithmetic, expression_arithmetic.operator, function_obj, exp_el_expr_operand);
  17803. element_to_append.append(exp_el_par_1);
  17804. element_to_append.append(exp_el_expr_el_1);
  17805. element_to_append.append(exp_el_expr_operand);
  17806. element_to_append.append(exp_el_expr_el_2);
  17807. element_to_append.append(exp_el_par_2);
  17808. }
  17809. function renderStartMenu(command, expression, function_obj, initial_el_to_render) {
  17810. var start_menu = '';
  17811. 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">';
  17812. 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>';
  17813. 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>';
  17814. start_menu += '</div></div>';
  17815. start_menu = $(start_menu);
  17816. start_menu.dropdown({
  17817. onChange: function onChange(value, text, $selectedItem) {
  17818. switch ($selectedItem.data('exp')) {
  17819. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic:
  17820. 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));
  17821. break;
  17822. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic:
  17823. 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);
  17824. break;
  17825. }
  17826. initial_el_to_render.html('');
  17827. renderExpression(command, expression, function_obj, initial_el_to_render);
  17828. },
  17829. selectOnKeydown: false
  17830. });
  17831. initial_el_to_render.append(' <span class="span_command_spec"> </span> ');
  17832. initial_el_to_render.append(start_menu);
  17833. initial_el_to_render.append(' <span class="span_command_spec"> </span> ');
  17834. }
  17835. /***/ }),
  17836. /***/ "./js/visualUI/commands/contextualized_menu.js":
  17837. /*!*****************************************************!*\
  17838. !*** ./js/visualUI/commands/contextualized_menu.js ***!
  17839. \*****************************************************/
  17840. /*! exports provided: renderMenu */
  17841. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17842. "use strict";
  17843. __webpack_require__.r(__webpack_exports__);
  17844. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenu", function() { return renderMenu; });
  17845. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17846. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17847. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17848. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17849. /* harmony import */ var _switch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./switch */ "./js/visualUI/commands/switch.js");
  17850. function renderMenu(command, dom_where_render, function_obj, dom_command) {
  17851. var menu_div = '<div class="ui dropdown menu_commands" ><i class="icon code"></i> <div class="menu"> ';
  17852. 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) {
  17853. menu_div += '<a class="item" data-command="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"] + '"><i class="download icon"></i> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_break') + ' </a>';
  17854. } else {
  17855. menu_div += '<a class="item" data-command="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"] + '"><i class="download icon"></i> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_break') + ' </a>';
  17856. menu_div += '<a class="item" data-command="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].switchcase + '"><i class="download icon"></i> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_case') + ' </a>';
  17857. }
  17858. menu_div += '</div></div>';
  17859. menu_div = $(menu_div);
  17860. dom_where_render.append(menu_div);
  17861. addHandlers(command, dom_where_render, function_obj, dom_command);
  17862. }
  17863. function addHandlers(command, dom_where_render, function_obj, dom_command) {
  17864. dom_where_render.find('.menu_commands').dropdown({
  17865. on: 'hover'
  17866. });
  17867. dom_where_render.find('.menu_commands a').on('click', function (evt) {
  17868. 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) {
  17869. if (command.commands_block == null || command.commands_block.length == 0) {
  17870. command.commands_block = [];
  17871. var new_cmd = _commands__WEBPACK_IMPORTED_MODULE_2__["genericCreateCommand"]($(this).data('command'));
  17872. command.commands_block.push(new_cmd);
  17873. _commands__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](new_cmd, dom_command.find('.block_commands'), 3, function_obj);
  17874. } else {
  17875. _commands__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"](function_obj, dom_command.find('.block_commands'), $(this).data('command'), evt);
  17876. }
  17877. } else {
  17878. switch ($(this).data('command')) {
  17879. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  17880. _commands__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"](function_obj, dom_command.find('.block_commands'), $(this).data('command'), evt);
  17881. break;
  17882. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].switchcase:
  17883. addCaseToSwitch(command, dom_where_render, function_obj, dom_command);
  17884. break;
  17885. }
  17886. }
  17887. });
  17888. }
  17889. function addCaseToSwitch(command, dom_where_render, function_obj, dom_command) {
  17890. if (command.cases == null) {
  17891. command.cases = [];
  17892. }
  17893. 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));
  17894. command.cases.push(sc);
  17895. _switch__WEBPACK_IMPORTED_MODULE_4__["renderCase"](sc, command, function_obj, dom_command.find('.all_cases_div'));
  17896. }
  17897. /***/ }),
  17898. /***/ "./js/visualUI/commands/dowhiletrue.js":
  17899. /*!*********************************************!*\
  17900. !*** ./js/visualUI/commands/dowhiletrue.js ***!
  17901. \*********************************************/
  17902. /*! exports provided: createFloatingCommand, renderCommand */
  17903. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17904. "use strict";
  17905. __webpack_require__.r(__webpack_exports__);
  17906. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17907. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17908. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17909. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17910. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  17911. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  17912. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  17913. function createFloatingCommand() {
  17914. 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>');
  17915. }
  17916. function renderCommand(command, function_obj) {
  17917. var ret = '';
  17918. ret += '<div class="ui dowhiletrue command_container"> <i class="ui icon small sync command_drag"></i> <i class="ui icon times red button_remove_command"></i> <div class="ui context_menu"></div> <span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_command_do') + ' </span>';
  17919. ret += '<div class="ui block_commands" data-subblock="" data-idcommand="">';
  17920. ret += '</div>';
  17921. ret += ' <span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_command_do_until') + ' </span> <span class="span_command_spec"> ( </span> <div class="conditional_expression"></div> <span class="span_command_spec"> ) </span>';
  17922. ret += '</div>';
  17923. var el = $(ret);
  17924. el.data('command', command);
  17925. el.find('.block_commands').data('command', command);
  17926. addHandlers(command, function_obj, el);
  17927. _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'));
  17928. if (command.expression) {
  17929. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  17930. }
  17931. if (command.commands_block) {
  17932. for (var j = 0; j < command.commands_block.length; j++) {
  17933. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  17934. }
  17935. }
  17936. return el;
  17937. }
  17938. function addHandlers(command, function_obj, dowhiletrue_dom) {
  17939. dowhiletrue_dom.find('.button_remove_command').on('click', function () {
  17940. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, dowhiletrue_dom)) {
  17941. dowhiletrue_dom.fadeOut(400, function () {
  17942. dowhiletrue_dom.remove();
  17943. });
  17944. }
  17945. });
  17946. }
  17947. /***/ }),
  17948. /***/ "./js/visualUI/commands/functioncall.js":
  17949. /*!**********************************************!*\
  17950. !*** ./js/visualUI/commands/functioncall.js ***!
  17951. \**********************************************/
  17952. /*! exports provided: createFloatingCommand, renderCommand */
  17953. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17954. "use strict";
  17955. __webpack_require__.r(__webpack_exports__);
  17956. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17957. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17958. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17959. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17960. function createFloatingCommand() {
  17961. return $('<div class="ui functioncall created_element"> <i class="hand point right icon"></i> <span> funcao() </span></div>');
  17962. }
  17963. function renderCommand(command, function_obj) {
  17964. 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>');
  17965. el.data('command', command);
  17966. _variable_value_menu__WEBPACK_IMPORTED_MODULE_0__["renderMenu"](command, command.function_called, el.find('.var_value_menu_div'), function_obj);
  17967. addHandlers(command, function_obj, el);
  17968. return el;
  17969. }
  17970. function addHandlers(command, function_obj, functioncall_dom) {
  17971. functioncall_dom.find('.button_remove_command').on('click', function () {
  17972. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, functioncall_dom)) {
  17973. functioncall_dom.fadeOut(400, function () {
  17974. functioncall_dom.remove();
  17975. });
  17976. }
  17977. });
  17978. }
  17979. /***/ }),
  17980. /***/ "./js/visualUI/commands/generic_expression.js":
  17981. /*!****************************************************!*\
  17982. !*** ./js/visualUI/commands/generic_expression.js ***!
  17983. \****************************************************/
  17984. /*! exports provided: renderExpression */
  17985. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17986. "use strict";
  17987. __webpack_require__.r(__webpack_exports__);
  17988. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderExpression", function() { return renderExpression; });
  17989. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types */ "./js/visualUI/types.js");
  17990. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17991. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17992. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17993. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../services/userLog */ "./js/services/userLog.js");
  17994. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  17995. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_5__);
  17996. window.timer = false;
  17997. function renderExpression(command, function_obj, div_to_render, expression_array) {
  17998. div_to_render.empty();
  17999. melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.unwatch(command, "expression");
  18000. melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.watch(command, "expression", function () {
  18001. if (window.timer) return;
  18002. var m = div_to_render.find(".single_element_expression").not(".mouse_distance").not(".add_parentheses");
  18003. var s = "";
  18004. m.each(function (e) {
  18005. if ($(this).hasClass("parentheses_in_expression")) {
  18006. s += $(this).text() + " ";
  18007. } else {
  18008. s += $(this).find(".text").text();
  18009. s += $(this).find(".var_name").text();
  18010. s += $(this).find(".parameters_function_called").text();
  18011. s += $(this).find(".value_rendered").text();
  18012. s += " ";
  18013. }
  18014. });
  18015. if (s) {
  18016. window.timer = true;
  18017. } else {
  18018. return;
  18019. }
  18020. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_COMMAND_EXP, command.type, "/", s);
  18021. setTimeout(function () {
  18022. window.timer = false;
  18023. }, 200);
  18024. }, 20, true);
  18025. if (command.type === _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].attribution) {
  18026. melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.unwatch(command.variable);
  18027. melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.watch(command.variable, function () {
  18028. renderExpression(command, function_obj, div_to_render, expression_array);
  18029. }, 0);
  18030. if (command.variable.content) {
  18031. var types_included = [];
  18032. if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER || command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  18033. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
  18034. } else if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  18035. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional);
  18036. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic);
  18037. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
  18038. } else if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  18039. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional);
  18040. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic);
  18041. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
  18042. } else {
  18043. console.log("NÃO RECONHECI! VEJA: ", command.variable.content.type);
  18044. }
  18045. renderElements(command, function_obj, div_to_render, expression_array, types_included);
  18046. } else {
  18047. div_to_render.text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("var_menu_select_var").toLowerCase());
  18048. }
  18049. } else {
  18050. var _types_included = [];
  18051. _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional);
  18052. _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic);
  18053. if (command.type === _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].writer) _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep);
  18054. _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
  18055. renderElements(command, function_obj, div_to_render, expression_array, _types_included);
  18056. }
  18057. div_to_render.children(".mouse_distance").addClass("mouse_distance_hidden");
  18058. div_to_render.children(".higher_element").on("mousemove", function (evt) {
  18059. if (!window.open_or_close) {
  18060. $(this).css("position", "relative", "!important");
  18061. $(this).children(".mouse_distance").css("opacity", "1");
  18062. }
  18063. });
  18064. div_to_render.children(".higher_element").on("mouseout", function (evt) {
  18065. if (!window.open_or_close) {
  18066. $(this).css("position", "absolute", "!important");
  18067. $(this).children(".mouse_distance").css("opacity", "0");
  18068. }
  18069. });
  18070. var lixeira = $('<div class="lixeira" draggable="true"></div>');
  18071. div_to_render.find(".single_element_expression").on("mousedown", function (evt) {
  18072. window.posX = evt.clientX;
  18073. window.posY = evt.clientY;
  18074. });
  18075. Sortable.create(div_to_render[0], {
  18076. animation: 100,
  18077. ghostClass: "ghost",
  18078. group: {
  18079. name: "shared",
  18080. put: false // Do not allow items to be put into this list
  18081. },
  18082. draggable: ".single_element_expression",
  18083. sort: false,
  18084. filter: ".not_allowed",
  18085. onStart: function onStart() {
  18086. $("body").append(lixeira);
  18087. lixeira.css("display", "block");
  18088. lixeira.css("top", window.posY + 70, "!important");
  18089. lixeira.css("left", window.posX - 20, "!important");
  18090. },
  18091. onMove: function onMove() {
  18092. lixeira.addClass("color_test");
  18093. },
  18094. onEnd: function onEnd() {
  18095. lixeira.remove();
  18096. div_to_render.find(".ghost").removeClass("ghost");
  18097. }
  18098. });
  18099. new Sortable(lixeira[0], {
  18100. group: "shared",
  18101. animation: 150,
  18102. onAdd: function onAdd(evt) {
  18103. lixeira.css("display", "none");
  18104. lixeira.find(".single_element_expression").remove();
  18105. lixeira.css("background-color", "");
  18106. lixeira.remove();
  18107. removeElement(evt, expression_array);
  18108. renderExpression(command, function_obj, div_to_render, expression_array);
  18109. }
  18110. });
  18111. }
  18112. function removeElement(event, expression_array) {
  18113. var indice = $(event.item).data("index");
  18114. var first = expression_array[0];
  18115. console.log("indice: ", indice);
  18116. if (expression_array[indice].type) {
  18117. // if is alone in expression:
  18118. if (expression_array.length == 1) {
  18119. //function_obj.commands.splice(function_obj.commands.indexOf(command), 1);
  18120. expression_array.splice(0, 1);
  18121. } else if (expression_array.length > 1) {
  18122. if (indice > 0 && expression_array[indice - 1].type_op) {
  18123. if (indice < expression_array.length && expression_array[indice - 2] == "(" && expression_array[indice + 1].type_op) {
  18124. expression_array.splice(indice + 1, 1);
  18125. }
  18126. expression_array.splice(indice, 1);
  18127. expression_array.splice(indice - 1, 1);
  18128. if (indice - 2 < expression_array.length && expression_array[indice - 2] == "(" && expression_array[indice - 1] == ")") {
  18129. expression_array.splice(indice - 1, 1);
  18130. expression_array.splice(indice - 2, 1);
  18131. if (indice - 3 >= 0 && indice - 3 < expression_array.length && expression_array[indice - 3].type_op) {
  18132. expression_array.splice(indice - 3, 1);
  18133. }
  18134. }
  18135. } else if (indice < expression_array.length - 1 && expression_array[indice + 1].type_op) {
  18136. expression_array.splice(indice + 1, 1);
  18137. expression_array.splice(indice, 1);
  18138. } else if (indice < expression_array.length - 1 && indice > 0 && expression_array[indice - 1] == "(" && expression_array[indice + 1] == ")") {
  18139. if (indice > 1 && expression_array[indice - 2].type_op) {
  18140. expression_array.splice(indice + 1, 1);
  18141. expression_array.splice(indice, 1);
  18142. expression_array.splice(indice - 1, 1);
  18143. expression_array.splice(indice - 2, 1);
  18144. } else if (indice < expression_array.length - 2 && expression_array[indice + 2].type_op) {
  18145. expression_array.splice(indice + 1, 1);
  18146. expression_array.splice(indice, 1);
  18147. expression_array.splice(indice - 1, 1);
  18148. } else {
  18149. expression_array.splice(indice + 1, 1);
  18150. expression_array.splice(indice, 1);
  18151. expression_array.splice(indice - 1, 1);
  18152. }
  18153. }
  18154. }
  18155. } else if (expression_array[indice].type_op) {// iVProg doesn't support operator remove
  18156. } else {
  18157. var opening = -1;
  18158. var closing = -1;
  18159. if (expression_array[indice] == "(") {
  18160. opening = indice;
  18161. for (var i = indice + 1; i < expression_array.length; i++) {
  18162. if (expression_array[i] == ")") {
  18163. closing = i;
  18164. break;
  18165. }
  18166. }
  18167. } else {
  18168. closing = indice;
  18169. for (var i = indice - 1; i >= 0; i--) {
  18170. if (expression_array[i] == "(") {
  18171. opening = i;
  18172. break;
  18173. }
  18174. }
  18175. }
  18176. if (expression_array[opening + 1].type_op) {
  18177. expression_array.splice(closing, 1);
  18178. expression_array.splice(opening + 1, 1);
  18179. expression_array.splice(opening, 1);
  18180. } else {
  18181. expression_array.splice(closing, 1);
  18182. expression_array.splice(opening, 1);
  18183. }
  18184. } // if expression is empty, add a new var value:
  18185. if (expression_array.length == 0) {
  18186. expression_array.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_3__["VAR_OR_VALUE_TYPES"].all, null, null, null, true));
  18187. }
  18188. if (first != expression_array[0] && expression_array[0].type_op) {
  18189. expression_array.splice(0, 1);
  18190. }
  18191. }
  18192. function renderElements(command, function_obj, div_to_render, expression_array, types_included) {
  18193. /*if (expression_array.length > 0) {
  18194. if (!expression_array[0].type_op) {
  18195. renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, 0);
  18196. }
  18197. }*/
  18198. var i = 0;
  18199. for (i = 0; i < expression_array.length; i++) {
  18200. if (expression_array[i].type == "var_value") {
  18201. var div_temp = $('<div class="single_element_expression" data-index="' + i + '"></div>');
  18202. if (i == 0) {
  18203. if (expression_array.length > 0 && !expression_array[0].type_op) {//renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, 0);
  18204. }
  18205. }
  18206. _variable_value_menu__WEBPACK_IMPORTED_MODULE_3__["renderMenu"](command, expression_array[i], div_temp, function_obj);
  18207. div_to_render.append(div_temp);
  18208. } else if (expression_array[i] == "(" || expression_array[i] == ")") {
  18209. if (expression_array[i] == ")") {
  18210. renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, i);
  18211. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  18212. } else if (expression_array[i] == "(" && !expression_array[i + 1].type_op) {
  18213. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  18214. renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, i + 1);
  18215. } else {
  18216. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  18217. }
  18218. } else {
  18219. if (i == 0) {
  18220. console.log("NEGAÇÃO NO PRIMEIRO ELEMENTO");
  18221. } else if (expression_array[i - 1] == "(") {
  18222. console.log("NEGAÇÃO APÓS O PARÊNTESES");
  18223. }
  18224. renderOperatorMenu(command, function_obj, div_to_render, expression_array[i], types_included, i, expression_array);
  18225. }
  18226. }
  18227. renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, i, true);
  18228. renderAddParenthesis(command, function_obj, div_to_render, expression_array, types_included);
  18229. }
  18230. window.parentheses_activate = false;
  18231. window.open_or_close = null;
  18232. function renderAddParenthesis(command, function_obj, div_to_render, expression_array, types_included) {
  18233. 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>');
  18234. div_to_render.append(addParentheses);
  18235. addParentheses.popup({
  18236. content: "Adicionar parênteses",
  18237. delay: {
  18238. show: 750,
  18239. hide: 0
  18240. }
  18241. });
  18242. addParentheses.on("click", function (mouse_event) {
  18243. // verificar se já está ativado
  18244. if (window.parentheses_activate) {
  18245. return;
  18246. }
  18247. div_to_render.find(".usepointer").off("click");
  18248. window.parentheses_activate = true;
  18249. window.open_or_close = "open";
  18250. div_to_render.find(".dropdown").addClass("disabled");
  18251. div_to_render.find(".ghost_element").addClass("temp_class");
  18252. div_to_render.find(".ghost_element").removeClass("ghost_element");
  18253. var floatingObject = $('<div class="floating_parenthesis"> ( </div>');
  18254. floatingObject.draggable().appendTo("body");
  18255. floatingObject.css("position", "absolute");
  18256. mouse_event.type = "mousedown.draggable";
  18257. mouse_event.target = floatingObject[0];
  18258. floatingObject.css("left", mouse_event.pageX + 10);
  18259. floatingObject.css("top", mouse_event.pageY + 10);
  18260. floatingObject.trigger(mouse_event);
  18261. div_to_render.on("mousemove", function (evt) {
  18262. var actual_target = null;
  18263. if ($(evt.target).hasClass("single_element_expression")) {
  18264. actual_target = $(evt.target);
  18265. } else {
  18266. actual_target = $(evt.target).closest(".single_element_expression");
  18267. }
  18268. 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")) {
  18269. return;
  18270. }
  18271. renderGhostParentheses(actual_target, command, function_obj, div_to_render, expression_array);
  18272. });
  18273. div_to_render.on("mouseleave", function () {
  18274. /*window.open_parentheses.remove();
  18275. window.close_parentheses.remove();*/
  18276. });
  18277. var floating;
  18278. $("body").on("mouseup", function (evt) {
  18279. if (window.open_or_close == "open") {
  18280. window.open_or_close = "close";
  18281. floatingObject.remove();
  18282. var comando_que_esta = $(evt.target).closest(".command_container");
  18283. var comando_certo = div_to_render.closest(".command_container");
  18284. if (!comando_que_esta.is(comando_certo)) {
  18285. window.parentheses_activate = false;
  18286. div_to_render.find(".temp_class").addClass("ghost_element");
  18287. div_to_render.find(".temp_class").removeClass("temp_class");
  18288. div_to_render.off("mousemove");
  18289. div_to_render.off("mouseleave");
  18290. $("body").off("mouseup");
  18291. window.open_parentheses.remove();
  18292. window.close_parentheses.remove();
  18293. window.inserir_open = -1;
  18294. window.inserir_close = -1;
  18295. window.open_or_close = null;
  18296. renderExpression(command, function_obj, div_to_render, expression_array);
  18297. return;
  18298. }
  18299. window.open_parentheses.addClass("parentheses_fixed");
  18300. floating = $('<div class="floating_parenthesis"> ) </div>');
  18301. floating.draggable().appendTo("body");
  18302. floating.css("position", "absolute");
  18303. floating.css("left", evt.pageX + 10);
  18304. floating.css("top", evt.pageY + 10);
  18305. $("body").on("mousemove", function (evts) {
  18306. floating.css("left", evts.pageX + 10);
  18307. floating.css("top", evts.pageY + 10);
  18308. });
  18309. } else {
  18310. floating.remove();
  18311. window.open_parentheses.removeClass("parentheses_fixed");
  18312. div_to_render.off("mousemove");
  18313. div_to_render.off("mouseleave");
  18314. $("body").off("mouseup");
  18315. setTimeout(function () {
  18316. window.parentheses_activate = false;
  18317. }, 50);
  18318. var comando_que_esta = $(evt.target).closest(".command_container");
  18319. var comando_certo = div_to_render.closest(".command_container");
  18320. var is_correct = false;
  18321. if (comando_que_esta.is(comando_certo)) {
  18322. is_correct = true;
  18323. }
  18324. if (is_correct) {
  18325. expression_array.splice(window.inserir_open, 0, "(");
  18326. expression_array.splice(window.inserir_close, 0, ")");
  18327. }
  18328. window.inserir_open = -1;
  18329. window.inserir_close = -1;
  18330. window.open_or_close = null;
  18331. renderExpression(command, function_obj, div_to_render, expression_array);
  18332. }
  18333. });
  18334. });
  18335. }
  18336. window.open_parentheses = $('<div class="parentheses_ghost">(</div>');
  18337. window.close_parentheses = $('<div class="parentheses_ghost">)</div>');
  18338. window.inserir_open = -1;
  18339. window.inserir_close = -1;
  18340. function renderGhostParentheses(actual_target, command, function_obj, div_to_render, expression_array) {
  18341. /*window.open_parentheses.remove();
  18342. window.close_parentheses.remove();*/
  18343. var index_in_array = actual_target.data("index");
  18344. if (expression_array[index_in_array] == "(" || expression_array[index_in_array] == ")") {
  18345. return;
  18346. }
  18347. if (window.open_or_close == "close") {
  18348. if (index_in_array < window.inserir_open) {
  18349. return;
  18350. }
  18351. } // Tratando a situação quando é na primeira posição:
  18352. if (index_in_array == 0) {
  18353. if (expression_array[index_in_array].type == "var_value") {
  18354. if (window.open_or_close == "open") {
  18355. window.open_parentheses.insertBefore(actual_target);
  18356. window.inserir_open = index_in_array;
  18357. }
  18358. /*if (expression_array.length == 1) {
  18359. if (window.open_or_close == "close") {
  18360. window.close_parentheses.insertAfter(actual_target);
  18361. window.inserir_close = index_in_array + 2;
  18362. }*/
  18363. //} else {
  18364. var count_opened = 0;
  18365. var count_closed = 0;
  18366. for (var i = 0; i < expression_array.length; i++) {
  18367. if (expression_array[i] == "(") {
  18368. count_opened++;
  18369. }
  18370. if (expression_array[i] == ")") {
  18371. count_closed++;
  18372. }
  18373. if (count_opened != count_closed) {} else {
  18374. if (count_opened > 0) {
  18375. if (window.open_or_close == "close") {
  18376. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  18377. window.inserir_close = i + 2;
  18378. }
  18379. break;
  18380. } else {
  18381. if (expression_array[i].type == "var_value") {
  18382. if (window.open_or_close == "close") {
  18383. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  18384. window.inserir_close = i + 2;
  18385. }
  18386. break;
  18387. }
  18388. }
  18389. }
  18390. } //}
  18391. } else if (expression_array[index_in_array].type_op) {
  18392. if (window.open_or_close == "open") {
  18393. window.open_parentheses.insertBefore(actual_target);
  18394. window.inserir_open = index_in_array;
  18395. }
  18396. var count_opened = 0;
  18397. var count_closed = 0;
  18398. for (var i = 1; i < expression_array.length; i++) {
  18399. // $('.slide-link[data-slide="0"]')
  18400. if (expression_array[i] == "(") {
  18401. count_opened++;
  18402. }
  18403. if (expression_array[i] == ")") {
  18404. count_closed++;
  18405. }
  18406. if (count_opened != count_closed) {} else {
  18407. if (count_opened > 0) {
  18408. if (expression_array[i].type == "var_value") {
  18409. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  18410. window.inserir_close = i + 2;
  18411. }
  18412. break;
  18413. } else {
  18414. if (expression_array[i].type == "var_value") {
  18415. if (expression_array[i].type == "var_value") {
  18416. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  18417. window.inserir_close = i + 2;
  18418. }
  18419. break;
  18420. }
  18421. }
  18422. }
  18423. }
  18424. }
  18425. return;
  18426. } // Tratando quando não é no índice 0:
  18427. if (expression_array[index_in_array].type == "var_value") {
  18428. if (window.open_or_close == "open") {
  18429. window.open_parentheses.insertBefore(actual_target);
  18430. window.inserir_open = index_in_array;
  18431. }
  18432. if (window.open_or_close == "close") {
  18433. window.close_parentheses.insertAfter(actual_target);
  18434. window.inserir_close = index_in_array + 2;
  18435. }
  18436. return;
  18437. }
  18438. if (expression_array[index_in_array].type_op) {
  18439. // buscar para a esquerda primeiro:
  18440. if (expression_array[index_in_array - 1] == "(") {
  18441. if (window.open_or_close == "open") {
  18442. window.open_parentheses.insertBefore(actual_target);
  18443. window.inserir_open = index_in_array;
  18444. }
  18445. } else if (expression_array[index_in_array - 1] == ")") {
  18446. // buscar a abertura
  18447. var count_opened = 0;
  18448. var count_closed = 0;
  18449. for (var j = index_in_array - 1; j >= 0; j--) {
  18450. if (expression_array[j] == "(") {
  18451. count_opened++;
  18452. }
  18453. if (expression_array[j] == ")") {
  18454. count_closed++;
  18455. }
  18456. if (count_opened != count_closed) {} else {
  18457. if (count_closed > 0) {
  18458. if (window.open_or_close == "open") {
  18459. window.open_parentheses.insertBefore(div_to_render.find('.single_element_expression[data-index="' + j + '"]'));
  18460. window.inserir_open = j;
  18461. }
  18462. break;
  18463. }
  18464. }
  18465. }
  18466. } else if (expression_array[index_in_array - 1].type == "var_value") {
  18467. if (window.open_or_close == "open") {
  18468. window.open_parentheses.insertBefore(div_to_render.find('.single_element_expression[data-index="' + (index_in_array - 1) + '"]'));
  18469. window.inserir_open = index_in_array - 1;
  18470. }
  18471. } // buscar para a direita agora:
  18472. if (expression_array[index_in_array + 1] == "(") {
  18473. // buscar o fechamento:
  18474. var count_opened = 0;
  18475. var count_closed = 0;
  18476. for (var j = index_in_array + 1; j < expression_array.length; j++) {
  18477. if (expression_array[j] == "(") {
  18478. count_opened++;
  18479. }
  18480. if (expression_array[j] == ")") {
  18481. count_closed++;
  18482. }
  18483. if (count_opened != count_closed) {} else {
  18484. if (count_opened > 0) {
  18485. if (window.open_or_close == "close") {
  18486. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + j + '"]'));
  18487. window.inserir_close = j + 2;
  18488. }
  18489. break;
  18490. }
  18491. }
  18492. }
  18493. } else if (expression_array[index_in_array + 1].type == "var_value") {
  18494. if (window.open_or_close == "close") {
  18495. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + (index_in_array + 1) + '"]'));
  18496. window.inserir_close = index_in_array + 3;
  18497. }
  18498. }
  18499. }
  18500. }
  18501. function renderParenthesis(div_to_render, expression_content, command, function_obj, position, expression_array) {
  18502. var ghost_parenthesis = $('<div class="single_element_expression parentheses_in_expression" data-index="' + position + '">' + expression_content + "</div>");
  18503. div_to_render.append(ghost_parenthesis);
  18504. }
  18505. function renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, position) {
  18506. var menu_final = '<div class="ui dropdown disabled usepointer"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  18507. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18508. if (types_included.length > 1) {
  18509. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
  18510. menu_final += getArithmeticOperators();
  18511. menu_final += "</div></div>";
  18512. } else {
  18513. menu_final += getArithmeticOperators();
  18514. }
  18515. }
  18516. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18517. if (types_included.length > 1) {
  18518. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
  18519. menu_final += getLogicOperators();
  18520. menu_final += "</div></div>";
  18521. } else {
  18522. menu_final += getLogicOperators();
  18523. }
  18524. }
  18525. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18526. if (types_included.length > 1) {
  18527. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
  18528. menu_final += getRelationalOperators();
  18529. menu_final += "</div></div>";
  18530. } else {
  18531. menu_final += getRelationalOperators();
  18532. }
  18533. }
  18534. menu_final += "</div></div>";
  18535. menu_final = $(menu_final);
  18536. var div_temp = $('<div class="single_element_expression ghost_element mouse_distance"></div>');
  18537. div_temp.append(menu_final);
  18538. var div_higher = $('<div class="higher_element"></div>');
  18539. div_higher.append(div_temp);
  18540. div_to_render.append(div_higher);
  18541. menu_final.dropdown("set selected", _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus);
  18542. div_temp.on("click", function () {
  18543. if (!window.open_or_close) {
  18544. var sera = position;
  18545. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18546. console.log("p1");
  18547. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus));
  18548. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18549. console.log("p2");
  18550. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to));
  18551. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18552. console.log("p3");
  18553. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than));
  18554. }
  18555. renderExpression(command, function_obj, div_to_render, expression_array);
  18556. }
  18557. });
  18558. }
  18559. function renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, position) {
  18560. var is_last = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
  18561. var menu_final = '<div class="ui dropdown disabled usepointer"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  18562. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18563. if (types_included.length > 1) {
  18564. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
  18565. menu_final += getArithmeticOperators();
  18566. menu_final += "</div></div>";
  18567. } else {
  18568. menu_final += getArithmeticOperators();
  18569. }
  18570. }
  18571. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18572. if (types_included.length > 1) {
  18573. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
  18574. menu_final += getLogicOperators();
  18575. menu_final += "</div></div>";
  18576. } else {
  18577. menu_final += getLogicOperators();
  18578. }
  18579. }
  18580. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18581. if (types_included.length > 1) {
  18582. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
  18583. menu_final += getRelationalOperators();
  18584. menu_final += "</div></div>";
  18585. } else {
  18586. menu_final += getRelationalOperators();
  18587. }
  18588. }
  18589. menu_final += "</div></div>";
  18590. menu_final = $(menu_final);
  18591. var div_temp = $('<div class="simple_add mouse_distance"></div>');
  18592. var div_higher = $('<div class="higher_element"></div>');
  18593. var button = $('<button class="ui button green add_expression"><i class="plus circle inverted icon"></i></button>');
  18594. div_temp.append(button);
  18595. if (!is_last) {
  18596. div_higher.append(div_temp);
  18597. div_to_render.append(div_higher); //div_temp.append(menu_final);
  18598. div_temp.css("opacity", "0", "!important");
  18599. } else {
  18600. div_temp.removeClass("mouse_distance");
  18601. div_temp.css("opacity", "1", "!important"); //div_temp.append(menu_final);
  18602. div_to_render.append(div_temp);
  18603. }
  18604. menu_final.dropdown("set selected", _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus);
  18605. div_temp.on("click", function () {
  18606. var sera = position;
  18607. if (expression_array[sera] == ")" && expression_array[sera - 1] == "(") {
  18608. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_3__["VAR_OR_VALUE_TYPES"].all, null, null, null, true));
  18609. renderExpression(command, function_obj, div_to_render, expression_array);
  18610. return;
  18611. }
  18612. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18613. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus));
  18614. expression_array.splice(sera + 1, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_3__["VAR_OR_VALUE_TYPES"].all, null, null, null, true));
  18615. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18616. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to));
  18617. expression_array.splice(sera + 1, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_3__["VAR_OR_VALUE_TYPES"].all, null, null, null, true));
  18618. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18619. expression_array.splice(sera, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ExpressionOperator"](_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than));
  18620. expression_array.splice(sera + 1, 0, new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_3__["VAR_OR_VALUE_TYPES"].all, null, null, null, true));
  18621. }
  18622. renderExpression(command, function_obj, div_to_render, expression_array);
  18623. });
  18624. }
  18625. function renderOperatorMenu(command, function_obj, div_to_render, expression_element, types_included, position, expression_array) {
  18626. var menu_final = '<div class="ui dropdown"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  18627. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  18628. if (types_included.length > 1) {
  18629. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
  18630. menu_final += getArithmeticOperators();
  18631. menu_final += "</div></div>";
  18632. } else {
  18633. menu_final += getArithmeticOperators();
  18634. }
  18635. }
  18636. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep) >= 0) {
  18637. menu_final += getSeparator();
  18638. }
  18639. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  18640. if (types_included.length > 1) {
  18641. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
  18642. menu_final += getLogicOperators();
  18643. menu_final += "</div></div>";
  18644. } else {
  18645. menu_final += getLogicOperators();
  18646. }
  18647. }
  18648. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  18649. if (types_included.length > 1) {
  18650. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
  18651. menu_final += getRelationalOperators();
  18652. menu_final += "</div></div>";
  18653. } else {
  18654. menu_final += getRelationalOperators();
  18655. }
  18656. }
  18657. menu_final += "</div></div>";
  18658. menu_final = $(menu_final);
  18659. var div_temp = $('<div class="single_element_expression not_allowed" data-index="' + position + '"></div>');
  18660. div_temp.append(menu_final);
  18661. div_to_render.append(div_temp);
  18662. menu_final.dropdown({
  18663. onChange: function onChange(_value, _text, $selectedItem) {
  18664. expression_element.item = $selectedItem.data("value");
  18665. expression_element.type_op = $selectedItem.data("type");
  18666. }
  18667. });
  18668. menu_final.dropdown("set selected", expression_element.item);
  18669. }
  18670. function getArithmeticOperators() {
  18671. var arithmetic_operators;
  18672. arithmetic_operators = '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus + '">+</div>';
  18673. arithmetic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus + '">-</div>';
  18674. arithmetic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].multiplication + '">*</div>';
  18675. arithmetic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].division + '">/</div>';
  18676. arithmetic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].module + '">%</div>';
  18677. return arithmetic_operators;
  18678. }
  18679. function getLogicOperators() {
  18680. var logic_operators;
  18681. logic_operators = '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to + '">==</div>';
  18682. logic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not_equals_to + '">!=</div>';
  18683. logic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].and + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_and") + "</div>";
  18684. logic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].or + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_or") + "</div>";
  18685. logic_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_not") + "</div>";
  18686. return logic_operators;
  18687. }
  18688. function getRelationalOperators() {
  18689. var relational_operators;
  18690. relational_operators = '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than + '">></div>';
  18691. relational_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than + '"><</div>';
  18692. relational_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].equals_to + '">==</div>';
  18693. relational_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].not_equals_to + '">!=</div>';
  18694. relational_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to + '">>=</div>';
  18695. relational_operators += '<div class="item" data-type="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional + '" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than_or_equals_to + '"><=</div>';
  18696. return relational_operators;
  18697. }
  18698. function getSeparator() {
  18699. return "<div class=\"item\" data-type=\"".concat(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep, "\" data-value=\"").concat(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep, "\">,</div>");
  18700. }
  18701. /***/ }),
  18702. /***/ "./js/visualUI/commands/iftrue.js":
  18703. /*!****************************************!*\
  18704. !*** ./js/visualUI/commands/iftrue.js ***!
  18705. \****************************************/
  18706. /*! exports provided: createFloatingCommand, renderCommand */
  18707. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18708. "use strict";
  18709. __webpack_require__.r(__webpack_exports__);
  18710. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18711. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18712. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18713. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18714. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  18715. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  18716. function createFloatingCommand() {
  18717. return $('<div class="ui iftrue created_element"> <i class="ui icon small random"></i> <span> if (x < 1) { } </span></div>');
  18718. }
  18719. function renderCommand(command, function_obj) {
  18720. var ret = '';
  18721. 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>';
  18722. ret += '<span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_if') + '</span>';
  18723. ret += ' <span class="span_command_spec"> ( </span> <div class="conditional_expression"></div> <span class="span_command_spec"> ) </span>';
  18724. ret += '<span> </span> ';
  18725. ret += '<div class="ui block_commands commands_if conditional_comands_block" data-if="true">';
  18726. ret += '</div></div>';
  18727. 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>';
  18728. ret += '<div class="ui block_commands commands_else conditional_comands_block" data-else="true">';
  18729. ret += '</div>';
  18730. ret += '<span></span></div>';
  18731. ret += '</div>';
  18732. var el = $(ret);
  18733. el.data('command', command);
  18734. el.find('.block_commands').data('command', command);
  18735. el.find('.data_block_if').data('command', command);
  18736. el.find('.data_block_else').data('command', command);
  18737. el.find('.commands_if').data('command', command);
  18738. addHandlers(command, function_obj, el); //ConditionalExpressionManagement.renderExpression(command, command.expression, function_obj, el.find('.conditional_expression'));
  18739. _generic_expression__WEBPACK_IMPORTED_MODULE_3__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  18740. if (command.commands_block) {
  18741. for (var j = 0; j < command.commands_block.length; j++) {
  18742. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.commands_if')[0]), 3, function_obj);
  18743. }
  18744. }
  18745. if (command.commands_else) {
  18746. for (var j = 0; j < command.commands_else.length; j++) {
  18747. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_else[j], $(el.find('.commands_else')[0]), 3, function_obj);
  18748. }
  18749. }
  18750. return el;
  18751. }
  18752. function addHandlers(command, function_obj, iftrue_dom) {
  18753. iftrue_dom.find('.button_remove_command').on('click', function () {
  18754. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, iftrue_dom)) {
  18755. iftrue_dom.fadeOut(400, function () {
  18756. iftrue_dom.remove();
  18757. });
  18758. }
  18759. });
  18760. }
  18761. /***/ }),
  18762. /***/ "./js/visualUI/commands/reader.js":
  18763. /*!****************************************!*\
  18764. !*** ./js/visualUI/commands/reader.js ***!
  18765. \****************************************/
  18766. /*! exports provided: createFloatingCommand, renderCommand */
  18767. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18768. "use strict";
  18769. __webpack_require__.r(__webpack_exports__);
  18770. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18771. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18772. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18773. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  18774. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18775. function createFloatingCommand() {
  18776. 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>');
  18777. }
  18778. function renderCommand(command, function_obj) {
  18779. 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>';
  18780. el = $(el);
  18781. el.data('command', command);
  18782. _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__["renderMenu"](command, command.variable_value_menu, el.find('.var_value_menu_div'), function_obj);
  18783. addHandlers(command, function_obj, el);
  18784. return el;
  18785. }
  18786. function addHandlers(command, function_obj, reader_dom) {
  18787. reader_dom.find('.button_remove_command').on('click', function () {
  18788. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, reader_dom)) {
  18789. reader_dom.fadeOut(400, function () {
  18790. reader_dom.remove();
  18791. });
  18792. }
  18793. });
  18794. }
  18795. /***/ }),
  18796. /***/ "./js/visualUI/commands/repeatNtimes.js":
  18797. /*!**********************************************!*\
  18798. !*** ./js/visualUI/commands/repeatNtimes.js ***!
  18799. \**********************************************/
  18800. /*! exports provided: createFloatingCommand, renderCommand, manageExpressionElements, manageClearExpressionElements */
  18801. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18802. "use strict";
  18803. __webpack_require__.r(__webpack_exports__);
  18804. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18805. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18806. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageExpressionElements", function() { return manageExpressionElements; });
  18807. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageClearExpressionElements", function() { return manageClearExpressionElements; });
  18808. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  18809. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18810. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18811. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  18812. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  18813. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  18814. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  18815. function createFloatingCommand() {
  18816. 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>');
  18817. }
  18818. function renderCommand(command, function_obj) {
  18819. var ret = "<div class=\"ui repeatNtimes command_container\"> \n\t\t<i class=\"ui icon small sync command_drag\"></i>\n\t\t<i class=\"ui icon times red button_remove_command\"></i>\n\t\t<div class=\"ui context_menu\"></div> <span class=\"span_command_spec\"> ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_for'), "\n\t\t</span> <div class=\"ui attribution_expression\">\n\t\t<div class=\"ui variable_attribution\"></div>\n\t\t<span class=\"text_receives span_command_spec\" style=\"margin-left: 10px;margin-right: 20px;\"></span>\n\t\t<div class=\"ui var_value_expression div_expression_st\"></div>\n\t\t</div>\n\t\t<span class=\"span_command_spec separator_character\" style=\"margin-left: 25px; margin-right: 15px;\">\n\t\t").concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_for_to"), " </span>\n\t\t<div class=\"conditional_expression\"></div> <div class=\"pass_button\"></div> \n\t\t<div class=\"ui incrementation_field\"><span class=\"text_inc_receives span_command_spec\"></span>\n\t\t<div class=\"ui first_operand\"></div><div class=\"ui operator\"></div>\n\t\t<div class=\"ui second_operand\"></div></div> <span class=\"span_command_spec\"> </span>'");
  18820. ret += '<div class="ui block_commands">';
  18821. ret += '</div>';
  18822. ret += '<span> </span>';
  18823. ret += '</div>';
  18824. var el = $(ret);
  18825. el.data('command', command);
  18826. el.find('.block_commands').data('command', command);
  18827. addHandlers(command, function_obj, el);
  18828. _contextualized_menu__WEBPACK_IMPORTED_MODULE_5__["renderMenu"](command, el.find('.context_menu'), function_obj, el);
  18829. _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'));
  18830. _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);
  18831. //VariableValueMenu.renderMenu(command, command.var_incrementation, el.find('.incrementation_variable'), function_obj);
  18832. //angle double right
  18833. if (!command.expression1) {
  18834. 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);
  18835. }
  18836. el.find('.text_receives').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_for_from"));
  18837. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression1, el.find('.var_value_expression'), function_obj);
  18838. if (!command.expression3) {
  18839. 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>');
  18840. el.find('.pass_button').find('button').on('click', function () {
  18841. togglePasso(command);
  18842. });
  18843. /*var exp = new Models.ExpressionElement(Models.EXPRESSION_ELEMENTS.exp_op_exp,
  18844. [command.var_attribution,
  18845. Models.ARITHMETIC_TYPES.plus,
  18846. new Models.VariableValueMenu(VariableValueMenu.VAR_OR_VALUE_TYPES.all, "1", null, null, true)]);
  18847. command.expression3 = exp;
  18848. command.var_incrementation = command.var_attribution;*/
  18849. } else {
  18850. 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>');
  18851. el.find('.pass_button').find('button').on('click', function () {
  18852. togglePasso(command);
  18853. });
  18854. renderOperator(command, function_obj, el.find('.operator'), command.expression3, 1);
  18855. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[2], el.find('.second_operand'), function_obj);
  18856. }
  18857. if (command.commands_block) {
  18858. for (var j = 0; j < command.commands_block.length; j++) {
  18859. _commands__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  18860. }
  18861. }
  18862. return el;
  18863. }
  18864. function togglePasso(command) {
  18865. if (!command.expression3) {
  18866. 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)]);
  18867. command.expression3 = exp;
  18868. command.var_incrementation = command.var_attribution;
  18869. } else {
  18870. command.expression3 = null;
  18871. }
  18872. renderAlgorithm();
  18873. }
  18874. function manageExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element) {
  18875. if (dom_object.hasClass('variable_attribution')) {
  18876. if (!command.expression3) {
  18877. 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)]);
  18878. command.expression3 = exp;
  18879. command.var_incrementation = command.var_attribution;
  18880. 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);
  18881. command.expression2.expression = cond_exp;
  18882. }
  18883. dom_object.parent().find('.text_receives').text('de');
  18884. 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);
  18885. dom_object.parent().find('.var_value_expression').empty();
  18886. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression1, dom_object.parent().find('.var_value_expression'), function_obj);
  18887. renderAlgorithm();
  18888. }
  18889. if (dom_object.hasClass('incrementation_variable')) {
  18890. dom_object.parent().find('.text_inc_receives').text('de');
  18891. 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)]);
  18892. command.expression3 = exp;
  18893. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[0], dom_object.parent().find('.first_operand'), function_obj);
  18894. renderOperator(command, function_obj, dom_object.parent().find('.operator'), command.expression3, 1);
  18895. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[2], dom_object.parent().find('.second_operand'), function_obj);
  18896. }
  18897. }
  18898. function manageClearExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element) {
  18899. if (dom_object.hasClass('variable_attribution')) {
  18900. $(dom_object).parent().find('.text_receives').text('');
  18901. command.expression1 = null;
  18902. $(dom_object).parent().find('.var_value_expression').empty();
  18903. }
  18904. if (dom_object.hasClass('incrementation_variable')) {
  18905. $(dom_object).parent().find('.text_inc_receives').text('');
  18906. command.expression3 = null;
  18907. $(dom_object).parent().find('.first_operand').empty();
  18908. $(dom_object).parent().find('.operator').empty();
  18909. $(dom_object).parent().find('.second_operand').empty();
  18910. }
  18911. }
  18912. function addHandlers(command, function_obj, repeatNtimes_dom) {
  18913. repeatNtimes_dom.find('.button_remove_command').on('click', function () {
  18914. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, repeatNtimes_dom)) {
  18915. repeatNtimes_dom.fadeOut(400, function () {
  18916. repeatNtimes_dom.remove();
  18917. });
  18918. }
  18919. });
  18920. }
  18921. function renderOperator(command, function_obj, temp_op, expression_element, index_op) {
  18922. var menu_operator = $('<div class="ui dropdown"><div class="text"></div></div>');
  18923. menu_operator.dropdown({
  18924. values: [{
  18925. name: '+',
  18926. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus,
  18927. selected: expression_element.itens[index_op] == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus
  18928. }, {
  18929. name: '-',
  18930. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus,
  18931. selected: expression_element.itens[index_op] == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus
  18932. }],
  18933. onChange: function onChange(value, text, $selectedItem) {
  18934. expression_element.itens[index_op] = value;
  18935. }
  18936. });
  18937. temp_op.append(menu_operator);
  18938. }
  18939. /***/ }),
  18940. /***/ "./js/visualUI/commands/return.js":
  18941. /*!****************************************!*\
  18942. !*** ./js/visualUI/commands/return.js ***!
  18943. \****************************************/
  18944. /*! exports provided: createFloatingCommand, renderCommand */
  18945. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18946. "use strict";
  18947. __webpack_require__.r(__webpack_exports__);
  18948. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18949. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18950. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types */ "./js/visualUI/types.js");
  18951. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18952. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  18953. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18954. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  18955. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  18956. function createFloatingCommand() {
  18957. 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>');
  18958. }
  18959. function renderCommand(command, function_obj) {
  18960. var el = $('<div class="ui return command_container"> <i class="ui icon small reply command_drag"></i> <i class="ui icon times red button_remove_command"></i> <span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_return') + ' </span> <div class="expression_elements"></div></div>');
  18961. el.data('command', command);
  18962. addHandlers(command, function_obj, el);
  18963. if (function_obj.return_type != _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID) {
  18964. if (!command.variable_value_menu) {
  18965. 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)];
  18966. }
  18967. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.expression_elements'), command.variable_value_menu);
  18968. } else {
  18969. el.find('.expression_elements').remove();
  18970. command.variable_value_menu = null;
  18971. }
  18972. return el;
  18973. }
  18974. function addHandlers(command, function_obj, return_dom) {
  18975. return_dom.find('.button_remove_command').on('click', function () {
  18976. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, return_dom)) {
  18977. return_dom.fadeOut(400, function () {
  18978. return_dom.remove();
  18979. });
  18980. }
  18981. });
  18982. }
  18983. /***/ }),
  18984. /***/ "./js/visualUI/commands/switch.js":
  18985. /*!****************************************!*\
  18986. !*** ./js/visualUI/commands/switch.js ***!
  18987. \****************************************/
  18988. /*! exports provided: createFloatingCommand, renderCommand, renderCase */
  18989. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18990. "use strict";
  18991. __webpack_require__.r(__webpack_exports__);
  18992. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  18993. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  18994. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCase", function() { return renderCase; });
  18995. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  18996. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  18997. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  18998. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  18999. function createFloatingCommand() {
  19000. 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>');
  19001. }
  19002. function renderCommand(command, function_obj) {
  19003. var ret = '';
  19004. ret += '<div class="ui switch command_container"> <i class="ui icon small random command_drag" ></i> <i class="ui icon times red button_remove_command"></i> <div class="ui context_menu"></div> <span> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_code_switch') + ' ( <div class="ui variable_to_switch"></div> ) <div class="ui all_cases_div"></div></span>';
  19005. ret += '</div>';
  19006. var el = $(ret);
  19007. el.data('command', command);
  19008. addHandlers(command, function_obj, el);
  19009. _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__["renderMenu"](command, el.find('.context_menu'), function_obj, el);
  19010. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.variable, el.find('.variable_to_switch'), function_obj);
  19011. if (command.cases) {
  19012. for (var i = 0; i < command.cases.length; i++) {
  19013. renderCase(command.cases[i], command, function_obj, el.find('.all_cases_div'));
  19014. }
  19015. }
  19016. return el;
  19017. }
  19018. function renderCase(switchcase, command, function_obj, el) {
  19019. 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>');
  19020. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, switchcase.variable_value_menu, casediv.find('.variable_case'), function_obj);
  19021. casediv.data('switchcase', switchcase);
  19022. casediv.find('.case_commands_block').data('switchcase', switchcase);
  19023. el.append(casediv);
  19024. if (switchcase.commands_block) {
  19025. for (var j = 0; j < switchcase.commands_block.length; j++) {
  19026. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](switchcase.commands_block[j], $(casediv.find('.case_commands_block')[0]), 3, function_obj);
  19027. }
  19028. }
  19029. casediv.find('.button_remove_command').on('click', function () {
  19030. for (var i = 0; i < command.cases.length; i++) {
  19031. if (switchcase == command.cases[i]) {
  19032. delete command.cases[i];
  19033. command.cases.splice(i, 1);
  19034. casediv.remove();
  19035. break;
  19036. }
  19037. }
  19038. });
  19039. }
  19040. function addHandlers(command, function_obj, switch_dom) {
  19041. switch_dom.find('.button_remove_command').on('click', function () {
  19042. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, switch_dom)) {
  19043. switch_dom.fadeOut(400, function () {
  19044. switch_dom.remove();
  19045. });
  19046. }
  19047. });
  19048. }
  19049. /***/ }),
  19050. /***/ "./js/visualUI/commands/variable_value_menu.js":
  19051. /*!*****************************************************!*\
  19052. !*** ./js/visualUI/commands/variable_value_menu.js ***!
  19053. \*****************************************************/
  19054. /*! exports provided: VAR_OR_VALUE_TYPES, renderMenu */
  19055. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19056. "use strict";
  19057. __webpack_require__.r(__webpack_exports__);
  19058. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VAR_OR_VALUE_TYPES", function() { return VAR_OR_VALUE_TYPES; });
  19059. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenu", function() { return renderMenu; });
  19060. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  19061. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19062. /* harmony import */ var _attribution__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./attribution */ "./js/visualUI/commands/attribution.js");
  19063. /* harmony import */ var _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./repeatNtimes */ "./js/visualUI/commands/repeatNtimes.js");
  19064. var VAR_OR_VALUE_TYPES = Object.freeze({
  19065. only_variable: 1,
  19066. only_value: 2,
  19067. only_function: 3,
  19068. variable_and_function: 4,
  19069. variable_and_value_opt: 5,
  19070. value_and_function: 6,
  19071. all: 7
  19072. });
  19073. function renderMenu(command, ref_object, dom_object, function_obj) {
  19074. var size_field = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 2;
  19075. var expression_element = arguments.length > 5 ? arguments[5] : undefined;
  19076. // Verificar se o objeto atual trata-se de uma chamada de função e conferir se possui a quantidade correta de parâmetros
  19077. // Caso não possua, tem que adicionar as variáveis que servirão de parâmetros:
  19078. if (ref_object.function_called) {
  19079. if (ref_object.function_called.parameters_list) {
  19080. while (ref_object.function_called.parameters_list.length != ref_object.parameters_list.length) {
  19081. if (ref_object.parameters_list.length > ref_object.function_called.parameters_list.length) {
  19082. ref_object.parameters_list.pop();
  19083. } else {
  19084. ref_object.parameters_list.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true));
  19085. }
  19086. }
  19087. }
  19088. }
  19089. 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">';
  19090. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_variable) {
  19091. 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">';
  19092. menu_var_or_value += '</div>';
  19093. }
  19094. 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) {
  19095. 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');
  19096. menu_var_or_value += '<div class="menu menu_only_vars">';
  19097. menu_var_or_value += '</div></div>';
  19098. }
  19099. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_value) {
  19100. menu_var_or_value = '<input type="text" class="width-dynamic" size="' + size_field + '" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />';
  19101. }
  19102. 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) {
  19103. 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>';
  19104. }
  19105. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_function) {
  19106. 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">';
  19107. menu_var_or_value += '</div>';
  19108. }
  19109. 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) {
  19110. 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');
  19111. menu_var_or_value += '<div class="menu menu_only_functions">';
  19112. menu_var_or_value += '</div></div>';
  19113. /* if (command.type == Models.COMMAND_TYPES.attribution) {
  19114. menu_var_or_value += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19115. menu_var_or_value += '<div class="menu">';
  19116. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19117. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19118. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19119. menu_var_or_value += '</div></div>';
  19120. }*/
  19121. }
  19122. menu_var_or_value += '</div></div>';
  19123. menu_var_or_value = $(menu_var_or_value);
  19124. dom_object.append(menu_var_or_value);
  19125. ref_object.dom_object = menu_var_or_value;
  19126. addHandlers(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  19127. addVariablesToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  19128. addFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  19129. addIVProgFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  19130. if (ref_object.content || ref_object.function_called) {
  19131. if (ref_object.content) {
  19132. // Verificar se a variável ainda existe:
  19133. var variable_fun = isVarInProgram(ref_object.content, function_obj);
  19134. if (variable_fun) {
  19135. ref_object.content = variable_fun;
  19136. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  19137. } else {
  19138. if (ref_object.content && ref_object.content.type) {
  19139. ref_object.content = null;
  19140. appendSelectText(ref_object, menu_var_or_value);
  19141. } else {
  19142. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  19143. }
  19144. }
  19145. } else if (ref_object.function_called) {
  19146. // Verificar se a função ainda existe:
  19147. var ret_function = isFunctionInProgram(ref_object.function_called);
  19148. if (ret_function) {
  19149. ref_object.function_called = ret_function;
  19150. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  19151. } else {
  19152. ref_object.content = null;
  19153. ref_object.row = null;
  19154. ref_object.column = null;
  19155. delete ref_object.function_called;
  19156. delete ref_object.parameters_list;
  19157. appendSelectText(ref_object, menu_var_or_value);
  19158. }
  19159. }
  19160. } else {
  19161. appendSelectText(ref_object, menu_var_or_value);
  19162. }
  19163. }
  19164. function appendSelectText(ref_object, menu_var_or_value) {
  19165. switch (ref_object.variable_and_value) {
  19166. case VAR_OR_VALUE_TYPES.only_variable:
  19167. menu_var_or_value.find('.text').append('<i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('var_menu_select_var') + '</i>');
  19168. break;
  19169. case VAR_OR_VALUE_TYPES.all:
  19170. menu_var_or_value.find('.text').append('<i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('var_menu_select_all') + '</i>');
  19171. break;
  19172. case VAR_OR_VALUE_TYPES.variable_and_function:
  19173. menu_var_or_value.find('.text').append('<i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('var_menu_select_all') + '</i>');
  19174. break;
  19175. case VAR_OR_VALUE_TYPES.only_function:
  19176. menu_var_or_value.find('.text').append('<i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('var_menu_select_function') + '</i>');
  19177. break;
  19178. }
  19179. }
  19180. function isFunctionInProgram(function_called_obj) {
  19181. if (function_called_obj.name) {
  19182. if (window.program_obj.functions) {
  19183. for (var i = 0; i < window.program_obj.functions.length; i++) {
  19184. if (window.program_obj.functions[i] == function_called_obj) {
  19185. return window.program_obj.functions[i];
  19186. }
  19187. }
  19188. for (var i = 0; i < window.program_obj.functions.length; i++) {
  19189. if (window.program_obj.functions[i].name == function_called_obj.name) {
  19190. return window.program_obj.functions[i];
  19191. }
  19192. }
  19193. }
  19194. } else if (function_called_obj.identifier) {
  19195. for (var i = 0; i < window.system_functions.length; i++) {
  19196. if (window.system_functions[i].identifier == function_called_obj.identifier) {
  19197. return window.system_functions[i];
  19198. }
  19199. }
  19200. }
  19201. return null;
  19202. }
  19203. function isVarInProgram(var_obj, function_obj) {
  19204. // Verify in locals:
  19205. if (function_obj.variables_list) {
  19206. for (var i = 0; i < function_obj.variables_list.length; i++) {
  19207. if (function_obj.variables_list[i] == var_obj) {
  19208. return function_obj.variables_list[i];
  19209. }
  19210. }
  19211. } // Verify in parameters:
  19212. if (function_obj.parameters_list) {
  19213. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  19214. if (function_obj.parameters_list[i] == var_obj) {
  19215. return function_obj.parameters_list[i];
  19216. }
  19217. }
  19218. } // Verify in globals:
  19219. if (window.program_obj.globals) {
  19220. for (var i = 0; i < window.program_obj.globals.length; i++) {
  19221. if (window.program_obj.globals[i] == var_obj) {
  19222. return window.program_obj.globals[i];
  19223. }
  19224. }
  19225. } // If not found, verify if the reference was lost
  19226. if (var_obj) {
  19227. if (function_obj.variables_list) {
  19228. for (var i = 0; i < function_obj.variables_list.length; i++) {
  19229. if (function_obj.variables_list[i].name == var_obj.name) {
  19230. return function_obj.variables_list[i];
  19231. }
  19232. }
  19233. }
  19234. if (function_obj.parameters_list) {
  19235. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  19236. if (function_obj.parameters_list[i].name == var_obj.name) {
  19237. return function_obj.parameters_list[i];
  19238. }
  19239. }
  19240. }
  19241. if (window.program_obj.globals) {
  19242. for (var i = 0; i < window.program_obj.globals.length; i++) {
  19243. if (window.program_obj.globals[i].name == var_obj.name) {
  19244. return window.program_obj.globals[i];
  19245. }
  19246. }
  19247. }
  19248. }
  19249. return null;
  19250. }
  19251. function renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element) {
  19252. if (ref_object.function_called) {
  19253. menu_var_or_value.remove();
  19254. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  19255. } else if (ref_object.content.type) {
  19256. menu_var_or_value.remove();
  19257. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  19258. } else {
  19259. menu_var_or_value.remove();
  19260. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  19261. }
  19262. }
  19263. function variableValueMenuCode(command, variable_obj, dom_object, function_obj, menu_var_or_value, expression_element) {
  19264. if (variable_obj.content || variable_obj.function_called) {
  19265. // Verificar se a variável ainda existe:
  19266. var var_fun = isVarInProgram(variable_obj.content, function_obj);
  19267. if (var_fun) {
  19268. variable_obj.content = var_fun;
  19269. } else {
  19270. if (variable_obj.content && variable_obj.content.type) {
  19271. variable_obj.content = null;
  19272. appendSelectText(variable_obj, menu_var_or_value);
  19273. }
  19274. }
  19275. } else {
  19276. appendSelectText(variable_obj, menu_var_or_value);
  19277. }
  19278. if (variable_obj.content == null && variable_obj.function_called == null) {
  19279. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  19280. return;
  19281. }
  19282. var ret = '';
  19283. if (variable_obj.function_called) {
  19284. if (variable_obj.function_called.parameters_list == null || variable_obj.function_called.length == 0) {
  19285. menu_var_or_value.find('.text').text(' ');
  19286. dom_object.find('.menu_var_or_value_dom').remove();
  19287. var parameters_menu;
  19288. if (variable_obj.function_called.name) {
  19289. parameters_menu = '<div class="parameters_function_called"> ' + variable_obj.function_called.name + ' <span> ( </span>';
  19290. } else {
  19291. 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>';
  19292. }
  19293. parameters_menu += '<span> ) </span></div>';
  19294. parameters_menu = $(parameters_menu);
  19295. dom_object.append(parameters_menu);
  19296. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19297. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_clear') + '</div>';
  19298. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19299. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19300. context_menu += '<div class="menu">';
  19301. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19302. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19303. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19304. context_menu += '</div></div>';
  19305. }*/
  19306. context_menu += '</div></div>';
  19307. context_menu = $(context_menu);
  19308. context_menu.insertAfter(dom_object.find('.parameters_function_called'));
  19309. context_menu.dropdown({
  19310. onChange: function onChange(value, text, $selectedItem) {
  19311. console.log('S1');
  19312. if ($selectedItem.data('clear')) {
  19313. console.log('PP1');
  19314. dom_object.text('');
  19315. variable_obj.content = null;
  19316. variable_obj.row = null;
  19317. variable_obj.column = null;
  19318. delete variable_obj.function_called;
  19319. delete variable_obj.parameters_list;
  19320. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  19321. }
  19322. if ($selectedItem.data('exp')) {
  19323. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19324. }
  19325. },
  19326. selectOnKeydown: false
  19327. });
  19328. } else {
  19329. menu_var_or_value.find('.text').text(' ');
  19330. dom_object.find('.menu_var_or_value_dom').remove();
  19331. var parameters_menu;
  19332. if (variable_obj.function_called.name) {
  19333. parameters_menu = '<div class="parameters_function_called"> ' + variable_obj.function_called.name + ' <span> ( </span>';
  19334. } else {
  19335. 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>';
  19336. }
  19337. for (var j = 0; j < variable_obj.function_called.parameters_list.length; j++) {
  19338. parameters_menu += '<div class="render_style_param parameter_' + j + '"></div>';
  19339. if (j + 1 != variable_obj.function_called.parameters_list.length) {
  19340. parameters_menu += ' , ';
  19341. }
  19342. }
  19343. parameters_menu += '<span> ) </span></div>';
  19344. parameters_menu = $(parameters_menu);
  19345. dom_object.append(parameters_menu);
  19346. for (var j = 0; j < variable_obj.function_called.parameters_list.length; j++) {
  19347. renderMenu(command, variable_obj.parameters_list[j], parameters_menu.find('.parameter_' + j), function_obj, 2, expression_element);
  19348. }
  19349. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19350. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_clear') + '</div>';
  19351. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19352. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19353. context_menu += '<div class="menu">';
  19354. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19355. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19356. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19357. context_menu += '</div></div>';
  19358. }*/
  19359. context_menu += '</div></div>';
  19360. context_menu = $(context_menu);
  19361. context_menu.insertAfter(parameters_menu);
  19362. context_menu.dropdown({
  19363. onChange: function onChange(value, text, $selectedItem) {
  19364. console.log('S2');
  19365. if ($selectedItem.data('clear')) {
  19366. console.log('PP2');
  19367. dom_object.text('');
  19368. variable_obj.content = null;
  19369. variable_obj.row = null;
  19370. variable_obj.column = null;
  19371. delete variable_obj.function_called;
  19372. delete variable_obj.parameters_list;
  19373. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  19374. }
  19375. if ($selectedItem.data('exp')) {
  19376. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19377. }
  19378. },
  19379. selectOnKeydown: false
  19380. });
  19381. }
  19382. } else if (variable_obj.content.type) {
  19383. var variable_render = "";
  19384. if (variable_obj.content.dimensions == 1 && variable_obj.dimensions != 1) {
  19385. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + '</span>';
  19386. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  19387. variable_render += '</div>';
  19388. variable_render = $(variable_render);
  19389. dom_object.append(variable_render);
  19390. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19391. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_clear') + '</div>';
  19392. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19393. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19394. context_menu += '<div class="menu">';
  19395. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19396. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19397. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19398. context_menu += '</div></div>';
  19399. }*/
  19400. context_menu += '</div></div>';
  19401. context_menu = $(context_menu);
  19402. variable_render.append(context_menu);
  19403. context_menu.dropdown({
  19404. onChange: function onChange(value, text, $selectedItem) {
  19405. console.log('S3');
  19406. if ($selectedItem.data('clear')) {
  19407. console.log('PP3');
  19408. dom_object.text('');
  19409. variable_obj.content = null;
  19410. variable_obj.row = null;
  19411. variable_obj.column = null;
  19412. delete variable_obj.function_called;
  19413. delete variable_obj.parameters_list;
  19414. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  19415. }
  19416. if ($selectedItem.data('exp')) {
  19417. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19418. }
  19419. },
  19420. selectOnKeydown: false
  19421. });
  19422. if (!variable_obj.column) {
  19423. variable_obj.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19424. }
  19425. variableValueMenuCode(command, variable_obj.column, $(variable_render.find('.column_container')), function_obj, menu_var_or_value, expression_element);
  19426. } else if (variable_obj.content.dimensions == 2 && variable_obj.dimensions != 2) {
  19427. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + '</span>';
  19428. variable_render += ' <span>[ </span> <div class="row_container"></div> <span> ]</span>';
  19429. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ] </span>';
  19430. variable_render += '</div>';
  19431. variable_render = $(variable_render);
  19432. dom_object.append(variable_render);
  19433. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19434. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_clear') + '</div>';
  19435. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19436. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19437. context_menu += '<div class="menu">';
  19438. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19439. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19440. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19441. context_menu += '</div></div>';
  19442. }*/
  19443. context_menu += '</div></div>';
  19444. context_menu = $(context_menu);
  19445. variable_render.append(context_menu);
  19446. context_menu.dropdown({
  19447. onChange: function onChange(value, text, $selectedItem) {
  19448. console.log('S4');
  19449. if ($selectedItem.data('clear')) {
  19450. console.log('PP4');
  19451. dom_object.text('');
  19452. variable_obj.content = null;
  19453. variable_obj.row = null;
  19454. variable_obj.column = null;
  19455. delete variable_obj.function_called;
  19456. delete variable_obj.parameters_list;
  19457. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  19458. }
  19459. if ($selectedItem.data('exp')) {
  19460. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19461. }
  19462. },
  19463. selectOnKeydown: false
  19464. });
  19465. if (!variable_obj.column) {
  19466. variable_obj.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19467. }
  19468. if (!variable_obj.row) {
  19469. variable_obj.row = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19470. }
  19471. variableValueMenuCode(command, variable_obj.row, $(variable_render.find('.row_container')), function_obj, menu_var_or_value, expression_element);
  19472. variableValueMenuCode(command, variable_obj.column, $(variable_render.find('.column_container')), function_obj, menu_var_or_value, expression_element);
  19473. } else {
  19474. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + '</span>';
  19475. variable_render += '</div>';
  19476. variable_render = $(variable_render);
  19477. dom_object.append(variable_render);
  19478. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19479. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_clear') + '</div>';
  19480. /*if (command.type == Models.COMMAND_TYPES.attribution && !dom_object.hasClass('var_attributed')) {
  19481. console.log('dom_object6');
  19482. console.log(dom_object);
  19483. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19484. context_menu += '<div class="menu">';
  19485. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19486. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19487. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19488. context_menu += '</div></div>';
  19489. }*/
  19490. context_menu += '</div></div>';
  19491. context_menu = $(context_menu);
  19492. variable_render.append(context_menu);
  19493. context_menu.dropdown({
  19494. onChange: function onChange(value, text, $selectedItem) {
  19495. console.log('S5');
  19496. if ($selectedItem.data('clear')) {
  19497. console.log('PP5');
  19498. dom_object.text('');
  19499. variable_obj.content = null;
  19500. variable_obj.row = null;
  19501. variable_obj.column = null;
  19502. delete variable_obj.function_called;
  19503. delete variable_obj.parameters_list;
  19504. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  19505. }
  19506. if ($selectedItem.data('exp')) {
  19507. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19508. }
  19509. },
  19510. selectOnKeydown: false
  19511. });
  19512. }
  19513. } else {
  19514. var variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content + '</span>';
  19515. variable_render += '</div>';
  19516. variable_render = $(variable_render);
  19517. dom_object.append(variable_render);
  19518. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19519. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_clear') + '</div>';
  19520. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19521. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19522. context_menu += '<div class="menu">';
  19523. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19524. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19525. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19526. context_menu += '</div></div>';
  19527. }*/
  19528. context_menu += '</div></div>';
  19529. context_menu = $(context_menu);
  19530. if (variable_obj.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  19531. context_menu.insertAfter(variable_render);
  19532. }
  19533. context_menu.dropdown({
  19534. onChange: function onChange(value, text, $selectedItem) {
  19535. console.log('S6');
  19536. if ($selectedItem.data('clear')) {
  19537. console.log('PP6');
  19538. dom_object.text('');
  19539. variable_obj.content = null;
  19540. variable_obj.row = null;
  19541. variable_obj.column = null;
  19542. delete variable_obj.function_called;
  19543. delete variable_obj.parameters_list;
  19544. dom_object.find('.value_rendered').remove();
  19545. dom_object.find('.context_menu_clear').remove();
  19546. dom_object.find('.width-dynamic-minus').remove();
  19547. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  19548. }
  19549. if ($selectedItem.data('exp')) {
  19550. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19551. }
  19552. },
  19553. selectOnKeydown: false
  19554. });
  19555. variable_render.on('click', function (e) {
  19556. variable_render.remove();
  19557. variable_render.empty();
  19558. variable_render.remove();
  19559. dom_object.empty();
  19560. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  19561. openInputToValue(command, variable_obj, dom_object, menu_var_or_value, function_obj, expression_element);
  19562. });
  19563. }
  19564. }
  19565. function addIVProgFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  19566. var sub_menu = menu_var_or_value.find('.menu_only_functions');
  19567. sub_menu.append('<div class="divider"></div><div class="header">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_header_ivprog_functions') + '</div>');
  19568. 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>');
  19569. 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>');
  19570. 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>');
  19571. 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:
  19572. for (var i = 0; i < window.system_functions.length; i++) {
  19573. var t = $('<div class="item"></div>');
  19574. t.data('function_reference', window.system_functions[i]);
  19575. t.data('option', VAR_OR_VALUE_TYPES.only_function);
  19576. t.text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].translateInternalFunction(window.system_functions[i].identifier));
  19577. switch (window.system_functions[i].category) {
  19578. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].math:
  19579. sub_menu.find('.menu_math_functions').append(t);
  19580. break;
  19581. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].text:
  19582. sub_menu.find('.menu_text_functions').append(t);
  19583. break;
  19584. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].arrangement:
  19585. sub_menu.find('.menu_arrangement_functions').append(t);
  19586. break;
  19587. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].conversion:
  19588. sub_menu.find('.menu_conversion_functions').append(t);
  19589. break;
  19590. }
  19591. }
  19592. }
  19593. function addFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  19594. var sub_menu = menu_var_or_value.find('.menu_only_functions');
  19595. sub_menu.text('');
  19596. for (var i = 0; i < window.program_obj.functions.length; i++) {
  19597. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_function + '">' + window.program_obj.functions[i].name + ' </div>');
  19598. temp.data('function_reference', window.program_obj.functions[i]);
  19599. sub_menu.append(temp);
  19600. }
  19601. }
  19602. function addVariablesToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  19603. var sub_menu = menu_var_or_value.find('.menu_only_vars');
  19604. sub_menu.text('');
  19605. var is_there = false;
  19606. if (window.program_obj.globals) {
  19607. if (ref_object.include_constant) {
  19608. for (var i = 0; i < window.program_obj.globals.length; i++) {
  19609. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + window.program_obj.globals[i].name + ' </div>');
  19610. temp.data('variable_reference', window.program_obj.globals[i]);
  19611. sub_menu.append(temp);
  19612. is_there = true;
  19613. }
  19614. } else {
  19615. for (var i = 0; i < window.program_obj.globals.length; i++) {
  19616. if (!window.program_obj.globals[i].is_constant) {
  19617. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + window.program_obj.globals[i].name + ' </div>');
  19618. temp.data('variable_reference', window.program_obj.globals[i]);
  19619. sub_menu.append(temp);
  19620. is_there = true;
  19621. }
  19622. }
  19623. }
  19624. }
  19625. if (function_obj.parameters_list) {
  19626. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  19627. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + function_obj.parameters_list[i].name + ' </div>');
  19628. temp.data('variable_reference', function_obj.parameters_list[i]);
  19629. sub_menu.append(temp);
  19630. is_there = true;
  19631. }
  19632. }
  19633. if (function_obj.variables_list) {
  19634. for (var i = 0; i < function_obj.variables_list.length; i++) {
  19635. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + function_obj.variables_list[i].name + ' </div>');
  19636. temp.data('variable_reference', function_obj.variables_list[i]);
  19637. sub_menu.append(temp);
  19638. is_there = true;
  19639. }
  19640. }
  19641. if (!is_there) {
  19642. sub_menu.append($('<div class="header">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_no_variable') + '</div>'));
  19643. sub_menu.append($('<div class="item disabled">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_no_variable_instruction') + '</div>'));
  19644. }
  19645. }
  19646. function addHandlers(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element) {
  19647. if (ref_object.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  19648. menu_var_or_value.dropdown({
  19649. onChange: function onChange(value, text, $selectedItem) {
  19650. console.log('S7');
  19651. dom_object.find('.var_name').remove();
  19652. switch ($selectedItem.data('option')) {
  19653. case VAR_OR_VALUE_TYPES.only_function:
  19654. openInputToFunction(command, ref_object, dom_object, menu_var_or_value, function_obj, $($selectedItem).data('function_reference'), expression_element);
  19655. break;
  19656. case VAR_OR_VALUE_TYPES.only_value:
  19657. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  19658. break;
  19659. case VAR_OR_VALUE_TYPES.only_variable:
  19660. openInputToVariable(command, ref_object, dom_object, menu_var_or_value, function_obj, $($selectedItem).data('variable_reference'), expression_element);
  19661. break;
  19662. }
  19663. if ($selectedItem.data('exp')) {
  19664. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19665. }
  19666. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes) {
  19667. _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19668. }
  19669. },
  19670. selectOnKeydown: false
  19671. });
  19672. }
  19673. dom_object.find('.width-dynamic').on('input', function () {
  19674. var inputWidth = $(this).textWidth() + 10;
  19675. $(this).focus();
  19676. var tmpStr = $(this).val();
  19677. $(this).val('');
  19678. $(this).val(tmpStr);
  19679. $(this).css({
  19680. width: inputWidth
  19681. });
  19682. }).trigger('input');
  19683. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment) {
  19684. dom_object.parent().on('click', function (e) {
  19685. dom_object.find('.value_rendered').remove();
  19686. dom_object.find('.value_rendered').empty();
  19687. dom_object.find('.value_rendered').remove();
  19688. dom_object.empty();
  19689. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  19690. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  19691. });
  19692. }
  19693. }
  19694. function openInputToFunction(command, ref_object, dom_object, menu_var_or_value, function_obj, function_selected, expression_element) {
  19695. ref_object.function_called = function_selected;
  19696. ref_object.parameters_list = [];
  19697. if (function_selected.parameters_list != null && function_selected.parameters_list.length > 0) {
  19698. menu_var_or_value.find('.text').text(' ');
  19699. dom_object.find('.menu_var_or_value_dom').remove();
  19700. var parameters_menu;
  19701. if (function_selected.name) {
  19702. parameters_menu = '<div class="parameters_function_called"> ' + function_selected.name + ' <span> ( </span>';
  19703. } else {
  19704. 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>';
  19705. }
  19706. for (var j = 0; j < function_selected.parameters_list.length; j++) {
  19707. parameters_menu += '<div class="render_style_param parameter_' + j + '"></div>';
  19708. if (j + 1 != function_selected.parameters_list.length) {
  19709. parameters_menu += ' , ';
  19710. }
  19711. }
  19712. parameters_menu += '<span> ) </span></div>';
  19713. parameters_menu = $(parameters_menu);
  19714. dom_object.append(parameters_menu);
  19715. for (var j = 0; j < function_selected.parameters_list.length; j++) {
  19716. var temp;
  19717. if (function_selected.parameters_list[j].dimensions > 0) {
  19718. 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);
  19719. } else {
  19720. temp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19721. }
  19722. ref_object.parameters_list.push(temp);
  19723. renderMenu(command, temp, parameters_menu.find('.parameter_' + j), function_obj, 2, expression_element);
  19724. }
  19725. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19726. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_clear') + '</div>';
  19727. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19728. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19729. context_menu += '<div class="menu">';
  19730. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19731. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19732. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19733. context_menu += '</div></div>';
  19734. }*/
  19735. context_menu += '</div></div>';
  19736. context_menu = $(context_menu);
  19737. context_menu.insertAfter(dom_object.find('.parameters_function_called'));
  19738. context_menu.dropdown({
  19739. onChange: function onChange(value, text, $selectedItem) {
  19740. console.log('S8');
  19741. if ($selectedItem.data('clear')) {
  19742. console.log('PP7');
  19743. dom_object.text('');
  19744. ref_object.content = null;
  19745. ref_object.row = null;
  19746. ref_object.column = null;
  19747. delete ref_object.function_called;
  19748. delete ref_object.parameters_list;
  19749. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  19750. }
  19751. if ($selectedItem.data('exp')) {
  19752. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19753. }
  19754. },
  19755. selectOnKeydown: false
  19756. });
  19757. } else {
  19758. menu_var_or_value.find('.text').text(' ');
  19759. dom_object.find('.menu_var_or_value_dom').remove();
  19760. var parameters_menu;
  19761. if (function_selected.name) {
  19762. parameters_menu = '<div class="parameters_function_called"> ' + function_selected.name + ' <span> ( </span>';
  19763. } else {
  19764. 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>';
  19765. }
  19766. parameters_menu += '<span> ) </span></div>';
  19767. parameters_menu = $(parameters_menu);
  19768. dom_object.append(parameters_menu);
  19769. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19770. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_clear') + '</div>';
  19771. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19772. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19773. context_menu += '<div class="menu">';
  19774. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19775. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19776. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19777. context_menu += '</div></div>';
  19778. }*/
  19779. context_menu += '</div></div>';
  19780. context_menu = $(context_menu);
  19781. context_menu.insertAfter(dom_object.find('.parameters_function_called'));
  19782. context_menu.dropdown({
  19783. onChange: function onChange(value, text, $selectedItem) {
  19784. console.log('S9');
  19785. if ($selectedItem.data('clear')) {
  19786. console.log('PP8');
  19787. dom_object.text('');
  19788. ref_object.content = null;
  19789. ref_object.row = null;
  19790. ref_object.column = null;
  19791. delete ref_object.function_called;
  19792. delete ref_object.parameters_list;
  19793. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  19794. }
  19795. if ($selectedItem.data('exp')) {
  19796. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19797. }
  19798. },
  19799. selectOnKeydown: false
  19800. });
  19801. }
  19802. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19803. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj);
  19804. }*/
  19805. }
  19806. function openInputToVariable(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected, expression_element) {
  19807. ref_object.content = variable_selected;
  19808. menu_var_or_value.find('.text').text(' ');
  19809. dom_object.find('.menu_var_or_value_dom').remove();
  19810. var variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_selected.name + '</span>';
  19811. if (variable_selected.dimensions == 1 && ref_object.dimensions != 1) {
  19812. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  19813. }
  19814. if (variable_selected.dimensions == 2 && ref_object.dimensions != 2) {
  19815. variable_render += ' <span>[ </span> <div class="row_container"></div> <span> ]</span> ';
  19816. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  19817. }
  19818. variable_render += '</div>';
  19819. variable_render = $(variable_render);
  19820. dom_object.append(variable_render);
  19821. if (variable_selected.dimensions == 1 && ref_object.dimensions != 1) {
  19822. ref_object.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19823. renderMenu(command, ref_object.column, variable_render.find('.column_container'), function_obj, 2, expression_element);
  19824. }
  19825. if (variable_selected.dimensions == 2 && ref_object.dimensions != 2) {
  19826. ref_object.row = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19827. renderMenu(command, ref_object.row, variable_render.find('.row_container'), function_obj, 2, expression_element);
  19828. ref_object.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  19829. renderMenu(command, ref_object.column, variable_render.find('.column_container'), function_obj, 2, expression_element);
  19830. }
  19831. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19832. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_clear') + '</div>';
  19833. /*if (command.type == Models.COMMAND_TYPES.attribution && !dom_object.hasClass('var_attributed')) {
  19834. console.log("dom_object 10: ");
  19835. console.log(dom_object);
  19836. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19837. context_menu += '<div class="menu">';
  19838. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19839. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19840. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19841. context_menu += '</div></div>';
  19842. }*/
  19843. context_menu += '</div></div>';
  19844. context_menu = $(context_menu);
  19845. context_menu.insertAfter(dom_object.find('.variable_rendered'));
  19846. context_menu.dropdown({
  19847. onChange: function onChange(value, text, $selectedItem) {
  19848. console.log('S10');
  19849. if ($selectedItem.data('clear')) {
  19850. console.log('PP9');
  19851. dom_object.text('');
  19852. ref_object.content = null;
  19853. ref_object.row = null;
  19854. ref_object.column = null;
  19855. delete ref_object.function_called;
  19856. delete ref_object.parameters_list;
  19857. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  19858. }
  19859. if ($selectedItem.data('exp')) {
  19860. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19861. }
  19862. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes) {
  19863. _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__["manageClearExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19864. }
  19865. },
  19866. selectOnKeydown: false
  19867. });
  19868. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19869. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected);
  19870. }*/
  19871. }
  19872. function openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element) {
  19873. if (ref_object.content == null) {
  19874. ref_object.content = "";
  19875. }
  19876. menu_var_or_value.find('.text').text(' ');
  19877. var field = $('<input type="text" size="2" class="width-dynamic-minus" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />');
  19878. field.insertBefore(dom_object.find('.menu_var_or_value_dom'));
  19879. var rendered = $('<div class="value_rendered"></div>');
  19880. rendered.insertBefore(field);
  19881. field.focus();
  19882. field.val(ref_object.content);
  19883. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  19884. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_clear') + '</div>';
  19885. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19886. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  19887. context_menu += '<div class="menu">';
  19888. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  19889. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  19890. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  19891. context_menu += '</div></div>';
  19892. }*/
  19893. context_menu += '</div></div>';
  19894. context_menu = $(context_menu);
  19895. dom_object.find('.menu_var_or_value_dom').remove();
  19896. if (ref_object.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  19897. context_menu.insertAfter(field);
  19898. }
  19899. context_menu.dropdown({
  19900. onChange: function onChange(value, text, $selectedItem) {
  19901. console.log('S11');
  19902. if ($selectedItem.data('clear')) {
  19903. console.log('PP10');
  19904. dom_object.text('');
  19905. dom_object.find('.value_rendered').remove();
  19906. dom_object.find('.context_menu_clear').remove();
  19907. dom_object.find('.width-dynamic-minus').remove();
  19908. ref_object.content = null;
  19909. ref_object.row = null;
  19910. ref_object.column = null;
  19911. delete ref_object.function_called;
  19912. delete ref_object.parameters_list;
  19913. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  19914. }
  19915. if ($selectedItem.data('exp')) {
  19916. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  19917. }
  19918. },
  19919. selectOnKeydown: false
  19920. });
  19921. dom_object.find('.width-dynamic-minus').focusout(function () {
  19922. if ($(this).val().trim()) {
  19923. ref_object.content = $(this).val().trim();
  19924. }
  19925. rendered.text(ref_object.content);
  19926. $(this).remove();
  19927. });
  19928. dom_object.find('.width-dynamic-minus').on('keydown', function (e) {
  19929. var code = e.keyCode || e.which;
  19930. if (code == 13) {
  19931. if ($(this).val().trim()) {
  19932. ref_object.content = $(this).val().trim();
  19933. }
  19934. rendered.text(ref_object.content);
  19935. $(this).remove();
  19936. }
  19937. if (code == 27) {
  19938. rendered.text(ref_object.content);
  19939. $(this).remove();
  19940. }
  19941. });
  19942. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment) {
  19943. /*rendered.parent().on('click', function(e) {
  19944. rendered.parent().off();
  19945. console.log("TTT14");
  19946. rendered.remove();
  19947. rendered.empty();
  19948. rendered.remove();
  19949. dom_object.empty();
  19950. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  19951. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element)
  19952. });*/
  19953. }
  19954. rendered.on('click', function (e) {
  19955. console.log("TTT2");
  19956. rendered.remove();
  19957. rendered.empty();
  19958. rendered.remove();
  19959. dom_object.empty();
  19960. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  19961. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  19962. });
  19963. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  19964. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj);
  19965. }*/
  19966. }
  19967. $.fn.textWidth = function (text, font) {
  19968. if (!$.fn.textWidth.fakeEl) $.fn.textWidth.fakeEl = $('<span>').hide().appendTo(document.body);
  19969. $.fn.textWidth.fakeEl.text(text || this.val() || this.text() || this.attr('placeholder')).css('font', font || this.css('font'));
  19970. return $.fn.textWidth.fakeEl.width();
  19971. };
  19972. /***/ }),
  19973. /***/ "./js/visualUI/commands/whiletrue.js":
  19974. /*!*******************************************!*\
  19975. !*** ./js/visualUI/commands/whiletrue.js ***!
  19976. \*******************************************/
  19977. /*! exports provided: createFloatingCommand, renderCommand */
  19978. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19979. "use strict";
  19980. __webpack_require__.r(__webpack_exports__);
  19981. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  19982. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  19983. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19984. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  19985. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  19986. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  19987. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  19988. function createFloatingCommand() {
  19989. 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>');
  19990. }
  19991. function renderCommand(command, function_obj) {
  19992. var ret = '';
  19993. ret += '<div class="ui whiletrue command_container"> <i class="ui icon small sync command_drag"></i> <i class="ui icon times red button_remove_command"></i> <div class="ui context_menu"></div> <span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_command_while') + ' </span>';
  19994. ret += '<span class="span_command_spec"> ( </span> <div class="conditional_expression"></div> <span class="span_command_spec"> ) </span>';
  19995. ret += ' </span>';
  19996. ret += '<div class="ui block_commands">';
  19997. ret += '</div>';
  19998. ret += '<span> </span>';
  19999. ret += '</div>';
  20000. var el = $(ret);
  20001. el.data('command', command);
  20002. el.find('.block_commands').data('command', command);
  20003. addHandlers(command, function_obj, el);
  20004. _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'));
  20005. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  20006. if (command.commands_block) {
  20007. for (var j = 0; j < command.commands_block.length; j++) {
  20008. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  20009. }
  20010. }
  20011. return el;
  20012. }
  20013. function addHandlers(command, function_obj, whiletrue_dom) {
  20014. whiletrue_dom.find('.button_remove_command').on('click', function () {
  20015. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, whiletrue_dom)) {
  20016. whiletrue_dom.fadeOut(400, function () {
  20017. whiletrue_dom.remove();
  20018. });
  20019. }
  20020. });
  20021. }
  20022. /***/ }),
  20023. /***/ "./js/visualUI/commands/writer.js":
  20024. /*!****************************************!*\
  20025. !*** ./js/visualUI/commands/writer.js ***!
  20026. \****************************************/
  20027. /*! exports provided: createFloatingCommand, renderCommand, addContent */
  20028. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20029. "use strict";
  20030. __webpack_require__.r(__webpack_exports__);
  20031. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  20032. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  20033. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addContent", function() { return addContent; });
  20034. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  20035. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  20036. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  20037. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  20038. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  20039. function createFloatingCommand() {
  20040. 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>");
  20041. }
  20042. function renderCommand(command, function_obj) {
  20043. var ret = "<div class=\"ui writer command_container\">\n <i class=\"ui icon small upload command_drag\"></i>\n <i class=\"ui icon times red button_remove_command\"></i>\n <span class=\"span_command_spec\">".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_command_write"), "\n ( </span><div class=\"all_elements_write\"></div>\n <span class=\"close_parentheses span_command_spec\">)</span>\n <img data-state=\"").concat(command.newline ? "on" : "false", "\" src=\"").concat(command.newline ? "img/new_line.svg" : "img/no_new_line.svg", "\" class=\"ivprog_newline_btn\"/>\n </div>");
  20044. var el = $(ret);
  20045. el.data("command", command); //renderExpression (command, function_obj, div_to_render, expression_array)
  20046. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find(".all_elements_write"), command.content);
  20047. /*for (var i = 0; i < command.content.length; i ++) {
  20048. var new_div_item = $( '<div class="var_value_menu_div"></div>' );
  20049. var div_parent_with_handler = $( '<div class="div_parent_handler"></div>' );
  20050. div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
  20051. div_parent_with_handler.append(new_div_item);
  20052. div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
  20053. el.find('.all_elements_write').append(div_parent_with_handler);
  20054. VariableValueMenu.renderMenu(command, command.content[i], new_div_item, function_obj);
  20055. addHandlerIconAdd(el.find('.all_elements_write'), command, function_obj);
  20056. addHandlersManager(command, function_obj, el, div_parent_with_handler, command.content[i]);
  20057. }
  20058. if (command.content.length == 0) {
  20059. addHandlerIconAdd(el.find('.all_elements_write'), command, function_obj);
  20060. }*/
  20061. addHandlers(command, function_obj, el);
  20062. return el;
  20063. }
  20064. function addHandlersManager(command, _function_obj, _writer_dom, item_div, content_element) {
  20065. item_div.find(".times").on("click", function () {
  20066. for (var i = 0; i < command.content.length; i++) {
  20067. if (command.content[i] == content_element) {
  20068. delete command.content[i];
  20069. command.content.splice(i, 1);
  20070. item_div.children().off();
  20071. item_div.off();
  20072. item_div.fadeOut();
  20073. if (command.content.length > 0) {
  20074. item_div.next(".icon_add_item_to_writer").fadeOut();
  20075. }
  20076. break;
  20077. }
  20078. }
  20079. });
  20080. }
  20081. function addHandlers(command, function_obj, writer_dom) {
  20082. writer_dom.find(".button_remove_command").on("click", function () {
  20083. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, writer_dom)) {
  20084. writer_dom.fadeOut(400, function () {
  20085. writer_dom.remove();
  20086. });
  20087. }
  20088. });
  20089. Sortable.create(writer_dom.find(".all_elements_write")[0], {
  20090. handle: ".ellipsis",
  20091. animation: 100,
  20092. ghostClass: "ghost",
  20093. group: "writer_" + Math.floor(Math.random() * 10000000),
  20094. draggable: ".div_parent_handler",
  20095. onEnd: function onEnd(evt) {
  20096. command.content.splice(evt.newIndex, 0, command.content.splice(evt.oldIndex, 1)[0]);
  20097. writer_dom.empty();
  20098. writer_dom.replaceWith(renderCommand(command, function_obj));
  20099. }
  20100. }); // Attach event handles for the newline button
  20101. var newlineBtn = writer_dom.find(".ivprog_newline_btn");
  20102. newlineBtn.on("click", function () {
  20103. var state = this.dataset.state;
  20104. if (state === "on") {
  20105. this.dataset.state = "off";
  20106. command.newline = false;
  20107. this.setAttribute("src", "img/no_new_line.svg");
  20108. } else {
  20109. this.dataset.state = "on";
  20110. command.newline = true;
  20111. this.setAttribute("src", "img/new_line.svg");
  20112. }
  20113. writer_dom.data("command", command);
  20114. setPopup(newlineBtn, command.newline);
  20115. }); // Attach jquery popup
  20116. setPopup(newlineBtn, command.newline);
  20117. }
  20118. function setPopup(element, state) {
  20119. if (element.popup("exists")) {
  20120. element.popup("destroy");
  20121. }
  20122. 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");
  20123. element.popup({
  20124. content: content,
  20125. delay: {
  20126. show: 750,
  20127. hide: 0
  20128. }
  20129. });
  20130. }
  20131. function _addHandlerIconAdd(dom_object, command, function_obj) {
  20132. var insert_after = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  20133. var after_which = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  20134. var icon_add_item = $('<i class="ui icon plus square outline icon_add_item_to_writer"></i> ');
  20135. if (!insert_after) {
  20136. dom_object.append(icon_add_item);
  20137. } else {
  20138. icon_add_item.insertAfter(after_which);
  20139. }
  20140. icon_add_item.on("click", function (_event) {
  20141. var div_parent_with_handler = $('<div class="div_parent_handler" style="display:none;"></div>');
  20142. var new_div_item = $('<div class="var_value_menu_div"></div>');
  20143. div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
  20144. div_parent_with_handler.append(new_div_item);
  20145. div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
  20146. div_parent_with_handler.insertAfter(icon_add_item);
  20147. 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);
  20148. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, new_related_menu, new_div_item, function_obj);
  20149. addHandlerIconAdd(dom_object, command, function_obj, true, div_parent_with_handler);
  20150. addHandlersManager(command, function_obj, dom_object, div_parent_with_handler, new_related_menu);
  20151. var pos = 1;
  20152. dom_object.find(".icon_add_item_to_writer").each(function () {
  20153. if ($(this).get(0) === icon_add_item.get(0)) {
  20154. command.content.splice(pos, 0, new_related_menu);
  20155. } else {
  20156. pos++;
  20157. }
  20158. });
  20159. if (command.content.length == 1) {
  20160. icon_add_item.remove();
  20161. }
  20162. div_parent_with_handler.fadeIn();
  20163. });
  20164. }
  20165. function addContent(command, _ref_object, dom_object, _menu_var_or_value, function_obj, _ref_object_content) {
  20166. if (dom_object.hasClass("var_value_menu_div")) {
  20167. var icon_add_item = $('<i class="ui icon plus square outline icon_add_item_to_writer"></i> ');
  20168. icon_add_item.insertAfter(dom_object);
  20169. icon_add_item.on("click", function (_event) {
  20170. var div_parent_with_handler = $('<div class="div_parent_handler"></div>');
  20171. div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
  20172. div_parent_with_handler.append(new_div_item);
  20173. div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
  20174. div_parent_with_handler.insertAfter(icon_add_item);
  20175. 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);
  20176. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, new_related_menu, new_div_item, function_obj);
  20177. addHandlersManager(command, function_obj, dom_object, div_parent_with_handler, new_related_menu);
  20178. command.content.push(new_related_menu);
  20179. if (command.content.length == 1) {
  20180. icon_add_item.remove();
  20181. }
  20182. });
  20183. }
  20184. }
  20185. /***/ }),
  20186. /***/ "./js/visualUI/functions.js":
  20187. /*!**********************************!*\
  20188. !*** ./js/visualUI/functions.js ***!
  20189. \**********************************/
  20190. /*! exports provided: renderFunction, initVisualUI, setTestCases, getTestCases, addFunctionChangeListener, addGlobalChangeListener, removeGlobalListener, removeFunctionListener */
  20191. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20192. "use strict";
  20193. __webpack_require__.r(__webpack_exports__);
  20194. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderFunction", function() { return renderFunction; });
  20195. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initVisualUI", function() { return initVisualUI; });
  20196. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTestCases", function() { return setTestCases; });
  20197. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTestCases", function() { return getTestCases; });
  20198. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addFunctionChangeListener", function() { return addFunctionChangeListener; });
  20199. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addGlobalChangeListener", function() { return addGlobalChangeListener; });
  20200. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeGlobalListener", function() { return removeGlobalListener; });
  20201. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFunctionListener", function() { return removeFunctionListener; });
  20202. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  20203. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  20204. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  20205. /* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./globals */ "./js/visualUI/globals.js");
  20206. /* harmony import */ var _variables__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./variables */ "./js/visualUI/variables.js");
  20207. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./commands */ "./js/visualUI/commands.js");
  20208. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./code_generator */ "./js/visualUI/code_generator.js");
  20209. /* harmony import */ var _commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./commands/variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  20210. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../io/domConsole */ "./js/io/domConsole.js");
  20211. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  20212. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  20213. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_10__);
  20214. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  20215. /* harmony import */ var _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../assessment/ivprogAssessment */ "./js/assessment/ivprogAssessment.js");
  20216. /* harmony import */ var _algorithm__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./algorithm */ "./js/visualUI/algorithm.js");
  20217. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  20218. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  20219. /* harmony import */ var _ima_version_json__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../../.ima_version.json */ "./.ima_version.json");
  20220. var _ima_version_json__WEBPACK_IMPORTED_MODULE_16___namespace = /*#__PURE__*/__webpack_require__.t(/*! ./../../.ima_version.json */ "./.ima_version.json", 1);
  20221. /* harmony import */ var _text_editor__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./text_editor */ "./js/visualUI/text_editor.js");
  20222. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  20223. /* harmony import */ var _processor_modes__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../processor/modes */ "./js/processor/modes.ts");
  20224. /* harmony import */ var _processor_modes__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_processor_modes__WEBPACK_IMPORTED_MODULE_19__);
  20225. var counter_new_functions = 0;
  20226. var counter_new_parameters = 0;
  20227. var ivprog_version = _ima_version_json__WEBPACK_IMPORTED_MODULE_16__.version;
  20228. var globalChangeListeners = [];
  20229. var functionsChangeListeners = [];
  20230. var proc = null;
  20231. var domConsole = null;
  20232. var _testCases = [];
  20233. var isRunning = false;
  20234. window.studentGrade = null;
  20235. window.LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"];
  20236. var program = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Program"]();
  20237. window.system_functions = []; // Adding math functions:
  20238. 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));
  20239. 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));
  20240. 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));
  20241. 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));
  20242. 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));
  20243. 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));
  20244. 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));
  20245. 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));
  20246. 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));
  20247. 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));
  20248. 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));
  20249. 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:
  20250. 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));
  20251. 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));
  20252. 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));
  20253. 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));
  20254. 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:
  20255. 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));
  20256. 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));
  20257. 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:
  20258. 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));
  20259. 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));
  20260. 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));
  20261. 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));
  20262. 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));
  20263. 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));
  20264. 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));
  20265. 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));
  20266. 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');
  20267. 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);
  20268. mainFunction.function_comment = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Comment"](_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_comment_main'));
  20269. program.addFunction(mainFunction);
  20270. window.program_obj = program;
  20271. window.generator = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"];
  20272. window.runCodeAssessment = runCodeAssessment;
  20273. window.renderAlgorithm = _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"];
  20274. window.insertContext = false;
  20275. window.watchW = melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a;
  20276. melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a.watch(window.program_obj.globals, function () {
  20277. if (window.insertContext) {
  20278. setTimeout(function () {
  20279. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  20280. globalChangeListeners.forEach(function (x) {
  20281. return x();
  20282. });
  20283. }, 300);
  20284. window.insertContext = false;
  20285. } else {
  20286. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  20287. globalChangeListeners.forEach(function (x) {
  20288. return x();
  20289. });
  20290. }
  20291. }, 1);
  20292. melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a.watch(window.program_obj.functions, function () {
  20293. if (window.insertContext) {
  20294. setTimeout(function () {
  20295. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  20296. functionsChangeListeners.forEach(function (x) {
  20297. return x();
  20298. });
  20299. }, 300);
  20300. window.insertContext = false;
  20301. } else {
  20302. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  20303. functionsChangeListeners.forEach(function (x) {
  20304. return x();
  20305. });
  20306. }
  20307. }, 1);
  20308. function addFunctionHandler() {
  20309. 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')));
  20310. program.addFunction(new_function);
  20311. counter_new_functions++;
  20312. window.insertContext = true;
  20313. 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);
  20314. renderFunction(new_function);
  20315. /*newe.css('display', 'none');
  20316. newe.fadeIn();*/
  20317. }
  20318. function addParameter(function_obj, function_container
  20319. /*, is_from_click = false*/
  20320. ) {
  20321. if (function_obj.parameters_list == null) {
  20322. function_obj.parameters_list = [];
  20323. }
  20324. 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);
  20325. function_obj.parameters_list.push(new_parameter);
  20326. counter_new_parameters++;
  20327. 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);
  20328. renderParameter(function_obj, new_parameter, function_container); // if (is_from_click) {
  20329. // newe.css('display', 'none');
  20330. // newe.fadeIn();
  20331. // }
  20332. }
  20333. function updateReturnType(function_obj, new_type) {
  20334. var new_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  20335. 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);
  20336. function_obj.return_type = new_type;
  20337. function_obj.return_dimensions = new_dimensions;
  20338. }
  20339. function removeFunction(function_obj) {
  20340. var index = program.functions.indexOf(function_obj);
  20341. if (index > -1) {
  20342. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_FUNCTION);
  20343. program.functions.splice(index, 1);
  20344. }
  20345. }
  20346. function minimizeFunction(function_obj) {
  20347. function_obj.is_hidden = !function_obj.is_hidden;
  20348. }
  20349. function addHandlers(function_obj, function_container) {
  20350. function_container.find('.ui.dropdown.function_return').dropdown({
  20351. onChange: function onChange(value, text, $selectedItem) {
  20352. if ($selectedItem.data('dimensions')) {
  20353. updateReturnType(function_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], $selectedItem.data('dimensions'));
  20354. } else {
  20355. updateReturnType(function_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')]);
  20356. }
  20357. },
  20358. selectOnKeydown: false
  20359. });
  20360. function_container.find(".name_function_updated").on('click', function (e) {
  20361. enableNameFunctionUpdate(function_obj, function_container);
  20362. });
  20363. function_container.find(".add_parameter_button").on('click', function (e) {
  20364. window.insertContext = true;
  20365. addParameter(function_obj, function_container, true);
  20366. });
  20367. function_container.find('.menu_commands').dropdown({
  20368. on: 'hover'
  20369. });
  20370. function_container.find('.menu_commands a').on('click', function (evt) {
  20371. if (function_obj.commands == null || function_obj.commands.length == 0) {
  20372. function_obj.commands = [];
  20373. var new_cmd = _commands__WEBPACK_IMPORTED_MODULE_5__["genericCreateCommand"]($(this).data('command'));
  20374. function_obj.commands.push(new_cmd);
  20375. _commands__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](new_cmd, function_container.find('.commands_list_div'), 3, function_obj);
  20376. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, $(this).data('command'), '/', 0);
  20377. } else {
  20378. _commands__WEBPACK_IMPORTED_MODULE_5__["createFloatingCommand"](function_obj, function_container, $(this).data('command'), evt);
  20379. }
  20380. });
  20381. function_container.find('.add_var_button_function').on('click', function (e) {
  20382. window.insertContext = true;
  20383. _variables__WEBPACK_IMPORTED_MODULE_4__["addVariable"](function_obj, function_container, true);
  20384. });
  20385. function_container.find('.remove_function_button').on('click', function (e) {
  20386. removeFunction(function_obj);
  20387. function_container.fadeOut();
  20388. });
  20389. function_container.find('.minimize_function_button').on('click', function (e) {
  20390. minimizeFunction(function_obj);
  20391. if (function_obj.is_hidden) {
  20392. function_container.find(".add_var_button_function").toggle();
  20393. function_container.find(".inline_add_command").toggle();
  20394. function_container.find(".function_area").slideToggle();
  20395. } else {
  20396. function_container.find(".function_area").slideToggle(function () {
  20397. function_container.find(".add_var_button_function").toggle();
  20398. function_container.find(".inline_add_command").toggle();
  20399. });
  20400. }
  20401. });
  20402. } // Essa função imprime o tipo de retorno da função e cria o menu do tipo 'select' para alteração
  20403. function renderFunctionReturn(function_obj, function_element) {
  20404. var ret = '<div class="ui dropdown function_return">';
  20405. if (function_obj.return_dimensions == 1) {
  20406. 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()));
  20407. ret += ' [ ] </div>';
  20408. } else if (function_obj.return_dimensions == 2) {
  20409. 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()));
  20410. ret += ' [ ] [ ] </div>';
  20411. } else {
  20412. ret += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(function_obj.return_type.toLowerCase())) + '</div>';
  20413. }
  20414. ret += '<div class="menu">';
  20415. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  20416. 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>';
  20417. }
  20418. 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">';
  20419. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  20420. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  20421. continue;
  20422. }
  20423. 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>';
  20424. }
  20425. ret += '</div></div>';
  20426. 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">';
  20427. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  20428. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  20429. continue;
  20430. }
  20431. 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>';
  20432. }
  20433. ret += '</div></div>';
  20434. ret += '</div></div>';
  20435. ret = $(ret);
  20436. function_element.find('.function_return').append(ret);
  20437. }
  20438. var cont = 0;
  20439. function renderFunction(function_obj) {
  20440. var appender = '<div class="ui secondary segment function_div list-group-item function_cont_' + cont + '">';
  20441. if (function_obj.function_comment) {//appender += renderComment(function_obj.function_comment, sequence, true, -1);
  20442. }
  20443. appender += '<span class="glyphicon glyphicon-move move_function" aria-hidden="true"><i class="icon sort alternate vertical"></i></span>';
  20444. 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>';
  20445. appender += '<div class="function_signature_div">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("function") + ' ';
  20446. if (function_obj.is_main) {
  20447. 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">';
  20448. } else {
  20449. appender += '<div class="ui function_return"></div>';
  20450. 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">';
  20451. }
  20452. appender += '</div> <span class="parethesis_function"> ) </span> </div>' + (function_obj.is_hidden ? ' <div class="function_area" style="display: none;"> ' : ' <div class="function_area"> ');
  20453. appender += '<div class="ui add_var_context add_var_button_function" style="float: left;"> <div class="ui icon button purple"> ';
  20454. 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>';
  20455. appender += '</div></div>';
  20456. appender += '<div class="ui top attached segment variables_list_div"></div>';
  20457. 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;">';
  20458. 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"> ';
  20459. 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>';
  20460. appender += '</div></div>' + '</div>';
  20461. appender += '</div></div>';
  20462. appender = $(appender);
  20463. $('.all_functions').append(appender);
  20464. appender.data('fun', function_obj);
  20465. appender.find('.commands_list_div').data('fun', function_obj);
  20466. renderFunctionReturn(function_obj, appender);
  20467. addHandlers(function_obj, appender); // Rendering parameters:
  20468. for (var j = 0; j < function_obj.parameters_list.length; j++) {
  20469. renderParameter(function_obj, function_obj.parameters_list[j], appender);
  20470. } // Rendering variables:
  20471. for (var j = 0; j < function_obj.variables_list.length; j++) {
  20472. _variables__WEBPACK_IMPORTED_MODULE_4__["renderVariable"](appender, function_obj.variables_list[j], function_obj);
  20473. } // Rendering commands:
  20474. for (var j = 0; j < function_obj.commands.length; j++) {
  20475. _commands__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](function_obj.commands[j], $(appender.find('.commands_list_div')[0]), 3, function_obj);
  20476. }
  20477. $('.minimize_function_button').popup({
  20478. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_hide_function"),
  20479. delay: {
  20480. show: 750,
  20481. hide: 0
  20482. }
  20483. });
  20484. var function_index = program.functions.indexOf(function_obj);
  20485. Sortable.create(appender.find(".variables_list_div")[0], {
  20486. handle: '.ellipsis',
  20487. animation: 100,
  20488. ghostClass: 'ghost',
  20489. group: 'local_vars_drag_' + function_index,
  20490. onEnd: function onEnd(evt) {
  20491. updateSequenceLocals(evt.oldIndex, evt.newIndex, function_obj);
  20492. }
  20493. });
  20494. addSortableHandler(appender.find(".commands_list_div")[0], function_index);
  20495. if (!function_obj.is_main) {
  20496. Sortable.create(appender.find(".container_parameters_list")[0], {
  20497. handle: '.ellipsis',
  20498. animation: 100,
  20499. ghostClass: 'ghost',
  20500. group: 'parameters_drag_' + program.functions.indexOf(function_obj),
  20501. onEnd: function onEnd(evt) {
  20502. updateSequenceParameters(evt.oldIndex, evt.newIndex, function_obj);
  20503. }
  20504. });
  20505. }
  20506. if (function_obj.commands.length > 0) {
  20507. var teste = '.ui.sticky.sticky_cont_' + cont;
  20508. $(teste).sticky({
  20509. context: '.ui.bottom.attached.segment.commands_list_div.commands_cont_' + cont,
  20510. scrollContext: '.ivprog_visual_panel',
  20511. observeChanges: true,
  20512. offset: 40,
  20513. onStick: function onStick(evt) {
  20514. $(teste).css('top', '20px', 'important');
  20515. },
  20516. onBottom: function onBottom(evt) {
  20517. $(teste).css('top', '20px', 'important');
  20518. },
  20519. onUnstick: function onUnstick(evt) {
  20520. $(teste).css('top', '20px', 'important');
  20521. },
  20522. onReposition: function onReposition(evt) {
  20523. $(teste).css('top', '20px', 'important');
  20524. },
  20525. onScroll: function onScroll(evt) {
  20526. $(teste).css('top', '20px', 'important');
  20527. if (!isVisible($(teste), $(teste).parent())) {
  20528. $(teste).removeClass('fixed');
  20529. }
  20530. },
  20531. onTop: function onTop(evt) {
  20532. $(teste).css('top', '20px', 'important');
  20533. }
  20534. });
  20535. }
  20536. cont++;
  20537. return appender;
  20538. }
  20539. function isVisible(element, container) {
  20540. var elementTop = $(element).offset().top,
  20541. elementHeight = $(element).height(),
  20542. containerTop = $(container).offset().top,
  20543. containerHeight = $(container).height() - 30;
  20544. return elementTop - containerTop + elementHeight > 0 && elementTop - containerTop < containerHeight;
  20545. }
  20546. window.evento_drag;
  20547. function updateProgramObjDrag() {
  20548. var nodes = Array.prototype.slice.call($('.all_functions').children());
  20549. var function_index;
  20550. var start_index;
  20551. var function_obj;
  20552. $(evento_drag.item).parentsUntil(".all_functions").each(function (index) {
  20553. var ref = $(this);
  20554. if (ref.hasClass('function_div')) {
  20555. function_index = nodes.indexOf(this);
  20556. start_index = index;
  20557. function_obj = ref;
  20558. }
  20559. });
  20560. var path_target = [];
  20561. $(evento_drag.item).parentsUntil(".all_functions").each(function () {
  20562. if ($(this).hasClass('command_container')) {
  20563. path_target.push(this);
  20564. }
  20565. });
  20566. if (path_target.length == 0) {//console.log('soltou na raiz, na posição: ' + evento_drag.newIndex + ' mas ainda não sei de onde saiu ');
  20567. } else {//console.log('soltou dentro de algum bloco, sequência vem logo abaixo (de baixo pra cima): ');
  20568. //console.log(path_target);
  20569. }
  20570. var index_each = [];
  20571. var path_relative = [];
  20572. for (var i = path_target.length - 1; i >= 0; i--) {
  20573. console.log('da vez', $(path_target[i + 1]));
  20574. if (i == path_target.length - 1) {
  20575. // está na raiz
  20576. var indice_na_raiz = function_obj.find('.command_container').index(path_target[i]);
  20577. console.log('índice na raiz: ', indice_na_raiz);
  20578. } else {
  20579. if ($(path_target[i + 1]).hasClass('iftrue')) {
  20580. if ($(path_target[i]).parent().hasClass('commands_if')) {
  20581. path_relative.push('if');
  20582. index_each.push($(path_target[i]).parent().find('.command_container').index(path_target[i]));
  20583. } else {
  20584. path_relative.push('else');
  20585. index_each.push($(path_target[i]).parent().find('.command_container').index(path_target[i]));
  20586. }
  20587. } else if ($(path_target[i + 1]).hasClass('dowhiletrue')) {
  20588. path_relative.push('dowhiletrue');
  20589. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  20590. } else if ($(path_target[i + 1]).hasClass('repeatNtimes')) {
  20591. path_relative.push('repeatNtimes');
  20592. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  20593. } else if ($(path_target[i + 1]).hasClass('whiletrue')) {
  20594. path_relative.push('whiletrue');
  20595. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  20596. } else if ($(path_target[i + 1]).hasClass('switch')) {
  20597. path_relative.push('switch'); //index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  20598. }
  20599. }
  20600. } // var index_in_block = -1;
  20601. 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);
  20602. var is_in_case_switch = $(evento_drag.item).parent().hasClass('case_commands_block'); // var index_case_of_switch = -1;
  20603. // if (is_in_case_switch) {
  20604. // index_case_of_switch = $(evento_drag.item).parent().parent().parent().find('.case_div').index($(evento_drag.item).parent().parent());
  20605. // }
  20606. /*console.log('path_relative:');
  20607. console.log(path_relative);
  20608. console.log('index_each:');
  20609. console.log(index_each);
  20610. console.log('index_in_block:');
  20611. console.log(index_in_block);
  20612. console.log('ele está em algum bloco de senão? ');
  20613. console.log(is_in_else);
  20614. console.log('ele está dentro de um case de switch?');
  20615. console.log(is_in_case_switch);
  20616. console.log('qual é o índice do case: ');
  20617. console.log(index_case_of_switch);*/
  20618. // encontrar o elemento na árvore:
  20619. var command_start_point = window.program_obj.functions[function_index].commands[indice_na_raiz];
  20620. var block_to_insert = command_start_point;
  20621. for (var i = 0; i < index_each.length; i++) {
  20622. if (path_relative[i] == "else") {
  20623. block_to_insert = block_to_insert.commands_else[index_each[i]];
  20624. } else if (path_relative[i] == "switch") {} else {
  20625. block_to_insert = block_to_insert.commands_block[index_each[i]];
  20626. }
  20627. } //console.log('command_start_point', command_start_point);
  20628. //console.log('block_to_insert', block_to_insert);
  20629. // agora tem que alocar o comando na árvore, mas considerar as quatro situações:
  20630. // (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.
  20631. if (path_target.length == 0) {
  20632. // soltou na raiz:
  20633. window.program_obj.functions[function_index].commands.splice(evento_drag.newIndex - 1, 0, command_in_drag);
  20634. } else if (is_in_else) {
  20635. if (block_to_insert.commands_else) {
  20636. block_to_insert.commands_else.splice(evento_drag.newIndex, 0, command_in_drag);
  20637. } else {
  20638. block_to_insert.commands_else = [];
  20639. block_to_insert.commands_else.push(command_in_drag);
  20640. }
  20641. } else if (is_in_case_switch) {} else {
  20642. // verificar se tem alguma coisa no bloco:
  20643. if (block_to_insert.commands_block) {
  20644. console.log("existe alguma coisa dentro do bloco, index: ", evento_drag.newIndex);
  20645. block_to_insert.commands_block.splice(evento_drag.newIndex, 0, command_in_drag);
  20646. } else {
  20647. block_to_insert.commands_block = [];
  20648. block_to_insert.commands_block.push(command_in_drag);
  20649. }
  20650. }
  20651. window.draging = false;
  20652. renderAlgorithm();
  20653. }
  20654. function prepareDragHandler(evt) {
  20655. window.draging = true;
  20656. var nodes = Array.prototype.slice.call($('.all_functions').children());
  20657. var function_index;
  20658. var function_obj;
  20659. $(evt.item).parentsUntil(".all_functions").each(function (index) {
  20660. if ($(this).hasClass('function_div')) {
  20661. function_index = nodes.indexOf(this);
  20662. function_obj = window.program_obj.functions[function_index];
  20663. }
  20664. });
  20665. command_in_drag = $(evt.item).data("command"); //console.log('$(evt.item).parent(): ');
  20666. //console.log($(evt.item).parent());
  20667. // descobrir qual das quatro situações:
  20668. if ($(evt.item).parent().hasClass('commands_list_div')) {
  20669. // está na raiz:
  20670. if (function_obj.commands.indexOf(command_in_drag) > -1) {
  20671. function_obj.commands.splice(function_obj.commands.indexOf(command_in_drag), 1);
  20672. }
  20673. } else if ($(evt.item).parent().hasClass('commands_else')) {
  20674. // está no else:
  20675. if ($(evt.item).parent().data('command').commands_else.indexOf(command_in_drag) > -1) {
  20676. $(evt.item).parent().data('command').commands_else.splice($(evt.item).parent().data('command').commands_else.indexOf(command_in_drag), 1);
  20677. }
  20678. } else if ($(evt.item).parent().hasClass('case_commands_block')) {// está em um switch:
  20679. } else {
  20680. // caso padrão:
  20681. if ($(evt.item).parent().data('command').commands_block.indexOf(command_in_drag) > -1) {
  20682. $(evt.item).parent().data('command').commands_block.splice($(evt.item).parent().data('command').commands_block.indexOf(command_in_drag), 1);
  20683. }
  20684. }
  20685. }
  20686. var command_in_drag;
  20687. function addSortableHandler(element, id_function) {
  20688. var n_group = 'commands_drag_' + id_function;
  20689. Sortable.create(element, {
  20690. handle: '.command_drag',
  20691. ghostClass: 'ghost',
  20692. animation: 300,
  20693. group: {
  20694. name: n_group
  20695. },
  20696. onEnd: function onEnd(evt) {
  20697. var nodes = Array.prototype.slice.call($('.all_functions').children());
  20698. var function_index;
  20699. var function_obj;
  20700. $(evt.item).parentsUntil(".all_functions").each(function (index) {
  20701. if ($(this).hasClass('function_div')) {
  20702. function_index = nodes.indexOf(this);
  20703. function_obj = window.program_obj.functions[function_index];
  20704. }
  20705. });
  20706. 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);
  20707. var itemEl = evt.item; // dragged HTMLElement
  20708. evt.to; // target list
  20709. evt.from; // previous list
  20710. evt.oldIndex; // element's old index within old parent
  20711. evt.newIndex; // element's new index within new parent
  20712. //console.log('::EVT::');
  20713. //console.log(evt);
  20714. window.evento_drag = evt;
  20715. try {
  20716. updateProgramObjDrag();
  20717. } catch (e) {
  20718. console.error(e);
  20719. window.draging = false;
  20720. }
  20721. },
  20722. onStart: function onStart(evt) {
  20723. //console.log("START::EVT::");
  20724. //console.log(evt);
  20725. //console.log("\n\ncommand_in_drag");
  20726. try {
  20727. prepareDragHandler(evt);
  20728. } catch (e) {
  20729. window.draging = false;
  20730. }
  20731. }
  20732. });
  20733. element = $(element);
  20734. element.find(".iftrue").each(function (index) {
  20735. addSortableHandler($(this).find(".block_commands")[0], id_function);
  20736. addSortableHandler($(this).find(".block_commands")[1], id_function);
  20737. });
  20738. element.find(".repeatNtimes").each(function (index) {
  20739. addSortableHandler($(this).find(".block_commands")[0], id_function);
  20740. });
  20741. element.find(".dowhiletrue").each(function (index) {
  20742. addSortableHandler($(this).find(".block_commands")[0], id_function);
  20743. });
  20744. element.find(".whiletrue").each(function (index) {
  20745. addSortableHandler($(this).find(".block_commands")[0], id_function);
  20746. });
  20747. element.find(".switch").each(function (index) {
  20748. $(this).find(".case_div").each(function (index) {
  20749. addSortableHandler($(this).find(".case_commands_block")[0], id_function);
  20750. });
  20751. });
  20752. }
  20753. function initVisualUI() {
  20754. // MUST USE CONST, LET, OR VAR !!!!!!
  20755. // const mainDiv = $('#visual-main-div');
  20756. // fill mainDiv with functions and globals...
  20757. // renderAlgorithm()...
  20758. domConsole = new _io_domConsole__WEBPACK_IMPORTED_MODULE_8__["DOMConsole"]("ivprog-term-div");
  20759. domConsole.hide();
  20760. $(document.getElementById("ivprog-term-div")).draggable();
  20761. $('.add_function_button').on('click', function () {
  20762. addFunctionHandler();
  20763. });
  20764. $('.add_global_button').on('click', function () {
  20765. window.insertContext = true;
  20766. _globals__WEBPACK_IMPORTED_MODULE_3__["addGlobal"](program, true);
  20767. });
  20768. $('#run_button').on('click', function () {
  20769. showStopButton();
  20770. runCode();
  20771. });
  20772. $('#stop_button').on('click', function () {
  20773. showRunButton();
  20774. stopExecution();
  20775. });
  20776. $('.visual_coding_button').on('click', function () {
  20777. toggleVisualCoding();
  20778. });
  20779. $('.textual_coding_button').on('click', function () {
  20780. toggleTextualCoding();
  20781. });
  20782. $('.assessment').on('click', function () {
  20783. is_iassign = true;
  20784. runCodeAssessment();
  20785. });
  20786. $('.div_toggle_console').on('click', function () {
  20787. toggleConsole();
  20788. });
  20789. $('.expand_button').on('click', function () {
  20790. full_screen();
  20791. });
  20792. $('.help_button').on('click', function () {
  20793. window.open('https://www.usp.br/line/ivprog/', '_blank');
  20794. });
  20795. $('.main_title h2').prop('title', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_ivprog_description'));
  20796. var time_show = 750;
  20797. $('.visual_coding_button').popup({
  20798. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_visual"),
  20799. delay: {
  20800. show: time_show,
  20801. hide: 0
  20802. }
  20803. });
  20804. $('.textual_coding_button').popup({
  20805. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_textual"),
  20806. delay: {
  20807. show: time_show,
  20808. hide: 0
  20809. }
  20810. });
  20811. $('.upload_file_button').popup({
  20812. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_upload"),
  20813. delay: {
  20814. show: time_show,
  20815. hide: 0
  20816. }
  20817. });
  20818. $('.download_file_button').popup({
  20819. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_download"),
  20820. delay: {
  20821. show: time_show,
  20822. hide: 0
  20823. }
  20824. });
  20825. $('.undo_button').popup({
  20826. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_undo"),
  20827. delay: {
  20828. show: time_show,
  20829. hide: 0
  20830. }
  20831. });
  20832. $('.redo_button').popup({
  20833. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_redo"),
  20834. delay: {
  20835. show: time_show,
  20836. hide: 0
  20837. }
  20838. });
  20839. $('.run_button').popup({
  20840. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_run"),
  20841. delay: {
  20842. show: time_show,
  20843. hide: 0
  20844. }
  20845. });
  20846. $('.assessment_button').popup({
  20847. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_evaluate"),
  20848. delay: {
  20849. show: time_show,
  20850. hide: 0
  20851. }
  20852. });
  20853. $('.help_button').popup({
  20854. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_help") + ' - ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_ivprog_version") + ' ' + ivprog_version,
  20855. delay: {
  20856. show: time_show,
  20857. hide: 0
  20858. }
  20859. });
  20860. $('.add_global_button').popup({
  20861. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_add_global"),
  20862. delay: {
  20863. show: time_show,
  20864. hide: 0
  20865. }
  20866. });
  20867. $('.div_toggle_console').popup({
  20868. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_console"),
  20869. delay: {
  20870. show: time_show,
  20871. hide: 0
  20872. }
  20873. });
  20874. Sortable.create(listWithHandle, {
  20875. handle: '.glyphicon-move',
  20876. animation: 100,
  20877. ghostClass: 'ghost',
  20878. group: 'functions_divs_drag',
  20879. onEnd: function onEnd(evt) {
  20880. updateSequenceFunction(evt.oldIndex, evt.newIndex);
  20881. }
  20882. });
  20883. var listGlobalsHandle = document.getElementById("listGlobalsHandle");
  20884. Sortable.create(listGlobalsHandle, {
  20885. handle: '.ellipsis',
  20886. animation: 100,
  20887. ghostClass: 'ghost',
  20888. group: 'globals_divs_drag',
  20889. onEnd: function onEnd(evt) {
  20890. updateSequenceGlobals(evt.oldIndex, evt.newIndex);
  20891. }
  20892. });
  20893. }
  20894. function setTestCases(testCases) {
  20895. _testCases = testCases;
  20896. }
  20897. function getTestCases() {
  20898. // Deep clone of test cases to avoid unauthorized modification
  20899. // TODO: It may be not possible to use this once custom test are fully implemented
  20900. return JSON.parse(JSON.stringify(_testCases));
  20901. }
  20902. var is_iassign = false;
  20903. function updateSequenceParameters(oldIndex, newIndex, function_obj) {
  20904. function_obj.parameters_list.splice(newIndex, 0, function_obj.parameters_list.splice(oldIndex, 1)[0]);
  20905. }
  20906. function updateSequenceLocals(oldIndex, newIndex, function_obj) {
  20907. function_obj.variables_list.splice(newIndex, 0, function_obj.variables_list.splice(oldIndex, 1)[0]);
  20908. }
  20909. function updateSequenceGlobals(oldIndex, newIndex) {
  20910. program_obj.globals.splice(newIndex, 0, program_obj.globals.splice(oldIndex, 1)[0]);
  20911. }
  20912. function updateSequenceFunction(oldIndex, newIndex) {
  20913. program_obj.functions.splice(newIndex, 0, program_obj.functions.splice(oldIndex, 1)[0]);
  20914. }
  20915. function runCodeAssessment() {
  20916. if (isRunning) {
  20917. // cannot run assessment or it's already running
  20918. return -1;
  20919. }
  20920. var strCode = null;
  20921. window.studentGrade = null;
  20922. if (settingsProgrammingTypes == "textual") {
  20923. strCode = _text_editor__WEBPACK_IMPORTED_MODULE_17__["getCode"]();
  20924. } else {
  20925. strCode = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  20926. }
  20927. if (strCode == null) {
  20928. // No code, so no assessment
  20929. return -1;
  20930. }
  20931. toggleConsole(true);
  20932. try {
  20933. var data = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__["SemanticAnalyser"].analyseFromSource(strCode);
  20934. isRunning = true;
  20935. var runner = new _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_12__["IVProgAssessment"](data, _testCases, domConsole);
  20936. runner.runTest().then(function (grade) {
  20937. if (!is_iassign) {
  20938. parent.getEvaluationCallback(grade);
  20939. } else {
  20940. is_iassign = false;
  20941. }
  20942. isRunning = false;
  20943. })["catch"](function (err) {
  20944. console.log(err);
  20945. isRunning = false;
  20946. });
  20947. } catch (error) {
  20948. isRunning = false;
  20949. domConsole.err(error.message);
  20950. console.log(error);
  20951. if (!is_iassign) {
  20952. parent.getEvaluationCallback(0);
  20953. } else {
  20954. is_iassign = false;
  20955. }
  20956. }
  20957. return 0;
  20958. }
  20959. function runCode() {
  20960. if (isRunning) {
  20961. return;
  20962. }
  20963. var strCode = null;
  20964. if (settingsProgrammingTypes == "textual") {
  20965. strCode = _text_editor__WEBPACK_IMPORTED_MODULE_17__["getCode"]();
  20966. } else {
  20967. strCode = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  20968. }
  20969. if (strCode == null) {
  20970. return;
  20971. }
  20972. toggleConsole(true); // if(domConsole == null)
  20973. // domConsole = new DOMConsole("#ivprog-term");
  20974. //$("#ivprog-term").slideDown(500);
  20975. try {
  20976. var data = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__["SemanticAnalyser"].analyseFromSource(strCode);
  20977. proc = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_9__["IVProgProcessor"](data);
  20978. proc.registerInput(domConsole);
  20979. proc.registerOutput(domConsole);
  20980. $("#ivprog-term").addClass('ivprog-term-active');
  20981. isRunning = true;
  20982. proc.interpretAST().then(function (_) {
  20983. scheduleCall(function () {
  20984. if (domConsole.pending_writes.length == 0) {
  20985. if (proc.mode === _processor_modes__WEBPACK_IMPORTED_MODULE_19__["Modes"].ABORT) {
  20986. domConsole.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getMessage("aborted_execution"));
  20987. } else {
  20988. domConsole.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getMessage("success_execution"));
  20989. }
  20990. $("#ivprog-term").removeClass('ivprog-term-active');
  20991. isRunning = false;
  20992. proc = null;
  20993. showRunButton();
  20994. return true;
  20995. }
  20996. return false;
  20997. }, 100);
  20998. })["catch"](function (err) {
  20999. scheduleCall(function () {
  21000. if (domConsole.pending_writes.length == 0) {
  21001. if (err instanceof Error) {
  21002. domConsole.err(err.message);
  21003. } else {
  21004. domConsole.err(err);
  21005. }
  21006. $("#ivprog-term").removeClass('ivprog-term-active');
  21007. isRunning = false;
  21008. proc = null;
  21009. showRunButton();
  21010. return true;
  21011. }
  21012. return false;
  21013. }, 100);
  21014. });
  21015. } catch (error) {
  21016. scheduleCall(function () {
  21017. if (domConsole.pending_writes.length == 0) {
  21018. isRunning = false;
  21019. proc = null;
  21020. showRunButton();
  21021. domConsole.err(error.message);
  21022. console.log(error);
  21023. return true;
  21024. }
  21025. return false;
  21026. }, 100);
  21027. }
  21028. }
  21029. function toggleConsole(is_running) {
  21030. if (is_running) {
  21031. $('.ivprog-term-div').css('display', 'block');
  21032. $('#ivprog-term').css('min-height', '160px');
  21033. if (domConsole != null) domConsole.focus(); //$('#ivprog-term').css('margin-top', '-170px');
  21034. return;
  21035. } else {
  21036. domConsole.hide();
  21037. return;
  21038. }
  21039. if ($('#ivprog-term').css('min-height') == '160px') {
  21040. // esconder
  21041. $('.ivprog-term-div').css('display', 'none');
  21042. $('#ivprog-term').css('min-height', '0'); //$('#ivprog-term').css('margin-top', '-30px');
  21043. //$('#ivprog-term').css('padding', '5px');
  21044. } else {
  21045. // mostrar
  21046. $('.ivprog-term-div').css('display', 'block');
  21047. $('#ivprog-term').css('min-height', '160px'); //$('#ivprog-term').css('margin-top', '-170px');
  21048. }
  21049. } // function waitToCloseConsole () {
  21050. // domConsole.info("Aperte qualquer tecla para fechar...");
  21051. // const p = new Promise((resolve, _) => {
  21052. // domConsole.requestInput(resolve, true);
  21053. // });
  21054. // p.then( _ => {
  21055. // domConsole.dispose();
  21056. // domConsole = null;
  21057. // $("#ivprog-term").hide();
  21058. // })
  21059. // }
  21060. function toggleTextualCoding() {
  21061. var code = null;
  21062. if (settingsProgrammingTypes != "textual") {
  21063. code = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  21064. if (code == null) {
  21065. return;
  21066. }
  21067. }
  21068. $('.ivprog_visual_panel').css('display', 'none');
  21069. $('.ivprog_textual_panel').css('display', 'block');
  21070. $('.ivprog_textual_panel').removeClass('loading');
  21071. _text_editor__WEBPACK_IMPORTED_MODULE_17__["updateEditor"]();
  21072. if (code != null) _text_editor__WEBPACK_IMPORTED_MODULE_17__["setCode"](code); //$('.ivprog_textual_code').text(code);
  21073. $('.visual_coding_button').removeClass('active');
  21074. $('.textual_coding_button').addClass('active');
  21075. }
  21076. function toggleVisualCoding() {
  21077. $('.ivprog_textual_panel').addClass('loading');
  21078. $('.ivprog_textual_panel').css('display', 'none');
  21079. $('.ivprog_visual_panel').css('display', 'block');
  21080. $('.textual_coding_button').removeClass('active');
  21081. $('.visual_coding_button').addClass('active');
  21082. }
  21083. function removeParameter(function_obj, parameter_obj, parameter_container) {
  21084. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(parameter_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_FUNCTION_PARAM, function_obj.name);
  21085. var index = function_obj.parameters_list.indexOf(parameter_obj);
  21086. if (index > -1) {
  21087. window.insertContext = true;
  21088. function_obj.parameters_list.splice(index, 1);
  21089. }
  21090. $(parameter_container).fadeOut();
  21091. }
  21092. function updateParameterType(parameter_obj, new_type, function_name) {
  21093. var new_dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  21094. 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);
  21095. parameter_obj.type = new_type;
  21096. parameter_obj.dimensions = new_dimensions;
  21097. if (new_dimensions > 0) {
  21098. parameter_obj.rows = new_dimensions;
  21099. parameter_obj.columns = 2;
  21100. }
  21101. }
  21102. function renderParameter(function_obj, parameter_obj, function_container) {
  21103. var ret = "";
  21104. ret += '<div class="ui label function_name_parameter pink"><i class="ui icon ellipsis vertical inverted"></i>';
  21105. ret += '<div class="ui dropdown parameter_type">';
  21106. if (parameter_obj.dimensions > 0) {
  21107. 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()));
  21108. if (parameter_obj.dimensions == 1) {
  21109. ret += ' [ ] ';
  21110. } else {
  21111. ret += ' [ ] [ ] ';
  21112. }
  21113. ret += '</div>';
  21114. } else {
  21115. ret += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(parameter_obj.type.toLowerCase())) + '</div>';
  21116. }
  21117. ret += '<div class="menu">';
  21118. for (var _tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21119. if (_tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  21120. continue;
  21121. }
  21122. 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>';
  21123. }
  21124. 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">';
  21125. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21126. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  21127. continue;
  21128. }
  21129. 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>';
  21130. }
  21131. ret += '</div></div>';
  21132. 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">';
  21133. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21134. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  21135. continue;
  21136. }
  21137. 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>';
  21138. }
  21139. ret += '</div></div>';
  21140. ret += '</div></div>';
  21141. ret += '<div class="parameter_div_edit"><span class="span_name_parameter label_enable_name_parameter">' + parameter_obj.name + '</span></div> ';
  21142. ret += ' <i class="yellow inverted icon times remove_parameter"></i></div>';
  21143. ret = $(ret);
  21144. function_container.find('.container_parameters_list').append(ret);
  21145. ret.find('.remove_parameter').on('click', function (e) {
  21146. removeParameter(function_obj, parameter_obj, ret);
  21147. });
  21148. ret.find('.ui.dropdown.parameter_type').dropdown({
  21149. onChange: function onChange(_, __, $selectedItem) {
  21150. if ($selectedItem.data('dimensions')) {
  21151. updateParameterType(parameter_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name, $selectedItem.data('dimensions'));
  21152. } else {
  21153. updateParameterType(parameter_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name);
  21154. }
  21155. },
  21156. selectOnKeydown: false
  21157. });
  21158. ret.find('.parameter_div_edit').on('click', function (e) {
  21159. 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);
  21160. enableNameParameterUpdate(parameter_obj, ret, function_obj);
  21161. });
  21162. return ret;
  21163. }
  21164. function updateParameterName(parameter_var, new_name, parameter_obj_dom, function_obj) {
  21165. if (parameter_var.name == new_name) {
  21166. return;
  21167. }
  21168. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_18__["isValidIdentifier"])(new_name)) {
  21169. if (variableNameAlreadyExists(new_name, function_obj)) {
  21170. _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]));
  21171. } else {
  21172. 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);
  21173. parameter_var.name = new_name;
  21174. }
  21175. } else {
  21176. _utils__WEBPACK_IMPORTED_MODULE_14__["renderErrorMessage"](parameter_obj_dom.find('.parameter_div_edit'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  21177. }
  21178. }
  21179. function variableNameAlreadyExists(name_var, function_obj) {
  21180. if (function_obj.parameters_list) {
  21181. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  21182. if (function_obj.parameters_list[i].name == name_var) {
  21183. return true;
  21184. }
  21185. }
  21186. }
  21187. if (function_obj.variables_list) {
  21188. for (var i = 0; i < function_obj.variables_list.length; i++) {
  21189. if (function_obj.variables_list[i].name == name_var) {
  21190. return true;
  21191. }
  21192. }
  21193. }
  21194. return false;
  21195. }
  21196. function updateFunctionName(function_var, new_name, function_obj_dom) {
  21197. if (function_var.name == new_name) {
  21198. return;
  21199. }
  21200. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_18__["isValidIdentifier"])(new_name)) {
  21201. if (functionNameAlreadyExists(new_name)) {
  21202. _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]));
  21203. } else {
  21204. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].RENAME_FUNCTION, new_name);
  21205. function_var.name = new_name;
  21206. }
  21207. } else {
  21208. _utils__WEBPACK_IMPORTED_MODULE_14__["renderErrorMessage"](function_obj_dom.find('.function_name_div'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  21209. }
  21210. }
  21211. function functionNameAlreadyExists(function_name) {
  21212. for (var i = 0; i < window.program_obj.functions.length; i++) {
  21213. if (window.program_obj.functions[i].name == function_name) {
  21214. return true;
  21215. }
  21216. }
  21217. return false;
  21218. }
  21219. var opened_name_parameter = false;
  21220. var opened_input_parameter = null;
  21221. function enableNameParameterUpdate(parameter_obj, parent_node, function_obj) {
  21222. if (opened_name_parameter) {
  21223. opened_input_parameter.focus();
  21224. return;
  21225. }
  21226. opened_name_parameter = true;
  21227. parent_node = $(parent_node);
  21228. var input_field;
  21229. parent_node.find('.span_name_parameter').text('');
  21230. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + parameter_obj.name + "' />");
  21231. input_field.insertBefore(parent_node.find('.span_name_parameter'));
  21232. input_field.on('input', function () {
  21233. var inputWidth = input_field.textWidth() + 10;
  21234. opened_input_parameter = input_field;
  21235. input_field.focus();
  21236. var tmpStr = input_field.val();
  21237. input_field.val('');
  21238. input_field.val(tmpStr);
  21239. input_field.css({
  21240. width: inputWidth
  21241. });
  21242. }).trigger('input');
  21243. input_field.focusout(function () {
  21244. /// update array:
  21245. if (input_field.val().trim()) {
  21246. updateParameterName(parameter_obj, input_field.val().trim(), parent_node, function_obj);
  21247. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  21248. }
  21249. input_field.off();
  21250. input_field.remove(); /// update elements:
  21251. opened_name_parameter = false;
  21252. opened_input_parameter = false;
  21253. });
  21254. input_field.on('keydown', function (e) {
  21255. var code = e.keyCode || e.which;
  21256. if (code == 13) {
  21257. if (input_field.val().trim()) {
  21258. updateParameterName(parameter_obj, input_field.val().trim(), parent_node, function_obj);
  21259. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  21260. }
  21261. input_field.off();
  21262. input_field.remove(); /// update elements:
  21263. opened_name_parameter = false;
  21264. opened_input_parameter = false;
  21265. }
  21266. if (code == 27) {
  21267. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  21268. input_field.off();
  21269. input_field.remove(); /// update elements:
  21270. opened_name_parameter = false;
  21271. opened_input_parameter = false;
  21272. }
  21273. });
  21274. input_field.select();
  21275. }
  21276. var opened_name_function = false;
  21277. var opened_input = null;
  21278. var previousPadding = null;
  21279. function enableNameFunctionUpdate(function_obj, parent_node) {
  21280. if (opened_name_function) {
  21281. opened_input.focus();
  21282. return;
  21283. }
  21284. parent_node = $(parent_node);
  21285. parent_node.find('.span_name_function').text('');
  21286. var input_field;
  21287. if (!previousPadding) {
  21288. previousPadding = parent_node.find('.span_name_function').css('padding-left');
  21289. }
  21290. parent_node.find('.span_name_function').css('padding-left', '0');
  21291. parent_node.find('.span_name_function').css('padding-right', '0');
  21292. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + function_obj.name + "' />");
  21293. input_field.insertBefore(parent_node.find('.span_name_function'));
  21294. input_field.on('input', function () {
  21295. var inputWidth = input_field.textWidth() + 10;
  21296. opened_input = input_field;
  21297. input_field.focus();
  21298. var tmpStr = input_field.val();
  21299. input_field.val('');
  21300. input_field.val(tmpStr);
  21301. input_field.css({
  21302. width: inputWidth
  21303. });
  21304. }).trigger('input');
  21305. input_field.focusout(function () {
  21306. /// update array:
  21307. if (input_field.val().trim()) {
  21308. updateFunctionName(function_obj, input_field.val().trim(), parent_node);
  21309. }
  21310. input_field.off();
  21311. input_field.remove();
  21312. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  21313. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  21314. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  21315. opened_name_function = false;
  21316. opened_input = false;
  21317. });
  21318. input_field.on('keydown', function (e) {
  21319. var code = e.keyCode || e.which;
  21320. if (code == 13) {
  21321. if (input_field.val().trim()) {
  21322. updateFunctionName(function_obj, input_field.val().trim(), parent_node);
  21323. }
  21324. input_field.off();
  21325. input_field.remove();
  21326. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  21327. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  21328. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  21329. opened_name_function = false;
  21330. opened_input = false;
  21331. }
  21332. if (code == 27) {
  21333. input_field.off();
  21334. input_field.remove();
  21335. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  21336. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  21337. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  21338. opened_name_function = false;
  21339. opened_input = false;
  21340. }
  21341. });
  21342. input_field.select();
  21343. }
  21344. function addFunctionChangeListener(callback) {
  21345. functionsChangeListeners.push(callback);
  21346. return functionsChangeListeners.length - 1;
  21347. }
  21348. function addGlobalChangeListener(callback) {
  21349. globalChangeListeners.push(callback);
  21350. return globalChangeListeners.length - 1;
  21351. }
  21352. function removeGlobalListener(index) {
  21353. globalChangeListeners.splice(index, 1);
  21354. }
  21355. function removeFunctionListener(index) {
  21356. functionsChangeListeners.splice(index);
  21357. }
  21358. function scheduleCall(callback, time) {
  21359. var scheduled_call = function scheduled_call() {
  21360. var id = setInterval(function () {
  21361. if (callback()) {
  21362. clearInterval(id);
  21363. }
  21364. }, time);
  21365. };
  21366. scheduled_call();
  21367. }
  21368. function showRunButton() {
  21369. document.getElementById('run_button').style.display = 'inline';
  21370. document.getElementById('stop_button').style.display = 'none';
  21371. }
  21372. function showStopButton() {
  21373. document.getElementById('run_button').style.display = 'none';
  21374. document.getElementById('stop_button').style.display = 'inline';
  21375. }
  21376. function stopExecution() {
  21377. domConsole.clearPendingWrites();
  21378. domConsole.cancelPendingInputRequests();
  21379. if (!isRunning) {
  21380. return;
  21381. }
  21382. proc.mode = _processor_modes__WEBPACK_IMPORTED_MODULE_19__["Modes"].ABORT;
  21383. }
  21384. /***/ }),
  21385. /***/ "./js/visualUI/globals.js":
  21386. /*!********************************!*\
  21387. !*** ./js/visualUI/globals.js ***!
  21388. \********************************/
  21389. /*! exports provided: addGlobal, renderGlobal */
  21390. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21391. "use strict";
  21392. __webpack_require__.r(__webpack_exports__);
  21393. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addGlobal", function() { return addGlobal; });
  21394. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderGlobal", function() { return renderGlobal; });
  21395. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  21396. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  21397. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  21398. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  21399. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  21400. var counter_new_globals = 0;
  21401. function addGlobal(program) {
  21402. var is_from_click = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  21403. 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);
  21404. counter_new_globals++;
  21405. program.addGlobal(new_global);
  21406. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(new_global.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].INSERT_GLOBAL_VAR);
  21407. var newe = renderGlobal(new_global);
  21408. if (is_from_click) {
  21409. newe.css('display', 'none');
  21410. newe.fadeIn();
  21411. }
  21412. }
  21413. function toggleConstant(global_var) {
  21414. global_var.is_constant = !global_var.is_constant;
  21415. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].SET_GLOBAL_CONST);
  21416. }
  21417. function updateName(global_var, new_name, global_obj_dom) {
  21418. if (global_var.name == new_name) {
  21419. return;
  21420. }
  21421. if (isValidIdentifier(new_name)) {
  21422. if (globalNameAlreadyExists(new_name)) {
  21423. _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'));
  21424. } else {
  21425. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].RENAME_GLOBAL_VAR, new_name);
  21426. global_var.name = new_name;
  21427. }
  21428. } else {
  21429. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](global_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('inform_valid_name'));
  21430. }
  21431. }
  21432. function globalNameAlreadyExists(global_name) {
  21433. for (var i = 0; i < window.program_obj.globals.length; i++) {
  21434. if (window.program_obj.globals[i].name == global_name) {
  21435. return true;
  21436. }
  21437. }
  21438. return false;
  21439. }
  21440. function isValidIdentifier(identifier_str) {
  21441. return /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier_str);
  21442. }
  21443. function updateType(global_var, new_type) {
  21444. var new_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  21445. global_var.type = new_type;
  21446. global_var.dimensions = new_dimensions;
  21447. if (new_dimensions > 0) {
  21448. global_var.rows = new_dimensions;
  21449. global_var.columns = 2;
  21450. }
  21451. 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);
  21452. updateInitialValues(global_var);
  21453. }
  21454. function removeGlobal(global_var, global_container) {
  21455. var index = window.program_obj.globals.indexOf(global_var);
  21456. if (index > -1) {
  21457. window.insertContext = true;
  21458. window.program_obj.globals.splice(index, 1);
  21459. }
  21460. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].REMOVE_GLOBAL_VAR);
  21461. global_container.children().off();
  21462. global_container.off();
  21463. global_container.fadeOut();
  21464. }
  21465. function updateInitialValues(global_var) {
  21466. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21467. if (global_var.dimensions == 0) {
  21468. global_var.value = 0;
  21469. }
  21470. if (global_var.dimensions == 1) {
  21471. global_var.value = [0, 0];
  21472. }
  21473. if (global_var.dimensions == 2) {
  21474. global_var.value = [[0, 0], [0, 0]];
  21475. }
  21476. }
  21477. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21478. if (global_var.dimensions == 0) {
  21479. global_var.value = 0.0;
  21480. }
  21481. if (global_var.dimensions == 1) {
  21482. global_var.value = [0.0, 0.0];
  21483. }
  21484. if (global_var.dimensions == 2) {
  21485. global_var.value = [[0.0, 0.0], [0.0, 0.0]];
  21486. }
  21487. }
  21488. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21489. if (global_var.dimensions == 0) {
  21490. global_var.value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value');
  21491. }
  21492. if (global_var.dimensions == 1) {
  21493. 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')];
  21494. }
  21495. if (global_var.dimensions == 2) {
  21496. 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')]];
  21497. }
  21498. }
  21499. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21500. if (global_var.dimensions == 0) {
  21501. global_var.value = true;
  21502. }
  21503. if (global_var.dimensions == 1) {
  21504. global_var.value = [true, true];
  21505. }
  21506. if (global_var.dimensions == 2) {
  21507. global_var.value = [[true, true], [true, true]];
  21508. }
  21509. }
  21510. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21511. if (global_var.dimensions == 0) {
  21512. global_var.value = 'A';
  21513. }
  21514. if (global_var.dimensions == 1) {
  21515. global_var.value = ['A', 'A'];
  21516. }
  21517. if (global_var.dimensions == 2) {
  21518. global_var.value = [['A', 'A'], ['A', 'A']];
  21519. }
  21520. }
  21521. 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);
  21522. }
  21523. function alternateBooleanGlobalValue(global_var, value_container) {
  21524. global_var.value = !global_var.value;
  21525. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value)));
  21526. }
  21527. function alternateBooleanGlobalVectorValue(global_var, index, value_container) {
  21528. global_var.value[index] = !global_var.value[index];
  21529. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value[index])));
  21530. }
  21531. function removeGlobalColumnVector(global_var) {
  21532. if (global_var.columns == 0) {
  21533. return;
  21534. }
  21535. global_var.columns--;
  21536. global_var.value.splice(global_var.value.length - 1, 1);
  21537. }
  21538. function addGlobalColumnVector(global_var) {
  21539. global_var.columns++;
  21540. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21541. global_var.value.push(0);
  21542. }
  21543. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21544. global_var.value.push(0.0);
  21545. }
  21546. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21547. global_var.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  21548. }
  21549. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21550. global_var.value.push(true);
  21551. }
  21552. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21553. global_var.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  21554. }
  21555. }
  21556. function removeColumnGlobalMatrix(global_var) {
  21557. if (global_var.columns == 0) {
  21558. return;
  21559. }
  21560. global_var.columns--;
  21561. for (var i = 0; i < global_var.rows; i++) {
  21562. global_var.value[i].splice(global_var.value[i].length - 1, 1);
  21563. }
  21564. }
  21565. function addColumnGlobalMatrix(global_var) {
  21566. global_var.columns++;
  21567. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21568. for (var i = 0; i < global_var.rows; i++) {
  21569. global_var.value[i].push(0);
  21570. }
  21571. }
  21572. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21573. for (var i = 0; i < global_var.rows; i++) {
  21574. global_var.value[i].push(0.0);
  21575. }
  21576. }
  21577. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21578. for (var i = 0; i < global_var.rows; i++) {
  21579. global_var.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  21580. }
  21581. }
  21582. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21583. for (var i = 0; i < global_var.rows; i++) {
  21584. global_var.value[i].push(true);
  21585. }
  21586. }
  21587. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21588. for (var i = 0; i < global_var.rows; i++) {
  21589. global_var.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  21590. }
  21591. }
  21592. }
  21593. function removeLineGlobalMatrix(global_var) {
  21594. if (global_var.rows == 0) {
  21595. return;
  21596. }
  21597. global_var.rows--;
  21598. global_var.value.splice(global_var.value.length - 1, 1);
  21599. }
  21600. function addLineGlobalMatrix(global_var) {
  21601. global_var.rows++;
  21602. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21603. var n_l = [];
  21604. for (var i = 0; i < global_var.columns; i++) {
  21605. n_l.push(0);
  21606. }
  21607. global_var.value.push(n_l);
  21608. }
  21609. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21610. var n_l = [];
  21611. for (i = 0; i < global_var.columns; i++) {
  21612. n_l.push(0.0);
  21613. }
  21614. global_var.value.push(n_l);
  21615. }
  21616. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21617. var n_l = [];
  21618. for (i = 0; i < global_var.columns; i++) {
  21619. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  21620. }
  21621. global_var.value.push(n_l);
  21622. }
  21623. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21624. var n_l = [];
  21625. for (i = 0; i < global_var.columns; i++) {
  21626. n_l.push(true);
  21627. }
  21628. global_var.value.push(n_l);
  21629. }
  21630. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  21631. var n_l = [];
  21632. for (i = 0; i < global_var.columns; i++) {
  21633. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  21634. }
  21635. global_var.value.push(n_l);
  21636. }
  21637. }
  21638. function alternateBooleanGlobalMatrixValue(global_var, row, index, value_container) {
  21639. global_var.value[row][index] = !global_var.value[row][index];
  21640. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value[row][index])));
  21641. }
  21642. function renderValues(global_var, global_container) {
  21643. var ret = "";
  21644. var j = 0;
  21645. if (global_var.dimensions == 0) {
  21646. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21647. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + global_var.value.toFixed(1) + '</span> </div> ';
  21648. } else {
  21649. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21650. 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> ';
  21651. } else {
  21652. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + global_var.value + '</span> </div> ';
  21653. }
  21654. }
  21655. } else {
  21656. ret += '<table class="tabela_var">';
  21657. if (global_var.dimensions == 1) {
  21658. ret += '<tr>';
  21659. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21660. for (var k = 0; k < global_var.columns; k++) {
  21661. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + global_var.value[k].toFixed(1) + '</span></td>';
  21662. }
  21663. } else {
  21664. for (var k = 0; k < global_var.columns; k++) {
  21665. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21666. 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>';
  21667. } else {
  21668. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + global_var.value[k] + '</span>' + '</td>';
  21669. }
  21670. }
  21671. }
  21672. ret += '</tr>';
  21673. ret += '</table>';
  21674. 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>';
  21675. }
  21676. if (global_var.dimensions == 2) {
  21677. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21678. for (var l = 0; l < global_var.rows; l++) {
  21679. ret += '<tr>';
  21680. for (var k = 0; k < global_var.columns; k++) {
  21681. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + global_var.value[l][k].toFixed(1) + '</span>' + '</td>';
  21682. }
  21683. ret += '</tr>';
  21684. }
  21685. } else {
  21686. for (var l = 0; l < global_var.rows; l++) {
  21687. ret += '<tr>';
  21688. for (var k = 0; k < global_var.columns; k++) {
  21689. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  21690. 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>';
  21691. } else {
  21692. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + global_var.value[l][k] + '</span></td>';
  21693. }
  21694. }
  21695. ret += '</tr>';
  21696. }
  21697. }
  21698. if (global_var.rows == 0) {
  21699. ret += '<tr><td></td></tr>';
  21700. }
  21701. 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>';
  21702. ret += '</table>';
  21703. 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>';
  21704. }
  21705. }
  21706. global_container.find(".div_valor_var").html('');
  21707. ret = $(ret);
  21708. ret.find('.span_value_variable').data('associatedOject', global_var);
  21709. ret.find(".boolean_simple_type").on('click', function (e) {
  21710. alternateBooleanGlobalValue(global_var, this.parentNode);
  21711. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21712. });
  21713. ret.find(".simple_var").on('click', function (e) {
  21714. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  21715. enableGlobalValueUpdate(global_var, this.parentNode);
  21716. });
  21717. ret.find(".boolean_vector_var").on('click', function (e) {
  21718. alternateBooleanGlobalVectorValue(global_var, $(this).data('index'), this.parentNode);
  21719. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21720. });
  21721. ret.find(".vector_var").on('click', function (e) {
  21722. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  21723. enableGlobalVectorValueUpdate(global_var, $(this).data('index'), this.parentNode);
  21724. });
  21725. ret.find(".remove_global_vector_column").on('click', function (e) {
  21726. removeGlobalColumnVector(global_var);
  21727. global_container.find(".div_valor_var").html('');
  21728. 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);
  21729. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21730. renderValues(global_var, global_container);
  21731. });
  21732. ret.find(".add_global_vector_column").on('click', function (e) {
  21733. addGlobalColumnVector(global_var);
  21734. 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);
  21735. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21736. global_container.find(".div_valor_var").html('');
  21737. renderValues(global_var, global_container);
  21738. });
  21739. ret.find(".remove_global_matrix_column").on('click', function (e) {
  21740. removeColumnGlobalMatrix(global_var);
  21741. 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);
  21742. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21743. global_container.find(".div_valor_var").html('');
  21744. renderValues(global_var, global_container);
  21745. });
  21746. ret.find(".add_global_matrix_column").on('click', function (e) {
  21747. addColumnGlobalMatrix(global_var);
  21748. 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);
  21749. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21750. global_container.find(".div_valor_var").html('');
  21751. renderValues(global_var, global_container);
  21752. });
  21753. ret.find(".remove_global_matrix_line").on('click', function (e) {
  21754. removeLineGlobalMatrix(global_var);
  21755. 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);
  21756. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21757. global_container.find(".div_valor_var").html('');
  21758. renderValues(global_var, global_container);
  21759. });
  21760. ret.find(".add_global_matrix_line").on('click', function (e) {
  21761. addLineGlobalMatrix(global_var);
  21762. 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);
  21763. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21764. global_container.find(".div_valor_var").html('');
  21765. renderValues(global_var, global_container);
  21766. });
  21767. ret.find(".boolean_matrix_var").on('click', function (e) {
  21768. alternateBooleanGlobalMatrixValue(global_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  21769. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21770. });
  21771. ret.find(".matrix_var").on('click', function (e) {
  21772. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  21773. enableGlobalMatrixValueUpdate(global_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  21774. });
  21775. global_container.find(".div_valor_var").append(ret);
  21776. updateColumnsAndRowsText(global_container, global_var);
  21777. }
  21778. function addHandlers(global_container) {
  21779. var global_var = global_container.data('associatedOject'); // Manage constant option:
  21780. global_container.find(".alternate_constant").on('click', function (e) {
  21781. toggleConstant(global_var);
  21782. $(this).removeClass("on off");
  21783. if (global_var.is_constant) {
  21784. $(this).addClass("on");
  21785. } else {
  21786. $(this).addClass("off");
  21787. }
  21788. }); // Manage global name:
  21789. global_container.find(".editing_name_var").on('click', function (e) {
  21790. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_NAME);
  21791. enableNameUpdate(global_container);
  21792. }); // Menu to change type:
  21793. global_container.find('.ui.dropdown.global_type').dropdown({
  21794. onChange: function onChange(_, __, $selectedItem) {
  21795. if ($selectedItem.data('dimensions')) {
  21796. updateType(global_var, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], $selectedItem.data('dimensions'));
  21797. } else {
  21798. updateType(global_var, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')]);
  21799. }
  21800. renderValues(global_var, global_container);
  21801. },
  21802. selectOnKeydown: false
  21803. }); // Remove global:
  21804. global_container.find(".remove_global").on('click', function (e) {
  21805. removeGlobal(global_var, global_container);
  21806. });
  21807. }
  21808. function updateColumnsAndRowsText(global_container, global_var) {
  21809. var prev = global_container.find('.text').text().split('[');
  21810. if (prev.length == 2) {
  21811. var ff = prev[0] + '[ ' + global_var.columns + ' ] ';
  21812. global_container.find('.text').empty();
  21813. global_container.find('.text').text(ff);
  21814. }
  21815. if (prev.length == 3) {
  21816. var ff = prev[0] + '[ ' + global_var.columns + ' ] [ ' + global_var.rows + ' ] ';
  21817. global_container.find('.text').empty();
  21818. global_container.find('.text').text(ff);
  21819. }
  21820. }
  21821. function renderGlobal(global_var) {
  21822. var element = '<div class="ui label global_container pink"><i class="ui icon ellipsis vertical inverted"></i><div class="global_const">const: ';
  21823. element += '<i class="ui icon toggle ' + (global_var.is_constant ? "on" : "off") + ' alternate_constant"></i></div>';
  21824. element += '<div class="ui dropdown global_type">';
  21825. if (global_var.dimensions == 1) {
  21826. 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));
  21827. element += ' [ <span class="dimensions_0"></span> ] ';
  21828. element += '</div>';
  21829. } else if (global_var.dimensions == 2) {
  21830. 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));
  21831. element += ' [ <span class="dimensions_0"></span> ] [ <span class="dimensions_1"></span> ] ';
  21832. element += '</div>';
  21833. } else {
  21834. element += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(global_var.type.toLowerCase())) + '</div>';
  21835. }
  21836. element += '<div class="menu">';
  21837. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21838. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  21839. continue;
  21840. }
  21841. 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>';
  21842. }
  21843. 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">';
  21844. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21845. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  21846. continue;
  21847. }
  21848. 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>';
  21849. }
  21850. element += '</div></div>';
  21851. 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">';
  21852. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  21853. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  21854. continue;
  21855. }
  21856. 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>';
  21857. }
  21858. element += '</div></div>';
  21859. 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> ';
  21860. element += '<div class="ui div_valor_var">' + global_var.value + '</div>';
  21861. element += ' <i class="yellow inverted icon times remove_global"></i></div>';
  21862. var complete_element = $(element);
  21863. complete_element.data('associatedOject', global_var);
  21864. $('.list_globals').append(complete_element);
  21865. addHandlers(complete_element);
  21866. renderValues(global_var, complete_element);
  21867. if (global_var.dimensions == 1) {
  21868. complete_element.find('.dimensions_0').text(global_var.columns);
  21869. }
  21870. if (global_var.dimensions == 2) {
  21871. complete_element.find('.dimensions_0').text(global_var.columns);
  21872. complete_element.find('.dimensions_1').text(global_var.rows);
  21873. }
  21874. return complete_element;
  21875. }
  21876. var opened_name_value_matrix_global_v = false;
  21877. var opened_input_value_matrix_global_v = null;
  21878. function enableGlobalMatrixValueUpdate(global_var, row, index, parent_node) {
  21879. if (opened_name_value_matrix_global_v) {
  21880. opened_input_value_matrix_global_v.focus();
  21881. return;
  21882. }
  21883. parent_node = $(parent_node);
  21884. opened_name_value_matrix_global_v = true;
  21885. parent_node.find('.span_value_variable').text('');
  21886. var input_field;
  21887. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21888. 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) + "' />");
  21889. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21890. } else {
  21891. 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] + "' />");
  21892. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21893. }
  21894. input_field.on('input', function () {
  21895. var inputWidth = input_field.textWidth() + 10;
  21896. opened_input_value_matrix_global_v = input_field;
  21897. input_field.focus();
  21898. var tmpStr = input_field.val();
  21899. input_field.val('');
  21900. input_field.val(tmpStr);
  21901. input_field.css({
  21902. width: inputWidth
  21903. });
  21904. }).trigger('input');
  21905. input_field.focusout(function () {
  21906. /// update array:
  21907. if (input_field.val().trim()) {
  21908. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21909. global_var.value[row][index] = parseFloat(input_field.val().trim());
  21910. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  21911. } else {
  21912. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21913. global_var.value[row][index] = parseInt(input_field.val().trim());
  21914. } else {
  21915. global_var.value[row][index] = input_field.val().trim();
  21916. }
  21917. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21918. }
  21919. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21920. } else {
  21921. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21922. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  21923. } else {
  21924. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21925. }
  21926. }
  21927. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21928. global_var.value[row][index] = input_field.val();
  21929. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21930. }
  21931. input_field.off();
  21932. input_field.remove(); /// update elements:
  21933. opened_name_value_matrix_global_v = false;
  21934. opened_input_value_matrix_global_v = false;
  21935. });
  21936. input_field.on('keydown', function (e) {
  21937. var code = e.keyCode || e.which;
  21938. if (code == 13) {
  21939. if (input_field.val().trim()) {
  21940. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21941. global_var.value[row][index] = parseFloat(input_field.val().trim());
  21942. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  21943. } else {
  21944. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21945. global_var.value[row][index] = parseInt(input_field.val().trim());
  21946. } else {
  21947. global_var.value[row][index] = input_field.val().trim();
  21948. }
  21949. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21950. }
  21951. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21952. } else {
  21953. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21954. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  21955. } else {
  21956. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21957. }
  21958. }
  21959. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21960. global_var.value[row][index] = input_field.val();
  21961. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  21962. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21963. }
  21964. input_field.off();
  21965. input_field.remove(); /// update elements:
  21966. opened_name_value_matrix_global_v = false;
  21967. opened_input_value_matrix_global_v = false;
  21968. }
  21969. if (code == 27) {
  21970. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21971. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  21972. } else {
  21973. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  21974. }
  21975. input_field.off();
  21976. input_field.remove(); /// update elements:
  21977. opened_name_value_matrix_global_v = false;
  21978. opened_input_value_matrix_global_v = false;
  21979. }
  21980. });
  21981. input_field.select();
  21982. }
  21983. var opened_name_value_global_var = false;
  21984. var opened_input_value_global_ar = null;
  21985. function enableGlobalValueUpdate(global_var, parent_node) {
  21986. if (opened_name_value_global_var) {
  21987. opened_input_value_global_ar.focus();
  21988. return;
  21989. }
  21990. parent_node = $(parent_node);
  21991. opened_name_value_global_var = true;
  21992. parent_node.find('.span_value_variable').text('');
  21993. var input_field;
  21994. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21995. 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) + "' />");
  21996. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21997. } else {
  21998. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.value + "' />");
  21999. input_field.insertBefore(parent_node.find('.span_value_variable'));
  22000. }
  22001. input_field.on('input', function () {
  22002. var inputWidth = input_field.textWidth() + 10;
  22003. opened_input_value_global_ar = input_field;
  22004. input_field.focus();
  22005. var tmpStr = input_field.val();
  22006. input_field.val('');
  22007. input_field.val(tmpStr);
  22008. input_field.css({
  22009. width: inputWidth
  22010. });
  22011. }).trigger('input');
  22012. input_field.focusout(function () {
  22013. var changed = false; /// update array:
  22014. if (input_field.val().trim()) {
  22015. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22016. global_var.value = parseFloat(input_field.val().trim());
  22017. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  22018. } else {
  22019. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22020. global_var.value = parseInt(input_field.val().trim());
  22021. } else if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22022. var_obj.value = input_field.val().charAt(0);
  22023. } else {
  22024. global_var.value = input_field.val().trim();
  22025. }
  22026. parent_node.find('.span_value_variable').text(global_var.value);
  22027. }
  22028. changed = true;
  22029. } else {
  22030. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22031. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  22032. } else {
  22033. parent_node.find('.span_value_variable').text(global_var.value);
  22034. }
  22035. }
  22036. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22037. global_var.value = input_field.val();
  22038. changed = true;
  22039. parent_node.find('.span_value_variable').text(global_var.value);
  22040. }
  22041. if (changed) {
  22042. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  22043. }
  22044. input_field.off();
  22045. input_field.remove(); /// update elements:
  22046. opened_name_value_global_var = false;
  22047. opened_input_value_global_ar = false;
  22048. });
  22049. input_field.on('keydown', function (e) {
  22050. var code = e.keyCode || e.which;
  22051. var changed = true;
  22052. if (code == 13) {
  22053. if (input_field.val().trim()) {
  22054. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22055. global_var.value = parseFloat(input_field.val().trim());
  22056. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  22057. } else {
  22058. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22059. global_var.value = parseInt(input_field.val().trim());
  22060. } else if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  22061. var_obj.value = input_field.val().charAt(0);
  22062. } else {
  22063. global_var.value = input_field.val().trim();
  22064. }
  22065. parent_node.find('.span_value_variable').text(global_var.value);
  22066. }
  22067. changed = true;
  22068. } else {
  22069. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22070. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  22071. } else {
  22072. parent_node.find('.span_value_variable').text(global_var.value);
  22073. }
  22074. }
  22075. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22076. global_var.value = input_field.val();
  22077. changed = true;
  22078. parent_node.find('.span_value_variable').text(global_var.value);
  22079. }
  22080. if (changed) {
  22081. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  22082. }
  22083. input_field.off();
  22084. input_field.remove(); /// update elements:
  22085. opened_name_value_global_var = false;
  22086. opened_input_value_global_ar = false;
  22087. }
  22088. if (code == 27) {
  22089. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22090. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  22091. } else {
  22092. parent_node.find('.span_value_variable').text(global_var.value);
  22093. }
  22094. input_field.off();
  22095. input_field.remove(); /// update elements:
  22096. opened_name_value_global_var = false;
  22097. opened_input_value_global_ar = false;
  22098. }
  22099. });
  22100. input_field.select();
  22101. }
  22102. var opened_name_global = false;
  22103. var opened_input_global = null;
  22104. function enableNameUpdate(global_container) {
  22105. var global_var = global_container.data('associatedOject');
  22106. if (opened_name_global) {
  22107. opened_input_global.focus();
  22108. return;
  22109. }
  22110. opened_name_global = true;
  22111. global_container.find('.span_name_variable').text('');
  22112. var input_name = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.name + "' />");
  22113. input_name.insertBefore(global_container.find('.span_name_variable'));
  22114. input_name.on('input', function () {
  22115. var inputWidth = input_name.textWidth() + 10;
  22116. opened_input_global = input_name;
  22117. opened_input_global.focus();
  22118. opened_input_global.css({
  22119. width: inputWidth
  22120. });
  22121. }).trigger('input');
  22122. input_name.focusout(function () {
  22123. /// update array:
  22124. if (input_name.val().trim().length > 0) {
  22125. updateName(global_var, input_name.val().trim(), global_container);
  22126. global_container.find('.span_name_variable').text(global_var.name);
  22127. } else {
  22128. global_container.find('.span_name_variable').text(global_var.name);
  22129. }
  22130. input_name.off();
  22131. input_name.remove(); /// update elements:
  22132. opened_name_global = false;
  22133. opened_input_global = false;
  22134. });
  22135. input_name.on('keydown', function (e) {
  22136. var code = e.keyCode || e.which;
  22137. if (code == 13) {
  22138. if (input_name.val().trim()) {
  22139. updateName(global_var, input_name.val().trim(), global_container);
  22140. global_container.find('.span_name_variable').text(global_var.name);
  22141. } else {
  22142. global_container.find('.span_name_variable').text(global_var.name);
  22143. }
  22144. input_name.off();
  22145. input_name.remove(); /// update elements:
  22146. opened_name_global = false;
  22147. opened_input_global = false;
  22148. }
  22149. if (code == 27) {
  22150. global_container.find('.span_name_variable').text(global_var.name);
  22151. input_name.off();
  22152. input_name.remove(); /// update elements:
  22153. opened_name_global = false;
  22154. opened_input_global = false;
  22155. }
  22156. });
  22157. input_name.select();
  22158. }
  22159. var opened_name_value_vector_global_ = false;
  22160. var opened_input_value_vector_global_ = null;
  22161. function enableGlobalVectorValueUpdate(global_var, index, parent_node) {
  22162. if (opened_name_value_vector_global_) {
  22163. opened_input_value_vector_global_.focus();
  22164. return;
  22165. }
  22166. parent_node = $(parent_node);
  22167. opened_name_value_vector_global_ = true;
  22168. parent_node.find('.span_value_variable').text('');
  22169. var input_field;
  22170. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22171. 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) + "' />");
  22172. input_field.insertBefore(parent_node.find('.span_value_variable'));
  22173. } else {
  22174. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.value[index] + "' />");
  22175. input_field.insertBefore(parent_node.find('.span_value_variable'));
  22176. }
  22177. input_field.on('input', function () {
  22178. var inputWidth = input_field.textWidth() + 10;
  22179. opened_input_value_vector_global_ = input_field;
  22180. input_field.focus();
  22181. var tmpStr = input_field.val();
  22182. input_field.val('');
  22183. input_field.val(tmpStr);
  22184. input_field.css({
  22185. width: inputWidth
  22186. });
  22187. }).trigger('input');
  22188. input_field.focusout(function () {
  22189. var changed = false; /// update array:
  22190. if (input_field.val().trim()) {
  22191. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22192. global_var.value[index] = parseFloat(input_field.val().trim());
  22193. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  22194. } else {
  22195. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22196. global_var.value[index] = parseInt(input_field.val().trim());
  22197. } else {
  22198. global_var.value[index] = input_field.val().trim();
  22199. }
  22200. parent_node.find('.span_value_variable').text(global_var.value[index]);
  22201. }
  22202. changed = true;
  22203. } else {
  22204. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22205. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  22206. } else {
  22207. parent_node.find('.span_value_variable').text(global_var.value[index]);
  22208. }
  22209. }
  22210. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22211. global_var.value[index] = input_field.val();
  22212. changed = true;
  22213. parent_node.find('.span_value_variable').text(global_var.value[index]);
  22214. }
  22215. if (changed) {
  22216. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  22217. }
  22218. input_field.off();
  22219. input_field.remove(); /// update elements:
  22220. opened_name_value_vector_global_ = false;
  22221. opened_input_value_vector_global_ = false;
  22222. });
  22223. input_field.on('keydown', function (e) {
  22224. var code = e.keyCode || e.which;
  22225. var changed = false;
  22226. if (code == 13) {
  22227. if (input_field.val().trim()) {
  22228. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22229. global_var.value[index] = parseFloat(input_field.val().trim());
  22230. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  22231. } else {
  22232. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  22233. global_var.value[index] = parseInt(input_field.val().trim());
  22234. } else {
  22235. global_var.value[index] = input_field.val().trim();
  22236. }
  22237. parent_node.find('.span_value_variable').text(global_var.value[index]);
  22238. }
  22239. changed = true;
  22240. } else {
  22241. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22242. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  22243. } else {
  22244. parent_node.find('.span_value_variable').text(global_var.value[index]);
  22245. }
  22246. }
  22247. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  22248. global_var.value[index] = input_field.val();
  22249. changed = true;
  22250. parent_node.find('.span_value_variable').text(global_var.value[index]);
  22251. }
  22252. if (changed) {
  22253. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  22254. }
  22255. input_field.off();
  22256. input_field.remove(); /// update elements:
  22257. opened_name_value_vector_global_ = false;
  22258. opened_input_value_vector_global_ = false;
  22259. }
  22260. if (code == 27) {
  22261. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22262. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  22263. } else {
  22264. parent_node.find('.span_value_variable').text(global_var.value[index]);
  22265. }
  22266. input_field.off();
  22267. input_field.remove(); /// update elements:
  22268. opened_name_value_vector_global_ = false;
  22269. opened_input_value_vector_global_ = false;
  22270. }
  22271. });
  22272. input_field.select();
  22273. }
  22274. $.fn.textWidth = function (text, font) {
  22275. if (!$.fn.textWidth.fakeEl) $.fn.textWidth.fakeEl = $('<span>').hide().appendTo(document.body);
  22276. $.fn.textWidth.fakeEl.text(text || this.val() || this.text() || this.attr('placeholder')).css('font', font || this.css('font'));
  22277. return $.fn.textWidth.fakeEl.width();
  22278. };
  22279. /***/ }),
  22280. /***/ "./js/visualUI/ivprog_elements.js":
  22281. /*!****************************************!*\
  22282. !*** ./js/visualUI/ivprog_elements.js ***!
  22283. \****************************************/
  22284. /*! 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 */
  22285. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22286. "use strict";
  22287. __webpack_require__.r(__webpack_exports__);
  22288. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMMAND_TYPES", function() { return COMMAND_TYPES; });
  22289. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARITHMETIC_TYPES", function() { return ARITHMETIC_TYPES; });
  22290. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXPRESSION_ELEMENTS", function() { return EXPRESSION_ELEMENTS; });
  22291. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXPRESSION_TYPES", function() { return EXPRESSION_TYPES; });
  22292. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARITHMETIC_COMPARISON", function() { return ARITHMETIC_COMPARISON; });
  22293. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOGIC_COMPARISON", function() { return LOGIC_COMPARISON; });
  22294. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYSTEM_FUNCTIONS_CATEGORIES", function() { return SYSTEM_FUNCTIONS_CATEGORIES; });
  22295. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Variable", function() { return Variable; });
  22296. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Function", function() { return Function; });
  22297. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SystemFunction", function() { return SystemFunction; });
  22298. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Comment", function() { return Comment; });
  22299. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Break", function() { return Break; });
  22300. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Reader", function() { return Reader; });
  22301. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Writer", function() { return Writer; });
  22302. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Attribution", function() { return Attribution; });
  22303. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpressionOperator", function() { return ExpressionOperator; });
  22304. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpressionElement", function() { return ExpressionElement; });
  22305. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConditionalExpression", function() { return ConditionalExpression; });
  22306. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogicExpression", function() { return LogicExpression; });
  22307. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArithmeticExpression", function() { return ArithmeticExpression; });
  22308. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IfTrue", function() { return IfTrue; });
  22309. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RepeatNTimes", function() { return RepeatNTimes; });
  22310. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WhileTrue", function() { return WhileTrue; });
  22311. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DoWhileTrue", function() { return DoWhileTrue; });
  22312. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return Switch; });
  22313. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Return", function() { return Return; });
  22314. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SwitchCase", function() { return SwitchCase; });
  22315. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return FunctionCall; });
  22316. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VariableValueMenu", function() { return VariableValueMenu; });
  22317. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCallMenu", function() { return FunctionCallMenu; });
  22318. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Program", function() { return Program; });
  22319. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
  22320. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0__);
  22321. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
  22322. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);
  22323. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  22324. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  22325. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_3__);
  22326. /* harmony import */ var _algorithm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./algorithm */ "./js/visualUI/algorithm.js");
  22327. var COMMAND_TYPES = Object.freeze({
  22328. "function": "function",
  22329. comment: "comment",
  22330. reader: "reader",
  22331. writer: "writer",
  22332. attribution: "attribution",
  22333. iftrue: "iftrue",
  22334. repeatNtimes: "repeatNtimes",
  22335. whiletrue: "whiletrue",
  22336. dowhiletrue: "dowhiletrue",
  22337. "switch": "switch",
  22338. switchcase: "switchcase",
  22339. functioncall: "functioncall",
  22340. "break": "break",
  22341. "return": "return"
  22342. });
  22343. var ARITHMETIC_TYPES = Object.freeze({
  22344. plus: "plus",
  22345. minus: "minus",
  22346. multiplication: "multiplication",
  22347. division: "division",
  22348. module: "module",
  22349. none: "none"
  22350. });
  22351. var EXPRESSION_ELEMENTS = Object.freeze({
  22352. exp_op_exp: "exp_op_exp",
  22353. op_exp: "op_exp",
  22354. par_exp_par: "par_exp_par",
  22355. start_point: "start_point"
  22356. });
  22357. var EXPRESSION_TYPES = Object.freeze({
  22358. exp_conditional: "exp_conditional",
  22359. exp_logic: "exp_logic",
  22360. exp_arithmetic: "exp_arithmetic",
  22361. write_sep: "write_separator"
  22362. });
  22363. var ARITHMETIC_COMPARISON = Object.freeze({
  22364. greater_than: "greater_than",
  22365. less_than: "less_than",
  22366. equals_to: "equals_to",
  22367. not_equals_to: "not_equals_to",
  22368. greater_than_or_equals_to: "greater_than_or_equals_to",
  22369. less_than_or_equals_to: "less_than_or_equals_to"
  22370. });
  22371. var LOGIC_COMPARISON = Object.freeze({
  22372. equals_to: "equals_to",
  22373. not_equals_to: "not_equals_to",
  22374. and: "and",
  22375. or: "or",
  22376. not: "not"
  22377. });
  22378. var SYSTEM_FUNCTIONS_CATEGORIES = Object.freeze({
  22379. math: "$mathLib",
  22380. text: "$strLib",
  22381. arrangement: "$arrayLib",
  22382. conversion: "$langLib"
  22383. });
  22384. var Variable = function Variable(type, name, value) {
  22385. var dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  22386. var is_constant = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  22387. var rows = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  22388. var columns = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;
  22389. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Variable);
  22390. this.type = type;
  22391. this.name = name;
  22392. this.value = value;
  22393. this.dimensions = dimensions;
  22394. this.is_constant = is_constant;
  22395. this.rows = rows;
  22396. this.columns = columns;
  22397. };
  22398. var Function = function Function(name) {
  22399. var return_type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _types__WEBPACK_IMPORTED_MODULE_2__["Types"].VOID;
  22400. var return_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  22401. var parameters_list = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  22402. var is_main = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  22403. var is_hidden = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
  22404. var variables_list = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [];
  22405. var function_comment = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
  22406. var commands = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : [];
  22407. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Function);
  22408. this.type = COMMAND_TYPES["function"];
  22409. this.name = name;
  22410. this.return_type = return_type;
  22411. this.return_dimensions = return_dimensions;
  22412. this.parameters_list = parameters_list;
  22413. this.is_main = is_main;
  22414. this.is_hidden = is_hidden;
  22415. this.variables_list = variables_list;
  22416. this.function_comment = function_comment;
  22417. this.commands = commands;
  22418. };
  22419. var SystemFunction = function SystemFunction(identifier, return_type, return_dimensions, parameters_list) {
  22420. var function_comment = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  22421. var category = arguments.length > 5 ? arguments[5] : undefined;
  22422. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, SystemFunction);
  22423. this.type = COMMAND_TYPES["function"];
  22424. this.identifier = identifier;
  22425. this.return_type = return_type;
  22426. this.return_dimensions = return_dimensions;
  22427. this.parameters_list = parameters_list;
  22428. this.function_comment = function_comment;
  22429. this.category = category;
  22430. };
  22431. var Comment = function Comment(comment_text) {
  22432. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Comment);
  22433. this.type = COMMAND_TYPES.comment;
  22434. this.comment_text = comment_text;
  22435. };
  22436. var Break = function Break() {
  22437. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Break);
  22438. this.type = COMMAND_TYPES["break"];
  22439. };
  22440. var Reader = function Reader() {
  22441. var variable_value_menu = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new VariableValueMenu();
  22442. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Reader);
  22443. this.type = COMMAND_TYPES.reader;
  22444. this.variable_value_menu = variable_value_menu;
  22445. };
  22446. var Writer = function Writer(content) {
  22447. var newline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  22448. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Writer);
  22449. this.type = COMMAND_TYPES.writer;
  22450. this.content = content;
  22451. this.newline = newline;
  22452. };
  22453. var Attribution = function Attribution(variable) {
  22454. var expression = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  22455. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Attribution);
  22456. this.type = COMMAND_TYPES.attribution;
  22457. this.variable = variable;
  22458. this.expression = expression;
  22459. };
  22460. var ExpressionOperator = function ExpressionOperator(type_op, item) {
  22461. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ExpressionOperator);
  22462. this.type_op = type_op; // Logic, Arithmetic OR Relational
  22463. this.item = item;
  22464. };
  22465. var ExpressionElement = function ExpressionElement(type_exp) {
  22466. var itens = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  22467. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ExpressionElement);
  22468. this.type_exp = type_exp;
  22469. this.itens = itens;
  22470. };
  22471. var ConditionalExpression = function ConditionalExpression(expression) {
  22472. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ConditionalExpression);
  22473. this.type = EXPRESSION_TYPES.exp_conditional;
  22474. this.expression = expression;
  22475. };
  22476. var LogicExpression = function LogicExpression(has_neg, first_operand, second_operand, operator) {
  22477. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, LogicExpression);
  22478. this.type = EXPRESSION_TYPES.exp_logic;
  22479. this.has_neg = has_neg;
  22480. this.first_operand = first_operand;
  22481. this.second_operand = second_operand;
  22482. this.operator = operator;
  22483. };
  22484. var ArithmeticExpression = function ArithmeticExpression(first_operand, second_operand, operator) {
  22485. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ArithmeticExpression);
  22486. this.type = EXPRESSION_TYPES.exp_arithmetic;
  22487. this.first_operand = first_operand;
  22488. this.second_operand = second_operand;
  22489. this.operator = operator;
  22490. };
  22491. var IfTrue = function IfTrue(expression, commands_block, commands_else) {
  22492. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, IfTrue);
  22493. this.type = COMMAND_TYPES.iftrue;
  22494. this.expression = expression;
  22495. this.commands_block = commands_block;
  22496. this.commands_else = commands_else;
  22497. };
  22498. var RepeatNTimes = function RepeatNTimes(var_attribution, var_incrementation, expression1, expression2, expression3, commands_block) {
  22499. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, RepeatNTimes);
  22500. this.type = COMMAND_TYPES.repeatNtimes;
  22501. this.var_attribution = var_attribution;
  22502. this.var_incrementation = var_incrementation;
  22503. this.expression1 = expression1;
  22504. this.expression2 = expression2;
  22505. this.expression3 = expression3;
  22506. this.commands_block = commands_block;
  22507. };
  22508. var WhileTrue = function WhileTrue(expression, commands_block) {
  22509. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, WhileTrue);
  22510. this.type = COMMAND_TYPES.whiletrue;
  22511. this.expression = expression;
  22512. this.commands_block = commands_block;
  22513. };
  22514. var DoWhileTrue = function DoWhileTrue(expression, commands_block) {
  22515. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, DoWhileTrue);
  22516. this.type = COMMAND_TYPES.dowhiletrue;
  22517. this.expression = expression;
  22518. this.commands_block = commands_block;
  22519. };
  22520. var Switch = function Switch(variable) {
  22521. var cases = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  22522. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Switch);
  22523. this.type = COMMAND_TYPES["switch"];
  22524. this.variable = variable;
  22525. this.cases = cases;
  22526. };
  22527. var Return = function Return(variable_value_menu) {
  22528. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Return);
  22529. this.type = COMMAND_TYPES["return"];
  22530. this.variable_value_menu = variable_value_menu;
  22531. };
  22532. var SwitchCase = function SwitchCase(variable_value_menu) {
  22533. var commands_block = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  22534. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, SwitchCase);
  22535. this.type = COMMAND_TYPES.switchcase;
  22536. this.variable_value_menu = variable_value_menu;
  22537. this.commands_block = commands_block;
  22538. };
  22539. var FunctionCall = function FunctionCall(function_called, parameters_list) {
  22540. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, FunctionCall);
  22541. this.type = COMMAND_TYPES.functioncall;
  22542. this.function_called = function_called;
  22543. this.parameters_list = parameters_list;
  22544. };
  22545. var VariableValueMenu = function VariableValueMenu() {
  22546. var variable_and_value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 7;
  22547. var content = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  22548. var row = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  22549. var column = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  22550. var include_constant = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
  22551. var dimensions = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  22552. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, VariableValueMenu);
  22553. this.type = "var_value";
  22554. this.variable_and_value = variable_and_value;
  22555. this.content = content;
  22556. this.row = row;
  22557. this.column = column;
  22558. this.include_constant = include_constant;
  22559. this.dimensions = dimensions;
  22560. };
  22561. var FunctionCallMenu = function FunctionCallMenu() {
  22562. var function_called = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  22563. var parameters_list = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  22564. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, FunctionCallMenu);
  22565. this.type = "function_call";
  22566. this.function_called = function_called;
  22567. this.parameters_list = parameters_list;
  22568. };
  22569. var Program = /*#__PURE__*/function () {
  22570. function Program() {
  22571. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Program);
  22572. this.functions = [];
  22573. this.globals = [];
  22574. }
  22575. _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0___default()(Program, [{
  22576. key: "addFunction",
  22577. value: function addFunction(function_to_add) {
  22578. melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default.a.watch(function_to_add.parameters_list, function () {
  22579. if (window.insertContext) {
  22580. setTimeout(function () {
  22581. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  22582. }, 300);
  22583. window.insertContext = false;
  22584. } else {
  22585. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  22586. }
  22587. }, 1);
  22588. melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default.a.watch(function_to_add.variables_list, function () {
  22589. if (window.insertContext) {
  22590. setTimeout(function () {
  22591. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  22592. }, 300);
  22593. window.insertContext = false;
  22594. } else {
  22595. _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
  22596. }
  22597. }, 1);
  22598. this.functions.push(function_to_add);
  22599. }
  22600. }, {
  22601. key: "addVariable",
  22602. value: function addVariable(function_to_receive, variable) {
  22603. if (this.functions[function_to_receive].variable === null) {
  22604. this.functions[function_to_receive].variables_list = [];
  22605. }
  22606. this.functions[function_to_receive].variables_list.push(variable);
  22607. }
  22608. }, {
  22609. key: "addGlobal",
  22610. value: function addGlobal(variable) {
  22611. this.globals.push(variable);
  22612. }
  22613. }]);
  22614. return Program;
  22615. }();
  22616. /***/ }),
  22617. /***/ "./js/visualUI/text_editor.js":
  22618. /*!************************************!*\
  22619. !*** ./js/visualUI/text_editor.js ***!
  22620. \************************************/
  22621. /*! exports provided: initTextEditor, disable, updateEditor, setCode, getCode */
  22622. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22623. "use strict";
  22624. __webpack_require__.r(__webpack_exports__);
  22625. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initTextEditor", function() { return initTextEditor; });
  22626. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disable", function() { return disable; });
  22627. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateEditor", function() { return updateEditor; });
  22628. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCode", function() { return setCode; });
  22629. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCode", function() { return getCode; });
  22630. /* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! codemirror */ "./node_modules/codemirror/lib/codemirror.js");
  22631. /* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(codemirror__WEBPACK_IMPORTED_MODULE_0__);
  22632. /* harmony import */ var codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! codemirror/addon/edit/closebrackets */ "./node_modules/codemirror/addon/edit/closebrackets.js");
  22633. /* harmony import */ var codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1__);
  22634. /* harmony import */ var codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! codemirror/addon/edit/matchbrackets */ "./node_modules/codemirror/addon/edit/matchbrackets.js");
  22635. /* harmony import */ var codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2__);
  22636. /* 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");
  22637. /* 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__);
  22638. /* harmony import */ var _util_editorMode2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../util/editorMode2 */ "./js/util/editorMode2.js");
  22639. // import "codemirror/addon/hint/show-hint";
  22640. // import "codemirror/addon/hint/anyword-hint";
  22641. Object(_util_editorMode2__WEBPACK_IMPORTED_MODULE_4__["CodeEditorMode"])(codemirror__WEBPACK_IMPORTED_MODULE_0__);
  22642. var codeEditor = null;
  22643. function initTextEditor(element) {
  22644. var id = element;
  22645. if (element[0] == '#') {
  22646. id = element.substring(1);
  22647. }
  22648. codeEditor = codemirror__WEBPACK_IMPORTED_MODULE_0__["fromTextArea"](document.getElementById(id), {
  22649. theme: "ttcn",
  22650. value: "",
  22651. mode: "text/x-ivprog",
  22652. indentUnit: 4,
  22653. lineNumbers: true,
  22654. matchBrackets: true,
  22655. autoCloseBrackets: true,
  22656. fixedGutter: true,
  22657. styleActiveLine: true,
  22658. readOnly: true
  22659. });
  22660. }
  22661. function disable(flag) {
  22662. codeEditor.setOption("readOnly", flag);
  22663. updateEditor();
  22664. }
  22665. function updateEditor() {
  22666. codeEditor.refresh();
  22667. }
  22668. function setCode(code) {
  22669. codeEditor.setValue(code);
  22670. }
  22671. function getCode() {
  22672. return codeEditor.getValue();
  22673. }
  22674. /***/ }),
  22675. /***/ "./js/visualUI/types.js":
  22676. /*!******************************!*\
  22677. !*** ./js/visualUI/types.js ***!
  22678. \******************************/
  22679. /*! exports provided: Types */
  22680. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22681. "use strict";
  22682. __webpack_require__.r(__webpack_exports__);
  22683. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Types", function() { return Types; });
  22684. var Types = Object.freeze({
  22685. INTEGER: "integer",
  22686. REAL: "real",
  22687. TEXT: "text",
  22688. CHAR: 'char',
  22689. BOOLEAN: "boolean",
  22690. VOID: "void"
  22691. });
  22692. /***/ }),
  22693. /***/ "./js/visualUI/utils.js":
  22694. /*!******************************!*\
  22695. !*** ./js/visualUI/utils.js ***!
  22696. \******************************/
  22697. /*! exports provided: renderErrorMessage */
  22698. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22699. "use strict";
  22700. __webpack_require__.r(__webpack_exports__);
  22701. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderErrorMessage", function() { return renderErrorMessage; });
  22702. function renderErrorMessage(dom_obj_target, message_text) {
  22703. dom_obj_target.popup({
  22704. html: '<i class="ui icon inverted exclamation triangle yellow"></i>' + message_text,
  22705. transition: "fade up",
  22706. on: 'click',
  22707. closable: true,
  22708. movePopup: true,
  22709. boundary: window,
  22710. preserve: false,
  22711. target: false,
  22712. className: {
  22713. popup: 'ui popup invalid-identifier'
  22714. },
  22715. onHidden: function onHidden($module) {
  22716. dom_obj_target.popup('destroy');
  22717. }
  22718. }).popup('toggle');
  22719. }
  22720. /***/ }),
  22721. /***/ "./js/visualUI/variables.js":
  22722. /*!**********************************!*\
  22723. !*** ./js/visualUI/variables.js ***!
  22724. \**********************************/
  22725. /*! exports provided: addVariable, renderVariable */
  22726. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22727. "use strict";
  22728. __webpack_require__.r(__webpack_exports__);
  22729. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addVariable", function() { return addVariable; });
  22730. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderVariable", function() { return renderVariable; });
  22731. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  22732. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  22733. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  22734. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  22735. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  22736. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  22737. var counter_new_variables = 0;
  22738. function addVariable(function_obj, function_container) {
  22739. var is_in_click = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  22740. 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);
  22741. if (function_obj.variables_list == null) {
  22742. function_obj.variables_list = [];
  22743. }
  22744. function_obj.variables_list.push(new_var);
  22745. counter_new_variables++;
  22746. 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);
  22747. var newe = renderVariable(function_container, new_var, function_obj);
  22748. if (is_in_click) {
  22749. newe.css('display', 'none');
  22750. newe.fadeIn();
  22751. }
  22752. }
  22753. function updateName(variable_obj, new_name, variable_obj_dom, function_obj) {
  22754. if (variable_obj.name == new_name) {
  22755. return;
  22756. }
  22757. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_5__["isValidIdentifier"])(new_name)) {
  22758. if (variableNameAlreadyExists(new_name, function_obj)) {
  22759. _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]));
  22760. } else {
  22761. 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);
  22762. variable_obj.name = new_name;
  22763. }
  22764. } else {
  22765. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](variable_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  22766. }
  22767. }
  22768. function variableNameAlreadyExists(name_var, function_obj) {
  22769. if (function_obj.parameters_list) {
  22770. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  22771. if (function_obj.parameters_list[i].name == name_var) {
  22772. return true;
  22773. }
  22774. }
  22775. }
  22776. if (function_obj.variables_list) {
  22777. for (var i = 0; i < function_obj.variables_list.length; i++) {
  22778. if (function_obj.variables_list[i].name == name_var) {
  22779. return true;
  22780. }
  22781. }
  22782. }
  22783. return false;
  22784. }
  22785. function removeVariable(variable_obj, variable_container, function_name) {
  22786. var function_associated = variable_container.data('associatedFunction');
  22787. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].REMOVE_FUNCTION_VAR, variable_obj.name);
  22788. var index = function_associated.variables_list.indexOf(variable_obj);
  22789. if (index > -1) {
  22790. window.insertContext = true;
  22791. delete function_associated.variables_list[index];
  22792. function_associated.variables_list.splice(index, 1);
  22793. }
  22794. variable_container.children().off();
  22795. variable_container.off();
  22796. variable_container.fadeOut();
  22797. }
  22798. function updateType(variable_obj, new_type, function_name) {
  22799. var new_dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  22800. variable_obj.type = new_type;
  22801. variable_obj.dimensions = new_dimensions;
  22802. if (new_dimensions > 0) {
  22803. variable_obj.rows = new_dimensions;
  22804. variable_obj.columns = 2;
  22805. }
  22806. 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);
  22807. updateInitialValues(variable_obj, function_name);
  22808. }
  22809. function addHandlers(variable_obj, variable_container, function_obj) {
  22810. // Manage variable name:
  22811. variable_container.find(".editing_name_var").on('click', function (e) {
  22812. 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);
  22813. enableNameUpdate(variable_obj, variable_container, function_obj);
  22814. }); // Menu to change type:
  22815. variable_container.find('.ui.dropdown.variable_type').dropdown({
  22816. onChange: function onChange(_, __, $selectedItem) {
  22817. if ($selectedItem.data('dimensions')) {
  22818. updateType(variable_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name, $selectedItem.data('dimensions'));
  22819. } else {
  22820. updateType(variable_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name);
  22821. }
  22822. renderValues(variable_obj, variable_container, function_obj.name);
  22823. },
  22824. selectOnKeydown: false
  22825. }); // Remove variable:
  22826. variable_container.find(".remove_variable").on('click', function (e) {
  22827. removeVariable(variable_obj, variable_container, function_obj.name);
  22828. });
  22829. }
  22830. function renderVariable(function_container, new_var, function_obj) {
  22831. var element = '<div class="ui label variable_container pink"><i class="ui icon ellipsis vertical inverted"></i>';
  22832. element += '<div class="ui dropdown variable_type">';
  22833. if (new_var.dimensions == 1) {
  22834. 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()));
  22835. element += ' [ ] </div>';
  22836. } else if (new_var.dimensions == 2) {
  22837. 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()));
  22838. element += ' [ ] [ ] </div>';
  22839. } else {
  22840. element += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(new_var.type.toLowerCase())) + '</div>';
  22841. }
  22842. element += '<div class="menu">';
  22843. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22844. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22845. continue;
  22846. }
  22847. 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>';
  22848. }
  22849. 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">';
  22850. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22851. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22852. continue;
  22853. }
  22854. 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>';
  22855. }
  22856. element += '</div></div>';
  22857. 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">';
  22858. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  22859. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  22860. continue;
  22861. }
  22862. 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>';
  22863. }
  22864. element += '</div></div>';
  22865. element += '</div></div> ';
  22866. element += '<div class="editing_name_var"><span class="span_name_variable enable_edit_name_variable">' + new_var.name + '</span> </div>';
  22867. element += ' <span class="character_equals"> <&#8212; </span> <div class="ui div_valor_var">' + new_var.value + '</div>';
  22868. element += ' <i class="yellow inverted icon times remove_variable"></i></div>';
  22869. element = $(element);
  22870. element.data('associatedFunction', function_obj);
  22871. function_container.find('.variables_list_div').append(element);
  22872. addHandlers(new_var, element, function_obj);
  22873. renderValues(new_var, element, function_obj.name);
  22874. return element;
  22875. }
  22876. function updateColumnsAndRowsText(variable_container, variable_var) {
  22877. var prev = variable_container.find('.text').text().split('[');
  22878. if (prev.length == 2) {
  22879. var ff = prev[0] + '[ ' + variable_var.columns + ' ] ';
  22880. variable_container.find('.text').empty();
  22881. variable_container.find('.text').text(ff);
  22882. }
  22883. if (prev.length == 3) {
  22884. var ff = prev[0] + '[ ' + variable_var.columns + ' ] [ ' + variable_var.rows + ' ] ';
  22885. variable_container.find('.text').empty();
  22886. variable_container.find('.text').text(ff);
  22887. }
  22888. }
  22889. function renderValues(new_var, variable_container, function_name) {
  22890. var ret = "";
  22891. var j = 0;
  22892. if (new_var.dimensions == 0) {
  22893. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22894. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + new_var.value.toFixed(1) + '</span> </div> ';
  22895. } else {
  22896. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22897. 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> ';
  22898. } else {
  22899. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + new_var.value + '</span> </div> ';
  22900. }
  22901. }
  22902. } else {
  22903. ret += '<table class="tabela_var">';
  22904. if (new_var.dimensions == 1) {
  22905. ret += '<tr>';
  22906. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22907. for (var k = 0; k < new_var.columns; k++) {
  22908. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + new_var.value[k].toFixed(1) + '</span></td>';
  22909. }
  22910. } else {
  22911. for (var k = 0; k < new_var.columns; k++) {
  22912. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22913. 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>';
  22914. } else {
  22915. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + new_var.value[k] + '</span>' + '</td>';
  22916. }
  22917. }
  22918. }
  22919. ret += '</tr>';
  22920. ret += '</table>';
  22921. 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>';
  22922. }
  22923. if (new_var.dimensions == 2) {
  22924. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  22925. for (var l = 0; l < new_var.rows; l++) {
  22926. ret += '<tr>';
  22927. for (var k = 0; k < new_var.columns; k++) {
  22928. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + new_var.value[l][k].toFixed(1) + '</span>' + '</td>';
  22929. }
  22930. ret += '</tr>';
  22931. }
  22932. } else {
  22933. for (var l = 0; l < new_var.rows; l++) {
  22934. ret += '<tr>';
  22935. for (var k = 0; k < new_var.columns; k++) {
  22936. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  22937. 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>';
  22938. } else {
  22939. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + new_var.value[l][k] + '</span></td>';
  22940. }
  22941. }
  22942. ret += '</tr>';
  22943. }
  22944. }
  22945. if (new_var.rows == 0) {
  22946. ret += '<tr><td></td></tr>';
  22947. }
  22948. 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>';
  22949. ret += '</table>';
  22950. 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>';
  22951. }
  22952. }
  22953. $(variable_container).find(".div_valor_var").html('');
  22954. ret = $(ret);
  22955. $(ret).find('.span_value_variable').data('associatedOject', new_var);
  22956. $(ret).find(".boolean_simple_type").on('click', function (e) {
  22957. 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);
  22958. alternateBooleanValue(new_var, this.parentNode);
  22959. });
  22960. $(ret).find(".simple_var").on('click', function (e) {
  22961. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_VAR_VALUE, new_var.name);
  22962. enableValueUpdate(new_var, this.parentNode, function_name);
  22963. });
  22964. $(ret).find(".boolean_vector_var").on('click', function (e) {
  22965. alternateBooleanVectorValue(new_var, $(this).data('index'), this.parentNode);
  22966. 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);
  22967. });
  22968. $(ret).find(".vector_var").on('click', function (e) {
  22969. enableVectorValueUpdate(new_var, $(this).data('index'), this.parentNode, function_name);
  22970. });
  22971. $(ret).find(".remove_global_vector_column").on('click', function (e) {
  22972. removeColumnVector(new_var);
  22973. 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);
  22974. 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);
  22975. $(variable_container).find(".div_valor_var").html('');
  22976. renderValues(new_var, variable_container, function_name);
  22977. });
  22978. $(ret).find(".add_global_vector_column").on('click', function (e) {
  22979. addColumnVector(new_var);
  22980. 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);
  22981. 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);
  22982. $(variable_container).find(".div_valor_var").html('');
  22983. renderValues(new_var, variable_container, function_name);
  22984. });
  22985. $(ret).find(".remove_global_matrix_column").on('click', function (e) {
  22986. removeColumnMatrix(new_var);
  22987. 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);
  22988. 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);
  22989. $(variable_container).find(".div_valor_var").html('');
  22990. renderValues(new_var, variable_container, function_name);
  22991. });
  22992. $(ret).find(".add_global_matrix_column").on('click', function (e) {
  22993. addColumnMatrix(new_var);
  22994. 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);
  22995. 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);
  22996. $(variable_container).find(".div_valor_var").html('');
  22997. renderValues(new_var, variable_container, function_name);
  22998. });
  22999. $(ret).find(".remove_global_matrix_line").on('click', function (e) {
  23000. removeLineMatrix(new_var);
  23001. 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);
  23002. 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);
  23003. $(variable_container).find(".div_valor_var").html('');
  23004. renderValues(new_var, variable_container, function_name);
  23005. });
  23006. $(ret).find(".add_global_matrix_line").on('click', function (e) {
  23007. addLineMatrix(new_var);
  23008. 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);
  23009. 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);
  23010. $(variable_container).find(".div_valor_var").html('');
  23011. renderValues(new_var, variable_container, function_name);
  23012. });
  23013. $(ret).find(".boolean_matrix_var").on('click', function (e) {
  23014. alternateBooleanMatrixValue(new_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  23015. 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);
  23016. });
  23017. $(ret).find(".matrix_var").on('click', function (e) {
  23018. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_VAR_VALUE, new_var.name);
  23019. enableMatrixValueUpdate(new_var, $(this).data('row'), $(this).data('index'), this.parentNode, function_name);
  23020. });
  23021. $(variable_container).find(".div_valor_var").append(ret);
  23022. updateColumnsAndRowsText(variable_container, new_var);
  23023. }
  23024. function alternateBooleanMatrixValue(var_obj, row, index, value_container) {
  23025. var_obj.value[row][index] = !var_obj.value[row][index];
  23026. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value[row][index])));
  23027. }
  23028. function addLineMatrix(var_obj) {
  23029. var_obj.rows++;
  23030. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23031. var n_l = [];
  23032. for (var i = 0; i < var_obj.columns; i++) {
  23033. n_l.push(0);
  23034. }
  23035. var_obj.value.push(n_l);
  23036. }
  23037. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23038. var n_l = [];
  23039. for (i = 0; i < var_obj.columns; i++) {
  23040. n_l.push(0.0);
  23041. }
  23042. var_obj.value.push(n_l);
  23043. }
  23044. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23045. var n_l = [];
  23046. for (i = 0; i < var_obj.columns; i++) {
  23047. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  23048. }
  23049. var_obj.value.push(n_l);
  23050. }
  23051. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  23052. var n_l = [];
  23053. for (i = 0; i < var_obj.columns; i++) {
  23054. n_l.push(true);
  23055. }
  23056. var_obj.value.push(n_l);
  23057. }
  23058. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  23059. var n_l = [];
  23060. for (i = 0; i < var_obj.columns; i++) {
  23061. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  23062. }
  23063. var_obj.value.push(n_l);
  23064. }
  23065. }
  23066. function removeLineMatrix(var_obj) {
  23067. if (var_obj.rows == 0) {
  23068. return;
  23069. }
  23070. var_obj.rows--;
  23071. var_obj.value.splice(var_obj.value.length - 1, 1);
  23072. }
  23073. function addColumnMatrix(var_obj) {
  23074. var_obj.columns++;
  23075. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23076. for (var i = 0; i < var_obj.rows; i++) {
  23077. var_obj.value[i].push(0);
  23078. }
  23079. }
  23080. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23081. for (var i = 0; i < var_obj.rows; i++) {
  23082. var_obj.value[i].push(0.0);
  23083. }
  23084. }
  23085. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23086. for (var i = 0; i < var_obj.rows; i++) {
  23087. var_obj.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  23088. }
  23089. }
  23090. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  23091. for (var i = 0; i < var_obj.rows; i++) {
  23092. var_obj.value[i].push(true);
  23093. }
  23094. }
  23095. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  23096. for (var i = 0; i < var_obj.rows; i++) {
  23097. var_obj.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  23098. }
  23099. }
  23100. }
  23101. function removeColumnMatrix(var_obj) {
  23102. if (var_obj.columns == 0) {
  23103. return;
  23104. }
  23105. var_obj.columns--;
  23106. for (var i = 0; i < var_obj.rows; i++) {
  23107. var_obj.value[i].splice(var_obj.value[i].length - 1, 1);
  23108. }
  23109. }
  23110. function addColumnVector(var_obj) {
  23111. var_obj.columns++;
  23112. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23113. var_obj.value.push(0);
  23114. }
  23115. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23116. var_obj.value.push(0.0);
  23117. }
  23118. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23119. var_obj.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  23120. }
  23121. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  23122. var_obj.value.push(true);
  23123. }
  23124. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  23125. var_obj.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
  23126. }
  23127. }
  23128. function removeColumnVector(var_obj) {
  23129. if (var_obj.columns == 0) {
  23130. return;
  23131. }
  23132. var_obj.columns--;
  23133. var_obj.value.splice(var_obj.value.length - 1, 1);
  23134. }
  23135. function alternateBooleanValue(var_obj, value_container) {
  23136. var_obj.value = !var_obj.value;
  23137. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value)));
  23138. }
  23139. function alternateBooleanVectorValue(var_obj, index, value_container) {
  23140. var_obj.value[index] = !var_obj.value[index];
  23141. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value[index])));
  23142. }
  23143. function updateInitialValues(variable_obj, function_name) {
  23144. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23145. if (variable_obj.dimensions == 0) {
  23146. variable_obj.value = 0;
  23147. }
  23148. if (variable_obj.dimensions == 1) {
  23149. variable_obj.value = [0, 0];
  23150. }
  23151. if (variable_obj.dimensions == 2) {
  23152. variable_obj.value = [[0, 0], [0, 0]];
  23153. }
  23154. }
  23155. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23156. if (variable_obj.dimensions == 0) {
  23157. variable_obj.value = 0.0;
  23158. }
  23159. if (variable_obj.dimensions == 1) {
  23160. variable_obj.value = [0.0, 0.0];
  23161. }
  23162. if (variable_obj.dimensions == 2) {
  23163. variable_obj.value = [[0.0, 0.0], [0.0, 0.0]];
  23164. }
  23165. }
  23166. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23167. if (variable_obj.dimensions == 0) {
  23168. variable_obj.value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value');
  23169. }
  23170. if (variable_obj.dimensions == 1) {
  23171. 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')];
  23172. }
  23173. if (variable_obj.dimensions == 2) {
  23174. 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')]];
  23175. }
  23176. }
  23177. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  23178. if (variable_obj.dimensions == 0) {
  23179. variable_obj.value = true;
  23180. }
  23181. if (variable_obj.dimensions == 1) {
  23182. variable_obj.value = [true, true];
  23183. }
  23184. if (variable_obj.dimensions == 2) {
  23185. variable_obj.value = [[true, true], [true, true]];
  23186. }
  23187. }
  23188. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  23189. if (variable_obj.dimensions == 0) {
  23190. variable_obj.value = 'A';
  23191. }
  23192. if (variable_obj.dimensions == 1) {
  23193. variable_obj.value = ['A', 'A'];
  23194. }
  23195. if (variable_obj.dimensions == 2) {
  23196. variable_obj.value = [['A', 'A'], ['A', 'A']];
  23197. }
  23198. }
  23199. 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);
  23200. }
  23201. var opened_name_value_vector_global_ = false;
  23202. var opened_input_value_vector_global_ = null;
  23203. function enableVectorValueUpdate(var_obj, index, parent_node, function_name) {
  23204. if (opened_name_value_vector_global_) {
  23205. opened_input_value_vector_global_.focus();
  23206. return;
  23207. }
  23208. parent_node = $(parent_node);
  23209. opened_name_value_vector_global_ = true;
  23210. parent_node.find('.span_value_variable').text('');
  23211. var input_field;
  23212. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23213. 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) + "' />");
  23214. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23215. } else {
  23216. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + var_obj.value[index] + "' />");
  23217. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23218. }
  23219. input_field.on('input', function () {
  23220. var inputWidth = input_field.textWidth() + 10;
  23221. opened_input_value_vector_global_ = input_field;
  23222. input_field.focus();
  23223. var tmpStr = input_field.val();
  23224. input_field.val('');
  23225. input_field.val(tmpStr);
  23226. input_field.css({
  23227. width: inputWidth
  23228. });
  23229. }).trigger('input');
  23230. input_field.focusout(function () {
  23231. var changed = false; /// update array:
  23232. if (input_field.val().trim()) {
  23233. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23234. var_obj.value[index] = parseFloat(input_field.val().trim());
  23235. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  23236. } else {
  23237. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23238. var_obj.value[index] = parseInt(input_field.val().trim());
  23239. } else {
  23240. var_obj.value[index] = input_field.val().trim();
  23241. }
  23242. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  23243. }
  23244. changed = true;
  23245. } else {
  23246. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23247. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  23248. } else {
  23249. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  23250. }
  23251. }
  23252. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23253. var_obj.value[index] = input_field.val();
  23254. changed = true;
  23255. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  23256. }
  23257. if (changed) {
  23258. 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);
  23259. }
  23260. input_field.off();
  23261. input_field.remove(); /// update elements:
  23262. opened_name_value_vector_global_ = false;
  23263. opened_input_value_vector_global_ = false;
  23264. });
  23265. input_field.on('keydown', function (e) {
  23266. var code = e.keyCode || e.which;
  23267. var changed = false;
  23268. if (code == 13) {
  23269. if (input_field.val().trim()) {
  23270. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23271. var_obj.value[index] = parseFloat(input_field.val().trim());
  23272. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  23273. } else {
  23274. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23275. var_obj.value[index] = parseInt(input_field.val().trim());
  23276. } else {
  23277. var_obj.value[index] = input_field.val().trim();
  23278. }
  23279. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  23280. }
  23281. changed = true;
  23282. } else {
  23283. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23284. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  23285. } else {
  23286. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  23287. }
  23288. }
  23289. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23290. var_obj.value[index] = input_field.val();
  23291. changed = true;
  23292. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  23293. }
  23294. if (changed) {
  23295. 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);
  23296. }
  23297. input_field.off();
  23298. input_field.remove(); /// update elements:
  23299. opened_name_value_vector_global_ = false;
  23300. opened_input_value_vector_global_ = false;
  23301. }
  23302. if (code == 27) {
  23303. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23304. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  23305. } else {
  23306. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  23307. }
  23308. input_field.off();
  23309. input_field.remove(); /// update elements:
  23310. opened_name_value_vector_global_ = false;
  23311. opened_input_value_vector_global_ = false;
  23312. }
  23313. });
  23314. input_field.select();
  23315. }
  23316. var opened_name_value_global_var = false;
  23317. var opened_input_value_global_ar = null;
  23318. function enableValueUpdate(var_obj, parent_node, function_name) {
  23319. if (opened_name_value_global_var) {
  23320. opened_input_value_global_ar.focus();
  23321. return;
  23322. }
  23323. parent_node = $(parent_node);
  23324. opened_name_value_global_var = true;
  23325. var input_field;
  23326. parent_node.find('.span_value_variable').text('');
  23327. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23328. 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) + "' />");
  23329. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23330. } else {
  23331. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + var_obj.value + "' />");
  23332. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23333. }
  23334. input_field.on('input', function () {
  23335. var inputWidth = input_field.textWidth() + 10;
  23336. opened_input_value_global_ar = input_field;
  23337. input_field.focus();
  23338. var tmpStr = input_field.val();
  23339. input_field.val('');
  23340. input_field.val(tmpStr);
  23341. input_field.css({
  23342. width: inputWidth
  23343. });
  23344. }).trigger('input');
  23345. input_field.focusout(function () {
  23346. /// update array:
  23347. var changed = false;
  23348. if (input_field.val().trim()) {
  23349. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23350. var_obj.value = parseFloat(input_field.val().trim());
  23351. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  23352. } else {
  23353. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23354. var_obj.value = parseInt(input_field.val().trim());
  23355. } else if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  23356. var_obj.value = input_field.val().charAt(0);
  23357. } else {
  23358. var_obj.value = input_field.val().trim();
  23359. }
  23360. parent_node.find('.span_value_variable').text(var_obj.value);
  23361. }
  23362. changed = true;
  23363. } else {
  23364. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23365. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  23366. } else {
  23367. parent_node.find('.span_value_variable').text(var_obj.value);
  23368. }
  23369. }
  23370. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23371. var_obj.value = input_field.val();
  23372. changed = true;
  23373. parent_node.find('.span_value_variable').text(var_obj.value);
  23374. }
  23375. if (changed) {
  23376. 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);
  23377. }
  23378. input_field.off();
  23379. input_field.remove(); /// update elements:
  23380. opened_name_value_global_var = false;
  23381. opened_input_value_global_ar = false;
  23382. });
  23383. input_field.on('keydown', function (e) {
  23384. var code = e.keyCode || e.which;
  23385. var changed = false;
  23386. if (code == 13) {
  23387. if (input_field.val().trim()) {
  23388. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23389. var_obj.value = parseFloat(input_field.val().trim());
  23390. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  23391. } else {
  23392. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23393. var_obj.value = parseInt(input_field.val().trim());
  23394. } else if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
  23395. var_obj.value = input_field.val().charAt(0);
  23396. } else {
  23397. var_obj.value = input_field.val().trim();
  23398. }
  23399. parent_node.find('.span_value_variable').text(var_obj.value);
  23400. }
  23401. changed = true;
  23402. } else {
  23403. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23404. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  23405. } else {
  23406. parent_node.find('.span_value_variable').text(var_obj.value);
  23407. }
  23408. }
  23409. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23410. var_obj.value = input_field.val();
  23411. changed = true;
  23412. parent_node.find('.span_value_variable').text(var_obj.value);
  23413. }
  23414. if (changed) {
  23415. 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);
  23416. }
  23417. input_field.off();
  23418. input_field.remove(); /// update elements:
  23419. opened_name_value_global_var = false;
  23420. opened_input_value_global_ar = false;
  23421. }
  23422. if (code == 27) {
  23423. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23424. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  23425. } else {
  23426. parent_node.find('.span_value_variable').text(var_obj.value);
  23427. }
  23428. input_field.off();
  23429. input_field.remove(); /// update elements:
  23430. opened_name_value_global_var = false;
  23431. opened_input_value_global_ar = false;
  23432. }
  23433. });
  23434. input_field.select();
  23435. }
  23436. var opened_name_global = false;
  23437. var opened_input_global = null;
  23438. function enableNameUpdate(variable_obj, variable_container, function_obj) {
  23439. if (opened_name_global) {
  23440. opened_input_global.focus();
  23441. return;
  23442. }
  23443. opened_name_global = true;
  23444. variable_container.find('.span_name_variable').text('');
  23445. var input_name;
  23446. input_name = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + variable_obj.name + "' />");
  23447. input_name.insertBefore(variable_container.find('.span_name_variable'));
  23448. input_name.on('input', function () {
  23449. var inputWidth = input_name.textWidth() + 10;
  23450. opened_input_global = input_name;
  23451. input_name.focus();
  23452. var tmpStr = input_name.val();
  23453. input_name.val('');
  23454. input_name.val(tmpStr);
  23455. input_name.css({
  23456. width: inputWidth
  23457. });
  23458. }).trigger('input');
  23459. input_name.focusout(function () {
  23460. /// update array:
  23461. if (input_name.val().trim().length > 0) {
  23462. updateName(variable_obj, input_name.val().trim(), variable_container, function_obj);
  23463. variable_container.find('.span_name_variable').text(variable_obj.name);
  23464. } else {
  23465. variable_container.find('.span_name_variable').text(variable_obj.name);
  23466. }
  23467. input_name.off();
  23468. input_name.remove(); /// update elements:
  23469. opened_name_global = false;
  23470. opened_input_global = false;
  23471. });
  23472. input_name.on('keydown', function (e) {
  23473. var code = e.keyCode || e.which;
  23474. if (code == 13) {
  23475. if (input_name.val().trim().length > 0) {
  23476. updateName(variable_obj, input_name.val().trim(), variable_container, function_obj);
  23477. variable_container.find('.span_name_variable').text(variable_obj.name);
  23478. } else {
  23479. variable_container.find('.span_name_variable').text(variable_obj.name);
  23480. }
  23481. input_name.off();
  23482. input_name.remove(); /// update elements:
  23483. opened_name_global = false;
  23484. opened_input_global = false;
  23485. }
  23486. if (code == 27) {
  23487. variable_container.find('.span_name_variable').text(variable_obj.name);
  23488. input_name.off();
  23489. input_name.remove(); /// update elements:
  23490. opened_name_global = false;
  23491. opened_input_global = false;
  23492. }
  23493. });
  23494. input_name.select();
  23495. }
  23496. var opened_name_value_matrix_global_v = false;
  23497. var opened_input_value_matrix_global_v = null;
  23498. function enableMatrixValueUpdate(var_obj, row, index, parent_node, function_name) {
  23499. if (opened_name_value_matrix_global_v) {
  23500. opened_input_value_matrix_global_v.focus();
  23501. return;
  23502. }
  23503. parent_node = $(parent_node);
  23504. opened_name_value_matrix_global_v = true;
  23505. parent_node.find('.span_value_variable').text('');
  23506. var input_field;
  23507. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23508. 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) + "' />");
  23509. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23510. } else {
  23511. 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] + "' />");
  23512. input_field.insertBefore(parent_node.find('.span_value_variable'));
  23513. }
  23514. input_field.on('input', function () {
  23515. var inputWidth = input_field.textWidth() + 10;
  23516. opened_input_value_matrix_global_v = input_field;
  23517. input_field.focus();
  23518. var tmpStr = input_field.val();
  23519. input_field.val('');
  23520. input_field.val(tmpStr);
  23521. input_field.css({
  23522. width: inputWidth
  23523. });
  23524. }).trigger('input');
  23525. input_field.focusout(function () {
  23526. var changed = false; /// update array:
  23527. if (input_field.val().trim()) {
  23528. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23529. var_obj.value[row][index] = parseFloat(input_field.val().trim());
  23530. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  23531. } else {
  23532. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23533. var_obj.value[row][index] = parseInt(input_field.val().trim());
  23534. } else {
  23535. var_obj.value[row][index] = input_field.val().trim();
  23536. }
  23537. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23538. }
  23539. changed = true;
  23540. } else {
  23541. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23542. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  23543. } else {
  23544. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23545. }
  23546. }
  23547. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23548. var_obj.value[row][index] = input_field.val();
  23549. changed = true;
  23550. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23551. }
  23552. if (changed) {
  23553. 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);
  23554. }
  23555. input_field.off();
  23556. input_field.remove(); /// update elements:
  23557. opened_name_value_matrix_global_v = false;
  23558. opened_input_value_matrix_global_v = false;
  23559. });
  23560. input_field.on('keydown', function (e) {
  23561. var code = e.keyCode || e.which;
  23562. var changed = false;
  23563. if (code == 13) {
  23564. if (input_field.val().trim()) {
  23565. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23566. var_obj.value[row][index] = parseFloat(input_field.val().trim());
  23567. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  23568. } else {
  23569. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  23570. var_obj.value[row][index] = parseInt(input_field.val().trim());
  23571. } else {
  23572. var_obj.value[row][index] = input_field.val().trim();
  23573. }
  23574. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23575. }
  23576. changed = true;
  23577. } else {
  23578. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23579. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  23580. } else {
  23581. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23582. }
  23583. }
  23584. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  23585. var_obj.value[row][index] = input_field.val();
  23586. changed = true;
  23587. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23588. }
  23589. if (changed) {
  23590. 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);
  23591. }
  23592. input_field.off();
  23593. input_field.remove(); /// update elements:
  23594. opened_name_value_matrix_global_v = false;
  23595. opened_input_value_matrix_global_v = false;
  23596. }
  23597. if (code == 27) {
  23598. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  23599. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  23600. } else {
  23601. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  23602. }
  23603. input_field.off();
  23604. input_field.remove(); /// update elements:
  23605. opened_name_value_matrix_global_v = false;
  23606. opened_input_value_matrix_global_v = false;
  23607. }
  23608. });
  23609. input_field.select();
  23610. }
  23611. /***/ })
  23612. /******/ });
  23613. });
  23614. //# sourceMappingURL=main.f255f7efef480c0fecaf.js.map