main.953c46193185032c68f7.js 1.2 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343
  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\":\"2019_10_11 16_06\"}");
  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-405w9ojosQJhPnz/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-405uNNdAGGYDPmN/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-405N2hWcSyOQaIL/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: "texto_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. $sin: "seno",
  1954. $cos: "cosseno",
  1955. $tan: "tangente",
  1956. $sqrt: "raiz_quadrada",
  1957. $pow: "potencia",
  1958. $log: "logaritmo",
  1959. $abs: "modulo",
  1960. $negate: "trocar_sinal",
  1961. $invert: "inverter_valor",
  1962. $max: "maximo",
  1963. $min: "minimo",
  1964. $rand: "numero_aleatorio"
  1965. });
  1966. /***/ }),
  1967. /***/ "./grammar/pt/langLibs.js":
  1968. /*!********************************!*\
  1969. !*** ./grammar/pt/langLibs.js ***!
  1970. \********************************/
  1971. /*! exports provided: default */
  1972. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1973. "use strict";
  1974. __webpack_require__.r(__webpack_exports__);
  1975. /**
  1976. * This is the dictionary of the language defined libraries
  1977. */
  1978. /* harmony default export */ __webpack_exports__["default"] = ({
  1979. $mathLib: "Matematica",
  1980. $ioLib: "ES",
  1981. $strLib: "Texto",
  1982. $arrayLib: "Arranjo",
  1983. $langLib: "Conversao"
  1984. });
  1985. /***/ }),
  1986. /***/ "./i18n/error.csv":
  1987. /*!************************!*\
  1988. !*** ./i18n/error.csv ***!
  1989. \************************/
  1990. /*! no static exports found */
  1991. /***/ (function(module, exports) {
  1992. 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":""}}
  1993. /***/ }),
  1994. /***/ "./i18n/index.ts":
  1995. /*!***********************!*\
  1996. !*** ./i18n/index.ts ***!
  1997. \***********************/
  1998. /*! no static exports found */
  1999. /***/ (function(module, exports, __webpack_require__) {
  2000. "use strict";
  2001. Object.defineProperty(exports, "__esModule", { value: true });
  2002. /// <reference path="csv.d.ts" />
  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":"Programa executado com sucesso!","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 generated 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 executed successfully!","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","initial_program_code":"programa {\\n\\n\\t\\tfuncao vazio inicio () {\\n\\t\\t\\t// Inicie seu codigo aqui!\\n\\t\\t}\\n}"},"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","initial_program_code":"program {\\n\\n\\t\\tfunction void main () {\\n\\t\\t\\t// Start your code here!\\n\\t\\t}\\n}"},"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":"","initial_program_code":""}}
  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 line_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  2045. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  2046. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../io/domConsole */ "./js/io/domConsole.js");
  2047. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  2048. /* harmony import */ var _output_matching_output_matching__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./output_matching/output_matching */ "./js/assessment/output_matching/output_matching.js");
  2049. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/config */ "./js/util/config.js");
  2050. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2051. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  2052. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  2053. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["getInstance"]();
  2054. var StringTypes = line_i18n__WEBPACK_IMPORTED_MODULE_0__["default"].StringTypes;
  2055. var AssessmentConfig = {
  2056. max_instruction_count: 350250,
  2057. suspend_threshold: 200
  2058. };
  2059. var IVProgAssessment =
  2060. /*#__PURE__*/
  2061. function () {
  2062. function IVProgAssessment(ast_code, testCases, domConsole) {
  2063. _classCallCheck(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_5__["Config"]));
  2068. _util_config__WEBPACK_IMPORTED_MODULE_5__["Config"].setConfig(AssessmentConfig);
  2069. }
  2070. _createClass(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_4__["OutputMatching"](new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__["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_2__["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_2__["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_2__["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_2__["DOMConsole"].INFO : _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["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_2__["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_5__["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_2__["DOMConsole"].ERR:
  2143. {
  2144. this.domConsole.err(msg);
  2145. break;
  2146. }
  2147. case _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].INFO:
  2148. {
  2149. this.domConsole.info(msg);
  2150. break;
  2151. }
  2152. case _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["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 _util_string_diff__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../util/string_diff */ "./js/util/string_diff.js");
  2173. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  2174. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2175. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  2176. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  2177. var OutputAssessmentResult =
  2178. /*#__PURE__*/
  2179. function () {
  2180. _createClass(OutputAssessmentResult, null, [{
  2181. key: "PAGE_TEMPLATE",
  2182. get: function get() {
  2183. 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>";
  2184. }
  2185. }, {
  2186. key: "DETAIL_TEMPLATE",
  2187. get: function get() {
  2188. 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>";
  2189. }
  2190. }, {
  2191. key: "OUPUT_TABLE_TEMPLATE",
  2192. get: function get() {
  2193. 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>";
  2194. }
  2195. }, {
  2196. key: "OUTPUT_TEMPLATE",
  2197. get: function get() {
  2198. return "<tr><td class=':class-expected:'>$0</td>\n <td class=':class-generated:'>$1</td>\n <td class=':class-result:'>$2</td></tr>";
  2199. }
  2200. }, {
  2201. key: "EMPTY_OUTPUT_TEMPLATE",
  2202. get: function get() {
  2203. return "<div class='assessment-popup'><img class='assessment-empty-output' src='img/empty.svg'>\n <span class='assessment-popuptext'>$0</span></div>";
  2204. }
  2205. }, {
  2206. key: "FAILED_TEMPLATE",
  2207. get: function get() {
  2208. return "<p class='assessment-failed-execution'><span class='assessment-failed-case'>\u2717</span>$0</p>";
  2209. }
  2210. }, {
  2211. key: "INPUT_INFO_TEMPLATE",
  2212. get: function get() {
  2213. return "<span class='$0'>$1</span>";
  2214. } // Status code - it is not grade related!
  2215. // 0 - Succesful execution
  2216. // 1 - failed execution
  2217. }]);
  2218. function OutputAssessmentResult(name, status, inputs, result, store, time) {
  2219. var error_msg = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : '';
  2220. _classCallCheck(this, OutputAssessmentResult);
  2221. this.name = name;
  2222. this.status = status;
  2223. this.inputs = inputs;
  2224. this.results = result;
  2225. this.store = store;
  2226. this.time = time;
  2227. this.error_msg = error_msg;
  2228. }
  2229. _createClass(OutputAssessmentResult, [{
  2230. key: "prepareResults",
  2231. value: function prepareResults() {
  2232. var _this = this;
  2233. var template = OutputAssessmentResult.DETAIL_TEMPLATE;
  2234. var grade = (this.grade * 100).toFixed(2);
  2235. var time = this.time || "-";
  2236. template = template.replace(':test-name:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('assessment-detail-title', [this.name + 1]));
  2237. template = template.replace(':time-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('assessment-detail-time-label'));
  2238. template = template.replace(':time:', time);
  2239. template = template.replace(':grade-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('assessment-detail-grade-label'));
  2240. template = template.replace(':grade:', grade);
  2241. var input_spans = this.prepareInputList(this.inputs);
  2242. template = template.replace(':input-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('assessment-detail-input-label'));
  2243. template = template.replace(':input-list:', input_spans);
  2244. template = template.replace(':output-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('assessment-detail-output-label'));
  2245. if (this.status == 0) {
  2246. var output_rows = this.results.map(function (result) {
  2247. if (result.type == "string") {
  2248. return _this.formatString(result);
  2249. } else if (result.type == "number") {
  2250. return _this.formatNumber(result);
  2251. } else {
  2252. return _this.formatBool(result);
  2253. }
  2254. }, this);
  2255. template = template.replace(':output-result:', this.prepareOutputTable(output_rows));
  2256. } else {
  2257. var failed_text = OutputAssessmentResult.FAILED_TEMPLATE;
  2258. failed_text = failed_text.replace("$0", this.error_msg);
  2259. template = template.replace(":output-result:", failed_text);
  2260. }
  2261. return template;
  2262. }
  2263. }, {
  2264. key: "prepareInputList",
  2265. value: function prepareInputList(input_list) {
  2266. var list = input_list.map(function (input) {
  2267. var template = OutputAssessmentResult.INPUT_INFO_TEMPLATE;
  2268. template = template.replace("$1", input.value);
  2269. if (input.read) {
  2270. template = template.replace("$0", "assessment-input-read");
  2271. } else {
  2272. template = template.replace("$0", "assessment-input-unread");
  2273. }
  2274. return template;
  2275. }, this);
  2276. return list.join(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_join_assessment_outputs'));
  2277. }
  2278. }, {
  2279. key: "prepareOutputTable",
  2280. value: function prepareOutputTable(output_rows) {
  2281. var template = OutputAssessmentResult.OUPUT_TABLE_TEMPLATE;
  2282. template = template.replace(':expected-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('assessment-detail-expected-label'));
  2283. template = template.replace(':generated-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('assessment-detail-generated-label'));
  2284. template = template.replace(':result-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('assessment-detail-result-label'));
  2285. template = template.replace(':results:', output_rows.join(''));
  2286. return template;
  2287. }
  2288. }, {
  2289. key: "generateOutput",
  2290. value: function generateOutput() {
  2291. var assessment_result = this.prepareResults();
  2292. var page = OutputAssessmentResult.PAGE_TEMPLATE;
  2293. page = page.replace(':assessment-result:', assessment_result);
  2294. page = page.replace(/(\r|\n|\t)/gm, '').replace(/> *</g, '><');
  2295. return page;
  2296. }
  2297. }, {
  2298. key: "formatNumber",
  2299. value: function formatNumber(result) {
  2300. var result_class = result.grade == 1 ? 'assessment-number-result' : 'assessment-number-result-failed';
  2301. var template = this.formatOutput('assessment-number-expected', 'assessment-number-generated', result_class, result);
  2302. return template;
  2303. }
  2304. }, {
  2305. key: "formatBool",
  2306. value: function formatBool(result) {
  2307. var result_class = result.grade == 1 ? 'assessment-bool-result' : 'assessment-bool-result-failed';
  2308. var template = this.formatOutput('assessment-bool-expected', 'assessment-bool-generated', result_class, result);
  2309. return template;
  2310. }
  2311. }, {
  2312. key: "formatOutput",
  2313. value: function formatOutput(expected_class, generated_class, result_class, result) {
  2314. var template = OutputAssessmentResult.OUTPUT_TEMPLATE;
  2315. template = template.replace(":class-expected:", expected_class);
  2316. template = template.replace(":class-generated:", generated_class);
  2317. template = template.replace(":class-result:", result_class);
  2318. var expected_tmpl = result.expected;
  2319. var generated_tmpl = result.generated;
  2320. if (expected_tmpl == null) {
  2321. expected_tmpl = OutputAssessmentResult.EMPTY_OUTPUT_TEMPLATE.replace('$0', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getMessage('assessment-empty-expected-tooltip'));
  2322. } else if (generated_tmpl == null) {
  2323. generated_tmpl = OutputAssessmentResult.EMPTY_OUTPUT_TEMPLATE.replace('$0', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getMessage('assessment-empty-generated-tooltip'));
  2324. }
  2325. template = template.replace("$0", expected_tmpl);
  2326. template = template.replace("$1", generated_tmpl);
  2327. var final_result = result.grade == 1 ? "✓" : "✗";
  2328. template = template.replace("$2", final_result);
  2329. return template;
  2330. }
  2331. }, {
  2332. key: "formatString",
  2333. value: function formatString(result) {
  2334. var _this2 = this;
  2335. var expected_class = 'assessment-string-expected';
  2336. var generated_class = 'assessment-string-generated'; //const result_class = 'assessment-string-result';
  2337. var template = OutputAssessmentResult.OUTPUT_TEMPLATE;
  2338. template = template.replace(":class-expected:", expected_class);
  2339. template = template.replace(":class-generated:", generated_class); //template = template.replace(":class-result:", result_class);
  2340. var g_string = result.generated || "";
  2341. var e_string = result.expected || "";
  2342. template = template.replace("$0", result.expected);
  2343. template = template.replace("$1", result.generated);
  2344. if (result.grade == 1) {
  2345. template = template.replace("$2", "✓");
  2346. template = template.replace(":class-result:", 'assessment-string-result');
  2347. } else {
  2348. var diff = Object(_util_string_diff__WEBPACK_IMPORTED_MODULE_0__["default"])(g_string, e_string);
  2349. var diff_vec = diff.map(function (part) {
  2350. return _this2.getDiffStringStyle(part[1], part[0]);
  2351. }, this);
  2352. var diff_string = diff_vec.reduce(function (prev, actual) {
  2353. return prev + actual;
  2354. }, "");
  2355. template = template.replace("$2", "<span class='assessment-failed-case'>✗</span>" + diff_string);
  2356. template = template.replace(":class-result:", "assessment-string-diff");
  2357. }
  2358. return template;
  2359. }
  2360. }, {
  2361. key: "getDiffStringStyle",
  2362. value: function getDiffStringStyle(text, action) {
  2363. var template = "<span class='$0'>$1</span>";
  2364. switch (action) {
  2365. case _util_string_diff__WEBPACK_IMPORTED_MODULE_0__["default"].INSERT:
  2366. return template.replace("$0", "stringdiff-insert").replace("$1", text);
  2367. case _util_string_diff__WEBPACK_IMPORTED_MODULE_0__["default"].DELETE:
  2368. return template.replace("$0", "stringdiff-delete").replace("$1", text);
  2369. case _util_string_diff__WEBPACK_IMPORTED_MODULE_0__["default"].EQUAL:
  2370. return template.replace("$0", "stringdiff-equal").replace("$1", text);
  2371. }
  2372. }
  2373. }, {
  2374. key: "grade",
  2375. get: function get() {
  2376. if (this.results == null) {
  2377. return 0;
  2378. }
  2379. return this.results.reduce(function (prev, val) {
  2380. return prev + val.grade;
  2381. }, 0) / this.results.length;
  2382. }
  2383. }]);
  2384. return OutputAssessmentResult;
  2385. }();
  2386. /***/ }),
  2387. /***/ "./js/assessment/output_matching/output_matching.js":
  2388. /*!**********************************************************!*\
  2389. !*** ./js/assessment/output_matching/output_matching.js ***!
  2390. \**********************************************************/
  2391. /*! exports provided: OutputMatching */
  2392. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2393. "use strict";
  2394. __webpack_require__.r(__webpack_exports__);
  2395. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputMatching", function() { return OutputMatching; });
  2396. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! decimal.js */ "./node_modules/decimal.js/decimal.js");
  2397. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(decimal_js__WEBPACK_IMPORTED_MODULE_0__);
  2398. /* harmony import */ var _util_input_assessment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/input_assessment */ "./js/util/input_assessment.js");
  2399. /* harmony import */ var _util_outputTest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/outputTest */ "./js/util/outputTest.js");
  2400. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/config */ "./js/util/config.js");
  2401. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/utils */ "./js/util/utils.js");
  2402. /* harmony import */ var _assessment_result__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./assessment_result */ "./js/assessment/output_matching/assessment_result.js");
  2403. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  2404. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  2405. /* harmony import */ var _output_result__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./output_result */ "./js/assessment/output_matching/output_result.js");
  2406. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2407. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  2408. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  2409. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_7__["getInstance"]();
  2410. var OutputMatching =
  2411. /*#__PURE__*/
  2412. function () {
  2413. _createClass(OutputMatching, null, [{
  2414. key: "NUM_REGEX",
  2415. get: function get() {
  2416. return /^[+-]?([0-9]+([.][0-9]*)?(e[+-]?[0-9]+)?)$/;
  2417. }
  2418. }, {
  2419. key: "NUM_IN_STRING_REGEX",
  2420. get: function get() {
  2421. return /[+-]?([0-9]+([.][0-9]*)?(e[+-]?[0-9]+)?)/g;
  2422. }
  2423. }, {
  2424. key: "BOOLEAN_REGEX",
  2425. get: function get() {
  2426. var str = "^(".concat(LocalizedStrings.getUI("logic_value_true"), "|").concat(LocalizedStrings.getUI("logic_value_false"), ")$");
  2427. return new RegExp(str);
  2428. }
  2429. }, {
  2430. key: "BOOLEAN_IN_STRING_REGEX",
  2431. get: function get() {
  2432. var str = "(".concat(LocalizedStrings.getUI("logic_value_true"), "|").concat(LocalizedStrings.getUI("logic_value_false"), ")");
  2433. return new RegExp(str, 'g');
  2434. }
  2435. }]);
  2436. function OutputMatching(program, input_list, expected_output, test_name) {
  2437. _classCallCheck(this, OutputMatching);
  2438. this.program = program;
  2439. this.name = test_name;
  2440. this.input_list = input_list;
  2441. this.expected_output = expected_output;
  2442. }
  2443. _createClass(OutputMatching, [{
  2444. key: "eval",
  2445. value: function _eval() {
  2446. var _this = this;
  2447. var refThis = this;
  2448. var input = new _util_input_assessment__WEBPACK_IMPORTED_MODULE_1__["InputAssessment"](this.input_list);
  2449. var gen_output = new _util_outputTest__WEBPACK_IMPORTED_MODULE_2__["OutputTest"]();
  2450. this.program.registerInput(input);
  2451. this.program.registerOutput(gen_output);
  2452. var start_time = Date.now();
  2453. return this.program.interpretAST().then(function (sto) {
  2454. var final_time = Date.now() - start_time;
  2455. if (input.isInputAvailable()) {
  2456. return new _assessment_result__WEBPACK_IMPORTED_MODULE_5__["OutputAssessmentResult"](_this.name, 1, input.input_list, null, sto, final_time, refThis.getErrorMessage('test_case_few_reads', _this.name + 1));
  2457. }
  2458. var result = gen_output.list.map(function (g_out, i) {
  2459. if (i >= _this.expected_output.length) {
  2460. return new _output_result__WEBPACK_IMPORTED_MODULE_8__["OutputMatchResult"](null, g_out, 0, _this.getPotentialOutputType(g_out));
  2461. }
  2462. return _this.outputMatch(g_out, _this.expected_output[i]);
  2463. }, _this);
  2464. if (_this.expected_output.length > gen_output.list.length) {
  2465. for (var i = gen_output.list.length; i < _this.expected_output.length; ++i) {
  2466. var e_out = _this.expected_output[i];
  2467. result.push(new _output_result__WEBPACK_IMPORTED_MODULE_8__["OutputMatchResult"](e_out, null, 0, _this.getPotentialOutputType(e_out)));
  2468. }
  2469. }
  2470. return new _assessment_result__WEBPACK_IMPORTED_MODULE_5__["OutputAssessmentResult"](_this.name, 0, input.input_list, result, sto, final_time);
  2471. })["catch"](function (error) {
  2472. return new _assessment_result__WEBPACK_IMPORTED_MODULE_5__["OutputAssessmentResult"](_this.name, 1, input.input_list, null, null, null, refThis.getErrorMessage('test_case_exception', _this.name + 1, error.message));
  2473. });
  2474. }
  2475. }, {
  2476. key: "getPotentialOutputType",
  2477. value: function getPotentialOutputType(output) {
  2478. if (OutputMatching.NUM_REGEX.test(output)) {
  2479. return "number";
  2480. } else if (OutputMatching.BOOLEAN_REGEX.test(output)) {
  2481. return "bool";
  2482. } else {
  2483. return "string";
  2484. }
  2485. }
  2486. }, {
  2487. key: "outputMatch",
  2488. value: function outputMatch(g_output, e_output) {
  2489. if (OutputMatching.NUM_REGEX.test(e_output)) {
  2490. if (!OutputMatching.NUM_REGEX.test(g_output)) {
  2491. return this.checkStrings(g_output, e_output);
  2492. }
  2493. var g_num = new decimal_js__WEBPACK_IMPORTED_MODULE_0__["Decimal"](g_output);
  2494. var e_num = new decimal_js__WEBPACK_IMPORTED_MODULE_0__["Decimal"](e_output);
  2495. return this.checkNumbers(g_num, e_num);
  2496. } else if (OutputMatching.BOOLEAN_REGEX.test(e_output)) {
  2497. if (!OutputMatching.BOOLEAN_REGEX.test(g_output)) {
  2498. return this.checkStrings(g_output, e_output);
  2499. }
  2500. var g_bool = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toBool"](g_output);
  2501. var e_bool = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toBool"](e_output);
  2502. return this.checkBoolean(g_bool, e_bool);
  2503. } else {
  2504. return this.checkStrings(g_output, e_output);
  2505. }
  2506. }
  2507. }, {
  2508. key: "checkNumbers",
  2509. value: function checkNumbers(g_num, e_num) {
  2510. var decimalPlaces = Math.min(e_num.dp(), _util_config__WEBPACK_IMPORTED_MODULE_3__["Config"].decimalPlaces);
  2511. g_num = new decimal_js__WEBPACK_IMPORTED_MODULE_0__["Decimal"](g_num.toFixed(decimalPlaces, decimal_js__WEBPACK_IMPORTED_MODULE_0__["Decimal"].ROUND_FLOOR));
  2512. e_num = new decimal_js__WEBPACK_IMPORTED_MODULE_0__["Decimal"](e_num.toFixed(decimalPlaces, decimal_js__WEBPACK_IMPORTED_MODULE_0__["Decimal"].ROUND_FLOOR));
  2513. var result = g_num.eq(e_num);
  2514. var grade = result ? 1 : 0;
  2515. return _output_result__WEBPACK_IMPORTED_MODULE_8__["createNumberResult"](e_num.toNumber(), g_num.toNumber(), grade);
  2516. }
  2517. }, {
  2518. key: "checkBoolean",
  2519. value: function checkBoolean(g_bool, e_bool) {
  2520. var grade = g_bool == e_bool ? 1 : 0;
  2521. var g_bool_text = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["convertBoolToString"](g_bool);
  2522. var e_bool_text = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["convertBoolToString"](e_bool);
  2523. return _output_result__WEBPACK_IMPORTED_MODULE_8__["createBoolResult"](e_bool_text, g_bool_text, grade);
  2524. }
  2525. }, {
  2526. key: "checkStrings",
  2527. value: function checkStrings(g_output, e_ouput) {
  2528. var _this2 = this;
  2529. var assessmentList = [];
  2530. var e_output_clean = e_ouput;
  2531. var g_output_clean = g_output;
  2532. if (OutputMatching.NUM_IN_STRING_REGEX.test(e_ouput)) {
  2533. var expected_numbers = e_ouput.match(OutputMatching.NUM_IN_STRING_REGEX);
  2534. var generated_numbers = g_output.match(OutputMatching.NUM_IN_STRING_REGEX) || [];
  2535. var result = generated_numbers.map(function (val, i) {
  2536. if (i >= expected_numbers.length) {
  2537. return _output_result__WEBPACK_IMPORTED_MODULE_8__["createNumberResult"](null, val, 0);
  2538. }
  2539. var g_val = new decimal_js__WEBPACK_IMPORTED_MODULE_0__["Decimal"](val);
  2540. var e_val = new decimal_js__WEBPACK_IMPORTED_MODULE_0__["Decimal"](expected_numbers[i]);
  2541. return _this2.checkNumbers(g_val, e_val);
  2542. }, this);
  2543. if (expected_numbers.length > generated_numbers.length) {
  2544. for (var i = generated_numbers.length; i < expected_numbers.length; ++i) {
  2545. result.push(_output_result__WEBPACK_IMPORTED_MODULE_8__["createNumberResult"](expected_numbers[i], null, 0));
  2546. }
  2547. }
  2548. e_output_clean = e_output_clean.replace(OutputMatching.NUM_IN_STRING_REGEX, '').trim();
  2549. g_output_clean = g_output_clean.replace(OutputMatching.NUM_IN_STRING_REGEX, '').trim();
  2550. var numberGrade = result.reduce(function (prev, r) {
  2551. return prev + r.grade;
  2552. }, 0) / result.length;
  2553. assessmentList.push(numberGrade);
  2554. }
  2555. if (OutputMatching.BOOLEAN_IN_STRING_REGEX.test(e_ouput)) {
  2556. var expected_bools = e_ouput.match(OutputMatching.BOOLEAN_IN_STRING_REGEX);
  2557. var generated_bools = g_output.match(OutputMatching.BOOLEAN_IN_STRING_REGEX) || [];
  2558. var _result = generated_bools.map(function (val, i) {
  2559. if (i >= expected_bools.length) {
  2560. return _output_result__WEBPACK_IMPORTED_MODULE_8__["createBoolResult"](null, val, 0);
  2561. }
  2562. var g_bool = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toBool"](val);
  2563. var e_bool = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toBool"](expected_bools[i]);
  2564. return _this2.checkBoolean(g_bool, e_bool);
  2565. }, this);
  2566. if (expected_bools.length > generated_bools.length) {
  2567. for (var _i = generated_bools.length; _i < expected_bools.length; ++_i) {
  2568. _result.push(_output_result__WEBPACK_IMPORTED_MODULE_8__["createBoolResult"](expected_bools[_i], null, 0));
  2569. }
  2570. }
  2571. e_output_clean = e_output_clean.replace(OutputMatching.BOOLEAN_IN_STRING_REGEX, '').trim();
  2572. g_output_clean = g_output_clean.replace(OutputMatching.BOOLEAN_IN_STRING_REGEX, '').trim();
  2573. var boolGrade = _result.reduce(function (prev, r) {
  2574. return prev + r.grade;
  2575. }, 0) / _result.length;
  2576. assessmentList.push(boolGrade);
  2577. }
  2578. var dist = Object(_util_utils__WEBPACK_IMPORTED_MODULE_4__["levenshteinDistance"])(g_output_clean, e_output_clean);
  2579. var gradeDiff = Math.max(0, e_output_clean.length - dist) / e_output_clean.length;
  2580. gradeDiff = Number.isNaN(gradeDiff) ? 0 : gradeDiff;
  2581. var assessment_size = assessmentList.length + 1;
  2582. var gradeAcc = assessmentList.reduce(function (prev, val) {
  2583. return prev + val / assessment_size;
  2584. }, 0);
  2585. var finalGrade = 1 * (gradeDiff / assessment_size + gradeAcc);
  2586. return _output_result__WEBPACK_IMPORTED_MODULE_8__["createStringResult"](e_ouput, g_output, finalGrade);
  2587. }
  2588. }, {
  2589. key: "getErrorMessage",
  2590. value: function getErrorMessage(errorID) {
  2591. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  2592. args[_key - 1] = arguments[_key];
  2593. }
  2594. return LocalizedStrings.getError(errorID, args);
  2595. }
  2596. }]);
  2597. return OutputMatching;
  2598. }();
  2599. /***/ }),
  2600. /***/ "./js/assessment/output_matching/output_result.js":
  2601. /*!********************************************************!*\
  2602. !*** ./js/assessment/output_matching/output_result.js ***!
  2603. \********************************************************/
  2604. /*! exports provided: createNumberResult, createBoolResult, createStringResult, OutputMatchResult */
  2605. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2606. "use strict";
  2607. __webpack_require__.r(__webpack_exports__);
  2608. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNumberResult", function() { return createNumberResult; });
  2609. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createBoolResult", function() { return createBoolResult; });
  2610. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createStringResult", function() { return createStringResult; });
  2611. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputMatchResult", function() { return OutputMatchResult; });
  2612. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2613. function createNumberResult(expected, generated, grade) {
  2614. return new OutputMatchResult(expected, generated, grade, "number");
  2615. }
  2616. function createBoolResult(expected, generated, grade) {
  2617. return new OutputMatchResult(expected, generated, grade, "bool");
  2618. }
  2619. function createStringResult(expected, generated, grade) {
  2620. return new OutputMatchResult(expected, generated, grade, "string");
  2621. }
  2622. var OutputMatchResult = function OutputMatchResult(expected, generated, grade, type) {
  2623. _classCallCheck(this, OutputMatchResult);
  2624. this.expected = expected;
  2625. this.generated = generated;
  2626. this.grade = grade;
  2627. this.type = type;
  2628. };
  2629. /***/ }),
  2630. /***/ "./js/ast/ast_helpers.js":
  2631. /*!*******************************!*\
  2632. !*** ./js/ast/ast_helpers.js ***!
  2633. \*******************************/
  2634. /*! exports provided: recover */
  2635. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2636. "use strict";
  2637. __webpack_require__.r(__webpack_exports__);
  2638. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recover", function() { return recover; });
  2639. /* harmony import */ var _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./error/syntaxErrorFactory */ "./js/ast/error/syntaxErrorFactory.js");
  2640. function recover(_) {
  2641. var start = this._tokenStartCharIndex;
  2642. var stop = this._input.index;
  2643. var text = this._input.getText(start, stop);
  2644. text = this.getErrorDisplay(text);
  2645. var line = this._tokenStartLine;
  2646. var column = this._tokenStartColumn;
  2647. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_0__["SyntaxErrorFactory"].invalid_character(text, line, column);
  2648. }
  2649. /***/ }),
  2650. /***/ "./js/ast/commands/arrayAssign.js":
  2651. /*!****************************************!*\
  2652. !*** ./js/ast/commands/arrayAssign.js ***!
  2653. \****************************************/
  2654. /*! exports provided: ArrayIndexAssign */
  2655. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2656. "use strict";
  2657. __webpack_require__.r(__webpack_exports__);
  2658. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayIndexAssign", function() { return ArrayIndexAssign; });
  2659. /* harmony import */ var _assign__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assign */ "./js/ast/commands/assign.js");
  2660. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  2661. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2662. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  2663. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  2664. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  2665. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  2666. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  2667. var ArrayIndexAssign =
  2668. /*#__PURE__*/
  2669. function (_Assign) {
  2670. _inherits(ArrayIndexAssign, _Assign);
  2671. function ArrayIndexAssign(id, lineExpression, columnExpression, expression) {
  2672. var _this;
  2673. _classCallCheck(this, ArrayIndexAssign);
  2674. _this = _possibleConstructorReturn(this, _getPrototypeOf(ArrayIndexAssign).call(this, id, expression));
  2675. _this.line = lineExpression;
  2676. _this.column = columnExpression;
  2677. return _this;
  2678. }
  2679. return ArrayIndexAssign;
  2680. }(_assign__WEBPACK_IMPORTED_MODULE_0__["Assign"]);
  2681. /***/ }),
  2682. /***/ "./js/ast/commands/arrayDeclaration.js":
  2683. /*!*********************************************!*\
  2684. !*** ./js/ast/commands/arrayDeclaration.js ***!
  2685. \*********************************************/
  2686. /*! exports provided: ArrayDeclaration */
  2687. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2688. "use strict";
  2689. __webpack_require__.r(__webpack_exports__);
  2690. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayDeclaration", function() { return ArrayDeclaration; });
  2691. /* harmony import */ var _declaration__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./declaration */ "./js/ast/commands/declaration.js");
  2692. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  2693. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2694. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  2695. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  2696. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  2697. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  2698. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  2699. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  2700. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  2701. var ArrayDeclaration =
  2702. /*#__PURE__*/
  2703. function (_Declaration) {
  2704. _inherits(ArrayDeclaration, _Declaration);
  2705. function ArrayDeclaration(id, type, lines, columns, initial, isConst) {
  2706. var _this;
  2707. _classCallCheck(this, ArrayDeclaration);
  2708. _this = _possibleConstructorReturn(this, _getPrototypeOf(ArrayDeclaration).call(this, id, type, initial, isConst));
  2709. _this.lines = lines;
  2710. _this.columns = columns;
  2711. return _this;
  2712. }
  2713. _createClass(ArrayDeclaration, [{
  2714. key: "isVector",
  2715. get: function get() {
  2716. return this.columns == null;
  2717. }
  2718. }]);
  2719. return ArrayDeclaration;
  2720. }(_declaration__WEBPACK_IMPORTED_MODULE_0__["Declaration"]);
  2721. /***/ }),
  2722. /***/ "./js/ast/commands/assign.js":
  2723. /*!***********************************!*\
  2724. !*** ./js/ast/commands/assign.js ***!
  2725. \***********************************/
  2726. /*! exports provided: Assign */
  2727. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2728. "use strict";
  2729. __webpack_require__.r(__webpack_exports__);
  2730. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Assign", function() { return Assign; });
  2731. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2732. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  2733. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2734. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  2735. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  2736. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  2737. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  2738. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  2739. var Assign =
  2740. /*#__PURE__*/
  2741. function (_Command) {
  2742. _inherits(Assign, _Command);
  2743. function Assign(id, expression) {
  2744. var _this;
  2745. _classCallCheck(this, Assign);
  2746. _this = _possibleConstructorReturn(this, _getPrototypeOf(Assign).call(this));
  2747. _this.id = id;
  2748. _this.expression = expression;
  2749. return _this;
  2750. }
  2751. return Assign;
  2752. }(_command__WEBPACK_IMPORTED_MODULE_0__["Command"]);
  2753. /***/ }),
  2754. /***/ "./js/ast/commands/break.js":
  2755. /*!**********************************!*\
  2756. !*** ./js/ast/commands/break.js ***!
  2757. \**********************************/
  2758. /*! exports provided: Break */
  2759. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2760. "use strict";
  2761. __webpack_require__.r(__webpack_exports__);
  2762. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Break", function() { return Break; });
  2763. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2764. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  2765. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2766. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  2767. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  2768. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  2769. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  2770. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  2771. var Break =
  2772. /*#__PURE__*/
  2773. function (_Command) {
  2774. _inherits(Break, _Command);
  2775. function Break() {
  2776. _classCallCheck(this, Break);
  2777. return _possibleConstructorReturn(this, _getPrototypeOf(Break).call(this));
  2778. }
  2779. return Break;
  2780. }(_command__WEBPACK_IMPORTED_MODULE_0__["Command"]);
  2781. /***/ }),
  2782. /***/ "./js/ast/commands/case.js":
  2783. /*!*********************************!*\
  2784. !*** ./js/ast/commands/case.js ***!
  2785. \*********************************/
  2786. /*! exports provided: Case */
  2787. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2788. "use strict";
  2789. __webpack_require__.r(__webpack_exports__);
  2790. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Case", function() { return Case; });
  2791. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2792. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  2793. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2794. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  2795. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  2796. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  2797. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  2798. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  2799. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  2800. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  2801. var Case =
  2802. /*#__PURE__*/
  2803. function (_Command) {
  2804. _inherits(Case, _Command);
  2805. function Case(expression) {
  2806. var _this;
  2807. _classCallCheck(this, Case);
  2808. _this = _possibleConstructorReturn(this, _getPrototypeOf(Case).call(this));
  2809. _this.expression = expression;
  2810. _this.commands = [];
  2811. return _this;
  2812. }
  2813. _createClass(Case, [{
  2814. key: "setCommands",
  2815. value: function setCommands(commands) {
  2816. this.commands = commands;
  2817. }
  2818. }, {
  2819. key: "isDefault",
  2820. get: function get() {
  2821. return this.expression === null;
  2822. }
  2823. }]);
  2824. return Case;
  2825. }(_command__WEBPACK_IMPORTED_MODULE_0__["Command"]);
  2826. /***/ }),
  2827. /***/ "./js/ast/commands/command.js":
  2828. /*!************************************!*\
  2829. !*** ./js/ast/commands/command.js ***!
  2830. \************************************/
  2831. /*! exports provided: Command */
  2832. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2833. "use strict";
  2834. __webpack_require__.r(__webpack_exports__);
  2835. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return Command; });
  2836. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2837. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  2838. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  2839. var Command =
  2840. /*#__PURE__*/
  2841. function () {
  2842. function Command() {
  2843. _classCallCheck(this, Command);
  2844. this._sourceInfo = null;
  2845. }
  2846. _createClass(Command, [{
  2847. key: "sourceInfo",
  2848. set: function set(sourceInfo) {
  2849. this._sourceInfo = sourceInfo;
  2850. },
  2851. get: function get() {
  2852. return this._sourceInfo;
  2853. }
  2854. }]);
  2855. return Command;
  2856. }();
  2857. /***/ }),
  2858. /***/ "./js/ast/commands/commandBlock.js":
  2859. /*!*****************************************!*\
  2860. !*** ./js/ast/commands/commandBlock.js ***!
  2861. \*****************************************/
  2862. /*! exports provided: CommandBlock */
  2863. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2864. "use strict";
  2865. __webpack_require__.r(__webpack_exports__);
  2866. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CommandBlock", function() { return CommandBlock; });
  2867. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2868. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  2869. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  2870. var CommandBlock =
  2871. /*#__PURE__*/
  2872. function () {
  2873. function CommandBlock(variables, commands) {
  2874. _classCallCheck(this, CommandBlock);
  2875. this.variables = variables;
  2876. this.commands = commands;
  2877. this._sourceInfo = null;
  2878. }
  2879. _createClass(CommandBlock, [{
  2880. key: "sourceInfo",
  2881. set: function set(sourceInfo) {
  2882. this._sourceInfo = sourceInfo;
  2883. },
  2884. get: function get() {
  2885. return this._sourceInfo;
  2886. }
  2887. }]);
  2888. return CommandBlock;
  2889. }();
  2890. /***/ }),
  2891. /***/ "./js/ast/commands/declaration.js":
  2892. /*!****************************************!*\
  2893. !*** ./js/ast/commands/declaration.js ***!
  2894. \****************************************/
  2895. /*! exports provided: Declaration */
  2896. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2897. "use strict";
  2898. __webpack_require__.r(__webpack_exports__);
  2899. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Declaration", function() { return Declaration; });
  2900. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2901. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  2902. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2903. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  2904. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  2905. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  2906. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  2907. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  2908. var Declaration =
  2909. /*#__PURE__*/
  2910. function (_Command) {
  2911. _inherits(Declaration, _Command);
  2912. function Declaration(id, type, initial, isConst) {
  2913. var _this;
  2914. _classCallCheck(this, Declaration);
  2915. _this = _possibleConstructorReturn(this, _getPrototypeOf(Declaration).call(this));
  2916. _this.id = id;
  2917. _this.type = type;
  2918. _this.initial = initial;
  2919. _this.isConst = isConst;
  2920. return _this;
  2921. }
  2922. return Declaration;
  2923. }(_command__WEBPACK_IMPORTED_MODULE_0__["Command"]);
  2924. /***/ }),
  2925. /***/ "./js/ast/commands/for.js":
  2926. /*!********************************!*\
  2927. !*** ./js/ast/commands/for.js ***!
  2928. \********************************/
  2929. /*! exports provided: For */
  2930. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2931. "use strict";
  2932. __webpack_require__.r(__webpack_exports__);
  2933. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "For", function() { return For; });
  2934. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  2935. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  2936. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2937. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  2938. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  2939. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  2940. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  2941. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  2942. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  2943. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  2944. var For =
  2945. /*#__PURE__*/
  2946. function (_Command) {
  2947. _inherits(For, _Command);
  2948. function For(for_id, for_from, for_to, for_pass, commandBlock) {
  2949. var _this;
  2950. _classCallCheck(this, For);
  2951. _this = _possibleConstructorReturn(this, _getPrototypeOf(For).call(this));
  2952. _this.for_id = for_id;
  2953. _this.for_from = for_from;
  2954. _this.for_to = for_to;
  2955. _this.for_pass = for_pass;
  2956. _this.commandBlock = commandBlock;
  2957. return _this;
  2958. }
  2959. _createClass(For, [{
  2960. key: "commands",
  2961. get: function get() {
  2962. return this.commandBlock.commands;
  2963. }
  2964. }]);
  2965. return For;
  2966. }(_command__WEBPACK_IMPORTED_MODULE_0__["Command"]);
  2967. /***/ }),
  2968. /***/ "./js/ast/commands/formalParameter.js":
  2969. /*!********************************************!*\
  2970. !*** ./js/ast/commands/formalParameter.js ***!
  2971. \********************************************/
  2972. /*! exports provided: FormalParameter */
  2973. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2974. "use strict";
  2975. __webpack_require__.r(__webpack_exports__);
  2976. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormalParameter", function() { return FormalParameter; });
  2977. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2978. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  2979. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  2980. var FormalParameter =
  2981. /*#__PURE__*/
  2982. function () {
  2983. function FormalParameter(type, id) {
  2984. var byRef = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  2985. _classCallCheck(this, FormalParameter);
  2986. this.type = type;
  2987. this.id = id;
  2988. this.byRef = byRef;
  2989. this._sourceInfo = null;
  2990. }
  2991. _createClass(FormalParameter, [{
  2992. key: "sourceInfo",
  2993. set: function set(sourceInfo) {
  2994. this._sourceInfo = sourceInfo;
  2995. },
  2996. get: function get() {
  2997. return this._sourceInfo;
  2998. }
  2999. }]);
  3000. return FormalParameter;
  3001. }();
  3002. /***/ }),
  3003. /***/ "./js/ast/commands/function.js":
  3004. /*!*************************************!*\
  3005. !*** ./js/ast/commands/function.js ***!
  3006. \*************************************/
  3007. /*! exports provided: Function */
  3008. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3009. "use strict";
  3010. __webpack_require__.r(__webpack_exports__);
  3011. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Function", function() { return Function; });
  3012. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3013. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__);
  3014. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3015. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  3016. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  3017. var Function =
  3018. /*#__PURE__*/
  3019. function () {
  3020. function Function(name, returnType, formalParameters, commandBlock) {
  3021. _classCallCheck(this, Function);
  3022. this.name = name;
  3023. this.returnType = returnType;
  3024. this.formalParameters = formalParameters;
  3025. this.commandBlock = commandBlock;
  3026. this._sourceInfo = null;
  3027. }
  3028. _createClass(Function, [{
  3029. key: "isMain",
  3030. get: function get() {
  3031. return this.name === null && this.returnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID);
  3032. }
  3033. }, {
  3034. key: "commands",
  3035. get: function get() {
  3036. return this.commandBlock.commands;
  3037. }
  3038. }, {
  3039. key: "variablesDeclarations",
  3040. get: function get() {
  3041. return this.commandBlock.variables;
  3042. }
  3043. }, {
  3044. key: "sourceInfo",
  3045. set: function set(sourceInfo) {
  3046. this._sourceInfo = sourceInfo;
  3047. },
  3048. get: function get() {
  3049. return this._sourceInfo;
  3050. }
  3051. }]);
  3052. return Function;
  3053. }();
  3054. /***/ }),
  3055. /***/ "./js/ast/commands/ifThenElse.js":
  3056. /*!***************************************!*\
  3057. !*** ./js/ast/commands/ifThenElse.js ***!
  3058. \***************************************/
  3059. /*! exports provided: IfThenElse */
  3060. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3061. "use strict";
  3062. __webpack_require__.r(__webpack_exports__);
  3063. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IfThenElse", function() { return IfThenElse; });
  3064. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  3065. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3066. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3067. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  3068. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3069. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3070. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3071. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3072. var IfThenElse =
  3073. /*#__PURE__*/
  3074. function (_Command) {
  3075. _inherits(IfThenElse, _Command);
  3076. function IfThenElse(condition, ifTrue, ifFalse) {
  3077. var _this;
  3078. _classCallCheck(this, IfThenElse);
  3079. _this = _possibleConstructorReturn(this, _getPrototypeOf(IfThenElse).call(this));
  3080. _this.condition = condition;
  3081. _this.ifTrue = ifTrue;
  3082. _this.ifFalse = ifFalse;
  3083. return _this;
  3084. }
  3085. return IfThenElse;
  3086. }(_command__WEBPACK_IMPORTED_MODULE_0__["Command"]);
  3087. /***/ }),
  3088. /***/ "./js/ast/commands/index.js":
  3089. /*!**********************************!*\
  3090. !*** ./js/ast/commands/index.js ***!
  3091. \**********************************/
  3092. /*! exports provided: Break, Return, Assign, ArrayIndexAssign, Declaration, ArrayDeclaration, While, For, Function, IfThenElse, CommandBlock, RepeatUntil, Switch, Case, SysCall, FormalParameter, FunctionCall */
  3093. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3094. "use strict";
  3095. __webpack_require__.r(__webpack_exports__);
  3096. /* harmony import */ var _break__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./break */ "./js/ast/commands/break.js");
  3097. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Break", function() { return _break__WEBPACK_IMPORTED_MODULE_0__["Break"]; });
  3098. /* harmony import */ var _return__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./return */ "./js/ast/commands/return.js");
  3099. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Return", function() { return _return__WEBPACK_IMPORTED_MODULE_1__["Return"]; });
  3100. /* harmony import */ var _assign__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./assign */ "./js/ast/commands/assign.js");
  3101. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Assign", function() { return _assign__WEBPACK_IMPORTED_MODULE_2__["Assign"]; });
  3102. /* harmony import */ var _arrayAssign__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./arrayAssign */ "./js/ast/commands/arrayAssign.js");
  3103. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayIndexAssign", function() { return _arrayAssign__WEBPACK_IMPORTED_MODULE_3__["ArrayIndexAssign"]; });
  3104. /* harmony import */ var _declaration__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./declaration */ "./js/ast/commands/declaration.js");
  3105. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Declaration", function() { return _declaration__WEBPACK_IMPORTED_MODULE_4__["Declaration"]; });
  3106. /* harmony import */ var _arrayDeclaration__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./arrayDeclaration */ "./js/ast/commands/arrayDeclaration.js");
  3107. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayDeclaration", function() { return _arrayDeclaration__WEBPACK_IMPORTED_MODULE_5__["ArrayDeclaration"]; });
  3108. /* harmony import */ var _while__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./while */ "./js/ast/commands/while.js");
  3109. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "While", function() { return _while__WEBPACK_IMPORTED_MODULE_6__["While"]; });
  3110. /* harmony import */ var _for__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./for */ "./js/ast/commands/for.js");
  3111. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "For", function() { return _for__WEBPACK_IMPORTED_MODULE_7__["For"]; });
  3112. /* harmony import */ var _function__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./function */ "./js/ast/commands/function.js");
  3113. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Function", function() { return _function__WEBPACK_IMPORTED_MODULE_8__["Function"]; });
  3114. /* harmony import */ var _ifThenElse__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ifThenElse */ "./js/ast/commands/ifThenElse.js");
  3115. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IfThenElse", function() { return _ifThenElse__WEBPACK_IMPORTED_MODULE_9__["IfThenElse"]; });
  3116. /* harmony import */ var _commandBlock__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./commandBlock */ "./js/ast/commands/commandBlock.js");
  3117. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CommandBlock", function() { return _commandBlock__WEBPACK_IMPORTED_MODULE_10__["CommandBlock"]; });
  3118. /* harmony import */ var _repeatUntil__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./repeatUntil */ "./js/ast/commands/repeatUntil.js");
  3119. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RepeatUntil", function() { return _repeatUntil__WEBPACK_IMPORTED_MODULE_11__["RepeatUntil"]; });
  3120. /* harmony import */ var _switch__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./switch */ "./js/ast/commands/switch.js");
  3121. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return _switch__WEBPACK_IMPORTED_MODULE_12__["Switch"]; });
  3122. /* harmony import */ var _case__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./case */ "./js/ast/commands/case.js");
  3123. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Case", function() { return _case__WEBPACK_IMPORTED_MODULE_13__["Case"]; });
  3124. /* harmony import */ var _sysCall__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./sysCall */ "./js/ast/commands/sysCall.js");
  3125. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SysCall", function() { return _sysCall__WEBPACK_IMPORTED_MODULE_14__["SysCall"]; });
  3126. /* harmony import */ var _formalParameter__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./formalParameter */ "./js/ast/commands/formalParameter.js");
  3127. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormalParameter", function() { return _formalParameter__WEBPACK_IMPORTED_MODULE_15__["FormalParameter"]; });
  3128. /* harmony import */ var _expressions_functionCall__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../expressions/functionCall */ "./js/ast/expressions/functionCall.js");
  3129. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return _expressions_functionCall__WEBPACK_IMPORTED_MODULE_16__["FunctionCall"]; });
  3130. //Proxy to expression since they do exatcly the same thing
  3131. /***/ }),
  3132. /***/ "./js/ast/commands/repeatUntil.js":
  3133. /*!****************************************!*\
  3134. !*** ./js/ast/commands/repeatUntil.js ***!
  3135. \****************************************/
  3136. /*! exports provided: RepeatUntil */
  3137. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3138. "use strict";
  3139. __webpack_require__.r(__webpack_exports__);
  3140. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RepeatUntil", function() { return RepeatUntil; });
  3141. /* harmony import */ var _while__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./while */ "./js/ast/commands/while.js");
  3142. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3143. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3144. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  3145. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  3146. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  3147. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3148. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3149. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3150. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3151. var RepeatUntil =
  3152. /*#__PURE__*/
  3153. function (_While) {
  3154. _inherits(RepeatUntil, _While);
  3155. function RepeatUntil(condition, commandBlock) {
  3156. _classCallCheck(this, RepeatUntil);
  3157. return _possibleConstructorReturn(this, _getPrototypeOf(RepeatUntil).call(this, condition, commandBlock));
  3158. }
  3159. _createClass(RepeatUntil, [{
  3160. key: "testFirst",
  3161. get: function get() {
  3162. return false;
  3163. }
  3164. }]);
  3165. return RepeatUntil;
  3166. }(_while__WEBPACK_IMPORTED_MODULE_0__["While"]);
  3167. /***/ }),
  3168. /***/ "./js/ast/commands/return.js":
  3169. /*!***********************************!*\
  3170. !*** ./js/ast/commands/return.js ***!
  3171. \***********************************/
  3172. /*! exports provided: Return */
  3173. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3174. "use strict";
  3175. __webpack_require__.r(__webpack_exports__);
  3176. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Return", function() { return Return; });
  3177. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  3178. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3179. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3180. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  3181. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3182. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3183. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3184. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3185. var Return =
  3186. /*#__PURE__*/
  3187. function (_Command) {
  3188. _inherits(Return, _Command);
  3189. function Return(expression) {
  3190. var _this;
  3191. _classCallCheck(this, Return);
  3192. _this = _possibleConstructorReturn(this, _getPrototypeOf(Return).call(this));
  3193. _this.expression = expression;
  3194. return _this;
  3195. }
  3196. return Return;
  3197. }(_command__WEBPACK_IMPORTED_MODULE_0__["Command"]);
  3198. /***/ }),
  3199. /***/ "./js/ast/commands/switch.js":
  3200. /*!***********************************!*\
  3201. !*** ./js/ast/commands/switch.js ***!
  3202. \***********************************/
  3203. /*! exports provided: Switch */
  3204. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3205. "use strict";
  3206. __webpack_require__.r(__webpack_exports__);
  3207. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return Switch; });
  3208. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  3209. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3210. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3211. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  3212. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3213. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3214. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3215. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3216. var Switch =
  3217. /*#__PURE__*/
  3218. function (_Command) {
  3219. _inherits(Switch, _Command);
  3220. function Switch(expression, cases) {
  3221. var _this;
  3222. _classCallCheck(this, Switch);
  3223. _this = _possibleConstructorReturn(this, _getPrototypeOf(Switch).call(this));
  3224. _this.expression = expression;
  3225. _this.cases = cases;
  3226. return _this;
  3227. }
  3228. return Switch;
  3229. }(_command__WEBPACK_IMPORTED_MODULE_0__["Command"]);
  3230. /***/ }),
  3231. /***/ "./js/ast/commands/sysCall.js":
  3232. /*!************************************!*\
  3233. !*** ./js/ast/commands/sysCall.js ***!
  3234. \************************************/
  3235. /*! exports provided: SysCall */
  3236. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3237. "use strict";
  3238. __webpack_require__.r(__webpack_exports__);
  3239. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SysCall", function() { return SysCall; });
  3240. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3241. /**
  3242. * This class represents all the language defined functions.
  3243. * The language processor uses the id provided here to properly execute the desired function.
  3244. * The function is actually implemented inside the language processor.
  3245. * All the functions can be found at: js/processor/definedFunctions.js
  3246. */
  3247. var SysCall = function SysCall(langFunc) {
  3248. _classCallCheck(this, SysCall);
  3249. this.langFunc = langFunc;
  3250. };
  3251. /***/ }),
  3252. /***/ "./js/ast/commands/while.js":
  3253. /*!**********************************!*\
  3254. !*** ./js/ast/commands/while.js ***!
  3255. \**********************************/
  3256. /*! exports provided: While */
  3257. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3258. "use strict";
  3259. __webpack_require__.r(__webpack_exports__);
  3260. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "While", function() { return While; });
  3261. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
  3262. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3263. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3264. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  3265. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  3266. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  3267. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3268. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3269. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3270. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3271. var While =
  3272. /*#__PURE__*/
  3273. function (_Command) {
  3274. _inherits(While, _Command);
  3275. function While(expression, commandBlock) {
  3276. var _this;
  3277. _classCallCheck(this, While);
  3278. _this = _possibleConstructorReturn(this, _getPrototypeOf(While).call(this));
  3279. _this.expression = expression;
  3280. _this.commandBlock = commandBlock;
  3281. return _this;
  3282. }
  3283. _createClass(While, [{
  3284. key: "commands",
  3285. get: function get() {
  3286. return this.commandBlock.commands;
  3287. }
  3288. }, {
  3289. key: "testFirst",
  3290. get: function get() {
  3291. return true;
  3292. }
  3293. }]);
  3294. return While;
  3295. }(_command__WEBPACK_IMPORTED_MODULE_0__["Command"]);
  3296. /***/ }),
  3297. /***/ "./js/ast/error/syntaxError.js":
  3298. /*!*************************************!*\
  3299. !*** ./js/ast/error/syntaxError.js ***!
  3300. \*************************************/
  3301. /*! exports provided: SyntaxError */
  3302. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3303. "use strict";
  3304. __webpack_require__.r(__webpack_exports__);
  3305. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SyntaxError", function() { return SyntaxError; });
  3306. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3307. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3308. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  3309. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3310. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3311. function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
  3312. 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; } }
  3313. function _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
  3314. function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
  3315. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3316. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3317. var SyntaxError =
  3318. /*#__PURE__*/
  3319. function (_Error) {
  3320. _inherits(SyntaxError, _Error);
  3321. function SyntaxError() {
  3322. var _getPrototypeOf2;
  3323. var _this;
  3324. _classCallCheck(this, SyntaxError);
  3325. for (var _len = arguments.length, msg = new Array(_len), _key = 0; _key < _len; _key++) {
  3326. msg[_key] = arguments[_key];
  3327. }
  3328. _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(SyntaxError)).call.apply(_getPrototypeOf2, [this].concat(msg)));
  3329. if (Error.captureStackTrace) Error.captureStackTrace(_assertThisInitialized(_this), SyntaxError);
  3330. return _this;
  3331. }
  3332. return SyntaxError;
  3333. }(_wrapNativeSuper(Error));
  3334. /***/ }),
  3335. /***/ "./js/ast/error/syntaxErrorFactory.js":
  3336. /*!********************************************!*\
  3337. !*** ./js/ast/error/syntaxErrorFactory.js ***!
  3338. \********************************************/
  3339. /*! exports provided: SyntaxErrorFactory */
  3340. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3341. "use strict";
  3342. __webpack_require__.r(__webpack_exports__);
  3343. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SyntaxErrorFactory", function() { return SyntaxErrorFactory; });
  3344. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  3345. /* harmony import */ var _syntaxError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./syntaxError */ "./js/ast/error/syntaxError.js");
  3346. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["getInstance"]();
  3347. function createError(message_id) {
  3348. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  3349. return new _syntaxError__WEBPACK_IMPORTED_MODULE_1__["SyntaxError"](LocalizedStrings.getError(message_id, context));
  3350. }
  3351. var SyntaxErrorFactory = Object.freeze({
  3352. extra_lines: function extra_lines() {
  3353. return new _syntaxError__WEBPACK_IMPORTED_MODULE_1__["SyntaxError"](LocalizedStrings.getError("extra_lines"));
  3354. },
  3355. token_missing_one: function token_missing_one(expected, token) {
  3356. var context = [expected, token.text, token.line, token.column];
  3357. return createError("token_missing_one", context);
  3358. },
  3359. token_missing_list: function token_missing_list(expectedList, token) {
  3360. var line = expectedList.join(LocalizedStrings.getOR());
  3361. return SyntaxErrorFactory.token_missing_one(line, token);
  3362. },
  3363. id_missing: function id_missing(token) {
  3364. var context = [token.text, token.line, token.column];
  3365. return createError("id_missing", context);
  3366. },
  3367. eos_missing: function eos_missing(token) {
  3368. var context = [token.line, token.column];
  3369. return createError("eos_missing", context);
  3370. },
  3371. invalid_array_dimension: function invalid_array_dimension(typeName, token) {
  3372. var context = [token.line, token.column, typeName];
  3373. return createError("invalid_array_dimension", context);
  3374. },
  3375. invalid_array_size: function invalid_array_size(token) {
  3376. var context = [token.line];
  3377. return createError("invalid_array_size", context);
  3378. },
  3379. invalid_main_return: function invalid_main_return(name, typeName, token) {
  3380. var context = [name, typeName, token.line];
  3381. return createError("invalid_main_return", context);
  3382. },
  3383. invalid_var_declaration: function invalid_var_declaration(token) {
  3384. var context = [token.line];
  3385. return createError("invalid_var_declaration", context);
  3386. },
  3387. invalid_break_command: function invalid_break_command(cmdName, token) {
  3388. var context = [token.line, cmdName];
  3389. return createError("invalid_break_command", context);
  3390. },
  3391. invalid_terminal: function invalid_terminal(token) {
  3392. var context = [token.text, token.line, token.column];
  3393. return createError('invalid_terminal', context);
  3394. },
  3395. invalid_type: function invalid_type(list, token) {
  3396. var line = list.join(LocalizedStrings.getOR());
  3397. var context = [token.text, token.line, token.column, line];
  3398. return createError("invalid_type", context);
  3399. },
  3400. const_not_init: function const_not_init(token) {
  3401. var context = [token.line, token.column];
  3402. return createError("const_not_init", context);
  3403. },
  3404. invalid_id_format: function invalid_id_format(token) {
  3405. var context = [token.text, token.line, token.column];
  3406. return createError("invalid_id_format", context);
  3407. },
  3408. duplicate_function: function duplicate_function(token) {
  3409. var context = [token.text, token.line, token.column];
  3410. return createError("duplicate_function", context);
  3411. },
  3412. main_parameters: function main_parameters() {
  3413. return createError("main_parameters");
  3414. },
  3415. duplicate_variable: function duplicate_variable(token) {
  3416. var context = [token.text, token.line, token.column];
  3417. return createError("duplicate_variable", context);
  3418. },
  3419. invalid_character: function invalid_character(text, line, _column) {
  3420. var context = [text, line];
  3421. return createError("invalid_character", context);
  3422. },
  3423. annonymous_array_literal: function annonymous_array_literal(token) {
  3424. var context = [token.line];
  3425. return createError("annonymous_array_literal", context);
  3426. },
  3427. invalid_matrix_literal_line: function invalid_matrix_literal_line(exp, sourceInfo) {
  3428. var context = [exp, sourceInfo.line];
  3429. return createError("invalid_matrix_literal_line", context);
  3430. },
  3431. cannot_infer_matrix_line: function cannot_infer_matrix_line(name, sourceInfo) {
  3432. var context = [name, sourceInfo.line];
  3433. return createError("cannot_infer_matrix_line", context);
  3434. },
  3435. cannot_infer_matrix_column: function cannot_infer_matrix_column(name, sourceInfo) {
  3436. var context = [name, sourceInfo.line];
  3437. return createError("cannot_infer_matrix_column", context);
  3438. },
  3439. cannot_infer_vector_size: function cannot_infer_vector_size(name, sourceInfo) {
  3440. var context = [name, sourceInfo.line];
  3441. return createError("cannot_infer_vector_size", context);
  3442. },
  3443. matrix_to_vector_literal_attr: function matrix_to_vector_literal_attr(name, exp, sourceInfo) {
  3444. var context = [sourceInfo.line, exp, name];
  3445. return createError("matrix_to_vector_literal_attr", context);
  3446. },
  3447. vector_to_matrix_literal_attr: function vector_to_matrix_literal_attr(name, exp, sourceInfo) {
  3448. var context = [sourceInfo.line, exp, name];
  3449. return createError("vector_to_matrix_literal_attr", context);
  3450. },
  3451. array_init_not_literal: function array_init_not_literal(sourceInfo) {
  3452. var context = [sourceInfo.line];
  3453. return createError("array_init_not_literal", context);
  3454. },
  3455. array_exceeds_2d: function array_exceeds_2d(sourceInfo) {
  3456. var context = [sourceInfo.line];
  3457. return createError("array_exceeds_2d", context);
  3458. },
  3459. invalid_matrix_id_dimension: function invalid_matrix_id_dimension(sourceInfo) {
  3460. var context = [sourceInfo.line];
  3461. return createError("invalid_matrix_id_dimension", context);
  3462. },
  3463. invalid_vector_init: function invalid_vector_init(sourceInfo) {
  3464. var context = [sourceInfo.line];
  3465. return createError("invalid_vector_init", context);
  3466. },
  3467. invalid_matrix_init: function invalid_matrix_init(sourceInfo) {
  3468. var context = [sourceInfo.line];
  3469. return createError("invalid_matrix_init", context);
  3470. }
  3471. });
  3472. /***/ }),
  3473. /***/ "./js/ast/expressions/arrayAccess.js":
  3474. /*!*******************************************!*\
  3475. !*** ./js/ast/expressions/arrayAccess.js ***!
  3476. \*******************************************/
  3477. /*! exports provided: ArrayAccess */
  3478. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3479. "use strict";
  3480. __webpack_require__.r(__webpack_exports__);
  3481. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayAccess", function() { return ArrayAccess; });
  3482. /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
  3483. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3484. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3485. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  3486. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  3487. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  3488. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3489. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3490. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3491. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3492. var ArrayAccess =
  3493. /*#__PURE__*/
  3494. function (_Expression) {
  3495. _inherits(ArrayAccess, _Expression);
  3496. function ArrayAccess(id, line, column) {
  3497. var _this;
  3498. _classCallCheck(this, ArrayAccess);
  3499. _this = _possibleConstructorReturn(this, _getPrototypeOf(ArrayAccess).call(this));
  3500. _this.id = id;
  3501. _this.line = line;
  3502. _this.column = column;
  3503. return _this;
  3504. }
  3505. _createClass(ArrayAccess, [{
  3506. key: "toString",
  3507. value: function toString() {
  3508. var strLine = this.line.toString();
  3509. var strColumn = null;
  3510. if (this.column) {
  3511. strColumn = this.column.toString();
  3512. }
  3513. var text = null;
  3514. if (strColumn) {
  3515. text = "".concat(this.id, "[").concat(strLine, "][").concat(strColumn, "]");
  3516. } else {
  3517. text = "".concat(this.id, "[").concat(strLine, "]");
  3518. }
  3519. if (this.parenthesis) {
  3520. return "(".concat(text, ")");
  3521. } else {
  3522. return text;
  3523. }
  3524. }
  3525. }]);
  3526. return ArrayAccess;
  3527. }(_expression__WEBPACK_IMPORTED_MODULE_0__["Expression"]);
  3528. /***/ }),
  3529. /***/ "./js/ast/expressions/arrayLiteral.js":
  3530. /*!********************************************!*\
  3531. !*** ./js/ast/expressions/arrayLiteral.js ***!
  3532. \********************************************/
  3533. /*! exports provided: ArrayLiteral */
  3534. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3535. "use strict";
  3536. __webpack_require__.r(__webpack_exports__);
  3537. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayLiteral", function() { return ArrayLiteral; });
  3538. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3539. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3540. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3541. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  3542. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  3543. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  3544. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3545. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3546. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3547. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3548. var ArrayLiteral =
  3549. /*#__PURE__*/
  3550. function (_Literal) {
  3551. _inherits(ArrayLiteral, _Literal);
  3552. function ArrayLiteral(type, value) {
  3553. var _this;
  3554. _classCallCheck(this, ArrayLiteral);
  3555. _this = _possibleConstructorReturn(this, _getPrototypeOf(ArrayLiteral).call(this, type));
  3556. _this.value = value;
  3557. return _this;
  3558. }
  3559. _createClass(ArrayLiteral, [{
  3560. key: "validateType",
  3561. value: function validateType() {
  3562. var valid = true; // const subtype = this.subtype;
  3563. // if(this.columns !== null) {
  3564. // const len = this.lines;
  3565. // const len2 = this.columns;
  3566. // for (let i = len - 1; i >= 0 && valid; --i) {
  3567. // for (let j = len2 - 1; j >= 0 && valid; --j) {
  3568. // if(!this.value[i].value[j].type.isCompatilbe(subtype)) {
  3569. // valid = false;
  3570. // break;
  3571. // }
  3572. // }
  3573. // }
  3574. // } else {
  3575. // const len = this.lines;
  3576. // for (var i = len - 1; i >= 0 && valid; i--) {
  3577. // if(!this.value[i].type.isCompatilbe(subtype)) {
  3578. // valid = false;
  3579. // break;
  3580. // }
  3581. // }
  3582. // }
  3583. // Cannot validate type since no information on variables literals are available
  3584. return valid;
  3585. }
  3586. }, {
  3587. key: "validateSize",
  3588. value: function validateSize() {
  3589. var valid = true; // if(this.columns !== null) {
  3590. // const equalityTest = this.value.map(v => v.value.length)
  3591. // .reduce((old, next) => {
  3592. // console.log(next);
  3593. // if (old == null) {
  3594. // return next;
  3595. // } else if (old === next) {
  3596. // return old
  3597. // } else {
  3598. // return -1;
  3599. // }
  3600. // }, null);
  3601. // valid = equalityTest !== -1;
  3602. // }
  3603. // check is now made inside IVProgParser.parseVectorList(...)
  3604. return valid;
  3605. }
  3606. }, {
  3607. key: "toString",
  3608. value: function toString() {
  3609. var strList = this.value.map(function (arrayLiteral) {
  3610. return arrayLiteral.toString();
  3611. });
  3612. var text = "{" + strList.join(',') + "}";
  3613. if (this.parenthesis) {
  3614. return "(".concat(text, ")");
  3615. } else {
  3616. return text;
  3617. }
  3618. }
  3619. }, {
  3620. key: "subtype",
  3621. get: function get() {
  3622. var element = this.value[0];
  3623. if (element instanceof ArrayLiteral) {
  3624. return element.value[0].type;
  3625. } else {
  3626. return element.type;
  3627. }
  3628. }
  3629. }, {
  3630. key: "lines",
  3631. get: function get() {
  3632. return this.value.length;
  3633. }
  3634. }, {
  3635. key: "columns",
  3636. get: function get() {
  3637. var element = this.value[0];
  3638. if (!(element instanceof ArrayLiteral)) {
  3639. return null;
  3640. } else {
  3641. return element.value.length;
  3642. }
  3643. }
  3644. }, {
  3645. key: "isVector",
  3646. get: function get() {
  3647. return this.columns === null;
  3648. }
  3649. }, {
  3650. key: "isValid",
  3651. get: function get() {
  3652. return this.validateSize() && this.validateType();
  3653. }
  3654. }]);
  3655. return ArrayLiteral;
  3656. }(_literal__WEBPACK_IMPORTED_MODULE_0__["Literal"]);
  3657. /***/ }),
  3658. /***/ "./js/ast/expressions/boolLiteral.js":
  3659. /*!*******************************************!*\
  3660. !*** ./js/ast/expressions/boolLiteral.js ***!
  3661. \*******************************************/
  3662. /*! exports provided: BoolLiteral */
  3663. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3664. "use strict";
  3665. __webpack_require__.r(__webpack_exports__);
  3666. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BoolLiteral", function() { return BoolLiteral; });
  3667. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3668. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3669. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__);
  3670. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  3671. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3672. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3673. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  3674. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  3675. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  3676. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3677. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3678. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3679. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3680. var BoolLiteral =
  3681. /*#__PURE__*/
  3682. function (_Literal) {
  3683. _inherits(BoolLiteral, _Literal);
  3684. function BoolLiteral(value) {
  3685. var _this;
  3686. _classCallCheck(this, BoolLiteral);
  3687. _this = _possibleConstructorReturn(this, _getPrototypeOf(BoolLiteral).call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].BOOLEAN));
  3688. _this.value = value;
  3689. return _this;
  3690. }
  3691. _createClass(BoolLiteral, [{
  3692. key: "toString",
  3693. value: function toString() {
  3694. var text = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__["convertBoolToString"])(this.value);
  3695. if (this.parenthesis) {
  3696. return "(".concat(text, ")");
  3697. } else {
  3698. return text;
  3699. }
  3700. }
  3701. }]);
  3702. return BoolLiteral;
  3703. }(_literal__WEBPACK_IMPORTED_MODULE_0__["Literal"]);
  3704. /***/ }),
  3705. /***/ "./js/ast/expressions/expression.js":
  3706. /*!******************************************!*\
  3707. !*** ./js/ast/expressions/expression.js ***!
  3708. \******************************************/
  3709. /*! exports provided: Expression */
  3710. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3711. "use strict";
  3712. __webpack_require__.r(__webpack_exports__);
  3713. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Expression", function() { return Expression; });
  3714. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3715. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  3716. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  3717. var Expression =
  3718. /*#__PURE__*/
  3719. function () {
  3720. function Expression() {
  3721. _classCallCheck(this, Expression);
  3722. this._sourceInfo = null;
  3723. this._parenthesis = false;
  3724. }
  3725. _createClass(Expression, [{
  3726. key: "sourceInfo",
  3727. set: function set(sourceInfo) {
  3728. this._sourceInfo = sourceInfo;
  3729. },
  3730. get: function get() {
  3731. return this._sourceInfo;
  3732. }
  3733. }, {
  3734. key: "parenthesis",
  3735. set: function set(flag) {
  3736. this._parenthesis = flag;
  3737. },
  3738. get: function get() {
  3739. return this._parenthesis;
  3740. }
  3741. }]);
  3742. return Expression;
  3743. }();
  3744. /***/ }),
  3745. /***/ "./js/ast/expressions/functionCall.js":
  3746. /*!********************************************!*\
  3747. !*** ./js/ast/expressions/functionCall.js ***!
  3748. \********************************************/
  3749. /*! exports provided: FunctionCall */
  3750. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3751. "use strict";
  3752. __webpack_require__.r(__webpack_exports__);
  3753. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return FunctionCall; });
  3754. /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
  3755. /* harmony import */ var _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../processor/definedFunctions */ "./js/processor/definedFunctions.js");
  3756. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3757. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3758. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  3759. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  3760. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  3761. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3762. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3763. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3764. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3765. var FunctionCall =
  3766. /*#__PURE__*/
  3767. function (_Expression) {
  3768. _inherits(FunctionCall, _Expression);
  3769. function FunctionCall(id, actualParameters) {
  3770. var _this;
  3771. _classCallCheck(this, FunctionCall);
  3772. _this = _possibleConstructorReturn(this, _getPrototypeOf(FunctionCall).call(this));
  3773. _this.id = id;
  3774. _this.actualParameters = actualParameters;
  3775. return _this;
  3776. }
  3777. _createClass(FunctionCall, [{
  3778. key: "toString",
  3779. value: function toString() {
  3780. var name = null;
  3781. if (this.isMainCall) {
  3782. name = _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_1__["LanguageDefinedFunction"].getMainFunctionName();
  3783. } else {
  3784. name = _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_1__["LanguageDefinedFunction"].getLocalName(this.id);
  3785. }
  3786. var params = null;
  3787. if (this.actualParameters.length == 0) {
  3788. params = "()";
  3789. } else {
  3790. var strParams = this.actualParameters.map(function (v) {
  3791. return v.toString();
  3792. });
  3793. params = "(" + strParams.join(",") + ")";
  3794. }
  3795. if (this.parenthesis) {
  3796. return "(".concat(name + params, ")");
  3797. } else {
  3798. return name + params;
  3799. }
  3800. }
  3801. }, {
  3802. key: "isMainCall",
  3803. get: function get() {
  3804. return this.id === null;
  3805. }
  3806. }, {
  3807. key: "parametersSize",
  3808. get: function get() {
  3809. return this.actualParameters.length;
  3810. }
  3811. }]);
  3812. return FunctionCall;
  3813. }(_expression__WEBPACK_IMPORTED_MODULE_0__["Expression"]);
  3814. /***/ }),
  3815. /***/ "./js/ast/expressions/index.js":
  3816. /*!*************************************!*\
  3817. !*** ./js/ast/expressions/index.js ***!
  3818. \*************************************/
  3819. /*! exports provided: ArrayAccess, FunctionCall, IntLiteral, RealLiteral, BoolLiteral, StringLiteral, ArrayLiteral, VariableLiteral, InfixApp, UnaryApp */
  3820. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3821. "use strict";
  3822. __webpack_require__.r(__webpack_exports__);
  3823. /* harmony import */ var _arrayAccess__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayAccess */ "./js/ast/expressions/arrayAccess.js");
  3824. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayAccess", function() { return _arrayAccess__WEBPACK_IMPORTED_MODULE_0__["ArrayAccess"]; });
  3825. /* harmony import */ var _functionCall__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functionCall */ "./js/ast/expressions/functionCall.js");
  3826. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return _functionCall__WEBPACK_IMPORTED_MODULE_1__["FunctionCall"]; });
  3827. /* harmony import */ var _intLiteral__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./intLiteral */ "./js/ast/expressions/intLiteral.js");
  3828. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IntLiteral", function() { return _intLiteral__WEBPACK_IMPORTED_MODULE_2__["IntLiteral"]; });
  3829. /* harmony import */ var _realLiteral__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./realLiteral */ "./js/ast/expressions/realLiteral.js");
  3830. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RealLiteral", function() { return _realLiteral__WEBPACK_IMPORTED_MODULE_3__["RealLiteral"]; });
  3831. /* harmony import */ var _boolLiteral__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./boolLiteral */ "./js/ast/expressions/boolLiteral.js");
  3832. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BoolLiteral", function() { return _boolLiteral__WEBPACK_IMPORTED_MODULE_4__["BoolLiteral"]; });
  3833. /* harmony import */ var _stringLiteral__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./stringLiteral */ "./js/ast/expressions/stringLiteral.js");
  3834. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StringLiteral", function() { return _stringLiteral__WEBPACK_IMPORTED_MODULE_5__["StringLiteral"]; });
  3835. /* harmony import */ var _arrayLiteral__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./arrayLiteral */ "./js/ast/expressions/arrayLiteral.js");
  3836. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayLiteral", function() { return _arrayLiteral__WEBPACK_IMPORTED_MODULE_6__["ArrayLiteral"]; });
  3837. /* harmony import */ var _variableLiteral__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./variableLiteral */ "./js/ast/expressions/variableLiteral.js");
  3838. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VariableLiteral", function() { return _variableLiteral__WEBPACK_IMPORTED_MODULE_7__["VariableLiteral"]; });
  3839. /* harmony import */ var _infixApp__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./infixApp */ "./js/ast/expressions/infixApp.js");
  3840. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InfixApp", function() { return _infixApp__WEBPACK_IMPORTED_MODULE_8__["InfixApp"]; });
  3841. /* harmony import */ var _unaryApp__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./unaryApp */ "./js/ast/expressions/unaryApp.js");
  3842. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UnaryApp", function() { return _unaryApp__WEBPACK_IMPORTED_MODULE_9__["UnaryApp"]; });
  3843. /***/ }),
  3844. /***/ "./js/ast/expressions/infixApp.js":
  3845. /*!****************************************!*\
  3846. !*** ./js/ast/expressions/infixApp.js ***!
  3847. \****************************************/
  3848. /*! exports provided: InfixApp */
  3849. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3850. "use strict";
  3851. __webpack_require__.r(__webpack_exports__);
  3852. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InfixApp", function() { return InfixApp; });
  3853. /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
  3854. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3855. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3856. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  3857. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  3858. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  3859. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3860. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3861. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3862. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3863. var InfixApp =
  3864. /*#__PURE__*/
  3865. function (_Expression) {
  3866. _inherits(InfixApp, _Expression);
  3867. function InfixApp(op, left, right) {
  3868. var _this;
  3869. _classCallCheck(this, InfixApp);
  3870. _this = _possibleConstructorReturn(this, _getPrototypeOf(InfixApp).call(this));
  3871. _this.op = op;
  3872. _this.left = left;
  3873. _this.right = right;
  3874. return _this;
  3875. }
  3876. _createClass(InfixApp, [{
  3877. key: "toString",
  3878. value: function toString() {
  3879. var l = this.left.toString();
  3880. var op = this.op.value;
  3881. var r = this.right.toString();
  3882. if (this.parenthesis) {
  3883. return "(".concat(l + op + r, ")");
  3884. } else {
  3885. return l + op + r;
  3886. }
  3887. }
  3888. }]);
  3889. return InfixApp;
  3890. }(_expression__WEBPACK_IMPORTED_MODULE_0__["Expression"]);
  3891. /***/ }),
  3892. /***/ "./js/ast/expressions/intLiteral.js":
  3893. /*!******************************************!*\
  3894. !*** ./js/ast/expressions/intLiteral.js ***!
  3895. \******************************************/
  3896. /*! exports provided: IntLiteral */
  3897. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3898. "use strict";
  3899. __webpack_require__.r(__webpack_exports__);
  3900. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IntLiteral", function() { return IntLiteral; });
  3901. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3902. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3903. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__);
  3904. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  3905. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3906. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3907. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  3908. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  3909. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  3910. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3911. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3912. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3913. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3914. var IntLiteral =
  3915. /*#__PURE__*/
  3916. function (_Literal) {
  3917. _inherits(IntLiteral, _Literal);
  3918. function IntLiteral(value) {
  3919. var _this;
  3920. _classCallCheck(this, IntLiteral);
  3921. _this = _possibleConstructorReturn(this, _getPrototypeOf(IntLiteral).call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER));
  3922. _this.value = value;
  3923. return _this;
  3924. }
  3925. _createClass(IntLiteral, [{
  3926. key: "toString",
  3927. value: function toString() {
  3928. var text = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__["convertToString"])(this.value, this.type);
  3929. if (this.parenthesis) {
  3930. return "(".concat(text, ")");
  3931. } else {
  3932. return text;
  3933. }
  3934. }
  3935. }]);
  3936. return IntLiteral;
  3937. }(_literal__WEBPACK_IMPORTED_MODULE_0__["Literal"]);
  3938. /***/ }),
  3939. /***/ "./js/ast/expressions/literal.js":
  3940. /*!***************************************!*\
  3941. !*** ./js/ast/expressions/literal.js ***!
  3942. \***************************************/
  3943. /*! exports provided: Literal */
  3944. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3945. "use strict";
  3946. __webpack_require__.r(__webpack_exports__);
  3947. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Literal", function() { return Literal; });
  3948. /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
  3949. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3950. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3951. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  3952. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3953. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3954. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3955. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3956. var Literal =
  3957. /*#__PURE__*/
  3958. function (_Expression) {
  3959. _inherits(Literal, _Expression);
  3960. function Literal(type) {
  3961. var _this;
  3962. _classCallCheck(this, Literal);
  3963. _this = _possibleConstructorReturn(this, _getPrototypeOf(Literal).call(this));
  3964. _this.type = type;
  3965. return _this;
  3966. }
  3967. return Literal;
  3968. }(_expression__WEBPACK_IMPORTED_MODULE_0__["Expression"]);
  3969. /***/ }),
  3970. /***/ "./js/ast/expressions/realLiteral.js":
  3971. /*!*******************************************!*\
  3972. !*** ./js/ast/expressions/realLiteral.js ***!
  3973. \*******************************************/
  3974. /*! exports provided: RealLiteral */
  3975. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3976. "use strict";
  3977. __webpack_require__.r(__webpack_exports__);
  3978. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RealLiteral", function() { return RealLiteral; });
  3979. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  3980. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  3981. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__);
  3982. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  3983. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3984. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3985. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  3986. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  3987. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  3988. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3989. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  3990. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  3991. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  3992. var RealLiteral =
  3993. /*#__PURE__*/
  3994. function (_Literal) {
  3995. _inherits(RealLiteral, _Literal);
  3996. function RealLiteral(value) {
  3997. var _this;
  3998. _classCallCheck(this, RealLiteral);
  3999. _this = _possibleConstructorReturn(this, _getPrototypeOf(RealLiteral).call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL));
  4000. _this.value = value;
  4001. return _this;
  4002. }
  4003. _createClass(RealLiteral, [{
  4004. key: "toString",
  4005. value: function toString() {
  4006. var text = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__["convertToString"])(this.value, this.type);
  4007. if (this.parenthesis) {
  4008. return "(".concat(text, ")");
  4009. } else {
  4010. return text;
  4011. }
  4012. }
  4013. }]);
  4014. return RealLiteral;
  4015. }(_literal__WEBPACK_IMPORTED_MODULE_0__["Literal"]);
  4016. /***/ }),
  4017. /***/ "./js/ast/expressions/stringLiteral.js":
  4018. /*!*********************************************!*\
  4019. !*** ./js/ast/expressions/stringLiteral.js ***!
  4020. \*********************************************/
  4021. /*! exports provided: StringLiteral */
  4022. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4023. "use strict";
  4024. __webpack_require__.r(__webpack_exports__);
  4025. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StringLiteral", function() { return StringLiteral; });
  4026. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  4027. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  4028. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__);
  4029. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  4030. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4031. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  4032. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  4033. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  4034. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  4035. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  4036. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  4037. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  4038. var StringLiteral =
  4039. /*#__PURE__*/
  4040. function (_Literal) {
  4041. _inherits(StringLiteral, _Literal);
  4042. function StringLiteral(value) {
  4043. var _this;
  4044. _classCallCheck(this, StringLiteral);
  4045. _this = _possibleConstructorReturn(this, _getPrototypeOf(StringLiteral).call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING));
  4046. _this.value = value;
  4047. return _this;
  4048. }
  4049. _createClass(StringLiteral, [{
  4050. key: "toString",
  4051. value: function toString() {
  4052. var text = '"' + this.value + '"';
  4053. if (this.parenthesis) {
  4054. return "(".concat(text, ")");
  4055. } else {
  4056. return text;
  4057. }
  4058. }
  4059. }]);
  4060. return StringLiteral;
  4061. }(_literal__WEBPACK_IMPORTED_MODULE_0__["Literal"]);
  4062. /***/ }),
  4063. /***/ "./js/ast/expressions/unaryApp.js":
  4064. /*!****************************************!*\
  4065. !*** ./js/ast/expressions/unaryApp.js ***!
  4066. \****************************************/
  4067. /*! exports provided: UnaryApp */
  4068. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4069. "use strict";
  4070. __webpack_require__.r(__webpack_exports__);
  4071. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnaryApp", function() { return UnaryApp; });
  4072. /* harmony import */ var _infixApp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./infixApp */ "./js/ast/expressions/infixApp.js");
  4073. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  4074. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4075. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  4076. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  4077. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  4078. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  4079. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  4080. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  4081. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  4082. var UnaryApp =
  4083. /*#__PURE__*/
  4084. function (_InfixApp) {
  4085. _inherits(UnaryApp, _InfixApp);
  4086. function UnaryApp(op, left) {
  4087. _classCallCheck(this, UnaryApp);
  4088. return _possibleConstructorReturn(this, _getPrototypeOf(UnaryApp).call(this, op, left, null));
  4089. }
  4090. _createClass(UnaryApp, [{
  4091. key: "toString",
  4092. value: function toString() {
  4093. var l = this.left.toString();
  4094. var op = this.op.value;
  4095. if (this.parenthesis) {
  4096. return "(".concat(op + l, ")");
  4097. } else {
  4098. return op + l;
  4099. }
  4100. }
  4101. }]);
  4102. return UnaryApp;
  4103. }(_infixApp__WEBPACK_IMPORTED_MODULE_0__["InfixApp"]);
  4104. /***/ }),
  4105. /***/ "./js/ast/expressions/variableLiteral.js":
  4106. /*!***********************************************!*\
  4107. !*** ./js/ast/expressions/variableLiteral.js ***!
  4108. \***********************************************/
  4109. /*! exports provided: VariableLiteral */
  4110. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4111. "use strict";
  4112. __webpack_require__.r(__webpack_exports__);
  4113. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VariableLiteral", function() { return VariableLiteral; });
  4114. /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
  4115. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  4116. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__);
  4117. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  4118. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4119. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  4120. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  4121. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  4122. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  4123. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  4124. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  4125. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  4126. var VariableLiteral =
  4127. /*#__PURE__*/
  4128. function (_Literal) {
  4129. _inherits(VariableLiteral, _Literal);
  4130. function VariableLiteral(id) {
  4131. var _this;
  4132. _classCallCheck(this, VariableLiteral);
  4133. _this = _possibleConstructorReturn(this, _getPrototypeOf(VariableLiteral).call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].UNDEFINED));
  4134. _this.id = id;
  4135. return _this;
  4136. }
  4137. _createClass(VariableLiteral, [{
  4138. key: "toString",
  4139. value: function toString() {
  4140. if (this.parenthesis) {
  4141. return "(".concat(this.id, ")");
  4142. } else {
  4143. return this.id;
  4144. }
  4145. }
  4146. }]);
  4147. return VariableLiteral;
  4148. }(_literal__WEBPACK_IMPORTED_MODULE_0__["Literal"]);
  4149. /***/ }),
  4150. /***/ "./js/ast/ivprogParser.js":
  4151. /*!********************************!*\
  4152. !*** ./js/ast/ivprogParser.js ***!
  4153. \********************************/
  4154. /*! exports provided: IVProgParser */
  4155. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4156. "use strict";
  4157. __webpack_require__.r(__webpack_exports__);
  4158. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IVProgParser", function() { return IVProgParser; });
  4159. /* harmony import */ var antlr4_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! antlr4/index */ "./node_modules/antlr4/index.js");
  4160. /* harmony import */ var antlr4_index__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(antlr4_index__WEBPACK_IMPORTED_MODULE_0__);
  4161. /* harmony import */ var _expressions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./expressions */ "./js/ast/expressions/index.js");
  4162. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commands */ "./js/ast/commands/index.js");
  4163. /* harmony import */ var _ast_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ast_helpers */ "./js/ast/ast_helpers.js");
  4164. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  4165. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../typeSystem/types */ "./js/typeSystem/types.ts");
  4166. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__);
  4167. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  4168. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_6__);
  4169. /* harmony import */ var _sourceInfo__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./sourceInfo */ "./js/ast/sourceInfo.js");
  4170. /* harmony import */ var _operators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./operators */ "./js/ast/operators.js");
  4171. /* harmony import */ var _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./error/syntaxErrorFactory */ "./js/ast/error/syntaxErrorFactory.js");
  4172. /* harmony import */ var _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../processor/definedFunctions */ "./js/processor/definedFunctions.js");
  4173. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../services/languageService */ "./js/services/languageService.js");
  4174. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4175. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  4176. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  4177. var IVProgParser =
  4178. /*#__PURE__*/
  4179. function () {
  4180. _createClass(IVProgParser, null, [{
  4181. key: "createParser",
  4182. value: function createParser(input) {
  4183. var lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_11__["LanguageService"].getCurrentLexer();
  4184. return new IVProgParser(input, lexerClass);
  4185. } // <BEGIN scope consts>
  4186. }, {
  4187. key: "BASE",
  4188. get: function get() {
  4189. return 0;
  4190. }
  4191. }, {
  4192. key: "FUNCTION",
  4193. get: function get() {
  4194. return 1;
  4195. }
  4196. }, {
  4197. key: "COMMAND",
  4198. get: function get() {
  4199. return 2;
  4200. }
  4201. }, {
  4202. key: "BREAKABLE",
  4203. get: function get() {
  4204. return 4;
  4205. } // </ END scope consts>
  4206. }]);
  4207. function IVProgParser(input, lexerClass) {
  4208. _classCallCheck(this, IVProgParser);
  4209. this.lexerClass = lexerClass;
  4210. this.inputStream = new antlr4_index__WEBPACK_IMPORTED_MODULE_0__["InputStream"](input);
  4211. this.lexer = new lexerClass(this.inputStream);
  4212. this.lexer.recover = _ast_helpers__WEBPACK_IMPORTED_MODULE_3__["recover"].bind(this.lexer);
  4213. this.tokenStream = new antlr4_index__WEBPACK_IMPORTED_MODULE_0__["CommonTokenStream"](this.lexer);
  4214. this.tokenStream.fill();
  4215. this.pos = 1;
  4216. this.variableTypes = [this.lexerClass.RK_INTEGER, this.lexerClass.RK_REAL, this.lexerClass.RK_BOOLEAN, this.lexerClass.RK_STRING];
  4217. this.functionTypes = this.variableTypes.concat(this.lexerClass.RK_VOID);
  4218. this.parsingArrayDimension = 0;
  4219. this.scope = [];
  4220. this.langFuncs = _services_languageService__WEBPACK_IMPORTED_MODULE_11__["LanguageService"].getCurrentLangFuncs();
  4221. this.definedFuncsNameList = [];
  4222. this.definedVariablesStack = [];
  4223. }
  4224. _createClass(IVProgParser, [{
  4225. key: "parseTree",
  4226. value: function parseTree() {
  4227. return this.parseProgram();
  4228. }
  4229. }, {
  4230. key: "getToken",
  4231. value: function getToken() {
  4232. var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.pos;
  4233. // if(index === null)
  4234. // index = this.pos;
  4235. return this.tokenStream.LT(index);
  4236. }
  4237. }, {
  4238. key: "insideScope",
  4239. value: function insideScope(scope) {
  4240. if (this.scope.length <= 0) {
  4241. return IVProgParser.BASE === scope;
  4242. } else {
  4243. return this.scope[this.scope.length - 1] === scope;
  4244. }
  4245. }
  4246. }, {
  4247. key: "pushScope",
  4248. value: function pushScope(scope) {
  4249. this.scope.push(scope);
  4250. }
  4251. }, {
  4252. key: "pushVariableStack",
  4253. value: function pushVariableStack() {
  4254. this.definedVariablesStack.push([]);
  4255. }
  4256. }, {
  4257. key: "popScope",
  4258. value: function popScope() {
  4259. return this.scope.pop();
  4260. }
  4261. }, {
  4262. key: "popVariableStack",
  4263. value: function popVariableStack() {
  4264. return this.definedVariablesStack.pop();
  4265. }
  4266. }, {
  4267. key: "getCurrentVariableStack",
  4268. value: function getCurrentVariableStack() {
  4269. return this.definedVariablesStack[this.definedVariablesStack.length - 1];
  4270. }
  4271. }, {
  4272. key: "isEOF",
  4273. value: function isEOF() {
  4274. this.getToken(this.pos);
  4275. return this.tokenStream.fetchedEOF;
  4276. }
  4277. }, {
  4278. key: "parseProgram",
  4279. value: function parseProgram() {
  4280. this.consumeNewLines();
  4281. var token = this.getToken();
  4282. var globalVars = [];
  4283. var functions = [];
  4284. if (this.lexerClass.RK_PROGRAM === token.type) {
  4285. this.pos++;
  4286. this.consumeNewLines();
  4287. this.checkOpenCurly();
  4288. this.pos++;
  4289. this.pushVariableStack();
  4290. for (;;) {
  4291. this.consumeNewLines();
  4292. var _token = this.getToken();
  4293. if (_token.type === this.lexerClass.RK_CONST || this.isVariableType(_token)) {
  4294. globalVars = globalVars.concat(this.parseGlobalVariables());
  4295. } else if (_token.type === this.lexerClass.RK_FUNCTION) {
  4296. this.pushVariableStack();
  4297. functions = functions.concat(this.parseFunction());
  4298. this.popVariableStack();
  4299. } else {
  4300. break;
  4301. }
  4302. }
  4303. this.consumeNewLines();
  4304. this.checkCloseCurly();
  4305. this.pos++;
  4306. this.consumeNewLines();
  4307. if (!this.isEOF()) {
  4308. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].extra_lines();
  4309. }
  4310. this.popVariableStack();
  4311. return {
  4312. global: globalVars,
  4313. functions: functions
  4314. };
  4315. } else {
  4316. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].token_missing_one(this.lexer.literalNames[this.lexerClass.RK_PROGRAM], token);
  4317. }
  4318. }
  4319. }, {
  4320. key: "checkOpenCurly",
  4321. value: function checkOpenCurly() {
  4322. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4323. var token = this.getToken();
  4324. if (this.lexerClass.OPEN_CURLY !== token.type) {
  4325. if (!attempt) throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].token_missing_one('{', token);else return false;
  4326. }
  4327. return true;
  4328. }
  4329. }, {
  4330. key: "checkCloseCurly",
  4331. value: function checkCloseCurly() {
  4332. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4333. var token = this.getToken();
  4334. if (this.lexerClass.CLOSE_CURLY !== token.type) {
  4335. if (!attempt) throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].token_missing_one('}', token);else return false;
  4336. }
  4337. return true;
  4338. }
  4339. /* It checks if the current token at position pos is a ']'.
  4340. * As a check function it doesn't increment pos.
  4341. *
  4342. * @params bool:attempt, indicates that the token is optional. Defaults: false
  4343. *
  4344. * @returns true if the attempt is true and current token is '[',
  4345. * false is attempt is true and current token is not '['
  4346. **/
  4347. }, {
  4348. key: "checkOpenBrace",
  4349. value: function checkOpenBrace() {
  4350. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4351. var token = this.getToken();
  4352. if (this.lexerClass.OPEN_BRACE !== token.type) {
  4353. if (!attempt) {
  4354. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].token_missing_one('[', token);
  4355. } else {
  4356. return false;
  4357. }
  4358. }
  4359. return true;
  4360. }
  4361. }, {
  4362. key: "checkCloseBrace",
  4363. value: function checkCloseBrace() {
  4364. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4365. var token = this.getToken();
  4366. if (this.lexerClass.CLOSE_BRACE !== token.type) {
  4367. if (!attempt) {
  4368. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].token_missing_one(']', token);
  4369. } else {
  4370. return false;
  4371. }
  4372. }
  4373. return true;
  4374. }
  4375. }, {
  4376. key: "checkOpenParenthesis",
  4377. value: function checkOpenParenthesis() {
  4378. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4379. var token = this.getToken();
  4380. if (this.lexerClass.OPEN_PARENTHESIS !== token.type) {
  4381. if (!attempt) {
  4382. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].token_missing_one('(', token);
  4383. } else {
  4384. return false;
  4385. }
  4386. }
  4387. return true;
  4388. }
  4389. }, {
  4390. key: "checkCloseParenthesis",
  4391. value: function checkCloseParenthesis() {
  4392. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4393. var token = this.getToken();
  4394. if (this.lexerClass.CLOSE_PARENTHESIS !== token.type) {
  4395. if (!attempt) {
  4396. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].token_missing_one(')', token);
  4397. } else {
  4398. return false;
  4399. }
  4400. }
  4401. return true;
  4402. }
  4403. }, {
  4404. key: "checkEOS",
  4405. value: function checkEOS() {
  4406. var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4407. var eosToken = this.getToken();
  4408. if (eosToken.type !== this.lexerClass.EOS) {
  4409. if (!attempt) throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].eos_missing(eosToken);else return false;
  4410. }
  4411. return true;
  4412. }
  4413. }, {
  4414. key: "checkFunctionDuplicate",
  4415. value: function checkFunctionDuplicate(functionID, funcIDToken) {
  4416. var id = functionID === null ? "$main" : functionID;
  4417. var index = this.definedFuncsNameList.indexOf(id);
  4418. if (index !== -1) {
  4419. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].duplicate_function(funcIDToken);
  4420. }
  4421. this.definedFuncsNameList.push(id);
  4422. }
  4423. }, {
  4424. key: "checkVariableDuplicate",
  4425. value: function checkVariableDuplicate(variableID, sourceInfo) {
  4426. var index = this.getCurrentVariableStack().indexOf(variableID);
  4427. if (index !== -1) {
  4428. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].duplicate_variable(sourceInfo);
  4429. }
  4430. this.getCurrentVariableStack().push(variableID);
  4431. }
  4432. }, {
  4433. key: "consumeForSemiColon",
  4434. value: function consumeForSemiColon() {
  4435. var eosToken = this.getToken();
  4436. if (eosToken.type === this.lexerClass.EOS && eosToken.text.match(';')) {
  4437. this.pos++;
  4438. return;
  4439. }
  4440. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].token_missing_one(';', eosToken);
  4441. }
  4442. }, {
  4443. key: "parseGlobalVariables",
  4444. value: function parseGlobalVariables() {
  4445. var decl = this.parseMaybeConst();
  4446. this.checkEOS();
  4447. this.pos++;
  4448. return decl;
  4449. }
  4450. /*
  4451. * Checks if the next token is PR_CONST. It's only available
  4452. * at global variables declaration level
  4453. * @returns Declararion(const, type, id, initVal?)
  4454. **/
  4455. }, {
  4456. key: "parseMaybeConst",
  4457. value: function parseMaybeConst() {
  4458. var constToken = this.getToken();
  4459. if (constToken.type === this.lexerClass.RK_CONST) {
  4460. this.pos++;
  4461. var typeString = this.parseType();
  4462. return this.parseDeclaration(typeString, true);
  4463. } else if (this.isVariableType(constToken)) {
  4464. var _typeString = this.parseType();
  4465. return this.parseDeclaration(_typeString);
  4466. } else {
  4467. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].token_missing_list([this.lexer.literalNames[this.lexerClass.RK_CONST]].concat(this.getTypeArray()), constToken);
  4468. }
  4469. }
  4470. /*
  4471. * Parses a declarion of the form: type --- id --- (= --- EAnd)?
  4472. * @returns a list of Declararion(const, type, id, initVal?)
  4473. **/
  4474. }, {
  4475. key: "parseDeclaration",
  4476. value: function parseDeclaration(typeString) {
  4477. var isConst = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  4478. var initial = null;
  4479. var dim1 = null;
  4480. var dim2 = null;
  4481. var dimensions = 0;
  4482. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(this.getToken());
  4483. var idString = this.parseID();
  4484. this.checkVariableDuplicate(idString, sourceInfo); // Check for array or vector
  4485. // ID[int/IDi?][int/IDj?]
  4486. if (this.checkOpenBrace(true)) {
  4487. this.pos += 1;
  4488. this.consumeNewLines();
  4489. dim1 = this.parseArrayDimension();
  4490. this.consumeNewLines();
  4491. this.checkCloseBrace();
  4492. this.pos += 1;
  4493. dimensions += 1;
  4494. if (this.checkOpenBrace(true)) {
  4495. this.pos += 1;
  4496. this.consumeNewLines();
  4497. dim2 = this.parseArrayDimension();
  4498. this.consumeNewLines();
  4499. this.checkCloseBrace();
  4500. this.pos += 1;
  4501. dimensions += 1;
  4502. }
  4503. return this.parseArrayDeclaration(typeString, isConst, idString, sourceInfo, dimensions, dim1, dim2);
  4504. } else {
  4505. var equalsToken = this.getToken();
  4506. if (isConst && equalsToken.type !== this.lexerClass.EQUAL) {
  4507. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].const_not_init(sourceInfo);
  4508. }
  4509. if (equalsToken.type === this.lexerClass.EQUAL) {
  4510. this.pos++;
  4511. initial = this.parseExpressionOR();
  4512. }
  4513. var declaration = new _commands__WEBPACK_IMPORTED_MODULE_2__["Declaration"](idString, typeString, initial, isConst);
  4514. declaration.sourceInfo = sourceInfo;
  4515. var commaToken = this.getToken();
  4516. if (commaToken.type === this.lexerClass.COMMA) {
  4517. this.pos++;
  4518. this.consumeNewLines();
  4519. return [declaration].concat(this.parseDeclaration(typeString, isConst));
  4520. } else {
  4521. return [declaration];
  4522. }
  4523. }
  4524. }
  4525. }, {
  4526. key: "parseArrayDeclaration",
  4527. value: function parseArrayDeclaration(typeString, isConst, idString, sourceInfo, dimensions, dim1, dim2) {
  4528. var equalsToken = this.getToken();
  4529. var n_lines = dim1;
  4530. var n_columns = dim2;
  4531. var initial = null;
  4532. var dim_is_id = false;
  4533. if (dim1 instanceof _expressions__WEBPACK_IMPORTED_MODULE_1__["VariableLiteral"] || dim2 instanceof _expressions__WEBPACK_IMPORTED_MODULE_1__["VariableLiteral"]) {
  4534. dim_is_id = true;
  4535. if (dimensions > 1 && (dim1 == null || dim2 == null)) {
  4536. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].invalid_matrix_id_dimension(_sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(equalsToken));
  4537. }
  4538. }
  4539. if (isConst && equalsToken.type !== this.lexerClass.EQUAL) {
  4540. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].const_not_init(sourceInfo);
  4541. }
  4542. if (equalsToken.type === this.lexerClass.EQUAL) {
  4543. if (dim_is_id) {
  4544. if (dimensions == 1) {
  4545. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].invalid_vector_init(_sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(equalsToken));
  4546. } else {
  4547. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].invalid_matrix_init(_sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(equalsToken));
  4548. }
  4549. }
  4550. this.pos += 1;
  4551. initial = this.parseArrayLiteral(typeString);
  4552. }
  4553. if (initial == null && dim1 == null) {
  4554. if (dimensions > 1) {
  4555. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].cannot_infer_matrix_line(idString, sourceInfo);
  4556. }
  4557. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].cannot_infer_vector_size(idString, sourceInfo);
  4558. }
  4559. if (dimensions > 1) {
  4560. if (initial == null && dim2 == null) {
  4561. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].cannot_infer_matrix_column(idString, sourceInfo);
  4562. }
  4563. }
  4564. if (dimensions === 1 && initial != null && !initial.isVector) {
  4565. var expString = initial.toString();
  4566. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].matrix_to_vector_literal_attr(idString, expString, initial.sourceInfo);
  4567. } else if (dimensions > 1 && initial != null && initial.isVector) {
  4568. var _expString = initial.toString();
  4569. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].vector_to_matrix_literal_attr(idString, _expString, initial.sourceInfo);
  4570. }
  4571. if (dim1 == null) {
  4572. n_lines = new _expressions__WEBPACK_IMPORTED_MODULE_1__["IntLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toInt"])(initial.lines));
  4573. n_lines.sourceInfo = sourceInfo;
  4574. }
  4575. if (dimensions > 1) {
  4576. if (dim2 == null) {
  4577. n_columns = new _expressions__WEBPACK_IMPORTED_MODULE_1__["IntLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toInt"])(initial.columns));
  4578. n_columns.sourceInfo = sourceInfo;
  4579. }
  4580. }
  4581. var declaration = new _commands__WEBPACK_IMPORTED_MODULE_2__["ArrayDeclaration"](idString, new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_6__["ArrayType"](typeString, dimensions), n_lines, n_columns, initial, isConst);
  4582. declaration.sourceInfo = sourceInfo;
  4583. var commaToken = this.getToken();
  4584. if (commaToken.type === this.lexerClass.COMMA) {
  4585. this.pos++;
  4586. this.consumeNewLines();
  4587. return [declaration].concat(this.parseDeclaration(typeString, isConst));
  4588. } else {
  4589. return [declaration];
  4590. }
  4591. }
  4592. }, {
  4593. key: "consumeNewLines",
  4594. value: function consumeNewLines() {
  4595. var token = this.getToken();
  4596. while (token.type === this.lexerClass.EOS && token.text.match('[\r\n]+')) {
  4597. this.pos++;
  4598. token = this.getToken();
  4599. }
  4600. }
  4601. }, {
  4602. key: "isVariableType",
  4603. value: function isVariableType(token) {
  4604. return this.variableTypes.find(function (v) {
  4605. return v === token.type;
  4606. });
  4607. }
  4608. /*
  4609. * Reads the next token of the stream to check if it is a Integer or an ID.
  4610. * @returns Integer | ID
  4611. **/
  4612. }, {
  4613. key: "parseArrayDimension",
  4614. value: function parseArrayDimension() {
  4615. var dimToken = this.getToken();
  4616. if (dimToken.type === this.lexerClass.INTEGER) {
  4617. //parse as int literal
  4618. this.pos++;
  4619. return this.getIntLiteral(dimToken);
  4620. } else if (dimToken.type === this.lexerClass.ID) {
  4621. //parse as variable
  4622. this.pos++;
  4623. return this.parseVariable(dimToken);
  4624. } else if (dimToken.type === this.lexerClass.CLOSE_BRACE) {
  4625. return null;
  4626. } else {
  4627. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].invalid_array_dimension(this.lexer.literalNames[this.lexerClass.RK_INTEGER], dimToken);
  4628. }
  4629. }
  4630. /*
  4631. * Returns an object {type: 'int', value: value}.
  4632. * It checks for binary and hexadecimal integers.
  4633. * @returns object with fields type and value
  4634. **/
  4635. }, {
  4636. key: "getIntLiteral",
  4637. value: function getIntLiteral(token) {
  4638. var text = token.text;
  4639. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(token);
  4640. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_1__["IntLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toInt"])(text));
  4641. exp.sourceInfo = sourceInfo;
  4642. return exp;
  4643. }
  4644. }, {
  4645. key: "getRealLiteral",
  4646. value: function getRealLiteral(token) {
  4647. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(token);
  4648. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_1__["RealLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toReal"])(token.text));
  4649. exp.sourceInfo = sourceInfo;
  4650. return exp;
  4651. }
  4652. }, {
  4653. key: "getStringLiteral",
  4654. value: function getStringLiteral(token) {
  4655. var text = token.text;
  4656. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(token);
  4657. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_1__["StringLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toString"])(text));
  4658. exp.sourceInfo = sourceInfo;
  4659. return exp;
  4660. }
  4661. }, {
  4662. key: "getBoolLiteral",
  4663. value: function getBoolLiteral(token) {
  4664. var val = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toBool"])(token.text);
  4665. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_1__["BoolLiteral"](val);
  4666. exp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(token);
  4667. return exp;
  4668. }
  4669. }, {
  4670. key: "parseArrayLiteral",
  4671. value: function parseArrayLiteral(typeString) {
  4672. var openCurly = this.checkOpenCurly(true);
  4673. if (!openCurly) {
  4674. var invalid_token = this.getToken();
  4675. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].array_init_not_literal(_sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(invalid_token));
  4676. }
  4677. var beginArray = this.getToken();
  4678. if (this.parsingArrayDimension >= 2) {
  4679. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].array_exceeds_2d(_sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(beginArray));
  4680. }
  4681. this.pos += 1;
  4682. this.parsingArrayDimension += 1;
  4683. this.consumeNewLines();
  4684. var data = null;
  4685. var maybeCurlyOpen = this.checkOpenCurly(true);
  4686. if (maybeCurlyOpen) {
  4687. // This is potentially a list of vectors
  4688. data = this.parseVectorList(typeString);
  4689. } else {
  4690. data = this.parseExpressionList();
  4691. }
  4692. this.consumeNewLines();
  4693. this.checkCloseCurly();
  4694. var endArray = this.getToken();
  4695. this.pos += 1;
  4696. this.parsingArrayDimension -= 1;
  4697. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfoFromList(beginArray, endArray);
  4698. var dataDim = 1;
  4699. if (data[0] instanceof _expressions__WEBPACK_IMPORTED_MODULE_1__["ArrayLiteral"]) {
  4700. dataDim += 1;
  4701. } else if (data.length == 1) {
  4702. console.log("Talvez uma variável seja uma melhor opção");
  4703. }
  4704. var type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_6__["ArrayType"](typeString, dataDim);
  4705. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_1__["ArrayLiteral"](type, data);
  4706. exp.sourceInfo = sourceInfo;
  4707. return exp;
  4708. }
  4709. /**
  4710. * Returns a list of ArrayLiterals. Helper function for parsing matrices
  4711. */
  4712. }, {
  4713. key: "parseVectorList",
  4714. value: function parseVectorList(typeString) {
  4715. var list = [];
  4716. var lastSize = null;
  4717. for (;;) {
  4718. this.checkOpenCurly();
  4719. var beginArray = this.getToken();
  4720. if (this.parsingArrayDimension >= 2) {
  4721. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].array_exceeds_2d(_sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(beginArray));
  4722. }
  4723. this.pos += 1;
  4724. this.parsingArrayDimension += 1;
  4725. this.consumeNewLines();
  4726. var data = this.parseExpressionList();
  4727. this.consumeNewLines();
  4728. this.checkCloseCurly();
  4729. var endArray = this.getToken();
  4730. this.pos += 1;
  4731. this.parsingArrayDimension -= 1;
  4732. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfoFromList(beginArray, endArray);
  4733. if (lastSize == null) {
  4734. lastSize = data.length;
  4735. } else if (lastSize !== data.length) {
  4736. var expString = this.inputStream.getText(beginArray.start, endArray.stop);
  4737. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].invalid_matrix_literal_line(expString, sourceInfo);
  4738. }
  4739. var type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_6__["ArrayType"](typeString, 1);
  4740. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_1__["ArrayLiteral"](type, data);
  4741. exp.sourceInfo = sourceInfo;
  4742. list.push(exp);
  4743. var commaToken = this.getToken();
  4744. if (commaToken.type !== this.lexerClass.COMMA) {
  4745. break;
  4746. }
  4747. this.pos += 1;
  4748. this.consumeNewLines();
  4749. }
  4750. if (list.length == 1) {
  4751. console.log("Talvez um vetor seja uma melhor opção");
  4752. }
  4753. return list;
  4754. }
  4755. /*
  4756. * Returns an object {type: 'variable', value: value}.
  4757. * @returns object with fields type and value
  4758. **/
  4759. }, {
  4760. key: "parseVariable",
  4761. value: function parseVariable(token) {
  4762. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(token);
  4763. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_1__["VariableLiteral"](token.text);
  4764. exp.sourceInfo = sourceInfo;
  4765. return exp;
  4766. }
  4767. /*
  4768. * Returns an object representing a function. It has
  4769. * four attributes: returnType, id, formalParams and block.
  4770. * The block object has two attributes: declarations and commands
  4771. **/
  4772. }, {
  4773. key: "parseFunction",
  4774. value: function parseFunction() {
  4775. this.pushScope(IVProgParser.FUNCTION);
  4776. var formalParams = [];
  4777. var token = this.getToken();
  4778. if (token.type !== this.lexerClass.RK_FUNCTION) {
  4779. //throw SyntaxError.createError(this.lexer.literalNames[this.lexerClass.PR_FUNCAO], token);
  4780. return null;
  4781. }
  4782. this.pos++;
  4783. var funType = this.parseType();
  4784. var dimensions = 0;
  4785. if (this.checkOpenBrace(true)) {
  4786. this.pos++;
  4787. this.checkCloseBrace();
  4788. this.pos++;
  4789. dimensions++;
  4790. if (this.checkOpenBrace(true)) {
  4791. this.pos++;
  4792. this.checkCloseBrace();
  4793. this.pos++;
  4794. dimensions++;
  4795. }
  4796. }
  4797. var funcIDToken = this.getToken();
  4798. var functionID = this.parseID();
  4799. this.checkFunctionDuplicate(functionID, funcIDToken);
  4800. this.checkOpenParenthesis();
  4801. this.pos++;
  4802. this.consumeNewLines();
  4803. if (!this.checkCloseParenthesis(true)) {
  4804. formalParams = this.parseFormalParameters(); // formal parameters
  4805. this.consumeNewLines();
  4806. this.checkCloseParenthesis();
  4807. this.pos++;
  4808. } else {
  4809. this.pos++;
  4810. }
  4811. this.consumeNewLines();
  4812. var commandsBlock = this.parseCommandBlock();
  4813. var returnType = funType;
  4814. if (dimensions > 0) {
  4815. returnType = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_6__["ArrayType"](funType, dimensions);
  4816. }
  4817. var func = new _commands__WEBPACK_IMPORTED_MODULE_2__["Function"](functionID, returnType, formalParams, commandsBlock);
  4818. if (functionID === null && !func.isMain) {
  4819. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].invalid_main_return(_processor_definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName(), this.lexer.literalNames[this.lexerClass.RK_VOID], token.line);
  4820. } else if (func.isMain && formalParams.length !== 0) {
  4821. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].main_parameters();
  4822. }
  4823. this.popScope();
  4824. return func;
  4825. }
  4826. /*
  4827. * Parse the formal parameters of a function.
  4828. * @returns a list of objects with the following attributes: type, id and dimensions.
  4829. **/
  4830. }, {
  4831. key: "parseFormalParameters",
  4832. value: function parseFormalParameters() {
  4833. var list = [];
  4834. for (;;) {
  4835. var dimensions = 0;
  4836. var reference = false;
  4837. var typeString = this.parseType();
  4838. var maybeIDToken = this.getToken();
  4839. if (maybeIDToken.type === this.lexerClass.RK_REFERENCE) {
  4840. reference = true;
  4841. this.pos += 1;
  4842. maybeIDToken = this.getToken();
  4843. }
  4844. var idString = this.parseID();
  4845. this.checkVariableDuplicate(idString, maybeIDToken);
  4846. if (this.checkOpenBrace(true)) {
  4847. this.pos += 1;
  4848. dimensions += 1;
  4849. this.checkCloseBrace();
  4850. this.pos += 1;
  4851. if (this.checkOpenBrace(true)) {
  4852. this.pos += 1;
  4853. dimensions += 1;
  4854. this.checkCloseBrace();
  4855. this.pos += 1;
  4856. }
  4857. }
  4858. var type = null;
  4859. if (dimensions > 0) {
  4860. type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_6__["ArrayType"](typeString, dimensions);
  4861. } else {
  4862. type = typeString;
  4863. }
  4864. var parameter = new _commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](type, idString, reference);
  4865. parameter.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(maybeIDToken);
  4866. list.push(parameter);
  4867. var commaToken = this.getToken();
  4868. if (commaToken.type !== this.lexerClass.COMMA) break;
  4869. this.pos++;
  4870. this.consumeNewLines();
  4871. }
  4872. return list;
  4873. }
  4874. }, {
  4875. key: "parseID",
  4876. value: function parseID() {
  4877. var token = this.getToken();
  4878. if (token.type !== this.lexerClass.ID) {
  4879. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].id_missing(token);
  4880. }
  4881. this.pos++;
  4882. if (this.insideScope(IVProgParser.FUNCTION)) {
  4883. if (token.text === _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName()) {
  4884. return null;
  4885. }
  4886. }
  4887. return token.text;
  4888. }
  4889. }, {
  4890. key: "parseMaybeLibID",
  4891. value: function parseMaybeLibID() {
  4892. var token = this.getToken();
  4893. if (token.type !== this.lexerClass.ID && token.type !== this.lexerClass.LIB_ID) {
  4894. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].id_missing(token);
  4895. }
  4896. this.pos++;
  4897. return token.text;
  4898. }
  4899. }, {
  4900. key: "parseType",
  4901. value: function parseType() {
  4902. var token = this.getToken();
  4903. if (token.type === this.lexerClass.ID && this.insideScope(IVProgParser.FUNCTION)) {
  4904. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].VOID;
  4905. } else if (token.type === this.lexerClass.RK_VOID && this.insideScope(IVProgParser.FUNCTION)) {
  4906. this.pos++;
  4907. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].VOID;
  4908. } else if (this.isVariableType(token)) {
  4909. this.pos++;
  4910. switch (token.type) {
  4911. case this.lexerClass.RK_INTEGER:
  4912. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].INTEGER;
  4913. case this.lexerClass.RK_BOOLEAN:
  4914. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].BOOLEAN;
  4915. case this.lexerClass.RK_REAL:
  4916. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].REAL;
  4917. case this.lexerClass.RK_STRING:
  4918. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].STRING;
  4919. default:
  4920. break;
  4921. }
  4922. }
  4923. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].invalid_type(this.getTypeArray(), token);
  4924. }
  4925. }, {
  4926. key: "parseCommandBlock",
  4927. value: function parseCommandBlock() {
  4928. var optionalCurly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  4929. var variablesDecl = [];
  4930. var commands = [];
  4931. var hasOpen = false;
  4932. if (this.checkOpenCurly(optionalCurly)) {
  4933. this.pos++;
  4934. hasOpen = true;
  4935. }
  4936. this.consumeNewLines();
  4937. var parsedCommand = false;
  4938. for (;;) {
  4939. var cmd = this.parseCommand();
  4940. if (cmd === null) break;
  4941. if (cmd !== -1) {
  4942. if (cmd instanceof Array) {
  4943. if (parsedCommand) {
  4944. var lastToken = this.getToken(this.pos - 1);
  4945. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].invalid_var_declaration(lastToken);
  4946. }
  4947. variablesDecl = variablesDecl.concat(cmd);
  4948. } else {
  4949. parsedCommand = true;
  4950. commands.push(cmd);
  4951. }
  4952. }
  4953. }
  4954. this.consumeNewLines();
  4955. if (hasOpen) {
  4956. this.checkCloseCurly();
  4957. this.pos++;
  4958. this.consumeNewLines();
  4959. }
  4960. return new _commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"](variablesDecl, commands);
  4961. }
  4962. }, {
  4963. key: "parseCommand",
  4964. value: function parseCommand() {
  4965. var token = this.getToken();
  4966. if (this.isVariableType(token)) {
  4967. if (!this.insideScope(IVProgParser.FUNCTION)) {
  4968. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].invalid_var_declaration(token);
  4969. }
  4970. this.pushScope(IVProgParser.BASE);
  4971. var varType = this.parseType();
  4972. this.popScope();
  4973. var cmd = this.parseDeclaration(varType);
  4974. this.checkEOS();
  4975. this.pos++;
  4976. return cmd;
  4977. } else if (token.type === this.lexerClass.ID) {
  4978. return this.parseIDCommand();
  4979. } else if (token.type === this.lexerClass.LIB_ID) {
  4980. return this.parseIDCommand();
  4981. } else if (token.type === this.lexerClass.RK_RETURN) {
  4982. return this.parseReturn();
  4983. } else if (token.type === this.lexerClass.RK_WHILE || token.type === this.lexerClass.RK_WHILE_ALT) {
  4984. return this.parseWhile();
  4985. } else if (token.type === this.lexerClass.RK_FOR || token.type === this.lexerClass.RK_FOR_ALT) {
  4986. return this.parseFor();
  4987. } else if (token.type === this.lexerClass.RK_BREAK) {
  4988. if (!this.insideScope(IVProgParser.BREAKABLE)) {
  4989. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].invalid_break_command(this.lexer.literalNames[this.lexerClass.RK_BREAK], token);
  4990. }
  4991. return this.parseBreak();
  4992. } else if (token.type === this.lexerClass.RK_SWITCH) {
  4993. return this.parseSwitchCase();
  4994. } else if (token.type === this.lexerClass.RK_DO) {
  4995. return this.parseRepeatUntil();
  4996. } else if (token.type === this.lexerClass.RK_IF) {
  4997. return this.parseIfThenElse();
  4998. } else if (this.checkEOS(true)) {
  4999. this.pos++;
  5000. return -1;
  5001. } else {
  5002. return null;
  5003. }
  5004. }
  5005. }, {
  5006. key: "parseSwitchCase",
  5007. value: function parseSwitchCase() {
  5008. this.pushScope(IVProgParser.BREAKABLE);
  5009. this.pos++;
  5010. this.checkOpenParenthesis();
  5011. this.pos++;
  5012. this.consumeNewLines();
  5013. var exp = this.parseExpressionOR();
  5014. this.consumeNewLines();
  5015. this.checkCloseParenthesis();
  5016. this.pos++;
  5017. this.consumeNewLines();
  5018. this.checkOpenCurly();
  5019. this.pos++;
  5020. this.consumeNewLines();
  5021. var casesList = this.parseCases();
  5022. this.consumeNewLines();
  5023. this.checkCloseCurly();
  5024. this.pos++;
  5025. this.consumeNewLines();
  5026. this.popScope();
  5027. return new _commands__WEBPACK_IMPORTED_MODULE_2__["Switch"](exp, casesList);
  5028. }
  5029. }, {
  5030. key: "parseRepeatUntil",
  5031. value: function parseRepeatUntil() {
  5032. this.pos++;
  5033. this.consumeNewLines();
  5034. this.pushScope(IVProgParser.BREAKABLE);
  5035. var commandsBlock = this.parseCommandBlock();
  5036. this.consumeNewLines(); //Maybe not...
  5037. var whileToken = this.getToken();
  5038. if (whileToken.type !== this.lexerClass.RK_DO_UNTIL) {
  5039. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].token_missing_one(this.lexer.literalNames[this.lexerClass.RK_DO_UNTIL], whileToken);
  5040. }
  5041. this.pos++;
  5042. this.checkOpenParenthesis();
  5043. this.pos++;
  5044. this.consumeNewLines();
  5045. var condition = this.parseExpressionOR();
  5046. this.consumeNewLines();
  5047. this.checkCloseParenthesis();
  5048. this.pos++;
  5049. this.checkEOS();
  5050. this.popScope();
  5051. return new _commands__WEBPACK_IMPORTED_MODULE_2__["RepeatUntil"](condition, commandsBlock);
  5052. }
  5053. }, {
  5054. key: "parseIfThenElse",
  5055. value: function parseIfThenElse() {
  5056. if (this.insideScope(IVProgParser.BREAKABLE)) {
  5057. this.pushScope(IVProgParser.BREAKABLE);
  5058. } else {
  5059. this.pushScope(IVProgParser.COMMAND);
  5060. }
  5061. var token = this.getToken();
  5062. this.pos++;
  5063. this.checkOpenParenthesis();
  5064. this.pos++;
  5065. this.consumeNewLines();
  5066. var logicalExpression = this.parseExpressionOR();
  5067. this.consumeNewLines();
  5068. this.checkCloseParenthesis();
  5069. this.pos++;
  5070. this.consumeNewLines();
  5071. var cmdBlocks = this.parseCommandBlock();
  5072. var maybeElse = this.getToken();
  5073. if (maybeElse.type === this.lexerClass.RK_ELSE) {
  5074. this.pos++;
  5075. this.consumeNewLines();
  5076. var maybeIf = this.getToken();
  5077. var elseBlock = null;
  5078. if (this.checkOpenCurly(true)) {
  5079. elseBlock = this.parseCommandBlock();
  5080. } else if (maybeIf.type === this.lexerClass.RK_IF) {
  5081. elseBlock = this.parseIfThenElse();
  5082. } else {
  5083. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].token_missing_list([this.lexer.literalNames[this.lexerClass.RK_IF], '{'], maybeIf);
  5084. }
  5085. this.popScope();
  5086. var _cmd = new _commands__WEBPACK_IMPORTED_MODULE_2__["IfThenElse"](logicalExpression, cmdBlocks, elseBlock);
  5087. _cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(token);
  5088. return _cmd;
  5089. }
  5090. this.popScope();
  5091. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_2__["IfThenElse"](logicalExpression, cmdBlocks, null);
  5092. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(token);
  5093. return cmd;
  5094. }
  5095. }, {
  5096. key: "parseFor",
  5097. value: function parseFor() {
  5098. this.pushScope(IVProgParser.BREAKABLE);
  5099. var for_token = this.getToken();
  5100. this.pos += 1; // parse ID
  5101. var id_token = this.getToken();
  5102. var id = this.parseID();
  5103. var for_id = new _expressions__WEBPACK_IMPORTED_MODULE_1__["VariableLiteral"](id);
  5104. for_id.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(id_token); // END parse ID
  5105. var for_from = this.parseForParameters(this.lexerClass.RK_FOR_FROM);
  5106. var for_to = this.parseForParameters(this.lexerClass.RK_FOR_TO);
  5107. var maybePass = this.parseForParameters(this.lexerClass.RK_FOR_PASS);
  5108. this.consumeNewLines();
  5109. var commandsBlock = this.parseCommandBlock();
  5110. this.popScope();
  5111. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_2__["For"](for_id, for_from, for_to, maybePass, commandsBlock);
  5112. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(for_token);
  5113. return cmd;
  5114. }
  5115. }, {
  5116. key: "parseWhile",
  5117. value: function parseWhile() {
  5118. this.pushScope(IVProgParser.BREAKABLE);
  5119. var token = this.getToken();
  5120. this.pos++;
  5121. this.checkOpenParenthesis();
  5122. this.pos++;
  5123. this.consumeNewLines();
  5124. var logicalExpression = this.parseExpressionOR();
  5125. this.consumeNewLines();
  5126. this.checkCloseParenthesis();
  5127. this.pos++;
  5128. this.consumeNewLines();
  5129. var cmdBlocks = this.parseCommandBlock();
  5130. this.popScope();
  5131. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_2__["While"](logicalExpression, cmdBlocks);
  5132. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(token);
  5133. return cmd;
  5134. }
  5135. }, {
  5136. key: "parseBreak",
  5137. value: function parseBreak() {
  5138. this.pos++;
  5139. this.checkEOS();
  5140. this.pos++;
  5141. return new _commands__WEBPACK_IMPORTED_MODULE_2__["Break"]();
  5142. }
  5143. }, {
  5144. key: "parseReturn",
  5145. value: function parseReturn() {
  5146. this.pos++;
  5147. var exp = null;
  5148. if (!this.checkEOS(true)) {
  5149. exp = this.parseExpressionOR();
  5150. this.checkEOS();
  5151. }
  5152. this.pos++;
  5153. return new _commands__WEBPACK_IMPORTED_MODULE_2__["Return"](exp);
  5154. }
  5155. }, {
  5156. key: "parseIDCommand",
  5157. value: function parseIDCommand() {
  5158. var refToken = this.getToken();
  5159. var isID = refToken.type === this.lexerClass.ID;
  5160. var id = this.parseMaybeLibID();
  5161. if (this.checkOpenBrace(true)) {
  5162. this.pos++;
  5163. var lineExpression = null;
  5164. var columnExpression = null;
  5165. this.consumeNewLines();
  5166. lineExpression = this.parseExpression();
  5167. this.consumeNewLines();
  5168. this.checkCloseBrace();
  5169. this.pos++;
  5170. if (this.checkOpenBrace(true)) {
  5171. this.pos++;
  5172. this.consumeNewLines();
  5173. columnExpression = this.parseExpression();
  5174. this.consumeNewLines();
  5175. this.checkCloseBrace();
  5176. this.pos++;
  5177. }
  5178. var equalToken = this.getToken();
  5179. if (equalToken.type !== this.lexerClass.EQUAL) {
  5180. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].token_missing_one('=', equalToken);
  5181. }
  5182. this.pos++;
  5183. var exp = this.parseExpressionOR();
  5184. this.checkEOS();
  5185. this.pos++;
  5186. var cmd = new _commands__WEBPACK_IMPORTED_MODULE_2__["ArrayIndexAssign"](id, lineExpression, columnExpression, exp);
  5187. cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(equalToken);
  5188. return cmd;
  5189. }
  5190. var equalOrParenthesis = this.getToken();
  5191. if (isID && equalOrParenthesis.type === this.lexerClass.EQUAL) {
  5192. this.pos++;
  5193. var _exp = this.parseExpressionOR();
  5194. this.checkEOS();
  5195. this.pos++;
  5196. var _cmd2 = new _commands__WEBPACK_IMPORTED_MODULE_2__["Assign"](id, _exp);
  5197. _cmd2.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(equalOrParenthesis);
  5198. return _cmd2;
  5199. } else if (equalOrParenthesis.type === this.lexerClass.OPEN_PARENTHESIS) {
  5200. var funcCall = this.parseFunctionCallCommand(id);
  5201. this.checkEOS();
  5202. this.pos++;
  5203. return funcCall;
  5204. } else if (isID) {
  5205. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].token_missing_list(['=', '('], equalOrParenthesis);
  5206. } else {
  5207. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].invalid_id_format(refToken);
  5208. }
  5209. }
  5210. }, {
  5211. key: "parseForParameters",
  5212. value: function parseForParameters(keyword_code) {
  5213. if (keyword_code === this.lexerClass.RK_FOR_PASS) {
  5214. if (this.checkOpenCurly(true)) {
  5215. return null;
  5216. }
  5217. }
  5218. var from_token = this.getToken();
  5219. if (from_token.type !== keyword_code) {
  5220. // TODO better error message
  5221. var keyword = this.lexer.literalNames[keyword_code];
  5222. throw new Error("Error de sintaxe no comando repita_para: esperava-se " + keyword + " mas encontrou " + from_token.text);
  5223. }
  5224. this.pos += 1;
  5225. var int_or_id = this.getToken();
  5226. var is_unary_op = false;
  5227. var op = null;
  5228. if (int_or_id.type === this.lexerClass.SUM_OP) {
  5229. is_unary_op = true;
  5230. op = int_or_id.text;
  5231. this.pos += 1;
  5232. int_or_id = this.getToken();
  5233. }
  5234. var for_from = null;
  5235. if (int_or_id.type === this.lexerClass.ID) {
  5236. for_from = new _expressions__WEBPACK_IMPORTED_MODULE_1__["VariableLiteral"](this.parseID());
  5237. for_from.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(int_or_id);
  5238. } else if (int_or_id.type === this.lexerClass.INTEGER) {
  5239. this.pos += 1;
  5240. for_from = this.getIntLiteral(int_or_id);
  5241. }
  5242. if (for_from == null) {
  5243. // TODO better error message
  5244. var _keyword = this.lexer.literalNames[keyword_code];
  5245. 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.");
  5246. }
  5247. if (is_unary_op) {
  5248. for_from = new _expressions__WEBPACK_IMPORTED_MODULE_1__["UnaryApp"](Object(_operators__WEBPACK_IMPORTED_MODULE_8__["convertFromString"])(op), for_from);
  5249. }
  5250. return for_from;
  5251. }
  5252. }, {
  5253. key: "parseCases",
  5254. value: function parseCases() {
  5255. var token = this.getToken();
  5256. if (token.type !== this.lexerClass.RK_CASE) {
  5257. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].token_missing_one(this.lexer.literalNames[this.lexerClass.RK_CASE], token);
  5258. }
  5259. this.pos++;
  5260. var nextToken = this.getToken();
  5261. if (nextToken.type === this.lexerClass.RK_DEFAULT) {
  5262. this.pos++;
  5263. var colonToken = this.getToken();
  5264. if (colonToken.type !== this.lexerClass.COLON) {
  5265. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].token_missing_one(':', colonToken);
  5266. }
  5267. this.pos++;
  5268. this.consumeNewLines();
  5269. var block = this.parseCommandBlock(true);
  5270. var defaultCase = new _commands__WEBPACK_IMPORTED_MODULE_2__["Case"](null);
  5271. defaultCase.setCommands(block.commands);
  5272. return [defaultCase];
  5273. } else {
  5274. var exp = this.parseExpressionOR();
  5275. var _colonToken = this.getToken();
  5276. if (_colonToken.type !== this.lexerClass.COLON) {
  5277. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].token_missing_one(':', _colonToken);
  5278. }
  5279. this.pos++;
  5280. this.consumeNewLines();
  5281. var _block = this.parseCommandBlock(true);
  5282. var aCase = new _commands__WEBPACK_IMPORTED_MODULE_2__["Case"](exp);
  5283. aCase.setCommands(_block.commands);
  5284. var caseToken = this.getToken();
  5285. if (caseToken.type === this.lexerClass.RK_CASE) {
  5286. return [aCase].concat(this.parseCases());
  5287. } else {
  5288. return [aCase];
  5289. }
  5290. }
  5291. }
  5292. /*
  5293. * Parses an Expression following the structure:
  5294. *
  5295. * EOR => EAnd ( 'or' EOR)? #expression and
  5296. *
  5297. * EOR => ENot ('and' EOR)? #expression or
  5298. *
  5299. * ENot => 'not'? ER #expression not
  5300. *
  5301. * ER => E ((>=, <=, ==, >, <) E)? #expression relational
  5302. *
  5303. * E => factor ((+, -) E)? #expression
  5304. *
  5305. * factor=> term ((*, /, %) factor)?
  5306. *
  5307. * term => literal || arrayAccess || FuncCall || ID || '('EAnd')'
  5308. **/
  5309. }, {
  5310. key: "parseExpressionOR",
  5311. value: function parseExpressionOR() {
  5312. var exp1 = this.parseExpressionAND();
  5313. while (this.getToken().type === this.lexerClass.OR_OPERATOR) {
  5314. var opToken = this.getToken();
  5315. this.pos++;
  5316. var or = Object(_operators__WEBPACK_IMPORTED_MODULE_8__["convertFromString"])('or');
  5317. this.consumeNewLines();
  5318. var exp2 = this.parseExpressionAND();
  5319. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_1__["InfixApp"](or, exp1, exp2);
  5320. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(opToken);
  5321. exp1 = finalExp;
  5322. }
  5323. return exp1;
  5324. }
  5325. }, {
  5326. key: "parseExpressionAND",
  5327. value: function parseExpressionAND() {
  5328. var exp1 = this.parseExpressionNot();
  5329. while (this.getToken().type === this.lexerClass.AND_OPERATOR) {
  5330. var opToken = this.getToken();
  5331. this.pos++;
  5332. var and = Object(_operators__WEBPACK_IMPORTED_MODULE_8__["convertFromString"])('and');
  5333. this.consumeNewLines();
  5334. var exp2 = this.parseExpressionNot();
  5335. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_1__["InfixApp"](and, exp1, exp2);
  5336. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(opToken);
  5337. exp1 = finalExp;
  5338. }
  5339. return exp1;
  5340. }
  5341. }, {
  5342. key: "parseExpressionNot",
  5343. value: function parseExpressionNot() {
  5344. var maybeNotToken = this.getToken();
  5345. if (maybeNotToken.type === this.lexerClass.NOT_OPERATOR) {
  5346. var opToken = this.getToken();
  5347. this.pos++;
  5348. var not = Object(_operators__WEBPACK_IMPORTED_MODULE_8__["convertFromString"])('not');
  5349. var exp1 = this.parseExpressionRel();
  5350. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_1__["UnaryApp"](not, exp1);
  5351. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(opToken);
  5352. return finalExp;
  5353. } else {
  5354. return this.parseExpressionRel();
  5355. }
  5356. }
  5357. }, {
  5358. key: "parseExpressionRel",
  5359. value: function parseExpressionRel() {
  5360. var exp1 = this.parseExpression();
  5361. while (this.getToken().type === this.lexerClass.RELATIONAL_OPERATOR) {
  5362. var relToken = this.getToken();
  5363. this.pos++;
  5364. var rel = Object(_operators__WEBPACK_IMPORTED_MODULE_8__["convertFromString"])(relToken.text);
  5365. var exp2 = this.parseExpression();
  5366. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_1__["InfixApp"](rel, exp1, exp2);
  5367. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(relToken);
  5368. exp1 = finalExp;
  5369. }
  5370. return exp1;
  5371. }
  5372. }, {
  5373. key: "parseExpression",
  5374. value: function parseExpression() {
  5375. var factor = this.parseFactor();
  5376. while (this.getToken().type === this.lexerClass.SUM_OP) {
  5377. var sumOpToken = this.getToken();
  5378. this.pos++;
  5379. var op = Object(_operators__WEBPACK_IMPORTED_MODULE_8__["convertFromString"])(sumOpToken.text);
  5380. var factor2 = this.parseFactor();
  5381. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_1__["InfixApp"](op, factor, factor2);
  5382. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(sumOpToken);
  5383. factor = finalExp;
  5384. }
  5385. return factor;
  5386. }
  5387. }, {
  5388. key: "parseFactor",
  5389. value: function parseFactor() {
  5390. var term = this.parseTerm();
  5391. while (this.getToken().type === this.lexerClass.MULTI_OP) {
  5392. var multOpToken = this.getToken();
  5393. this.pos++;
  5394. var op = Object(_operators__WEBPACK_IMPORTED_MODULE_8__["convertFromString"])(multOpToken.text);
  5395. var term2 = this.parseTerm();
  5396. var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_1__["InfixApp"](op, term, term2);
  5397. finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(multOpToken);
  5398. term = finalExp;
  5399. }
  5400. return term;
  5401. }
  5402. }, {
  5403. key: "parseTerm",
  5404. value: function parseTerm() {
  5405. var token = this.getToken();
  5406. var sourceInfo = null;
  5407. var exp = null;
  5408. switch (token.type) {
  5409. case this.lexerClass.SUM_OP:
  5410. this.pos++;
  5411. sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(token);
  5412. exp = new _expressions__WEBPACK_IMPORTED_MODULE_1__["UnaryApp"](Object(_operators__WEBPACK_IMPORTED_MODULE_8__["convertFromString"])(token.text), this.parseTerm());
  5413. exp.sourceInfo = sourceInfo;
  5414. return exp;
  5415. case this.lexerClass.INTEGER:
  5416. this.pos++;
  5417. return this.getIntLiteral(token);
  5418. case this.lexerClass.REAL:
  5419. this.pos++;
  5420. return this.getRealLiteral(token);
  5421. case this.lexerClass.STRING:
  5422. this.pos++;
  5423. return this.getStringLiteral(token);
  5424. case this.lexerClass.RK_TRUE:
  5425. case this.lexerClass.RK_FALSE:
  5426. this.pos++;
  5427. return this.getBoolLiteral(token);
  5428. case this.lexerClass.OPEN_CURLY:
  5429. // No more annonymous array
  5430. // return this.parseArrayLiteral();
  5431. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].annonymous_array_literal(token);
  5432. case this.lexerClass.ID:
  5433. case this.lexerClass.LIB_ID:
  5434. return this.parseIDTerm();
  5435. case this.lexerClass.OPEN_PARENTHESIS:
  5436. return this.parseParenthesisExp();
  5437. default:
  5438. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].invalid_terminal(token);
  5439. }
  5440. }
  5441. }, {
  5442. key: "parseIDTerm",
  5443. value: function parseIDTerm() {
  5444. var tokenA = this.getToken();
  5445. var id = this.parseMaybeLibID();
  5446. var isID = tokenA.type === this.lexerClass.ID;
  5447. if (isID && this.checkOpenBrace(true)) {
  5448. var tokenB = null;
  5449. this.pos++;
  5450. var firstIndex = this.parseExpression();
  5451. var secondIndex = null;
  5452. this.consumeNewLines();
  5453. this.checkCloseBrace();
  5454. tokenB = this.getToken();
  5455. this.pos++;
  5456. if (this.checkOpenBrace(true)) {
  5457. this.pos++;
  5458. secondIndex = this.parseExpression();
  5459. this.consumeNewLines();
  5460. this.checkCloseBrace();
  5461. tokenB = this.getToken();
  5462. this.pos++;
  5463. }
  5464. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
  5465. var exp = new _expressions__WEBPACK_IMPORTED_MODULE_1__["ArrayAccess"](id, firstIndex, secondIndex);
  5466. exp.sourceInfo = sourceInfo;
  5467. return exp;
  5468. } else if (this.checkOpenParenthesis(true)) {
  5469. return this.parseFunctionCallExpression(id);
  5470. } else if (isID) {
  5471. var _sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfo(tokenA);
  5472. var _exp2 = new _expressions__WEBPACK_IMPORTED_MODULE_1__["VariableLiteral"](id);
  5473. _exp2.sourceInfo = _sourceInfo;
  5474. return _exp2;
  5475. } else {
  5476. throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_9__["SyntaxErrorFactory"].invalid_id_format(tokenA);
  5477. }
  5478. }
  5479. }, {
  5480. key: "getFunctionName",
  5481. value: function getFunctionName(id) {
  5482. var name = _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getInternalName(id);
  5483. if (name === null) {
  5484. if (id === _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName()) {
  5485. return null;
  5486. }
  5487. return id;
  5488. } else {
  5489. return name;
  5490. }
  5491. }
  5492. }, {
  5493. key: "parseFunctionCallExpression",
  5494. value: function parseFunctionCallExpression(id) {
  5495. var tokenA = this.getToken(this.pos - 1);
  5496. var actualParameters = this.parseActualParameters();
  5497. var tokenB = this.getToken(this.pos - 1);
  5498. var funcName = this.getFunctionName(id);
  5499. var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
  5500. var cmd = new _expressions__WEBPACK_IMPORTED_MODULE_1__["FunctionCall"](funcName, actualParameters);
  5501. cmd.sourceInfo = sourceInfo;
  5502. return cmd;
  5503. }
  5504. }, {
  5505. key: "parseFunctionCallCommand",
  5506. value: function parseFunctionCallCommand(id) {
  5507. return this.parseFunctionCallExpression(id);
  5508. }
  5509. }, {
  5510. key: "parseParenthesisExp",
  5511. value: function parseParenthesisExp() {
  5512. this.checkOpenParenthesis();
  5513. var tokenA = this.getToken();
  5514. this.pos += 1;
  5515. this.consumeNewLines();
  5516. var exp = this.parseExpressionOR();
  5517. this.consumeNewLines();
  5518. this.checkCloseParenthesis();
  5519. var tokenB = this.getToken();
  5520. this.pos += 1;
  5521. exp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_7__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
  5522. exp.parenthesis = true;
  5523. return exp;
  5524. }
  5525. }, {
  5526. key: "parseActualParameters",
  5527. value: function parseActualParameters() {
  5528. this.checkOpenParenthesis();
  5529. this.pos++;
  5530. if (this.checkCloseParenthesis(true)) {
  5531. this.pos++;
  5532. return [];
  5533. }
  5534. this.consumeNewLines();
  5535. var list = this.parseExpressionList();
  5536. this.consumeNewLines();
  5537. this.checkCloseParenthesis();
  5538. this.pos++;
  5539. return list;
  5540. }
  5541. }, {
  5542. key: "parseExpressionList",
  5543. value: function parseExpressionList() {
  5544. var list = [];
  5545. for (;;) {
  5546. var exp = this.parseExpressionOR();
  5547. list.push(exp);
  5548. var maybeToken = this.getToken();
  5549. if (maybeToken.type !== this.lexerClass.COMMA) {
  5550. break;
  5551. } else {
  5552. this.pos++;
  5553. this.consumeNewLines();
  5554. }
  5555. }
  5556. return list;
  5557. }
  5558. }, {
  5559. key: "getTypeArray",
  5560. value: function getTypeArray() {
  5561. var _this = this;
  5562. var types = this.insideScope(IVProgParser.FUNCTION) ? this.functionTypes : this.variableTypes;
  5563. return types.map(function (x) {
  5564. return _this.lexer.literalNames[x];
  5565. });
  5566. }
  5567. }]);
  5568. return IVProgParser;
  5569. }();
  5570. /***/ }),
  5571. /***/ "./js/ast/operators.js":
  5572. /*!*****************************!*\
  5573. !*** ./js/ast/operators.js ***!
  5574. \*****************************/
  5575. /*! exports provided: Operators, convertFromString */
  5576. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5577. "use strict";
  5578. __webpack_require__.r(__webpack_exports__);
  5579. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Operators", function() { return Operators; });
  5580. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertFromString", function() { return convertFromString; });
  5581. var Operators = Object.freeze({
  5582. ADD: {
  5583. ord: 0,
  5584. value: "+"
  5585. },
  5586. SUB: {
  5587. ord: 1,
  5588. value: "-"
  5589. },
  5590. MULT: {
  5591. ord: 2,
  5592. value: '*'
  5593. },
  5594. DIV: {
  5595. ord: 3,
  5596. value: '/'
  5597. },
  5598. MOD: {
  5599. ord: 4,
  5600. value: '%'
  5601. },
  5602. GT: {
  5603. ord: 5,
  5604. value: '>'
  5605. },
  5606. GE: {
  5607. ord: 6,
  5608. value: '>='
  5609. },
  5610. LT: {
  5611. ord: 7,
  5612. value: '<'
  5613. },
  5614. LE: {
  5615. ord: 8,
  5616. value: '<='
  5617. },
  5618. EQ: {
  5619. ord: 9,
  5620. value: '=='
  5621. },
  5622. NEQ: {
  5623. ord: 10,
  5624. value: '!='
  5625. },
  5626. AND: {
  5627. ord: 11,
  5628. value: 'and'
  5629. },
  5630. OR: {
  5631. ord: 12,
  5632. value: 'or'
  5633. },
  5634. NOT: {
  5635. ord: 13,
  5636. value: 'not'
  5637. }
  5638. });
  5639. function convertFromString(op) {
  5640. switch (op) {
  5641. case '+':
  5642. return Operators.ADD;
  5643. case '-':
  5644. return Operators.SUB;
  5645. case '*':
  5646. return Operators.MULT;
  5647. case '/':
  5648. return Operators.DIV;
  5649. case '%':
  5650. return Operators.MOD;
  5651. case '>':
  5652. return Operators.GT;
  5653. case '>=':
  5654. return Operators.GE;
  5655. case '<':
  5656. return Operators.LT;
  5657. case '<=':
  5658. return Operators.LE;
  5659. case '==':
  5660. return Operators.EQ;
  5661. case '!=':
  5662. return Operators.NEQ;
  5663. case 'and':
  5664. return Operators.AND;
  5665. case 'or':
  5666. return Operators.OR;
  5667. case 'not':
  5668. return Operators.NOT;
  5669. }
  5670. }
  5671. /***/ }),
  5672. /***/ "./js/ast/sourceInfo.js":
  5673. /*!******************************!*\
  5674. !*** ./js/ast/sourceInfo.js ***!
  5675. \******************************/
  5676. /*! exports provided: SourceInfo */
  5677. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5678. "use strict";
  5679. __webpack_require__.r(__webpack_exports__);
  5680. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SourceInfo", function() { return SourceInfo; });
  5681. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5682. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  5683. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  5684. var SourceInfo =
  5685. /*#__PURE__*/
  5686. function () {
  5687. _createClass(SourceInfo, null, [{
  5688. key: "createSourceInfo",
  5689. value: function createSourceInfo(token) {
  5690. return new SourceInfo(token.line, token.column, token.text, token.text.length);
  5691. }
  5692. }, {
  5693. key: "createSourceInfoFromList",
  5694. value: function createSourceInfoFromList(tokenA, tokenB) {
  5695. var line = tokenA.line;
  5696. 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
  5697. // No idea why...
  5698. var size = tokenB.tokenIndex + 1 - tokenA.tokenIndex;
  5699. return new SourceInfo(line, column, "", size);
  5700. }
  5701. }]);
  5702. function SourceInfo(line, column, text, size) {
  5703. _classCallCheck(this, SourceInfo);
  5704. this.line = line;
  5705. this.column = column;
  5706. this.text = text;
  5707. this.size = size;
  5708. }
  5709. return SourceInfo;
  5710. }();
  5711. /***/ }),
  5712. /***/ "./js/io/domConsole.js":
  5713. /*!*****************************!*\
  5714. !*** ./js/io/domConsole.js ***!
  5715. \*****************************/
  5716. /*! exports provided: DOMConsole */
  5717. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5718. "use strict";
  5719. __webpack_require__.r(__webpack_exports__);
  5720. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOMConsole", function() { return DOMConsole; });
  5721. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  5722. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  5723. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../util/config */ "./js/util/config.js");
  5724. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5725. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  5726. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  5727. var DOMConsole =
  5728. /*#__PURE__*/
  5729. function () {
  5730. _createClass(DOMConsole, null, [{
  5731. key: "BASH_TEMPLATE",
  5732. get: function get() {
  5733. 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>";
  5734. }
  5735. }, {
  5736. key: "INPUT_CARET_TEMPLATE",
  5737. get: function get() {
  5738. return "\n <div id=\"cmd\">\n <span></span>\n <div id=\"cursor\"></div>\n </div>";
  5739. }
  5740. }, {
  5741. key: "USER",
  5742. get: function get() {
  5743. return 0;
  5744. }
  5745. }, {
  5746. key: "INFO",
  5747. get: function get() {
  5748. return 1;
  5749. }
  5750. }, {
  5751. key: "ERR",
  5752. get: function get() {
  5753. return 2;
  5754. }
  5755. }, {
  5756. key: "INPUT",
  5757. get: function get() {
  5758. return 3;
  5759. }
  5760. }]);
  5761. function DOMConsole(elementID) {
  5762. var disableMarginTop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  5763. _classCallCheck(this, DOMConsole);
  5764. this.disableMarginTop = disableMarginTop;
  5765. this.input = null;
  5766. this.cursorInterval = null;
  5767. this.idleInterval = null;
  5768. this.inputDiv = null;
  5769. this.inputCMD = null;
  5770. this.inputSpan = null;
  5771. this.cursorRef = null;
  5772. this.needInput = false;
  5773. this.clearBtn = null;
  5774. this.hideBtn = null;
  5775. this.showBtn = null;
  5776. this.termDiv = null;
  5777. this.anyKey = false;
  5778. var actualID = elementID;
  5779. if (elementID[0] === '#') {
  5780. actualID = elementID.substring(1);
  5781. }
  5782. this.parent = document.getElementById(actualID);
  5783. this.setup();
  5784. this.inputListeners = [];
  5785. this.hideInput();
  5786. this.pending_writes = [];
  5787. this.last_clear = -1;
  5788. }
  5789. _createClass(DOMConsole, [{
  5790. key: "setup",
  5791. value: function setup() {
  5792. this._setupDom();
  5793. this._setupEvents();
  5794. }
  5795. }, {
  5796. key: "_setupEvents",
  5797. value: function _setupEvents() {
  5798. this.input.addEventListener('keydown', this.registerInput.bind(this));
  5799. this.clearBtn.addEventListener('click', this.clearBtnClick.bind(this));
  5800. this.hideBtn.addEventListener('click', this.hideBtnClick.bind(this));
  5801. this.showBtn.addEventListener('click', this.showBtnClick.bind(this));
  5802. }
  5803. }, {
  5804. key: "registerInput",
  5805. value: function registerInput(event) {
  5806. if (!this.needInput) {
  5807. return;
  5808. }
  5809. var keyCode = event.which;
  5810. if (keyCode === 13 || this.anyKey) {
  5811. if (this.idleInterval != null) {
  5812. clearInterval(this.idleInterval);
  5813. this.idleInterval = null;
  5814. }
  5815. var text = this.input.value;
  5816. text = text.replace('[\n\r]+', '');
  5817. this.notifyListeners(text);
  5818. this._appendUserInput(text);
  5819. this.input.value = '';
  5820. this.inputSpan.innerHTML = '';
  5821. }
  5822. }
  5823. }, {
  5824. key: "_setupDom",
  5825. value: function _setupDom() {
  5826. var bashNode = document.createElement('div');
  5827. bashNode.classList.add('bash');
  5828. bashNode.innerHTML = DOMConsole.BASH_TEMPLATE;
  5829. this.termDiv = bashNode.querySelector("#ivprog-term");
  5830. this.termDiv.classList.add("ivprog-term-div");
  5831. this.inputDiv = document.createElement("div");
  5832. this.inputDiv.id = "ivprog-terminal-inputdiv";
  5833. this.inputDiv.innerHTML = DOMConsole.INPUT_CARET_TEMPLATE;
  5834. this.input = document.createElement("input");
  5835. this.input.setAttribute("name", "command");
  5836. this.input.setAttribute("value", "");
  5837. this.input.setAttribute("type", "text");
  5838. this.inputDiv.append(this.input);
  5839. this.termDiv.append(this.inputDiv);
  5840. bashNode.append(this.termDiv);
  5841. this.parent.append(bashNode);
  5842. this.inputCMD = this.inputDiv.querySelector("#cmd");
  5843. this.cursorRef = this.inputCMD.querySelector("#cursor");
  5844. this.inputSpan = this.inputCMD.querySelector('span');
  5845. this.clearBtn = bashNode.querySelector('#ivprog-console-clearbtn');
  5846. this.hideBtn = bashNode.querySelector('#ivprog-console-hidebtn');
  5847. this.showBtn = bashNode.querySelector('#ivprog-console-showbtn');
  5848. this._setupCursor(); //Jquery tooltips....
  5849. window.$(this.clearBtn).popup({
  5850. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("tooltip_terminal_clear")
  5851. });
  5852. window.$(this.showBtn).popup({
  5853. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("tooltip_terminal_show")
  5854. });
  5855. window.$(this.hideBtn).popup({
  5856. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI("tooltip_terminal_hide")
  5857. });
  5858. }
  5859. }, {
  5860. key: "_setupCursor",
  5861. value: function _setupCursor() {
  5862. this.inputCMD.addEventListener('click', this.blinkCaretAndFocus.bind(this)); //this.inputCMD.click();
  5863. this.input.addEventListener('keyup', this.updateSpanText.bind(this));
  5864. this.input.addEventListener('blur', this.stopBlinkCaret.bind(this));
  5865. }
  5866. }, {
  5867. key: "blinkCaretAndFocus",
  5868. value: function blinkCaretAndFocus() {
  5869. var _this = this;
  5870. if (this.cursorInterval != null) {
  5871. return;
  5872. }
  5873. this.input.focus();
  5874. this.cursorInterval = window.setInterval(function () {
  5875. if (_this.cursorRef.style.visibility === 'visible') {
  5876. _this.cursorRef.style.visibility = 'hidden';
  5877. } else {
  5878. _this.cursorRef.style.visibility = 'visible';
  5879. }
  5880. }, 500);
  5881. }
  5882. }, {
  5883. key: "updateSpanText",
  5884. value: function updateSpanText() {
  5885. this.inputSpan.innerHTML = this.input.value;
  5886. if (this.idleInterval != null) window.clearInterval(this.idleInterval);
  5887. this.scheduleNotify();
  5888. }
  5889. }, {
  5890. key: "stopBlinkCaret",
  5891. value: function stopBlinkCaret() {
  5892. clearInterval(this.cursorInterval);
  5893. this.cursorInterval = null;
  5894. this.cursorRef.style.visibility = 'visible';
  5895. }
  5896. }, {
  5897. key: "notifyListeners",
  5898. value: function notifyListeners(text) {
  5899. this.inputListeners.forEach(function (resolve) {
  5900. return resolve(text);
  5901. });
  5902. this.inputListeners.splice(0, this.inputListeners.length);
  5903. this.hideInput();
  5904. this.anyKey = false;
  5905. }
  5906. }, {
  5907. key: "write",
  5908. value: function write(text) {
  5909. this._appendText(text, DOMConsole.USER);
  5910. }
  5911. }, {
  5912. key: "info",
  5913. value: function info(text) {
  5914. this._appendText(text, DOMConsole.INFO);
  5915. }
  5916. }, {
  5917. key: "err",
  5918. value: function err(text) {
  5919. this._appendText(text, DOMConsole.ERR);
  5920. }
  5921. }, {
  5922. key: "_appendText",
  5923. value: function _appendText(text, type) {
  5924. var _this2 = this;
  5925. var write_time = Date.now();
  5926. var pending_write = setTimeout(function () {
  5927. _this2.pending_writes.shift();
  5928. if (_this2.last_clear >= write_time) {
  5929. return;
  5930. }
  5931. var divClass = _this2.getClassForType(type);
  5932. var textDiv = document.createElement('div');
  5933. textDiv.classList.add(divClass);
  5934. textDiv.innerHTML = _this2.getOutputText(text);
  5935. _this2.termDiv.insertBefore(textDiv, _this2.inputDiv);
  5936. _this2.scrollTerm();
  5937. }, 5);
  5938. this.pending_writes.push(pending_write);
  5939. }
  5940. }, {
  5941. key: "_appendUserInput",
  5942. value: function _appendUserInput(text) {
  5943. var _this3 = this;
  5944. var write_time = Date.now();
  5945. var pending_write = setTimeout(function () {
  5946. _this3.pending_writes.shift();
  5947. if (_this3.last_clear >= write_time) {
  5948. return;
  5949. }
  5950. var divClass = _this3.getClassForType(DOMConsole.INPUT);
  5951. var textDiv = document.createElement('div');
  5952. textDiv.innerHTML = _this3.getUserInputText(text);
  5953. textDiv.classList.add(divClass);
  5954. _this3.termDiv.insertBefore(textDiv, _this3.inputDiv);
  5955. _this3.scrollTerm();
  5956. }, 5);
  5957. this.pending_writes.push(pending_write);
  5958. }
  5959. }, {
  5960. key: "getOutputText",
  5961. value: function getOutputText(text) {
  5962. if (text.trim().length == 0) {
  5963. text = "&nbsp;";
  5964. }
  5965. return "<span>".concat(text, "</span>");
  5966. }
  5967. }, {
  5968. key: "getUserInputText",
  5969. value: function getUserInputText(text) {
  5970. if (text.trim().length == 0) {
  5971. text = "&nbsp;";
  5972. }
  5973. return "<i class=\"icon keyboard outline\" style=\"float:left\"></i><span>".concat(text, "</span>");
  5974. }
  5975. }, {
  5976. key: "scrollTerm",
  5977. value: function scrollTerm() {
  5978. //scrollIt(this.inputDiv.previousSibling,200);
  5979. this.termDiv.scrollTop = this.termDiv.scrollHeight;
  5980. }
  5981. }, {
  5982. key: "focus",
  5983. value: function focus() {
  5984. this.termDiv.style.display = 'block'; // Is in draggable mode?
  5985. if (!this.disableMarginTop && this.parent.style.top.length == 0) {
  5986. this.parent.style.marginTop = "-160px";
  5987. }
  5988. if (this.needInput) {
  5989. this.showInput();
  5990. this.scheduleNotify();
  5991. }
  5992. if (!Object(_util_utils__WEBPACK_IMPORTED_MODULE_1__["isElementInViewport"])(this.termDiv)) this.termDiv.scrollIntoView(false);
  5993. this.scrollTerm();
  5994. }
  5995. }, {
  5996. key: "hide",
  5997. value: function hide() {
  5998. if (this.needInput) {
  5999. clearInterval(this.idleInterval);
  6000. this.hideInput();
  6001. this.needInput = true;
  6002. } // Is in draggable mode?
  6003. if (!this.disableMarginTop && this.parent.style.top.length == 0) {
  6004. this.parent.style.marginTop = "0";
  6005. }
  6006. this.termDiv.style.display = 'none';
  6007. }
  6008. }, {
  6009. key: "getClassForType",
  6010. value: function getClassForType(type) {
  6011. switch (type) {
  6012. case DOMConsole.INPUT:
  6013. return "ivprog-term-userInput";
  6014. case DOMConsole.USER:
  6015. return "ivprog-term-userText";
  6016. case DOMConsole.INFO:
  6017. return "ivprog-term-info";
  6018. case DOMConsole.ERR:
  6019. return "ivprog-term-error";
  6020. }
  6021. }
  6022. }, {
  6023. key: "dispose",
  6024. value: function dispose() {
  6025. this.input.removeEventListener('keyup', this.updateSpanText.bind(this));
  6026. this.input.removeEventListener('blur', this.stopBlinkCaret.bind(this));
  6027. this.input.removeEventListener('keydown', this.registerInput.bind(this));
  6028. this.inputCMD.removeEventListener('click', this.blinkCaretAndFocus.bind(this));
  6029. this.clearBtn.removeEventListener('click', this.clearBtnClick.bind(this));
  6030. this.hideBtn.removeEventListener('click', this.hideBtnClick.bind(this));
  6031. this.showBtn.removeEventListener('click', this.showBtnClick.bind(this));
  6032. this.input = null;
  6033. this.inputCMD = null;
  6034. this.inputDiv = null;
  6035. this.termDiv = null;
  6036. this.inputSpan = null;
  6037. this.cursorRef = null;
  6038. this.clearBtn = null;
  6039. this.hideBtn = null;
  6040. this.showBtn = null;
  6041. var cNode = this.parent.cloneNode(false);
  6042. this.parent.parentNode.replaceChild(cNode, this.parent);
  6043. if (this.cursorInterval != null) {
  6044. clearInterval(this.cursorInterval);
  6045. }
  6046. if (this.idleInterval != null) {
  6047. clearInterval(this.idleInterval);
  6048. }
  6049. }
  6050. }, {
  6051. key: "showInput",
  6052. value: function showInput() {
  6053. this.needInput = true;
  6054. this.inputDiv.style.display = 'block';
  6055. this.inputCMD.click(); //this.inputCMD.scrollIntoView();
  6056. this.scrollTerm();
  6057. }
  6058. }, {
  6059. key: "hideInput",
  6060. value: function hideInput() {
  6061. this.needInput = false;
  6062. this.inputDiv.style.display = ' none';
  6063. clearInterval(this.cursorInterval);
  6064. this.cursorInterval = null;
  6065. }
  6066. }, {
  6067. key: "requestInput",
  6068. value: function requestInput(callback) {
  6069. var anyKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  6070. this.inputListeners.push(callback);
  6071. this.anyKey = anyKey;
  6072. if (this.idleInterval == null) this.scheduleNotify();
  6073. this.showInput();
  6074. }
  6075. }, {
  6076. key: "sendOutput",
  6077. value: function sendOutput(text) {
  6078. var _this4 = this;
  6079. var output = "" + text;
  6080. output.split("\n").forEach(function (t) {
  6081. t = t.replace(/\t/g, '&nbsp;&nbsp;');
  6082. t = t.replace(/\s/g, "&nbsp;");
  6083. _this4.write(t);
  6084. });
  6085. }
  6086. }, {
  6087. key: "clearPendingWrites",
  6088. value: function clearPendingWrites() {
  6089. this.last_clear = Date.now();
  6090. for (var id in this.pending_writes) {
  6091. clearTimeout(id);
  6092. }
  6093. }
  6094. }, {
  6095. key: "clear",
  6096. value: function clear() {
  6097. this.clearPendingWrites();
  6098. this.pending_writes = [];
  6099. while (this.inputDiv.parentElement.childNodes.length > 1) {
  6100. this.inputDiv.parentElement.removeChild(this.inputDiv.parentElement.firstChild);
  6101. }
  6102. this.input.value = "";
  6103. this.inputSpan.innerHTML = '';
  6104. }
  6105. }, {
  6106. key: "clearBtnClick",
  6107. value: function clearBtnClick() {
  6108. this.clear();
  6109. }
  6110. }, {
  6111. key: "showBtnClick",
  6112. value: function showBtnClick() {
  6113. this.focus();
  6114. }
  6115. }, {
  6116. key: "hideBtnClick",
  6117. value: function hideBtnClick() {
  6118. this.hide();
  6119. }
  6120. }, {
  6121. key: "notifyIdle",
  6122. value: function notifyIdle() {
  6123. this.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getMessage('awaiting_input_message'));
  6124. this.inputCMD.click();
  6125. }
  6126. }, {
  6127. key: "scheduleNotify",
  6128. value: function scheduleNotify() {
  6129. this.idleInterval = window.setInterval(this.notifyIdle.bind(this), _util_config__WEBPACK_IMPORTED_MODULE_2__["Config"].idle_input_interval);
  6130. }
  6131. }, {
  6132. key: "cancelPendingInputRequests",
  6133. value: function cancelPendingInputRequests() {
  6134. this.inputListeners.forEach(function (resolve) {
  6135. return resolve('');
  6136. });
  6137. this.inputListeners.splice(0, this.inputListeners.length);
  6138. if (this.idleInterval != null) {
  6139. clearInterval(this.idleInterval);
  6140. this.idleInterval = null;
  6141. }
  6142. this.input.value = '';
  6143. this.inputSpan.innerHTML = '';
  6144. this.hideInput();
  6145. this.anyKey = false;
  6146. }
  6147. }]);
  6148. return DOMConsole;
  6149. }();
  6150. /***/ }),
  6151. /***/ "./js/io/input.js":
  6152. /*!************************!*\
  6153. !*** ./js/io/input.js ***!
  6154. \************************/
  6155. /*! exports provided: Input */
  6156. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6157. "use strict";
  6158. __webpack_require__.r(__webpack_exports__);
  6159. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return Input; });
  6160. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6161. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6162. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  6163. var Input =
  6164. /*#__PURE__*/
  6165. function () {
  6166. function Input() {
  6167. _classCallCheck(this, Input);
  6168. }
  6169. _createClass(Input, [{
  6170. key: "requestInput",
  6171. value: function requestInput(callback) {
  6172. throw new Error("Must be implemented");
  6173. }
  6174. }, {
  6175. key: "cancelPendingInputRequests",
  6176. value: function cancelPendingInputRequests() {
  6177. throw new Error("Must be implemented");
  6178. }
  6179. }]);
  6180. return Input;
  6181. }();
  6182. /***/ }),
  6183. /***/ "./js/io/output.js":
  6184. /*!*************************!*\
  6185. !*** ./js/io/output.js ***!
  6186. \*************************/
  6187. /*! exports provided: Output */
  6188. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6189. "use strict";
  6190. __webpack_require__.r(__webpack_exports__);
  6191. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Output", function() { return Output; });
  6192. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6193. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6194. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  6195. var Output =
  6196. /*#__PURE__*/
  6197. function () {
  6198. function Output() {
  6199. _classCallCheck(this, Output);
  6200. }
  6201. _createClass(Output, [{
  6202. key: "sendOutput",
  6203. value: function sendOutput(text) {
  6204. throw new Error("Must be implemented");
  6205. }
  6206. }]);
  6207. return Output;
  6208. }();
  6209. /***/ }),
  6210. /***/ "./js/main.js":
  6211. /*!********************!*\
  6212. !*** ./js/main.js ***!
  6213. \********************/
  6214. /*! exports provided: runner, initVisualUI, addFunctionChangeListener, addGlobalChangeListener, removeFunctionListener, removeGlobalListener, getTestCases, autoEval, prepareActivityToStudentHelper, LocalizedStrings, i18n, getLogs, getLogsAsString, registerClick, registerUserEvent, parseLogs, ActionTypes, CodeEditor, openAssessmentDetail, autoGenerateTestCaseOutput */
  6215. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6216. "use strict";
  6217. __webpack_require__.r(__webpack_exports__);
  6218. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocalizedStrings", function() { return LocalizedStrings; });
  6219. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i18n", function() { return i18n; });
  6220. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeEditor", function() { return CodeEditor; });
  6221. /* harmony import */ var _runner__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./runner */ "./js/runner.js");
  6222. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "runner", function() { return _runner__WEBPACK_IMPORTED_MODULE_0__["runner"]; });
  6223. /* harmony import */ var _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./visualUI/functions */ "./js/visualUI/functions.js");
  6224. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initVisualUI", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["initVisualUI"]; });
  6225. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addFunctionChangeListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["addFunctionChangeListener"]; });
  6226. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addGlobalChangeListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["addGlobalChangeListener"]; });
  6227. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeFunctionListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["removeFunctionListener"]; });
  6228. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeGlobalListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["removeGlobalListener"]; });
  6229. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getTestCases", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["getTestCases"]; });
  6230. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./services/localizedStringsService */ "./js/services/localizedStringsService.js");
  6231. /* harmony import */ var _services_i18nHelper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/i18nHelper */ "./js/services/i18nHelper.js");
  6232. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./services/userLog */ "./js/services/userLog.js");
  6233. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLogs", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["getLogs"]; });
  6234. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLogsAsString", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["getLogsAsString"]; });
  6235. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerClick", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerClick"]; });
  6236. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerUserEvent", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"]; });
  6237. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseLogs", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["parseLogs"]; });
  6238. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ActionTypes", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"]; });
  6239. /* harmony import */ var _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util/iassignHelpers */ "./js/util/iassignHelpers.js");
  6240. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autoEval", function() { return _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__["autoEval"]; });
  6241. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareActivityToStudentHelper", function() { return _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__["prepareActivityToStudentHelper"]; });
  6242. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util/utils */ "./js/util/utils.js");
  6243. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "openAssessmentDetail", function() { return _util_utils__WEBPACK_IMPORTED_MODULE_6__["openAssessmentDetail"]; });
  6244. /* harmony import */ var _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./visualUI/text_editor */ "./js/visualUI/text_editor.js");
  6245. /* harmony import */ var _util_auto_gen_output__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./util/auto_gen_output */ "./js/util/auto_gen_output.js");
  6246. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autoGenerateTestCaseOutput", function() { return _util_auto_gen_output__WEBPACK_IMPORTED_MODULE_8__["autoGenerateTestCaseOutput"]; });
  6247. var CodeEditor = {
  6248. initTextEditor: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_7__["initTextEditor"],
  6249. setCode: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_7__["setCode"],
  6250. getCode: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_7__["getCode"],
  6251. updateEditor: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_7__["updateEditor"],
  6252. disable: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_7__["disable"]
  6253. };
  6254. var i18n = _services_i18nHelper__WEBPACK_IMPORTED_MODULE_3__["i18nHelper"].i18n;
  6255. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["getInstance"]();
  6256. /***/ }),
  6257. /***/ "./js/memory/address.ts":
  6258. /*!******************************!*\
  6259. !*** ./js/memory/address.ts ***!
  6260. \******************************/
  6261. /*! no static exports found */
  6262. /***/ (function(module, exports, __webpack_require__) {
  6263. "use strict";
  6264. Object.defineProperty(exports, "__esModule", { value: true });
  6265. class Address {
  6266. /**
  6267. *
  6268. * @param {Number} id the address id
  6269. * @param {*} value the value stored at this address
  6270. */
  6271. constructor(id, value) {
  6272. this.id = id;
  6273. this.value = value;
  6274. }
  6275. }
  6276. exports.Address = Address;
  6277. /***/ }),
  6278. /***/ "./js/memory/location.ts":
  6279. /*!*******************************!*\
  6280. !*** ./js/memory/location.ts ***!
  6281. \*******************************/
  6282. /*! no static exports found */
  6283. /***/ (function(module, exports, __webpack_require__) {
  6284. "use strict";
  6285. Object.defineProperty(exports, "__esModule", { value: true });
  6286. const address_1 = __webpack_require__(/*! ./address */ "./js/memory/address.ts");
  6287. class LocationHolder {
  6288. constructor() {
  6289. this.data = [];
  6290. this.address_id = 0;
  6291. }
  6292. /**
  6293. *
  6294. * @param {*} value the value to be allocated
  6295. * @returns {Number} - the address id
  6296. */
  6297. allocate(value) {
  6298. const id = this.address_id;
  6299. // console.log("Allocation address "+ id);
  6300. const address = new address_1.Address(id, value);
  6301. this.data.push(address);
  6302. this.address_id += 1;
  6303. return id;
  6304. }
  6305. /**
  6306. *
  6307. * @param {Number} id
  6308. */
  6309. deallocate(id) {
  6310. const index = this.findIndex(id);
  6311. // console.log("Deallocation address "+ id);
  6312. if (index !== -1) {
  6313. this.data.splice(index, 1);
  6314. return true;
  6315. }
  6316. return false;
  6317. }
  6318. /**
  6319. *
  6320. * @param {Number} id
  6321. * @returns {Address} the address identified by id
  6322. */
  6323. find(id) {
  6324. let beg = 0;
  6325. let end = this.data.length;
  6326. // console.log("Finding address "+id);
  6327. while (beg < end) {
  6328. const med = Math.floor((beg + end) / 2);
  6329. const address = this.getAddressAt(med);
  6330. if (address.id === id) {
  6331. return address;
  6332. }
  6333. else if (id > address.id) {
  6334. beg = med;
  6335. }
  6336. else {
  6337. end = med;
  6338. }
  6339. }
  6340. return undefined;
  6341. }
  6342. getAddressAt(pos) {
  6343. return this.data[pos];
  6344. }
  6345. /**
  6346. *
  6347. * @param {Number} id address id
  6348. * @returns {Number} the index of the address identified by id
  6349. */
  6350. findIndex(id) {
  6351. let beg = 0;
  6352. let end = this.data.length;
  6353. while (beg < end) {
  6354. const med = Math.floor((beg + end) / 2);
  6355. const address = this.getAddressAt(med);
  6356. if (address.id === id) {
  6357. return med;
  6358. }
  6359. else if (id > address.id) {
  6360. beg = med;
  6361. }
  6362. else {
  6363. end = med;
  6364. }
  6365. }
  6366. return -1;
  6367. }
  6368. updateAddress(id, value) {
  6369. const index = this.findIndex(id);
  6370. if (index === -1) {
  6371. throw new Error("Invalid address..." + id);
  6372. }
  6373. this.data[index].value = value;
  6374. }
  6375. clear() {
  6376. for (let i = 0; i < this.data.length; i += 1) {
  6377. delete this.data[i];
  6378. }
  6379. this.data = [];
  6380. this.address_id = 0;
  6381. }
  6382. }
  6383. const inner_ref = new LocationHolder();
  6384. exports.Location = Object.freeze({
  6385. allocate: inner_ref.allocate.bind(inner_ref),
  6386. deallocate: inner_ref.deallocate.bind(inner_ref),
  6387. find: inner_ref.find.bind(inner_ref),
  6388. updateAddress: inner_ref.updateAddress.bind(inner_ref),
  6389. clear: inner_ref.clear.bind(inner_ref),
  6390. size: () => inner_ref.data.length
  6391. });
  6392. /***/ }),
  6393. /***/ "./js/processor/compatibilityTable.js":
  6394. /*!********************************************!*\
  6395. !*** ./js/processor/compatibilityTable.js ***!
  6396. \********************************************/
  6397. /*! exports provided: resultTypeAfterInfixOp, resultTypeAfterUnaryOp */
  6398. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6399. "use strict";
  6400. __webpack_require__.r(__webpack_exports__);
  6401. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resultTypeAfterInfixOp", function() { return resultTypeAfterInfixOp; });
  6402. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "resultTypeAfterUnaryOp", function() { return resultTypeAfterUnaryOp; });
  6403. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../typeSystem/types */ "./js/typeSystem/types.ts");
  6404. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__);
  6405. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.js");
  6406. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  6407. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_2__);
  6408. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/config */ "./js/util/config.js");
  6409. function buildInfixAddTable() {
  6410. var table = [[], [], [], []];
  6411. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER;
  6412. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL;
  6413. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].STRING.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].STRING;
  6414. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL;
  6415. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL;
  6416. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].STRING.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].STRING;
  6417. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].STRING.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].STRING;
  6418. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].STRING.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].STRING;
  6419. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].STRING.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].STRING.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].STRING;
  6420. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].STRING.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].STRING;
  6421. return table;
  6422. }
  6423. function buildInfixMultiDivSubTable() {
  6424. var table = [[], [], [], []];
  6425. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER;
  6426. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL;
  6427. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL;
  6428. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL;
  6429. return table;
  6430. }
  6431. function buildInfixEqualityInequalityTable() {
  6432. var table = [[], [], [], []];
  6433. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN;
  6434. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN;
  6435. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN;
  6436. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].STRING.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].STRING.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN;
  6437. return table;
  6438. }
  6439. function buildInfixRelationalTable() {
  6440. var table = [[], [], [], []];
  6441. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN;
  6442. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN;
  6443. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].STRING.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].STRING.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN;
  6444. return table;
  6445. }
  6446. function buildInfixAndOrTable() {
  6447. var table = [[], [], [], []];
  6448. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN;
  6449. return table;
  6450. }
  6451. function buildInfixModTable() {
  6452. var table = [[], [], [], []];
  6453. table[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER.ord][_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER;
  6454. return table;
  6455. }
  6456. function buildUnarySumSubList() {
  6457. var list = [];
  6458. list[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER;
  6459. list[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL;
  6460. return list;
  6461. }
  6462. function buildUnaryNegList() {
  6463. var list = [];
  6464. list[_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN.ord] = _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN;
  6465. return list;
  6466. }
  6467. function buildInfixCompatibilityTable() {
  6468. var compatibilityMap = new WeakMap();
  6469. compatibilityMap.set(_ast_operators__WEBPACK_IMPORTED_MODULE_1__["Operators"].ADD, buildInfixAddTable());
  6470. compatibilityMap.set(_ast_operators__WEBPACK_IMPORTED_MODULE_1__["Operators"].SUB, buildInfixMultiDivSubTable());
  6471. compatibilityMap.set(_ast_operators__WEBPACK_IMPORTED_MODULE_1__["Operators"].MULT, buildInfixMultiDivSubTable());
  6472. compatibilityMap.set(_ast_operators__WEBPACK_IMPORTED_MODULE_1__["Operators"].DIV, buildInfixMultiDivSubTable());
  6473. compatibilityMap.set(_ast_operators__WEBPACK_IMPORTED_MODULE_1__["Operators"].EQ, buildInfixEqualityInequalityTable());
  6474. compatibilityMap.set(_ast_operators__WEBPACK_IMPORTED_MODULE_1__["Operators"].NEQ, buildInfixEqualityInequalityTable());
  6475. compatibilityMap.set(_ast_operators__WEBPACK_IMPORTED_MODULE_1__["Operators"].GE, buildInfixRelationalTable());
  6476. compatibilityMap.set(_ast_operators__WEBPACK_IMPORTED_MODULE_1__["Operators"].GT, buildInfixRelationalTable());
  6477. compatibilityMap.set(_ast_operators__WEBPACK_IMPORTED_MODULE_1__["Operators"].LE, buildInfixRelationalTable());
  6478. compatibilityMap.set(_ast_operators__WEBPACK_IMPORTED_MODULE_1__["Operators"].LT, buildInfixRelationalTable());
  6479. compatibilityMap.set(_ast_operators__WEBPACK_IMPORTED_MODULE_1__["Operators"].OR, buildInfixAndOrTable());
  6480. compatibilityMap.set(_ast_operators__WEBPACK_IMPORTED_MODULE_1__["Operators"].AND, buildInfixAndOrTable());
  6481. compatibilityMap.set(_ast_operators__WEBPACK_IMPORTED_MODULE_1__["Operators"].MOD, buildInfixModTable());
  6482. return compatibilityMap;
  6483. }
  6484. function buildUnaryCompatibilityTable() {
  6485. var compatibilityMap = new WeakMap();
  6486. compatibilityMap.set(_ast_operators__WEBPACK_IMPORTED_MODULE_1__["Operators"].ADD, buildUnarySumSubList());
  6487. compatibilityMap.set(_ast_operators__WEBPACK_IMPORTED_MODULE_1__["Operators"].SUB, buildUnarySumSubList());
  6488. compatibilityMap.set(_ast_operators__WEBPACK_IMPORTED_MODULE_1__["Operators"].NOT, buildUnaryNegList());
  6489. return compatibilityMap;
  6490. }
  6491. var infixMap = buildInfixCompatibilityTable();
  6492. var unaryMap = buildUnaryCompatibilityTable();
  6493. function resultTypeAfterInfixOp(operator, leftExpressionType, rightExpressionType) {
  6494. try {
  6495. if (leftExpressionType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_2__["MultiType"] && rightExpressionType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_2__["MultiType"]) {
  6496. var newMulti = [];
  6497. for (var i = 0; i < leftExpressionType.types.length; ++i) {
  6498. var typeA = leftExpressionType.types[i];
  6499. for (var j = 0; j < rightExpressionType.types.length; ++i) {
  6500. var typeB = rightExpressionType.types[j];
  6501. newMulti.push(resultTypeAfterInfixOp(operator, typeA, typeB));
  6502. }
  6503. }
  6504. newMulti = newMulti.filter(function (x) {
  6505. return !x.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].UNDEFINED);
  6506. });
  6507. if (newMulti.length <= 0) {
  6508. if (_util_config__WEBPACK_IMPORTED_MODULE_3__["Config"].enable_type_casting) {
  6509. if (leftExpressionType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) || leftExpressionType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL)) {
  6510. if (rightExpressionType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) || rightExpressionType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL)) {
  6511. return new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_2__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL]);
  6512. }
  6513. }
  6514. }
  6515. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].UNDEFINED;
  6516. } else {
  6517. return new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_2__["MultiType"](newMulti);
  6518. }
  6519. } else if (leftExpressionType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_2__["MultiType"]) {
  6520. if (leftExpressionType.isCompatible(rightExpressionType)) {
  6521. return resultTypeAfterInfixOp(operator, rightExpressionType, rightExpressionType);
  6522. } else {
  6523. if (_util_config__WEBPACK_IMPORTED_MODULE_3__["Config"].enable_type_casting) {
  6524. if (leftExpressionType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) || leftExpressionType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL)) {
  6525. if (rightExpressionType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) || rightExpressionType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL)) {
  6526. return rightExpressionType;
  6527. }
  6528. }
  6529. }
  6530. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].UNDEFINED;
  6531. }
  6532. } else if (rightExpressionType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_2__["MultiType"]) {
  6533. if (rightExpressionType.isCompatible(leftExpressionType)) {
  6534. return resultTypeAfterInfixOp(operator, leftExpressionType, leftExpressionType);
  6535. } else {
  6536. if (_util_config__WEBPACK_IMPORTED_MODULE_3__["Config"].enable_type_casting) {
  6537. if (leftExpressionType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) || leftExpressionType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL)) {
  6538. if (rightExpressionType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) || rightExpressionType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL)) {
  6539. return leftExpressionType;
  6540. }
  6541. }
  6542. }
  6543. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].UNDEFINED;
  6544. }
  6545. }
  6546. var resultType = infixMap.get(operator)[leftExpressionType.ord][rightExpressionType.ord];
  6547. if (resultType === null || resultType === undefined) {
  6548. if (_util_config__WEBPACK_IMPORTED_MODULE_3__["Config"].enable_type_casting) {
  6549. if (leftExpressionType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) || leftExpressionType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL)) {
  6550. if (rightExpressionType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) || rightExpressionType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL)) {
  6551. if (operator === _ast_operators__WEBPACK_IMPORTED_MODULE_1__["Operators"].MOD) {
  6552. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER;
  6553. } else if (operator.ord >= 5 && operator.ord <= 10) {
  6554. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN;
  6555. }
  6556. }
  6557. }
  6558. }
  6559. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].UNDEFINED;
  6560. }
  6561. return resultType;
  6562. } catch (e) {
  6563. if (e instanceof TypeError) {
  6564. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].UNDEFINED;
  6565. } else {
  6566. throw e;
  6567. }
  6568. }
  6569. }
  6570. function resultTypeAfterUnaryOp(operator, leftExpressionType) {
  6571. try {
  6572. if (leftExpressionType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_2__["MultiType"]) {
  6573. return leftExpressionType;
  6574. }
  6575. var resultType = unaryMap.get(operator)[leftExpressionType.ord];
  6576. if (resultType == null) {
  6577. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].UNDEFINED;
  6578. }
  6579. return resultType;
  6580. } catch (e) {
  6581. if (e instanceof TypeError) {
  6582. return _typeSystem_types__WEBPACK_IMPORTED_MODULE_0__["Types"].UNDEFINED;
  6583. } else {
  6584. throw e;
  6585. }
  6586. }
  6587. }
  6588. /***/ }),
  6589. /***/ "./js/processor/context.ts":
  6590. /*!*********************************!*\
  6591. !*** ./js/processor/context.ts ***!
  6592. \*********************************/
  6593. /*! no static exports found */
  6594. /***/ (function(module, exports, __webpack_require__) {
  6595. "use strict";
  6596. Object.defineProperty(exports, "__esModule", { value: true });
  6597. exports.Context = Object.freeze({
  6598. BASE: Symbol('context:base'),
  6599. BREAKABLE: Symbol('context:breakable'),
  6600. FUNCTION: Symbol('context:function')
  6601. });
  6602. /***/ }),
  6603. /***/ "./js/processor/definedFunctions.js":
  6604. /*!******************************************!*\
  6605. !*** ./js/processor/definedFunctions.js ***!
  6606. \******************************************/
  6607. /*! exports provided: LanguageDefinedFunction */
  6608. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6609. "use strict";
  6610. __webpack_require__.r(__webpack_exports__);
  6611. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LanguageDefinedFunction", function() { return LanguageDefinedFunction; });
  6612. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../services/languageService */ "./js/services/languageService.js");
  6613. /* harmony import */ var _lib_io__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/io */ "./js/processor/lib/io.js");
  6614. /* harmony import */ var _lib_strings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/strings */ "./js/processor/lib/strings.js");
  6615. /* harmony import */ var _lib_arrays__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/arrays */ "./js/processor/lib/arrays.js");
  6616. /* harmony import */ var _lib_lang__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/lang */ "./js/processor/lib/lang.js");
  6617. /* harmony import */ var _lib_math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/math */ "./js/processor/lib/math.js");
  6618. function valueToKey(value, object) {
  6619. for (var key in object) {
  6620. if (Object.prototype.hasOwnProperty.call(object, key)) {
  6621. if (object[key] === value) {
  6622. return key;
  6623. }
  6624. }
  6625. }
  6626. return null;
  6627. }
  6628. function concatObjects() {
  6629. var result = {};
  6630. for (var i = 0; i < arguments.length; i++) {
  6631. var obj = i < 0 || arguments.length <= i ? undefined : arguments[i];
  6632. for (var key in obj) {
  6633. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  6634. result[key] = obj[key];
  6635. }
  6636. }
  6637. }
  6638. return result;
  6639. }
  6640. var libsObject = {
  6641. $mathLib: {
  6642. $sin: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createSinFun"])(),
  6643. $cos: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createCosFun"])(),
  6644. $tan: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createTanFun"])(),
  6645. $sqrt: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createSqrtFun"])(),
  6646. $pow: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createPowFun"])(),
  6647. $log: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createLogFun"])(),
  6648. $abs: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createAbsFun"])(),
  6649. $negate: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createNegateFun"])(),
  6650. $invert: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createInvertFun"])(),
  6651. $max: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createMaxFun"])(),
  6652. $min: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createMinFun"])(),
  6653. $rand: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createRandFun"])()
  6654. },
  6655. $ioLib: {
  6656. $read: Object(_lib_io__WEBPACK_IMPORTED_MODULE_1__["createInputFun"])(),
  6657. $write: Object(_lib_io__WEBPACK_IMPORTED_MODULE_1__["createOutputFun"])()
  6658. },
  6659. $strLib: {
  6660. $substring: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createSubstringFun"])(),
  6661. $length: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createLengthFun"])(),
  6662. $uppercase: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createUppercaseFun"])(),
  6663. $lowercase: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createLowercaseFun"])(),
  6664. $charAt: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createrCharAtFun"])()
  6665. },
  6666. $arrayLib: {
  6667. $numElements: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createNumElementsFun"])(),
  6668. $matrixLines: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createMatrixLinesFun"])(),
  6669. $matrixColumns: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createMatrixColumnsFun"])()
  6670. },
  6671. $langLib: {
  6672. $isReal: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsRealFun"])(),
  6673. $isInt: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsIntFun"])(),
  6674. $isBool: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsBoolFun"])(),
  6675. $castReal: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastRealFun"])(),
  6676. $castInt: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastIntFun"])(),
  6677. $castBool: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastBoolFun"])(),
  6678. $castString: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastStringFun"])()
  6679. }
  6680. };
  6681. var funcsObject = concatObjects(libsObject.$ioLib, libsObject.$langLib, libsObject.$strLib, libsObject.$arrayLib);
  6682. var LanguageDefinedFunction = Object.freeze({
  6683. getMainFunctionName: function getMainFunctionName() {
  6684. return _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs().main_function;
  6685. },
  6686. getInternalName: function getInternalName(localName) {
  6687. if (localName.indexOf(".") !== -1) {
  6688. var names = localName.split(".");
  6689. var lib = valueToKey(names[0], _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangLibs());
  6690. var internalName = valueToKey(names[1], _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs());
  6691. if (lib === null || internalName === null) {
  6692. return null;
  6693. }
  6694. return lib + "." + internalName;
  6695. }
  6696. var funcName = valueToKey(localName, _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs());
  6697. if (funcName !== null) {
  6698. if (funcsObject[funcName]) {
  6699. return funcName;
  6700. }
  6701. }
  6702. return null;
  6703. },
  6704. getFunction: function getFunction(internalName) {
  6705. if (internalName.indexOf(".") !== -1) {
  6706. var names = internalName.split(".");
  6707. var libName = names[0];
  6708. var funName = names[1];
  6709. return libsObject[libName][funName];
  6710. }
  6711. return funcsObject[internalName];
  6712. },
  6713. getLocalName: function getLocalName(internalName) {
  6714. if (internalName.indexOf(".") !== -1) {
  6715. var names = internalName.split(".");
  6716. var libName = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangLibs()[names[0]];
  6717. var funName = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[names[1]];
  6718. return "".concat(libName, ".").concat(funName);
  6719. } else if (_services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[internalName]) {
  6720. return _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[internalName];
  6721. } else {
  6722. return internalName;
  6723. }
  6724. }
  6725. });
  6726. /***/ }),
  6727. /***/ "./js/processor/error/processorErrorFactory.js":
  6728. /*!*****************************************************!*\
  6729. !*** ./js/processor/error/processorErrorFactory.js ***!
  6730. \*****************************************************/
  6731. /*! exports provided: ProcessorErrorFactory */
  6732. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6733. "use strict";
  6734. __webpack_require__.r(__webpack_exports__);
  6735. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ProcessorErrorFactory", function() { return ProcessorErrorFactory; });
  6736. /* harmony import */ var _runtimeError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./runtimeError */ "./js/processor/error/runtimeError.js");
  6737. /* harmony import */ var _semanticError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./semanticError */ "./js/processor/error/semanticError.js");
  6738. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  6739. /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../definedFunctions */ "./js/processor/definedFunctions.js");
  6740. var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["getInstance"]();
  6741. function createRuntimeError(i18n_id) {
  6742. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  6743. return new _runtimeError__WEBPACK_IMPORTED_MODULE_0__["RuntimeError"](LocalizedStrings.getError(i18n_id, context));
  6744. }
  6745. function createSemanticError(i18n_id) {
  6746. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  6747. return new _semanticError__WEBPACK_IMPORTED_MODULE_1__["SemanticError"](LocalizedStrings.getError(i18n_id, context));
  6748. }
  6749. var ProcessorErrorFactory = Object.freeze({
  6750. symbol_not_found_full: function symbol_not_found_full(id, sourceInfo) {
  6751. if (sourceInfo) {
  6752. var context = [id, sourceInfo.line, sourceInfo.column];
  6753. return createSemanticError("symbol_not_found_full", context);
  6754. } else {
  6755. return ProcessorErrorFactory.symbol_not_found(id);
  6756. }
  6757. },
  6758. symbol_not_found: function symbol_not_found(id) {
  6759. var context = [id];
  6760. return createSemanticError("symbol_not_found", context);
  6761. },
  6762. function_missing_full: function function_missing_full(id, sourceInfo) {
  6763. if (sourceInfo) {
  6764. var context = [id, sourceInfo.line, sourceInfo.column];
  6765. return createSemanticError("function_missing_full", context);
  6766. } else {
  6767. return ProcessorErrorFactory.function_missing(id);
  6768. }
  6769. },
  6770. function_missing: function function_missing(id) {
  6771. var context = [id];
  6772. return createSemanticError("function_missing", context);
  6773. },
  6774. main_missing: function main_missing() {
  6775. return createSemanticError("main_missing");
  6776. },
  6777. array_dimension_not_int_full: function array_dimension_not_int_full(sourceInfo) {
  6778. if (sourceInfo) {
  6779. var context = [sourceInfo.line];
  6780. return createSemanticError("array_dimension_not_int_full", context);
  6781. } else {
  6782. return ProcessorErrorFactory.array_dimension_not_int();
  6783. }
  6784. },
  6785. array_dimension_not_int: function array_dimension_not_int() {
  6786. return createSemanticError("array_dimension_not_int");
  6787. },
  6788. unknown_command_full: function unknown_command_full(sourceInfo) {
  6789. if (sourceInfo) {
  6790. var context = [sourceInfo.line];
  6791. return createRuntimeError("unknown_command_full", context);
  6792. } else {
  6793. return ProcessorErrorFactory.unknown_command();
  6794. }
  6795. },
  6796. unknown_command: function unknown_command() {
  6797. return createRuntimeError("unknown_command");
  6798. },
  6799. incompatible_types_full: function incompatible_types_full(left_type, left_dim, right_type, right_dim, exp, source_info) {
  6800. if (source_info) {
  6801. var context = [LocalizedStrings.translateType(left_type, left_dim), exp, source_info.line, LocalizedStrings.translateType(right_type, right_dim)];
  6802. return createSemanticError("incompatible_types_full", context);
  6803. } else {
  6804. return ProcessorErrorFactory.incompatible_types(left_type, left_dim, right_type, right_dim, exp);
  6805. }
  6806. },
  6807. incompatible_types: function incompatible_types(left_type, left_dim, right_type, right_dim, exp) {
  6808. var context = [LocalizedStrings.translateType(left_type, left_dim), exp, LocalizedStrings.translateType(right_type, right_dim)];
  6809. return createSemanticError("incompatible_types", context);
  6810. },
  6811. incompatible_types_array_full: function incompatible_types_array_full(exp, type, dim, sourceInfo) {
  6812. if (sourceInfo) {
  6813. var context = [exp, LocalizedStrings.translateType(type, dim), sourceInfo.line, sourceInfo.column];
  6814. return createSemanticError("incompatible_types_array_full", context);
  6815. } else {
  6816. return ProcessorErrorFactory.incompatible_types_array(exp, type, dim);
  6817. }
  6818. },
  6819. incompatible_types_array: function incompatible_types_array(exp, type, dim) {
  6820. var context = [exp, LocalizedStrings.translateType(type, dim)];
  6821. return createSemanticError("incompatible_types_array", context);
  6822. },
  6823. loop_condition_type_full: function loop_condition_type_full(exp, sourceInfo) {
  6824. if (sourceInfo) {
  6825. var context = [sourceInfo.line, sourceInfo.column, exp];
  6826. return createSemanticError("loop_condition_type_full", context);
  6827. } else {
  6828. return ProcessorErrorFactory.loop_condition_type(exp);
  6829. }
  6830. },
  6831. loop_condition_type: function loop_condition_type(exp) {
  6832. var context = [exp];
  6833. return createSemanticError("loop_condition_type", context);
  6834. },
  6835. /**
  6836. * @deprecated 01/10/2019
  6837. */
  6838. endless_loop_full: function endless_loop_full(sourceInfo) {
  6839. if (sourceInfo) {
  6840. var context = [sourceInfo.line];
  6841. return createSemanticError("endless_loop_full", context);
  6842. } else {
  6843. return ProcessorErrorFactory.endless_loop();
  6844. }
  6845. },
  6846. endless_loop: function endless_loop() {
  6847. return createSemanticError("endless_loop");
  6848. },
  6849. if_condition_type_full: function if_condition_type_full(exp, sourceInfo) {
  6850. if (sourceInfo) {
  6851. var context = [sourceInfo.line, sourceInfo.column, exp];
  6852. return createSemanticError("if_condition_type_full", context);
  6853. } else {
  6854. return ProcessorErrorFactory.if_condition_type(exp);
  6855. }
  6856. },
  6857. if_condition_type: function if_condition_type(exp) {
  6858. var context = [exp];
  6859. return createSemanticError("if_condition_type", context);
  6860. },
  6861. invalid_global_var: function invalid_global_var() {
  6862. return createRuntimeError("invalid_global_var");
  6863. },
  6864. not_implemented: function not_implemented(id) {
  6865. var context = [id];
  6866. return createRuntimeError("not_implemented", context);
  6867. },
  6868. invalid_case_type_full: function invalid_case_type_full(exp, type, dim, sourceInfo) {
  6869. if (sourceInfo) {
  6870. var context = [exp, LocalizedStrings.translateType(type, dim), sourceInfo.line, sourceInfo.column];
  6871. return createSemanticError("invalid_case_type_full", context);
  6872. } else {
  6873. return ProcessorErrorFactory.invalid_case_type(exp, type, dim);
  6874. }
  6875. },
  6876. invalid_case_type: function invalid_case_type(exp, type, dim) {
  6877. var context = [exp, LocalizedStrings.translateType(type, dim)];
  6878. return createSemanticError("invalid_case_type", context);
  6879. },
  6880. void_in_expression_full: function void_in_expression_full(id, sourceInfo) {
  6881. if (sourceInfo) {
  6882. var context = [sourceInfo.line, sourceInfo.column, id];
  6883. return createSemanticError("void_in_expression_full", context);
  6884. } else {
  6885. return ProcessorErrorFactory.void_in_expression(id);
  6886. }
  6887. },
  6888. void_in_expression: function void_in_expression(id) {
  6889. var context = [id];
  6890. return createSemanticError("void_in_expression", context);
  6891. },
  6892. invalid_array_access_full: function invalid_array_access_full(id, sourceInfo) {
  6893. if (sourceInfo) {
  6894. var context = [id, sourceInfo.line, sourceInfo.column];
  6895. return createSemanticError("invalid_array_access_full", context);
  6896. } else {
  6897. return ProcessorErrorFactory.invalid_array_access(id);
  6898. }
  6899. },
  6900. invalid_array_access: function invalid_array_access(id) {
  6901. var context = [id];
  6902. return createSemanticError("invalid_array_access", context);
  6903. },
  6904. invalid_matrix_access_full: function invalid_matrix_access_full(id, sourceInfo) {
  6905. if (sourceInfo) {
  6906. var context = [id, sourceInfo.line, sourceInfo.column];
  6907. return createSemanticError("invalid_matrix_access_full", context);
  6908. } else {
  6909. return ProcessorErrorFactory.invalid_matrix_access(id);
  6910. }
  6911. },
  6912. invalid_matrix_access: function invalid_matrix_access(id) {
  6913. var context = [id];
  6914. return createSemanticError("invalid_matrix_access", context);
  6915. },
  6916. matrix_column_outbounds_full: function matrix_column_outbounds_full(id, value, columns, sourceInfo) {
  6917. if (sourceInfo) {
  6918. var context = [sourceInfo.line, value, id, columns];
  6919. return createRuntimeError("matrix_column_outbounds_full", context);
  6920. } else {
  6921. return ProcessorErrorFactory.matrix_column_outbounds(id, value, columns);
  6922. }
  6923. },
  6924. matrix_column_outbounds: function matrix_column_outbounds(id, value, columns) {
  6925. var context = [value, id, columns];
  6926. return createRuntimeError("matrix_column_outbounds", context);
  6927. },
  6928. matrix_line_outbounds_full: function matrix_line_outbounds_full(id, value, lines, sourceInfo) {
  6929. if (sourceInfo) {
  6930. var context = [sourceInfo.line, value, id, lines];
  6931. return createRuntimeError("matrix_line_outbounds_full", context);
  6932. } else {
  6933. return ProcessorErrorFactory.matrix_line_outbounds(id, value, lines);
  6934. }
  6935. },
  6936. matrix_line_outbounds: function matrix_line_outbounds(id, value, lines) {
  6937. var context = [value, id, lines];
  6938. return createRuntimeError("matrix_line_outbounds", context);
  6939. },
  6940. vector_line_outbounds_full: function vector_line_outbounds_full(id, value, lines, sourceInfo) {
  6941. if (sourceInfo) {
  6942. var context = [sourceInfo.line, value, id, lines];
  6943. return createRuntimeError("vector_line_outbounds_full", context);
  6944. } else {
  6945. return ProcessorErrorFactory.vector_line_outbounds(id, value, lines);
  6946. }
  6947. },
  6948. vector_line_outbounds: function vector_line_outbounds(id, value, lines) {
  6949. var context = [value, id, lines];
  6950. return createRuntimeError("vector_line_outbounds", context);
  6951. },
  6952. vector_not_matrix_full: function vector_not_matrix_full(id, sourceInfo) {
  6953. if (sourceInfo) {
  6954. var context = [sourceInfo.line, id];
  6955. return createRuntimeError("vector_not_matrix_full", context);
  6956. } else {
  6957. return ProcessorErrorFactory.vector_not_matrix(id);
  6958. }
  6959. },
  6960. vector_not_matrix: function vector_not_matrix(id) {
  6961. var context = [id];
  6962. return createRuntimeError("vector_not_matrix", context);
  6963. },
  6964. function_no_return: function function_no_return(id) {
  6965. var context = [id];
  6966. return createSemanticError("function_no_return", context);
  6967. },
  6968. invalid_void_return_full: function invalid_void_return_full(id, type, dim, sourceInfo) {
  6969. if (sourceInfo) {
  6970. var context = [sourceInfo.line, id, LocalizedStrings.translateType(type, dim)];
  6971. return createSemanticError("invalid_void_return_full", context);
  6972. } else {
  6973. return ProcessorErrorFactory.invalid_void_return(id, type, dim);
  6974. }
  6975. },
  6976. invalid_void_return: function invalid_void_return(id, type, dim) {
  6977. var context = [id, LocalizedStrings.translateType(type, dim)];
  6978. return createSemanticError("invalid_void_return_full", context);
  6979. },
  6980. invalid_return_type_full: function invalid_return_type_full(id, type, dim, sourceInfo) {
  6981. if (sourceInfo) {
  6982. var context = [sourceInfo.line, id, LocalizedStrings.translateType(type, dim)];
  6983. return createSemanticError("invalid_return_type_full", context);
  6984. } else {
  6985. return ProcessorErrorFactory.invalid_return_type(id, type, dim);
  6986. }
  6987. },
  6988. invalid_return_type: function invalid_return_type(id, type, dim) {
  6989. var context = [id, LocalizedStrings.translateType(type, dim)];
  6990. return createSemanticError("invalid_return_type", context);
  6991. },
  6992. invalid_parameters_size_full: function invalid_parameters_size_full(id, expected, actual, sourceInfo) {
  6993. if (sourceInfo) {
  6994. var context = [sourceInfo.line, id, expected, actual];
  6995. return createSemanticError("invalid_parameters_size_full", context);
  6996. } else {
  6997. return ProcessorErrorFactory.invalid_parameters_size(id, expected, actual);
  6998. }
  6999. },
  7000. invalid_parameters_size: function invalid_parameters_size(id, expected, actual) {
  7001. var context = [id, expected, actual];
  7002. return createSemanticError("invalid_parameters_size", context);
  7003. },
  7004. invalid_parameter_type_full: function invalid_parameter_type_full(fun_name, exp, sourceInfo) {
  7005. if (sourceInfo) {
  7006. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name), sourceInfo.line];
  7007. return createSemanticError("invalid_parameter_type_full", context);
  7008. } else {
  7009. return ProcessorErrorFactory.invalid_parameter_type(fun_name, exp);
  7010. }
  7011. },
  7012. invalid_parameter_type: function invalid_parameter_type(fun_name, exp) {
  7013. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name)];
  7014. return createSemanticError("invalid_parameter_type_full", context);
  7015. },
  7016. invalid_ref_full: function invalid_ref_full(id, exp, sourceInfo) {
  7017. if (sourceInfo) {
  7018. var context = [exp, id, sourceInfo.line];
  7019. return createSemanticError("invalid_ref_full", context);
  7020. } else {
  7021. return ProcessorErrorFactory.invalid_ref(id, exp);
  7022. }
  7023. },
  7024. invalid_ref: function invalid_ref(id, exp) {
  7025. var context = [exp, id];
  7026. return createSemanticError("invalid_ref", context);
  7027. },
  7028. unexpected_break_command_full: function unexpected_break_command_full(sourceInfo) {
  7029. if (sourceInfo) {
  7030. var context = [sourceInfo.line];
  7031. return createRuntimeError("unexpected_break_command_full", context);
  7032. } else {
  7033. return ProcessorErrorFactory.unexpected_break_command();
  7034. }
  7035. },
  7036. unexpected_break_command: function unexpected_break_command() {
  7037. return createRuntimeError("unexpected_break_command");
  7038. },
  7039. invalid_array_literal_type_full: function invalid_array_literal_type_full(exp, sourceInfo) {
  7040. if (sourceInfo) {
  7041. var context = [sourceInfo.line, exp];
  7042. return createRuntimeError("invalid_array_literal_type_full", context);
  7043. } else {
  7044. return ProcessorErrorFactory.invalid_array_literal_type(exp);
  7045. }
  7046. },
  7047. invalid_array_literal_type: function invalid_array_literal_type(exp) {
  7048. var context = [exp];
  7049. return createRuntimeError("invalid_array_literal_type", context);
  7050. },
  7051. invalid_array_literal_line_full: function invalid_array_literal_line_full(expected, actual, sourceInfo) {
  7052. if (sourceInfo) {
  7053. var context = [sourceInfo.line, expected, actual];
  7054. return createRuntimeError("invalid_array_literal_line_full", context);
  7055. } else {
  7056. return ProcessorErrorFactory.invalid_array_literal_type(expected, actual);
  7057. }
  7058. },
  7059. invalid_array_literal_line: function invalid_array_literal_line(expected, actual) {
  7060. var context = [expected, actual];
  7061. return createRuntimeError("invalid_array_literal_line", context);
  7062. },
  7063. invalid_array_literal_column_full: function invalid_array_literal_column_full(expected, actual, sourceInfo) {
  7064. if (sourceInfo) {
  7065. var context = [sourceInfo.line, expected, actual];
  7066. return createRuntimeError("invalid_array_literal_column_full", context);
  7067. } else {
  7068. return ProcessorErrorFactory.invalid_array_literal_column(expected, actual);
  7069. }
  7070. },
  7071. invalid_array_literal_column: function invalid_array_literal_column(expected, actual) {
  7072. var context = [expected, actual];
  7073. return createRuntimeError("invalid_array_literal_column", context);
  7074. },
  7075. invalid_unary_op_full: function invalid_unary_op_full(expString, opName, type, dim, sourceInfo) {
  7076. if (sourceInfo) {
  7077. var context = [sourceInfo.line, expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(type, dim)];
  7078. return createRuntimeError("invalid_unary_op_full", context);
  7079. } else {
  7080. return ProcessorErrorFactory.invalid_unary_op(opName, type, dim);
  7081. }
  7082. },
  7083. invalid_unary_op: function invalid_unary_op(expString, opName, type, dim) {
  7084. var context = [expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(type, dim)];
  7085. return createRuntimeError("invalid_unary_op", context);
  7086. },
  7087. invalid_infix_op_full: function invalid_infix_op_full(expString, opName, typeLeft, dimLeft, typeRight, dimRight, sourceInfo) {
  7088. if (sourceInfo) {
  7089. var context = [sourceInfo.line, expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(typeLeft, dimLeft), LocalizedStrings.translateType(typeRight, dimRight)];
  7090. return createRuntimeError("invalid_infix_op_full", context);
  7091. } else {
  7092. return ProcessorErrorFactory.invalid_infix_op(opName, typeLeft, dimLeft, typeRight, dimRight);
  7093. }
  7094. },
  7095. invalid_infix_op: function invalid_infix_op(expString, opName, typeLeft, dimLeft, typeRight, dimRight) {
  7096. var context = [expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(typeLeft, dimLeft), LocalizedStrings.translateType(typeRight, dimRight)];
  7097. return createRuntimeError("invalid_infix_op", context);
  7098. },
  7099. array_dimension_not_positive_full: function array_dimension_not_positive_full(sourceInfo) {
  7100. if (sourceInfo) {
  7101. var context = [sourceInfo.line];
  7102. return createSemanticError("array_dimension_not_positive_full", context);
  7103. } else {
  7104. return ProcessorErrorFactory.array_dimension_not_positive();
  7105. }
  7106. },
  7107. array_dimension_not_positive: function array_dimension_not_positive() {
  7108. return createSemanticError("array_dimension_not_positive");
  7109. },
  7110. invalid_type_conversion: function invalid_type_conversion(value, type, dim) {
  7111. var context = [value, LocalizedStrings.translateType(type, dim)];
  7112. return createRuntimeError("invalid_type_conversion", context);
  7113. },
  7114. invalid_read_type: function invalid_read_type(exp, type, dim, name, source_info) {
  7115. var context = [source_info.line, exp, LocalizedStrings.translateType(type, dim), name];
  7116. return createRuntimeError("invalid_read_type", context);
  7117. },
  7118. invalid_read_type_array: function invalid_read_type_array(exp, typePos, dimPos, name, typeArray, dimArray, sourceInfo) {
  7119. var context = [sourceInfo.line, exp, LocalizedStrings.translateType(typePos, dimPos), name, LocalizedStrings.translateType(typeArray, dimArray)];
  7120. return createRuntimeError("invalid_read_type_array", context);
  7121. },
  7122. invalid_const_ref_full: function invalid_const_ref_full(fun_name, exp, sourceInfo) {
  7123. if (sourceInfo) {
  7124. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name), sourceInfo.line];
  7125. return createSemanticError("invalid_const_ref_full", context);
  7126. } else {
  7127. return ProcessorErrorFactory.invalid_const_ref(fun_name, exp);
  7128. }
  7129. },
  7130. invalid_const_ref: function invalid_const_ref(fun_name, exp) {
  7131. var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name)];
  7132. return createSemanticError("invalid_const_ref", context);
  7133. },
  7134. invalid_const_assignment_full: function invalid_const_assignment_full(var_id, source_info) {
  7135. if (source_info) {
  7136. var context = [source_info.line, var_id];
  7137. return createSemanticError("invalid_const_assignment_full", context);
  7138. } else {
  7139. return ProcessorErrorFactory.invalid_const_assignment(var_id);
  7140. }
  7141. },
  7142. invalid_const_assignment: function invalid_const_assignment(var_id) {
  7143. var context = [var_id];
  7144. return createSemanticError("invalid_const_assignment", context);
  7145. },
  7146. invalid_vector_assignment_full: function invalid_vector_assignment_full(left_id, left_size, right_id, right_size, source_info) {
  7147. if (source_info) {
  7148. var context = [source_info.line, left_id, left_size, right_id, right_size];
  7149. return createRuntimeError("invalid_vector_assignment_full", context);
  7150. } else {
  7151. return ProcessorErrorFactory.invalid_vector_assignment(left_id, left_size, right_id, right_size);
  7152. }
  7153. },
  7154. invalid_vector_assignment: function invalid_vector_assignment(left_id, left_size, right_id, right_size) {
  7155. var context = [left_id, left_size, right_id, right_size];
  7156. return createRuntimeError("invalid_vector_assignment", context);
  7157. },
  7158. invalid_matrix_assignment_full: function invalid_matrix_assignment_full(left_id, left_line, left_column, right_id, right_line, right_column, source_info) {
  7159. if (source_info) {
  7160. var context = [source_info.line, left_id, left_line, left_column, right_id, right_line, right_column];
  7161. return createRuntimeError("invalid_matrix_assignment_full", context);
  7162. } else {
  7163. return ProcessorErrorFactory.invalid_matrix_assignment(left_id, left_line, left_column, right_id, right_line, right_column);
  7164. }
  7165. },
  7166. invalid_matrix_assignment: function invalid_matrix_assignment(left_id, left_line, left_column, right_id, right_line, right_column) {
  7167. var context = [left_id, left_line, left_column, right_id, right_line, right_column];
  7168. return createRuntimeError("invalid_matrix_assignment", context);
  7169. },
  7170. matrix_to_vector_attr: function matrix_to_vector_attr(left_id, right_id, source_info) {
  7171. // SourceInfo have to be valid...
  7172. var context = [source_info.line, right_id, left_id];
  7173. return createSemanticError("matrix_to_vector_attr", context);
  7174. },
  7175. vector_to_matrix_attr: function vector_to_matrix_attr(left_id, right_id, source_info) {
  7176. // SourceInfo have to be valid...
  7177. var context = [source_info.line, right_id, left_id];
  7178. return createSemanticError("vector_to_matrix_attr", context);
  7179. },
  7180. invalid_matrix_index_assign_full: function invalid_matrix_index_assign_full(mat_id, mat_line, mat_size, exp, exp_size, source_info) {
  7181. if (source_info) {
  7182. var context = [source_info.line, mat_line, mat_id, mat_size, exp, exp_size];
  7183. return createRuntimeError("invalid_matrix_index_assign_full", context);
  7184. } else {
  7185. return ProcessorErrorFactory.invalid_matrix_index_assign(mat_id, mat_line, mat_size, exp, exp_size);
  7186. }
  7187. },
  7188. invalid_matrix_index_assign: function invalid_matrix_index_assign(mat_id, mat_line, mat_size, exp, exp_size) {
  7189. var context = [mat_line, mat_id, mat_size, exp, exp_size];
  7190. return createRuntimeError("invalid_matrix_index_assign", context);
  7191. },
  7192. invalid_number_elements_vector: function invalid_number_elements_vector(expected_num, exp, actual_num, source_info) {
  7193. // SourceInfo have to be valid...
  7194. var context = [expected_num, source_info.line, exp, actual_num];
  7195. return createRuntimeError("invalid_number_elements_vector", context);
  7196. },
  7197. invalid_number_lines_matrix: function invalid_number_lines_matrix(expected_num, exp, actual_num, source_info) {
  7198. // SourceInfo have to be valid...
  7199. var context = [expected_num, source_info.line, exp, actual_num];
  7200. return createRuntimeError("invalid_number_lines_matrix", context);
  7201. },
  7202. divsion_by_zero_full: function divsion_by_zero_full(exp, source_info) {
  7203. if (source_info) {
  7204. var context = [source_info.line, exp];
  7205. return createRuntimeError("divsion_by_zero_full", context);
  7206. } else {
  7207. return ProcessorErrorFactory.divsion_by_zero(exp);
  7208. }
  7209. },
  7210. divsion_by_zero: function divsion_by_zero(exp) {
  7211. var context = [exp];
  7212. return createRuntimeError("divsion_by_zero", context);
  7213. },
  7214. undefined_tanget_value: function undefined_tanget_value(value, source_info) {
  7215. var context = [source_info.line, value];
  7216. return createRuntimeError("undefined_tanget_value", context);
  7217. },
  7218. negative_log_value: function negative_log_value(source_info) {
  7219. return createRuntimeError("negative_log_value", [source_info.line]);
  7220. },
  7221. invalid_string_index: function invalid_string_index(index, str, source_info) {
  7222. var local_fun_name = _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName("$charAt");
  7223. var context = [source_info.line, local_fun_name, index, str, str.length - 1];
  7224. return createRuntimeError("invalid_string_index", context);
  7225. },
  7226. negative_sqrt_value: function negative_sqrt_value(source_info) {
  7227. return createRuntimeError("negative_sqrt_value", [source_info.line]);
  7228. },
  7229. /**
  7230. * @deprecated 01/10/2019
  7231. */
  7232. exceeded_recursive_calls: function exceeded_recursive_calls(source_info) {
  7233. var context = [source_info.line];
  7234. return createRuntimeError("exceeded_recursive_calls", context);
  7235. },
  7236. invalid_for_variable: function invalid_for_variable(id, source_info) {
  7237. var context = [source_info.line, id];
  7238. return createSemanticError("invalid_for_variable", context);
  7239. },
  7240. invalid_for_from: function invalid_for_from(exp, source_info) {
  7241. var context = [source_info.line, exp];
  7242. return createSemanticError("invalid_for_from", context);
  7243. },
  7244. invalid_for_to: function invalid_for_to(exp, source_info) {
  7245. var context = [source_info.line, exp];
  7246. return createSemanticError("invalid_for_to", context);
  7247. },
  7248. invalid_for_pass: function invalid_for_pass(exp, source_info) {
  7249. var context = [source_info.line, exp];
  7250. return createSemanticError("invalid_for_pass", context);
  7251. },
  7252. exceed_max_instructions: function exceed_max_instructions() {
  7253. return createRuntimeError('exceed_max_instructions');
  7254. }
  7255. });
  7256. /***/ }),
  7257. /***/ "./js/processor/error/runtimeError.js":
  7258. /*!********************************************!*\
  7259. !*** ./js/processor/error/runtimeError.js ***!
  7260. \********************************************/
  7261. /*! exports provided: RuntimeError */
  7262. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7263. "use strict";
  7264. __webpack_require__.r(__webpack_exports__);
  7265. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RuntimeError", function() { return RuntimeError; });
  7266. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  7267. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7268. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  7269. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7270. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  7271. function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
  7272. 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; } }
  7273. function _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
  7274. function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
  7275. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  7276. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  7277. var RuntimeError =
  7278. /*#__PURE__*/
  7279. function (_Error) {
  7280. _inherits(RuntimeError, _Error);
  7281. function RuntimeError() {
  7282. var _getPrototypeOf2;
  7283. var _this;
  7284. _classCallCheck(this, RuntimeError);
  7285. for (var _len = arguments.length, msg = new Array(_len), _key = 0; _key < _len; _key++) {
  7286. msg[_key] = arguments[_key];
  7287. }
  7288. _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(RuntimeError)).call.apply(_getPrototypeOf2, [this].concat(msg)));
  7289. if (Error.captureStackTrace) Error.captureStackTrace(_assertThisInitialized(_this), RuntimeError);
  7290. return _this;
  7291. }
  7292. return RuntimeError;
  7293. }(_wrapNativeSuper(Error));
  7294. /***/ }),
  7295. /***/ "./js/processor/error/semanticError.js":
  7296. /*!*********************************************!*\
  7297. !*** ./js/processor/error/semanticError.js ***!
  7298. \*********************************************/
  7299. /*! exports provided: SemanticError */
  7300. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7301. "use strict";
  7302. __webpack_require__.r(__webpack_exports__);
  7303. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SemanticError", function() { return SemanticError; });
  7304. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  7305. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7306. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  7307. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7308. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  7309. function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
  7310. 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; } }
  7311. function _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
  7312. function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
  7313. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  7314. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  7315. var SemanticError =
  7316. /*#__PURE__*/
  7317. function (_Error) {
  7318. _inherits(SemanticError, _Error);
  7319. function SemanticError() {
  7320. var _getPrototypeOf2;
  7321. var _this;
  7322. _classCallCheck(this, SemanticError);
  7323. for (var _len = arguments.length, msg = new Array(_len), _key = 0; _key < _len; _key++) {
  7324. msg[_key] = arguments[_key];
  7325. }
  7326. _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(SemanticError)).call.apply(_getPrototypeOf2, [this].concat(msg)));
  7327. if (Error.captureStackTrace) Error.captureStackTrace(_assertThisInitialized(_this), SemanticError);
  7328. return _this;
  7329. }
  7330. return SemanticError;
  7331. }(_wrapNativeSuper(Error));
  7332. /***/ }),
  7333. /***/ "./js/processor/ivprogProcessor.js":
  7334. /*!*****************************************!*\
  7335. !*** ./js/processor/ivprogProcessor.js ***!
  7336. \*****************************************/
  7337. /*! exports provided: IVProgProcessor */
  7338. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7339. "use strict";
  7340. __webpack_require__.r(__webpack_exports__);
  7341. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IVProgProcessor", function() { return IVProgProcessor; });
  7342. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./store/store */ "./js/processor/store/store.ts");
  7343. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_store_store__WEBPACK_IMPORTED_MODULE_0__);
  7344. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modes */ "./js/processor/modes.ts");
  7345. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_1__);
  7346. /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./context */ "./js/processor/context.ts");
  7347. /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_context__WEBPACK_IMPORTED_MODULE_2__);
  7348. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../typeSystem/types */ "./js/typeSystem/types.ts");
  7349. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
  7350. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.js");
  7351. /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./definedFunctions */ "./js/processor/definedFunctions.js");
  7352. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./compatibilityTable */ "./js/processor/compatibilityTable.js");
  7353. /* harmony import */ var _ast_commands___WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../ast/commands/ */ "./js/ast/commands/index.js");
  7354. /* harmony import */ var _ast_expressions___WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../ast/expressions/ */ "./js/ast/expressions/index.js");
  7355. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  7356. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_9__);
  7357. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  7358. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../util/config */ "./js/util/config.js");
  7359. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  7360. /* harmony import */ var _error_runtimeError__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./error/runtimeError */ "./js/processor/error/runtimeError.js");
  7361. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../memory/location */ "./js/memory/location.ts");
  7362. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_memory_location__WEBPACK_IMPORTED_MODULE_14__);
  7363. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./store/value/store_value */ "./js/processor/store/value/store_value.ts");
  7364. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_15__);
  7365. /* harmony import */ var _store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./store/value/store_value_ref */ "./js/processor/store/value/store_value_ref.ts");
  7366. /* harmony import */ var _store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_16__);
  7367. /* harmony import */ var _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./store/value/array_store_value */ "./js/processor/store/value/array_store_value.ts");
  7368. /* harmony import */ var _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_store_value_array_store_value__WEBPACK_IMPORTED_MODULE_17__);
  7369. /* harmony import */ var _store_value_array_store_value_ref__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./store/value/array_store_value_ref */ "./js/processor/store/value/array_store_value_ref.ts");
  7370. /* harmony import */ var _store_value_array_store_value_ref__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(_store_value_array_store_value_ref__WEBPACK_IMPORTED_MODULE_18__);
  7371. /* harmony import */ var _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./store/value/store_value_address */ "./js/processor/store/value/store_value_address.ts");
  7372. /* harmony import */ var _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value_address__WEBPACK_IMPORTED_MODULE_19__);
  7373. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  7374. function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
  7375. function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
  7376. function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
  7377. function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  7378. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7379. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  7380. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  7381. var IVProgProcessor =
  7382. /*#__PURE__*/
  7383. function () {
  7384. _createClass(IVProgProcessor, null, [{
  7385. key: "MAIN_INTERNAL_ID",
  7386. get: function get() {
  7387. return "$main";
  7388. }
  7389. }]);
  7390. function IVProgProcessor(ast) {
  7391. _classCallCheck(this, IVProgProcessor);
  7392. this.ast = ast;
  7393. this.globalStore = new _store_store__WEBPACK_IMPORTED_MODULE_0__["Store"]("$global");
  7394. this.stores = [this.globalStore];
  7395. this.context = [_context__WEBPACK_IMPORTED_MODULE_2__["Context"].BASE];
  7396. this.input = null;
  7397. this.forceKill = false;
  7398. this.output = null;
  7399. this.mode = _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].RUN;
  7400. /**
  7401. * Stores the sourceInfo of every function call, command or expression
  7402. */
  7403. this.function_call_stack = [];
  7404. this.instruction_count = 0;
  7405. this.function_call_count = 0;
  7406. }
  7407. _createClass(IVProgProcessor, [{
  7408. key: "registerInput",
  7409. value: function registerInput(input) {
  7410. if (this.input !== null) this.input = null;
  7411. this.input = input;
  7412. }
  7413. }, {
  7414. key: "registerOutput",
  7415. value: function registerOutput(output) {
  7416. if (this.output !== null) this.output = null;
  7417. this.output = output;
  7418. }
  7419. }, {
  7420. key: "checkContext",
  7421. value: function checkContext(context) {
  7422. return this.context[this.context.length - 1] === context;
  7423. }
  7424. }, {
  7425. key: "ignoreSwitchCases",
  7426. value: function ignoreSwitchCases(store) {
  7427. if (store.mode === _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].RETURN) {
  7428. return true;
  7429. } else if (store.mode === _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].BREAK) {
  7430. return true;
  7431. } else {
  7432. return false;
  7433. }
  7434. }
  7435. }, {
  7436. key: "prepareState",
  7437. value: function prepareState() {
  7438. if (this.stores !== null) {
  7439. for (var i = 0; i < this.stores.length; i++) {
  7440. delete this.stores[i];
  7441. }
  7442. this.stores = null;
  7443. }
  7444. if (this.globalStore !== null) this.globalStore = null;
  7445. this.globalStore = new _store_store__WEBPACK_IMPORTED_MODULE_0__["Store"]("$global");
  7446. this.stores = [this.globalStore];
  7447. this.context = [_context__WEBPACK_IMPORTED_MODULE_2__["Context"].BASE];
  7448. this.instruction_count = 0;
  7449. this.mode = _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].RUN;
  7450. }
  7451. }, {
  7452. key: "interpretAST",
  7453. value: function interpretAST() {
  7454. var _this = this;
  7455. this.prepareState();
  7456. _memory_location__WEBPACK_IMPORTED_MODULE_14__["Location"].clear();
  7457. return this.initGlobal().then(function (_) {
  7458. var mainFunc = _this.findMainFunction();
  7459. if (mainFunc === null) {
  7460. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].main_missing());
  7461. }
  7462. return _this.runFunction(mainFunc, [], _this.globalStore);
  7463. });
  7464. }
  7465. }, {
  7466. key: "initGlobal",
  7467. value: function initGlobal() {
  7468. if (!this.checkContext(_context__WEBPACK_IMPORTED_MODULE_2__["Context"].BASE)) {
  7469. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].invalid_global_var());
  7470. }
  7471. return this.executeCommands(this.globalStore, this.ast.global);
  7472. }
  7473. }, {
  7474. key: "findMainFunction",
  7475. value: function findMainFunction() {
  7476. return this.ast.functions.find(function (v) {
  7477. return v.isMain;
  7478. });
  7479. }
  7480. }, {
  7481. key: "findFunction",
  7482. value: function findFunction(name) {
  7483. if (name.match(/^\$.+$/)) {
  7484. if (name === IVProgProcessor.MAIN_INTERNAL_ID) {
  7485. return this.findMainFunction();
  7486. }
  7487. var fun = _definedFunctions__WEBPACK_IMPORTED_MODULE_5__["LanguageDefinedFunction"].getFunction(name);
  7488. if (!fun) {
  7489. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].not_implemented(name);
  7490. }
  7491. return fun;
  7492. } else {
  7493. var val = this.ast.functions.find(function (v) {
  7494. return v.name === name;
  7495. });
  7496. if (!val) {
  7497. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].function_missing(name);
  7498. }
  7499. return val;
  7500. }
  7501. }
  7502. }, {
  7503. key: "runFunction",
  7504. value: function runFunction(func, actualParameters, store) {
  7505. var _this2 = this;
  7506. var funcName = func.isMain ? IVProgProcessor.MAIN_INTERNAL_ID : func.name;
  7507. var funcStore = new _store_store__WEBPACK_IMPORTED_MODULE_0__["Store"](funcName);
  7508. funcStore.extendStore(this.globalStore);
  7509. return new Promise(function (resolve, reject) {
  7510. var run_lambda = function run_lambda() {
  7511. var newFuncStore$ = _this2.associateParameters(func.formalParameters, actualParameters, store, funcStore);
  7512. newFuncStore$.then(function (sto) {
  7513. _this2.context.push(_context__WEBPACK_IMPORTED_MODULE_2__["Context"].FUNCTION);
  7514. _this2.stores.push(sto);
  7515. return _this2.executeCommands(sto, func.variablesDeclarations).then(function (stoWithVars) {
  7516. return _this2.executeCommands(stoWithVars, func.commands);
  7517. }).then(function (finalSto) {
  7518. _this2.stores.pop();
  7519. _this2.context.pop();
  7520. return finalSto;
  7521. });
  7522. }).then(resolve)["catch"](reject);
  7523. };
  7524. run_lambda();
  7525. });
  7526. }
  7527. }, {
  7528. key: "associateParameters",
  7529. value: function associateParameters(formal_params, effective_params, caller_store, callee_store) {
  7530. var _this3 = this;
  7531. var funcName = callee_store.name === IVProgProcessor.MAIN_INTERNAL_ID ? _definedFunctions__WEBPACK_IMPORTED_MODULE_5__["LanguageDefinedFunction"].getMainFunctionName() : callee_store.name;
  7532. if (formal_params.length != effective_params.length) {
  7533. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].invalid_parameters_size(funcName, formal_params.length, effective_params.length));
  7534. }
  7535. var promises$ = effective_params.map(function (actual_param) {
  7536. return _this3.evaluateExpression(caller_store, actual_param);
  7537. });
  7538. return Promise.all(promises$).then(function (values) {
  7539. for (var i = 0; i < values.length; i++) {
  7540. var sto_value = values[i]; // console.log(callee_store.name);
  7541. // console.log(sto_value);
  7542. var exp = effective_params[i];
  7543. var shouldTypeCast = false;
  7544. var formalParameter = formal_params[i];
  7545. if (!formalParameter.type.isCompatible(sto_value.type)) {
  7546. if (_util_config__WEBPACK_IMPORTED_MODULE_11__["Config"].enable_type_casting && !formalParameter.byRef && _store_store__WEBPACK_IMPORTED_MODULE_0__["Store"].canImplicitTypeCast(formalParameter.type, sto_value.type)) {
  7547. shouldTypeCast = true;
  7548. } else {
  7549. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].invalid_parameter_type(funcName, exp.toString()));
  7550. }
  7551. }
  7552. if (formalParameter.byRef && !sto_value.inStore()) {
  7553. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].invalid_ref(funcName, exp.toString()));
  7554. }
  7555. if (formalParameter.byRef) {
  7556. (function () {
  7557. var realObj = caller_store.getStoreObject(sto_value.id);
  7558. var ref = null;
  7559. if (sto_value instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_17__["ArrayStoreValue"]) {
  7560. // it's a vector or matrix...
  7561. var _values = sto_value.get();
  7562. var array_type = sto_value.type;
  7563. var addresses = _values.map(function (v) {
  7564. return realObj.getLocAddressOf(v.line, v.column);
  7565. });
  7566. var columns = sto_value.isVector() ? 0 : sto_value.columns;
  7567. ref = new _store_value_array_store_value_ref__WEBPACK_IMPORTED_MODULE_18__["ArrayStoreValueRef"](array_type, _values, addresses, sto_value.lines, columns, realObj.id);
  7568. } else {
  7569. if (sto_value instanceof _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_19__["StoreValueAddress"]) {
  7570. var line = sto_value.line;
  7571. var column = sto_value.column;
  7572. ref = new _store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_16__["StoreValueRef"](sto_value.type, sto_value.get(), realObj.getLocAddressOf(line, column), realObj.id);
  7573. ref.setReferenceDimension(realObj.type.dimensions);
  7574. } else {
  7575. ref = new _store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_16__["StoreValueRef"](sto_value.type, sto_value.get(), realObj.locAddress, realObj.id);
  7576. }
  7577. }
  7578. callee_store.insertStore(formalParameter.id, ref);
  7579. })();
  7580. } else {
  7581. var realValue = sto_value;
  7582. if (shouldTypeCast) {
  7583. realValue = _store_store__WEBPACK_IMPORTED_MODULE_0__["Store"].doImplicitCasting(formalParameter.type, realValue);
  7584. }
  7585. callee_store.insertStore(formalParameter.id, realValue);
  7586. }
  7587. }
  7588. return callee_store;
  7589. });
  7590. }
  7591. }, {
  7592. key: "executeCommands",
  7593. value: function executeCommands(store, cmds) {
  7594. var _this4 = this;
  7595. // helper to partially apply a function, in this case executeCommand
  7596. var partial = function partial(fun, cmd) {
  7597. return function (sto) {
  7598. return fun(sto, cmd);
  7599. };
  7600. };
  7601. return cmds.reduce(function (lastCommand, next) {
  7602. var nextCommand = partial(_this4.executeCommand.bind(_this4), next);
  7603. return lastCommand.then(nextCommand);
  7604. }, Promise.resolve(store));
  7605. }
  7606. }, {
  7607. key: "executeCommand",
  7608. value: function executeCommand(store, cmd) {
  7609. var _this5 = this;
  7610. this.instruction_count += 1;
  7611. return new Promise(function (resolve, reject) {
  7612. var command_lambda = function command_lambda() {
  7613. if (_this5.instruction_count >= _util_config__WEBPACK_IMPORTED_MODULE_11__["Config"].max_instruction_count) {
  7614. return reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].exceed_max_instructions());
  7615. } else if (_this5.forceKill) {
  7616. return reject("FORCED_KILL!");
  7617. } else if (store.mode === _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].PAUSE) {
  7618. return resolve(_this5.executeCommand(store, cmd));
  7619. } else if (store.mode === _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].RETURN) {
  7620. return resolve(store);
  7621. } else if (_this5.checkContext(_context__WEBPACK_IMPORTED_MODULE_2__["Context"].BREAKABLE) && store.mode === _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].BREAK) {
  7622. return resolve(store);
  7623. } else if (_this5.mode === _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].ABORT) {
  7624. return reject(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_20__["LocalizedStrings"].getMessage('aborted_execution'));
  7625. }
  7626. if (cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_7__["Declaration"]) {
  7627. return resolve(_this5.executeDeclaration(store, cmd));
  7628. } else if (cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_7__["ArrayIndexAssign"]) {
  7629. return resolve(_this5.executeArrayIndexAssign(store, cmd));
  7630. } else if (cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_7__["Assign"]) {
  7631. return resolve(_this5.executeAssign(store, cmd));
  7632. } else if (cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_7__["Break"]) {
  7633. return resolve(_this5.executeBreak(store, cmd));
  7634. } else if (cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_7__["Return"]) {
  7635. return resolve(_this5.executeReturn(store, cmd));
  7636. } else if (cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_7__["IfThenElse"]) {
  7637. return resolve(_this5.executeIfThenElse(store, cmd));
  7638. } else if (cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_7__["RepeatUntil"]) {
  7639. return resolve(_this5.executeRepeatUntil(store, cmd));
  7640. } else if (cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_7__["While"]) {
  7641. return resolve(_this5.executeWhile(store, cmd));
  7642. } else if (cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_7__["For"]) {
  7643. return resolve(_this5.executeFor(store, cmd));
  7644. } else if (cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_7__["Switch"]) {
  7645. return resolve(_this5.executeSwitch(store, cmd));
  7646. } else if (cmd instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_8__["FunctionCall"]) {
  7647. return resolve(_this5.executeFunctionCall(store, cmd));
  7648. } else if (cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_7__["SysCall"]) {
  7649. return resolve(_this5.executeSysCall(store, cmd));
  7650. } else {
  7651. return reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].unknown_command(cmd.sourceInfo));
  7652. }
  7653. };
  7654. if (_this5.instruction_count % _util_config__WEBPACK_IMPORTED_MODULE_11__["Config"].suspend_threshold == 0) {
  7655. //every 100th command should briefly delay its execution in order to allow the browser to process other things
  7656. setTimeout(command_lambda, 5);
  7657. } else {
  7658. command_lambda();
  7659. }
  7660. });
  7661. }
  7662. }, {
  7663. key: "executeSysCall",
  7664. value: function executeSysCall(store, cmd) {
  7665. var func = cmd.langFunc.bind(this);
  7666. return func(store, cmd);
  7667. }
  7668. }, {
  7669. key: "executeFunctionCall",
  7670. value: function executeFunctionCall(store, cmd) {
  7671. var _this6 = this;
  7672. var func = null;
  7673. if (cmd.isMainCall) {
  7674. func = this.findMainFunction();
  7675. } else {
  7676. func = this.findFunction(cmd.id);
  7677. } // if(this.function_call_stack.length >= Config.max_call_stack) {
  7678. // return Promise.reject(ProcessorErrorFactory.exceeded_recursive_calls(cmd.sourceInfo));
  7679. // }
  7680. this.function_call_stack.push(cmd.sourceInfo);
  7681. return this.runFunction(func, cmd.actualParameters, store).then(function (sto) {
  7682. sto.destroy();
  7683. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].VOID.isCompatible(func.returnType) && sto.mode !== _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].RETURN) {
  7684. var funcName = func.name === IVProgProcessor.MAIN_INTERNAL_ID ? _definedFunctions__WEBPACK_IMPORTED_MODULE_5__["LanguageDefinedFunction"].getMainFunctionName() : func.name;
  7685. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].function_no_return(funcName));
  7686. } else {
  7687. _this6.function_call_stack.pop();
  7688. return store;
  7689. }
  7690. });
  7691. }
  7692. }, {
  7693. key: "executeSwitch",
  7694. value: function executeSwitch(store, cmd) {
  7695. var _this7 = this;
  7696. this.context.push(_context__WEBPACK_IMPORTED_MODULE_2__["Context"].BREAKABLE);
  7697. var caseSequence = cmd.cases.reduce(function (prev, next) {
  7698. return prev.then(function (tuple) {
  7699. if (_this7.ignoreSwitchCases(tuple[1])) {
  7700. return Promise.resolve(tuple);
  7701. } else if (tuple[0] || next.isDefault) {
  7702. return _this7.executeCommands(tuple[1], next.commands).then(function (nSto) {
  7703. return Promise.resolve([true, nSto]);
  7704. });
  7705. } else {
  7706. var equalityInfixApp = new _ast_expressions___WEBPACK_IMPORTED_MODULE_8__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].EQ, cmd.expression, next.expression);
  7707. equalityInfixApp.sourceInfo = next.sourceInfo;
  7708. return _this7.evaluateExpression(tuple[1], equalityInfixApp).then(function (stoObj) {
  7709. return stoObj.get();
  7710. }).then(function (isEqual) {
  7711. if (isEqual) {
  7712. return _this7.executeCommands(tuple[1], next.commands).then(function (nSto) {
  7713. return Promise.resolve([true, nSto]);
  7714. });
  7715. } else {
  7716. return Promise.resolve(tuple);
  7717. }
  7718. });
  7719. }
  7720. });
  7721. }, Promise.resolve([false, store]));
  7722. return caseSequence.then(function (tuple) {
  7723. _this7.context.pop();
  7724. var newStore = tuple[1];
  7725. if (newStore.mode === _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].BREAK) {
  7726. newStore.mode = _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].RUN;
  7727. }
  7728. return newStore;
  7729. });
  7730. }
  7731. /**
  7732. *
  7733. * @param {Store} store
  7734. * @param {Commands.For} cmd
  7735. */
  7736. }, {
  7737. key: "executeFor",
  7738. value: function executeFor(store, cmd) {
  7739. var _this8 = this;
  7740. //BEGIN for -> while rewrite
  7741. var initCmd = new _ast_commands___WEBPACK_IMPORTED_MODULE_7__["Assign"](cmd.for_id.id, cmd.for_from);
  7742. initCmd.sourceInfo = cmd.sourceInfo;
  7743. var is_forward_exp = new _ast_expressions___WEBPACK_IMPORTED_MODULE_8__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].GE, cmd.for_to, cmd.for_from);
  7744. return this.evaluateExpression(store, is_forward_exp).then(function (result) {
  7745. var is_forward = result.value;
  7746. var condition = null;
  7747. if (is_forward) {
  7748. condition = new _ast_expressions___WEBPACK_IMPORTED_MODULE_8__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].LE, cmd.for_id, cmd.for_to);
  7749. } else {
  7750. condition = new _ast_expressions___WEBPACK_IMPORTED_MODULE_8__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].GE, cmd.for_id, cmd.for_to);
  7751. }
  7752. condition.sourceInfo = cmd.sourceInfo;
  7753. var pass_value = cmd.for_pass;
  7754. if (pass_value == null) {
  7755. if (is_forward) {
  7756. pass_value = new _ast_expressions___WEBPACK_IMPORTED_MODULE_8__["IntLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_10__["toInt"])(1));
  7757. } else {
  7758. pass_value = new _ast_expressions___WEBPACK_IMPORTED_MODULE_8__["IntLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_10__["toInt"])(-1));
  7759. }
  7760. }
  7761. var increment = new _ast_commands___WEBPACK_IMPORTED_MODULE_7__["Assign"](cmd.for_id.id, new _ast_expressions___WEBPACK_IMPORTED_MODULE_8__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].ADD, cmd.for_id, pass_value));
  7762. increment.sourceInfo = cmd.sourceInfo;
  7763. var whileBlock = new _ast_commands___WEBPACK_IMPORTED_MODULE_7__["CommandBlock"]([], cmd.commands.concat(increment));
  7764. var forAsWhile = new _ast_commands___WEBPACK_IMPORTED_MODULE_7__["While"](condition, whileBlock);
  7765. forAsWhile.sourceInfo = cmd.sourceInfo; //END for -> while rewrite
  7766. var newCmdList = [initCmd, forAsWhile];
  7767. return _this8.executeCommands(store, newCmdList);
  7768. })["catch"](function (error) {
  7769. return Promise.reject(error);
  7770. });
  7771. }
  7772. }, {
  7773. key: "executeRepeatUntil",
  7774. value: function executeRepeatUntil(store, cmd) {
  7775. var _this9 = this;
  7776. try {
  7777. this.context.push(_context__WEBPACK_IMPORTED_MODULE_2__["Context"].BREAKABLE);
  7778. var $newStore = this.executeCommands(store, cmd.commands);
  7779. return $newStore.then(function (sto) {
  7780. if (sto.mode === _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].BREAK) {
  7781. _this9.context.pop();
  7782. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].RUN;
  7783. return sto;
  7784. }
  7785. var $value = _this9.evaluateExpression(sto, cmd.expression);
  7786. return $value.then(function (vl) {
  7787. if (!vl.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN)) {
  7788. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].loop_condition_type_full(cmd.sourceInfo));
  7789. }
  7790. if (!vl.get()) {
  7791. _this9.context.pop();
  7792. return _this9.executeCommand(sto, cmd);
  7793. } else {
  7794. _this9.context.pop();
  7795. return sto;
  7796. }
  7797. });
  7798. });
  7799. } catch (error) {
  7800. return Promise.reject(error);
  7801. }
  7802. }
  7803. }, {
  7804. key: "executeWhile",
  7805. value: function executeWhile(store, cmd) {
  7806. var _this10 = this;
  7807. try {
  7808. this.context.push(_context__WEBPACK_IMPORTED_MODULE_2__["Context"].BREAKABLE);
  7809. var $value = this.evaluateExpression(store, cmd.expression);
  7810. return $value.then(function (vl) {
  7811. if (vl.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN)) {
  7812. if (vl.get()) {
  7813. var $newStore = _this10.executeCommands(store, cmd.commands);
  7814. return $newStore.then(function (sto) {
  7815. _this10.context.pop();
  7816. if (sto.mode === _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].BREAK) {
  7817. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].RUN;
  7818. return sto;
  7819. }
  7820. return _this10.executeCommand(sto, cmd);
  7821. });
  7822. } else {
  7823. _this10.context.pop();
  7824. return store;
  7825. }
  7826. } else {
  7827. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].loop_condition_type_full(cmd.expression.toString(), cmd.sourceInfo));
  7828. }
  7829. });
  7830. } catch (error) {
  7831. return Promise.reject(error);
  7832. }
  7833. }
  7834. }, {
  7835. key: "executeIfThenElse",
  7836. value: function executeIfThenElse(store, cmd) {
  7837. var _this11 = this;
  7838. try {
  7839. var $value = this.evaluateExpression(store, cmd.condition);
  7840. return $value.then(function (vl) {
  7841. if (vl.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN)) {
  7842. if (vl.get()) {
  7843. return _this11.executeCommands(store, cmd.ifTrue.commands);
  7844. } else if (cmd.ifFalse !== null) {
  7845. if (cmd.ifFalse instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_7__["IfThenElse"]) {
  7846. return _this11.executeCommand(store, cmd.ifFalse);
  7847. } else {
  7848. return _this11.executeCommands(store, cmd.ifFalse.commands);
  7849. }
  7850. } else {
  7851. return Promise.resolve(store);
  7852. }
  7853. } else {
  7854. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].if_condition_type_full(cmd.condition.toString(), cmd.sourceInfo));
  7855. }
  7856. });
  7857. } catch (error) {
  7858. return Promise.reject(error);
  7859. }
  7860. }
  7861. }, {
  7862. key: "executeReturn",
  7863. value: function executeReturn(store, cmd) {
  7864. try {
  7865. var funcName = store.name === IVProgProcessor.MAIN_INTERNAL_ID ? _definedFunctions__WEBPACK_IMPORTED_MODULE_5__["LanguageDefinedFunction"].getMainFunctionName() : store.name; // console.log(funcName, store.name === IVProgProcessor.MAIN_INTERNAL_ID);
  7866. var func = this.findFunction(store.name);
  7867. var funcType = func.returnType;
  7868. var $value = this.evaluateExpression(store, cmd.expression);
  7869. return $value.then(function (value) {
  7870. var real_value = value;
  7871. if (value === null && funcType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].VOID)) {
  7872. store.mode = _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].RETURN;
  7873. return Promise.resolve(store);
  7874. }
  7875. if (value === null || !funcType.isCompatible(value.type)) {
  7876. if (!_util_config__WEBPACK_IMPORTED_MODULE_11__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_0__["Store"].canImplicitTypeCast(funcType, value.type)) {
  7877. var stringInfo = funcType.stringInfo();
  7878. var info = stringInfo[0];
  7879. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].invalid_return_type_full(funcName, info.type, info.dim, cmd.sourceInfo));
  7880. }
  7881. real_value = _store_store__WEBPACK_IMPORTED_MODULE_0__["Store"].doImplicitCasting(funcType, value);
  7882. } else {
  7883. store.insertStore('$', real_value);
  7884. store.mode = _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].RETURN;
  7885. return Promise.resolve(store);
  7886. }
  7887. });
  7888. } catch (error) {
  7889. return Promise.reject(error);
  7890. }
  7891. }
  7892. }, {
  7893. key: "executeBreak",
  7894. value: function executeBreak(store, cmd) {
  7895. if (this.checkContext(_context__WEBPACK_IMPORTED_MODULE_2__["Context"].BREAKABLE)) {
  7896. store.mode = _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].BREAK;
  7897. return Promise.resolve(store);
  7898. } else {
  7899. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].unexpected_break_command_full(cmd.sourceInfo));
  7900. }
  7901. }
  7902. }, {
  7903. key: "executeAssign",
  7904. value: function executeAssign(store, cmd) {
  7905. try {
  7906. var inStore = store.applyStore(cmd.id);
  7907. if (inStore.isConst) {
  7908. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo));
  7909. }
  7910. var $value = this.evaluateExpression(store, cmd.expression);
  7911. return $value.then(function (vl) {
  7912. var realValue = vl;
  7913. if (!inStore.type.isCompatible(realValue.type)) {
  7914. if (_util_config__WEBPACK_IMPORTED_MODULE_11__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_0__["Store"].canImplicitTypeCast(inStore.type, vl.type)) {
  7915. realValue = _store_store__WEBPACK_IMPORTED_MODULE_0__["Store"].doImplicitCasting(inStore.type, realValue);
  7916. } else {
  7917. var stringInfo = inStore.type.stringInfo();
  7918. var info = stringInfo[0];
  7919. var exp_type_string_info = vl.type.stringInfo();
  7920. var exp_type_info = exp_type_string_info[0];
  7921. var exp = cmd.expression.toString();
  7922. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].incompatible_types_full(info.type, info.dim, exp_type_info.type, exp_type_info.dim, exp, cmd.sourceInfo));
  7923. }
  7924. }
  7925. if (inStore instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_17__["ArrayStoreValue"]) {
  7926. var columns = realValue.columns == null ? 0 : realValue.columns;
  7927. if (inStore.lines !== realValue.lines || inStore.columns !== columns) {
  7928. var _exp = cmd.expression.toString();
  7929. if (inStore.isVector()) {
  7930. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].invalid_vector_assignment_full(cmd.id, inStore.lines, _exp, realValue.lines, cmd.sourceInfo));
  7931. } else {
  7932. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].invalid_matrix_assignment_full(cmd.id, inStore.lines, inStore.columns, _exp, realValue.lines, realValue.columns, cmd.sourceInfo));
  7933. }
  7934. }
  7935. }
  7936. store.updateStore(cmd.id, realValue);
  7937. return store;
  7938. });
  7939. } catch (error) {
  7940. return Promise.reject(error);
  7941. }
  7942. }
  7943. }, {
  7944. key: "executeArrayIndexAssign",
  7945. value: function executeArrayIndexAssign(store, cmd) {
  7946. var mustBeArray = store.applyStore(cmd.id);
  7947. var used_dims = 0;
  7948. if (mustBeArray.isConst) {
  7949. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo));
  7950. }
  7951. if (!(mustBeArray.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_9__["ArrayType"])) {
  7952. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].invalid_array_access_full(cmd.id, cmd.sourceInfo));
  7953. }
  7954. var line$ = this.evaluateExpression(store, cmd.line);
  7955. var column$ = this.evaluateExpression(store, cmd.column);
  7956. var value$ = this.evaluateExpression(store, cmd.expression);
  7957. return Promise.all([line$, column$, value$]).then(function (_ref) {
  7958. var _ref2 = _slicedToArray(_ref, 3),
  7959. line_sv = _ref2[0],
  7960. column_sv = _ref2[1],
  7961. value = _ref2[2];
  7962. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER.isCompatible(line_sv.type)) {
  7963. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo));
  7964. }
  7965. var line = line_sv.get().toNumber();
  7966. used_dims += 1;
  7967. var column = undefined;
  7968. if (column_sv != null) {
  7969. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER.isCompatible(column_sv.type)) {
  7970. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo));
  7971. }
  7972. column = column_sv.get().toNumber();
  7973. used_dims += 1;
  7974. }
  7975. var actualValue = value;
  7976. if (line >= mustBeArray.lines) {
  7977. if (mustBeArray.isVector) {
  7978. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].vector_line_outbounds_full(cmd.id, line, mustBeArray.lines, cmd.sourceInfo));
  7979. } else {
  7980. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].matrix_line_outbounds_full(cmd.id, line, mustBeArray.lines, cmd.sourceInfo));
  7981. }
  7982. } else if (line < 0) {
  7983. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo));
  7984. }
  7985. if (column != null && mustBeArray.columns === 0) {
  7986. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].vector_not_matrix_full(cmd.id, cmd.sourceInfo));
  7987. }
  7988. if (column != null) {
  7989. if (column >= mustBeArray.columns) {
  7990. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].matrix_column_outbounds_full(cmd.id, column, mustBeArray.columns, cmd.sourceInfo));
  7991. } else if (column < 0) {
  7992. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo));
  7993. }
  7994. }
  7995. if (!mustBeArray.type.canAccept(value.type, used_dims)) {
  7996. if (!_util_config__WEBPACK_IMPORTED_MODULE_11__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_0__["Store"].canImplicitTypeCast(mustBeArray.type.innerType, value.type)) {
  7997. var type = mustBeArray.type.innerType;
  7998. var stringInfo = type.stringInfo();
  7999. var info = stringInfo[0];
  8000. var exp_type_string_info = value.type.stringInfo();
  8001. var exp_type_info = exp_type_string_info[0];
  8002. var exp = cmd.expression.toString();
  8003. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].incompatible_types_full(info.type, info.dim, exp_type_info.type, exp_type_info.dim, exp, cmd.sourceInfo));
  8004. }
  8005. actualValue = _store_store__WEBPACK_IMPORTED_MODULE_0__["Store"].doImplicitCasting(mustBeArray.type.innerType, value);
  8006. }
  8007. var current_value = mustBeArray.getAt(line, column);
  8008. if (current_value instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_17__["ArrayStoreValue"]) {
  8009. if (current_value.lines !== actualValue.lines || current_value.columns !== actualValue.columns) {
  8010. var _exp2 = cmd.expression.toString();
  8011. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].invalid_matrix_index_assign_full(cmd.id, line, current_value.lines, _exp2, actualValue.lines, cmd.sourceInfo));
  8012. }
  8013. } // mustBeArray.setAt(actualValue, line, column);
  8014. // store.updateStore(cmd.id, mustBeArray);
  8015. return store.updateStoreArray(cmd.id, actualValue, line, column);
  8016. });
  8017. }
  8018. /**
  8019. *
  8020. * @param {Store} store
  8021. * @param {Commands.Declaration} cmd
  8022. */
  8023. }, {
  8024. key: "executeDeclaration",
  8025. value: function executeDeclaration(store, cmd) {
  8026. try {
  8027. var $value = Promise.resolve(null);
  8028. if (cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_7__["ArrayDeclaration"]) {
  8029. return this.executeArrayDeclaration(store, cmd);
  8030. } else {
  8031. if (cmd.initial !== null) {
  8032. $value = this.evaluateExpression(store, cmd.initial);
  8033. }
  8034. return $value.then(function (vl) {
  8035. var realValue = vl;
  8036. var temp = null;
  8037. if (vl !== null) {
  8038. if (!vl.type.isCompatible(cmd.type)) {
  8039. if (_util_config__WEBPACK_IMPORTED_MODULE_11__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_0__["Store"].canImplicitTypeCast(cmd.type, vl.type)) {
  8040. realValue = _store_store__WEBPACK_IMPORTED_MODULE_0__["Store"].doImplicitCasting(cmd.type, realValue);
  8041. } else {
  8042. var stringInfo = vl.type.stringInfo();
  8043. var info = stringInfo[0];
  8044. var exp_type_string_info = vl.type.stringInfo();
  8045. var exp_type_info = exp_type_string_info[0];
  8046. var exp = cmd.expression.toString();
  8047. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].incompatible_types_full(info.type, info.dim, exp_type_info.type, exp_type_info.dim, exp, cmd.sourceInfo));
  8048. }
  8049. }
  8050. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](cmd.type, realValue.get(), null, cmd.isConst);
  8051. } else {
  8052. temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](cmd.type, null, null, cmd.isConst);
  8053. }
  8054. store.insertStore(cmd.id, temp);
  8055. return store;
  8056. });
  8057. }
  8058. } catch (e) {
  8059. return Promise.reject(e);
  8060. }
  8061. }
  8062. /**
  8063. *
  8064. * @param {Store} store
  8065. * @param {Commands.ArrayDeclaration} cmd
  8066. */
  8067. }, {
  8068. key: "executeArrayDeclaration",
  8069. value: function executeArrayDeclaration(store, cmd) {
  8070. var _this12 = this;
  8071. var $lines = this.evaluateExpression(store, cmd.lines);
  8072. var $columns = cmd.columns === null ? null : this.evaluateExpression(store, cmd.columns);
  8073. return Promise.all([$lines, $columns]).then(function (_ref3) {
  8074. var _ref4 = _slicedToArray(_ref3, 2),
  8075. line_sv = _ref4[0],
  8076. column_sv = _ref4[1];
  8077. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER.isCompatible(line_sv.type)) {
  8078. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo));
  8079. }
  8080. var line = line_sv.get().toNumber();
  8081. if (line < 0) {
  8082. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo));
  8083. }
  8084. var column = null;
  8085. if (column_sv !== null) {
  8086. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER.isCompatible(column_sv.type)) {
  8087. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo));
  8088. }
  8089. column = column_sv.get().toNumber();
  8090. if (column < 0) {
  8091. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo));
  8092. }
  8093. }
  8094. var $value = Promise.resolve(null);
  8095. if (cmd.initial !== null) {
  8096. // array can only be initialized by a literal....
  8097. $value = _this12.evaluateArrayLiteral(store, cmd.initial, cmd.type, line, column);
  8098. }
  8099. return $value.then(function (vector_list) {
  8100. var temp = null;
  8101. if (vector_list !== null) {
  8102. temp = new _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_17__["ArrayStoreValue"](cmd.type, vector_list, line, column, null, cmd.isConst);
  8103. } else {
  8104. temp = new _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_17__["ArrayStoreValue"](cmd.type, [], line, column, null, cmd.isConst);
  8105. }
  8106. store.insertStore(cmd.id, temp);
  8107. return store;
  8108. });
  8109. });
  8110. }
  8111. }, {
  8112. key: "evaluateExpression",
  8113. value: function evaluateExpression(store, exp) {
  8114. var _this13 = this;
  8115. this.instruction_count += 1;
  8116. return new Promise(function (resolve, reject) {
  8117. var expression_lambda = function expression_lambda() {
  8118. if (_this13.mode === _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].ABORT) {
  8119. return reject(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_20__["LocalizedStrings"].getMessage('aborted_execution'));
  8120. }
  8121. if (_this13.instruction_count >= _util_config__WEBPACK_IMPORTED_MODULE_11__["Config"].max_instruction_count) {
  8122. return reject(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."));
  8123. }
  8124. if (exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_8__["UnaryApp"]) {
  8125. return resolve(_this13.evaluateUnaryApp(store, exp));
  8126. } else if (exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_8__["InfixApp"]) {
  8127. return resolve(_this13.evaluateInfixApp(store, exp));
  8128. } else if (exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_8__["ArrayAccess"]) {
  8129. return resolve(_this13.evaluateArrayAccess(store, exp));
  8130. } else if (exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_8__["VariableLiteral"]) {
  8131. return resolve(_this13.evaluateVariableLiteral(store, exp));
  8132. } else if (exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_8__["IntLiteral"]) {
  8133. return resolve(_this13.evaluateLiteral(store, exp));
  8134. } else if (exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_8__["RealLiteral"]) {
  8135. return resolve(_this13.evaluateLiteral(store, exp));
  8136. } else if (exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_8__["BoolLiteral"]) {
  8137. return resolve(_this13.evaluateLiteral(store, exp));
  8138. } else if (exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_8__["StringLiteral"]) {
  8139. return resolve(_this13.evaluateLiteral(store, exp));
  8140. } else if (exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_8__["ArrayLiteral"]) {
  8141. return reject(new Error("Internal Error: The system should not eval an array literal."));
  8142. } else if (exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_8__["FunctionCall"]) {
  8143. return resolve(_this13.evaluateFunctionCall(store, exp));
  8144. }
  8145. return resolve(null);
  8146. };
  8147. if (_this13.instruction_count % _util_config__WEBPACK_IMPORTED_MODULE_11__["Config"].suspend_threshold == 0) {
  8148. //every 100th command should briefly delay its execution in order to allow the browser to process other things
  8149. setTimeout(expression_lambda, 5);
  8150. } else {
  8151. expression_lambda();
  8152. }
  8153. });
  8154. }
  8155. }, {
  8156. key: "evaluateFunctionCall",
  8157. value: function evaluateFunctionCall(store, exp) {
  8158. var _this14 = this;
  8159. if (exp.isMainCall) {
  8160. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].void_in_expression_full(_definedFunctions__WEBPACK_IMPORTED_MODULE_5__["LanguageDefinedFunction"].getMainFunctionName(), exp.sourceInfo));
  8161. }
  8162. var func = this.findFunction(exp.id);
  8163. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].VOID.isCompatible(func.returnType)) {
  8164. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].void_in_expression_full(exp.id, exp.sourceInfo));
  8165. }
  8166. if (this.function_call_stack.length >= _util_config__WEBPACK_IMPORTED_MODULE_11__["Config"].max_call_stack) {
  8167. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].exceeded_recursive_calls(exp.sourceInfo));
  8168. }
  8169. this.function_call_stack.push(exp.sourceInfo);
  8170. var $newStore = this.runFunction(func, exp.actualParameters, store);
  8171. return $newStore.then(function (sto) {
  8172. if (sto.mode !== _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].RETURN) {
  8173. return Promise.reject(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));
  8174. }
  8175. var val = sto.applyStore('$');
  8176. sto.destroy();
  8177. _this14.function_call_stack.pop();
  8178. return Promise.resolve(val);
  8179. });
  8180. }
  8181. /**
  8182. *
  8183. * @param {Store} store
  8184. * @param {Expressions.ArrayLiteral} exp
  8185. * @param {ArrayType} type
  8186. */
  8187. }, {
  8188. key: "evaluateArrayLiteral",
  8189. value: function evaluateArrayLiteral(store, exp, type, lines, columns) {
  8190. if (!exp.isVector) {
  8191. if (columns == null) {
  8192. return Promise.reject(new Error("This should never happen: Vector cannot be initialized by a matrix"));
  8193. }
  8194. var $matrix = this.evaluateMatrix(store, exp, type, lines, columns);
  8195. return Promise.all($matrix).then(function (vectorList) {
  8196. var values = vectorList.reduce(function (prev, next) {
  8197. return prev.concat(next);
  8198. }, []);
  8199. return Promise.resolve(values);
  8200. });
  8201. } else {
  8202. if (columns != null) {
  8203. return Promise.reject(new Error("This should never happen: Matrix cannot be initialized by a vector"));
  8204. }
  8205. return this.evaluateVector(store, exp, type, lines).then(function (list) {
  8206. return Promise.resolve(list);
  8207. });
  8208. }
  8209. }
  8210. /**
  8211. * Evalautes a list of literals and expression composing the vector
  8212. * @param {Store} store
  8213. * @param {Expressions.ArrayLiteral} exps
  8214. * @param {ArrayType} type
  8215. * @param {number} n_elements
  8216. * @returns {Promise<StoreValue[]>} store object list
  8217. */
  8218. }, {
  8219. key: "evaluateVector",
  8220. value: function evaluateVector(store, exps, type, n_elements) {
  8221. var _this15 = this;
  8222. var values = exps.value;
  8223. if (n_elements !== values.length) {
  8224. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].invalid_number_elements_vector(n_elements, exps.toString(), values.length, exps.sourceInfo));
  8225. }
  8226. var actual_values = Promise.all(values.map(function (exp) {
  8227. return _this15.evaluateExpression(store, exp);
  8228. }));
  8229. return actual_values.then(function (values) {
  8230. return values.map(function (v, index) {
  8231. if (!type.canAccept(v.type, 1)) {
  8232. if (!_util_config__WEBPACK_IMPORTED_MODULE_11__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_0__["Store"].canImplicitTypeCast(type.innerType, v.type)) {
  8233. // const stringInfo = v.type.stringInfo();
  8234. // const info = stringInfo[0];
  8235. var exp_str = values[index].toString(); // TODO - fix error message
  8236. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].invalid_array_literal_type_full(exp_str, values[index].sourceInfo));
  8237. }
  8238. var new_value = _store_store__WEBPACK_IMPORTED_MODULE_0__["Store"].doImplicitCasting(type.innerType, v);
  8239. return new_value;
  8240. }
  8241. return v;
  8242. });
  8243. });
  8244. }
  8245. /**
  8246. * Evaluates a list of array literals composing the matrix
  8247. * @param {Store} store
  8248. * @param {Expressions.ArrayLiteral} exps
  8249. * @param {ArrayType} type
  8250. * @returns {Promise<StoreValue[]>[]}
  8251. */
  8252. }, {
  8253. key: "evaluateMatrix",
  8254. value: function evaluateMatrix(store, exps, type, lines, columns) {
  8255. var _this16 = this;
  8256. var values = exps.value;
  8257. if (values.length !== lines) {
  8258. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].invalid_number_lines_matrix(lines, exps.toString(), values.length, exps.sourceInfo));
  8259. }
  8260. return values.map(function (vector) {
  8261. var vec_type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_9__["ArrayType"](type.innerType, 1);
  8262. return _this16.evaluateVector(store, vector, vec_type, columns);
  8263. });
  8264. }
  8265. }, {
  8266. key: "evaluateLiteral",
  8267. value: function evaluateLiteral(_, exp) {
  8268. return Promise.resolve(new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](exp.type, exp.value));
  8269. }
  8270. }, {
  8271. key: "evaluateVariableLiteral",
  8272. value: function evaluateVariableLiteral(store, exp) {
  8273. try {
  8274. var val = store.applyStore(exp.id);
  8275. return Promise.resolve(val);
  8276. } catch (error) {
  8277. return Promise.reject(error);
  8278. }
  8279. }
  8280. }, {
  8281. key: "evaluateArrayAccess",
  8282. value: function evaluateArrayAccess(store, exp) {
  8283. var mustBeArray = store.getStoreObject(exp.id);
  8284. if (!(mustBeArray.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_9__["ArrayType"])) {
  8285. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].invalid_array_access_full(exp.id, exp.sourceInfo));
  8286. }
  8287. var $line = this.evaluateExpression(store, exp.line);
  8288. var $column = this.evaluateExpression(store, exp.column);
  8289. return Promise.all([$line, $column]).then(function (_ref5) {
  8290. var _ref6 = _slicedToArray(_ref5, 2),
  8291. line_sv = _ref6[0],
  8292. column_sv = _ref6[1];
  8293. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER.isCompatible(line_sv.type)) {
  8294. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].array_dimension_not_int_full(exp.sourceInfo));
  8295. }
  8296. var line = line_sv.get().toNumber();
  8297. var column = null;
  8298. if (column_sv !== null) {
  8299. if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER.isCompatible(column_sv.type)) {
  8300. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].array_dimension_not_int_full(exp.sourceInfo));
  8301. }
  8302. column = column_sv.get().toNumber();
  8303. }
  8304. if (line >= mustBeArray.lines) {
  8305. if (mustBeArray.isVector) {
  8306. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].vector_line_outbounds_full(exp.id, line, mustBeArray.lines, exp.sourceInfo));
  8307. } else {
  8308. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].matrix_line_outbounds_full(exp.id, line, mustBeArray.lines, exp.sourceInfo));
  8309. }
  8310. } else if (line < 0) {
  8311. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].array_dimension_not_positive_full(exp.sourceInfo));
  8312. }
  8313. if (column !== null && mustBeArray.columns === 0) {
  8314. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].vector_not_matrix_full(exp.id, exp.sourceInfo));
  8315. }
  8316. if (column !== null) {
  8317. if (column >= mustBeArray.columns) {
  8318. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].matrix_column_outbounds_full(exp.id, column, mustBeArray.columns, exp.sourceInfo));
  8319. } else if (column < 0) {
  8320. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].array_dimension_not_positive_full(exp.sourceInfo));
  8321. }
  8322. }
  8323. var result = mustBeArray.getAt(line, column);
  8324. var type = mustBeArray.type.innerType;
  8325. if (Array.isArray(result)) {
  8326. var values = result.map(function (v, c) {
  8327. return new _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_19__["StoreValueAddress"](type, v, line, c, mustBeArray.id, mustBeArray.readOnly);
  8328. });
  8329. return Promise.resolve(new _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_17__["ArrayStoreValue"](new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_9__["ArrayType"](type, 1), values, mustBeArray.columns, null, mustBeArray.id, mustBeArray.readOnly));
  8330. } else {
  8331. return Promise.resolve(new _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_19__["StoreValueAddress"](type, result, line, column, mustBeArray.id, mustBeArray.readOnly));
  8332. }
  8333. });
  8334. }
  8335. }, {
  8336. key: "evaluateUnaryApp",
  8337. value: function evaluateUnaryApp(store, unaryApp) {
  8338. var $left = this.evaluateExpression(store, unaryApp.left);
  8339. return $left.then(function (left) {
  8340. var resultType = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_6__["resultTypeAfterUnaryOp"])(unaryApp.op, left.type);
  8341. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].UNDEFINED.isCompatible(resultType)) {
  8342. var stringInfo = left.type.stringInfo();
  8343. var info = stringInfo[0];
  8344. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].invalid_unary_op_full(unaryApp.op, info.type, info.dim, unaryApp.sourceInfo));
  8345. }
  8346. switch (unaryApp.op.ord) {
  8347. case _ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].ADD.ord:
  8348. return new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](resultType, left.get());
  8349. case _ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].SUB.ord:
  8350. return new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](resultType, left.get().negated());
  8351. case _ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].NOT.ord:
  8352. return new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](resultType, !left.get());
  8353. default:
  8354. return Promise.reject(new _error_runtimeError__WEBPACK_IMPORTED_MODULE_13__["RuntimeError"]('!!!Critical Invalid UnaryApp ' + unaryApp.op));
  8355. }
  8356. });
  8357. }
  8358. }, {
  8359. key: "evaluateInfixApp",
  8360. value: function evaluateInfixApp(store, infixApp) {
  8361. var $left = this.evaluateExpression(store, infixApp.left);
  8362. var $right = this.evaluateExpression(store, infixApp.right);
  8363. return Promise.all([$left, $right]).then(function (values) {
  8364. var shouldImplicitCast = false;
  8365. var left = values[0];
  8366. var right = values[1];
  8367. var resultType = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_6__["resultTypeAfterInfixOp"])(infixApp.op, left.type, right.type);
  8368. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].UNDEFINED.isCompatible(resultType)) {
  8369. if (_util_config__WEBPACK_IMPORTED_MODULE_11__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_0__["Store"].canImplicitTypeCast(left.type, right.type)) {
  8370. shouldImplicitCast = true;
  8371. } else {
  8372. var stringInfoLeft = left.type.stringInfo();
  8373. var infoLeft = stringInfoLeft[0];
  8374. var stringInfoRight = right.type.stringInfo();
  8375. var infoRight = stringInfoRight[0];
  8376. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].invalid_infix_op_full(infixApp.op, infoLeft.type, infoLeft.dim, infoRight.type, infoRight.dim, infixApp.sourceInfo));
  8377. }
  8378. }
  8379. var result = null;
  8380. switch (infixApp.op.ord) {
  8381. case _ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].ADD.ord:
  8382. {
  8383. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING.isCompatible(left.type)) {
  8384. var rightStr = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_10__["convertToString"])(right.get(), right.type);
  8385. return new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](resultType, left.get() + rightStr);
  8386. } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING.isCompatible(right.type)) {
  8387. var leftStr = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_10__["convertToString"])(left.get(), left.type);
  8388. return new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](resultType, leftStr + right.get());
  8389. } else {
  8390. return new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](resultType, left.get().plus(right.get()));
  8391. }
  8392. }
  8393. case _ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].SUB.ord:
  8394. return new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](resultType, left.get().minus(right.get()));
  8395. case _ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].MULT.ord:
  8396. {
  8397. result = left.get().times(right.get());
  8398. return new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](resultType, result);
  8399. }
  8400. case _ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].DIV.ord:
  8401. {
  8402. if (right.get() == 0) {
  8403. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_12__["ProcessorErrorFactory"].divsion_by_zero_full(infixApp.toString(), infixApp.sourceInfo));
  8404. }
  8405. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER.isCompatible(resultType)) result = left.get().divToInt(right.get());else result = left.get().div(right.get());
  8406. return new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](resultType, result);
  8407. }
  8408. case _ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].MOD.ord:
  8409. {
  8410. var leftValue = left.get();
  8411. var rightValue = right.get();
  8412. if (shouldImplicitCast) {
  8413. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER;
  8414. leftValue = leftValue.trunc();
  8415. rightValue = rightValue.trunc();
  8416. }
  8417. result = leftValue.modulo(rightValue);
  8418. return new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](resultType, result);
  8419. }
  8420. case _ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].GT.ord:
  8421. {
  8422. var _leftValue = left.get();
  8423. var _rightValue = right.get();
  8424. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING.isCompatible(left.type)) {
  8425. result = _leftValue.length > _rightValue.length;
  8426. } else {
  8427. if (shouldImplicitCast) {
  8428. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN;
  8429. _leftValue = _leftValue.trunc();
  8430. _rightValue = _rightValue.trunc();
  8431. }
  8432. result = _leftValue.gt(_rightValue);
  8433. }
  8434. return new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](resultType, result);
  8435. }
  8436. case _ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].GE.ord:
  8437. {
  8438. var _leftValue2 = left.get();
  8439. var _rightValue2 = right.get();
  8440. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING.isCompatible(left.type)) {
  8441. result = _leftValue2.length >= _rightValue2.length;
  8442. } else {
  8443. if (shouldImplicitCast) {
  8444. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN;
  8445. _leftValue2 = _leftValue2.trunc();
  8446. _rightValue2 = _rightValue2.trunc();
  8447. }
  8448. result = _leftValue2.gte(_rightValue2);
  8449. }
  8450. return new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](resultType, result);
  8451. }
  8452. case _ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].LT.ord:
  8453. {
  8454. var _leftValue3 = left.get();
  8455. var _rightValue3 = right.get();
  8456. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING.isCompatible(left.type)) {
  8457. result = _leftValue3.length < _rightValue3.length;
  8458. } else {
  8459. if (shouldImplicitCast) {
  8460. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN;
  8461. _leftValue3 = _leftValue3.trunc();
  8462. _rightValue3 = _rightValue3.trunc();
  8463. }
  8464. result = _leftValue3.lt(_rightValue3);
  8465. }
  8466. return new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](resultType, result);
  8467. }
  8468. case _ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].LE.ord:
  8469. {
  8470. var _leftValue4 = left.get();
  8471. var _rightValue4 = right.get();
  8472. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING.isCompatible(left.type)) {
  8473. result = _leftValue4.length <= _rightValue4.length;
  8474. } else {
  8475. if (shouldImplicitCast) {
  8476. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN;
  8477. _leftValue4 = _leftValue4.trunc();
  8478. _rightValue4 = _rightValue4.trunc();
  8479. }
  8480. result = _leftValue4.lte(_rightValue4);
  8481. }
  8482. return new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](resultType, result);
  8483. }
  8484. case _ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].EQ.ord:
  8485. {
  8486. var _leftValue5 = left.get();
  8487. var _rightValue5 = right.get();
  8488. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER.isCompatible(left.type) || _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL.isCompatible(left.type)) {
  8489. if (shouldImplicitCast) {
  8490. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN;
  8491. _leftValue5 = _leftValue5.trunc();
  8492. _rightValue5 = _rightValue5.trunc();
  8493. }
  8494. result = _leftValue5.eq(_rightValue5);
  8495. } else {
  8496. result = _leftValue5 === _rightValue5;
  8497. }
  8498. return new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](resultType, result);
  8499. }
  8500. case _ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].NEQ.ord:
  8501. {
  8502. var _leftValue6 = left.get();
  8503. var _rightValue6 = right.get();
  8504. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER.isCompatible(left.type) || _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL.isCompatible(left.type)) {
  8505. if (shouldImplicitCast) {
  8506. resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN;
  8507. _leftValue6 = _leftValue6.trunc();
  8508. _rightValue6 = _rightValue6.trunc();
  8509. }
  8510. result = !_leftValue6.eq(_rightValue6);
  8511. } else {
  8512. result = _leftValue6 !== _rightValue6;
  8513. }
  8514. return new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](resultType, result);
  8515. }
  8516. case _ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].AND.ord:
  8517. return new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](resultType, left.get() && right.get());
  8518. case _ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].OR.ord:
  8519. return new _store_value_store_value__WEBPACK_IMPORTED_MODULE_15__["StoreValue"](resultType, left.get() || right.get());
  8520. default:
  8521. return Promise.reject(new _error_runtimeError__WEBPACK_IMPORTED_MODULE_13__["RuntimeError"]('!!!Critical Invalid InfixApp ' + infixApp.op));
  8522. }
  8523. });
  8524. }
  8525. }]);
  8526. return IVProgProcessor;
  8527. }();
  8528. /***/ }),
  8529. /***/ "./js/processor/lib/arrays.js":
  8530. /*!************************************!*\
  8531. !*** ./js/processor/lib/arrays.js ***!
  8532. \************************************/
  8533. /*! exports provided: createNumElementsFun, createMatrixLinesFun, createMatrixColumnsFun */
  8534. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8535. "use strict";
  8536. __webpack_require__.r(__webpack_exports__);
  8537. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNumElementsFun", function() { return createNumElementsFun; });
  8538. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMatrixLinesFun", function() { return createMatrixLinesFun; });
  8539. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMatrixColumnsFun", function() { return createMatrixColumnsFun; });
  8540. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  8541. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  8542. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__);
  8543. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  8544. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  8545. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_3__);
  8546. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  8547. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_4__);
  8548. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  8549. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_5__);
  8550. /**
  8551. * num_elements
  8552. * matrix_lines
  8553. * matrix_columns
  8554. */
  8555. function createNumElementsFun() {
  8556. var numElementsFun = function numElementsFun(sto, _) {
  8557. var vector = sto.applyStore("vector");
  8558. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_5__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__["toInt"])(vector.lines));
  8559. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_4__["Modes"].RETURN;
  8560. sto.insertStore("$", temp);
  8561. return Promise.resolve(sto);
  8562. };
  8563. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](numElementsFun)]);
  8564. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$numElements', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_3__["ArrayType"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].ALL, 1), 'vector', false)], block);
  8565. return func;
  8566. }
  8567. function createMatrixLinesFun() {
  8568. var matrixLinesFun = function matrixLinesFun(sto, _) {
  8569. var matrix = sto.applyStore("matrix");
  8570. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_5__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__["toInt"])(matrix.lines));
  8571. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_4__["Modes"].RETURN;
  8572. sto.insertStore("$", temp);
  8573. return Promise.resolve(sto);
  8574. };
  8575. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](matrixLinesFun)]);
  8576. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$matrixLines', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_3__["ArrayType"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].ALL, 2), 'matrix', false)], block);
  8577. return func;
  8578. }
  8579. function createMatrixColumnsFun() {
  8580. var matrixColumnsFun = function matrixColumnsFun(sto, _) {
  8581. var matrix = sto.applyStore("matrix");
  8582. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_5__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__["toInt"])(matrix.columns));
  8583. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_4__["Modes"].RETURN;
  8584. sto.insertStore("$", temp);
  8585. return Promise.resolve(sto);
  8586. };
  8587. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](matrixColumnsFun)]);
  8588. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$matrixColumns', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_3__["ArrayType"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].ALL, 2), 'matrix', false)], block);
  8589. return func;
  8590. }
  8591. /***/ }),
  8592. /***/ "./js/processor/lib/io.js":
  8593. /*!********************************!*\
  8594. !*** ./js/processor/lib/io.js ***!
  8595. \********************************/
  8596. /*! exports provided: createOutputFun, createInputFun */
  8597. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8598. "use strict";
  8599. __webpack_require__.r(__webpack_exports__);
  8600. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createOutputFun", function() { return createOutputFun; });
  8601. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createInputFun", function() { return createInputFun; });
  8602. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  8603. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  8604. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_1__);
  8605. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  8606. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  8607. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
  8608. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  8609. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  8610. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_5__);
  8611. function createOutputFun() {
  8612. var writeFunction = function writeFunction(store, _) {
  8613. var val = store.applyStore('p1');
  8614. this.output.sendOutput(Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__["convertToString"])(val.get(), val.type));
  8615. store.mode = _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].RETURN;
  8616. return Promise.resolve(store);
  8617. };
  8618. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](writeFunction)]);
  8619. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$write', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].VOID, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].ALL, 'p1', false)], block);
  8620. return func;
  8621. }
  8622. function createInputFun() {
  8623. var readFunction = function readFunction(store, _) {
  8624. var _this = this;
  8625. var request = new Promise(function (resolve, _) {
  8626. _this.input.requestInput(resolve);
  8627. });
  8628. return request.then(function (text) {
  8629. var typeToConvert = store.applyStore('p1').type;
  8630. var type = null;
  8631. var result = null;
  8632. try {
  8633. if (typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER)) {
  8634. result = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__["toInt"])(text).trunc();
  8635. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER;
  8636. } else if (typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL)) {
  8637. result = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__["toReal"])(text);
  8638. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL;
  8639. } else if (typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN)) {
  8640. result = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__["toBool"])(text);
  8641. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN;
  8642. } else if (typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING)) {
  8643. result = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__["toString"])(text);
  8644. type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING;
  8645. } else {
  8646. return Promise.reject(new Error("!!!!Critical error: Unknown type in readFunction!!!!"));
  8647. }
  8648. } catch (_) {
  8649. if (_this.mode == _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].ABORT) {
  8650. store.mode = _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].RETURN;
  8651. return Promise.resolve(store);
  8652. }
  8653. var stringInfo = typeToConvert.stringInfo()[0];
  8654. var realObject = store.getStoreObject("p1");
  8655. if (realObject.getReferenceDimension() > 0) {
  8656. var arrayInfo = realObject.type.stringInfo()[0];
  8657. var dim = realObject.getReferenceDimension();
  8658. var _error = _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_4__["ProcessorErrorFactory"].invalid_read_type_array(text, stringInfo.type, stringInfo.dim, realObject.getRefObj(), arrayInfo.type, dim, _this.function_call_stack.pop());
  8659. return Promise.reject(_error);
  8660. }
  8661. var error = _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_4__["ProcessorErrorFactory"].invalid_read_type(text, stringInfo.type, stringInfo.dim, realObject.getRefObj(), _this.function_call_stack.pop());
  8662. return Promise.reject(error);
  8663. }
  8664. var stoValue = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_5__["StoreValue"](type, result);
  8665. store.updateStore('p1', stoValue);
  8666. store.mode = _modes__WEBPACK_IMPORTED_MODULE_1__["Modes"].RETURN;
  8667. return Promise.resolve(store);
  8668. });
  8669. };
  8670. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](readFunction)]);
  8671. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$read', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].VOID, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].ALL, 'p1', true)], block);
  8672. return func;
  8673. }
  8674. /***/ }),
  8675. /***/ "./js/processor/lib/lang.js":
  8676. /*!**********************************!*\
  8677. !*** ./js/processor/lib/lang.js ***!
  8678. \**********************************/
  8679. /*! exports provided: createIsRealFun, createIsIntFun, createIsBoolFun, createCastRealFun, createCastIntFun, createCastBoolFun, createCastStringFun */
  8680. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8681. "use strict";
  8682. __webpack_require__.r(__webpack_exports__);
  8683. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsRealFun", function() { return createIsRealFun; });
  8684. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsIntFun", function() { return createIsIntFun; });
  8685. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsBoolFun", function() { return createIsBoolFun; });
  8686. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastRealFun", function() { return createCastRealFun; });
  8687. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastIntFun", function() { return createCastIntFun; });
  8688. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastBoolFun", function() { return createCastBoolFun; });
  8689. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastStringFun", function() { return createCastStringFun; });
  8690. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  8691. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  8692. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__);
  8693. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  8694. /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../ast/ivprogParser */ "./js/ast/ivprogParser.js");
  8695. /* harmony import */ var _ast_expressions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../ast/expressions */ "./js/ast/expressions/index.js");
  8696. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  8697. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_5__);
  8698. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  8699. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_6__);
  8700. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  8701. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  8702. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_8__);
  8703. /**
  8704. *
  8705. * is_real
  8706. * is_int
  8707. * is_bool
  8708. * cast_real
  8709. * cast_int
  8710. * cast_bool
  8711. * cast_string
  8712. */
  8713. function createIsRealFun() {
  8714. var isRealFun = function isRealFun(sto, _) {
  8715. var str = sto.applyStore("str");
  8716. var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_3__["IVProgParser"].createParser(str.get());
  8717. var result = false;
  8718. try {
  8719. var val = parser.parseTerm();
  8720. if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_4__["RealLiteral"]) {
  8721. result = true;
  8722. }
  8723. } catch (error) {// ignore
  8724. }
  8725. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_8__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].BOOLEAN, result);
  8726. sto.insertStore("$", temp);
  8727. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  8728. return Promise.resolve(sto);
  8729. };
  8730. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](isRealFun)]);
  8731. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$isReal', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].BOOLEAN, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING, 'str', false)], block);
  8732. return func;
  8733. }
  8734. function createIsIntFun() {
  8735. var isIntFun = function isIntFun(sto, _) {
  8736. var str = sto.applyStore("str");
  8737. var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_3__["IVProgParser"].createParser(str.get());
  8738. var result = false;
  8739. try {
  8740. var val = parser.parseTerm();
  8741. if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_4__["IntLiteral"]) {
  8742. result = true;
  8743. }
  8744. } catch (_unused) {// ignore
  8745. }
  8746. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_8__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].BOOLEAN, result);
  8747. sto.insertStore("$", temp);
  8748. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  8749. return Promise.resolve(sto);
  8750. };
  8751. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](isIntFun)]);
  8752. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$isInt', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].BOOLEAN, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING, 'str', false)], block);
  8753. return func;
  8754. }
  8755. function createIsBoolFun() {
  8756. var isBoolFun = function isBoolFun(sto, _) {
  8757. var str = sto.applyStore("str");
  8758. var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_3__["IVProgParser"].createParser(str.get());
  8759. var result = false;
  8760. try {
  8761. var val = parser.parseTerm();
  8762. if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_4__["BoolLiteral"]) {
  8763. result = true;
  8764. }
  8765. } catch (error) {// ignore
  8766. }
  8767. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_8__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].BOOLEAN, result);
  8768. sto.insertStore("$", temp);
  8769. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  8770. return Promise.resolve(sto);
  8771. };
  8772. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](isBoolFun)]);
  8773. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$isBool', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].BOOLEAN, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING, 'str', false)], block);
  8774. return func;
  8775. }
  8776. function createCastRealFun() {
  8777. var castRealFun = function castRealFun(sto, _) {
  8778. var val = sto.applyStore("val");
  8779. var value = val.get();
  8780. switch (val.type.ord) {
  8781. case _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER.ord:
  8782. {
  8783. value = value.toNumber();
  8784. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_8__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL, Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__["toReal"])(value));
  8785. sto.insertStore("$", temp);
  8786. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  8787. return Promise.resolve(sto);
  8788. }
  8789. case _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING.ord:
  8790. {
  8791. var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_3__["IVProgParser"].createParser(value);
  8792. try {
  8793. var result = parser.parseTerm();
  8794. if (result instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_4__["RealLiteral"]) {
  8795. var _temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_8__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL, result.value);
  8796. sto.insertStore("$", _temp);
  8797. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  8798. return Promise.resolve(sto);
  8799. }
  8800. } catch (error) {// ignore
  8801. }
  8802. }
  8803. }
  8804. var typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL.stringInfo();
  8805. var typeInfo = typeStringInfoArray[0];
  8806. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_7__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim));
  8807. };
  8808. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](castRealFun)]);
  8809. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$castReal', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_6__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING]), 'val', false)], block);
  8810. return func;
  8811. }
  8812. function createCastIntFun() {
  8813. var castIntFun = function castIntFun(sto, _) {
  8814. var val = sto.applyStore("val");
  8815. var value = val.get();
  8816. switch (val.type.ord) {
  8817. case _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL.ord:
  8818. {
  8819. value = value.toNumber();
  8820. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_8__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, Math.floor(value));
  8821. sto.insertStore("$", temp);
  8822. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  8823. return Promise.resolve(sto);
  8824. }
  8825. case _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING.ord:
  8826. {
  8827. var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_3__["IVProgParser"].createParser(value);
  8828. try {
  8829. var result = parser.parseTerm();
  8830. if (result instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_4__["IntLiteral"]) {
  8831. var _temp2 = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_8__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, result.value);
  8832. sto.insertStore("$", _temp2);
  8833. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  8834. return Promise.resolve(sto);
  8835. }
  8836. } catch (error) {// ignore
  8837. }
  8838. }
  8839. }
  8840. var typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER.stringInfo();
  8841. var typeInfo = typeStringInfoArray[0];
  8842. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_7__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim));
  8843. };
  8844. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](castIntFun)]);
  8845. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$castInt', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_6__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING]), 'val', false)], block);
  8846. return func;
  8847. }
  8848. function createCastBoolFun() {
  8849. var castBoolFun = function castBoolFun(sto, _) {
  8850. var str = sto.applyStore("str");
  8851. var value = str.get();
  8852. var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_3__["IVProgParser"].createParser(value);
  8853. try {
  8854. var val = parser.parseTerm();
  8855. if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_4__["BoolLiteral"]) {
  8856. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_8__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].BOOLEAN, val.value);
  8857. sto.insertStore("$", temp);
  8858. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  8859. return Promise.resolve(sto);
  8860. }
  8861. } catch (error) {// ignore
  8862. }
  8863. var typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].BOOLEAN.stringInfo();
  8864. var typeInfo = typeStringInfoArray[0];
  8865. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_7__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim));
  8866. };
  8867. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](castBoolFun)]);
  8868. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$castBool', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].BOOLEAN, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING, 'str', false)], block);
  8869. return func;
  8870. }
  8871. function createCastStringFun() {
  8872. var castStringFun = function castStringFun(store, _) {
  8873. var val = store.applyStore('str');
  8874. var result = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__["convertToString"])(val.get(), val.type);
  8875. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_8__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING, result);
  8876. store.insertStore("$", temp);
  8877. store.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
  8878. return Promise.resolve(store);
  8879. };
  8880. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](castStringFun)]);
  8881. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$castString', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].ALL, 'str', false)], block);
  8882. return func;
  8883. }
  8884. /***/ }),
  8885. /***/ "./js/processor/lib/math.js":
  8886. /*!**********************************!*\
  8887. !*** ./js/processor/lib/math.js ***!
  8888. \**********************************/
  8889. /*! exports provided: createSinFun, createCosFun, createTanFun, createSqrtFun, createPowFun, createLogFun, createAbsFun, createNegateFun, createInvertFun, createMaxFun, createMinFun, createRandFun */
  8890. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8891. "use strict";
  8892. __webpack_require__.r(__webpack_exports__);
  8893. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSinFun", function() { return createSinFun; });
  8894. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCosFun", function() { return createCosFun; });
  8895. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createTanFun", function() { return createTanFun; });
  8896. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSqrtFun", function() { return createSqrtFun; });
  8897. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPowFun", function() { return createPowFun; });
  8898. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLogFun", function() { return createLogFun; });
  8899. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createAbsFun", function() { return createAbsFun; });
  8900. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNegateFun", function() { return createNegateFun; });
  8901. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createInvertFun", function() { return createInvertFun; });
  8902. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMaxFun", function() { return createMaxFun; });
  8903. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMinFun", function() { return createMinFun; });
  8904. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRandFun", function() { return createRandFun; });
  8905. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  8906. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  8907. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__);
  8908. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  8909. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! decimal.js */ "./node_modules/decimal.js/decimal.js");
  8910. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(decimal_js__WEBPACK_IMPORTED_MODULE_3__);
  8911. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  8912. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_4__);
  8913. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  8914. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__);
  8915. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  8916. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_6__);
  8917. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  8918. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_7__);
  8919. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  8920. function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
  8921. function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
  8922. function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
  8923. function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
  8924. /**
  8925. * sin
  8926. * cos
  8927. * tan
  8928. * sqrt
  8929. * pow
  8930. * log
  8931. * abs
  8932. * negate
  8933. * invert
  8934. * max
  8935. * min
  8936. */
  8937. function convertToRadians(degrees) {
  8938. return degrees.times(decimal_js__WEBPACK_IMPORTED_MODULE_3__["Decimal"].acos(-1)).div(180);
  8939. }
  8940. function createSinFun() {
  8941. var sinFun = function sinFun(sto, _) {
  8942. var x = sto.applyStore('x');
  8943. var angle = x.get().mod(360);
  8944. var result = null;
  8945. if (angle.eq(90)) {
  8946. result = new decimal_js__WEBPACK_IMPORTED_MODULE_3__["Decimal"](1);
  8947. } else if (angle.eq(180)) {
  8948. result = new decimal_js__WEBPACK_IMPORTED_MODULE_3__["Decimal"](0);
  8949. } else if (angle.eq(270)) {
  8950. result = new decimal_js__WEBPACK_IMPORTED_MODULE_3__["Decimal"](-1);
  8951. } else {
  8952. result = decimal_js__WEBPACK_IMPORTED_MODULE_3__["Decimal"].sin(convertToRadians(angle));
  8953. }
  8954. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL, result);
  8955. sto.insertStore("$", temp);
  8956. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  8957. return Promise.resolve(sto);
  8958. };
  8959. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](sinFun)]);
  8960. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$sin', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_4__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL]), 'x', false)], block);
  8961. return func;
  8962. }
  8963. function createCosFun() {
  8964. var cosFun = function cosFun(sto, _) {
  8965. var x = sto.applyStore('x');
  8966. var angle = x.get().mod(360);
  8967. var result = null;
  8968. if (angle.eq(90)) {
  8969. result = new decimal_js__WEBPACK_IMPORTED_MODULE_3__["Decimal"](0);
  8970. } else if (angle.eq(180)) {
  8971. result = new decimal_js__WEBPACK_IMPORTED_MODULE_3__["Decimal"](-1);
  8972. } else if (angle.eq(270)) {
  8973. result = new decimal_js__WEBPACK_IMPORTED_MODULE_3__["Decimal"](0);
  8974. }
  8975. result = decimal_js__WEBPACK_IMPORTED_MODULE_3__["Decimal"].cos(convertToRadians(angle));
  8976. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL, result);
  8977. sto.insertStore("$", temp);
  8978. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  8979. return Promise.resolve(sto);
  8980. };
  8981. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](cosFun)]);
  8982. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$cos', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_4__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL]), 'x', false)], block);
  8983. return func;
  8984. }
  8985. function createTanFun() {
  8986. var tanFun = function tanFun(sto, _) {
  8987. var x = sto.applyStore('x');
  8988. var angle = x.get().mod(360);
  8989. if (angle.eq(90) || angle.eq(270)) {
  8990. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_8__["ProcessorErrorFactory"].undefined_tanget_value(x.get().toNumber(), this.function_call_stack.pop()));
  8991. }
  8992. var result = decimal_js__WEBPACK_IMPORTED_MODULE_3__["Decimal"].tan(convertToRadians(angle));
  8993. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL, result);
  8994. sto.insertStore("$", temp);
  8995. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  8996. return Promise.resolve(sto);
  8997. };
  8998. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](tanFun)]);
  8999. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$tan', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_4__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL]), 'x', false)], block);
  9000. return func;
  9001. }
  9002. function createSqrtFun() {
  9003. var sqrtFun = function sqrtFun(sto, _) {
  9004. var x = sto.applyStore('x');
  9005. if (x.get().isNeg()) {
  9006. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_8__["ProcessorErrorFactory"].negative_sqrt_value(this.function_call_stack.pop()));
  9007. }
  9008. var result = x.get().sqrt();
  9009. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL, result);
  9010. sto.insertStore("$", temp);
  9011. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9012. return Promise.resolve(sto);
  9013. };
  9014. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](sqrtFun)]);
  9015. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$sqrt', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_4__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL]), 'x', false)], block);
  9016. return func;
  9017. }
  9018. function createPowFun() {
  9019. var powFun = function powFun(sto, _) {
  9020. var x = sto.applyStore('x');
  9021. var y = sto.applyStore('y');
  9022. var result = x.get().pow(y.get());
  9023. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL, result);
  9024. sto.insertStore("$", temp);
  9025. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9026. return Promise.resolve(sto);
  9027. };
  9028. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](powFun)]);
  9029. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$pow', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_4__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL]), 'x', false), new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_4__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL]), 'y', false)], block);
  9030. return func;
  9031. }
  9032. function createLogFun() {
  9033. var logFun = function logFun(sto, _) {
  9034. var x = sto.applyStore('x');
  9035. if (x.get().isNegative()) {
  9036. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_8__["ProcessorErrorFactory"].negative_log_value(this.function_call_stack.pop()));
  9037. }
  9038. var result = decimal_js__WEBPACK_IMPORTED_MODULE_3__["Decimal"].log10(x.get());
  9039. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL, result);
  9040. sto.insertStore("$", temp);
  9041. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9042. return Promise.resolve(sto);
  9043. };
  9044. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](logFun)]);
  9045. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$log', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_4__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL]), 'x', false)], block);
  9046. return func;
  9047. }
  9048. function createAbsFun() {
  9049. var absFun = function absFun(sto, _) {
  9050. var x = sto.applyStore('x');
  9051. var result = x.get().abs();
  9052. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](x.type, result);
  9053. sto.insertStore("$", temp);
  9054. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9055. return Promise.resolve(sto);
  9056. };
  9057. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](absFun)]);
  9058. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$abs', new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_4__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL]), [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_4__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL]), 'x', false)], block);
  9059. return func;
  9060. }
  9061. function createNegateFun() {
  9062. var negateFun = function negateFun(sto, _) {
  9063. var x = sto.applyStore('x');
  9064. var result = x.get().negated();
  9065. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](x.type, result);
  9066. sto.insertStore("$", temp);
  9067. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9068. return Promise.resolve(sto);
  9069. };
  9070. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](negateFun)]);
  9071. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$negate', new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_4__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL]), [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_4__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL]), 'x', false)], block);
  9072. return func;
  9073. }
  9074. function createInvertFun() {
  9075. var invertFun = function invertFun(sto, _) {
  9076. var x = sto.applyStore('x');
  9077. var result = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__["toReal"])(1).dividedBy(x.get());
  9078. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL, result);
  9079. sto.insertStore("$", temp);
  9080. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9081. return Promise.resolve(sto);
  9082. };
  9083. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](invertFun)]);
  9084. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$invert', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_4__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL]), 'x', false)], block);
  9085. return func;
  9086. }
  9087. function createMaxFun() {
  9088. var maxFun = function maxFun(sto, _) {
  9089. var x = sto.applyStore('x');
  9090. var numbers = x.get().map(function (sto_addrs) {
  9091. return sto_addrs.get();
  9092. });
  9093. var result = decimal_js__WEBPACK_IMPORTED_MODULE_3__["Decimal"].max.apply(decimal_js__WEBPACK_IMPORTED_MODULE_3__["Decimal"], _toConsumableArray(numbers));
  9094. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](x.type.innerType, result);
  9095. sto.insertStore("$", temp);
  9096. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9097. return Promise.resolve(sto);
  9098. };
  9099. var paramType = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__["ArrayType"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_4__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL]), 1);
  9100. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](maxFun)]);
  9101. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$max', new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_4__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL]), [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](paramType, 'x', false)], block);
  9102. return func;
  9103. }
  9104. function createMinFun() {
  9105. var minFun = function minFun(sto, _) {
  9106. var x = sto.applyStore('x');
  9107. var numbers = x.get().map(function (sto_addrs) {
  9108. return sto_addrs.get();
  9109. });
  9110. var result = decimal_js__WEBPACK_IMPORTED_MODULE_3__["Decimal"].min.apply(decimal_js__WEBPACK_IMPORTED_MODULE_3__["Decimal"], _toConsumableArray(numbers));
  9111. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](x.type.innerType, result);
  9112. sto.insertStore("$", temp);
  9113. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9114. return Promise.resolve(sto);
  9115. };
  9116. var paramType = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__["ArrayType"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_4__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL]), 1);
  9117. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](minFun)]);
  9118. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$min', new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_4__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL]), [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](paramType, 'x', false)], block);
  9119. return func;
  9120. }
  9121. function createRandFun() {
  9122. var randFun = function randFun(sto, _) {
  9123. var val = Math.random();
  9124. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL, new decimal_js__WEBPACK_IMPORTED_MODULE_3__["Decimal"](val));
  9125. sto.insertStore("$", temp);
  9126. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
  9127. return Promise.resolve(sto);
  9128. };
  9129. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](randFun)]);
  9130. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$rand', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL, [], block);
  9131. return func;
  9132. }
  9133. /***/ }),
  9134. /***/ "./js/processor/lib/strings.js":
  9135. /*!*************************************!*\
  9136. !*** ./js/processor/lib/strings.js ***!
  9137. \*************************************/
  9138. /*! exports provided: createSubstringFun, createLengthFun, createUppercaseFun, createLowercaseFun, createrCharAtFun */
  9139. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9140. "use strict";
  9141. __webpack_require__.r(__webpack_exports__);
  9142. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSubstringFun", function() { return createSubstringFun; });
  9143. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLengthFun", function() { return createLengthFun; });
  9144. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUppercaseFun", function() { return createUppercaseFun; });
  9145. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLowercaseFun", function() { return createLowercaseFun; });
  9146. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createrCharAtFun", function() { return createrCharAtFun; });
  9147. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
  9148. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
  9149. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__);
  9150. /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
  9151. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  9152. /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_3__);
  9153. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
  9154. /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_4__);
  9155. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  9156. /*
  9157. * substring
  9158. * length
  9159. * uppercase
  9160. * lowercase
  9161. * charAt
  9162. **/
  9163. function createSubstringFun() {
  9164. var substringFun = function substringFun(sto, _) {
  9165. var str = sto.applyStore("str");
  9166. var start = sto.applyStore("start");
  9167. var end = sto.applyStore("end");
  9168. var result = str.get().substring(start.get(), end.get());
  9169. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_4__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING, result);
  9170. sto.insertStore("$", temp);
  9171. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
  9172. return Promise.resolve(sto);
  9173. };
  9174. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](substringFun)]);
  9175. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$substring', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING, 'str', false), new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, 'start', false), new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, 'end', false)], block);
  9176. return func;
  9177. }
  9178. function createLengthFun() {
  9179. var lengthFun = function lengthFun(sto, _) {
  9180. var str = sto.applyStore("str");
  9181. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_4__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_2__["toInt"])(str.value.length));
  9182. sto.insertStore("$", temp);
  9183. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
  9184. return Promise.resolve(sto);
  9185. };
  9186. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](lengthFun)]);
  9187. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$length', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING, 'str', false)], block);
  9188. return func;
  9189. }
  9190. function createUppercaseFun() {
  9191. var uppercaseFun = function uppercaseFun(sto, _) {
  9192. var str = sto.applyStore("str");
  9193. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_4__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING, str.get().toUpperCase());
  9194. sto.insertStore("$", temp);
  9195. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
  9196. return Promise.resolve(sto);
  9197. };
  9198. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](uppercaseFun)]);
  9199. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$uppercase', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING, 'str', false)], block);
  9200. return func;
  9201. }
  9202. function createLowercaseFun() {
  9203. var lowercaseFun = function lowercaseFun(sto, _) {
  9204. var str = sto.applyStore("str");
  9205. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_4__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING, str.get().toLowerCase());
  9206. sto.insertStore("$", temp);
  9207. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
  9208. return Promise.resolve(sto);
  9209. };
  9210. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](lowercaseFun)]);
  9211. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$lowercase', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING, 'str', false)], block);
  9212. return func;
  9213. }
  9214. function createrCharAtFun() {
  9215. var charAtFun = function charAtFun(sto, _) {
  9216. var str = sto.applyStore("str");
  9217. var idx = sto.applyStore("index");
  9218. if (idx.get().toNumber() < 0 || idx.get().toNumber() >= str.get().length) {
  9219. return Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_5__["ProcessorErrorFactory"].invalid_string_index(idx.get().toNumber(), str.get(), this.function_call_stack.pop()));
  9220. }
  9221. var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_4__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING, str.get().charAt(idx.get().toNumber()));
  9222. sto.insertStore("$", temp);
  9223. sto.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
  9224. return Promise.resolve(sto);
  9225. };
  9226. var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["SysCall"](charAtFun)]);
  9227. var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["Function"]('$charAt', _typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING, [new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].STRING, 'str', false), new _ast_commands__WEBPACK_IMPORTED_MODULE_0__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER, 'index', false)], block);
  9228. return func;
  9229. }
  9230. /***/ }),
  9231. /***/ "./js/processor/modes.ts":
  9232. /*!*******************************!*\
  9233. !*** ./js/processor/modes.ts ***!
  9234. \*******************************/
  9235. /*! no static exports found */
  9236. /***/ (function(module, exports, __webpack_require__) {
  9237. "use strict";
  9238. Object.defineProperty(exports, "__esModule", { value: true });
  9239. exports.Modes = Object.freeze({
  9240. RETURN: Symbol('mode:return'),
  9241. BREAK: Symbol('mode:break'),
  9242. PAUSE: Symbol('mode:pause'),
  9243. RUN: Symbol('mode:run'),
  9244. ABORT: Symbol('mode:abort')
  9245. });
  9246. /***/ }),
  9247. /***/ "./js/processor/semantic/semanticAnalyser.js":
  9248. /*!***************************************************!*\
  9249. !*** ./js/processor/semantic/semanticAnalyser.js ***!
  9250. \***************************************************/
  9251. /*! exports provided: SemanticAnalyser */
  9252. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9253. "use strict";
  9254. __webpack_require__.r(__webpack_exports__);
  9255. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SemanticAnalyser", function() { return SemanticAnalyser; });
  9256. /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
  9257. /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../definedFunctions */ "./js/processor/definedFunctions.js");
  9258. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../services/languageService */ "./js/services/languageService.js");
  9259. /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../ast/commands */ "./js/ast/commands/index.js");
  9260. /* harmony import */ var _ast_expressions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../ast/expressions */ "./js/ast/expressions/index.js");
  9261. /* harmony import */ var _ast_expressions_literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ast/expressions/literal */ "./js/ast/expressions/literal.js");
  9262. /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../compatibilityTable */ "./js/processor/compatibilityTable.js");
  9263. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../typeSystem/types */ "./js/typeSystem/types.ts");
  9264. /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__);
  9265. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  9266. /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__);
  9267. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
  9268. /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_9__);
  9269. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../util/config */ "./js/util/config.js");
  9270. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../store/store */ "./js/processor/store/store.ts");
  9271. /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_store_store__WEBPACK_IMPORTED_MODULE_11__);
  9272. /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../ast/ivprogParser */ "./js/ast/ivprogParser.js");
  9273. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9274. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  9275. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  9276. var SemanticAnalyser =
  9277. /*#__PURE__*/
  9278. function () {
  9279. _createClass(SemanticAnalyser, null, [{
  9280. key: "analyseFromSource",
  9281. value: function analyseFromSource(stringCode) {
  9282. var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_12__["IVProgParser"].createParser(stringCode);
  9283. var semantic = new SemanticAnalyser(parser.parseTree());
  9284. return semantic.analyseTree();
  9285. }
  9286. }]);
  9287. function SemanticAnalyser(ast) {
  9288. _classCallCheck(this, SemanticAnalyser);
  9289. this.ast = ast;
  9290. this.lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_2__["LanguageService"].getCurrentLexer();
  9291. var lexer = new this.lexerClass(null);
  9292. this.literalNames = lexer.literalNames;
  9293. this.symbolMap = null;
  9294. this.currentFunction = null;
  9295. }
  9296. _createClass(SemanticAnalyser, [{
  9297. key: "pushMap",
  9298. value: function pushMap() {
  9299. if (this.symbolMap === null) {
  9300. this.symbolMap = {
  9301. map: {},
  9302. next: null
  9303. };
  9304. } else {
  9305. var n = {
  9306. map: {},
  9307. next: this.symbolMap
  9308. };
  9309. this.symbolMap = n;
  9310. }
  9311. }
  9312. }, {
  9313. key: "popMap",
  9314. value: function popMap() {
  9315. if (this.symbolMap !== null) {
  9316. this.symbolMap = this.symbolMap.next;
  9317. }
  9318. }
  9319. }, {
  9320. key: "insertSymbol",
  9321. value: function insertSymbol(id, typeInfo) {
  9322. this.symbolMap.map[id] = typeInfo;
  9323. }
  9324. }, {
  9325. key: "findSymbol",
  9326. value: function findSymbol(id, symbol_map) {
  9327. if (!symbol_map.map[id]) {
  9328. if (symbol_map.next) {
  9329. return this.findSymbol(id, symbol_map.next);
  9330. }
  9331. return null;
  9332. } else {
  9333. return symbol_map.map[id];
  9334. }
  9335. }
  9336. }, {
  9337. key: "getMainFunction",
  9338. value: function getMainFunction() {
  9339. return this.ast.functions.find(function (v) {
  9340. return v.isMain;
  9341. });
  9342. }
  9343. }, {
  9344. key: "findFunction",
  9345. value: function findFunction(name) {
  9346. if (name.match(/^\$.+$/)) {
  9347. var fun = _definedFunctions__WEBPACK_IMPORTED_MODULE_1__["LanguageDefinedFunction"].getFunction(name);
  9348. if (!fun) {
  9349. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].not_implemented(name);
  9350. }
  9351. return fun;
  9352. } else {
  9353. var val = this.ast.functions.find(function (v) {
  9354. return v.name === name;
  9355. });
  9356. if (!val) {
  9357. return null;
  9358. }
  9359. return val;
  9360. }
  9361. }
  9362. }, {
  9363. key: "analyseTree",
  9364. value: function analyseTree() {
  9365. var globalVars = this.ast.global;
  9366. this.pushMap();
  9367. this.assertDeclarations(globalVars);
  9368. var functions = this.ast.functions;
  9369. var mainFunc = functions.filter(function (f) {
  9370. return f.name === null;
  9371. });
  9372. if (mainFunc.length <= 0) {
  9373. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].main_missing();
  9374. }
  9375. for (var i = 0; i < functions.length; i++) {
  9376. var fun = functions[i];
  9377. this.assertFunction(fun);
  9378. }
  9379. return this.ast;
  9380. }
  9381. }, {
  9382. key: "assertDeclarations",
  9383. value: function assertDeclarations(list) {
  9384. for (var i = 0; i < list.length; i++) {
  9385. this.assertDeclaration(list[i]);
  9386. }
  9387. }
  9388. }, {
  9389. key: "assertDeclaration",
  9390. value: function assertDeclaration(declaration) {
  9391. if (declaration instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_3__["ArrayDeclaration"]) {
  9392. this.assertArrayDeclaration(declaration);
  9393. this.insertSymbol(declaration.id, {
  9394. id: declaration.id,
  9395. lines: declaration.lines,
  9396. columns: declaration.columns,
  9397. type: declaration.type,
  9398. isConst: declaration.isConst
  9399. });
  9400. } else {
  9401. if (declaration.initial === null) {
  9402. this.insertSymbol(declaration.id, {
  9403. id: declaration.id,
  9404. type: declaration.type,
  9405. isConst: declaration.isConst
  9406. });
  9407. return;
  9408. }
  9409. var resultType = this.evaluateExpressionType(declaration.initial);
  9410. if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_9__["MultiType"]) {
  9411. if (!resultType.isCompatible(declaration.type)) {
  9412. var stringInfo = declaration.type.stringInfo();
  9413. var info = stringInfo[0];
  9414. var result_string_info = resultType.stringInfo();
  9415. var result_info = result_string_info[0];
  9416. var exp = declaration.initial;
  9417. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].incompatible_types_full(info.type, info.dim, result_info.type, result_info.dim, exp.toString(), declaration.sourceInfo);
  9418. }
  9419. this.insertSymbol(declaration.id, {
  9420. id: declaration.id,
  9421. type: declaration.type,
  9422. isConst: declaration.isConst
  9423. });
  9424. } else if (!declaration.type.isCompatible(resultType) && !_util_config__WEBPACK_IMPORTED_MODULE_10__["Config"].enable_type_casting || !declaration.type.isCompatible(resultType) && _util_config__WEBPACK_IMPORTED_MODULE_10__["Config"].enable_type_casting && !_store_store__WEBPACK_IMPORTED_MODULE_11__["Store"].canImplicitTypeCast(declaration.type, resultType)) {
  9425. var _stringInfo = declaration.type.stringInfo();
  9426. var _info = _stringInfo[0];
  9427. var _result_string_info = resultType.stringInfo();
  9428. var _result_info = _result_string_info[0];
  9429. var _exp = declaration.initial;
  9430. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].incompatible_types_full(_info.type, _info.dim, _result_info.type, _result_info.dim, _exp.toString(), declaration.sourceInfo);
  9431. } else {
  9432. this.insertSymbol(declaration.id, {
  9433. id: declaration.id,
  9434. type: declaration.type,
  9435. isConst: declaration.isConst
  9436. });
  9437. }
  9438. }
  9439. }
  9440. }, {
  9441. key: "assertArrayDeclaration",
  9442. value: function assertArrayDeclaration(declaration) {
  9443. if (declaration.initial === null) {
  9444. var lineType = this.evaluateExpressionType(declaration.lines);
  9445. if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].INTEGER)) {
  9446. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].array_dimension_not_int_full(declaration.sourceInfo);
  9447. }
  9448. if (declaration.columns !== null) {
  9449. var columnType = this.evaluateExpressionType(declaration.columns);
  9450. if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].INTEGER)) {
  9451. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].array_dimension_not_int_full(declaration.sourceInfo);
  9452. }
  9453. }
  9454. } else {
  9455. this.evaluateArrayLiteral(declaration);
  9456. }
  9457. this.insertSymbol(declaration.id, {
  9458. id: declaration.id,
  9459. lines: declaration.lines,
  9460. columns: declaration.columns,
  9461. type: declaration.type
  9462. });
  9463. return;
  9464. }
  9465. }, {
  9466. key: "evaluateExpressionType",
  9467. value: function evaluateExpressionType(expression) {
  9468. // TODO: Throw operator error in case type == UNDEFINED
  9469. if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_4__["UnaryApp"]) {
  9470. var op = expression.op;
  9471. var resultType = this.evaluateExpressionType(expression.left);
  9472. var finalResult = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_6__["resultTypeAfterUnaryOp"])(op, resultType);
  9473. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].UNDEFINED.isCompatible(finalResult)) {
  9474. var stringInfo = resultType.stringInfo();
  9475. var info = stringInfo[0];
  9476. var expString = expression.toString();
  9477. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_unary_op_full(expString, op, info.type, info.dim, expression.sourceInfo);
  9478. }
  9479. return finalResult;
  9480. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_4__["InfixApp"]) {
  9481. var _op = expression.op;
  9482. var resultTypeLeft = this.evaluateExpressionType(expression.left);
  9483. var resultTypeRight = this.evaluateExpressionType(expression.right);
  9484. var _finalResult = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_6__["resultTypeAfterInfixOp"])(_op, resultTypeLeft, resultTypeRight);
  9485. if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].UNDEFINED.isCompatible(_finalResult)) {
  9486. var stringInfoLeft = resultTypeLeft.stringInfo();
  9487. var infoLeft = stringInfoLeft[0];
  9488. var stringInfoRight = resultTypeRight.stringInfo();
  9489. var infoRight = stringInfoRight[0];
  9490. var _expString = expression.toString();
  9491. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_infix_op_full(_expString, _op, infoLeft.type, infoLeft.dim, infoRight.type, infoRight.dim, expression.sourceInfo);
  9492. }
  9493. return _finalResult;
  9494. } else if (expression instanceof _ast_expressions_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]) {
  9495. return this.evaluateLiteralType(expression);
  9496. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_4__["FunctionCall"]) {
  9497. if (expression.isMainCall) {
  9498. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].void_in_expression_full(_definedFunctions__WEBPACK_IMPORTED_MODULE_1__["LanguageDefinedFunction"].getMainFunctionName(), expression.sourceInfo);
  9499. }
  9500. var fun = this.findFunction(expression.id);
  9501. if (fun === null) {
  9502. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].function_missing_full(expression.id, expression.sourceInfo);
  9503. }
  9504. if (fun.returnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].VOID)) {
  9505. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].void_in_expression_full(expression.id, expression.sourceInfo);
  9506. }
  9507. this.assertParameters(fun, expression.actualParameters);
  9508. return fun.returnType;
  9509. } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_4__["ArrayAccess"]) {
  9510. var arrayTypeInfo = this.findSymbol(expression.id, this.symbolMap);
  9511. if (arrayTypeInfo === null) {
  9512. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].symbol_not_found_full(expression.id, expression.sourceInfo);
  9513. }
  9514. if (!(arrayTypeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"])) {
  9515. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_array_access_full(expression.id, expression.sourceInfo);
  9516. }
  9517. var lineType = this.evaluateExpressionType(expression.line);
  9518. if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].INTEGER)) {
  9519. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].array_dimension_not_int_full(expression.sourceInfo);
  9520. }
  9521. if (expression.column !== null) {
  9522. if (arrayTypeInfo.columns === null) {
  9523. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_matrix_access_full(expression.id, expression.sourceInfo);
  9524. }
  9525. var columnType = this.evaluateExpressionType(expression.column);
  9526. if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].INTEGER)) {
  9527. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].array_dimension_not_int_full(expression.sourceInfo);
  9528. }
  9529. }
  9530. var arrType = arrayTypeInfo.type;
  9531. if (expression.column !== null) {
  9532. // indexing matrix
  9533. return arrType.innerType;
  9534. } else {
  9535. if (arrayTypeInfo.columns === null) {
  9536. return arrType.innerType;
  9537. }
  9538. return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](arrType.innerType, 1);
  9539. }
  9540. }
  9541. }
  9542. }, {
  9543. key: "evaluateLiteralType",
  9544. value: function evaluateLiteralType(literal) {
  9545. if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_4__["IntLiteral"]) {
  9546. return literal.type;
  9547. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_4__["RealLiteral"]) {
  9548. return literal.type;
  9549. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_4__["StringLiteral"]) {
  9550. return literal.type;
  9551. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_4__["BoolLiteral"]) {
  9552. return literal.type;
  9553. } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_4__["VariableLiteral"]) {
  9554. var typeInfo = this.findSymbol(literal.id, this.symbolMap);
  9555. if (typeInfo === null) {
  9556. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].symbol_not_found_full(literal.id, literal.sourceInfo);
  9557. }
  9558. if (typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"]) {
  9559. return typeInfo.type;
  9560. }
  9561. return typeInfo.type;
  9562. } else {
  9563. // console.warn("Evaluating type only for an array literal...");
  9564. var last = null;
  9565. if (literal.value.length === 1) {
  9566. last = this.evaluateExpressionType(literal.value[0]);
  9567. } else {
  9568. for (var i = 0; i < literal.value.length; i++) {
  9569. var e = this.evaluateExpressionType(literal.value[i]);
  9570. if (last === null) {
  9571. last = e;
  9572. } else if (!last.isCompatible(e)) {
  9573. var strInfo = last.stringInfo();
  9574. var info = strInfo[0];
  9575. var strExp = literal.toString();
  9576. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].incompatible_types_array_full(strExp, info.type, info.dim, literal.sourceInfo);
  9577. }
  9578. }
  9579. }
  9580. if (last instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"]) {
  9581. return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](last.innerType, last.dimensions + 1);
  9582. }
  9583. return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](last, 1);
  9584. }
  9585. }
  9586. }, {
  9587. key: "evaluateArrayLiteral",
  9588. value: function evaluateArrayLiteral(arrayDeclaration) {
  9589. var type = arrayDeclaration.type;
  9590. var literal = arrayDeclaration.initial; // console.log(arrayDeclaration);
  9591. if (arrayDeclaration.isVector) {
  9592. this.evaluateVectorLiteralType(literal, type);
  9593. } else {
  9594. // TODO matrix type check
  9595. for (var i = 0; i < literal.lines; ++i) {
  9596. var line_literal = literal.value[i];
  9597. this.evaluateVectorLiteralType(line_literal, new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](type.innerType, 1));
  9598. }
  9599. }
  9600. return true;
  9601. }
  9602. }, {
  9603. key: "assertFunction",
  9604. value: function assertFunction(fun) {
  9605. var _this = this;
  9606. this.pushMap();
  9607. this.currentFunction = fun;
  9608. fun.formalParameters.forEach(function (formalParam) {
  9609. if (formalParam.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"]) {
  9610. if (formalParam.type.dimensions > 1) {
  9611. _this.insertSymbol(formalParam.id, {
  9612. id: formalParam.id,
  9613. lines: -1,
  9614. columns: -1,
  9615. type: formalParam.type
  9616. });
  9617. } else {
  9618. _this.insertSymbol(formalParam.id, {
  9619. id: formalParam.id,
  9620. lines: -1,
  9621. columns: null,
  9622. type: formalParam.type
  9623. });
  9624. }
  9625. } else {
  9626. _this.insertSymbol(formalParam.id, {
  9627. id: formalParam.id,
  9628. type: formalParam.type
  9629. });
  9630. }
  9631. });
  9632. this.assertDeclarations(fun.variablesDeclarations);
  9633. var optional = fun.returnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].VOID);
  9634. var valid = this.assertReturn(fun, optional);
  9635. if (!valid) {
  9636. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].function_no_return(fun.name);
  9637. }
  9638. this.popMap();
  9639. }
  9640. }, {
  9641. key: "assertReturn",
  9642. value: function assertReturn(fun, optional) {
  9643. var _this2 = this;
  9644. return fun.commands.reduce(function (last, next) {
  9645. return _this2.checkCommand(fun.returnType, next, optional) || last;
  9646. }, optional);
  9647. }
  9648. }, {
  9649. key: "checkCommand",
  9650. value: function checkCommand(type, cmd, optional) {
  9651. if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_3__["While"]) {
  9652. var resultType = this.evaluateExpressionType(cmd.expression);
  9653. if (!resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].BOOLEAN)) {
  9654. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].loop_condition_type_full(cmd.expression.toString(), cmd.sourceInfo);
  9655. }
  9656. this.checkCommands(type, cmd.commands, optional);
  9657. return false;
  9658. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_3__["For"]) {
  9659. var var_type = this.evaluateExpressionType(cmd.for_id);
  9660. if (!var_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].INTEGER)) {
  9661. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_for_variable(cmd.for_id, cmd.sourceInfo);
  9662. }
  9663. var from_type = this.evaluateExpressionType(cmd.for_from);
  9664. if (!from_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].INTEGER)) {
  9665. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_for_from(cmd.for_from, cmd.sourceInfo);
  9666. }
  9667. var to_type = this.evaluateExpressionType(cmd.for_to);
  9668. if (!to_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].INTEGER)) {
  9669. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_for_to(cmd.for_to, cmd.sourceInfo);
  9670. }
  9671. if (cmd.for_pass != null) {
  9672. var pass_type = this.evaluateExpressionType(cmd.for_pass);
  9673. if (!pass_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].INTEGER)) {
  9674. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_for_pass(cmd.for_pass, cmd.sourceInfo);
  9675. }
  9676. }
  9677. this.checkCommands(type, cmd.commands, optional);
  9678. return false;
  9679. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Switch"]) {
  9680. var sType = this.evaluateExpressionType(cmd.expression);
  9681. var result = optional;
  9682. var hasDefault = false;
  9683. for (var i = 0; i < cmd.cases.length; i++) {
  9684. var aCase = cmd.cases[i];
  9685. if (aCase.expression !== null) {
  9686. var caseType = this.evaluateExpressionType(aCase.expression);
  9687. if (!sType.isCompatible(caseType)) {
  9688. var strInfo = sType.stringInfo();
  9689. var info = strInfo[0];
  9690. var strExp = aCase.expression.toString();
  9691. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_case_type_full(strExp, info.type, info.dim, aCase.sourceInfo);
  9692. }
  9693. } else {
  9694. hasDefault = true;
  9695. }
  9696. result = result && this.checkCommands(type, aCase.commands, result);
  9697. }
  9698. return result && hasDefault;
  9699. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_3__["ArrayIndexAssign"]) {
  9700. // TODO - rework!!!!!
  9701. var used_dims = 0;
  9702. var typeInfo = this.findSymbol(cmd.id, this.symbolMap);
  9703. if (typeInfo === null) {
  9704. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].symbol_not_found_full(cmd.id, cmd.sourceInfo);
  9705. }
  9706. if (typeInfo.isConst) {
  9707. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  9708. }
  9709. if (!(typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"])) {
  9710. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_array_access_full(cmd.id, cmd.sourceInfo);
  9711. }
  9712. var exp = cmd.expression;
  9713. var lineExp = cmd.line;
  9714. var lineType = this.evaluateExpressionType(lineExp);
  9715. if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].INTEGER)) {
  9716. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  9717. }
  9718. used_dims += 1;
  9719. var columnExp = cmd.column;
  9720. if (typeInfo.columns === null && columnExp !== null) {
  9721. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_matrix_access_full(cmd.id, cmd.sourceInfo);
  9722. } else if (columnExp !== null) {
  9723. var columnType = this.evaluateExpressionType(columnExp);
  9724. if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].INTEGER)) {
  9725. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
  9726. }
  9727. used_dims += 1;
  9728. } // exp a single value exp or an array access
  9729. var exp_type = this.evaluateExpressionType(exp);
  9730. var access_type = typeInfo.type;
  9731. var compatible = false;
  9732. if (exp_type instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_9__["MultiType"]) {
  9733. var _type = access_type;
  9734. if (access_type.dimensions - used_dims == 0) {
  9735. _type = access_type.innerType;
  9736. } else {
  9737. _type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](access_type.innerType, Math.max(0, access_type.dimensions - used_dims));
  9738. }
  9739. compatible = exp_type.isCompatible(_type);
  9740. } else {
  9741. compatible = access_type.canAccept(exp_type, used_dims);
  9742. }
  9743. if (!compatible) {
  9744. if (!_util_config__WEBPACK_IMPORTED_MODULE_10__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_11__["Store"].canImplicitTypeCast(access_type, exp_type)) {
  9745. var access_type_string_info = access_type.stringInfo();
  9746. var access_type_info = access_type_string_info[0];
  9747. var exp_type_string_info = exp_type.stringInfo();
  9748. var exp_type_info = exp_type_string_info[0];
  9749. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["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);
  9750. }
  9751. }
  9752. return optional;
  9753. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Assign"]) {
  9754. // TODO - rework since there is no literal array assignment
  9755. var _typeInfo = this.findSymbol(cmd.id, this.symbolMap);
  9756. if (_typeInfo === null) {
  9757. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].symbol_not_found_full(cmd.id, cmd.sourceInfo);
  9758. }
  9759. if (_typeInfo.isConst) {
  9760. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
  9761. }
  9762. var _exp2 = cmd.expression;
  9763. var _exp_type = this.evaluateExpressionType(_exp2);
  9764. if (_exp_type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"]) {
  9765. if (!(_typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"])) {
  9766. // TODO better error message
  9767. throw new Error("Cannot assign an array to a non-array variable ");
  9768. } // Both are arrays...
  9769. // if both don't have same dimensions and type, cannot perform assignment
  9770. if (!_exp_type.isCompatible(_typeInfo.type)) {
  9771. if (_exp_type.dimensions === _typeInfo.type.dimensions && !_exp_type.innerType.isCompatible(_typeInfo.type.innerType)) {
  9772. if (!_util_config__WEBPACK_IMPORTED_MODULE_10__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_11__["Store"].canImplicitTypeCast(_typeInfo.type.innerType, _exp_type.innerType)) {
  9773. var stringInfo = _typeInfo.type.stringInfo();
  9774. var _info2 = stringInfo[0];
  9775. var _exp_type_string_info = _exp_type.stringInfo();
  9776. var _exp_type_info = _exp_type_string_info[0];
  9777. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].incompatible_types_full(_info2.type, _info2.dim, _exp_type_info.type, _exp_type_info.dim, _exp2.toString(), cmd.sourceInfo);
  9778. }
  9779. } else {
  9780. switch (_exp_type.dimensions) {
  9781. case 1:
  9782. {
  9783. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].vector_to_matrix_attr(cmd.id, _exp2.toString(), cmd.sourceInfo);
  9784. }
  9785. case 2:
  9786. {
  9787. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].matrix_to_vector_attr(cmd.id, _exp2.toString(), cmd.sourceInfo);
  9788. }
  9789. }
  9790. }
  9791. }
  9792. } else if (!_exp_type.isCompatible(_typeInfo.type)) {
  9793. if (!_util_config__WEBPACK_IMPORTED_MODULE_10__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_11__["Store"].canImplicitTypeCast(_typeInfo.type, _exp_type)) {
  9794. var _stringInfo2 = _typeInfo.type.stringInfo();
  9795. var _info3 = _stringInfo2[0];
  9796. var _exp_type_string_info2 = _exp_type.stringInfo();
  9797. var _exp_type_info2 = _exp_type_string_info2[0];
  9798. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].incompatible_types_full(_info3.type, _info3.dim, _exp_type_info2.type, _exp_type_info2.dim, _exp2.toString(), cmd.sourceInfo);
  9799. }
  9800. }
  9801. return optional;
  9802. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Break"]) {
  9803. return optional;
  9804. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_3__["IfThenElse"]) {
  9805. var _resultType = this.evaluateExpressionType(cmd.condition);
  9806. if (!_resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].BOOLEAN)) {
  9807. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].if_condition_type_full(cmd.condition.toString(), cmd.sourceInfo);
  9808. }
  9809. if (cmd.ifFalse instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_3__["IfThenElse"]) {
  9810. return this.checkCommands(type, cmd.ifTrue.commands, optional) && this.checkCommand(type, cmd.ifFalse, optional);
  9811. } else if (cmd.ifFalse != null) {
  9812. return this.checkCommands(type, cmd.ifTrue.commands, optional) && this.checkCommands(type, cmd.ifFalse.commands, optional);
  9813. } else {
  9814. return this.checkCommands(type, cmd.ifTrue.commands, optional);
  9815. }
  9816. } else if (cmd instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_4__["FunctionCall"]) {
  9817. var fun = null;
  9818. if (cmd.isMainCall) {
  9819. fun = this.getMainFunction();
  9820. } else {
  9821. fun = this.findFunction(cmd.id);
  9822. }
  9823. if (fun === null) {
  9824. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].function_missing_full(cmd.id, cmd.sourceInfo);
  9825. }
  9826. this.assertParameters(fun, cmd.actualParameters);
  9827. return optional;
  9828. } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Return"]) {
  9829. var funcName = this.currentFunction.isMain ? _definedFunctions__WEBPACK_IMPORTED_MODULE_1__["LanguageDefinedFunction"].getMainFunctionName() : this.currentFunction.name;
  9830. if (cmd.expression === null && !type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].VOID)) {
  9831. var _stringInfo3 = type.stringInfo();
  9832. var _info4 = _stringInfo3[0];
  9833. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_void_return_full(funcName, _info4.type, _info4.dim, cmd.sourceInfo);
  9834. } else if (cmd.expression !== null) {
  9835. var _resultType2 = this.evaluateExpressionType(cmd.expression);
  9836. if (!type.isCompatible(_resultType2)) {
  9837. var _stringInfo4 = type.stringInfo();
  9838. var _info5 = _stringInfo4[0];
  9839. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_return_type_full(funcName, _info5.type, _info5.dim, cmd.sourceInfo);
  9840. } else {
  9841. return true;
  9842. }
  9843. } else {
  9844. return true;
  9845. }
  9846. }
  9847. }
  9848. }, {
  9849. key: "checkCommands",
  9850. value: function checkCommands(type, cmds, optional) {
  9851. var _this3 = this;
  9852. return cmds.reduce(function (last, next) {
  9853. return _this3.checkCommand(type, next, optional) || last;
  9854. }, optional);
  9855. }
  9856. }, {
  9857. key: "assertParameters",
  9858. value: function assertParameters(fun, actualParametersList) {
  9859. if (fun.formalParameters.length !== actualParametersList.length) {
  9860. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_parameters_size_full(fun.name, actualParametersList.length, fun.formalParameters.length, null);
  9861. }
  9862. for (var i = 0; i < actualParametersList.length; ++i) {
  9863. var param = actualParametersList[i];
  9864. var formalParam = fun.formalParameters[i]; // const id = formalParam.id;
  9865. if (formalParam.byRef) {
  9866. if (param instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_4__["VariableLiteral"]) {
  9867. var variable = this.findSymbol(param.id, this.symbolMap);
  9868. if (variable.isConst) {
  9869. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_const_ref_full(fun.name, param.toString(), param.sourceInfo);
  9870. }
  9871. } else if (!(param instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_4__["VariableLiteral"] || param instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_4__["ArrayAccess"])) {
  9872. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, param.toString(), param.sourceInfo);
  9873. }
  9874. }
  9875. var resultType = this.evaluateExpressionType(param);
  9876. if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_9__["MultiType"] && formalParam.type instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_9__["MultiType"]) {
  9877. var shared = 0;
  9878. for (var j = 0; j < resultType.types.length; ++j) {
  9879. var element = resultType.types[j];
  9880. if (formalParam.type.types.indexOf(element) !== -1) {
  9881. shared += 1;
  9882. }
  9883. }
  9884. if (shared <= 0) {
  9885. if (_util_config__WEBPACK_IMPORTED_MODULE_10__["Config"].enable_type_casting && !formalParam.byRef) {
  9886. if (resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].INTEGER) || resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].REAL)) {
  9887. if (formalParam.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].INTEGER) || formalParam.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].REAL)) {
  9888. continue;
  9889. }
  9890. }
  9891. }
  9892. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, param.toString(), param.sourceInfo);
  9893. }
  9894. } else if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_9__["MultiType"]) {
  9895. if (!resultType.isCompatible(formalParam.type)) {
  9896. if (_util_config__WEBPACK_IMPORTED_MODULE_10__["Config"].enable_type_casting && !formalParam.byRef) {
  9897. if (resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].INTEGER) || resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].REAL)) {
  9898. if (formalParam.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].INTEGER) || formalParam.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].REAL)) {
  9899. continue;
  9900. }
  9901. }
  9902. }
  9903. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, param.toString(), param.sourceInfo);
  9904. }
  9905. } else if (!formalParam.type.isCompatible(resultType)) {
  9906. if (_util_config__WEBPACK_IMPORTED_MODULE_10__["Config"].enable_type_casting && !formalParam.byRef) {
  9907. if (_store_store__WEBPACK_IMPORTED_MODULE_11__["Store"].canImplicitTypeCast(formalParam.type, resultType)) {
  9908. continue;
  9909. }
  9910. }
  9911. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, param.toString(), param.sourceInfo);
  9912. }
  9913. }
  9914. }
  9915. }, {
  9916. key: "evaluateVectorLiteralType",
  9917. value: function evaluateVectorLiteralType(literal, type) {
  9918. // console.log(literal);
  9919. for (var i = 0; i < literal.value.length; i += 1) {
  9920. var exp = literal.value[i];
  9921. var expType = this.evaluateExpressionType(exp);
  9922. var compatible = false;
  9923. if (expType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_9__["MultiType"]) {
  9924. compatible = expType.isCompatible(type.innerType);
  9925. } else {
  9926. compatible = type.canAccept(expType, 1);
  9927. }
  9928. if (!compatible) {
  9929. if (!_util_config__WEBPACK_IMPORTED_MODULE_10__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_11__["Store"].canImplicitTypeCast(type.innerType, expType)) {
  9930. var stringInfo = type.stringInfo();
  9931. var info = stringInfo[0];
  9932. var result_string_info = expType.stringInfo();
  9933. var result_info = result_string_info[0];
  9934. throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_0__["ProcessorErrorFactory"].incompatible_types_full(info.type, 0, result_info.type, result_info.dim, exp.toString(), literal.sourceInfo);
  9935. }
  9936. }
  9937. }
  9938. return type;
  9939. }
  9940. }]);
  9941. return SemanticAnalyser;
  9942. }();
  9943. /***/ }),
  9944. /***/ "./js/processor/store/store.ts":
  9945. /*!*************************************!*\
  9946. !*** ./js/processor/store/store.ts ***!
  9947. \*************************************/
  9948. /*! no static exports found */
  9949. /***/ (function(module, exports, __webpack_require__) {
  9950. "use strict";
  9951. Object.defineProperty(exports, "__esModule", { value: true });
  9952. const modes_1 = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
  9953. const types_1 = __webpack_require__(/*! ../../typeSystem/types */ "./js/typeSystem/types.ts");
  9954. const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
  9955. const storeObjectRef_1 = __webpack_require__(/*! ./storeObjectRef */ "./js/processor/store/storeObjectRef.ts");
  9956. const array_type_1 = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  9957. const array_store_value_1 = __webpack_require__(/*! ./value/array_store_value */ "./js/processor/store/value/array_store_value.ts");
  9958. const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
  9959. const storeObjectArray_1 = __webpack_require__(/*! ./storeObjectArray */ "./js/processor/store/storeObjectArray.ts");
  9960. const store_value_1 = __webpack_require__(/*! ./value/store_value */ "./js/processor/store/value/store_value.ts");
  9961. const store_value_address_1 = __webpack_require__(/*! ./value/store_value_address */ "./js/processor/store/value/store_value_address.ts");
  9962. const store_value_ref_1 = __webpack_require__(/*! ./value/store_value_ref */ "./js/processor/store/value/store_value_ref.ts");
  9963. const array_store_value_ref_1 = __webpack_require__(/*! ./value/array_store_value_ref */ "./js/processor/store/value/array_store_value_ref.ts");
  9964. const store_object_array_ref_1 = __webpack_require__(/*! ./store_object_array_ref */ "./js/processor/store/store_object_array_ref.ts");
  9965. class Store {
  9966. constructor(name) {
  9967. this.name = name;
  9968. this.store = new Map();
  9969. this.mode = modes_1.Modes.RUN;
  9970. }
  9971. static canImplicitTypeCast(castType, sourceType) {
  9972. if (castType.isCompatible(types_1.Types.INTEGER) || castType.isCompatible(types_1.Types.REAL)) {
  9973. if (sourceType.isCompatible(types_1.Types.INTEGER) || sourceType.isCompatible(types_1.Types.REAL)) {
  9974. return true;
  9975. }
  9976. }
  9977. return false;
  9978. }
  9979. static doImplicitCasting(castType, stoObj) {
  9980. if (!Store.canImplicitTypeCast(castType, stoObj.type)) {
  9981. throw new Error("!!!Critical error: attempted to type cast invalid types");
  9982. }
  9983. if (castType.isCompatible(types_1.Types.INTEGER)) {
  9984. return new store_value_1.StoreValue(types_1.Types.INTEGER, stoObj.get().trunc());
  9985. }
  9986. else {
  9987. return new store_value_1.StoreValue(types_1.Types.REAL, stoObj.get());
  9988. }
  9989. }
  9990. extendStore(nextStore) {
  9991. this.nextStore = nextStore;
  9992. }
  9993. applyStore(id) {
  9994. if (!this.store.has(id)) {
  9995. if (this.nextStore != null) {
  9996. return this.nextStore.applyStore(id);
  9997. }
  9998. else {
  9999. throw new Error(`Variable ${id} not found.`);
  10000. }
  10001. }
  10002. const val = this.store.get(id);
  10003. let result = null;
  10004. if (val.type instanceof array_type_1.ArrayType) {
  10005. const array = val;
  10006. const array_type = array.type;
  10007. let l = 0, c = 0;
  10008. const values = array.value.map(v => {
  10009. if (array.isVector) {
  10010. return new store_value_address_1.StoreValueAddress(array_type.innerType, v, l++, undefined, array.id, array.readOnly);
  10011. }
  10012. else {
  10013. if (c >= array.columns) {
  10014. c = 0;
  10015. l += 1;
  10016. }
  10017. return new store_value_address_1.StoreValueAddress(array_type.innerType, v, l, c++, array.id, array.readOnly);
  10018. }
  10019. });
  10020. result = new array_store_value_1.ArrayStoreValue(array_type, values, array.lines, array.columns, val.id, val.readOnly);
  10021. }
  10022. else {
  10023. result = new store_value_1.StoreValue(val.type, val.value, val.id, val.readOnly);
  10024. }
  10025. return result;
  10026. }
  10027. updateStore(id, stoValue) {
  10028. if (!this.store.has(id)) {
  10029. if (this.nextStore != null) {
  10030. this.nextStore.updateStore(id, stoValue);
  10031. return this;
  10032. }
  10033. else {
  10034. // TODO: better error message
  10035. throw new Error(`Variable ${id} not found.`);
  10036. }
  10037. }
  10038. else {
  10039. const oldObj = this.store.get(id);
  10040. if (oldObj.readOnly) {
  10041. // TODO: better error message
  10042. throw new Error("Cannot change value of a read only variable: " + id);
  10043. }
  10044. if (oldObj instanceof storeObjectArray_1.StoreObjectArray) {
  10045. const array_value = stoValue;
  10046. if (oldObj.isCompatible(array_value)) {
  10047. if (oldObj.isVector) {
  10048. array_value.get().forEach((val, index) => {
  10049. oldObj.setAt(val, index, undefined);
  10050. });
  10051. }
  10052. else {
  10053. let line = 0;
  10054. let column = 0;
  10055. array_value.get().forEach((val) => {
  10056. oldObj.setAt(val, line, column);
  10057. column += 1;
  10058. if (column >= oldObj.columns) {
  10059. line += 1;
  10060. column = 0;
  10061. }
  10062. });
  10063. }
  10064. return this;
  10065. }
  10066. }
  10067. else if (oldObj.isCompatible(stoValue)) {
  10068. const loc_address = oldObj.locAddress;
  10069. location_1.Location.updateAddress(loc_address, stoValue.get());
  10070. return this;
  10071. }
  10072. const oldType = oldObj.type;
  10073. const stoType = stoValue.type;
  10074. // TODO: better error message
  10075. throw new Error(`${oldType.value} is not compatible with type ${stoType.value} given`);
  10076. }
  10077. }
  10078. /**
  10079. * Method used to update regions of an array (vector or matrix). The should only be used when update an specific
  10080. * possition since it will only update the required addresses.
  10081. * @param {string} id the variable id to be updated
  10082. * @param {IStoreValue} sto_value the value to be used in the update process
  10083. * @param {number} line the line address of the vector/matrix
  10084. * @param {number} column the matrix column, which can be undefined
  10085. */
  10086. updateStoreArray(id, sto_value, line, column) {
  10087. if (!this.store.has(id)) {
  10088. if (this.nextStore != null) {
  10089. this.nextStore.updateStoreArray(id, sto_value, line, column);
  10090. return this;
  10091. }
  10092. else {
  10093. // TODO: better error message
  10094. throw new Error(`Variable ${id} not found.`);
  10095. }
  10096. }
  10097. else {
  10098. const oldObj = this.store.get(id);
  10099. if (oldObj.readOnly) {
  10100. // TODO: better error message
  10101. throw new Error("Cannot change value of a read only variable: " + id);
  10102. }
  10103. if (oldObj instanceof storeObjectArray_1.StoreObjectArray) {
  10104. if (sto_value instanceof array_store_value_1.ArrayStoreValue) {
  10105. // this must be a vector or matrix line update
  10106. const actual_values = sto_value.get();
  10107. if (oldObj.isVector && sto_value.isVector()) {
  10108. for (let i = 0; i < sto_value.lines; i += 1) {
  10109. const val = actual_values[i];
  10110. oldObj.setAt(val, i, undefined);
  10111. }
  10112. }
  10113. else if (!oldObj.isVector && column == null && sto_value.isVector()) {
  10114. for (let i = 0; i < oldObj.columns; i += 1) {
  10115. const val = actual_values[i];
  10116. oldObj.setAt(val, line, i);
  10117. }
  10118. }
  10119. else {
  10120. // TODO: better error message
  10121. throw new Error(`Attempting to assign an invalid value to array ${id}`);
  10122. }
  10123. }
  10124. else {
  10125. if (!oldObj.isVector && column == null) {
  10126. // TODO: better error message
  10127. throw new Error(`Attempting to assign an invalid value to array ${id}`);
  10128. }
  10129. oldObj.setAt(sto_value, line, column);
  10130. }
  10131. }
  10132. else {
  10133. throw new Error("Cannot update a non-array variable using updateStoreArray");
  10134. }
  10135. // const oldType = oldObj.type;
  10136. // const stoType = sto_value.type;
  10137. // // TODO: better error message
  10138. // throw new Error(`${oldType.value} is not compatible with type ${stoType.value} given`);
  10139. return this;
  10140. }
  10141. }
  10142. /**
  10143. * Inserts a new variable into the Store. This method should be used when declaring a new variable,
  10144. * including the special return variable $.
  10145. * @param id variable id
  10146. * @param stoValue the value to be used as the initial value of id
  10147. */
  10148. insertStore(id, stoValue) {
  10149. if (this.store.has(id)) {
  10150. // TODO: better error message
  10151. throw new Error(`${id} is already defined`);
  10152. }
  10153. // TODO check for array....
  10154. let newObj;
  10155. if (stoValue instanceof store_value_ref_1.StoreValueRef) {
  10156. newObj = new storeObjectRef_1.StoreObjectRef(stoValue);
  10157. }
  10158. else if (stoValue instanceof array_store_value_ref_1.ArrayStoreValueRef) {
  10159. newObj = new store_object_array_ref_1.StoreObjectArrayRef(stoValue, stoValue.lines, stoValue.columns);
  10160. }
  10161. else if (stoValue instanceof array_store_value_1.ArrayStoreValue) {
  10162. const columns = stoValue.isVector() ? 0 : stoValue.columns;
  10163. const addresses = [];
  10164. const all_values = stoValue.get();
  10165. if (all_values.length > 0) {
  10166. for (let i = 0; i < stoValue.get().length; i += 1) {
  10167. const val = all_values[i].get();
  10168. addresses.push(location_1.Location.allocate(val));
  10169. }
  10170. }
  10171. else {
  10172. let total = stoValue.lines;
  10173. total = stoValue.isVector() ? total : total * columns;
  10174. for (let i = 0; i < total; i += 1) {
  10175. addresses.push(location_1.Location.allocate(null));
  10176. }
  10177. }
  10178. newObj = new storeObjectArray_1.StoreObjectArray(stoValue.type, stoValue.lines, columns, addresses, stoValue.isConst);
  10179. }
  10180. else {
  10181. const loc_address = location_1.Location.allocate(stoValue.get());
  10182. newObj = new storeObject_1.StoreObject(stoValue.type, loc_address, stoValue.isConst);
  10183. }
  10184. newObj.setID(id);
  10185. this.store.set(id, newObj);
  10186. return this;
  10187. }
  10188. /**
  10189. * Helper function similar to applyStore. But it returns the actual object in the store be it ref or not
  10190. * applyStore will return the refferenced object if the object in the store is a ref
  10191. */
  10192. getStoreObject(id) {
  10193. if (!this.store.has(id)) {
  10194. if (this.nextStore != null) {
  10195. return this.nextStore.getStoreObject(id);
  10196. }
  10197. else {
  10198. throw new Error(`Variable ${id} not found.`);
  10199. }
  10200. }
  10201. return this.store.get(id);
  10202. }
  10203. destroy() {
  10204. this.store.forEach(sto => sto.destroy(), this);
  10205. }
  10206. }
  10207. exports.Store = Store;
  10208. /***/ }),
  10209. /***/ "./js/processor/store/storeObject.ts":
  10210. /*!*******************************************!*\
  10211. !*** ./js/processor/store/storeObject.ts ***!
  10212. \*******************************************/
  10213. /*! no static exports found */
  10214. /***/ (function(module, exports, __webpack_require__) {
  10215. "use strict";
  10216. Object.defineProperty(exports, "__esModule", { value: true });
  10217. const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
  10218. class StoreObject {
  10219. /**
  10220. *
  10221. * @param {Type} type
  10222. * @param {Number} loc_address
  10223. * @param {Boolean} readOnly
  10224. */
  10225. constructor(type, loc_address, readOnly = false) {
  10226. this._loc_address = loc_address;
  10227. this._type = type;
  10228. this._readOnly = readOnly;
  10229. this._id = undefined;
  10230. }
  10231. setID(id) {
  10232. this._id = id;
  10233. }
  10234. get id() {
  10235. return this._id;
  10236. }
  10237. get inStore() {
  10238. return this.id !== null;
  10239. }
  10240. get type() {
  10241. return this._type;
  10242. }
  10243. /**
  10244. * Returns the actual value stored at the loccation address present in this object.
  10245. * The returned value is compatible with @prop{StoreObject.type}
  10246. */
  10247. get value() {
  10248. const address = location_1.Location.find(this._loc_address);
  10249. if (address != null) {
  10250. return address.value;
  10251. }
  10252. else {
  10253. throw new Error("!!!Critical Error: variable " + this.id + " does not have a valid address. Loc-Address " + this.locAddress);
  10254. }
  10255. }
  10256. get number() {
  10257. throw new Error("DOT NOT USE THIS PROPERTY!");
  10258. }
  10259. get readOnly() {
  10260. return this._readOnly;
  10261. }
  10262. set readOnly(value) {
  10263. this._readOnly = value;
  10264. }
  10265. isCompatible(another) {
  10266. return this.type.isCompatible(another.type);
  10267. }
  10268. destroy() {
  10269. return location_1.Location.deallocate(this._loc_address);
  10270. }
  10271. get locAddress() {
  10272. return this._loc_address;
  10273. }
  10274. }
  10275. exports.StoreObject = StoreObject;
  10276. /***/ }),
  10277. /***/ "./js/processor/store/storeObjectArray.ts":
  10278. /*!************************************************!*\
  10279. !*** ./js/processor/store/storeObjectArray.ts ***!
  10280. \************************************************/
  10281. /*! no static exports found */
  10282. /***/ (function(module, exports, __webpack_require__) {
  10283. "use strict";
  10284. Object.defineProperty(exports, "__esModule", { value: true });
  10285. const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
  10286. const array_store_value_1 = __webpack_require__(/*! ./value/array_store_value */ "./js/processor/store/value/array_store_value.ts");
  10287. const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
  10288. class StoreObjectArray extends storeObject_1.StoreObject {
  10289. constructor(type, _lines, _columns, loc_addresses, readOnly = false) {
  10290. super(type, -1, readOnly);
  10291. this._lines = _lines;
  10292. this._columns = _columns;
  10293. this.loc_addresses = loc_addresses;
  10294. }
  10295. get lines() {
  10296. return this._lines;
  10297. }
  10298. get columns() {
  10299. return this._columns;
  10300. }
  10301. isCompatible(another) {
  10302. if (another instanceof array_store_value_1.ArrayStoreValue) {
  10303. const cols = another.columns == null ? 0 : another.columns;
  10304. if (this.lines === another.lines && this.columns === cols) {
  10305. return super.isCompatible(another);
  10306. }
  10307. }
  10308. return false;
  10309. }
  10310. get isVector() {
  10311. return this.type.dimensions === 1;
  10312. }
  10313. /**@override
  10314. * Returns the list of values stored by this array.
  10315. * All returned values are compatible with @prop{StoreObject.type}
  10316. */
  10317. get value() {
  10318. const values = [];
  10319. for (let i = 0; i < this.addresses.length; i += 1) {
  10320. const address = location_1.Location.find(this.addresses[i]);
  10321. if (address != null) {
  10322. values.push(address.value);
  10323. }
  10324. else {
  10325. throw new Error("!!!Critical Error: variable " + this.id + " does not have a valid address. Loc-Address " + this.locAddress);
  10326. }
  10327. }
  10328. return values;
  10329. }
  10330. destroy() {
  10331. let bool = true;
  10332. for (let i = 0; i < this.addresses.length; i += 1) {
  10333. bool = bool && location_1.Location.deallocate(this.addresses[i]);
  10334. }
  10335. return bool;
  10336. }
  10337. /**
  10338. * @override
  10339. *
  10340. * Returns the address that contains a list of all addresses of the values present in the array
  10341. */
  10342. get locAddress() {
  10343. throw new Error("!!!Internal Error: Cannot invoke locAddress on StoreObjectArray");
  10344. }
  10345. get addresses() {
  10346. return this.loc_addresses;
  10347. }
  10348. getAt(line, column) {
  10349. if (this.isVector) {
  10350. if (column != null) {
  10351. throw new Error(this.id + " is not a matrix!");
  10352. }
  10353. column = line;
  10354. line = 0;
  10355. }
  10356. else if (column == null) {
  10357. // this is a whole line...
  10358. const values = [];
  10359. for (let col = 0; col < this.columns; col += 1) {
  10360. const index = this.getIndexOf(line, col);
  10361. const address = location_1.Location.find(this.addresses[index]);
  10362. values.push(address.value);
  10363. }
  10364. return values;
  10365. }
  10366. const index = this.getIndexOf(line, column);
  10367. const address = location_1.Location.find(this.addresses[index]);
  10368. return address.value;
  10369. }
  10370. setAt(value, line, column) {
  10371. let used_dims = 1;
  10372. if (column != null) {
  10373. used_dims += 1;
  10374. }
  10375. if (!this.type.canAccept(value.type, used_dims)) {
  10376. throw new Error("!!!Internal Error: Attempting to insert an invalid value inside array " + this.id);
  10377. }
  10378. if (this.isVector) {
  10379. if (column != null) {
  10380. throw new Error(this.id + " is not a matrix!");
  10381. }
  10382. column = line;
  10383. line = 0;
  10384. }
  10385. else if (column == null) {
  10386. throw new Error("!!!Internal Error: Attempting to insert a line into matrix " + this.id);
  10387. }
  10388. const pos = this.getIndexOf(line, column);
  10389. location_1.Location.updateAddress(this.addresses[pos], value.get());
  10390. }
  10391. getIndexOf(line, column) {
  10392. return line * this.columns + column;
  10393. }
  10394. getLocAddressOf(line, column) {
  10395. if (this.isVector) {
  10396. if (column != null) {
  10397. throw new Error(this.id + " is not a matrix!");
  10398. }
  10399. column = line;
  10400. line = 0;
  10401. }
  10402. else if (column == null) {
  10403. // this is a whole line...
  10404. const values = [];
  10405. for (let col = 0; col < this.columns; col += 1) {
  10406. const index = this.getIndexOf(line, col);
  10407. values.push(this.addresses[index]);
  10408. }
  10409. return values;
  10410. }
  10411. const index = this.getIndexOf(line, column);
  10412. return this.addresses[index];
  10413. }
  10414. }
  10415. exports.StoreObjectArray = StoreObjectArray;
  10416. /***/ }),
  10417. /***/ "./js/processor/store/storeObjectRef.ts":
  10418. /*!**********************************************!*\
  10419. !*** ./js/processor/store/storeObjectRef.ts ***!
  10420. \**********************************************/
  10421. /*! no static exports found */
  10422. /***/ (function(module, exports, __webpack_require__) {
  10423. "use strict";
  10424. Object.defineProperty(exports, "__esModule", { value: true });
  10425. const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
  10426. class StoreObjectRef extends storeObject_1.StoreObject {
  10427. /**
  10428. *
  10429. * @param {StoreObject} stoValue
  10430. */
  10431. constructor(stoValue) {
  10432. super(stoValue.type, stoValue.getRefAddress(), false);
  10433. this.refObj = stoValue.id;
  10434. this.reference_dimension = stoValue.getReferenceDimension();
  10435. }
  10436. get isRef() {
  10437. return true;
  10438. }
  10439. getRefObj() {
  10440. return this.refObj;
  10441. }
  10442. getReferenceDimension() {
  10443. return this.reference_dimension;
  10444. }
  10445. destroy() {
  10446. return false;
  10447. }
  10448. }
  10449. exports.StoreObjectRef = StoreObjectRef;
  10450. /***/ }),
  10451. /***/ "./js/processor/store/store_object_array_ref.ts":
  10452. /*!******************************************************!*\
  10453. !*** ./js/processor/store/store_object_array_ref.ts ***!
  10454. \******************************************************/
  10455. /*! no static exports found */
  10456. /***/ (function(module, exports, __webpack_require__) {
  10457. "use strict";
  10458. Object.defineProperty(exports, "__esModule", { value: true });
  10459. const storeObjectArray_1 = __webpack_require__(/*! ./storeObjectArray */ "./js/processor/store/storeObjectArray.ts");
  10460. class StoreObjectArrayRef extends storeObjectArray_1.StoreObjectArray {
  10461. constructor(stoValue, lines, columns) {
  10462. super(stoValue.type, lines, columns, stoValue.getAddresses(), false);
  10463. this.refObj = stoValue.id;
  10464. }
  10465. get isRef() {
  10466. return true;
  10467. }
  10468. getRefObj() {
  10469. return this.refObj;
  10470. }
  10471. destroy() {
  10472. return false;
  10473. }
  10474. }
  10475. exports.StoreObjectArrayRef = StoreObjectArrayRef;
  10476. /***/ }),
  10477. /***/ "./js/processor/store/value/array_store_value.ts":
  10478. /*!*******************************************************!*\
  10479. !*** ./js/processor/store/value/array_store_value.ts ***!
  10480. \*******************************************************/
  10481. /*! no static exports found */
  10482. /***/ (function(module, exports, __webpack_require__) {
  10483. "use strict";
  10484. Object.defineProperty(exports, "__esModule", { value: true });
  10485. const array_type_1 = __webpack_require__(/*! ../../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
  10486. const store_value_address_1 = __webpack_require__(/*! ./store_value_address */ "./js/processor/store/value/store_value_address.ts");
  10487. class ArrayStoreValue {
  10488. constructor(type, values, lines, columns, id, isConst = false) {
  10489. this.type = type;
  10490. this.id = id;
  10491. this.isConst = isConst;
  10492. this.values = values;
  10493. this.lines = lines;
  10494. this.columns = columns;
  10495. }
  10496. get() {
  10497. return this.values;
  10498. }
  10499. /**
  10500. * @deprecated
  10501. * Potential not necessary since array access is occuring directly in the StoreObject
  10502. * @param line
  10503. * @param column
  10504. */
  10505. getAt(line, column) {
  10506. console.log("Column ", column);
  10507. if (this.isVector()) {
  10508. if (column != null) {
  10509. throw new Error(this.id + " is not a matrix!");
  10510. }
  10511. column = line;
  10512. line = 0;
  10513. }
  10514. else if (column == null) {
  10515. const values = [];
  10516. for (let col = 0; col < this.columns; col += 1) {
  10517. const index = line * this.lines + col;
  10518. values.push(this.values[index]);
  10519. }
  10520. const array_type = this.type;
  10521. const vector_type = new array_type_1.ArrayType(array_type.innerType, array_type.dimensions - 1);
  10522. return new ArrayStoreValue(vector_type, values, this.columns, 0, this.id, this.isConst);
  10523. }
  10524. const index = line * this.lines + column;
  10525. console.log("Get at: ", index);
  10526. return this.values[index];
  10527. }
  10528. setAt(value, line, column) {
  10529. let used_dims = 1;
  10530. if (column != null) {
  10531. used_dims += 1;
  10532. }
  10533. let actual_line = line;
  10534. let actual_column = column;
  10535. if (!this.type.canAccept(value.type, used_dims)) {
  10536. throw new Error("!!!Internal Error: Attempting to insert an invalid value inside array " + this.id);
  10537. }
  10538. if (this.isVector) {
  10539. if (column != null) {
  10540. throw new Error(this.id + " is not a matrix!");
  10541. }
  10542. actual_column = actual_line;
  10543. actual_line = 0;
  10544. }
  10545. else if (column == null) {
  10546. if (!(value instanceof ArrayStoreValue)) {
  10547. throw new Error("Attempting to insert a single value as a line of matrix " + this.id);
  10548. }
  10549. const actual_values = value.get();
  10550. for (let i = 0; i < this.columns; i += 1) {
  10551. const pos = actual_line * this.columns + i;
  10552. const val = actual_values[i];
  10553. this.values[pos] = new store_value_address_1.StoreValueAddress(value.type, val.get(), actual_line, i, this.id, this.isConst);
  10554. }
  10555. }
  10556. const columns = this.columns == null ? 0 : this.columns;
  10557. const pos = actual_line * columns + actual_column;
  10558. this.values[pos] = new store_value_address_1.StoreValueAddress(value.type, value.get(), line, column, this.id, this.isConst);
  10559. }
  10560. inStore() {
  10561. return this.id != null;
  10562. }
  10563. isVector() {
  10564. return this.type.dimensions == 1;
  10565. }
  10566. }
  10567. exports.ArrayStoreValue = ArrayStoreValue;
  10568. /***/ }),
  10569. /***/ "./js/processor/store/value/array_store_value_ref.ts":
  10570. /*!***********************************************************!*\
  10571. !*** ./js/processor/store/value/array_store_value_ref.ts ***!
  10572. \***********************************************************/
  10573. /*! no static exports found */
  10574. /***/ (function(module, exports, __webpack_require__) {
  10575. "use strict";
  10576. Object.defineProperty(exports, "__esModule", { value: true });
  10577. class ArrayStoreValueRef {
  10578. constructor(type, values, addresses, lines, columns, id) {
  10579. this.type = type;
  10580. this.values = values;
  10581. this.addresses = addresses;
  10582. this.lines = lines;
  10583. this.columns = columns;
  10584. this.id = id;
  10585. this.isConst = false;
  10586. }
  10587. get() {
  10588. return this.values;
  10589. }
  10590. getAddresses() {
  10591. return this.addresses;
  10592. }
  10593. inStore() {
  10594. return this.id != null;
  10595. }
  10596. }
  10597. exports.ArrayStoreValueRef = ArrayStoreValueRef;
  10598. /***/ }),
  10599. /***/ "./js/processor/store/value/store_value.ts":
  10600. /*!*************************************************!*\
  10601. !*** ./js/processor/store/value/store_value.ts ***!
  10602. \*************************************************/
  10603. /*! no static exports found */
  10604. /***/ (function(module, exports, __webpack_require__) {
  10605. "use strict";
  10606. Object.defineProperty(exports, "__esModule", { value: true });
  10607. class StoreValue {
  10608. constructor(type, value, id, isConst = false) {
  10609. this.type = type;
  10610. this.id = id;
  10611. this.isConst = isConst;
  10612. this.value = value;
  10613. }
  10614. get() {
  10615. return this.value;
  10616. }
  10617. inStore() {
  10618. return this.id != null;
  10619. }
  10620. }
  10621. exports.StoreValue = StoreValue;
  10622. /***/ }),
  10623. /***/ "./js/processor/store/value/store_value_address.ts":
  10624. /*!*********************************************************!*\
  10625. !*** ./js/processor/store/value/store_value_address.ts ***!
  10626. \*********************************************************/
  10627. /*! no static exports found */
  10628. /***/ (function(module, exports, __webpack_require__) {
  10629. "use strict";
  10630. Object.defineProperty(exports, "__esModule", { value: true });
  10631. const store_value_1 = __webpack_require__(/*! ./store_value */ "./js/processor/store/value/store_value.ts");
  10632. class StoreValueAddress extends store_value_1.StoreValue {
  10633. constructor(type, value, line, column, id, isConst = false) {
  10634. super(type, value, id, isConst);
  10635. this.line = line;
  10636. this.column = column;
  10637. }
  10638. }
  10639. exports.StoreValueAddress = StoreValueAddress;
  10640. /***/ }),
  10641. /***/ "./js/processor/store/value/store_value_ref.ts":
  10642. /*!*****************************************************!*\
  10643. !*** ./js/processor/store/value/store_value_ref.ts ***!
  10644. \*****************************************************/
  10645. /*! no static exports found */
  10646. /***/ (function(module, exports, __webpack_require__) {
  10647. "use strict";
  10648. Object.defineProperty(exports, "__esModule", { value: true });
  10649. class StoreValueRef {
  10650. constructor(type, value, loc_address, id) {
  10651. this.type = type;
  10652. this.value = value;
  10653. this.loc_address = loc_address;
  10654. this.id = id;
  10655. this.isConst = false;
  10656. this.reference_dimesion = 0;
  10657. }
  10658. get() {
  10659. return this.value;
  10660. }
  10661. getRefAddress() {
  10662. return this.loc_address;
  10663. }
  10664. inStore() {
  10665. return this.id != null;
  10666. }
  10667. getReferenceDimension() {
  10668. return this.reference_dimesion;
  10669. }
  10670. setReferenceDimension(dimension) {
  10671. this.reference_dimesion = dimension;
  10672. }
  10673. }
  10674. exports.StoreValueRef = StoreValueRef;
  10675. /***/ }),
  10676. /***/ "./js/runner.js":
  10677. /*!**********************!*\
  10678. !*** ./js/runner.js ***!
  10679. \**********************/
  10680. /*! exports provided: runner */
  10681. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10682. "use strict";
  10683. __webpack_require__.r(__webpack_exports__);
  10684. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runner", function() { return runner; });
  10685. /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ast/ivprogParser */ "./js/ast/ivprogParser.js");
  10686. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  10687. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./io/domConsole */ "./js/io/domConsole.js");
  10688. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/languageService */ "./js/services/languageService.js");
  10689. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  10690. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./memory/location */ "./js/memory/location.ts");
  10691. /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_memory_location__WEBPACK_IMPORTED_MODULE_5__);
  10692. function runner() {
  10693. var ivprogLexer = _services_languageService__WEBPACK_IMPORTED_MODULE_3__["LanguageService"].getCurrentLexer(); // const lexer = new ivprogLexer(new InputStream(input));
  10694. // const stream = new CommonTokenStream(lexer);
  10695. // stream.fill();
  10696. // let i = 1;
  10697. // let token = null;
  10698. // while ((token = stream.LT(i)).type !== ivprogLexer.EOF && token.type !== ivprogLexer.WHITESPACE) {
  10699. // console.log(`${token.type}-${token.text}`);
  10700. // console.log('\n')
  10701. // i++;
  10702. // }
  10703. // const anaSin = new IVProgParser(input, ivprogLexer);
  10704. var editor = new window.JsonEditor('#json-renderer', {});
  10705. var domConsole = new _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"]("#console", true);
  10706. domConsole.hide(); // proc.interpretAST().then( sto => {
  10707. // console.log(sto.applyStore('a'));
  10708. // }).catch(e => console.log(e));
  10709. try {
  10710. window.$('#btn').click(function () {
  10711. var input = window.$('#input').val();
  10712. var analiser = new _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_0__["IVProgParser"](input, ivprogLexer);
  10713. try {
  10714. var data = analiser.parseTree();
  10715. var semAna = new _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_4__["SemanticAnalyser"](data);
  10716. var proc = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__["IVProgProcessor"](semAna.analyseTree());
  10717. proc.registerInput(domConsole);
  10718. domConsole.clear();
  10719. proc.registerOutput(domConsole);
  10720. proc.interpretAST().then(function (sto) {
  10721. console.log(sto);
  10722. editor.load(sto.store);
  10723. console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
  10724. })["catch"](function (e) {
  10725. alert(e);
  10726. console.log(e);
  10727. console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
  10728. });
  10729. } catch (error) {
  10730. alert(error);
  10731. console.log(error);
  10732. console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
  10733. }
  10734. });
  10735. } catch (a) {
  10736. console.log(a);
  10737. }
  10738. }
  10739. /***/ }),
  10740. /***/ "./js/services/i18nHelper.js":
  10741. /*!***********************************!*\
  10742. !*** ./js/services/i18nHelper.js ***!
  10743. \***********************************/
  10744. /*! exports provided: i18nHelper */
  10745. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10746. "use strict";
  10747. __webpack_require__.r(__webpack_exports__);
  10748. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i18nHelper", function() { return i18nHelper; });
  10749. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  10750. /* harmony import */ var _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./localizedStringsService */ "./js/services/localizedStringsService.js");
  10751. var StringTypes = line_i18n__WEBPACK_IMPORTED_MODULE_0__["default"].StringTypes;
  10752. var i18nHelper = Object.freeze({
  10753. i18n: function i18n(identifier) {
  10754. var opts = identifier.split(':');
  10755. var type = opts[0].toLowerCase();
  10756. var id = opts[1];
  10757. if (StringTypes.ERROR === type) {
  10758. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getError(id);
  10759. } else if (StringTypes.MESSAGE === type) {
  10760. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getMessage(id);
  10761. } else if (StringTypes.UI === type) {
  10762. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI(id);
  10763. } else {
  10764. console.warn("A string has been passed to the i18n helper function that was not in the form type:id -> " + identifier);
  10765. return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getString(identifier, type);
  10766. }
  10767. }
  10768. });
  10769. /***/ }),
  10770. /***/ "./js/services/languageService.js":
  10771. /*!****************************************!*\
  10772. !*** ./js/services/languageService.js ***!
  10773. \****************************************/
  10774. /*! exports provided: LanguageService */
  10775. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10776. "use strict";
  10777. __webpack_require__.r(__webpack_exports__);
  10778. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LanguageService", function() { return LanguageService; });
  10779. /* harmony import */ var _grammar___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../grammar/ */ "./grammar/index.js");
  10780. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  10781. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../util/config */ "./js/util/config.js");
  10782. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  10783. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10784. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  10785. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  10786. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  10787. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  10788. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  10789. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  10790. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  10791. var LanguageServiceExtended =
  10792. /*#__PURE__*/
  10793. function (_line_i18n$LanguageSe) {
  10794. _inherits(LanguageServiceExtended, _line_i18n$LanguageSe);
  10795. function LanguageServiceExtended() {
  10796. _classCallCheck(this, LanguageServiceExtended);
  10797. return _possibleConstructorReturn(this, _getPrototypeOf(LanguageServiceExtended).call(this, typeof iLMparameters === 'undefined' ? _util_config__WEBPACK_IMPORTED_MODULE_2__["Config"].default_lang : iLMparameters.lang));
  10798. }
  10799. _createClass(LanguageServiceExtended, [{
  10800. key: "getDefaultLang",
  10801. value: function getDefaultLang() {
  10802. return "pt";
  10803. }
  10804. }, {
  10805. key: "getCurrentLexer",
  10806. value: function getCurrentLexer() {
  10807. var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_0__["default"][this.getLang()];
  10808. if (langInfo === null || langInfo === undefined) {
  10809. return _grammar___WEBPACK_IMPORTED_MODULE_0__["default"][this.getDefaultLang()].lexer;
  10810. } else {
  10811. return langInfo.lexer;
  10812. }
  10813. }
  10814. }, {
  10815. key: "getCurrentLangFuncs",
  10816. value: function getCurrentLangFuncs() {
  10817. var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_0__["default"][this.getLang()];
  10818. if (langInfo === null || langInfo === undefined) {
  10819. return _grammar___WEBPACK_IMPORTED_MODULE_0__["default"][this.getDefaultLang()].langFuncs;
  10820. } else {
  10821. return langInfo.langFuncs;
  10822. }
  10823. }
  10824. }, {
  10825. key: "getCurrentLangLibs",
  10826. value: function getCurrentLangLibs() {
  10827. var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_0__["default"][this.getLang()];
  10828. if (langInfo === null || langInfo === undefined) {
  10829. return _grammar___WEBPACK_IMPORTED_MODULE_0__["default"][this.getDefaultLang()].langLibs;
  10830. }
  10831. return langInfo.langLibs;
  10832. }
  10833. }]);
  10834. return LanguageServiceExtended;
  10835. }(line_i18n__WEBPACK_IMPORTED_MODULE_1__["default"].LanguageServiceNoLS);
  10836. var LanguageService = new LanguageServiceExtended();
  10837. /***/ }),
  10838. /***/ "./js/services/localizedStringsService.js":
  10839. /*!************************************************!*\
  10840. !*** ./js/services/localizedStringsService.js ***!
  10841. \************************************************/
  10842. /*! exports provided: LocalizedStrings, getInstance */
  10843. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10844. "use strict";
  10845. __webpack_require__.r(__webpack_exports__);
  10846. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocalizedStrings", function() { return LocalizedStrings; });
  10847. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getInstance", function() { return getInstance; });
  10848. /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
  10849. /* harmony import */ var _languageService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./languageService */ "./js/services/languageService.js");
  10850. /* harmony import */ var _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../processor/definedFunctions */ "./js/processor/definedFunctions.js");
  10851. /* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../i18n */ "./i18n/index.ts");
  10852. /* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_i18n__WEBPACK_IMPORTED_MODULE_3__);
  10853. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.js");
  10854. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  10855. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10856. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  10857. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  10858. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  10859. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  10860. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  10861. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  10862. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  10863. var IVProgLocalizedStrings =
  10864. /*#__PURE__*/
  10865. function (_line_i18n$LocalizedS) {
  10866. _inherits(IVProgLocalizedStrings, _line_i18n$LocalizedS);
  10867. function IVProgLocalizedStrings(langService, langsJsons) {
  10868. var shouldListenToChange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  10869. _classCallCheck(this, IVProgLocalizedStrings);
  10870. return _possibleConstructorReturn(this, _getPrototypeOf(IVProgLocalizedStrings).call(this, langService, langsJsons, shouldListenToChange));
  10871. }
  10872. _createClass(IVProgLocalizedStrings, [{
  10873. key: "translateType",
  10874. value: function translateType(type, dim) {
  10875. var type_string = this.getUI("type_".concat(type));
  10876. switch (dim) {
  10877. case 0:
  10878. return type_string;
  10879. default:
  10880. if (dim > 1) return this.getUI("matrix_info_string", [type_string]);else return this.getUI("vector_info_string", [type_string]);
  10881. }
  10882. }
  10883. }, {
  10884. key: "translateOp",
  10885. value: function translateOp(op) {
  10886. switch (op.ord) {
  10887. case _ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].AND.ord:
  10888. case _ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].OR.ord:
  10889. case _ast_operators__WEBPACK_IMPORTED_MODULE_4__["Operators"].NOT.ord:
  10890. return this.getUI("logic_operator_".concat(op.value));
  10891. default:
  10892. return op.value;
  10893. }
  10894. }
  10895. }, {
  10896. key: "translateInternalFunction",
  10897. value: function translateInternalFunction(name) {
  10898. var category = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  10899. if (category == null) {
  10900. return _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_2__["LanguageDefinedFunction"].getLocalName(name);
  10901. } else {
  10902. return _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_2__["LanguageDefinedFunction"].getLocalName("".concat(category, ".").concat(name));
  10903. }
  10904. }
  10905. }]);
  10906. return IVProgLocalizedStrings;
  10907. }(line_i18n__WEBPACK_IMPORTED_MODULE_0__["default"].LocalizedStrings);
  10908. var LocalizedStrings = Object.freeze(new IVProgLocalizedStrings(_languageService__WEBPACK_IMPORTED_MODULE_1__["LanguageService"], _i18n__WEBPACK_IMPORTED_MODULE_3___default.a, true));
  10909. var _instance = null;
  10910. function getInstance() {
  10911. if (_instance == null) {
  10912. _instance = new IVProgLocalizedStrings(_languageService__WEBPACK_IMPORTED_MODULE_1__["LanguageService"], _i18n__WEBPACK_IMPORTED_MODULE_3___default.a);
  10913. }
  10914. return _instance;
  10915. }
  10916. /***/ }),
  10917. /***/ "./js/services/userLog.js":
  10918. /*!********************************!*\
  10919. !*** ./js/services/userLog.js ***!
  10920. \********************************/
  10921. /*! exports provided: ActionTypes, registerClick, registerUserEvent, registerSystemEvent, getLogs, setRebuildMode, getLogsAsString, parseLogs */
  10922. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10923. "use strict";
  10924. __webpack_require__.r(__webpack_exports__);
  10925. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActionTypes", function() { return ActionTypes; });
  10926. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerClick", function() { return registerClick; });
  10927. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerUserEvent", function() { return registerUserEvent; });
  10928. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerSystemEvent", function() { return registerSystemEvent; });
  10929. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLogs", function() { return getLogs; });
  10930. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setRebuildMode", function() { return setRebuildMode; });
  10931. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLogsAsString", function() { return getLogsAsString; });
  10932. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseLogs", function() { return parseLogs; });
  10933. var clicks = [];
  10934. var inRebuildMode = false;
  10935. var ActionTypes = Object.freeze({
  10936. // registerUserEvent payload:
  10937. // (function_name, insert action)
  10938. INSERT_FUNCTION: "INSERT_FUNCTION",
  10939. // (function_name, remove action)
  10940. REMOVE_FUNCTION: "REMOVE_FUNCTION",
  10941. // (var_name,insert action, type, dim)
  10942. INSERT_GLOBAL_VAR: "INSERT_GLOBAL_VAR",
  10943. // (var name, remove action)
  10944. REMOVE_GLOBAL_VAR: "REMOVE_GLOBAL_VAR",
  10945. // (old function name, rename action, new function name)
  10946. RENAME_FUNCTION: "RENAME_FUNCTION",
  10947. // (old var name, rename action. new var name)
  10948. RENAME_GLOBAL_VAR: "RENAME_GLOBAL_VAR",
  10949. // (var name, set const action)
  10950. SET_GLOBAL_CONST: "SET_GLOBAL_CONST",
  10951. // (function name, change return action, type, dim)
  10952. CHANGE_FUNCTION_RETURN: "CHANGE_FUNCTION_RETURN",
  10953. // (var name, change type action, type, dim, rows?, columns?)
  10954. CHANGE_GLOBAL_TYPE: "CHANGE_GLOBAL_TYPE",
  10955. // (var name, change value action, value)
  10956. CHANGE_GLOBAL_VALUE: "CHANGE_GLOBAL_VALUE",
  10957. // (function name, insert param action, param varname, type, dim)
  10958. INSERT_FUNCTION_PARAM: "INSERT_FUNCTION_PARAM",
  10959. // (function name, remove param action, param varname)
  10960. REMOVE_FUNCTION_PARAM: "REMOVE_FUNCTION_PARAM",
  10961. // (function name, change param type action, type, dim)
  10962. CHANGE_PARAM_TYPE: "CHANGE_PARAM_TYPE",
  10963. // (function name, rename param action, old param name, new param name)
  10964. RENAME_FUNCTION_PARAM: "RENAME_FUNCTION_PARAM",
  10965. // (function name, insert var action, var name, type, dim)
  10966. INSERT_FUNCTION_VAR: "INSERT_FUCNTION_VAR",
  10967. // (function name, remove var action, var name)
  10968. REMOVE_FUNCTION_VAR: "REMOVE_FUNCTION_VAR",
  10969. // (function name, rename var action, old var name, new var name)
  10970. RENAME_FUNCTION_VAR: "RENAME_FUNCTION_VAR",
  10971. // (function name, change var type action, var name, type, dim, rows?, columns?)
  10972. CHANGE_VAR_TYPE: "CHANGE_VAR_TYPE",
  10973. // (function name, change var value action, var name, value)
  10974. CHANGE_VAR_VALUE: "CHANGE_VAR_VALUE",
  10975. // (function name, insert command action, command, path)
  10976. INSERT_COMMAND: "INSERT_COMMAND",
  10977. // (function name, remove command action, path)
  10978. REMOVE_COMMAND: "REMOVE_COMMAND",
  10979. // (function name, change command exp action, path, exp)
  10980. CHANGE_COMMAND_EXP: "CHANGE_COMMAND_EXP",
  10981. // (function name, change attrib exp action, path, exp)
  10982. CHANGE_ATTRIB_EXP: "CHANGE_ATTRIB_EXP",
  10983. // (function name, change attrib var action, path, var name, row_exp?, column_exp?)
  10984. CHANGE_ATTRIB_VAR: "CHANGE_ATTRIB_VAR",
  10985. // (function name, move command action, old path, new path)
  10986. MOVE_COMMAND: "MOVE_COMMAND",
  10987. // (function name, enter change name action, var name)
  10988. ENTER_CHANGE_VAR_NAME: 'ENTER_CHANGE_VAR_NAME',
  10989. // (function name, enter change value action, var name)
  10990. ENTER_CHANGE_VAR_VALUE: 'ENTER_CHANGE_VAR_VALUE',
  10991. // (var name, enter change name action)
  10992. ENTER_CHANGE_GLOBAL_NAME: 'ENTER_CHANGE_GLOBAL_NAME',
  10993. // (var name, enter change value action)
  10994. ENTER_CHANGE_GLOBAL_VALUE: 'ENTER_CHANGE_GLOBAL_VALUE',
  10995. // (function name, enter change name action, param name)
  10996. ENTER_CHANGE_PARAM_NAME: 'ENTER_CHANGE_PARAM_NAME'
  10997. });
  10998. function registerClick(x, y, details) {
  10999. if (inRebuildMode) {
  11000. return;
  11001. }
  11002. clicks.push([x, y, Date.now(), details]);
  11003. }
  11004. function registerUserEvent(command, action) {
  11005. for (var _len = arguments.length, params = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  11006. params[_key - 2] = arguments[_key];
  11007. }
  11008. registerEvent('user_event', command, action, params);
  11009. }
  11010. function registerSystemEvent(command, action) {
  11011. for (var _len2 = arguments.length, params = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
  11012. params[_key2 - 2] = arguments[_key2];
  11013. }
  11014. registerEvent('system_event', command, action, params);
  11015. }
  11016. function registerEvent(tag, command, action, params) {
  11017. if (inRebuildMode) {
  11018. return;
  11019. }
  11020. var event = {
  11021. context: command,
  11022. action: action,
  11023. params: params
  11024. };
  11025. clicks.push([tag, Date.now(), event]);
  11026. }
  11027. function getLogs() {
  11028. return clicks;
  11029. }
  11030. function setRebuildMode(flag) {
  11031. inRebuildMode = flag;
  11032. }
  11033. function getLogsAsString() {
  11034. return JSON.stringify(clicks);
  11035. }
  11036. function parseLogs(logData) {
  11037. clicks = JSON.parse(logData);
  11038. }
  11039. /***/ }),
  11040. /***/ "./js/typeSystem/array_type.ts":
  11041. /*!*************************************!*\
  11042. !*** ./js/typeSystem/array_type.ts ***!
  11043. \*************************************/
  11044. /*! no static exports found */
  11045. /***/ (function(module, exports, __webpack_require__) {
  11046. "use strict";
  11047. Object.defineProperty(exports, "__esModule", { value: true });
  11048. class ArrayType {
  11049. constructor(type, dimensions) {
  11050. this.dimensions = dimensions;
  11051. this.innerType = type;
  11052. }
  11053. get isVector() {
  11054. return this.dimensions == 1;
  11055. }
  11056. isCompatible(another) {
  11057. if (another instanceof ArrayType) {
  11058. if (this.dimensions !== another.dimensions) {
  11059. return false;
  11060. }
  11061. return this.innerType.isCompatible(another.innerType);
  11062. }
  11063. return false;
  11064. }
  11065. stringInfo() {
  11066. const list = this.innerType.stringInfo();
  11067. list.forEach(v => {
  11068. v.dim = this.dimensions;
  11069. });
  11070. return list;
  11071. }
  11072. get value() {
  11073. return undefined;
  11074. }
  11075. get ord() {
  11076. return undefined;
  11077. }
  11078. canAccept(another, used_dims) {
  11079. const free_dims = this.dimensions - used_dims;
  11080. if (another instanceof ArrayType) {
  11081. return free_dims == another.dimensions && this.innerType.isCompatible(another.innerType);
  11082. }
  11083. else {
  11084. return free_dims == 0 && this.innerType.isCompatible(another);
  11085. }
  11086. }
  11087. }
  11088. exports.ArrayType = ArrayType;
  11089. /***/ }),
  11090. /***/ "./js/typeSystem/multiType.ts":
  11091. /*!************************************!*\
  11092. !*** ./js/typeSystem/multiType.ts ***!
  11093. \************************************/
  11094. /*! no static exports found */
  11095. /***/ (function(module, exports, __webpack_require__) {
  11096. "use strict";
  11097. Object.defineProperty(exports, "__esModule", { value: true });
  11098. class MultiType {
  11099. constructor(types) {
  11100. this.types = types;
  11101. }
  11102. get value() {
  11103. return undefined;
  11104. }
  11105. get ord() {
  11106. return undefined;
  11107. }
  11108. stringInfo() {
  11109. let list = [];
  11110. for (let i = 0; i < this.types.length; i++) {
  11111. const t = this.types[i];
  11112. list = list.concat(t.stringInfo());
  11113. }
  11114. return list;
  11115. }
  11116. isCompatible(another) {
  11117. for (let i = 0; i < this.types.length; i++) {
  11118. const t = this.types[i];
  11119. if (another.isCompatible(t)) {
  11120. return true;
  11121. }
  11122. }
  11123. return false;
  11124. }
  11125. }
  11126. exports.MultiType = MultiType;
  11127. /***/ }),
  11128. /***/ "./js/typeSystem/parsers.js":
  11129. /*!**********************************!*\
  11130. !*** ./js/typeSystem/parsers.js ***!
  11131. \**********************************/
  11132. /*! exports provided: toInt, toString, toReal, toBool, convertBoolToString, convertToString */
  11133. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11134. "use strict";
  11135. __webpack_require__.r(__webpack_exports__);
  11136. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toInt", function() { return toInt; });
  11137. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toString", function() { return toString; });
  11138. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toReal", function() { return toReal; });
  11139. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toBool", function() { return toBool; });
  11140. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertBoolToString", function() { return convertBoolToString; });
  11141. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToString", function() { return convertToString; });
  11142. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../services/languageService */ "./js/services/languageService.js");
  11143. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./types */ "./js/typeSystem/types.ts");
  11144. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_types__WEBPACK_IMPORTED_MODULE_1__);
  11145. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! decimal.js */ "./node_modules/decimal.js/decimal.js");
  11146. /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(decimal_js__WEBPACK_IMPORTED_MODULE_2__);
  11147. /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/config */ "./js/util/config.js");
  11148. function toInt(str) {
  11149. return new decimal_js__WEBPACK_IMPORTED_MODULE_2___default.a(str);
  11150. }
  11151. function toString(str) {
  11152. var value = str.replace(/^"/, '');
  11153. value = value.replace(/"$/, '');
  11154. value = value.replace(/\\b/g, "\b");
  11155. value = value.replace(/\\t/g, "\t");
  11156. value = value.replace(/\\n/g, "\n");
  11157. value = value.replace(/\\r/g, "\r");
  11158. value = value.replace(/\\"/g, "\"");
  11159. value = value.replace(/\\'/g, '\'');
  11160. value = value.replace(/\\\\/g, "\\");
  11161. return value;
  11162. }
  11163. function toReal(value) {
  11164. return new decimal_js__WEBPACK_IMPORTED_MODULE_2___default.a(value);
  11165. }
  11166. function toBool(str) {
  11167. var val = "'" + str + "'";
  11168. var lexer = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLexer();
  11169. var instance = new lexer(null);
  11170. if (instance.literalNames[lexer.RK_TRUE] === val) {
  11171. return true;
  11172. } else if (instance.literalNames[lexer.RK_FALSE] === val) {
  11173. return false;
  11174. } else {
  11175. // TODO: better error message
  11176. throw new Error(str + "not a valid boolean");
  11177. }
  11178. }
  11179. function convertBoolToString(bool) {
  11180. var lexer = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLexer();
  11181. var instance = new lexer(null);
  11182. var result = null;
  11183. if (bool) {
  11184. result = instance.literalNames[lexer.RK_TRUE];
  11185. } else {
  11186. result = instance.literalNames[lexer.RK_FALSE];
  11187. }
  11188. return result.replace(/'/g, "");
  11189. }
  11190. function convertToString(value, type) {
  11191. switch (type.ord) {
  11192. case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER.ord:
  11193. return value.toString();
  11194. case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL.ord:
  11195. {
  11196. if (value.dp() <= 0) {
  11197. return value.toFixed(1);
  11198. } else {
  11199. return value.toFixed(_util_config__WEBPACK_IMPORTED_MODULE_3__["Config"].decimalPlaces);
  11200. }
  11201. }
  11202. case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].BOOLEAN.ord:
  11203. return convertBoolToString(value);
  11204. default:
  11205. return value;
  11206. }
  11207. }
  11208. /***/ }),
  11209. /***/ "./js/typeSystem/type.ts":
  11210. /*!*******************************!*\
  11211. !*** ./js/typeSystem/type.ts ***!
  11212. \*******************************/
  11213. /*! no static exports found */
  11214. /***/ (function(module, exports, __webpack_require__) {
  11215. "use strict";
  11216. Object.defineProperty(exports, "__esModule", { value: true });
  11217. class Type {
  11218. constructor(value, ord) {
  11219. this.value = value;
  11220. this.ord = ord;
  11221. }
  11222. stringInfo() {
  11223. return [{ type: this.value, dim: 0 }];
  11224. }
  11225. isCompatible(another) {
  11226. return this.value === another.value && this.ord === another.ord;
  11227. }
  11228. }
  11229. exports.Type = Type;
  11230. /***/ }),
  11231. /***/ "./js/typeSystem/types.ts":
  11232. /*!********************************!*\
  11233. !*** ./js/typeSystem/types.ts ***!
  11234. \********************************/
  11235. /*! no static exports found */
  11236. /***/ (function(module, exports, __webpack_require__) {
  11237. "use strict";
  11238. Object.defineProperty(exports, "__esModule", { value: true });
  11239. const type_1 = __webpack_require__(/*! ./type */ "./js/typeSystem/type.ts");
  11240. const multiType_1 = __webpack_require__(/*! ./multiType */ "./js/typeSystem/multiType.ts");
  11241. const maybe_1 = __webpack_require__(/*! ../util/maybe */ "./js/util/maybe.ts");
  11242. const INTEGER = new type_1.Type("integer", 0);
  11243. const REAL = new type_1.Type("real", 1);
  11244. const STRING = new type_1.Type("text", 2);
  11245. const BOOLEAN = new type_1.Type("boolean", 3);
  11246. const VOID = new type_1.Type("void", 4);
  11247. const UNDEFINED = new type_1.Type("undefined", 5);
  11248. const ALL = new multiType_1.MultiType([INTEGER, REAL, STRING, BOOLEAN]);
  11249. exports.Types = Object.freeze({
  11250. INTEGER: INTEGER,
  11251. REAL: REAL,
  11252. STRING: STRING,
  11253. BOOLEAN: BOOLEAN,
  11254. VOID: VOID,
  11255. UNDEFINED: UNDEFINED,
  11256. ALL: ALL
  11257. });
  11258. function fromOrdToType(ord) {
  11259. const typeMap = exports.Types;
  11260. for (let t in typeMap) {
  11261. if (typeMap[t].ord === ord) {
  11262. return maybe_1.Maybe.some(typeMap[t]);
  11263. }
  11264. }
  11265. return maybe_1.Maybe.none();
  11266. }
  11267. exports.fromOrdToType = fromOrdToType;
  11268. /***/ }),
  11269. /***/ "./js/util/auto_gen_output.js":
  11270. /*!************************************!*\
  11271. !*** ./js/util/auto_gen_output.js ***!
  11272. \************************************/
  11273. /*! exports provided: autoGenerateTestCaseOutput */
  11274. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11275. "use strict";
  11276. __webpack_require__.r(__webpack_exports__);
  11277. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoGenerateTestCaseOutput", function() { return autoGenerateTestCaseOutput; });
  11278. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  11279. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  11280. /* harmony import */ var _inputTest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./inputTest */ "./js/util/inputTest.js");
  11281. /* harmony import */ var _outputTest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./outputTest */ "./js/util/outputTest.js");
  11282. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  11283. function autoGenerateTestCaseOutput(program_text, testCases) {
  11284. var copyTestCases = testCases.map(function (test) {
  11285. return Object.assign({}, test);
  11286. });
  11287. try {
  11288. var program = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_0__["SemanticAnalyser"].analyseFromSource(program_text);
  11289. var resultList = testCases.map(function (test, id) {
  11290. var input = new _inputTest__WEBPACK_IMPORTED_MODULE_2__["InputTest"](test.input);
  11291. var output = new _outputTest__WEBPACK_IMPORTED_MODULE_3__["OutputTest"]();
  11292. var exec = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__["IVProgProcessor"](program);
  11293. exec.registerInput(input);
  11294. exec.registerOutput(output);
  11295. return exec.interpretAST().then(function (_) {
  11296. return {
  11297. id: id,
  11298. program: exec
  11299. };
  11300. });
  11301. });
  11302. return Promise.all(resultList).then(function (result_final) {
  11303. for (var i = 0; i < result_final.length; ++i) {
  11304. var result = result_final[i];
  11305. var output = result.program.output.list;
  11306. var input = result.program.input;
  11307. if (input.index != input.inputList.length) {
  11308. window.showAlert(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getMessage("testcase_autogen_unused_input", [result.id + 1]));
  11309. return Promise.resolve(false);
  11310. }
  11311. if (output.length == 0) {
  11312. window.showAlert(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getMessage("testcase_autogen_empty", [result.id + 1]));
  11313. }
  11314. copyTestCases[result.id].output = output;
  11315. }
  11316. window.outputGenerated(copyTestCases);
  11317. return Promise.resolve(true);
  11318. });
  11319. } catch (error) {
  11320. return Promise.reject(error);
  11321. }
  11322. }
  11323. /***/ }),
  11324. /***/ "./js/util/config.js":
  11325. /*!***************************!*\
  11326. !*** ./js/util/config.js ***!
  11327. \***************************/
  11328. /*! exports provided: Config */
  11329. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11330. "use strict";
  11331. __webpack_require__.r(__webpack_exports__);
  11332. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Config", function() { return Config; });
  11333. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11334. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  11335. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  11336. var ConfigObject =
  11337. /*#__PURE__*/
  11338. function () {
  11339. function ConfigObject() {
  11340. _classCallCheck(this, ConfigObject);
  11341. this.decimalPlaces = 8;
  11342. this.intConvertRoundMode = 2;
  11343. this.default_lang = 'pt';
  11344. this.enable_type_casting = true;
  11345. this.idle_input_interval = 5000;
  11346. this.suspend_threshold = 100; // this.max_instruction_count = 350250; - automated evaluation limit
  11347. this.max_instruction_count = Number.MAX_SAFE_INTEGER;
  11348. }
  11349. _createClass(ConfigObject, [{
  11350. key: "setConfig",
  11351. value: function setConfig(opts) {
  11352. for (var key in opts) {
  11353. if (Object.prototype.hasOwnProperty.call(this, key)) {
  11354. this[key] = opts[key];
  11355. }
  11356. }
  11357. }
  11358. }]);
  11359. return ConfigObject;
  11360. }();
  11361. var config = new ConfigObject();
  11362. var Config = config;
  11363. /***/ }),
  11364. /***/ "./js/util/editorMode2.js":
  11365. /*!********************************!*\
  11366. !*** ./js/util/editorMode2.js ***!
  11367. \********************************/
  11368. /*! exports provided: CodeEditorMode */
  11369. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11370. "use strict";
  11371. __webpack_require__.r(__webpack_exports__);
  11372. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeEditorMode", function() { return CodeEditorMode; });
  11373. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./js/util/utils.js");
  11374. /**
  11375. * Source: https://raw.githubusercontent.com/codemirror/CodeMirror/master/mode/clike/clike.js
  11376. * @author arijn Haverbeke and others
  11377. * @author Lucas de Souza
  11378. * @param {CodeMirror} CodeMirror
  11379. */
  11380. function CodeEditorMode(CodeMirror) {
  11381. "use strict";
  11382. function Context(indented, column, type, info, align, prev) {
  11383. this.indented = indented;
  11384. this.column = column;
  11385. this.type = type;
  11386. this.info = info;
  11387. this.align = align;
  11388. this.prev = prev;
  11389. }
  11390. function pushContext(state, col, type, info) {
  11391. var indent = state.indented;
  11392. if (state.context && state.context.type == "statement" && type != "statement") indent = state.context.indented;
  11393. return state.context = new Context(indent, col, type, info, null, state.context);
  11394. }
  11395. function popContext(state) {
  11396. var t = state.context.type;
  11397. if (t == ")" || t == "]" || t == "}") state.indented = state.context.indented;
  11398. return state.context = state.context.prev;
  11399. }
  11400. function typeBefore(stream, state, pos) {
  11401. if (state.prevToken == "variable" || state.prevToken == "type") return true;
  11402. if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, pos))) return true;
  11403. if (state.typeAtEndOfLine && stream.column() == stream.indentation()) return true;
  11404. }
  11405. function isTopScope(context) {
  11406. for (;;) {
  11407. if (!context || context.type == "top") return true;
  11408. if (context.type == "}" && context.prev.info != "namespace") return false;
  11409. context = context.prev;
  11410. }
  11411. }
  11412. function contains(words, word) {
  11413. if (typeof words === "function") {
  11414. return words(word);
  11415. } else {
  11416. return Object.propertyIsEnumerable.call(words, word);
  11417. }
  11418. }
  11419. function tokenComment(stream, state) {
  11420. var maybeEnd = false,
  11421. ch;
  11422. while (ch = stream.next()) {
  11423. if (ch == "/" && maybeEnd) {
  11424. state.tokenize = null;
  11425. break;
  11426. }
  11427. maybeEnd = ch == "*";
  11428. }
  11429. return "comment";
  11430. }
  11431. CodeMirror.defineMode("ivprog", function (config, parserConfig) {
  11432. var indentUnit = config.indentUnit,
  11433. statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
  11434. dontAlignCalls = parserConfig.dontAlignCalls,
  11435. keywords = parserConfig.keywords || {},
  11436. switchKeyword = parserConfig.switchKeyword,
  11437. caseKeyword = parserConfig.caseKeyword,
  11438. defaultKeyword = parserConfig.defaultKeyword,
  11439. caseRegex = new RegExp("^\\s*(?:".concat(caseKeyword, " .*?:|").concat(defaultKeyword, ":|\\{\\}?|\\})$")),
  11440. ////,
  11441. types = parserConfig.types || {},
  11442. builtin = parserConfig.builtin || {},
  11443. blockKeywords = parserConfig.blockKeywords || {},
  11444. defKeywords = parserConfig.defKeywords || {},
  11445. atoms = parserConfig.atoms || {},
  11446. hooks = parserConfig.hooks || {},
  11447. multiLineStrings = parserConfig.multiLineStrings,
  11448. indentStatements = false,
  11449. namespaceSeparator = null,
  11450. isPunctuationChar = /[[\]{}(),;:\n]/,
  11451. numberStart = /[\d.]/,
  11452. number = /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)$/i,
  11453. isOperatorChar = /[+\-*%=<>!/&]/,
  11454. isIdentifierChar = /[a-zA-Z0-9_]/,
  11455. // An optional function that takes a {string} token and returns true if it
  11456. // should be treated as a builtin.
  11457. isReservedIdentifier = parserConfig.isReservedIdentifier || false;
  11458. var curPunc, isDefKeyword;
  11459. var tokenString = function tokenString() {
  11460. /*SKIP*/
  11461. };
  11462. function tokenBase(stream, state) {
  11463. var ch = stream.next();
  11464. if (hooks[ch]) {
  11465. var result = hooks[ch](stream, state);
  11466. if (result !== false) return result;
  11467. }
  11468. if (ch == '"') {
  11469. state.tokenize = tokenString(ch);
  11470. return state.tokenize(stream, state);
  11471. }
  11472. if (isPunctuationChar.test(ch)) {
  11473. curPunc = ch;
  11474. return null;
  11475. }
  11476. if (numberStart.test(ch)) {
  11477. stream.backUp(1);
  11478. if (stream.match(number)) return "number";
  11479. stream.next();
  11480. }
  11481. if (ch == "/") {
  11482. if (stream.eat("*")) {
  11483. state.tokenize = tokenComment;
  11484. return tokenComment(stream, state);
  11485. }
  11486. if (stream.eat("/")) {
  11487. stream.skipToEnd();
  11488. return "comment";
  11489. }
  11490. }
  11491. if (isOperatorChar.test(ch)) {
  11492. while (!stream.match(/^\/[/*]/, false) && stream.eat(isOperatorChar)) {
  11493. /* SKIP */
  11494. }
  11495. return "operator";
  11496. }
  11497. stream.eatWhile(isIdentifierChar);
  11498. if (namespaceSeparator) while (stream.match(namespaceSeparator)) {
  11499. stream.eatWhile(isIdentifierChar);
  11500. }
  11501. var cur = stream.current();
  11502. if (contains(keywords, cur)) {
  11503. if (contains(blockKeywords, cur)) curPunc = "newstatement";
  11504. if (contains(defKeywords, cur)) isDefKeyword = true;
  11505. return "keyword";
  11506. }
  11507. if (contains(types, cur)) return "type";
  11508. if (contains(builtin, cur) || isReservedIdentifier && isReservedIdentifier(cur)) {
  11509. if (contains(blockKeywords, cur)) curPunc = "newstatement";
  11510. return "builtin";
  11511. }
  11512. if (contains(atoms, cur)) return "atom";
  11513. return "variable";
  11514. }
  11515. tokenString = function tokenString(quote) {
  11516. return function (stream, state) {
  11517. var escaped = false,
  11518. next,
  11519. end = false;
  11520. while ((next = stream.next()) != null) {
  11521. if (next == quote && !escaped) {
  11522. end = true;
  11523. break;
  11524. }
  11525. escaped = !escaped && next == "\\";
  11526. }
  11527. if (end || !(escaped || multiLineStrings)) state.tokenize = null;
  11528. return "string";
  11529. };
  11530. };
  11531. function maybeEOL(stream, state) {
  11532. if (parserConfig.typeFirstDefinitions && stream.eol() && isTopScope(state.context)) state.typeAtEndOfLine = typeBefore(stream, state, stream.pos);
  11533. } // Interface
  11534. return {
  11535. startState: function startState(basecolumn) {
  11536. return {
  11537. tokenize: null,
  11538. context: new Context((basecolumn || 0) - indentUnit, 0, "top", null, false),
  11539. indented: 0,
  11540. startOfLine: true,
  11541. prevToken: null
  11542. };
  11543. },
  11544. token: function token(stream, state) {
  11545. var ctx = state.context;
  11546. if (stream.sol()) {
  11547. if (ctx.align == null) ctx.align = false;
  11548. state.indented = stream.indentation();
  11549. state.startOfLine = true;
  11550. }
  11551. if (stream.eatSpace()) {
  11552. maybeEOL(stream, state);
  11553. return null;
  11554. }
  11555. curPunc = isDefKeyword = null;
  11556. var style = (state.tokenize || tokenBase)(stream, state);
  11557. if (style == "comment" || style == "meta") return style;
  11558. if (ctx.align == null) ctx.align = true;
  11559. if (curPunc == ";" || curPunc == ":" || curPunc == "," && stream.match(/^\s*(?:\/\/.*)?$/, false)) while (state.context.type == "statement") {
  11560. popContext(state);
  11561. } else if (curPunc == "{") pushContext(state, stream.column(), "}");else if (curPunc == "[") pushContext(state, stream.column(), "]");else if (curPunc == "(") pushContext(state, stream.column(), ")");else if (curPunc == "}") {
  11562. while (ctx.type == "statement") {
  11563. ctx = popContext(state);
  11564. }
  11565. if (ctx.type == "}") ctx = popContext(state);
  11566. while (ctx.type == "statement") {
  11567. ctx = popContext(state);
  11568. }
  11569. } else if (curPunc == ctx.type) popContext(state);else if (indentStatements && ((ctx.type == "}" || ctx.type == "top") && curPunc != ";" || ctx.type == "statement" && curPunc == "newstatement")) {
  11570. pushContext(state, stream.column(), "statement", stream.current());
  11571. }
  11572. if (style == "variable" && (state.prevToken == "def" || parserConfig.typeFirstDefinitions && typeBefore(stream, state, stream.start) && isTopScope(state.context) && stream.match(/^\s*\(/, false))) style = "def";
  11573. if (hooks.token) {
  11574. var result = hooks.token(stream, state, style);
  11575. if (result !== undefined) style = result;
  11576. }
  11577. if (style == "def" && parserConfig.styleDefs === false) style = "variable";
  11578. state.startOfLine = false;
  11579. state.prevToken = isDefKeyword ? "def" : style || curPunc;
  11580. maybeEOL(stream, state);
  11581. return style;
  11582. },
  11583. indent: function indent(state, textAfter) {
  11584. if (state.tokenize != tokenBase && state.tokenize != null || state.typeAtEndOfLine) return CodeMirror.Pass;
  11585. var ctx = state.context;
  11586. var firstChar = textAfter && textAfter.charAt(0);
  11587. var closing = firstChar == ctx.type;
  11588. if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
  11589. if (parserConfig.dontIndentStatements) while (ctx.type == "statement" && parserConfig.dontIndentStatements.test(ctx.info)) {
  11590. ctx = ctx.prev;
  11591. }
  11592. if (hooks.indent) {
  11593. var hook = hooks.indent(state, ctx, textAfter, indentUnit);
  11594. if (typeof hook == "number") return hook;
  11595. }
  11596. var switchBlock = ctx.prev && ctx.prev.info == switchKeyword;
  11597. if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
  11598. while (ctx.type != "top" && ctx.type != "}") {
  11599. ctx = ctx.prev;
  11600. }
  11601. return ctx.indented;
  11602. }
  11603. if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
  11604. if (ctx.align && (!dontAlignCalls || ctx.type != ")")) return ctx.column + (closing ? 0 : 1);
  11605. if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit;
  11606. var caseTestRegex = new RegExp("^(?:".concat(caseKeyword, "|").concat(defaultKeyword, ")\b"));
  11607. return ctx.indented + (closing ? 0 : indentUnit) + (!closing && switchBlock && !caseTestRegex.test(textAfter) ? indentUnit : 0);
  11608. },
  11609. electricInput: caseRegex,
  11610. blockCommentStart: "/*",
  11611. blockCommentEnd: "*/",
  11612. blockCommentContinue: " * ",
  11613. lineComment: "//",
  11614. fold: "brace"
  11615. };
  11616. });
  11617. function words(str) {
  11618. var obj = {},
  11619. words = str.split(" ");
  11620. for (var i = 0; i < words.length; ++i) {
  11621. obj[words[i]] = true;
  11622. }
  11623. return obj;
  11624. }
  11625. var codeConfig = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getCodeEditorModeConfig"])();
  11626. var ivprogKeywords = codeConfig.keywords.join(" ");
  11627. var basicTypes = words(codeConfig.types.join(" "));
  11628. function ivprogTypes(identifier) {
  11629. return contains(basicTypes, identifier);
  11630. }
  11631. var ivprogBlockKeywords = codeConfig.blocks.join(" ");
  11632. var ivprogDefKeywords = "funcao const";
  11633. function def(mimes, mode) {
  11634. if (typeof mimes == "string") mimes = [mimes];
  11635. var words = [];
  11636. function add(obj) {
  11637. if (obj) {
  11638. for (var prop in obj) {
  11639. if (Object.hasOwnProperty.call(obj, prop)) {
  11640. words.push(prop);
  11641. }
  11642. }
  11643. }
  11644. }
  11645. add(mode.keywords);
  11646. add(mode.types);
  11647. add(mode.builtin);
  11648. add(mode.atoms);
  11649. if (words.length) {
  11650. mode.helperType = mimes[0];
  11651. CodeMirror.registerHelper("hintWords", mimes[0], words);
  11652. }
  11653. for (var i = 0; i < mimes.length; ++i) {
  11654. CodeMirror.defineMIME(mimes[i], mode);
  11655. }
  11656. }
  11657. def(["text/x-ivprog"], {
  11658. name: "ivprog",
  11659. keywords: words(ivprogKeywords),
  11660. types: ivprogTypes,
  11661. blockKeywords: words(ivprogBlockKeywords),
  11662. defKeywords: words(ivprogDefKeywords),
  11663. typeFirstDefinitions: true,
  11664. atoms: words(codeConfig.atoms.join(" ")),
  11665. switchKeyword: codeConfig.switchString,
  11666. caseKeyword: codeConfig.case_default[0],
  11667. defaultKeyword: codeConfig.case_default[1],
  11668. modeProps: {
  11669. fold: ["brace"]
  11670. }
  11671. });
  11672. }
  11673. /***/ }),
  11674. /***/ "./js/util/iassignHelpers.js":
  11675. /*!***********************************!*\
  11676. !*** ./js/util/iassignHelpers.js ***!
  11677. \***********************************/
  11678. /*! exports provided: prepareActivityToStudentHelper, autoEval */
  11679. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11680. "use strict";
  11681. __webpack_require__.r(__webpack_exports__);
  11682. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prepareActivityToStudentHelper", function() { return prepareActivityToStudentHelper; });
  11683. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoEval", function() { return autoEval; });
  11684. /* harmony import */ var _visualUI_functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../visualUI/functions */ "./js/visualUI/functions.js");
  11685. /* harmony import */ var _visualUI_code_generator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../visualUI/code_generator */ "./js/visualUI/code_generator.js");
  11686. /* harmony import */ var _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../assessment/ivprogAssessment */ "./js/assessment/ivprogAssessment.js");
  11687. /* harmony import */ var _testConsole__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./testConsole */ "./js/util/testConsole.js");
  11688. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  11689. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  11690. /* harmony import */ var _maybe__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./maybe */ "./js/util/maybe.ts");
  11691. /* harmony import */ var _maybe__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_maybe__WEBPACK_IMPORTED_MODULE_6__);
  11692. function parseActivityData(data) {
  11693. var algorithm_in_ilm = null;
  11694. if (data.split('\n::algorithm::')[1]) {
  11695. algorithm_in_ilm = data.split('\n::algorithm::')[1].split('\n::logs::')[0];
  11696. var logs = data.split('\n::algorithm::')[1].split('\n::logs::')[1];
  11697. if (logs != null) {
  11698. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["parseLogs"])(logs);
  11699. }
  11700. }
  11701. var content;
  11702. try {
  11703. content = JSON.parse(data.split('\n::algorithm::')[0]);
  11704. content['algorithm_in_ilm'] = algorithm_in_ilm;
  11705. } catch (e) {
  11706. console.error(e);
  11707. return _maybe__WEBPACK_IMPORTED_MODULE_6__["Maybe"].none();
  11708. }
  11709. return _maybe__WEBPACK_IMPORTED_MODULE_6__["Maybe"].some(content);
  11710. }
  11711. function prepareActivityToStudentHelper(ilm_cont) {
  11712. var maybe_content = parseActivityData(ilm_cont);
  11713. return maybe_content.map(function (content) {
  11714. var testCases = content.testcases;
  11715. Object(_visualUI_functions__WEBPACK_IMPORTED_MODULE_0__["setTestCases"])(testCases);
  11716. var prog_type = null;
  11717. if (content.settings_programming_type) {
  11718. prog_type = content.settings_programming_type[0].value;
  11719. } else {
  11720. prog_type = "visual";
  11721. }
  11722. return {
  11723. settingsProgrammingType: prog_type,
  11724. settingsDataTypes: content.settings_data_types,
  11725. settingsCommands: content.settings_commands,
  11726. settingsFunctions: content.settings_functions,
  11727. algorithmInIlm: content.algorithm_in_ilm,
  11728. settingsFilter: content.settings_filter
  11729. };
  11730. });
  11731. }
  11732. function compareArray(a, b) {
  11733. for (var i = 0; i < a.length; ++i) {
  11734. var elementA = a[i];
  11735. var elementB = b[i];
  11736. if (elementA != elementB) {
  11737. return false;
  11738. }
  11739. }
  11740. return true;
  11741. }
  11742. function compareTestcases(original, student) {
  11743. if (original.length != student.length) {
  11744. return false;
  11745. }
  11746. for (var i = 0; i < original.length; ++i) {
  11747. var elementO = original[i];
  11748. var elementS = student[i];
  11749. if (!compareArray(elementO.input, elementS.input)) {
  11750. return false;
  11751. }
  11752. if (!compareArray(elementO.output, elementS.output)) {
  11753. return false;
  11754. }
  11755. }
  11756. return true;
  11757. }
  11758. function autoEval(originalData, callback) {
  11759. var code = Object(_visualUI_code_generator__WEBPACK_IMPORTED_MODULE_1__["generate"])();
  11760. var original = parseActivityData(originalData).getOrElse(undefined);
  11761. if (original == null) {
  11762. alert("iAssign did not provide the original activity data!");
  11763. return callback(null);
  11764. }
  11765. if (code == null) {
  11766. return callback(-1); // @FeedbackConvention Casos de teste vazios
  11767. } else {
  11768. if (!compareTestcases(original.testcases, Object(_visualUI_functions__WEBPACK_IMPORTED_MODULE_0__["getTestCases"])())) {
  11769. return callback(-2); // @FeedbackConvention Casos de teste alterados pelo aluno
  11770. }
  11771. var ast_code = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_5__["SemanticAnalyser"].analyseFromSource(code);
  11772. 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"]([]));
  11773. autoAssessment.runTest().then(function (grade) {
  11774. return callback(grade);
  11775. })["catch"](function (err) {
  11776. console.log(err);
  11777. callback(0);
  11778. });
  11779. }
  11780. }
  11781. /***/ }),
  11782. /***/ "./js/util/inputTest.js":
  11783. /*!******************************!*\
  11784. !*** ./js/util/inputTest.js ***!
  11785. \******************************/
  11786. /*! exports provided: InputTest */
  11787. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11788. "use strict";
  11789. __webpack_require__.r(__webpack_exports__);
  11790. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputTest", function() { return InputTest; });
  11791. /* harmony import */ var _io_input__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../io/input */ "./js/io/input.js");
  11792. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  11793. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  11794. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11795. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  11796. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  11797. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  11798. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  11799. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  11800. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  11801. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  11802. var InputTest =
  11803. /*#__PURE__*/
  11804. function (_Input) {
  11805. _inherits(InputTest, _Input);
  11806. function InputTest(inputList) {
  11807. var _this;
  11808. _classCallCheck(this, InputTest);
  11809. _this = _possibleConstructorReturn(this, _getPrototypeOf(InputTest).call(this));
  11810. _this.index = 0;
  11811. _this.inputList = inputList;
  11812. return _this;
  11813. }
  11814. _createClass(InputTest, [{
  11815. key: "requestInput",
  11816. value: function requestInput(callback) {
  11817. if (this.index < this.inputList.length) {
  11818. callback(this.inputList[this.index]);
  11819. this.index++;
  11820. } else {
  11821. throw new Error(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getError("exceeded_input_request"));
  11822. }
  11823. }
  11824. }]);
  11825. return InputTest;
  11826. }(_io_input__WEBPACK_IMPORTED_MODULE_0__["Input"]);
  11827. /***/ }),
  11828. /***/ "./js/util/input_assessment.js":
  11829. /*!*************************************!*\
  11830. !*** ./js/util/input_assessment.js ***!
  11831. \*************************************/
  11832. /*! exports provided: InputAssessment */
  11833. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11834. "use strict";
  11835. __webpack_require__.r(__webpack_exports__);
  11836. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputAssessment", function() { return InputAssessment; });
  11837. /* harmony import */ var _io_input__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../io/input */ "./js/io/input.js");
  11838. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  11839. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  11840. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11841. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  11842. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  11843. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  11844. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  11845. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  11846. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  11847. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  11848. var InputAssessment =
  11849. /*#__PURE__*/
  11850. function (_Input) {
  11851. _inherits(InputAssessment, _Input);
  11852. function InputAssessment(input_list) {
  11853. var _this;
  11854. _classCallCheck(this, InputAssessment);
  11855. _this = _possibleConstructorReturn(this, _getPrototypeOf(InputAssessment).call(this));
  11856. _this.index = 0;
  11857. _this.input_list = input_list.map(function (val) {
  11858. return {
  11859. "value": val,
  11860. "read": false
  11861. };
  11862. });
  11863. return _this;
  11864. }
  11865. _createClass(InputAssessment, [{
  11866. key: "requestInput",
  11867. value: function requestInput(callback) {
  11868. if (this.index < this.input_list.length) {
  11869. var input = this.input_list[this.index];
  11870. input.read = true;
  11871. this.index += 1;
  11872. callback(input.value);
  11873. } else {
  11874. throw new Error(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getError("exceeded_input_request"));
  11875. }
  11876. }
  11877. }, {
  11878. key: "isInputAvailable",
  11879. value: function isInputAvailable() {
  11880. return this.index < this.input_list.length;
  11881. }
  11882. }]);
  11883. return InputAssessment;
  11884. }(_io_input__WEBPACK_IMPORTED_MODULE_0__["Input"]);
  11885. /***/ }),
  11886. /***/ "./js/util/maybe.ts":
  11887. /*!**************************!*\
  11888. !*** ./js/util/maybe.ts ***!
  11889. \**************************/
  11890. /*! no static exports found */
  11891. /***/ (function(module, exports, __webpack_require__) {
  11892. "use strict";
  11893. Object.defineProperty(exports, "__esModule", { value: true });
  11894. /**
  11895. *
  11896. * Maybe Monad
  11897. * @Source: https://codewithstyle.info/advanced-functional-programming-in-typescript-maybe-monad/
  11898. * @Modified by: @lucascalion - 28/08/2019
  11899. *
  11900. **/
  11901. class Maybe {
  11902. constructor(value) {
  11903. this.value = value;
  11904. }
  11905. static some(value) {
  11906. if (!value) {
  11907. throw Error("Provided value must not be empty");
  11908. }
  11909. return new Maybe(value);
  11910. }
  11911. static none() {
  11912. return new Maybe(null);
  11913. }
  11914. static fromValue(value) {
  11915. return value ? Maybe.some(value) : Maybe.none();
  11916. }
  11917. getOrElse(defaultValue) {
  11918. return this.value === null ? defaultValue : this.value;
  11919. }
  11920. map(f) {
  11921. if (this.value === null) {
  11922. return Maybe.none();
  11923. }
  11924. else {
  11925. return Maybe.fromValue(f(this.value));
  11926. }
  11927. }
  11928. }
  11929. exports.Maybe = Maybe;
  11930. /***/ }),
  11931. /***/ "./js/util/outputTest.js":
  11932. /*!*******************************!*\
  11933. !*** ./js/util/outputTest.js ***!
  11934. \*******************************/
  11935. /*! exports provided: OutputTest */
  11936. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11937. "use strict";
  11938. __webpack_require__.r(__webpack_exports__);
  11939. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputTest", function() { return OutputTest; });
  11940. /* harmony import */ var _io_output__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../io/output */ "./js/io/output.js");
  11941. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  11942. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11943. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  11944. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  11945. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  11946. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  11947. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  11948. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  11949. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  11950. var OutputTest =
  11951. /*#__PURE__*/
  11952. function (_Output) {
  11953. _inherits(OutputTest, _Output);
  11954. function OutputTest() {
  11955. var _this;
  11956. _classCallCheck(this, OutputTest);
  11957. _this = _possibleConstructorReturn(this, _getPrototypeOf(OutputTest).call(this));
  11958. _this.list = [];
  11959. return _this;
  11960. }
  11961. _createClass(OutputTest, [{
  11962. key: "sendOutput",
  11963. value: function sendOutput(text) {
  11964. var _this2 = this;
  11965. var output = '' + text;
  11966. output.split("\n").forEach(function (t) {
  11967. t = t.replace(/\t/g, ' ');
  11968. t = t.replace(/\s/g, " ");
  11969. _this2.list.push(t);
  11970. }, this);
  11971. }
  11972. }]);
  11973. return OutputTest;
  11974. }(_io_output__WEBPACK_IMPORTED_MODULE_0__["Output"]);
  11975. /***/ }),
  11976. /***/ "./js/util/string_diff.js":
  11977. /*!********************************!*\
  11978. !*** ./js/util/string_diff.js ***!
  11979. \********************************/
  11980. /*! exports provided: default */
  11981. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11982. "use strict";
  11983. __webpack_require__.r(__webpack_exports__);
  11984. /**
  11985. * Author: @jhchen - https://github.com/jhchen
  11986. * Modified by: @lucascalion - 23/07/2019
  11987. * This library modifies the diff-patch-match library by Neil Fraser
  11988. * by removing the patch and match functionality and certain advanced
  11989. * options in the diff function. The original license is as follows:
  11990. *
  11991. * ===
  11992. *
  11993. * Diff Match and Patch
  11994. *
  11995. * Copyright 2006 Google Inc.
  11996. * http://code.google.com/p/google-diff-match-patch/
  11997. *
  11998. * Licensed under the Apache License, Version 2.0 (the "License");
  11999. * you may not use this file except in compliance with the License.
  12000. * You may obtain a copy of the License at
  12001. *
  12002. * http://www.apache.org/licenses/LICENSE-2.0
  12003. *
  12004. * Unless required by applicable law or agreed to in writing, software
  12005. * distributed under the License is distributed on an "AS IS" BASIS,
  12006. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12007. * See the License for the specific language governing permissions and
  12008. * limitations under the License.
  12009. */
  12010. /**
  12011. * The data structure representing a diff is an array of tuples:
  12012. * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]
  12013. * which means: delete 'Hello', add 'Goodbye' and keep ' world.'
  12014. */
  12015. var DIFF_DELETE = -1;
  12016. var DIFF_INSERT = 1;
  12017. var DIFF_EQUAL = 0;
  12018. /**
  12019. * Find the differences between two texts. Simplifies the problem by stripping
  12020. * any common prefix or suffix off the texts before diffing.
  12021. * @param {string} text1 Old string to be diffed.
  12022. * @param {string} text2 New string to be diffed.
  12023. * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info
  12024. * @return {Array} Array of diff tuples.
  12025. */
  12026. function diff_main(text1, text2, cursor_pos, _fix_unicode) {
  12027. // Check for equality
  12028. if (text1 === text2) {
  12029. if (text1) {
  12030. return [[DIFF_EQUAL, text1]];
  12031. }
  12032. return [];
  12033. }
  12034. if (cursor_pos != null) {
  12035. var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);
  12036. if (editdiff) {
  12037. return editdiff;
  12038. }
  12039. } // Trim off common prefix (speedup).
  12040. var commonlength = diff_commonPrefix(text1, text2);
  12041. var commonprefix = text1.substring(0, commonlength);
  12042. text1 = text1.substring(commonlength);
  12043. text2 = text2.substring(commonlength); // Trim off common suffix (speedup).
  12044. commonlength = diff_commonSuffix(text1, text2);
  12045. var commonsuffix = text1.substring(text1.length - commonlength);
  12046. text1 = text1.substring(0, text1.length - commonlength);
  12047. text2 = text2.substring(0, text2.length - commonlength); // Compute the diff on the middle block.
  12048. var diffs = diff_compute_(text1, text2); // Restore the prefix and suffix.
  12049. if (commonprefix) {
  12050. diffs.unshift([DIFF_EQUAL, commonprefix]);
  12051. }
  12052. if (commonsuffix) {
  12053. diffs.push([DIFF_EQUAL, commonsuffix]);
  12054. }
  12055. diff_cleanupMerge(diffs, _fix_unicode);
  12056. return diffs;
  12057. }
  12058. /**
  12059. * Find the differences between two texts. Assumes that the texts do not
  12060. * have any common prefix or suffix.
  12061. * @param {string} text1 Old string to be diffed.
  12062. * @param {string} text2 New string to be diffed.
  12063. * @return {Array} Array of diff tuples.
  12064. */
  12065. function diff_compute_(text1, text2) {
  12066. var diffs;
  12067. if (!text1) {
  12068. // Just add some text (speedup).
  12069. return [[DIFF_INSERT, text2]];
  12070. }
  12071. if (!text2) {
  12072. // Just delete some text (speedup).
  12073. return [[DIFF_DELETE, text1]];
  12074. }
  12075. var longtext = text1.length > text2.length ? text1 : text2;
  12076. var shorttext = text1.length > text2.length ? text2 : text1;
  12077. var i = longtext.indexOf(shorttext);
  12078. if (i !== -1) {
  12079. // Shorter text is inside the longer text (speedup).
  12080. 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.
  12081. if (text1.length > text2.length) {
  12082. diffs[0][0] = diffs[2][0] = DIFF_DELETE;
  12083. }
  12084. return diffs;
  12085. }
  12086. if (shorttext.length === 1) {
  12087. // Single character string.
  12088. // After the previous speedup, the character can't be an equality.
  12089. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
  12090. } // Check to see if the problem can be split in two.
  12091. var hm = diff_halfMatch_(text1, text2);
  12092. if (hm) {
  12093. // A half-match was found, sort out the return data.
  12094. var text1_a = hm[0];
  12095. var text1_b = hm[1];
  12096. var text2_a = hm[2];
  12097. var text2_b = hm[3];
  12098. var mid_common = hm[4]; // Send both pairs off for separate processing.
  12099. var diffs_a = diff_main(text1_a, text2_a);
  12100. var diffs_b = diff_main(text1_b, text2_b); // Merge the results.
  12101. return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);
  12102. }
  12103. return diff_bisect_(text1, text2);
  12104. }
  12105. /**
  12106. * Find the 'middle snake' of a diff, split the problem in two
  12107. * and return the recursively constructed diff.
  12108. * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.
  12109. * @param {string} text1 Old string to be diffed.
  12110. * @param {string} text2 New string to be diffed.
  12111. * @return {Array} Array of diff tuples.
  12112. * @private
  12113. */
  12114. function diff_bisect_(text1, text2) {
  12115. // Cache the text lengths to prevent multiple calls.
  12116. var text1_length = text1.length;
  12117. var text2_length = text2.length;
  12118. var max_d = Math.ceil((text1_length + text2_length) / 2);
  12119. var v_offset = max_d;
  12120. var v_length = 2 * max_d;
  12121. var v1 = new Array(v_length);
  12122. var v2 = new Array(v_length); // Setting all elements to -1 is faster in Chrome & Firefox than mixing
  12123. // integers and undefined.
  12124. for (var x = 0; x < v_length; x++) {
  12125. v1[x] = -1;
  12126. v2[x] = -1;
  12127. }
  12128. v1[v_offset + 1] = 0;
  12129. v2[v_offset + 1] = 0;
  12130. var delta = text1_length - text2_length; // If the total number of characters is odd, then the front path will collide
  12131. // with the reverse path.
  12132. var front = delta % 2 !== 0; // Offsets for start and end of k loop.
  12133. // Prevents mapping of space beyond the grid.
  12134. var k1start = 0;
  12135. var k1end = 0;
  12136. var k2start = 0;
  12137. var k2end = 0;
  12138. for (var d = 0; d < max_d; d++) {
  12139. // Walk the front path one step.
  12140. for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {
  12141. var k1_offset = v_offset + k1;
  12142. var x1 = void 0;
  12143. if (k1 === -d || k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1]) {
  12144. x1 = v1[k1_offset + 1];
  12145. } else {
  12146. x1 = v1[k1_offset - 1] + 1;
  12147. }
  12148. var y1 = x1 - k1;
  12149. while (x1 < text1_length && y1 < text2_length && text1.charAt(x1) === text2.charAt(y1)) {
  12150. x1++;
  12151. y1++;
  12152. }
  12153. v1[k1_offset] = x1;
  12154. if (x1 > text1_length) {
  12155. // Ran off the right of the graph.
  12156. k1end += 2;
  12157. } else if (y1 > text2_length) {
  12158. // Ran off the bottom of the graph.
  12159. k1start += 2;
  12160. } else if (front) {
  12161. var k2_offset = v_offset + delta - k1;
  12162. if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {
  12163. // Mirror x2 onto top-left coordinate system.
  12164. var x2 = text1_length - v2[k2_offset];
  12165. if (x1 >= x2) {
  12166. // Overlap detfrontected.
  12167. return diff_bisectSplit_(text1, text2, x1, y1);
  12168. }
  12169. }
  12170. }
  12171. } // Walk the reverse path one step.
  12172. for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {
  12173. var _k2_offset = v_offset + k2;
  12174. var _x = void 0;
  12175. if (k2 === -d || k2 !== d && v2[_k2_offset - 1] < v2[_k2_offset + 1]) {
  12176. _x = v2[_k2_offset + 1];
  12177. } else {
  12178. _x = v2[_k2_offset - 1] + 1;
  12179. }
  12180. var y2 = _x - k2;
  12181. while (_x < text1_length && y2 < text2_length && text1.charAt(text1_length - _x - 1) === text2.charAt(text2_length - y2 - 1)) {
  12182. _x++;
  12183. y2++;
  12184. }
  12185. v2[_k2_offset] = _x;
  12186. if (_x > text1_length) {
  12187. // Ran off the left of the graph.
  12188. k2end += 2;
  12189. } else if (y2 > text2_length) {
  12190. // Ran off the top of the graph.
  12191. k2start += 2;
  12192. } else if (!front) {
  12193. var _k1_offset = v_offset + delta - k2;
  12194. if (_k1_offset >= 0 && _k1_offset < v_length && v1[_k1_offset] !== -1) {
  12195. var _x2 = v1[_k1_offset];
  12196. var _y = v_offset + _x2 - _k1_offset; // Mirror x2 onto top-left coordinate system.
  12197. _x = text1_length - _x;
  12198. if (_x2 >= _x) {
  12199. // Overlap detected.
  12200. return diff_bisectSplit_(text1, text2, _x2, _y);
  12201. }
  12202. }
  12203. }
  12204. }
  12205. } // Diff took too long and hit the deadline or
  12206. // number of diffs equals number of characters, no commonality at all.
  12207. return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
  12208. }
  12209. /**
  12210. * Given the location of the 'middle snake', split the diff in two parts
  12211. * and recurse.
  12212. * @param {string} text1 Old string to be diffed.
  12213. * @param {string} text2 New string to be diffed.
  12214. * @param {number} x Index of split point in text1.
  12215. * @param {number} y Index of split point in text2.
  12216. * @return {Array} Array of diff tuples.
  12217. */
  12218. function diff_bisectSplit_(text1, text2, x, y) {
  12219. var text1a = text1.substring(0, x);
  12220. var text2a = text2.substring(0, y);
  12221. var text1b = text1.substring(x);
  12222. var text2b = text2.substring(y); // Compute both diffs serially.
  12223. var diffs = diff_main(text1a, text2a);
  12224. var diffsb = diff_main(text1b, text2b);
  12225. return diffs.concat(diffsb);
  12226. }
  12227. /**
  12228. * Determine the common prefix of two strings.
  12229. * @param {string} text1 First string.
  12230. * @param {string} text2 Second string.
  12231. * @return {number} The number of characters common to the start of each
  12232. * string.
  12233. */
  12234. function diff_commonPrefix(text1, text2) {
  12235. // Quick check for common null cases.
  12236. if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {
  12237. return 0;
  12238. } // Binary search.
  12239. // Performance analysis: http://neil.fraser.name/news/2007/10/09/
  12240. var pointermin = 0;
  12241. var pointermax = Math.min(text1.length, text2.length);
  12242. var pointermid = pointermax;
  12243. var pointerstart = 0;
  12244. while (pointermin < pointermid) {
  12245. if (text1.substring(pointerstart, pointermid) == text2.substring(pointerstart, pointermid)) {
  12246. pointermin = pointermid;
  12247. pointerstart = pointermin;
  12248. } else {
  12249. pointermax = pointermid;
  12250. }
  12251. pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
  12252. }
  12253. if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {
  12254. pointermid--;
  12255. }
  12256. return pointermid;
  12257. }
  12258. /**
  12259. * Determine the common suffix of two strings.
  12260. * @param {string} text1 First string.
  12261. * @param {string} text2 Second string.
  12262. * @return {number} The number of characters common to the end of each string.
  12263. */
  12264. function diff_commonSuffix(text1, text2) {
  12265. // Quick check for common null cases.
  12266. if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {
  12267. return 0;
  12268. } // Binary search.
  12269. // Performance analysis: http://neil.fraser.name/news/2007/10/09/
  12270. var pointermin = 0;
  12271. var pointermax = Math.min(text1.length, text2.length);
  12272. var pointermid = pointermax;
  12273. var pointerend = 0;
  12274. while (pointermin < pointermid) {
  12275. if (text1.substring(text1.length - pointermid, text1.length - pointerend) == text2.substring(text2.length - pointermid, text2.length - pointerend)) {
  12276. pointermin = pointermid;
  12277. pointerend = pointermin;
  12278. } else {
  12279. pointermax = pointermid;
  12280. }
  12281. pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
  12282. }
  12283. if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {
  12284. pointermid--;
  12285. }
  12286. return pointermid;
  12287. }
  12288. /**
  12289. * Do the two texts share a substring which is at least half the length of the
  12290. * longer text?
  12291. * This speedup can produce non-minimal diffs.
  12292. * @param {string} text1 First string.
  12293. * @param {string} text2 Second string.
  12294. * @return {Array.<string>} Five element Array, containing the prefix of
  12295. * text1, the suffix of text1, the prefix of text2, the suffix of
  12296. * text2 and the common middle. Or null if there was no match.
  12297. */
  12298. function diff_halfMatch_(text1, text2) {
  12299. var longtext = text1.length > text2.length ? text1 : text2;
  12300. var shorttext = text1.length > text2.length ? text2 : text1;
  12301. if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {
  12302. return null; // Pointless.
  12303. }
  12304. /**
  12305. * Does a substring of shorttext exist within longtext such that the substring
  12306. * is at least half the length of longtext?
  12307. * Closure, but does not reference any external variables.
  12308. * @param {string} longtext Longer string.
  12309. * @param {string} shorttext Shorter string.
  12310. * @param {number} i Start index of quarter length substring within longtext.
  12311. * @return {Array.<string>} Five element Array, containing the prefix of
  12312. * longtext, the suffix of longtext, the prefix of shorttext, the suffix
  12313. * of shorttext and the common middle. Or null if there was no match.
  12314. * @private
  12315. */
  12316. function diff_halfMatchI_(longtext, shorttext, i) {
  12317. // Start with a 1/4 length substring at position i as a seed.
  12318. var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));
  12319. var j = -1;
  12320. var best_common = '';
  12321. var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
  12322. while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {
  12323. var prefixLength = diff_commonPrefix(longtext.substring(i), shorttext.substring(j));
  12324. var suffixLength = diff_commonSuffix(longtext.substring(0, i), shorttext.substring(0, j));
  12325. if (best_common.length < suffixLength + prefixLength) {
  12326. best_common = shorttext.substring(j - suffixLength, j) + shorttext.substring(j, j + prefixLength);
  12327. best_longtext_a = longtext.substring(0, i - suffixLength);
  12328. best_longtext_b = longtext.substring(i + prefixLength);
  12329. best_shorttext_a = shorttext.substring(0, j - suffixLength);
  12330. best_shorttext_b = shorttext.substring(j + prefixLength);
  12331. }
  12332. }
  12333. if (best_common.length * 2 >= longtext.length) {
  12334. return [best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b, best_common];
  12335. } else {
  12336. return null;
  12337. }
  12338. } // First check if the second quarter is the seed for a half-match.
  12339. var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4)); // Check again based on the third quarter.
  12340. var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));
  12341. var hm;
  12342. if (!hm1 && !hm2) {
  12343. return null;
  12344. } else if (!hm2) {
  12345. hm = hm1;
  12346. } else if (!hm1) {
  12347. hm = hm2;
  12348. } else {
  12349. // Both matched. Select the longest.
  12350. hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
  12351. } // A half-match was found, sort out the return data.
  12352. var text1_a, text1_b, text2_a, text2_b;
  12353. if (text1.length > text2.length) {
  12354. text1_a = hm[0];
  12355. text1_b = hm[1];
  12356. text2_a = hm[2];
  12357. text2_b = hm[3];
  12358. } else {
  12359. text2_a = hm[0];
  12360. text2_b = hm[1];
  12361. text1_a = hm[2];
  12362. text1_b = hm[3];
  12363. }
  12364. var mid_common = hm[4];
  12365. return [text1_a, text1_b, text2_a, text2_b, mid_common];
  12366. }
  12367. /**
  12368. * Reorder and merge like edit sections. Merge equalities.
  12369. * Any edit section can move as long as it doesn't cross an equality.
  12370. * @param {Array} diffs Array of diff tuples.
  12371. * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff
  12372. */
  12373. function diff_cleanupMerge(diffs, fix_unicode) {
  12374. diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.
  12375. var pointer = 0;
  12376. var count_delete = 0;
  12377. var count_insert = 0;
  12378. var text_delete = '';
  12379. var text_insert = '';
  12380. var commonlength;
  12381. var previous_equality;
  12382. while (pointer < diffs.length) {
  12383. if (pointer < diffs.length - 1 && !diffs[pointer][1]) {
  12384. diffs.splice(pointer, 1);
  12385. continue;
  12386. }
  12387. switch (diffs[pointer][0]) {
  12388. case DIFF_INSERT:
  12389. count_insert++;
  12390. text_insert += diffs[pointer][1];
  12391. pointer++;
  12392. break;
  12393. case DIFF_DELETE:
  12394. count_delete++;
  12395. text_delete += diffs[pointer][1];
  12396. pointer++;
  12397. break;
  12398. case DIFF_EQUAL:
  12399. previous_equality = pointer - count_insert - count_delete - 1;
  12400. if (fix_unicode) {
  12401. // prevent splitting of unicode surrogate pairs. when fix_unicode is true,
  12402. // we assume that the old and new text in the diff are complete and correct
  12403. // unicode-encoded JS strings, but the tuple boundaries may fall between
  12404. // surrogate pairs. we fix this by shaving off stray surrogates from the end
  12405. // of the previous equality and the beginning of this equality. this may create
  12406. // empty equalities or a common prefix or suffix. for example, if AB and AC are
  12407. // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and
  12408. // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this
  12409. // particular case, both equalities go away, we absorb any previous inequalities,
  12410. // and we keep scanning for the next equality before rewriting the tuples.
  12411. if (previous_equality >= 0 && ends_with_pair_start(diffs[previous_equality][1])) {
  12412. var stray = diffs[previous_equality][1].slice(-1);
  12413. diffs[previous_equality][1] = diffs[previous_equality][1].slice(0, -1);
  12414. text_delete = stray + text_delete;
  12415. text_insert = stray + text_insert;
  12416. if (!diffs[previous_equality][1]) {
  12417. // emptied out previous equality, so delete it and include previous delete/insert
  12418. diffs.splice(previous_equality, 1);
  12419. pointer--;
  12420. var k = previous_equality - 1;
  12421. if (diffs[k] && diffs[k][0] === DIFF_INSERT) {
  12422. count_insert++;
  12423. text_insert = diffs[k][1] + text_insert;
  12424. k--;
  12425. }
  12426. if (diffs[k] && diffs[k][0] === DIFF_DELETE) {
  12427. count_delete++;
  12428. text_delete = diffs[k][1] + text_delete;
  12429. k--;
  12430. }
  12431. previous_equality = k;
  12432. }
  12433. }
  12434. if (starts_with_pair_end(diffs[pointer][1])) {
  12435. var _stray = diffs[pointer][1].charAt(0);
  12436. diffs[pointer][1] = diffs[pointer][1].slice(1);
  12437. text_delete += _stray;
  12438. text_insert += _stray;
  12439. }
  12440. }
  12441. if (pointer < diffs.length - 1 && !diffs[pointer][1]) {
  12442. // for empty equality not at end, wait for next equality
  12443. diffs.splice(pointer, 1);
  12444. break;
  12445. }
  12446. if (text_delete.length > 0 || text_insert.length > 0) {
  12447. // note that diff_commonPrefix and diff_commonSuffix are unicode-aware
  12448. if (text_delete.length > 0 && text_insert.length > 0) {
  12449. // Factor out any common prefixes.
  12450. commonlength = diff_commonPrefix(text_insert, text_delete);
  12451. if (commonlength !== 0) {
  12452. if (previous_equality >= 0) {
  12453. diffs[previous_equality][1] += text_insert.substring(0, commonlength);
  12454. } else {
  12455. diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]);
  12456. pointer++;
  12457. }
  12458. text_insert = text_insert.substring(commonlength);
  12459. text_delete = text_delete.substring(commonlength);
  12460. } // Factor out any common suffixes.
  12461. commonlength = diff_commonSuffix(text_insert, text_delete);
  12462. if (commonlength !== 0) {
  12463. diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];
  12464. text_insert = text_insert.substring(0, text_insert.length - commonlength);
  12465. text_delete = text_delete.substring(0, text_delete.length - commonlength);
  12466. }
  12467. } // Delete the offending records and add the merged ones.
  12468. var n = count_insert + count_delete;
  12469. if (text_delete.length === 0 && text_insert.length === 0) {
  12470. diffs.splice(pointer - n, n);
  12471. pointer = pointer - n;
  12472. } else if (text_delete.length === 0) {
  12473. diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);
  12474. pointer = pointer - n + 1;
  12475. } else if (text_insert.length === 0) {
  12476. diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);
  12477. pointer = pointer - n + 1;
  12478. } else {
  12479. diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]);
  12480. pointer = pointer - n + 2;
  12481. }
  12482. }
  12483. if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {
  12484. // Merge this equality with the previous one.
  12485. diffs[pointer - 1][1] += diffs[pointer][1];
  12486. diffs.splice(pointer, 1);
  12487. } else {
  12488. pointer++;
  12489. }
  12490. count_insert = 0;
  12491. count_delete = 0;
  12492. text_delete = '';
  12493. text_insert = '';
  12494. break;
  12495. }
  12496. }
  12497. if (diffs[diffs.length - 1][1] === '') {
  12498. diffs.pop(); // Remove the dummy entry at the end.
  12499. } // Second pass: look for single edits surrounded on both sides by equalities
  12500. // which can be shifted sideways to eliminate an equality.
  12501. // e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC
  12502. var changes = false;
  12503. pointer = 1; // Intentionally ignore the first and last element (don't need checking).
  12504. while (pointer < diffs.length - 1) {
  12505. if (diffs[pointer - 1][0] === DIFF_EQUAL && diffs[pointer + 1][0] === DIFF_EQUAL) {
  12506. // This is a single edit surrounded by equalities.
  12507. if (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {
  12508. // Shift the edit over the previous equality.
  12509. diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length);
  12510. diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
  12511. diffs.splice(pointer - 1, 1);
  12512. changes = true;
  12513. } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == diffs[pointer + 1][1]) {
  12514. // Shift the edit over the next equality.
  12515. diffs[pointer - 1][1] += diffs[pointer + 1][1];
  12516. diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1];
  12517. diffs.splice(pointer + 1, 1);
  12518. changes = true;
  12519. }
  12520. }
  12521. pointer++;
  12522. } // If shifts were made, the diff needs reordering and another shift sweep.
  12523. if (changes) {
  12524. diff_cleanupMerge(diffs, fix_unicode);
  12525. }
  12526. }
  12527. function is_surrogate_pair_start(charCode) {
  12528. return charCode >= 0xD800 && charCode <= 0xDBFF;
  12529. }
  12530. function is_surrogate_pair_end(charCode) {
  12531. return charCode >= 0xDC00 && charCode <= 0xDFFF;
  12532. }
  12533. function starts_with_pair_end(str) {
  12534. return is_surrogate_pair_end(str.charCodeAt(0));
  12535. }
  12536. function ends_with_pair_start(str) {
  12537. return is_surrogate_pair_start(str.charCodeAt(str.length - 1));
  12538. }
  12539. function remove_empty_tuples(tuples) {
  12540. var ret = [];
  12541. for (var i = 0; i < tuples.length; i++) {
  12542. if (tuples[i][1].length > 0) {
  12543. ret.push(tuples[i]);
  12544. }
  12545. }
  12546. return ret;
  12547. }
  12548. function make_edit_splice(before, oldMiddle, newMiddle, after) {
  12549. if (ends_with_pair_start(before) || starts_with_pair_end(after)) {
  12550. return null;
  12551. }
  12552. return remove_empty_tuples([[DIFF_EQUAL, before], [DIFF_DELETE, oldMiddle], [DIFF_INSERT, newMiddle], [DIFF_EQUAL, after]]);
  12553. }
  12554. function find_cursor_edit_diff(oldText, newText, cursor_pos) {
  12555. // note: this runs after equality check has ruled out exact equality
  12556. var oldRange = typeof cursor_pos === 'number' ? {
  12557. index: cursor_pos,
  12558. length: 0
  12559. } : cursor_pos.oldRange;
  12560. var newRange = typeof cursor_pos === 'number' ? null : cursor_pos.newRange; // take into account the old and new selection to generate the best diff
  12561. // possible for a text edit. for example, a text change from "xxx" to "xx"
  12562. // could be a delete or forwards-delete of any one of the x's, or the
  12563. // result of selecting two of the x's and typing "x".
  12564. var oldLength = oldText.length;
  12565. var newLength = newText.length;
  12566. if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {
  12567. // see if we have an insert or delete before or after cursor
  12568. var oldCursor = oldRange.index;
  12569. var oldBefore = oldText.slice(0, oldCursor);
  12570. var oldAfter = oldText.slice(oldCursor);
  12571. var maybeNewCursor = newRange ? newRange.index : null;
  12572. editBefore: {
  12573. // is this an insert or delete right before oldCursor?
  12574. var newCursor = oldCursor + newLength - oldLength;
  12575. if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {
  12576. break editBefore;
  12577. }
  12578. if (newCursor < 0 || newCursor > newLength) {
  12579. break editBefore;
  12580. }
  12581. var newBefore = newText.slice(0, newCursor);
  12582. var newAfter = newText.slice(newCursor);
  12583. if (newAfter !== oldAfter) {
  12584. break editBefore;
  12585. }
  12586. var prefixLength = Math.min(oldCursor, newCursor);
  12587. var oldPrefix = oldBefore.slice(0, prefixLength);
  12588. var newPrefix = newBefore.slice(0, prefixLength);
  12589. if (oldPrefix !== newPrefix) {
  12590. break editBefore;
  12591. }
  12592. var oldMiddle = oldBefore.slice(prefixLength);
  12593. var newMiddle = newBefore.slice(prefixLength);
  12594. return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);
  12595. }
  12596. editAfter: {
  12597. // is this an insert or delete right after oldCursor?
  12598. if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {
  12599. break editAfter;
  12600. }
  12601. var cursor = oldCursor;
  12602. var _newBefore = newText.slice(0, cursor);
  12603. var _newAfter = newText.slice(cursor);
  12604. if (_newBefore !== oldBefore) {
  12605. break editAfter;
  12606. }
  12607. var suffixLength = Math.min(oldLength - cursor, newLength - cursor);
  12608. var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);
  12609. var newSuffix = _newAfter.slice(_newAfter.length - suffixLength);
  12610. if (oldSuffix !== newSuffix) {
  12611. break editAfter;
  12612. }
  12613. var _oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);
  12614. var _newMiddle = _newAfter.slice(0, _newAfter.length - suffixLength);
  12615. return make_edit_splice(oldBefore, _oldMiddle, _newMiddle, oldSuffix);
  12616. }
  12617. }
  12618. if (oldRange.length > 0 && newRange && newRange.length === 0) {
  12619. replaceRange: {
  12620. // see if diff could be a splice of the old selection range
  12621. var _oldPrefix = oldText.slice(0, oldRange.index);
  12622. var _oldSuffix = oldText.slice(oldRange.index + oldRange.length);
  12623. var _prefixLength = _oldPrefix.length;
  12624. var _suffixLength = _oldSuffix.length;
  12625. if (newLength < _prefixLength + _suffixLength) {
  12626. break replaceRange;
  12627. }
  12628. var _newPrefix = newText.slice(0, _prefixLength);
  12629. var _newSuffix = newText.slice(newLength - _suffixLength);
  12630. if (_oldPrefix !== _newPrefix || _oldSuffix !== _newSuffix) {
  12631. break replaceRange;
  12632. }
  12633. var _oldMiddle2 = oldText.slice(_prefixLength, oldLength - _suffixLength);
  12634. var _newMiddle2 = newText.slice(_prefixLength, newLength - _suffixLength);
  12635. return make_edit_splice(_oldPrefix, _oldMiddle2, _newMiddle2, _oldSuffix);
  12636. }
  12637. }
  12638. return null;
  12639. }
  12640. function diff(text1, text2, cursor_pos) {
  12641. // only pass fix_unicode=true at the top level, not when diff_main is
  12642. // recursively invoked
  12643. return diff_main(text1, text2, cursor_pos, true);
  12644. }
  12645. diff.INSERT = DIFF_INSERT;
  12646. diff.DELETE = DIFF_DELETE;
  12647. diff.EQUAL = DIFF_EQUAL;
  12648. /* harmony default export */ __webpack_exports__["default"] = (diff);
  12649. /***/ }),
  12650. /***/ "./js/util/testConsole.js":
  12651. /*!********************************!*\
  12652. !*** ./js/util/testConsole.js ***!
  12653. \********************************/
  12654. /*! exports provided: TestConsole */
  12655. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12656. "use strict";
  12657. __webpack_require__.r(__webpack_exports__);
  12658. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TestConsole", function() { return TestConsole; });
  12659. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../io/domConsole */ "./js/io/domConsole.js");
  12660. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  12661. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12662. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  12663. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  12664. var LocalizedStrings = Object(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["getInstance"])();
  12665. var TestConsole =
  12666. /*#__PURE__*/
  12667. function () {
  12668. function TestConsole(inputList) {
  12669. _classCallCheck(this, TestConsole);
  12670. this.index = 0;
  12671. this.inputList = inputList;
  12672. this.list = [];
  12673. }
  12674. _createClass(TestConsole, [{
  12675. key: "write",
  12676. value: function write(text) {
  12677. this._appendText(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_0__["DOMConsole"].USER);
  12678. }
  12679. }, {
  12680. key: "info",
  12681. value: function info(text) {
  12682. this._appendText(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_0__["DOMConsole"].INFO);
  12683. }
  12684. }, {
  12685. key: "err",
  12686. value: function err(text) {
  12687. this._appendText(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_0__["DOMConsole"].ERR);
  12688. }
  12689. }, {
  12690. key: "_appendText",
  12691. value: function _appendText(text) {
  12692. this.list.push(text);
  12693. }
  12694. }, {
  12695. key: "getClassForType",
  12696. value: function getClassForType(type) {
  12697. switch (type) {
  12698. case _io_domConsole__WEBPACK_IMPORTED_MODULE_0__["DOMConsole"].USER:
  12699. return "ivprog-term-userText";
  12700. case _io_domConsole__WEBPACK_IMPORTED_MODULE_0__["DOMConsole"].INFO:
  12701. return "ivprog-term-info";
  12702. case _io_domConsole__WEBPACK_IMPORTED_MODULE_0__["DOMConsole"].ERR:
  12703. return "ivprog-term-error";
  12704. }
  12705. }
  12706. }, {
  12707. key: "requestInput",
  12708. value: function requestInput(callback) {
  12709. if (this.index < this.inputList.length) {
  12710. callback(this.inputList[this.index]);
  12711. this.index++;
  12712. } else {
  12713. throw new Error(LocalizedStrings.getError("exceeded_input_request"));
  12714. }
  12715. }
  12716. }, {
  12717. key: "sendOutput",
  12718. value: function sendOutput(text) {
  12719. var _this = this;
  12720. var output = "" + text;
  12721. output.split("\n").forEach(function (t) {
  12722. t = t.replace(/\t/g, '&#9;');
  12723. _this.write(t);
  12724. });
  12725. }
  12726. }]);
  12727. return TestConsole;
  12728. }();
  12729. /***/ }),
  12730. /***/ "./js/util/utils.js":
  12731. /*!**************************!*\
  12732. !*** ./js/util/utils.js ***!
  12733. \**************************/
  12734. /*! exports provided: scrollIt, isElementInViewport, isKeyword, isValidIdentifier, getCodeEditorModeConfig, levenshteinDistance, openAssessmentDetail, range */
  12735. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12736. "use strict";
  12737. __webpack_require__.r(__webpack_exports__);
  12738. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollIt", function() { return scrollIt; });
  12739. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isElementInViewport", function() { return isElementInViewport; });
  12740. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isKeyword", function() { return isKeyword; });
  12741. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidIdentifier", function() { return isValidIdentifier; });
  12742. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCodeEditorModeConfig", function() { return getCodeEditorModeConfig; });
  12743. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "levenshteinDistance", function() { return levenshteinDistance; });
  12744. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "openAssessmentDetail", function() { return openAssessmentDetail; });
  12745. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return range; });
  12746. /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../services/languageService */ "./js/services/languageService.js");
  12747. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  12748. /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.js");
  12749. function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
  12750. function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
  12751. function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
  12752. function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
  12753. /**
  12754. * source: https://pawelgrzybek.com/page-scroll-in-vanilla-javascript/
  12755. *
  12756. */
  12757. function scrollIt(destination) {
  12758. var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
  12759. var easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'linear';
  12760. var callback = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  12761. var easings = {
  12762. linear: function linear(t) {
  12763. return t;
  12764. },
  12765. easeInQuad: function easeInQuad(t) {
  12766. return t * t;
  12767. },
  12768. easeOutQuad: function easeOutQuad(t) {
  12769. return t * (2 - t);
  12770. },
  12771. easeInOutQuad: function easeInOutQuad(t) {
  12772. return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
  12773. },
  12774. easeInCubic: function easeInCubic(t) {
  12775. return t * t * t;
  12776. },
  12777. easeOutCubic: function easeOutCubic(t) {
  12778. return --t * t * t + 1;
  12779. },
  12780. easeInOutCubic: function easeInOutCubic(t) {
  12781. return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
  12782. },
  12783. easeInQuart: function easeInQuart(t) {
  12784. return t * t * t * t;
  12785. },
  12786. easeOutQuart: function easeOutQuart(t) {
  12787. return 1 - --t * t * t * t;
  12788. },
  12789. easeInOutQuart: function easeInOutQuart(t) {
  12790. return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
  12791. },
  12792. easeInQuint: function easeInQuint(t) {
  12793. return t * t * t * t * t;
  12794. },
  12795. easeOutQuint: function easeOutQuint(t) {
  12796. return 1 + --t * t * t * t * t;
  12797. },
  12798. easeInOutQuint: function easeInOutQuint(t) {
  12799. return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;
  12800. }
  12801. };
  12802. var start = window.pageYOffset;
  12803. var startTime = 'now' in window.performance ? performance.now() : new Date().getTime();
  12804. var documentHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);
  12805. var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;
  12806. var destinationOffset = typeof destination === 'number' ? destination : destination.offsetTop;
  12807. var destinationOffsetToScroll = Math.round(documentHeight - destinationOffset < windowHeight ? documentHeight - windowHeight : destinationOffset);
  12808. if ('requestAnimationFrame' in window === false) {
  12809. window.scroll(0, destinationOffsetToScroll);
  12810. if (callback) {
  12811. callback();
  12812. }
  12813. return;
  12814. }
  12815. function scroll() {
  12816. var now = 'now' in window.performance ? performance.now() : new Date().getTime();
  12817. var time = Math.min(1, (now - startTime) / duration);
  12818. var timeFunction = easings[easing](time);
  12819. window.scroll(0, Math.ceil(timeFunction * (destinationOffsetToScroll - start) + start));
  12820. if (window.pageYOffset === destinationOffsetToScroll) {
  12821. if (callback) {
  12822. callback();
  12823. }
  12824. return;
  12825. }
  12826. requestAnimationFrame(scroll);
  12827. }
  12828. scroll();
  12829. }
  12830. /**
  12831. *
  12832. * source: https://stackoverflow.com/a/16270434
  12833. */
  12834. function isElementInViewport(el) {
  12835. var rect = el.getBoundingClientRect();
  12836. return rect.bottom > 0 && rect.right > 0 && rect.left < (window.innerWidth || document.documentElement.clientWidth) && rect.top < (window.innerHeight || document.documentElement.clientHeight);
  12837. }
  12838. var cacheMainList = null;
  12839. var cacheOp = null;
  12840. function fillCache() {
  12841. if (cacheMainList == null) {
  12842. cacheMainList = [];
  12843. 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"];
  12844. var lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLexer();
  12845. var nullLexer = new lexerClass();
  12846. for (var key = 0; key < mainList.length; ++key) {
  12847. var word = mainList[key];
  12848. var keyword = nullLexer.literalNames[lexerClass[word]];
  12849. cacheMainList.push(keyword.substring(1, keyword.length - 1));
  12850. }
  12851. }
  12852. if (cacheOp == null) {
  12853. cacheOp = [];
  12854. var logicOpList = [_ast_operators__WEBPACK_IMPORTED_MODULE_2__["Operators"].AND.value, _ast_operators__WEBPACK_IMPORTED_MODULE_2__["Operators"].OR.value, _ast_operators__WEBPACK_IMPORTED_MODULE_2__["Operators"].NOT.value];
  12855. for (var op = 0; op < logicOpList.length; ++op) {
  12856. var lOp = "logic_operator_".concat(logicOpList[op]);
  12857. cacheOp.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI(lOp));
  12858. }
  12859. }
  12860. }
  12861. function isKeyword(text) {
  12862. fillCache();
  12863. for (var key = 0; key < cacheMainList.length; ++key) {
  12864. var keyword = cacheMainList[key];
  12865. if (keyword == text) {
  12866. return true;
  12867. }
  12868. } // not in main list, check op
  12869. for (var op = 0; op < cacheOp.length; op++) {
  12870. var lOp = cacheOp[op];
  12871. if (lOp == text) {
  12872. return true;
  12873. }
  12874. }
  12875. return false;
  12876. }
  12877. function isValidIdentifier(identifier_str) {
  12878. var validRegex = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier_str);
  12879. if (!validRegex) {
  12880. return false;
  12881. }
  12882. return !isKeyword(identifier_str);
  12883. }
  12884. function getCodeEditorModeConfig() {
  12885. 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"];
  12886. var keywordsList = ["RK_CONST", "RK_RETURN", "RK_BREAK", "RK_FOR_FROM", "RK_FOR_TO", "RK_FOR_PASS", "RK_DO_UNTIL"];
  12887. var typeList = ["RK_REAL", "RK_VOID", "RK_BOOLEAN", "RK_STRING", "RK_INTEGER"];
  12888. var atomList = ["RK_FALSE", "RK_TRUE"];
  12889. var case_default = [];
  12890. var blocks = [];
  12891. var keywords = [];
  12892. var types = [];
  12893. var atoms = [];
  12894. var switchString = "";
  12895. cacheMainList = [];
  12896. var lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLexer();
  12897. var nullLexer = new lexerClass();
  12898. blockList.forEach(function (v) {
  12899. var keyword = nullLexer.literalNames[lexerClass[v]];
  12900. var value = keyword.substring(1, keyword.length - 1);
  12901. cacheMainList.push(value);
  12902. keywords.push(value);
  12903. blocks.push(value);
  12904. if (v == "RK_SWITCH") {
  12905. switchString = value;
  12906. } else if (v == "RK_CASE" || v == "RK_DEFAULT") {
  12907. case_default.push(value);
  12908. }
  12909. });
  12910. keywordsList.forEach(function (v) {
  12911. var keyword = nullLexer.literalNames[lexerClass[v]];
  12912. var value = keyword.substring(1, keyword.length - 1);
  12913. cacheMainList.push(value);
  12914. keywords.push(value);
  12915. });
  12916. typeList.forEach(function (v) {
  12917. var keyword = nullLexer.literalNames[lexerClass[v]];
  12918. var value = keyword.substring(1, keyword.length - 1);
  12919. cacheMainList.push(value);
  12920. types.push(value);
  12921. });
  12922. atomList.forEach(function (v) {
  12923. var keyword = nullLexer.literalNames[lexerClass[v]];
  12924. var value = keyword.substring(1, keyword.length - 1);
  12925. cacheMainList.push(value);
  12926. atoms.push(value);
  12927. });
  12928. cacheOp = [];
  12929. var logicOpList = [_ast_operators__WEBPACK_IMPORTED_MODULE_2__["Operators"].AND.value, _ast_operators__WEBPACK_IMPORTED_MODULE_2__["Operators"].OR.value, _ast_operators__WEBPACK_IMPORTED_MODULE_2__["Operators"].NOT.value];
  12930. for (var op = 0; op < logicOpList.length; ++op) {
  12931. var lOp = "logic_operator_".concat(logicOpList[op]);
  12932. var value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI(lOp);
  12933. cacheOp.push(value);
  12934. keywords.push(value);
  12935. }
  12936. return {
  12937. case_default: case_default,
  12938. atoms: atoms,
  12939. keywords: keywords,
  12940. switchString: switchString,
  12941. types: types,
  12942. blocks: blocks
  12943. };
  12944. }
  12945. /**
  12946. * Source: https://gist.github.com/andrei-m/982927
  12947. * @param {string} a
  12948. * @param {string} b
  12949. */
  12950. function levenshteinDistance(a, b) {
  12951. if (a.length == 0) return b.length;
  12952. if (b.length == 0) return a.length;
  12953. var matrix = []; // increment along the first column of each row
  12954. var i;
  12955. for (i = 0; i <= b.length; i++) {
  12956. matrix[i] = [i];
  12957. } // increment each column in the first row
  12958. var j;
  12959. for (j = 0; j <= a.length; j++) {
  12960. matrix[0][j] = j;
  12961. } // Fill in the rest of the matrix
  12962. for (i = 1; i <= b.length; i++) {
  12963. for (j = 1; j <= a.length; j++) {
  12964. if (b.charCodeAt(i - 1) == a.charCodeAt(j - 1)) {
  12965. matrix[i][j] = matrix[i - 1][j - 1];
  12966. } else {
  12967. matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution
  12968. Math.min(matrix[i][j - 1] + 1, // insertion
  12969. matrix[i - 1][j] + 1)); // deletion
  12970. }
  12971. }
  12972. }
  12973. return matrix[b.length][a.length];
  12974. }
  12975. var win = null;
  12976. function openAssessmentDetail(event) {
  12977. event.preventDefault();
  12978. var page_code = event.currentTarget.dataset.page;
  12979. if (win != null) {
  12980. win.close();
  12981. }
  12982. win = window.open("", "DetailWindow", "width=550,height=600");
  12983. win.document.open();
  12984. win.document.write(page_code);
  12985. win.document.close();
  12986. }
  12987. function range(size) {
  12988. var startAt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  12989. return _toConsumableArray(Array(size).keys()).map(function (i) {
  12990. return i + startAt;
  12991. });
  12992. }
  12993. /***/ }),
  12994. /***/ "./js/visualUI/algorithm.js":
  12995. /*!**********************************!*\
  12996. !*** ./js/visualUI/algorithm.js ***!
  12997. \**********************************/
  12998. /*! exports provided: renderAlgorithm */
  12999. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13000. "use strict";
  13001. __webpack_require__.r(__webpack_exports__);
  13002. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderAlgorithm", function() { return renderAlgorithm; });
  13003. /* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./globals */ "./js/visualUI/globals.js");
  13004. /* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functions */ "./js/visualUI/functions.js");
  13005. window.block_render = false;
  13006. function renderAlgorithm() {
  13007. if (window.block_render) {
  13008. return;
  13009. }
  13010. if (window.draging) {
  13011. return;
  13012. }
  13013. window.block_render = true;
  13014. console.log('rendering algorithm');
  13015. $('.all_functions').children().off();
  13016. $('.all_functions').empty();
  13017. $('.list_globals').children().off();
  13018. $('.list_globals').empty();
  13019. for (var i = 0; i < window.program_obj.functions.length; i++) {
  13020. _functions__WEBPACK_IMPORTED_MODULE_1__["renderFunction"](window.program_obj.functions[i]);
  13021. }
  13022. for (var i = 0; i < window.program_obj.globals.length; i++) {
  13023. _globals__WEBPACK_IMPORTED_MODULE_0__["renderGlobal"](window.program_obj.globals[i]);
  13024. }
  13025. setTimeout(function () {
  13026. window.block_render = false;
  13027. }, 100);
  13028. console.log('fim do render');
  13029. if (settingsFilter && settingsFilter[0]) {
  13030. blockAllEditingOptions();
  13031. }
  13032. }
  13033. /***/ }),
  13034. /***/ "./js/visualUI/code_generator.js":
  13035. /*!***************************************!*\
  13036. !*** ./js/visualUI/code_generator.js ***!
  13037. \***************************************/
  13038. /*! exports provided: generate */
  13039. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13040. "use strict";
  13041. __webpack_require__.r(__webpack_exports__);
  13042. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return generate; });
  13043. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  13044. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  13045. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  13046. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  13047. function generate() {
  13048. $('.ivprog_visual_panel').find('.error_icon').remove();
  13049. var code = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('program') + ' { ';
  13050. code += globalsCode();
  13051. code += '\n';
  13052. var has_error = false;
  13053. for (var i = 0; i < window.program_obj.functions.length; i++) {
  13054. var n_code = functionsCode(window.program_obj.functions[i]);
  13055. if (n_code == null) {
  13056. has_error = true;
  13057. }
  13058. code += n_code;
  13059. code += '\n';
  13060. }
  13061. code += '\n}';
  13062. if (has_error) {
  13063. return null;
  13064. } else {
  13065. return code;
  13066. }
  13067. }
  13068. function functionsCode(function_obj) {
  13069. var ret = '\n\t' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('function') + ' ';
  13070. var has_error = false;
  13071. switch (function_obj.return_type) {
  13072. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  13073. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('type_integer');
  13074. break;
  13075. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  13076. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('type_real');
  13077. break;
  13078. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  13079. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('type_text');
  13080. break;
  13081. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  13082. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('type_boolean');
  13083. break;
  13084. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID:
  13085. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('type_void');
  13086. break;
  13087. }
  13088. ret += ' ';
  13089. if (function_obj.return_dimensions == 1) {
  13090. ret += '[] ';
  13091. } else if (function_obj.return_dimensions == 2) {
  13092. ret += '[][] ';
  13093. }
  13094. ret += function_obj.name + ' ( ';
  13095. for (var j = 0; j < function_obj.parameters_list.length; j++) {
  13096. ret += parametersCode(function_obj.parameters_list[j]);
  13097. if (j + 1 < function_obj.parameters_list.length) {
  13098. ret += ', ';
  13099. }
  13100. }
  13101. ret += ' ) {';
  13102. for (var j = 0; j < function_obj.variables_list.length; j++) {
  13103. ret += variablesCode(function_obj.variables_list[j]);
  13104. }
  13105. for (var j = 0; j < function_obj.commands.length; j++) {
  13106. //try {
  13107. ret += commandsCode(function_obj.commands[j]);
  13108. /*} catch (err) {
  13109. has_error = true;
  13110. console.error(err.message);
  13111. var todos = $('body').find('.command_container');
  13112. for (var i = 0; i < todos.length; i++) {
  13113. if ($(todos[i]).data('command') == function_obj.commands[j]) {
  13114. $( todos[i] ).prepend( ' <i class="ui icon red exclamation triangle error_icon"></i> ' );
  13115. break;
  13116. }
  13117. }
  13118. }*/
  13119. }
  13120. ret += '\n\t}';
  13121. if (has_error) {
  13122. return null;
  13123. } else {
  13124. return ret;
  13125. }
  13126. }
  13127. function commandsCode(command_obj) {
  13128. var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  13129. switch (command_obj.type) {
  13130. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["break"]:
  13131. return breaksCode(command_obj, indentation);
  13132. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].comment:
  13133. return commentsCode(command_obj, indentation);
  13134. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].reader:
  13135. return readersCode(command_obj, indentation);
  13136. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].writer:
  13137. return writersCode(command_obj, indentation);
  13138. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].functioncall:
  13139. return functioncallsCode(command_obj, indentation);
  13140. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].attribution:
  13141. return attributionsCode(command_obj, indentation);
  13142. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].whiletrue:
  13143. return whiletruesCode(command_obj, indentation);
  13144. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].dowhiletrue:
  13145. return doWhilesCode(command_obj, indentation);
  13146. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].iftrue:
  13147. return iftruesCode(command_obj, indentation);
  13148. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].repeatNtimes:
  13149. return repeatNtimesCode(command_obj, indentation);
  13150. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["switch"]:
  13151. return switchsCode(command_obj, indentation);
  13152. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["return"]:
  13153. return returnsCode(command_obj, indentation);
  13154. }
  13155. }
  13156. function returnsCode(command_obj, indentation) {
  13157. var ret = '\n';
  13158. for (var i = 0; i < indentation; i++) {
  13159. ret += '\t';
  13160. }
  13161. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_return');
  13162. if (command_obj.variable_value_menu) {
  13163. try {
  13164. ret += ' ' + elementExpressionCode(command_obj.variable_value_menu); //ret += ' ' + variableValueMenuCode(command_obj.variable_value_menu, true);
  13165. } catch (err) {}
  13166. }
  13167. return ret;
  13168. }
  13169. function breaksCode(command_obj, indentation) {
  13170. var ret = '\n';
  13171. for (var i = 0; i < indentation; i++) {
  13172. ret += '\t';
  13173. }
  13174. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_break');
  13175. return ret;
  13176. }
  13177. function switchsCode(command_obj, indentation) {
  13178. var ret = '\n';
  13179. for (var i = 0; i < indentation; i++) {
  13180. ret += '\t';
  13181. }
  13182. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_code_switch') + ' ( ';
  13183. ret += variableValueMenuCode(command_obj.variable);
  13184. ret += ' ) { ';
  13185. if (command_obj.cases) {
  13186. for (var i = 0; i < command_obj.cases.length; i++) {
  13187. ret += switchcasesCode(command_obj.cases[i], indentation + 1);
  13188. }
  13189. }
  13190. ret += '\n';
  13191. for (var i = 0; i < indentation; i++) {
  13192. ret += '\t';
  13193. }
  13194. ret += '} ';
  13195. return ret;
  13196. }
  13197. function switchcasesCode(switchcase, indentation) {
  13198. var ret = '\n';
  13199. for (var i = 0; i < indentation; i++) {
  13200. ret += '\t';
  13201. }
  13202. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_code_case') + ' ';
  13203. ret += variableValueMenuCode(switchcase.variable_value_menu);
  13204. ret += ' :';
  13205. if (switchcase.commands_block) {
  13206. for (var i = 0; i < switchcase.commands_block.length; i++) {
  13207. ret += commandsCode(switchcase.commands_block[i], indentation + 1);
  13208. }
  13209. }
  13210. return ret;
  13211. }
  13212. function repeatNtimesCode(command_obj, indentation) {
  13213. var ret = '\n';
  13214. for (var i = 0; i < indentation; i++) {
  13215. ret += '\t';
  13216. }
  13217. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_for') + ' ';
  13218. if (command_obj.var_attribution) {
  13219. ret += variableValueMenuCode(command_obj.var_attribution);
  13220. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_code_for_from'), " ");
  13221. ret += variableValueMenuCode(command_obj.expression1);
  13222. }
  13223. if (command_obj.expression2) {
  13224. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_code_for_to'), " ");
  13225. ret += variableValueMenuCode(command_obj.expression2);
  13226. }
  13227. if (command_obj.expression3) {
  13228. ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_code_for_pass'), " ");
  13229. switch (command_obj.expression3.itens[1]) {
  13230. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus:
  13231. ret += ' +';
  13232. break;
  13233. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus:
  13234. ret += ' -';
  13235. break;
  13236. }
  13237. ret += variableValueMenuCode(command_obj.expression3.itens[2]);
  13238. }
  13239. /*if (command_obj.var_incrementation) {
  13240. ret += variableValueMenuCode(command_obj.var_incrementation);
  13241. ret += ' <- ';
  13242. ret += variableValueMenuCode(command_obj.expression3.itens[0]);
  13243. switch (command_obj.expression3.itens[1]) {
  13244. case Models.ARITHMETIC_TYPES.plus:
  13245. ret += ' + ';
  13246. break;
  13247. case Models.ARITHMETIC_TYPES.minus:
  13248. ret += ' - ';
  13249. break;
  13250. case Models.ARITHMETIC_TYPES.multiplication:
  13251. ret += ' * ';
  13252. break;
  13253. case Models.ARITHMETIC_TYPES.division:
  13254. ret += ' / ';
  13255. break;
  13256. case Models.ARITHMETIC_TYPES.module:
  13257. ret += ' % ';
  13258. break;
  13259. }
  13260. ret += variableValueMenuCode(command_obj.expression3.itens[2]);
  13261. }*/
  13262. ret += ' { ';
  13263. if (command_obj.commands_block) {
  13264. for (var i = 0; i < command_obj.commands_block.length; i++) {
  13265. ret += commandsCode(command_obj.commands_block[i], indentation + 1);
  13266. }
  13267. }
  13268. ret += '\n';
  13269. for (var i = 0; i < indentation; i++) {
  13270. ret += '\t';
  13271. }
  13272. ret += '}';
  13273. return ret;
  13274. }
  13275. function iftruesCode(command_obj, indentation) {
  13276. var ret = '\n';
  13277. for (var i = 0; i < indentation; i++) {
  13278. ret += '\t';
  13279. }
  13280. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_if');
  13281. if (!command_obj.expression) {
  13282. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('inform_valid_expression'));
  13283. } else {
  13284. ret += ' ( ';
  13285. ret += elementExpressionCode(command_obj.expression);
  13286. ret += ' ) ';
  13287. }
  13288. /*switch (command_obj.expression.expression.type) {
  13289. case Models.EXPRESSION_TYPES.exp_logic:
  13290. ret += logicExpressionCode(command_obj.expression.expression);
  13291. break;
  13292. case Models.EXPRESSION_TYPES.exp_arithmetic:
  13293. ret += arithmeticExpressionCode(command_obj.expression.expression);
  13294. break;
  13295. }*/
  13296. ret += ' { ';
  13297. if (command_obj.commands_block) {
  13298. for (var i = 0; i < command_obj.commands_block.length; i++) {
  13299. ret += commandsCode(command_obj.commands_block[i], indentation + 1);
  13300. }
  13301. }
  13302. ret += '\n';
  13303. for (var i = 0; i < indentation; i++) {
  13304. ret += '\t';
  13305. }
  13306. ret += '} ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_else') + ' {';
  13307. if (command_obj.commands_else) {
  13308. for (var i = 0; i < command_obj.commands_else.length; i++) {
  13309. ret += commandsCode(command_obj.commands_else[i], indentation + 1);
  13310. }
  13311. }
  13312. ret += '\n';
  13313. for (var i = 0; i < indentation; i++) {
  13314. ret += '\t';
  13315. }
  13316. ret += '}';
  13317. return ret;
  13318. }
  13319. function doWhilesCode(command_obj, indentation) {
  13320. var ret = '\n';
  13321. for (var i = 0; i < indentation; i++) {
  13322. ret += '\t';
  13323. }
  13324. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_code_do') + ' { ';
  13325. if (command_obj.commands_block) {
  13326. for (var i = 0; i < command_obj.commands_block.length; i++) {
  13327. ret += commandsCode(command_obj.commands_block[i], indentation + 1);
  13328. }
  13329. }
  13330. ret += '\n';
  13331. for (var i = 0; i < indentation; i++) {
  13332. ret += '\t';
  13333. }
  13334. ret += '} ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_code_do_until');
  13335. if (!command_obj.expression) {
  13336. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('inform_valid_expression'));
  13337. }
  13338. /*switch (command_obj.expression.expression.type) {
  13339. case Models.EXPRESSION_TYPES.exp_logic:
  13340. ret += logicExpressionCode(command_obj.expression.expression);
  13341. break;
  13342. case Models.EXPRESSION_TYPES.exp_arithmetic:
  13343. ret += arithmeticExpressionCode(command_obj.expression.expression);
  13344. break;
  13345. }*/
  13346. if (command_obj.expression) {
  13347. ret += ' ( ';
  13348. ret += elementExpressionCode(command_obj.expression);
  13349. ret += ' ) ';
  13350. }
  13351. return ret;
  13352. }
  13353. function whiletruesCode(command_obj, indentation) {
  13354. var ret = '\n';
  13355. for (var i = 0; i < indentation; i++) {
  13356. ret += '\t';
  13357. }
  13358. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_code_while');
  13359. if (!command_obj.expression) {
  13360. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('inform_valid_expression'));
  13361. }
  13362. /*switch (command_obj.expression.expression.type) {
  13363. case Models.EXPRESSION_TYPES.exp_logic:
  13364. ret += logicExpressionCode(command_obj.expression.expression);
  13365. break;
  13366. case Models.EXPRESSION_TYPES.exp_arithmetic:
  13367. ret += arithmeticExpressionCode(command_obj.expression.expression);
  13368. break;
  13369. }*/
  13370. if (command_obj.expression) {
  13371. ret += ' ( ';
  13372. ret += elementExpressionCode(command_obj.expression);
  13373. ret += ' ) ';
  13374. }
  13375. ret += ' { ';
  13376. if (command_obj.commands_block) {
  13377. for (var i = 0; i < command_obj.commands_block.length; i++) {
  13378. ret += commandsCode(command_obj.commands_block[i], indentation + 1);
  13379. }
  13380. }
  13381. ret += '\n';
  13382. for (var i = 0; i < indentation; i++) {
  13383. ret += '\t';
  13384. }
  13385. ret += '}';
  13386. return ret;
  13387. }
  13388. function logicExpressionCode(expression) {
  13389. var ret = ' ( ';
  13390. if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  13391. ret += logicExpressionCode(expression.first_operand);
  13392. } else if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  13393. ret += arithmeticExpressionCode(expression.first_operand);
  13394. } else {
  13395. ret += variableValueMenuCode(expression.first_operand);
  13396. }
  13397. if (expression.operator) {
  13398. switch (expression.operator) {
  13399. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to:
  13400. ret += ' == ';
  13401. break;
  13402. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not_equals_to:
  13403. ret += ' != ';
  13404. break;
  13405. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].and:
  13406. ret += ' && ';
  13407. break;
  13408. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].or:
  13409. ret += ' || ';
  13410. break;
  13411. }
  13412. if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  13413. ret += logicExpressionCode(expression.second_operand);
  13414. } else if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  13415. ret += arithmeticExpressionCode(expression.second_operand);
  13416. } else {
  13417. ret += variableValueMenuCode(expression.second_operand);
  13418. }
  13419. }
  13420. ret += ' ) ';
  13421. return ret;
  13422. }
  13423. function arithmeticExpressionCode(expression) {
  13424. var ret = ' ( ';
  13425. if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  13426. ret += logicExpressionCode(expression.first_operand);
  13427. } else if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  13428. ret += arithmeticExpressionCode(expression.first_operand);
  13429. } else {
  13430. ret += variableValueMenuCode(expression.first_operand);
  13431. }
  13432. switch (expression.operator) {
  13433. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than:
  13434. ret += ' > ';
  13435. break;
  13436. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than:
  13437. ret += ' < ';
  13438. break;
  13439. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].equals_to:
  13440. ret += ' == ';
  13441. break;
  13442. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].not_equals_to:
  13443. ret += ' != ';
  13444. break;
  13445. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to:
  13446. ret += ' >= ';
  13447. break;
  13448. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than_or_equals_to:
  13449. ret += ' <= ';
  13450. break;
  13451. }
  13452. if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
  13453. ret += logicExpressionCode(expression.second_operand);
  13454. } else if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
  13455. ret += arithmeticExpressionCode(expression.second_operand);
  13456. } else {
  13457. ret += variableValueMenuCode(expression.second_operand);
  13458. }
  13459. ret += ' ) ';
  13460. return ret;
  13461. }
  13462. function attributionsCode(command_obj, indentation) {
  13463. var ret = '\n';
  13464. for (var i = 0; i < indentation; i++) {
  13465. ret += '\t';
  13466. }
  13467. ret += variableValueMenuCode(command_obj.variable) + ' <- ';
  13468. /*for (var i = 0; i < command_obj.expression.length; i++) {
  13469. ret += elementExpressionCode(command_obj.expression[i]);
  13470. }*/
  13471. ret += elementExpressionCode(command_obj.expression);
  13472. return ret;
  13473. }
  13474. function elementExpressionCode(expression_obj) {
  13475. var ret = '';
  13476. for (var i = 0; i < expression_obj.length; i++) {
  13477. if (expression_obj[i].type) {
  13478. ret += variableValueMenuCode(expression_obj[i]);
  13479. } else if (expression_obj[i].type_op) {
  13480. switch (expression_obj[i].item) {
  13481. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus:
  13482. ret += ' + ';
  13483. break;
  13484. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus:
  13485. ret += ' - ';
  13486. break;
  13487. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].multiplication:
  13488. ret += ' * ';
  13489. break;
  13490. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].division:
  13491. ret += ' / ';
  13492. break;
  13493. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].module:
  13494. ret += ' % ';
  13495. break;
  13496. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to:
  13497. ret += ' == ';
  13498. break;
  13499. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not_equals_to:
  13500. ret += ' != ';
  13501. break;
  13502. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].and:
  13503. ret += ' ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('logic_operator_and') + ' ';
  13504. break;
  13505. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].or:
  13506. ret += ' ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('logic_operator_or') + ' ';
  13507. break;
  13508. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not:
  13509. ret += ' ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('logic_operator_not') + ' ';
  13510. break;
  13511. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than:
  13512. ret += ' > ';
  13513. break;
  13514. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than:
  13515. ret += ' < ';
  13516. break;
  13517. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to:
  13518. ret += ' >= ';
  13519. break;
  13520. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than_or_equals_to:
  13521. ret += ' <= ';
  13522. break;
  13523. }
  13524. } else {
  13525. ret += ' ' + expression_obj[i] + ' ';
  13526. }
  13527. }
  13528. return ret;
  13529. }
  13530. function functioncallsCode(command_obj, indentation) {
  13531. var ret = '\n';
  13532. for (var i = 0; i < indentation; i++) {
  13533. ret += '\t';
  13534. }
  13535. ret += variableValueMenuCode(command_obj.function_called);
  13536. return ret;
  13537. }
  13538. function readersCode(command_obj, indentation) {
  13539. var ret = '\n';
  13540. for (var i = 0; i < indentation; i++) {
  13541. ret += '\t';
  13542. }
  13543. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_command_read') + ' ( ';
  13544. ret += variableValueMenuCode(command_obj.variable_value_menu);
  13545. ret += ' ) ';
  13546. return ret;
  13547. }
  13548. function variableValueMenuCode(variable_obj) {
  13549. var is_return = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  13550. var ret = '';
  13551. try {
  13552. if (variable_obj.function_called) {
  13553. if (variable_obj.function_called.name) {
  13554. ret += variable_obj.function_called.name + ' ( ';
  13555. } else {
  13556. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].translateInternalFunction(variable_obj.function_called.identifier, variable_obj.function_called.category) + ' ( ';
  13557. }
  13558. if (variable_obj.parameters_list) {
  13559. for (var i = 0; i < variable_obj.parameters_list.length; i++) {
  13560. ret += variableValueMenuCode(variable_obj.parameters_list[i]);
  13561. if (i + 1 < variable_obj.parameters_list.length) {
  13562. ret += ', ';
  13563. }
  13564. }
  13565. }
  13566. ret += ' )';
  13567. } else if (variable_obj.content.type) {
  13568. ret += variable_obj.content.name;
  13569. if (variable_obj.content.dimensions == 1 && variable_obj.dimensions != 1) {
  13570. ret += ' [ ' + variableValueMenuCode(variable_obj.column) + ' ] ';
  13571. }
  13572. if (variable_obj.content.dimensions == 2 && variable_obj.dimensions != 2) {
  13573. ret += ' [ ' + variableValueMenuCode(variable_obj.row) + ' ] ';
  13574. ret += ' [ ' + variableValueMenuCode(variable_obj.column) + ' ] ';
  13575. }
  13576. } else {
  13577. if (isNaN(variable_obj.content)) {
  13578. ret += '"' + variable_obj.content + '"';
  13579. } else {
  13580. ret += variable_obj.content;
  13581. }
  13582. }
  13583. } catch (err) {
  13584. if (!is_return) {
  13585. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](variable_obj.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('inform_valid_content'));
  13586. throw err;
  13587. }
  13588. }
  13589. return ret;
  13590. }
  13591. function writersCode(command_obj, indentation) {
  13592. var ret = '\n';
  13593. for (var i = 0; i < indentation; i++) {
  13594. ret += '\t';
  13595. }
  13596. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_command_write') + ' ( ';
  13597. /*for (var i = 0; i < command_obj.content.length; i++) {
  13598. ret += variableValueMenuCode(command_obj.content[i]);
  13599. if ((i + 1) < command_obj.content.length) {
  13600. ret += ' + ';
  13601. }
  13602. }*/
  13603. ret += elementExpressionCode(command_obj.content);
  13604. ret += ' ) ';
  13605. return ret;
  13606. }
  13607. function commentsCode(command_obj, indentation) {
  13608. var ret = '\n';
  13609. for (var i = 0; i < indentation; i++) {
  13610. ret += '\t';
  13611. }
  13612. ret += '// ';
  13613. ret += command_obj.comment_text.content;
  13614. return ret;
  13615. }
  13616. function parametersCode(parameter_obj) {
  13617. var ret = '';
  13618. switch (parameter_obj.type) {
  13619. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  13620. ret += ' ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('type_integer') + ' ';
  13621. break;
  13622. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  13623. ret += ' ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('type_real') + ' ';
  13624. break;
  13625. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  13626. ret += ' ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('type_text') + ' ';
  13627. break;
  13628. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  13629. ret += ' ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('type_boolean') + ' ';
  13630. break;
  13631. }
  13632. ret += parameter_obj.name + '';
  13633. if (parameter_obj.dimensions == 1) {
  13634. ret += ' []';
  13635. } else if (parameter_obj.dimensions == 2) {
  13636. ret += ' [][]';
  13637. }
  13638. return ret;
  13639. }
  13640. function variablesCode(variable_obj) {
  13641. var ret = '';
  13642. var temp = variable_obj;
  13643. ret += '\n\t\t';
  13644. if (temp.is_constant) {
  13645. ret += 'const ';
  13646. }
  13647. switch (temp.type) {
  13648. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  13649. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('type_integer') + ' ';
  13650. break;
  13651. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  13652. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('type_real') + ' ';
  13653. break;
  13654. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  13655. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('type_text') + ' ';
  13656. break;
  13657. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  13658. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('type_boolean') + ' ';
  13659. break;
  13660. }
  13661. ret += temp.name + ' ';
  13662. if (temp.dimensions == 1) {
  13663. ret += '[' + temp.columns + '] ';
  13664. switch (temp.type) {
  13665. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  13666. ret += '<- {';
  13667. for (var j = 0; j < temp.value.length; j++) {
  13668. ret += temp.value[j];
  13669. if (j + 1 < temp.value.length) {
  13670. ret += ', ';
  13671. }
  13672. }
  13673. ret += '}';
  13674. break;
  13675. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  13676. ret += '<- {';
  13677. for (var j = 0; j < temp.value.length; j++) {
  13678. ret += temp.value[j].toFixed(2);
  13679. if (j + 1 < temp.value.length) {
  13680. ret += ', ';
  13681. }
  13682. }
  13683. ret += '}';
  13684. break;
  13685. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  13686. ret += '<- {';
  13687. for (var j = 0; j < temp.value.length; j++) {
  13688. ret += '"' + temp.value[j] + '"';
  13689. if (j + 1 < temp.value.length) {
  13690. ret += ', ';
  13691. }
  13692. }
  13693. ret += '}';
  13694. break;
  13695. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  13696. ret += '<- {';
  13697. for (var j = 0; j < temp.value.length; j++) {
  13698. if (temp.value[j]) {
  13699. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('logic_value_true');
  13700. } else {
  13701. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('logic_value_false');
  13702. }
  13703. if (j + 1 < temp.value.length) {
  13704. ret += ', ';
  13705. }
  13706. }
  13707. ret += '}';
  13708. break;
  13709. }
  13710. } else if (temp.dimensions == 2) {
  13711. ret += '[' + temp.rows + '][' + temp.columns + '] ';
  13712. switch (temp.type) {
  13713. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  13714. ret += '<- {';
  13715. for (var j = 0; j < temp.rows; j++) {
  13716. ret += '{';
  13717. for (var k = 0; k < temp.columns; k++) {
  13718. ret += temp.value[j][k];
  13719. if (k + 1 < temp.columns) {
  13720. ret += ', ';
  13721. }
  13722. }
  13723. ret += '}';
  13724. if (j + 1 < temp.rows) {
  13725. ret += ', ';
  13726. }
  13727. }
  13728. ret += '}';
  13729. break;
  13730. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  13731. ret += '<- {';
  13732. for (var j = 0; j < temp.rows; j++) {
  13733. ret += '{';
  13734. for (var k = 0; k < temp.columns; k++) {
  13735. ret += temp.value[j][k].toFixed(2);
  13736. if (k + 1 < temp.columns) {
  13737. ret += ', ';
  13738. }
  13739. }
  13740. ret += '}';
  13741. if (j + 1 < temp.rows) {
  13742. ret += ', ';
  13743. }
  13744. }
  13745. ret += '}';
  13746. break;
  13747. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  13748. ret += '<- {';
  13749. for (var j = 0; j < temp.rows; j++) {
  13750. ret += '{';
  13751. for (var k = 0; k < temp.columns; k++) {
  13752. ret += '"' + temp.value[j][k] + '"';
  13753. if (k + 1 < temp.columns) {
  13754. ret += ', ';
  13755. }
  13756. }
  13757. ret += '}';
  13758. if (j + 1 < temp.rows) {
  13759. ret += ', ';
  13760. }
  13761. }
  13762. ret += '}';
  13763. break;
  13764. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  13765. ret += '<- {';
  13766. for (var j = 0; j < temp.rows; j++) {
  13767. ret += '{';
  13768. for (var k = 0; k < temp.columns; k++) {
  13769. if (temp.value[j][k]) {
  13770. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('logic_value_true');
  13771. } else {
  13772. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('logic_value_false');
  13773. }
  13774. if (k + 1 < temp.columns) {
  13775. ret += ', ';
  13776. }
  13777. }
  13778. ret += '}';
  13779. if (j + 1 < temp.rows) {
  13780. ret += ', ';
  13781. }
  13782. }
  13783. ret += '}';
  13784. break;
  13785. }
  13786. } else {
  13787. switch (temp.type) {
  13788. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  13789. ret += '<- ' + temp.value;
  13790. break;
  13791. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  13792. ret += '<- ' + temp.value.toFixed(2);
  13793. break;
  13794. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  13795. ret += '<- "' + temp.value + '"';
  13796. break;
  13797. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  13798. ret += '<- ';
  13799. if (temp.value) {
  13800. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('logic_value_true');
  13801. } else {
  13802. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('logic_value_false');
  13803. }
  13804. break;
  13805. }
  13806. }
  13807. return ret;
  13808. }
  13809. function globalsCode() {
  13810. var ret = '';
  13811. if (window.program_obj.globals) {
  13812. for (var i = 0; i < window.program_obj.globals.length; i++) {
  13813. var temp = window.program_obj.globals[i];
  13814. ret += '\n\t';
  13815. if (temp.is_constant) {
  13816. ret += 'const ';
  13817. }
  13818. switch (temp.type) {
  13819. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  13820. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('type_integer');
  13821. break;
  13822. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  13823. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('type_real');
  13824. break;
  13825. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  13826. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('type_text');
  13827. break;
  13828. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  13829. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('type_boolean');
  13830. break;
  13831. }
  13832. ret += ' ' + temp.name + ' ';
  13833. if (temp.dimensions == 1) {
  13834. ret += '[' + temp.columns + '] ';
  13835. switch (temp.type) {
  13836. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  13837. ret += '<- {';
  13838. for (var j = 0; j < temp.value.length; j++) {
  13839. ret += temp.value[j];
  13840. if (j + 1 < temp.value.length) {
  13841. ret += ', ';
  13842. }
  13843. }
  13844. ret += '}';
  13845. break;
  13846. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  13847. ret += '<- {';
  13848. for (var j = 0; j < temp.value.length; j++) {
  13849. ret += temp.value[j].toFixed(2);
  13850. if (j + 1 < temp.value.length) {
  13851. ret += ', ';
  13852. }
  13853. }
  13854. ret += '}';
  13855. break;
  13856. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  13857. ret += '<- {';
  13858. for (var j = 0; j < temp.value.length; j++) {
  13859. ret += '"' + temp.value[j] + '"';
  13860. if (j + 1 < temp.value.length) {
  13861. ret += ', ';
  13862. }
  13863. }
  13864. ret += '}';
  13865. break;
  13866. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  13867. ret += '<- {';
  13868. for (var j = 0; j < temp.value.length; j++) {
  13869. if (temp.value[j]) {
  13870. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('logic_value_true');
  13871. } else {
  13872. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('logic_value_false');
  13873. }
  13874. if (j + 1 < temp.value.length) {
  13875. ret += ', ';
  13876. }
  13877. }
  13878. ret += '}';
  13879. break;
  13880. }
  13881. } else if (temp.dimensions == 2) {
  13882. ret += '[' + temp.rows + '][' + temp.columns + '] ';
  13883. switch (temp.type) {
  13884. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  13885. ret += '<- {';
  13886. for (var j = 0; j < temp.rows; j++) {
  13887. ret += '{';
  13888. for (var k = 0; k < temp.columns; k++) {
  13889. ret += temp.value[j][k];
  13890. if (k + 1 < temp.columns) {
  13891. ret += ', ';
  13892. }
  13893. }
  13894. ret += '}';
  13895. if (j + 1 < temp.rows) {
  13896. ret += ', ';
  13897. }
  13898. }
  13899. ret += '}';
  13900. break;
  13901. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  13902. ret += '<- {';
  13903. for (var j = 0; j < temp.rows; j++) {
  13904. ret += '{';
  13905. for (var k = 0; k < temp.columns; k++) {
  13906. ret += temp.value[j][k].toFixed(2);
  13907. if (k + 1 < temp.columns) {
  13908. ret += ', ';
  13909. }
  13910. }
  13911. ret += '}';
  13912. if (j + 1 < temp.rows) {
  13913. ret += ', ';
  13914. }
  13915. }
  13916. ret += '}';
  13917. break;
  13918. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  13919. ret += '<- {';
  13920. for (var j = 0; j < temp.rows; j++) {
  13921. ret += '{';
  13922. for (var k = 0; k < temp.columns; k++) {
  13923. ret += '"' + temp.value[j][k] + '"';
  13924. if (k + 1 < temp.columns) {
  13925. ret += ', ';
  13926. }
  13927. }
  13928. ret += '}';
  13929. if (j + 1 < temp.rows) {
  13930. ret += ', ';
  13931. }
  13932. }
  13933. ret += '}';
  13934. break;
  13935. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  13936. ret += '<- {';
  13937. for (var j = 0; j < temp.rows; j++) {
  13938. ret += '{';
  13939. for (var k = 0; k < temp.columns; k++) {
  13940. if (temp.value[j][k]) {
  13941. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('logic_value_true');
  13942. } else {
  13943. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('logic_value_false');
  13944. }
  13945. if (k + 1 < temp.columns) {
  13946. ret += ', ';
  13947. }
  13948. }
  13949. ret += '}';
  13950. if (j + 1 < temp.rows) {
  13951. ret += ', ';
  13952. }
  13953. }
  13954. ret += '}';
  13955. break;
  13956. }
  13957. } else {
  13958. switch (temp.type) {
  13959. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
  13960. ret += '<- ' + temp.value;
  13961. break;
  13962. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
  13963. ret += '<- ' + temp.value.toFixed(2);
  13964. break;
  13965. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
  13966. ret += '<- "' + temp.value + '"';
  13967. break;
  13968. case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
  13969. ret += '<- ';
  13970. if (temp.value) {
  13971. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('logic_value_true');
  13972. ;
  13973. } else {
  13974. ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('logic_value_false');
  13975. ;
  13976. }
  13977. break;
  13978. }
  13979. }
  13980. }
  13981. }
  13982. return ret;
  13983. }
  13984. /***/ }),
  13985. /***/ "./js/visualUI/commands.js":
  13986. /*!*********************************!*\
  13987. !*** ./js/visualUI/commands.js ***!
  13988. \*********************************/
  13989. /*! exports provided: removeCommand, createFloatingCommand, renderCommand, genericCreateCommand */
  13990. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13991. "use strict";
  13992. __webpack_require__.r(__webpack_exports__);
  13993. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeCommand", function() { return removeCommand; });
  13994. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  13995. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  13996. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "genericCreateCommand", function() { return genericCreateCommand; });
  13997. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  13998. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  13999. /* harmony import */ var _commands_comment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commands/comment */ "./js/visualUI/commands/comment.js");
  14000. /* harmony import */ var _commands_reader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./commands/reader */ "./js/visualUI/commands/reader.js");
  14001. /* harmony import */ var _commands_writer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./commands/writer */ "./js/visualUI/commands/writer.js");
  14002. /* harmony import */ var _commands_attribution__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./commands/attribution */ "./js/visualUI/commands/attribution.js");
  14003. /* harmony import */ var _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./commands/iftrue */ "./js/visualUI/commands/iftrue.js");
  14004. /* harmony import */ var _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./commands/repeatNtimes */ "./js/visualUI/commands/repeatNtimes.js");
  14005. /* harmony import */ var _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./commands/whiletrue */ "./js/visualUI/commands/whiletrue.js");
  14006. /* harmony import */ var _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./commands/dowhiletrue */ "./js/visualUI/commands/dowhiletrue.js");
  14007. /* harmony import */ var _commands_switch__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./commands/switch */ "./js/visualUI/commands/switch.js");
  14008. /* harmony import */ var _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./commands/functioncall */ "./js/visualUI/commands/functioncall.js");
  14009. /* harmony import */ var _commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./commands/variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  14010. /* harmony import */ var _commands_break__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./commands/break */ "./js/visualUI/commands/break.js");
  14011. /* harmony import */ var _commands_return__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./commands/return */ "./js/visualUI/commands/return.js");
  14012. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  14013. // let has_element_created_draged = false;
  14014. // let which_element_is_draged = null;
  14015. function removeCommand(command, function_obj, dom_obj) {
  14016. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_COMMAND, command.type, '/', 0);
  14017. if (function_obj.commands.indexOf(command) > -1) {
  14018. function_obj.commands.splice(function_obj.commands.indexOf(command), 1);
  14019. return true;
  14020. } // Utilize dois parantNode, pois o primeiro é o div de comandos
  14021. try {
  14022. if (dom_obj.parent().parent().data('command').commands_block.indexOf(command) > -1) {
  14023. dom_obj.parent().parent().data('command').commands_block.splice(dom_obj.parent().parent().data('command').commands_block.indexOf(command), 1);
  14024. return true;
  14025. }
  14026. } catch (err) {}
  14027. try {
  14028. if (dom_obj.parent().parent().data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  14029. if (dom_obj.parent().parent().data('command').commands_else.indexOf(command) > -1) {
  14030. dom_obj.parent().parent().data('command').commands_else.splice(dom_obj.parent().parent().data('command').commands_else.indexOf(command), 1);
  14031. return true;
  14032. }
  14033. }
  14034. } catch (err) {}
  14035. if (dom_obj.parent().data('switchcase')) {
  14036. console.log("o que encontrei: ");
  14037. console.log(dom_obj.parent().data('switchcase'));
  14038. dom_obj.parent().data('switchcase').commands_block.splice(dom_obj.parent().data('switchcase').commands_block.indexOf(command), 1);
  14039. return true;
  14040. }
  14041. return false;
  14042. }
  14043. window.function_container_active = null;
  14044. function createFloatingCommand(function_obj, function_container, command_type, mouse_event) {
  14045. var floatingObject;
  14046. switch (command_type) {
  14047. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  14048. floatingObject = _commands_break__WEBPACK_IMPORTED_MODULE_13__["createFloatingCommand"]();
  14049. break;
  14050. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  14051. floatingObject = _commands_comment__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"]();
  14052. break;
  14053. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  14054. floatingObject = _commands_reader__WEBPACK_IMPORTED_MODULE_3__["createFloatingCommand"]();
  14055. break;
  14056. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  14057. floatingObject = _commands_writer__WEBPACK_IMPORTED_MODULE_4__["createFloatingCommand"]();
  14058. break;
  14059. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  14060. floatingObject = _commands_attribution__WEBPACK_IMPORTED_MODULE_5__["createFloatingCommand"]();
  14061. break;
  14062. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  14063. floatingObject = _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__["createFloatingCommand"]();
  14064. break;
  14065. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  14066. floatingObject = _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__["createFloatingCommand"]();
  14067. break;
  14068. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  14069. floatingObject = _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__["createFloatingCommand"]();
  14070. break;
  14071. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  14072. floatingObject = _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__["createFloatingCommand"]();
  14073. break;
  14074. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  14075. floatingObject = _commands_switch__WEBPACK_IMPORTED_MODULE_10__["createFloatingCommand"]();
  14076. break;
  14077. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  14078. floatingObject = _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__["createFloatingCommand"]();
  14079. break;
  14080. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  14081. floatingObject = _commands_return__WEBPACK_IMPORTED_MODULE_14__["createFloatingCommand"]();
  14082. break;
  14083. }
  14084. floatingObject.draggable().appendTo("body");
  14085. $('body').mouseup(function (evt) {
  14086. manageCommand(function_obj, function_container, evt, command_type);
  14087. $('body').off('mouseup');
  14088. $('body').off('mouseover');
  14089. });
  14090. if (!function_container.hasClass('function_div') || function_container.length < 1) {
  14091. window.mouse_event = mouse_event;
  14092. function_container = $(mouse_event.originalEvent.srcElement.closest('.function_div'));
  14093. }
  14094. console.log('function_container', function_container);
  14095. function_container_active = function_container;
  14096. function_container.find('.commands_list_div').on('mousemove', function (evt) {
  14097. addGhostDiv(evt);
  14098. });
  14099. function_container.find('.commands_list_div').find("*").on('mousemove', function (evt) {
  14100. addGhostDiv(evt);
  14101. });
  14102. function_container.on('mouseout', function (event) {
  14103. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  14104. if (el.closest('.commands_list_div').length < 1) {
  14105. window.ghostDiv.remove();
  14106. }
  14107. });
  14108. floatingObject.css("position", "absolute");
  14109. mouse_event.type = "mousedown.draggable";
  14110. mouse_event.target = floatingObject[0];
  14111. floatingObject.css("left", mouse_event.pageX - window.divx);
  14112. floatingObject.css("top", mouse_event.pageY);
  14113. floatingObject.trigger(mouse_event);
  14114. }
  14115. window.divx = 100;
  14116. window.ghostDiv = $('<div class="ghost_div">');
  14117. window.active_container = null;
  14118. function addGhostToEmptyBlock(element, evt) {
  14119. $('.ghost_div').remove();
  14120. var container = element.closest('.command_container');
  14121. if (container.hasClass('switch')) {
  14122. container = $(evt.target).closest('.case_div');
  14123. }
  14124. if (!container.hasClass('dowhiletrue') && !container.hasClass('iftrue') && !container.hasClass('repeatNtimes') && !container.hasClass('case_div') && !container.hasClass('whiletrue')) {
  14125. addGhostToNotEmptyBlock(element, evt);
  14126. return;
  14127. }
  14128. if (window.active_container != null) {
  14129. if (window.active_container.is(container)) {
  14130. console.log('é o mesmo, não mudou!');
  14131. } else {
  14132. if (container.length < 1) {
  14133. container = element.closest('.commands_list_div');
  14134. if (window.active_container.is(container)) {
  14135. console.log('é o mesmo command list');
  14136. } else {
  14137. console.log('mudou para um command list');
  14138. window.active_container = container;
  14139. }
  14140. } else {
  14141. console.log('mudou para um outro container?');
  14142. }
  14143. }
  14144. }
  14145. window.active_container = container;
  14146. if (container.hasClass('iftrue')) {
  14147. var containerIf = container.find('.commands_if').get(0);
  14148. var containerElse = container.find('.commands_else').get(0);
  14149. var topIfDistance = Math.abs(evt.clientY - containerIf.getBoundingClientRect().top);
  14150. var bottomIfDistance = Math.abs(containerIf.getBoundingClientRect().top + containerIf.getBoundingClientRect().height - evt.clientY);
  14151. var topElseDistance = Math.abs(evt.clientY - containerElse.getBoundingClientRect().top);
  14152. var bottomElseDistance = Math.abs(containerElse.getBoundingClientRect().top + containerElse.getBoundingClientRect().height - evt.clientY);
  14153. if (topIfDistance < topElseDistance && topIfDistance < bottomElseDistance) {
  14154. $(containerIf).append(window.ghostDiv);
  14155. } else {
  14156. $(containerElse).append(window.ghostDiv);
  14157. }
  14158. } else if (container.hasClass('case_div')) {
  14159. container.find('.case_commands_block').append(window.ghostDiv);
  14160. } else {
  14161. container.find('.block_commands').append(window.ghostDiv);
  14162. }
  14163. }
  14164. function addGhostToNotEmptyBlock(element, evt) {
  14165. $('.ghost_div').remove();
  14166. var container = element.closest('.dowhiletrue, .iftrue, .repeatNtimes, .case_div, .whiletrue'); //console.log("\n\nNOT EMPTY: ", container);
  14167. //if (window.active_container != null) {
  14168. //}
  14169. if (container.length < 1) {
  14170. container = element.closest('.commands_list_div');
  14171. window.active_container = container;
  14172. addGhostToFunctionArea(element, evt);
  14173. } else {//console.log('mudou para um outro container?');
  14174. }
  14175. window.active_container = container; // quem está mais próximo? // Essa regra se aplica somente quando o over está sobre um comando
  14176. var allfilhos;
  14177. console.log('olha o container: ', container);
  14178. if (container.hasClass('iftrue')) {
  14179. if ($(evt.target).closest('.data_block_if').length > 0) {
  14180. allfilhos = container.find('.commands_if').children('.command_container');
  14181. } else if ($(evt.target).closest('.data_block_else').length > 0) {
  14182. allfilhos = container.find('.commands_else').children('.command_container');
  14183. } else {
  14184. var containerIf = container.find('.commands_if').get(0);
  14185. var containerElse = container.find('.commands_else').get(0);
  14186. var topIfDistance = Math.abs(evt.clientY - containerIf.getBoundingClientRect().top);
  14187. var bottomIfDistance = Math.abs(containerIf.getBoundingClientRect().top + containerIf.getBoundingClientRect().height - evt.clientY);
  14188. var topElseDistance = Math.abs(evt.clientY - containerElse.getBoundingClientRect().top);
  14189. var bottomElseDistance = Math.abs(containerElse.getBoundingClientRect().top + containerElse.getBoundingClientRect().height - evt.clientY);
  14190. if (topIfDistance < topElseDistance && topIfDistance < bottomElseDistance) {
  14191. allfilhos = $(containerIf).children('.command_container');
  14192. } else {
  14193. allfilhos = $(containerElse).children('.command_container');
  14194. }
  14195. }
  14196. } else if (container.hasClass('case_div')) {
  14197. allfilhos = container.children('.case_commands_block').children('.command_container');
  14198. } else if (container.hasClass('commands_list_div')) {
  14199. allfilhos = container.children('.command_container');
  14200. } else {
  14201. allfilhos = container.children('.block_commands').children('.command_container');
  14202. }
  14203. var topDistances = [];
  14204. var bottomDistances = [];
  14205. for (var i = 0; i < allfilhos.length; i++) {
  14206. var topD = Math.abs(evt.clientY - allfilhos.get(i).getBoundingClientRect().top);
  14207. topDistances.push(topD);
  14208. var botD = Math.abs(allfilhos.get(i).getBoundingClientRect().top + allfilhos.get(i).getBoundingClientRect().height - evt.clientY);
  14209. bottomDistances.push(botD);
  14210. }
  14211. console.log('topDistances\n', topDistances, '\nbottomDistances\n', bottomDistances);
  14212. var menorTop = Math.min.apply(null, topDistances);
  14213. var indiceTop = topDistances.indexOf(menorTop);
  14214. var menorBot = Math.min.apply(null, bottomDistances);
  14215. var indiceBot = bottomDistances.indexOf(menorBot);
  14216. if (menorTop < menorBot) {
  14217. window.ghostDiv.insertBefore($(allfilhos.get(indiceTop)));
  14218. } else {
  14219. window.ghostDiv.insertAfter($(allfilhos.get(indiceBot)));
  14220. }
  14221. console.log('distancias: menorTop ', menorTop, ' menorBot ', menorBot);
  14222. }
  14223. function addGhostToFunctionArea(undermouse, evt) {
  14224. $('.ghost_div').remove();
  14225. var allfilhos = undermouse.closest('.commands_list_div').children('.command_container');
  14226. var topDistances = [];
  14227. var bottomDistances = [];
  14228. for (var i = 0; i < allfilhos.length; i++) {
  14229. var topD = Math.abs(evt.clientY - allfilhos.get(i).getBoundingClientRect().top);
  14230. topDistances.push(topD);
  14231. var botD = Math.abs(allfilhos.get(i).getBoundingClientRect().top + allfilhos.get(i).getBoundingClientRect().height - evt.clientY);
  14232. bottomDistances.push(botD);
  14233. }
  14234. var menorTop = Math.min.apply(null, topDistances);
  14235. var indiceTop = topDistances.indexOf(menorTop);
  14236. var menorBot = Math.min.apply(null, bottomDistances);
  14237. var indiceBot = bottomDistances.indexOf(menorBot);
  14238. if (menorTop < menorBot) {
  14239. window.ghostDiv.insertBefore($(allfilhos.get(indiceTop)));
  14240. } else {
  14241. window.ghostDiv.insertAfter($(allfilhos.get(indiceBot)));
  14242. }
  14243. }
  14244. function addGhostDiv(evt) {
  14245. var undermouse = $(evt.target);
  14246. if (undermouse.hasClass('ghost_div')) {
  14247. return;
  14248. } else if (undermouse.hasClass('commands_list_div')) {
  14249. addGhostToFunctionArea(undermouse, evt);
  14250. return;
  14251. } else if (undermouse.hasClass('block_commands')) {
  14252. if (undermouse.find('.command_container').length > 0) {
  14253. addGhostToNotEmptyBlock(undermouse, evt);
  14254. } else {
  14255. addGhostToEmptyBlock(undermouse, evt);
  14256. }
  14257. } else if (undermouse.hasClass('case_div')) {
  14258. if (undermouse.find('.case_commands_block').find('.command_container').length > 0) {
  14259. addGhostToNotEmptyBlock(undermouse, evt);
  14260. } else {
  14261. addGhostToEmptyBlock(undermouse, evt);
  14262. }
  14263. } else {
  14264. addGhostToNotEmptyBlock(undermouse, evt);
  14265. }
  14266. }
  14267. function borderMouseDragCommand(function_obj, function_container, evt) {
  14268. function_container.find('.over_command_drag').each(function (index) {
  14269. $(this).removeClass('over_command_drag');
  14270. });
  14271. var prev = null;
  14272. function_container.find('.commands_list_div').each(function (index) {
  14273. prev = $(this);
  14274. if (prev) {
  14275. var objLeft = prev.offset().left;
  14276. var objTop = prev.offset().top;
  14277. var objRight = objLeft + prev.width();
  14278. var objBottom = objTop + prev.height();
  14279. if (evt.pageX > objLeft && evt.pageX < objRight && evt.pageY > objTop && evt.pageY < objBottom) {
  14280. prev.addClass("over_command_drag");
  14281. }
  14282. }
  14283. });
  14284. function_container.find('.command_container').each(function (index) {
  14285. var obj = $(this);
  14286. var objLeft = obj.offset().left;
  14287. var objTop = obj.offset().top;
  14288. var objRight = objLeft + obj.width();
  14289. var objBottom = objTop + obj.height();
  14290. if (evt.pageX > objLeft && evt.pageX < objRight && evt.pageY > objTop && evt.pageY < objBottom) {
  14291. if (prev) {
  14292. prev.removeClass('over_command_drag');
  14293. }
  14294. obj.addClass("over_command_drag");
  14295. return;
  14296. }
  14297. });
  14298. } // before_after_inside: 1 -> before, 2 -> after, 3 -> inside
  14299. function renderCommand(command, element_reference, before_after_inside, function_obj) {
  14300. var createdElement;
  14301. switch (command.type) {
  14302. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  14303. createdElement = _commands_comment__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](command, function_obj);
  14304. break;
  14305. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  14306. createdElement = _commands_break__WEBPACK_IMPORTED_MODULE_13__["renderCommand"](command, function_obj);
  14307. break;
  14308. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  14309. createdElement = _commands_reader__WEBPACK_IMPORTED_MODULE_3__["renderCommand"](command, function_obj);
  14310. break;
  14311. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  14312. createdElement = _commands_writer__WEBPACK_IMPORTED_MODULE_4__["renderCommand"](command, function_obj);
  14313. break;
  14314. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  14315. createdElement = _commands_attribution__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](command, function_obj);
  14316. break;
  14317. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  14318. createdElement = _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__["renderCommand"](command, function_obj);
  14319. break;
  14320. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  14321. createdElement = _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__["renderCommand"](command, function_obj);
  14322. break;
  14323. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  14324. createdElement = _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__["renderCommand"](command, function_obj);
  14325. break;
  14326. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  14327. createdElement = _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__["renderCommand"](command, function_obj);
  14328. break;
  14329. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  14330. createdElement = _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__["renderCommand"](command, function_obj);
  14331. break;
  14332. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  14333. createdElement = _commands_switch__WEBPACK_IMPORTED_MODULE_10__["renderCommand"](command, function_obj);
  14334. break;
  14335. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  14336. createdElement = _commands_return__WEBPACK_IMPORTED_MODULE_14__["renderCommand"](command, function_obj);
  14337. break;
  14338. }
  14339. switch (before_after_inside) {
  14340. case 1:
  14341. createdElement.insertBefore(element_reference);
  14342. break;
  14343. case 2:
  14344. createdElement.insertAfter(element_reference);
  14345. break;
  14346. case 3:
  14347. element_reference.append(createdElement);
  14348. break;
  14349. }
  14350. }
  14351. function genericCreateCommand(command_type) {
  14352. switch (command_type) {
  14353. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  14354. return new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["Break"]();
  14355. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
  14356. 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));
  14357. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
  14358. 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));
  14359. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
  14360. 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)]);
  14361. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
  14362. 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), []);
  14363. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
  14364. 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);
  14365. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  14366. 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)]);
  14367. //(var_attribution, var_incrementation, expression1, expression2, expression3, commands_block)
  14368. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  14369. 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);
  14370. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  14371. 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);
  14372. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  14373. 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);
  14374. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  14375. 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))];
  14376. 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);
  14377. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
  14378. 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)]);
  14379. }
  14380. }
  14381. function dragTrash(event) {
  14382. $('.ghost_div').remove();
  14383. var trash = $('<i class="ui icon trash alternate outline"></i>');
  14384. $('body').append(trash);
  14385. trash.css('position', 'absolute');
  14386. trash.css('top', event.clientY);
  14387. trash.css('left', event.clientX - 20);
  14388. trash.css('font-size', '3em');
  14389. trash.css('display', 'none');
  14390. function_container_active.find('.commands_list_div').off('mousemove');
  14391. function_container_active.find('.commands_list_div').find("*").off('mousemove');
  14392. trash.fadeIn(200, function () {
  14393. trash.fadeOut(200, function () {
  14394. trash.remove();
  14395. });
  14396. });
  14397. }
  14398. function findSingleElement(searching, query) {
  14399. if (!searching || !query) {
  14400. return '';
  14401. }
  14402. 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) {
  14403. if (searching.commands_block) {
  14404. return '' + searching.commands_block.indexOf(query);
  14405. } else {
  14406. return '0';
  14407. }
  14408. } else if (searching.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  14409. if (searching.commands_block == null) {
  14410. searching.commands_block = [];
  14411. }
  14412. if (searching.commands_else == null) {
  14413. searching.commands_else = [];
  14414. }
  14415. console.log('\n\nveja onde: ', searching.commands_block, ' \n\nquery: ', query);
  14416. if (searching.commands_block.indexOf(query) >= 0) {
  14417. return 'if[' + searching.commands_block.indexOf(query) + ']';
  14418. } else {
  14419. return 'else[' + searching.commands_else.indexOf(query) + ']';
  14420. }
  14421. } else if (searching.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]) {
  14422. for (var i = 0; i < searching.cases.length; i++) {
  14423. if (searching.cases[i].commands_block.indexOf(query) >= 0) {
  14424. return 'case[' + searching.cases[i].commands_block.indexOf(query) + ']';
  14425. }
  14426. }
  14427. }
  14428. }
  14429. function findPathRecursive(starter_index, hierarquia_bottom_up, function_obj) {
  14430. var index_command = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1;
  14431. var actual = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  14432. var full_path = '';
  14433. for (var i = 0; i <= hierarquia_bottom_up.length; i++) {
  14434. console.log('\n\n:: ', i, ':\n', hierarquia_bottom_up[i]);
  14435. full_path += findSingleElement(hierarquia_bottom_up[i], hierarquia_bottom_up[i + 1]) + '-';
  14436. }
  14437. return full_path;
  14438. }
  14439. function manageCommand(function_obj, function_container, event, command_type) {
  14440. $(".created_element").each(function (index) {
  14441. $(this).remove();
  14442. });
  14443. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  14444. if (el.hasClass('ghost_div')) {
  14445. if (el.closest('.command_container').length < 1) {
  14446. console.log('\n\nvou tentar!!!!');
  14447. console.log(el.closest('.commands_list_div'), '\n\n');
  14448. el.closest('.commands_list_div').css('height', el.closest('.commands_list_div').css('height') + 30); //$('.ghost_div').remove();
  14449. el = el.closest('.commands_list_div');
  14450. }
  14451. }
  14452. console.log('soltou no: ');
  14453. console.log(el);
  14454. console.log(el.data('fun')); // Primeiro verificar se ele soltou no espaço da função correta:
  14455. var hier = el.parentsUntil(".all_functions");
  14456. var esta_correto = false;
  14457. var esta_na_div_correta = false;
  14458. if (el.hasClass("commands_list_div")) {
  14459. esta_na_div_correta = true;
  14460. }
  14461. for (var i = 0; i < hier.length; i++) {
  14462. var temp = $(hier[i]);
  14463. if (temp.hasClass("commands_list_div")) {
  14464. esta_na_div_correta = true;
  14465. }
  14466. if (temp.data('fun') == function_obj) {
  14467. esta_correto = true;
  14468. break;
  14469. }
  14470. }
  14471. if (!esta_correto) {
  14472. // has_element_created_draged = false;
  14473. // which_element_is_draged = null;
  14474. dragTrash(event);
  14475. return;
  14476. } else {
  14477. if (!esta_na_div_correta) {
  14478. // has_element_created_draged = false;
  14479. // which_element_is_draged = null;
  14480. dragTrash(event);
  14481. return;
  14482. }
  14483. }
  14484. var hierarquia_bottom_up = null; // Agora é descobrir qual o escopo para adicionar o comando:
  14485. console.log('ev0'); // Se o elemento clicado possuir o atributo "fun", então, é direto na div dos comandos:
  14486. if (typeof el.data('fun') !== 'undefined') {
  14487. // Se a lista de comandos estiver vazia, então é o primeiro.
  14488. // Portanto, ele deve soltar o elemento obrigatoriamente no objeto vazio
  14489. if (el.data('fun').commands == null || el.data('fun').commands.length == 0) {
  14490. // pode adicionar
  14491. el.data('fun').commands = [];
  14492. var new_cmd = genericCreateCommand(command_type);
  14493. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', 0);
  14494. el.data('fun').commands.push(new_cmd);
  14495. renderCommand(new_cmd, $(function_container).find('.commands_list_div'), 3, function_obj);
  14496. } else {
  14497. // Entra nesse else, caso já existam outros comandos no bloco:
  14498. findNearbyCommandToAddInFunctionScope(el, event, $(function_container).find('.commands_list_div'), function_obj, command_type);
  14499. }
  14500. } else {
  14501. console.log("soltou em um comando"); // descobrir em qual comando ele soltou:
  14502. var hier_find = el.parentsUntil(".commands_list_div");
  14503. hierarquia_bottom_up = [];
  14504. if (typeof el.data('command') !== 'undefined') {
  14505. hierarquia_bottom_up.push(el.data('command'));
  14506. }
  14507. for (var i = 0; i < hier_find.length; i++) {
  14508. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  14509. hierarquia_bottom_up.push($(hier_find[i]).data('command'));
  14510. }
  14511. }
  14512. console.log("comando em que soltou: ");
  14513. console.log(hierarquia_bottom_up[0]);
  14514. console.log("hierarquia de baixo para cima na árvore, de onde ele soltou: ");
  14515. for (var i = 0; i < hierarquia_bottom_up.length; i++) {
  14516. console.log(hierarquia_bottom_up[i]);
  14517. } // Se for do tipo break, verificar se está no contexto correto:
  14518. // Caso não esteja no contexto, apenas retorna sem dar continuidade:
  14519. var is_correct_context = false;
  14520. if (command_type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]) {
  14521. for (var i = 0; i < hierarquia_bottom_up.length; i++) {
  14522. 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"]) {
  14523. is_correct_context = true;
  14524. break;
  14525. }
  14526. }
  14527. if (!is_correct_context) {
  14528. console.error("Context not allowed to insert BREAK COMMAND!");
  14529. return;
  14530. }
  14531. } // se a hierarquia possuir apenas um elemento, então está na raiz dos comandos:
  14532. if (hierarquia_bottom_up.length == 1) {
  14533. console.log('QQ1');
  14534. var sub_elemento = false;
  14535. for (var i = 0; i < hier_find.length; i++) {
  14536. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  14537. console.log('QQ2');
  14538. findBeforeOrAfterCommandToAdd(hier_find[i], event, function_obj, command_type);
  14539. sub_elemento = true;
  14540. break;
  14541. }
  14542. }
  14543. if (!sub_elemento) {
  14544. console.log('QQ3');
  14545. findBeforeOrAfterCommandToAdd(el[0], event, function_obj, command_type);
  14546. }
  14547. } else {
  14548. console.log('QQ4'); // caso exista mais de um elemento na hierarquia:
  14549. if (typeof $(el).data('command') !== 'undefined') {
  14550. console.log('QQ5');
  14551. console.log("PPP1");
  14552. insertCommandInBlockHierar(el[0], event, function_obj, command_type, hier_find, hierarquia_bottom_up);
  14553. } else {
  14554. console.log('QQ6');
  14555. var sub_elemento = false;
  14556. for (var i = 0; i < hier_find.length; i++) {
  14557. if (typeof $(hier_find[i]).data('command') !== 'undefined') {
  14558. console.log('QQ7');
  14559. insertCommandInBlockHierar(hier_find[i], event, function_obj, command_type, hier_find, hierarquia_bottom_up);
  14560. sub_elemento = true;
  14561. break;
  14562. }
  14563. }
  14564. }
  14565. }
  14566. } // has_element_created_draged = false;
  14567. // which_element_is_draged = null;
  14568. if (hierarquia_bottom_up) {
  14569. console.log('\n\n:::índices::\n\n');
  14570. var i = hierarquia_bottom_up.length - 1;
  14571. var starter_index = window.program_obj.functions[window.program_obj.functions.indexOf(function_obj)].commands.indexOf(hierarquia_bottom_up[i]);
  14572. var all_str_path = starter_index + '-' + findPathRecursive(starter_index, hierarquia_bottom_up, function_obj);
  14573. 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);
  14574. console.log('\n\nfull path: \n\n', all_str_path);
  14575. console.log('fim dos índices');
  14576. }
  14577. renderAlgorithm();
  14578. }
  14579. function insertCommandInBlockHierar(el, event, function_obj, command_type, hier_dom, hier_obj) {
  14580. var el_jq = $(el);
  14581. var command_parent = el_jq.data('command');
  14582. 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"]) {
  14583. console.log('QQ17');
  14584. 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) {
  14585. console.log('QQ18'); // Se não tiver outro comando ainda no bloco, só adiciona:
  14586. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  14587. command_parent.commands_block = [];
  14588. var recentComand = genericCreateCommand(command_type);
  14589. command_parent.commands_block.push(recentComand);
  14590. 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);
  14591. renderCommand(recentComand, el_jq.find('.block_commands'), 3, function_obj);
  14592. } else {
  14593. // Se já tem algum comando no bloco:
  14594. findNearbyCommandToAddInBlockScope(el, event, el, function_obj, command_type, command_parent);
  14595. }
  14596. } else {
  14597. // QUANDO FOR BLOCO DO TIPO IF OU SWITCH/CASE:
  14598. addCommandToSwitchCase(event, function_obj, command_type);
  14599. }
  14600. } else {
  14601. console.log('QQ19'); // entra neste bloco, se soltou o comando sobre outro comando dentro de um subbloco:
  14602. findBeforeOrAfterCommandToAddInsertBlock(el, event, function_obj, command_type);
  14603. }
  14604. }
  14605. function findNearbyCommandToAddInBlockScope(el, event, node_list_commands, function_obj, command_type, command_parent) {
  14606. console.log("\n\n\n::COMANDOS:\n\n", el, event, node_list_commands, function_obj, command_type, command_parent);
  14607. var all_sub = $(node_list_commands).find('div.command_container');
  14608. var menor_distancia = 999999999;
  14609. var elemento_menor_distancia = null;
  14610. var antes = true;
  14611. var t_bot;
  14612. var t_top; // Descobrindo o elemento mais próximo:
  14613. for (var i = 0; i < all_sub.length; i++) {
  14614. t_top = all_sub[i].getBoundingClientRect().top;
  14615. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  14616. if (t_top - event.clientY < menor_distancia) {
  14617. menor_distancia = event.clientY - t_top;
  14618. elemento_menor_distancia = all_sub[i];
  14619. }
  14620. }
  14621. 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:
  14622. if (borda_inferior - event.clientY < menor_distancia) {
  14623. var recentComand = genericCreateCommand(command_type);
  14624. command_parent.commands_block.push(recentComand); //
  14625. renderCommand(recentComand, node_list_commands, 3, function_obj);
  14626. } else {
  14627. var recentComand = genericCreateCommand(command_type);
  14628. var index = command_parent.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  14629. if (index > -1) {
  14630. command_parent.commands_block.splice(index, 0, recentComand);
  14631. }
  14632. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  14633. }
  14634. }
  14635. function findBeforeOrAfterCommandToAddInsertBlock(el, event, function_obj, command_type) {
  14636. var el_jq = $(el);
  14637. var command_parent = $(el.parentNode.parentNode).data('command');
  14638. var command_target = el_jq.data('command');
  14639. var temp_parent = $(el.parentNode.parentNode);
  14640. var is_in_else = false;
  14641. if (!command_parent) {
  14642. command_parent = el_jq.data('command');
  14643. temp_parent = el_jq;
  14644. var hier = el_jq.parentsUntil(".command_container");
  14645. for (var i = 0; i < hier.length; i++) {
  14646. var temp = $(hier[i]);
  14647. if (typeof temp.data('else') != 'undefined') {
  14648. is_in_else = true;
  14649. }
  14650. if (typeof temp.data('command') != 'undefined') {
  14651. command_parent = temp.data('command');
  14652. temp_parent = temp;
  14653. }
  14654. }
  14655. }
  14656. var hier = el_jq.parentsUntil(".command_container");
  14657. for (var i = 0; i < hier.length; i++) {
  14658. var temp = $(hier[i]);
  14659. if (typeof temp.data('else') != 'undefined') {
  14660. is_in_else = true;
  14661. }
  14662. }
  14663. if (command_parent == command_target) {
  14664. var hier = el_jq.parentsUntil(".command_container");
  14665. for (var i = 0; i < hier.length; i++) {
  14666. var temp = $(hier[i]);
  14667. if (typeof temp.data('else') !== 'undefined') {
  14668. is_in_else = true;
  14669. break;
  14670. }
  14671. }
  14672. }
  14673. 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"]) {
  14674. var hier = temp_parent.parentsUntil(".all_cases_div");
  14675. console.log("vou procurar!!");
  14676. for (var i = 0; i < hier.length; i++) {
  14677. console.log("estou vasculhando...");
  14678. var temp = $(hier[i]);
  14679. if (typeof temp.data('switchcase') !== 'undefined') {
  14680. console.log("encontrei");
  14681. command_parent = temp.data('switchcase');
  14682. is_in_else = false;
  14683. break;
  14684. }
  14685. }
  14686. }
  14687. console.log('debugging:');
  14688. console.log('el_jq');
  14689. console.log(el_jq);
  14690. console.log('command_parent');
  14691. console.log(command_parent);
  14692. console.log('command_target');
  14693. console.log(command_target);
  14694. var menor_distancia = 999999999;
  14695. var antes = true;
  14696. var t_bot;
  14697. var t_top;
  14698. t_top = el.getBoundingClientRect().top;
  14699. t_bot = el.getBoundingClientRect().top + el.getBoundingClientRect().height;
  14700. var d_top = event.clientY - t_top; // distancia topo
  14701. var d_bot = t_bot - event.clientY; // distancia baixo
  14702. // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  14703. if (d_top < d_bot) {
  14704. var recentComand = genericCreateCommand(command_type);
  14705. console.log('MMM1');
  14706. if (is_in_else) {
  14707. console.log('MMM2');
  14708. if (command_parent == command_target) {
  14709. console.log('MMM3');
  14710. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  14711. command_parent.commands_else = [];
  14712. var recentComand = genericCreateCommand(command_type);
  14713. command_parent.commands_else.push(recentComand);
  14714. renderCommand(recentComand, el_jq, 3, function_obj);
  14715. } else {
  14716. // Se já tem algum comando no bloco:
  14717. findInBlockCorrectPlace(el_jq, event, function_obj, command_type, true);
  14718. }
  14719. return;
  14720. }
  14721. console.log('MMM7');
  14722. var index = command_parent.commands_else.indexOf(command_target);
  14723. if (index > -1) {
  14724. command_parent.commands_else.splice(index, 0, recentComand);
  14725. }
  14726. renderCommand(recentComand, el, 1, function_obj);
  14727. } else {
  14728. console.log('MMM4');
  14729. if (command_parent == command_target) {
  14730. console.log('Nxxxx5');
  14731. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  14732. command_parent.commands_block = [];
  14733. console.log('SSS4');
  14734. var recentComand = genericCreateCommand(command_type);
  14735. command_parent.commands_block.push(recentComand);
  14736. renderCommand(recentComand, el_jq, 3, function_obj);
  14737. } else {
  14738. console.log('SSS5');
  14739. findInBlockCorrectPlace(el_jq, event, function_obj, command_type);
  14740. }
  14741. return;
  14742. }
  14743. console.log('MMM6');
  14744. var index = command_parent.commands_block.indexOf(command_target);
  14745. if (index > -1) {
  14746. command_parent.commands_block.splice(index, 0, recentComand);
  14747. }
  14748. renderCommand(recentComand, el, 1, function_obj);
  14749. }
  14750. } else {
  14751. console.log('XXX1');
  14752. var recentComand = genericCreateCommand(command_type);
  14753. if (is_in_else) {
  14754. if (command_parent == command_target) {
  14755. console.log('MMM3');
  14756. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  14757. command_parent.commands_else = [];
  14758. console.log('SSS1');
  14759. var recentComand = genericCreateCommand(command_type);
  14760. command_parent.commands_else.push(recentComand);
  14761. renderCommand(recentComand, el_jq, 3, function_obj);
  14762. } else {
  14763. // Se já tem algum comando no bloco:
  14764. console.log('SSS2');
  14765. findInBlockCorrectPlace(el_jq, event, function_obj, command_type, true);
  14766. }
  14767. return;
  14768. }
  14769. console.log('XXX2');
  14770. var index = command_parent.commands_else.indexOf(command_target);
  14771. if (index > -1) {
  14772. command_parent.commands_else.splice(index + 1, 0, recentComand);
  14773. }
  14774. renderCommand(recentComand, el, 2, function_obj);
  14775. } else {
  14776. if (command_parent == command_target) {
  14777. console.log('Nxxxx78');
  14778. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  14779. command_parent.commands_block = [];
  14780. var recentComand = genericCreateCommand(command_type);
  14781. command_parent.commands_block.push(recentComand);
  14782. console.log('SSS6');
  14783. renderCommand(recentComand, el_jq, 3, function_obj);
  14784. } else {
  14785. console.log('SSS7');
  14786. findInBlockCorrectPlace(el_jq, event, function_obj, command_type);
  14787. }
  14788. return;
  14789. }
  14790. console.log('XXX3');
  14791. var index = command_parent.commands_block.indexOf(command_target);
  14792. if (index > -1) {
  14793. command_parent.commands_block.splice(index + 1, 0, recentComand);
  14794. }
  14795. renderCommand(recentComand, el, 2, function_obj);
  14796. }
  14797. }
  14798. }
  14799. function insertCommandInBlock(el, event, function_obj, command_type) {
  14800. var el_jq = $(el);
  14801. var command_parent = el_jq.data('command');
  14802. 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) {
  14803. // Se não tiver outro comando ainda no bloco, só adiciona:
  14804. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  14805. command_parent.commands_block = [];
  14806. var recentComand = genericCreateCommand(command_type);
  14807. command_parent.commands_block.push(recentComand);
  14808. renderCommand(recentComand, el_jq.find('.block_commands'), 3, function_obj);
  14809. } else {
  14810. // Se já tem algum comando no bloco:
  14811. findInBlockCorrectPlace(el, event, function_obj, command_type);
  14812. }
  14813. } else if (el_jq.data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
  14814. console.log('QQ9'); // no if ou no else?
  14815. var correct_div = $(document.elementFromPoint(event.pageX, event.pageY));
  14816. var is_in_if = true;
  14817. if (correct_div.data('if')) {
  14818. is_in_if = true;
  14819. } else if (correct_div.data('else')) {
  14820. is_in_if = false;
  14821. } else {
  14822. var hier = correct_div.parentsUntil(".command_container");
  14823. for (var i = 0; i < hier.length; i++) {
  14824. var temp = $(hier[i]);
  14825. if (typeof temp.data('if') !== 'undefined') {
  14826. is_in_if = true;
  14827. break;
  14828. }
  14829. if (typeof temp.data('else') !== 'undefined') {
  14830. is_in_if = false;
  14831. break;
  14832. }
  14833. }
  14834. }
  14835. if (is_in_if) {
  14836. if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
  14837. command_parent.commands_block = [];
  14838. var recentComand = genericCreateCommand(command_type);
  14839. command_parent.commands_block.push(recentComand);
  14840. renderCommand(recentComand, el_jq.find('.commands_if'), 3, function_obj);
  14841. } else {
  14842. // Se já tem algum comando no bloco:
  14843. findInBlockCorrectPlace(el_jq.find('.commands_if'), event, function_obj, command_type);
  14844. }
  14845. } else {
  14846. if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
  14847. command_parent.commands_else = [];
  14848. var recentComand = genericCreateCommand(command_type);
  14849. command_parent.commands_else.push(recentComand);
  14850. renderCommand(recentComand, el_jq.find('.commands_else'), 3, function_obj);
  14851. } else {
  14852. // Se já tem algum comando no bloco:
  14853. findInBlockCorrectPlace(el_jq.find('.commands_else'), event, function_obj, command_type, true);
  14854. }
  14855. }
  14856. } else {
  14857. // é do tipo switch
  14858. console.log("está tentando inserir em um switch que está na raiz!");
  14859. addCommandToSwitchCase(event, function_obj, command_type);
  14860. }
  14861. }
  14862. function addCommandToSwitchCase(event, function_obj, command_type) {
  14863. var el = $(document.elementFromPoint(event.clientX, event.clientY));
  14864. var which_case = el.data('switchcase');
  14865. var case_div = el;
  14866. if (!which_case) {
  14867. var hier_find = el.parentsUntil(".all_cases_div");
  14868. for (var i = 0; i < hier_find.length; i++) {
  14869. if (typeof $(hier_find[i]).data('switchcase') !== 'undefined') {
  14870. which_case = $(hier_find[i]).data('switchcase');
  14871. case_div = $(hier_find[i]);
  14872. break;
  14873. }
  14874. }
  14875. }
  14876. if (which_case.commands_block == null || which_case.commands_block.length < 1) {
  14877. which_case.commands_block = [];
  14878. var recentComand = genericCreateCommand(command_type);
  14879. which_case.commands_block.push(recentComand);
  14880. renderCommand(recentComand, case_div.find('.case_commands_block'), 3, function_obj);
  14881. } else {
  14882. findInBlockCorrectPlaceInSwitchCase(which_case, case_div, event, function_obj, command_type);
  14883. }
  14884. }
  14885. function findInBlockCorrectPlaceInSwitchCase(which_case, case_div, event, function_obj, command_type) {
  14886. var all_sub = case_div.find('div.command_container');
  14887. var menor_distancia = 999999999;
  14888. var elemento_menor_distancia = null;
  14889. var antes = true;
  14890. var t_bot;
  14891. var t_top; // Descobrindo o elemento mais próximo:
  14892. for (var i = 0; i < all_sub.length; i++) {
  14893. t_top = all_sub[i].getBoundingClientRect().top;
  14894. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  14895. if (t_top - event.clientY < menor_distancia) {
  14896. menor_distancia = event.clientY - t_top;
  14897. elemento_menor_distancia = all_sub[i];
  14898. }
  14899. }
  14900. 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:
  14901. if (borda_inferior - event.clientY < menor_distancia) {
  14902. var recentComand = genericCreateCommand(command_type);
  14903. which_case.commands_block.push(recentComand);
  14904. renderCommand(recentComand, $(case_div.find('.case_commands_block')[0]), 3, function_obj);
  14905. } else {
  14906. var recentComand = genericCreateCommand(command_type);
  14907. var index = which_case.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  14908. if (index > -1) {
  14909. which_case.commands_block.splice(index, 0, recentComand);
  14910. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  14911. }
  14912. }
  14913. }
  14914. function findInBlockCorrectPlace(el, event, function_obj, command_type) {
  14915. var is_in_else = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  14916. var el_jq = $(el);
  14917. var all_sub = el_jq.find('div.command_container');
  14918. var menor_distancia = 999999999;
  14919. var elemento_menor_distancia = null;
  14920. var antes = true;
  14921. var t_bot;
  14922. var t_top; // Descobrindo o elemento mais próximo:
  14923. for (var i = 0; i < all_sub.length; i++) {
  14924. t_top = all_sub[i].getBoundingClientRect().top;
  14925. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  14926. if (t_top - event.clientY < menor_distancia) {
  14927. menor_distancia = event.clientY - t_top;
  14928. elemento_menor_distancia = all_sub[i];
  14929. }
  14930. }
  14931. var borda_inferior = elemento_menor_distancia.parentNode.getBoundingClientRect().top + elemento_menor_distancia.parentNode.getBoundingClientRect().height;
  14932. console.log("menor_distancia: ");
  14933. console.log(elemento_menor_distancia); // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  14934. if (borda_inferior - event.clientY < menor_distancia) {
  14935. console.log('QQ11');
  14936. var recentComand = genericCreateCommand(command_type);
  14937. var command_parent = el_jq.data('command');
  14938. if (is_in_else) {
  14939. console.log('QQ15');
  14940. command_parent.commands_else.push(recentComand);
  14941. console.log('el_jq');
  14942. console.log(el_jq);
  14943. console.log("$(el_jq.find('.commands_else')[0]):: ");
  14944. console.log($(el_jq.find('.commands_else')[0]));
  14945. renderCommand(recentComand, el_jq, 3, function_obj);
  14946. } else {
  14947. console.log('QQ16');
  14948. command_parent.commands_block.push(recentComand);
  14949. renderCommand(recentComand, $(el_jq.find('.block_commands')[0]), 3, function_obj);
  14950. }
  14951. } else {
  14952. console.log('QQ12');
  14953. var recentComand = genericCreateCommand(command_type);
  14954. var command_parent = el_jq.data('command');
  14955. if (is_in_else) {
  14956. var index = command_parent.commands_else.indexOf($(elemento_menor_distancia).data('command'));
  14957. if (index > -1) {
  14958. command_parent.commands_else.splice(index, 0, recentComand);
  14959. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  14960. }
  14961. } else {
  14962. var index = command_parent.commands_block.indexOf($(elemento_menor_distancia).data('command'));
  14963. if (index > -1) {
  14964. command_parent.commands_block.splice(index, 0, recentComand);
  14965. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  14966. }
  14967. }
  14968. }
  14969. }
  14970. function findBeforeOrAfterCommandToAdd(el, event, function_obj, command_type) {
  14971. switch ($(el).data('command').type) {
  14972. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
  14973. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
  14974. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
  14975. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
  14976. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
  14977. insertCommandInBlock(el, event, function_obj, command_type);
  14978. return;
  14979. }
  14980. var menor_distancia = 999999999;
  14981. var antes = true;
  14982. var t_bot;
  14983. var t_top;
  14984. t_top = el.getBoundingClientRect().top;
  14985. t_bot = el.getBoundingClientRect().top + el.getBoundingClientRect().height;
  14986. var d_top = event.clientY - t_top; // distancia topo
  14987. var d_bot = t_bot - event.clientY; // distancia baixo
  14988. // Está mais próximo da borda de baixo, ou seja.. inserir por último:
  14989. if (d_top < d_bot) {
  14990. var recentComand = genericCreateCommand(command_type);
  14991. var index = function_obj.commands.indexOf($(el).data('command'));
  14992. if (index > -1) {
  14993. function_obj.commands.splice(index, 0, recentComand);
  14994. }
  14995. renderCommand(recentComand, el, 1, function_obj);
  14996. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  14997. } else {
  14998. var recentComand = genericCreateCommand(command_type);
  14999. var index = function_obj.commands.indexOf($(el).data('command'));
  15000. if (index > -1) {
  15001. function_obj.commands.splice(index + 1, 0, recentComand);
  15002. }
  15003. renderCommand(recentComand, el, 2, function_obj);
  15004. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  15005. }
  15006. }
  15007. function findNearbyCommandToAddInFunctionScope(el, event, node_list_commands, function_obj, command_type) {
  15008. var all_sub = $(node_list_commands).find('div.command_container');
  15009. var menor_distancia = 999999999;
  15010. var elemento_menor_distancia = null;
  15011. var antes = true;
  15012. var t_bot;
  15013. var t_top; // Descobrindo o elemento mais próximo:
  15014. for (var i = 0; i < all_sub.length; i++) {
  15015. t_top = all_sub[i].getBoundingClientRect().top;
  15016. t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
  15017. if (t_top - event.clientY < menor_distancia) {
  15018. menor_distancia = event.clientY - t_top;
  15019. elemento_menor_distancia = all_sub[i];
  15020. }
  15021. }
  15022. 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:
  15023. if (borda_inferior - event.clientY < menor_distancia) {
  15024. var recentComand = genericCreateCommand(command_type);
  15025. function_obj.commands.push(recentComand); //
  15026. renderCommand(recentComand, node_list_commands, 3, function_obj);
  15027. 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);
  15028. } else {
  15029. var recentComand = genericCreateCommand(command_type);
  15030. var index = function_obj.commands.indexOf($(elemento_menor_distancia).data('command'));
  15031. if (index > -1) {
  15032. function_obj.commands.splice(index, 0, recentComand);
  15033. }
  15034. renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
  15035. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
  15036. }
  15037. }
  15038. /***/ }),
  15039. /***/ "./js/visualUI/commands/attribution.js":
  15040. /*!*********************************************!*\
  15041. !*** ./js/visualUI/commands/attribution.js ***!
  15042. \*********************************************/
  15043. /*! exports provided: createFloatingCommand, renderCommand, manageExpressionElements, renderMenuOperations */
  15044. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15045. "use strict";
  15046. __webpack_require__.r(__webpack_exports__);
  15047. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  15048. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  15049. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageExpressionElements", function() { return manageExpressionElements; });
  15050. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenuOperations", function() { return renderMenuOperations; });
  15051. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  15052. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  15053. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  15054. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  15055. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  15056. function createFloatingCommand() {
  15057. return $('<div class="ui attribution created_element"> <i class="ui icon small arrow left"></i> <span> x <&#8212; 1 + 1 </span></div>');
  15058. }
  15059. function renderCommand(command, function_obj) {
  15060. 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>');
  15061. el.data('command', command);
  15062. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.variable, el.find('.var_attributed'), function_obj);
  15063. if (!command.expression || command.expression.length < 1) {
  15064. 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);
  15065. command.expression.push(exp);
  15066. }
  15067. addHandlers(command, function_obj, el);
  15068. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.expression_elements'), command.expression); //renderExpressionElements(command, function_obj, el);
  15069. return el;
  15070. }
  15071. function manageExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, selectedItem, expression_element) {
  15072. var index_to_move = expression_element.itens.indexOf(ref_object);
  15073. switch (selectedItem.data('exp')) {
  15074. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  15075. 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)]);
  15076. expression_element.itens[index_to_move] = exp;
  15077. break;
  15078. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  15079. 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]]);
  15080. expression_element.itens[index_to_move] = exp;
  15081. break;
  15082. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  15083. 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]]);
  15084. expression_element.itens[index_to_move] = exp;
  15085. break;
  15086. }
  15087. renderExpressionElements(command, function_obj, dom_object);
  15088. }
  15089. function renderExpressionElements(command, function_obj, el) {
  15090. var expression_div = el.find('.expression_elements');
  15091. var command_container;
  15092. if (el.hasClass("command_container") == false) {
  15093. var hier = el.parentsUntil(".command_container");
  15094. for (var i = 0; i < hier.length; i++) {
  15095. if ($(hier[i]).hasClass("command_container")) {
  15096. command_container = $(hier[i]);
  15097. break;
  15098. }
  15099. if ($(hier[i]).hasClass("expression_elements")) {
  15100. expression_div = $(hier[i]);
  15101. break;
  15102. }
  15103. }
  15104. }
  15105. if (command_container) {
  15106. expression_div = command_container.find('.expression_elements');
  15107. }
  15108. expression_div.text('');
  15109. for (var i = 0; i < command.expression.length; i++) {
  15110. var temp = $('<div class="expression_element"></div>');
  15111. temp.data('ref_element', command.expression[i]);
  15112. temp.data('ref_index', i);
  15113. expression_div.append(temp);
  15114. renderElement(command, function_obj, temp, command.expression[i]);
  15115. }
  15116. }
  15117. function renderOperator(command, function_obj, temp_op, expression_element, index_op) {
  15118. var context_menu = '<div class="ui dropdown"><div class="text">';
  15119. switch (expression_element.itens[index_op]) {
  15120. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus:
  15121. context_menu += '+';
  15122. break;
  15123. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus:
  15124. context_menu += '-';
  15125. break;
  15126. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication:
  15127. context_menu += '*';
  15128. break;
  15129. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division:
  15130. context_menu += '/';
  15131. break;
  15132. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module:
  15133. context_menu += '%';
  15134. break;
  15135. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].none:
  15136. context_menu += '...';
  15137. break;
  15138. }
  15139. context_menu += '</div><div class="menu">';
  15140. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus + '">+</div>';
  15141. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus + '">-</div>';
  15142. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication + '">*</div>';
  15143. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division + '">/</div>';
  15144. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module + '">%</div>';
  15145. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].none + '" data-text="...">Nenhum</div>';
  15146. context_menu += '</div></div>';
  15147. context_menu = $(context_menu);
  15148. temp_op.append(context_menu);
  15149. context_menu.dropdown({
  15150. onChange: function onChange(value, text, $selectedItem) {
  15151. expression_element.itens[index_op] = value;
  15152. }
  15153. });
  15154. }
  15155. function renderMenuAddExpression(command, function_obj, el, dom_append_menu, expression_append_new_expression) {
  15156. if (el.hasClass("command_container") == false) {
  15157. var hier = el.parentsUntil(".commands_list_div");
  15158. for (var i = 0; i < hier.length; i++) {
  15159. if ($(hier[i]).hasClass("command_container")) {
  15160. el = $(hier[i]);
  15161. break;
  15162. }
  15163. }
  15164. }
  15165. if (dom_append_menu.hasClass("expression_elements") == false) {
  15166. var hier = el.parentsUntil(".commands_list_div");
  15167. for (var i = 0; i < hier.length; i++) {
  15168. if ($(hier[i]).hasClass("expression_elements")) {
  15169. dom_append_menu = $(hier[i]);
  15170. break;
  15171. }
  15172. }
  15173. }
  15174. var context_menu = '<div class="ui dropdown"><div class="text"></div><i class="ui icon arrow alternate circle right outline"></i><div class="menu">';
  15175. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp + '">EXP OP EXP</div>';
  15176. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp + '">OP EXP</div>';
  15177. context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par + '">( EXP )</div>';
  15178. context_menu += '</div></div>';
  15179. context_menu = $(context_menu);
  15180. dom_append_menu.append(context_menu);
  15181. context_menu.dropdown({
  15182. onChange: function onChange(value, text, $selectedItem) {
  15183. switch (value) {
  15184. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  15185. 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)]);
  15186. expression_append_new_expression.push(exp);
  15187. break;
  15188. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  15189. 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)]);
  15190. expression_append_new_expression.push(exp);
  15191. break;
  15192. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  15193. 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)]);
  15194. expression_append_new_expression.push(exp);
  15195. break;
  15196. }
  15197. renderExpressionElements(command, function_obj, el);
  15198. }
  15199. });
  15200. }
  15201. function renderElement(command, function_obj, el, expression_element) {
  15202. switch (expression_element.type_exp) {
  15203. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
  15204. var temp_op = $('<div class="component_element"></div>');
  15205. var temp_exp_1 = $('<div class="component_element"></div>');
  15206. var temp_exp_2 = $('<div class="component_element"></div>');
  15207. el.append(temp_exp_1);
  15208. el.append(temp_op);
  15209. el.append(temp_exp_2);
  15210. if (expression_element.itens[0].type) {
  15211. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[0], temp_exp_1, function_obj, 2, expression_element);
  15212. } else {
  15213. renderElement(command, function_obj, temp_exp_1, expression_element.itens[0]);
  15214. }
  15215. renderOperator(command, function_obj, temp_op, expression_element, 1);
  15216. if (expression_element.itens[2].type) {
  15217. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[2], temp_exp_2, function_obj, 2, expression_element);
  15218. } else {
  15219. renderElement(command, function_obj, temp_exp_2, expression_element.itens[2]);
  15220. }
  15221. break;
  15222. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
  15223. var temp_op = $('<div class="component_element"></div>');
  15224. var temp_exp = $('<div class="component_element"></div>');
  15225. el.append(temp_op);
  15226. el.append(temp_exp);
  15227. renderOperator(command, function_obj, temp_op, expression_element, 0);
  15228. if (expression_element.itens[1].type) {
  15229. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[1], temp_exp, function_obj, 2, expression_element);
  15230. } else {
  15231. renderElement(command, function_obj, temp_exp, expression_element.itens[1]);
  15232. }
  15233. break;
  15234. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
  15235. var temp_par_1 = $('<div class="component_element"> ( </div>');
  15236. var temp_exp = $('<div class="component_element"></div>');
  15237. var temp_par_2 = $('<div class="component_element"> ) </div>');
  15238. el.append(temp_par_1);
  15239. el.append(temp_exp);
  15240. for (var j = 0; j < expression_element.itens.length; j++) {
  15241. if (expression_element.itens[j].type) {
  15242. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[j], temp_exp, function_obj, 2, expression_element);
  15243. } else {
  15244. renderElement(command, function_obj, temp_exp, expression_element.itens[j]);
  15245. }
  15246. } //renderMenuAddExpression(command, function_obj, el, el, expression_element.itens);
  15247. el.append(temp_par_2);
  15248. break;
  15249. }
  15250. }
  15251. function renderExpression(command, function_obj, el) {
  15252. var expression_div = el.find('.expression_elements');
  15253. expression_div.text('');
  15254. var menu_add_item = $('<div class="menu_add_item"></div>');
  15255. menu_add_item.data('index_add', 0);
  15256. expression_div.append(menu_add_item);
  15257. for (var i = 0; i < command.expression.length; i++) {
  15258. if (command.expression[i].type) {
  15259. var temp = $('<div class="expression_element"></div>');
  15260. temp.data('ref_element', command.expression[i]);
  15261. temp.data('ref_index', i);
  15262. expression_div.append(temp);
  15263. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.expression[i], temp, function_obj);
  15264. } else if (command.expression[i] == "(" || command.expression[i] == ")") {
  15265. var temp = $('<div class="expression_element">' + command.expression[i] + '</div>');
  15266. temp.data('ref_element', command.expression[i]);
  15267. temp.data('ref_index', i);
  15268. expression_div.append(temp);
  15269. } else {
  15270. var temp = '<div class="expression_element">';
  15271. switch (command.expression[i]) {
  15272. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus:
  15273. temp += '+';
  15274. break;
  15275. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus:
  15276. temp += '-';
  15277. break;
  15278. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication:
  15279. temp += '*';
  15280. break;
  15281. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division:
  15282. temp += '/';
  15283. break;
  15284. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module:
  15285. temp += '%';
  15286. break;
  15287. }
  15288. temp += '</div>';
  15289. temp = $(temp);
  15290. temp.data('ref_element', command.expression[i]);
  15291. temp.data('ref_index', i);
  15292. expression_div.append(temp);
  15293. }
  15294. var menu_add_item_seq = $('<div class="menu_add_item"></div>');
  15295. var index_temp = i + 1;
  15296. menu_add_item_seq.data('index_add', index_temp);
  15297. expression_div.append(menu_add_item_seq);
  15298. }
  15299. addMenuItens(command, function_obj, el);
  15300. }
  15301. function addMenuItens(command, function_obj, expression_div) {
  15302. var divs_expression = expression_div.find('.menu_add_item');
  15303. for (var i = 0; i < divs_expression.length; i++) {
  15304. var temp = $(divs_expression[i]).data('index_add');
  15305. var context_menu = '<div class="ui dropdown context_menu_clear"><i class="ui icon plus square outline"></i><div class="menu">';
  15306. context_menu += '<div class="item" data-option="value" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_value') + '</div>';
  15307. context_menu += '<div class="item" data-option="operator" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_operator') + '</div>';
  15308. context_menu += '<div class="item" data-option="parentheses" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_parentheses') + '</div>';
  15309. context_menu += '</div></div>';
  15310. context_menu = $(context_menu);
  15311. $(divs_expression[i]).append(context_menu);
  15312. context_menu.dropdown({
  15313. on: 'hover',
  15314. onChange: function onChange(value, text, $selectedItem) {
  15315. switch ($selectedItem.data('option')) {
  15316. case "value":
  15317. 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));
  15318. renderExpression(command, function_obj, expression_div);
  15319. break;
  15320. case "operator":
  15321. command.expression.splice($selectedItem.data('index'), 0, _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus);
  15322. renderExpression(command, function_obj, expression_div);
  15323. break;
  15324. case "parentheses":
  15325. command.expression.splice($selectedItem.data('index'), 0, "(");
  15326. 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));
  15327. command.expression.splice($selectedItem.data('index') + 2, 0, ")");
  15328. renderExpression(command, function_obj, expression_div);
  15329. break;
  15330. }
  15331. }
  15332. });
  15333. }
  15334. }
  15335. function addHandlers(command, function_obj, attribution_dom) {
  15336. attribution_dom.find('.button_remove_command').on('click', function () {
  15337. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, attribution_dom)) {
  15338. attribution_dom.fadeOut(400, function () {
  15339. attribution_dom.remove();
  15340. });
  15341. }
  15342. });
  15343. attribution_dom.find('.button_refresh_attribution').on('click', function () {
  15344. renderExpressionElements(command, function_obj, attribution_dom);
  15345. });
  15346. }
  15347. function renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected) {
  15348. /*console.log("recebido o seguinte DOM: ");
  15349. console.log(dom_object);
  15350. if (dom_object.hasClass('var_attributed')) {
  15351. return;
  15352. } else {
  15353. var hier = dom_object.parentsUntil(".command_container");
  15354. for (var i = 0; i < hier.length; i++) {
  15355. if ($(hier[i]).hasClass('var_attributed') || $(hier[i]).hasClass('parameters_function_called')) {
  15356. return;
  15357. }
  15358. }
  15359. }
  15360. dom_object.find('.context_menu_clear').remove();
  15361. var menu_operations = '<div class="ui dropdown menu_operations"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  15362. for (var tm in Models.ARITHMETIC_TYPES) {
  15363. menu_operations += '<div class="item" data-option="'+tm+'">'+LocalizedStrings.getUI('btn_arithmetic_' + tm)+'</div>';
  15364. }
  15365. menu_operations += '<div class="item" data-option="clear">'+LocalizedStrings.getUI('btn_clear')+'</div>';
  15366. menu_operations += '</div></div>';
  15367. menu_operations = $(menu_operations);
  15368. dom_object.append(menu_operations);
  15369. menu_operations.dropdown({
  15370. onChange: function(value, text, $selectedItem) {
  15371. switch ($($selectedItem).data('option')) {
  15372. case "clear":
  15373. $(dom_object).text('');
  15374. VariableValueMenu.renderMenu(command, ref_object, dom_object, function_obj);
  15375. break;
  15376. default:
  15377. createExpressionAround(command, ref_object, dom_object, function_obj);
  15378. menu_operations.find('.text').text('');
  15379. }
  15380. }
  15381. });*/
  15382. }
  15383. function createExpressionAround(command, ref_object, dom_object, function_obj) {
  15384. $('<span> ( </span>').insertBefore(dom_object);
  15385. $('<span> ) </span>').insertAfter(dom_object);
  15386. _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);
  15387. }
  15388. /***/ }),
  15389. /***/ "./js/visualUI/commands/break.js":
  15390. /*!***************************************!*\
  15391. !*** ./js/visualUI/commands/break.js ***!
  15392. \***************************************/
  15393. /*! exports provided: createFloatingCommand, renderCommand */
  15394. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15395. "use strict";
  15396. __webpack_require__.r(__webpack_exports__);
  15397. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  15398. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  15399. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  15400. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  15401. function createFloatingCommand() {
  15402. 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>');
  15403. }
  15404. function renderCommand(command, function_obj) {
  15405. 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>');
  15406. el.data('command', command);
  15407. addHandlers(command, function_obj, el);
  15408. return el;
  15409. }
  15410. function addHandlers(command, function_obj, break_dom) {
  15411. break_dom.find('.button_remove_command').on('click', function () {
  15412. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, break_dom)) {
  15413. break_dom.fadeOut(400, function () {
  15414. break_dom.remove();
  15415. });
  15416. }
  15417. });
  15418. }
  15419. /***/ }),
  15420. /***/ "./js/visualUI/commands/comment.js":
  15421. /*!*****************************************!*\
  15422. !*** ./js/visualUI/commands/comment.js ***!
  15423. \*****************************************/
  15424. /*! exports provided: createFloatingCommand, renderCommand */
  15425. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15426. "use strict";
  15427. __webpack_require__.r(__webpack_exports__);
  15428. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  15429. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  15430. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  15431. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  15432. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  15433. function createFloatingCommand() {
  15434. 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>');
  15435. }
  15436. function renderCommand(command, function_obj) {
  15437. 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>');
  15438. el.data('command', command);
  15439. addHandlers(command, function_obj, el);
  15440. renderTextComment(command, function_obj, el);
  15441. return el;
  15442. }
  15443. function renderTextComment(command, function_obj, el) {
  15444. _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__["renderMenu"](command, command.comment_text, el.find('.var_value_menu_div'), function_obj, 20);
  15445. }
  15446. function addHandlers(command, function_obj, comment_dom) {
  15447. comment_dom.find('.button_remove_command').on('click', function () {
  15448. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, comment_dom)) {
  15449. comment_dom.fadeOut(400, function () {
  15450. comment_dom.remove();
  15451. });
  15452. }
  15453. });
  15454. }
  15455. /***/ }),
  15456. /***/ "./js/visualUI/commands/conditional_expression.js":
  15457. /*!********************************************************!*\
  15458. !*** ./js/visualUI/commands/conditional_expression.js ***!
  15459. \********************************************************/
  15460. /*! exports provided: renderExpression */
  15461. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15462. "use strict";
  15463. __webpack_require__.r(__webpack_exports__);
  15464. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderExpression", function() { return renderExpression; });
  15465. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  15466. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  15467. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  15468. function renderExpression(command, expression, function_obj, initial_el_to_render) {
  15469. expression.dom_object = initial_el_to_render;
  15470. if (expression.expression == null || expression.expression.length < 1) {
  15471. renderStartMenu(command, expression, function_obj, initial_el_to_render);
  15472. } else {
  15473. var main_div = $('<div class="expression_elements"></div>');
  15474. switch (expression.expression.type) {
  15475. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic:
  15476. renderLogicExpression(command, expression, expression.expression, function_obj, main_div, initial_el_to_render);
  15477. break;
  15478. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic:
  15479. renderArithmeticExpression(command, expression, expression.expression, function_obj, main_div);
  15480. break;
  15481. }
  15482. initial_el_to_render.append(main_div);
  15483. var restartMenu = $('<div class="ui restart_expression"><i class="ui icon undo"></i></div>');
  15484. initial_el_to_render.append(restartMenu);
  15485. restartMenu.on('click', function (e) {
  15486. expression.expression = null;
  15487. initial_el_to_render.empty();
  15488. renderExpression(command, expression, function_obj, initial_el_to_render);
  15489. });
  15490. }
  15491. }
  15492. function renderArithmeticOperator(command, all_expression, expression_arithmetic, arithmetic_operator, function_obj, element_to_append) {
  15493. var menu_operator = $('<div class="ui dropdown"><div class="text"></div><i class="dropdown icon"></i></div>');
  15494. menu_operator.dropdown({
  15495. values: [{
  15496. name: '>',
  15497. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than,
  15498. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than
  15499. }, {
  15500. name: '<',
  15501. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than,
  15502. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than
  15503. }, {
  15504. name: '==',
  15505. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].equals_to,
  15506. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].equals_to
  15507. }, {
  15508. name: '!=',
  15509. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].not_equals_to,
  15510. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].not_equals_to
  15511. }, {
  15512. name: '>=',
  15513. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to,
  15514. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to
  15515. }, {
  15516. name: '<=',
  15517. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than_or_equals_to,
  15518. selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than_or_equals_to
  15519. }],
  15520. onChange: function onChange(value, text, $selectedItem) {
  15521. expression_arithmetic.operator = value;
  15522. }
  15523. });
  15524. element_to_append.append(menu_operator);
  15525. }
  15526. function renderLogicOperator(command, all_expression, expression_logic, logic_operator, function_obj, element_to_append, initial_el_to_render) {
  15527. var menu_operator = $('<div class="ui dropdown"><div class="text"></div><i class="dropdown icon"></i></div>');
  15528. menu_operator.dropdown({
  15529. values: [{
  15530. name: '==',
  15531. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].equals_to,
  15532. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].equals_to
  15533. }, {
  15534. name: '!=',
  15535. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].not_equals_to,
  15536. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].not_equals_to
  15537. }, {
  15538. name: '&&',
  15539. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].and,
  15540. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].and
  15541. }, {
  15542. name: '||',
  15543. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].or,
  15544. selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].or
  15545. }],
  15546. onChange: function onChange(value, text, $selectedItem) {
  15547. if ($selectedItem) {
  15548. expression_logic.operator = value;
  15549. if (expression_logic.second_operand == null) {
  15550. 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);
  15551. initial_el_to_render.empty();
  15552. renderExpression(command, all_expression, function_obj, initial_el_to_render);
  15553. }
  15554. }
  15555. }
  15556. });
  15557. element_to_append.append(menu_operator);
  15558. }
  15559. function renderLogicExpression(command, all_expression, expression_logic, function_obj, element_to_append, initial_el_to_render) {
  15560. var exp_el_par_1 = $(' <span class="span_command_spec"> </span> ');
  15561. var exp_el_expr_el_1 = $('<div class="expression_element"></div>');
  15562. var exp_el_expr_operand = $('<div class="expression_element"></div>');
  15563. var exp_el_expr_el_2 = $('<div class="expression_element"></div>');
  15564. var exp_el_par_2 = $(' <span class="span_command_spec"> </span> ');
  15565. if (expression_logic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  15566. renderLogicExpression(command, all_expression, expression_logic.first_operand, function_obj, exp_el_expr_el_1);
  15567. } else if (expression_logic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  15568. renderArithmeticExpression(command, all_expression, expression_logic.first_operand, function_obj, exp_el_expr_el_1);
  15569. } else {
  15570. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_logic.first_operand, exp_el_expr_el_1, function_obj);
  15571. }
  15572. element_to_append.append(exp_el_par_1);
  15573. element_to_append.append(exp_el_expr_el_1);
  15574. renderLogicOperator(command, all_expression, expression_logic, expression_logic.operator, function_obj, exp_el_expr_operand, initial_el_to_render);
  15575. element_to_append.append(exp_el_expr_operand);
  15576. if (expression_logic.second_operand) {
  15577. if (expression_logic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  15578. renderLogicExpression(command, all_expression, expression_logic.second_operand, function_obj, exp_el_expr_el_2);
  15579. } else if (expression_logic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  15580. renderArithmeticExpression(command, all_expression, expression_logic.second_operand, function_obj, exp_el_expr_el_2);
  15581. } else {
  15582. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_logic.second_operand, exp_el_expr_el_2, function_obj);
  15583. }
  15584. element_to_append.append(exp_el_expr_el_2);
  15585. }
  15586. element_to_append.append(exp_el_par_2);
  15587. }
  15588. function renderArithmeticExpression(command, all_expression, expression_arithmetic, function_obj, element_to_append) {
  15589. var exp_el_par_1 = $(' <span class="span_command_spec"> </span> ');
  15590. var exp_el_expr_el_1 = $('<div class="expression_element"></div>');
  15591. var exp_el_expr_operand = $('<div class="expression_element"></div>');
  15592. var exp_el_expr_el_2 = $('<div class="expression_element"></div>');
  15593. var exp_el_par_2 = $(' <span class="span_command_spec"> </span> ');
  15594. if (expression_arithmetic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  15595. renderLogicExpression(command, all_expression, expression_arithmetic.first_operand, function_obj, exp_el_expr_el_1);
  15596. } else if (expression_arithmetic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  15597. renderArithmeticExpression(command, all_expression, expression_arithmetic.first_operand, function_obj, exp_el_expr_el_1);
  15598. } else {
  15599. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_arithmetic.first_operand, exp_el_expr_el_1, function_obj);
  15600. }
  15601. if (expression_arithmetic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
  15602. renderLogicExpression(command, all_expression, expression_arithmetic.second_operand, function_obj, exp_el_expr_el_2);
  15603. } else if (expression_arithmetic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
  15604. renderArithmeticExpression(command, all_expression, expression_arithmetic.second_operand, function_obj, exp_el_expr_el_2);
  15605. } else {
  15606. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_arithmetic.second_operand, exp_el_expr_el_2, function_obj);
  15607. }
  15608. renderArithmeticOperator(command, all_expression, expression_arithmetic, expression_arithmetic.operator, function_obj, exp_el_expr_operand);
  15609. element_to_append.append(exp_el_par_1);
  15610. element_to_append.append(exp_el_expr_el_1);
  15611. element_to_append.append(exp_el_expr_operand);
  15612. element_to_append.append(exp_el_expr_el_2);
  15613. element_to_append.append(exp_el_par_2);
  15614. }
  15615. function renderStartMenu(command, expression, function_obj, initial_el_to_render) {
  15616. var start_menu = '';
  15617. 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">';
  15618. 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>';
  15619. 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>';
  15620. start_menu += '</div></div>';
  15621. start_menu = $(start_menu);
  15622. start_menu.dropdown({
  15623. onChange: function onChange(value, text, $selectedItem) {
  15624. switch ($selectedItem.data('exp')) {
  15625. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic:
  15626. 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));
  15627. break;
  15628. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic:
  15629. 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);
  15630. break;
  15631. }
  15632. initial_el_to_render.html('');
  15633. renderExpression(command, expression, function_obj, initial_el_to_render);
  15634. },
  15635. selectOnKeydown: false
  15636. });
  15637. initial_el_to_render.append(' <span class="span_command_spec"> </span> ');
  15638. initial_el_to_render.append(start_menu);
  15639. initial_el_to_render.append(' <span class="span_command_spec"> </span> ');
  15640. }
  15641. /***/ }),
  15642. /***/ "./js/visualUI/commands/contextualized_menu.js":
  15643. /*!*****************************************************!*\
  15644. !*** ./js/visualUI/commands/contextualized_menu.js ***!
  15645. \*****************************************************/
  15646. /*! exports provided: renderMenu */
  15647. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15648. "use strict";
  15649. __webpack_require__.r(__webpack_exports__);
  15650. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenu", function() { return renderMenu; });
  15651. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  15652. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  15653. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  15654. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  15655. /* harmony import */ var _switch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./switch */ "./js/visualUI/commands/switch.js");
  15656. function renderMenu(command, dom_where_render, function_obj, dom_command) {
  15657. var menu_div = '<div class="ui dropdown menu_commands" ><i class="icon code"></i> <div class="menu"> ';
  15658. 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) {
  15659. 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>';
  15660. } else {
  15661. 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>';
  15662. 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>';
  15663. }
  15664. menu_div += '</div></div>';
  15665. menu_div = $(menu_div);
  15666. dom_where_render.append(menu_div);
  15667. addHandlers(command, dom_where_render, function_obj, dom_command);
  15668. }
  15669. function addHandlers(command, dom_where_render, function_obj, dom_command) {
  15670. dom_where_render.find('.menu_commands').dropdown({
  15671. on: 'hover'
  15672. });
  15673. dom_where_render.find('.menu_commands a').on('click', function (evt) {
  15674. 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) {
  15675. if (command.commands_block == null || command.commands_block.length == 0) {
  15676. command.commands_block = [];
  15677. var new_cmd = _commands__WEBPACK_IMPORTED_MODULE_2__["genericCreateCommand"]($(this).data('command'));
  15678. command.commands_block.push(new_cmd);
  15679. _commands__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](new_cmd, dom_command.find('.block_commands'), 3, function_obj);
  15680. } else {
  15681. _commands__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"](function_obj, dom_command.find('.block_commands'), $(this).data('command'), evt);
  15682. }
  15683. } else {
  15684. switch ($(this).data('command')) {
  15685. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
  15686. _commands__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"](function_obj, dom_command.find('.block_commands'), $(this).data('command'), evt);
  15687. break;
  15688. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].switchcase:
  15689. addCaseToSwitch(command, dom_where_render, function_obj, dom_command);
  15690. break;
  15691. }
  15692. }
  15693. });
  15694. }
  15695. function addCaseToSwitch(command, dom_where_render, function_obj, dom_command) {
  15696. if (command.cases == null) {
  15697. command.cases = [];
  15698. }
  15699. 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));
  15700. command.cases.push(sc);
  15701. _switch__WEBPACK_IMPORTED_MODULE_4__["renderCase"](sc, command, function_obj, dom_command.find('.all_cases_div'));
  15702. }
  15703. /***/ }),
  15704. /***/ "./js/visualUI/commands/dowhiletrue.js":
  15705. /*!*********************************************!*\
  15706. !*** ./js/visualUI/commands/dowhiletrue.js ***!
  15707. \*********************************************/
  15708. /*! exports provided: createFloatingCommand, renderCommand */
  15709. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15710. "use strict";
  15711. __webpack_require__.r(__webpack_exports__);
  15712. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  15713. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  15714. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  15715. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  15716. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  15717. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  15718. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  15719. function createFloatingCommand() {
  15720. 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>');
  15721. }
  15722. function renderCommand(command, function_obj) {
  15723. var ret = '';
  15724. 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>';
  15725. ret += '<div class="ui block_commands" data-subblock="" data-idcommand="">';
  15726. ret += '</div>';
  15727. 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>';
  15728. ret += '</div>';
  15729. var el = $(ret);
  15730. el.data('command', command);
  15731. el.find('.block_commands').data('command', command);
  15732. addHandlers(command, function_obj, el);
  15733. _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'));
  15734. if (command.expression) {
  15735. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  15736. }
  15737. if (command.commands_block) {
  15738. for (var j = 0; j < command.commands_block.length; j++) {
  15739. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  15740. }
  15741. }
  15742. return el;
  15743. }
  15744. function addHandlers(command, function_obj, dowhiletrue_dom) {
  15745. dowhiletrue_dom.find('.button_remove_command').on('click', function () {
  15746. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, dowhiletrue_dom)) {
  15747. dowhiletrue_dom.fadeOut(400, function () {
  15748. dowhiletrue_dom.remove();
  15749. });
  15750. }
  15751. });
  15752. }
  15753. /***/ }),
  15754. /***/ "./js/visualUI/commands/functioncall.js":
  15755. /*!**********************************************!*\
  15756. !*** ./js/visualUI/commands/functioncall.js ***!
  15757. \**********************************************/
  15758. /*! exports provided: createFloatingCommand, renderCommand */
  15759. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15760. "use strict";
  15761. __webpack_require__.r(__webpack_exports__);
  15762. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  15763. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  15764. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  15765. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  15766. function createFloatingCommand() {
  15767. return $('<div class="ui functioncall created_element"> <i class="hand point right icon"></i> <span> funcao() </span></div>');
  15768. }
  15769. function renderCommand(command, function_obj) {
  15770. 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>');
  15771. el.data('command', command);
  15772. _variable_value_menu__WEBPACK_IMPORTED_MODULE_0__["renderMenu"](command, command.function_called, el.find('.var_value_menu_div'), function_obj);
  15773. addHandlers(command, function_obj, el);
  15774. return el;
  15775. }
  15776. function addHandlers(command, function_obj, functioncall_dom) {
  15777. functioncall_dom.find('.button_remove_command').on('click', function () {
  15778. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, functioncall_dom)) {
  15779. functioncall_dom.fadeOut(400, function () {
  15780. functioncall_dom.remove();
  15781. });
  15782. }
  15783. });
  15784. }
  15785. /***/ }),
  15786. /***/ "./js/visualUI/commands/generic_expression.js":
  15787. /*!****************************************************!*\
  15788. !*** ./js/visualUI/commands/generic_expression.js ***!
  15789. \****************************************************/
  15790. /*! exports provided: renderExpression */
  15791. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15792. "use strict";
  15793. __webpack_require__.r(__webpack_exports__);
  15794. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderExpression", function() { return renderExpression; });
  15795. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types */ "./js/visualUI/types.js");
  15796. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  15797. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  15798. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  15799. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../services/userLog */ "./js/services/userLog.js");
  15800. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  15801. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_5__);
  15802. window.timer = false;
  15803. function renderExpression(command, function_obj, div_to_render, expression_array) {
  15804. div_to_render.empty();
  15805. melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.unwatch(command, "expression");
  15806. melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.watch(command, "expression", function () {
  15807. if (window.timer) return;
  15808. var m = div_to_render.find('.single_element_expression').not('.mouse_distance').not('.add_parentheses');
  15809. var s = "";
  15810. m.each(function (e) {
  15811. if ($(this).hasClass('parentheses_in_expression')) {
  15812. s += $(this).text() + " ";
  15813. } else {
  15814. s += $(this).find('.text').text();
  15815. s += $(this).find('.var_name').text();
  15816. s += $(this).find('.parameters_function_called').text();
  15817. s += $(this).find('.value_rendered').text();
  15818. s += " ";
  15819. }
  15820. });
  15821. if (s) {
  15822. window.timer = true;
  15823. } else {
  15824. return;
  15825. }
  15826. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_COMMAND_EXP, command.type, '/', s);
  15827. setTimeout(function () {
  15828. window.timer = false;
  15829. }, 200);
  15830. }, 20, true);
  15831. if (command.type === _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].attribution) {
  15832. melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.unwatch(command.variable);
  15833. melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.watch(command.variable, function () {
  15834. renderExpression(command, function_obj, div_to_render, expression_array);
  15835. }, 0);
  15836. if (command.variable.content) {
  15837. var types_included = [];
  15838. if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER || command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  15839. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
  15840. } else if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  15841. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional);
  15842. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic);
  15843. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
  15844. } else if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  15845. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional);
  15846. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic);
  15847. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
  15848. } else {
  15849. console.log('NÃO RECONHECI! VEJA: ', command.variable.content.type);
  15850. }
  15851. renderElements(command, function_obj, div_to_render, expression_array, types_included);
  15852. } else {
  15853. div_to_render.text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('var_menu_select_var').toLowerCase());
  15854. }
  15855. } else {
  15856. var types_included = [];
  15857. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional);
  15858. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic);
  15859. types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
  15860. renderElements(command, function_obj, div_to_render, expression_array, types_included);
  15861. }
  15862. div_to_render.children('.mouse_distance').addClass('mouse_distance_hidden');
  15863. div_to_render.children('.higher_element').on('mousemove', function (evt) {
  15864. if (!window.open_or_close) {
  15865. $(this).css('position', 'relative', '!important');
  15866. $(this).children('.mouse_distance').css('opacity', '1');
  15867. }
  15868. });
  15869. div_to_render.children('.higher_element').on('mouseout', function (evt) {
  15870. if (!window.open_or_close) {
  15871. $(this).css('position', 'absolute', '!important');
  15872. $(this).children('.mouse_distance').css('opacity', '0');
  15873. }
  15874. });
  15875. var lixeira = $('<div class="lixeira" draggable="true"></div>');
  15876. div_to_render.find('.single_element_expression').on('mousedown', function (evt) {
  15877. window.posX = evt.clientX;
  15878. window.posY = evt.clientY;
  15879. });
  15880. Sortable.create(div_to_render[0], {
  15881. animation: 100,
  15882. ghostClass: 'ghost',
  15883. group: {
  15884. name: 'shared',
  15885. put: false // Do not allow items to be put into this list
  15886. },
  15887. draggable: '.single_element_expression',
  15888. sort: false,
  15889. filter: '.not_allowed',
  15890. onStart: function onStart() {
  15891. $('body').append(lixeira);
  15892. lixeira.css('display', 'block');
  15893. lixeira.css('top', window.posY + 70, '!important');
  15894. lixeira.css('left', window.posX - 20, '!important');
  15895. },
  15896. onMove: function onMove() {
  15897. lixeira.addClass('color_test');
  15898. },
  15899. onEnd: function onEnd() {
  15900. lixeira.remove();
  15901. div_to_render.find('.ghost').removeClass('ghost');
  15902. }
  15903. });
  15904. new Sortable(lixeira[0], {
  15905. group: 'shared',
  15906. animation: 150,
  15907. onAdd: function onAdd(evt) {
  15908. lixeira.css('display', 'none');
  15909. lixeira.find('.single_element_expression').remove();
  15910. lixeira.css('background-color', '');
  15911. lixeira.remove();
  15912. removeElement(evt, expression_array);
  15913. renderExpression(command, function_obj, div_to_render, expression_array);
  15914. }
  15915. });
  15916. }
  15917. function removeElement(event, expression_array) {
  15918. var indice = $(event.item).data('index');
  15919. var first = expression_array[0];
  15920. console.log('indice: ', indice);
  15921. if (expression_array[indice].type) {
  15922. // if is alone in expression:
  15923. if (expression_array.length == 1) {
  15924. //function_obj.commands.splice(function_obj.commands.indexOf(command), 1);
  15925. expression_array.splice(0, 1);
  15926. } else if (expression_array.length > 1) {
  15927. if (indice > 0 && expression_array[indice - 1].type_op) {
  15928. if (indice < expression_array.length && expression_array[indice - 2] == '(' && expression_array[indice + 1].type_op) {
  15929. expression_array.splice(indice + 1, 1);
  15930. }
  15931. expression_array.splice(indice, 1);
  15932. expression_array.splice(indice - 1, 1);
  15933. if (indice - 2 < expression_array.length && expression_array[indice - 2] == '(' && expression_array[indice - 1] == ')') {
  15934. expression_array.splice(indice - 1, 1);
  15935. expression_array.splice(indice - 2, 1);
  15936. if (indice - 3 >= 0 && indice - 3 < expression_array.length && expression_array[indice - 3].type_op) {
  15937. expression_array.splice(indice - 3, 1);
  15938. }
  15939. }
  15940. } else if (indice < expression_array.length - 1 && expression_array[indice + 1].type_op) {
  15941. expression_array.splice(indice + 1, 1);
  15942. expression_array.splice(indice, 1);
  15943. } else if (indice < expression_array.length - 1 && indice > 0 && expression_array[indice - 1] == '(' && expression_array[indice + 1] == ')') {
  15944. if (indice > 1 && expression_array[indice - 2].type_op) {
  15945. expression_array.splice(indice + 1, 1);
  15946. expression_array.splice(indice, 1);
  15947. expression_array.splice(indice - 1, 1);
  15948. expression_array.splice(indice - 2, 1);
  15949. } else if (indice < expression_array.length - 2 && expression_array[indice + 2].type_op) {
  15950. expression_array.splice(indice + 1, 1);
  15951. expression_array.splice(indice, 1);
  15952. expression_array.splice(indice - 1, 1);
  15953. } else {
  15954. expression_array.splice(indice + 1, 1);
  15955. expression_array.splice(indice, 1);
  15956. expression_array.splice(indice - 1, 1);
  15957. }
  15958. }
  15959. }
  15960. } else if (expression_array[indice].type_op) {// iVProg doesn't support operator remove
  15961. } else {
  15962. var opening = -1;
  15963. var closing = -1;
  15964. if (expression_array[indice] == '(') {
  15965. opening = indice;
  15966. for (var i = indice + 1; i < expression_array.length; i++) {
  15967. if (expression_array[i] == ')') {
  15968. closing = i;
  15969. break;
  15970. }
  15971. }
  15972. } else {
  15973. closing = indice;
  15974. for (var i = indice - 1; i >= 0; i--) {
  15975. if (expression_array[i] == '(') {
  15976. opening = i;
  15977. break;
  15978. }
  15979. }
  15980. }
  15981. if (expression_array[opening + 1].type_op) {
  15982. expression_array.splice(closing, 1);
  15983. expression_array.splice(opening + 1, 1);
  15984. expression_array.splice(opening, 1);
  15985. } else {
  15986. expression_array.splice(closing, 1);
  15987. expression_array.splice(opening, 1);
  15988. }
  15989. } // if expression is empty, add a new var value:
  15990. if (expression_array.length == 0) {
  15991. 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));
  15992. }
  15993. if (first != expression_array[0] && expression_array[0].type_op) {
  15994. expression_array.splice(0, 1);
  15995. }
  15996. }
  15997. function renderElements(command, function_obj, div_to_render, expression_array, types_included) {
  15998. /*if (expression_array.length > 0) {
  15999. if (!expression_array[0].type_op) {
  16000. renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, 0);
  16001. }
  16002. }*/
  16003. var i = 0;
  16004. for (i = 0; i < expression_array.length; i++) {
  16005. if (expression_array[i].type == "var_value") {
  16006. var div_temp = $('<div class="single_element_expression" data-index="' + i + '"></div>');
  16007. if (i == 0) {
  16008. if (expression_array.length > 0 && !expression_array[0].type_op) {//renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, 0);
  16009. }
  16010. }
  16011. _variable_value_menu__WEBPACK_IMPORTED_MODULE_3__["renderMenu"](command, expression_array[i], div_temp, function_obj);
  16012. div_to_render.append(div_temp);
  16013. } else if (expression_array[i] == '(' || expression_array[i] == ')') {
  16014. if (expression_array[i] == ')') {
  16015. renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, i);
  16016. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  16017. } else if (expression_array[i] == '(' && !expression_array[i + 1].type_op) {
  16018. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  16019. renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, i + 1);
  16020. } else {
  16021. renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
  16022. }
  16023. } else {
  16024. if (i == 0) {
  16025. console.log("NEGAÇÃO NO PRIMEIRO ELEMENTO");
  16026. } else if (expression_array[i - 1] == '(') {
  16027. console.log("NEGAÇÃO APÓS O PARÊNTESES");
  16028. }
  16029. renderOperatorMenu(command, function_obj, div_to_render, expression_array[i], types_included, i, expression_array);
  16030. }
  16031. }
  16032. renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, i, true);
  16033. renderAddParenthesis(command, function_obj, div_to_render, expression_array, types_included);
  16034. }
  16035. window.parentheses_activate = false;
  16036. window.open_or_close = null;
  16037. function renderAddParenthesis(command, function_obj, div_to_render, expression_array, types_included) {
  16038. 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>');
  16039. div_to_render.append(addParentheses);
  16040. addParentheses.popup({
  16041. content: "Adicionar parênteses",
  16042. delay: {
  16043. show: 750,
  16044. hide: 0
  16045. }
  16046. });
  16047. addParentheses.on('click', function (mouse_event) {
  16048. // verificar se já está ativado
  16049. if (window.parentheses_activate) {
  16050. return;
  16051. }
  16052. div_to_render.find('.usepointer').off('click');
  16053. window.parentheses_activate = true;
  16054. window.open_or_close = "open";
  16055. div_to_render.find('.dropdown').addClass('disabled');
  16056. div_to_render.find('.ghost_element').addClass('temp_class');
  16057. div_to_render.find('.ghost_element').removeClass('ghost_element');
  16058. var floatingObject = $('<div class="floating_parenthesis"> ( </div>');
  16059. floatingObject.draggable().appendTo("body");
  16060. floatingObject.css("position", "absolute");
  16061. mouse_event.type = "mousedown.draggable";
  16062. mouse_event.target = floatingObject[0];
  16063. floatingObject.css("left", mouse_event.pageX + 10);
  16064. floatingObject.css("top", mouse_event.pageY + 10);
  16065. floatingObject.trigger(mouse_event);
  16066. div_to_render.on('mousemove', function (evt) {
  16067. var actual_target = null;
  16068. if ($(evt.target).hasClass('single_element_expression')) {
  16069. actual_target = $(evt.target);
  16070. } else {
  16071. actual_target = $(evt.target).closest('.single_element_expression');
  16072. }
  16073. 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')) {
  16074. return;
  16075. }
  16076. renderGhostParentheses(actual_target, command, function_obj, div_to_render, expression_array);
  16077. });
  16078. div_to_render.on('mouseleave', function () {
  16079. /*window.open_parentheses.remove();
  16080. window.close_parentheses.remove();*/
  16081. });
  16082. var floating;
  16083. $('body').on('mouseup', function (evt) {
  16084. if (window.open_or_close == "open") {
  16085. window.open_or_close = "close";
  16086. floatingObject.remove();
  16087. var comando_que_esta = $(evt.target).closest('.command_container');
  16088. var comando_certo = div_to_render.closest('.command_container');
  16089. if (!comando_que_esta.is(comando_certo)) {
  16090. window.parentheses_activate = false;
  16091. div_to_render.find('.temp_class').addClass('ghost_element');
  16092. div_to_render.find('.temp_class').removeClass('temp_class');
  16093. div_to_render.off('mousemove');
  16094. div_to_render.off('mouseleave');
  16095. $('body').off('mouseup');
  16096. window.open_parentheses.remove();
  16097. window.close_parentheses.remove();
  16098. window.inserir_open = -1;
  16099. window.inserir_close = -1;
  16100. window.open_or_close = null;
  16101. renderExpression(command, function_obj, div_to_render, expression_array);
  16102. return;
  16103. }
  16104. window.open_parentheses.addClass('parentheses_fixed');
  16105. floating = $('<div class="floating_parenthesis"> ) </div>');
  16106. floating.draggable().appendTo("body");
  16107. floating.css("position", "absolute");
  16108. floating.css("left", evt.pageX + 10);
  16109. floating.css("top", evt.pageY + 10);
  16110. $('body').on('mousemove', function (evts) {
  16111. floating.css("left", evts.pageX + 10);
  16112. floating.css("top", evts.pageY + 10);
  16113. });
  16114. } else {
  16115. floating.remove();
  16116. window.open_parentheses.removeClass('parentheses_fixed');
  16117. div_to_render.off('mousemove');
  16118. div_to_render.off('mouseleave');
  16119. $('body').off('mouseup');
  16120. setTimeout(function () {
  16121. window.parentheses_activate = false;
  16122. }, 50);
  16123. var comando_que_esta = $(evt.target).closest('.command_container');
  16124. var comando_certo = div_to_render.closest('.command_container');
  16125. var is_correct = false;
  16126. if (comando_que_esta.is(comando_certo)) {
  16127. is_correct = true;
  16128. }
  16129. if (is_correct) {
  16130. expression_array.splice(window.inserir_open, 0, '(');
  16131. expression_array.splice(window.inserir_close, 0, ')');
  16132. }
  16133. window.inserir_open = -1;
  16134. window.inserir_close = -1;
  16135. window.open_or_close = null;
  16136. renderExpression(command, function_obj, div_to_render, expression_array);
  16137. }
  16138. });
  16139. });
  16140. }
  16141. window.open_parentheses = $('<div class="parentheses_ghost">(</div>');
  16142. window.close_parentheses = $('<div class="parentheses_ghost">)</div>');
  16143. window.inserir_open = -1;
  16144. window.inserir_close = -1;
  16145. function renderGhostParentheses(actual_target, command, function_obj, div_to_render, expression_array) {
  16146. /*window.open_parentheses.remove();
  16147. window.close_parentheses.remove();*/
  16148. var index_in_array = actual_target.data('index');
  16149. if (expression_array[index_in_array] == '(' || expression_array[index_in_array] == ')') {
  16150. return;
  16151. }
  16152. if (window.open_or_close == "close") {
  16153. if (index_in_array < window.inserir_open) {
  16154. return;
  16155. }
  16156. } // Tratando a situação quando é na primeira posição:
  16157. if (index_in_array == 0) {
  16158. if (expression_array[index_in_array].type == "var_value") {
  16159. if (window.open_or_close == "open") {
  16160. window.open_parentheses.insertBefore(actual_target);
  16161. window.inserir_open = index_in_array;
  16162. }
  16163. /*if (expression_array.length == 1) {
  16164. if (window.open_or_close == "close") {
  16165. window.close_parentheses.insertAfter(actual_target);
  16166. window.inserir_close = index_in_array + 2;
  16167. }*/
  16168. //} else {
  16169. var count_opened = 0;
  16170. var count_closed = 0;
  16171. for (var i = 0; i < expression_array.length; i++) {
  16172. if (expression_array[i] == '(') {
  16173. count_opened++;
  16174. }
  16175. if (expression_array[i] == ')') {
  16176. count_closed++;
  16177. }
  16178. if (count_opened != count_closed) {} else {
  16179. if (count_opened > 0) {
  16180. if (window.open_or_close == "close") {
  16181. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  16182. window.inserir_close = i + 2;
  16183. }
  16184. break;
  16185. } else {
  16186. if (expression_array[i].type == "var_value") {
  16187. if (window.open_or_close == "close") {
  16188. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  16189. window.inserir_close = i + 2;
  16190. }
  16191. break;
  16192. }
  16193. }
  16194. }
  16195. } //}
  16196. } else if (expression_array[index_in_array].type_op) {
  16197. if (window.open_or_close == "open") {
  16198. window.open_parentheses.insertBefore(actual_target);
  16199. window.inserir_open = index_in_array;
  16200. }
  16201. var count_opened = 0;
  16202. var count_closed = 0;
  16203. for (var i = 1; i < expression_array.length; i++) {
  16204. // $('.slide-link[data-slide="0"]')
  16205. if (expression_array[i] == '(') {
  16206. count_opened++;
  16207. }
  16208. if (expression_array[i] == ')') {
  16209. count_closed++;
  16210. }
  16211. if (count_opened != count_closed) {} else {
  16212. if (count_opened > 0) {
  16213. if (expression_array[i].type == "var_value") {
  16214. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  16215. window.inserir_close = i + 2;
  16216. }
  16217. break;
  16218. } else {
  16219. if (expression_array[i].type == "var_value") {
  16220. if (expression_array[i].type == "var_value") {
  16221. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
  16222. window.inserir_close = i + 2;
  16223. }
  16224. break;
  16225. }
  16226. }
  16227. }
  16228. }
  16229. }
  16230. return;
  16231. } // Tratando quando não é no índice 0:
  16232. if (expression_array[index_in_array].type == "var_value") {
  16233. if (window.open_or_close == "open") {
  16234. window.open_parentheses.insertBefore(actual_target);
  16235. window.inserir_open = index_in_array;
  16236. }
  16237. if (window.open_or_close == "close") {
  16238. window.close_parentheses.insertAfter(actual_target);
  16239. window.inserir_close = index_in_array + 2;
  16240. }
  16241. return;
  16242. }
  16243. if (expression_array[index_in_array].type_op) {
  16244. // buscar para a esquerda primeiro:
  16245. if (expression_array[index_in_array - 1] == '(') {
  16246. if (window.open_or_close == "open") {
  16247. window.open_parentheses.insertBefore(actual_target);
  16248. window.inserir_open = index_in_array;
  16249. }
  16250. } else if (expression_array[index_in_array - 1] == ')') {
  16251. // buscar a abertura
  16252. var count_opened = 0;
  16253. var count_closed = 0;
  16254. for (var j = index_in_array - 1; j >= 0; j--) {
  16255. if (expression_array[j] == '(') {
  16256. count_opened++;
  16257. }
  16258. if (expression_array[j] == ')') {
  16259. count_closed++;
  16260. }
  16261. if (count_opened != count_closed) {} else {
  16262. if (count_closed > 0) {
  16263. if (window.open_or_close == "open") {
  16264. window.open_parentheses.insertBefore(div_to_render.find('.single_element_expression[data-index="' + j + '"]'));
  16265. window.inserir_open = j;
  16266. }
  16267. break;
  16268. }
  16269. }
  16270. }
  16271. } else if (expression_array[index_in_array - 1].type == "var_value") {
  16272. if (window.open_or_close == "open") {
  16273. window.open_parentheses.insertBefore(div_to_render.find('.single_element_expression[data-index="' + (index_in_array - 1) + '"]'));
  16274. window.inserir_open = index_in_array - 1;
  16275. }
  16276. } // buscar para a direita agora:
  16277. if (expression_array[index_in_array + 1] == '(') {
  16278. // buscar o fechamento:
  16279. var count_opened = 0;
  16280. var count_closed = 0;
  16281. for (var j = index_in_array + 1; j < expression_array.length; j++) {
  16282. if (expression_array[j] == '(') {
  16283. count_opened++;
  16284. }
  16285. if (expression_array[j] == ')') {
  16286. count_closed++;
  16287. }
  16288. if (count_opened != count_closed) {} else {
  16289. if (count_opened > 0) {
  16290. if (window.open_or_close == "close") {
  16291. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + j + '"]'));
  16292. window.inserir_close = j + 2;
  16293. }
  16294. break;
  16295. }
  16296. }
  16297. }
  16298. } else if (expression_array[index_in_array + 1].type == "var_value") {
  16299. if (window.open_or_close == "close") {
  16300. window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + (index_in_array + 1) + '"]'));
  16301. window.inserir_close = index_in_array + 3;
  16302. }
  16303. }
  16304. }
  16305. }
  16306. function renderParenthesis(div_to_render, expression_content, command, function_obj, position, expression_array) {
  16307. var ghost_parenthesis = $('<div class="single_element_expression parentheses_in_expression" data-index="' + position + '">' + expression_content + '</div>');
  16308. div_to_render.append(ghost_parenthesis);
  16309. }
  16310. function renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, position) {
  16311. var menu_final = '<div class="ui dropdown disabled usepointer"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  16312. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  16313. if (types_included.length > 1) {
  16314. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_arithmetic_expression') + '<div class="menu">';
  16315. menu_final += getArithmeticOperators();
  16316. menu_final += '</div></div>';
  16317. } else {
  16318. menu_final += getArithmeticOperators();
  16319. }
  16320. }
  16321. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  16322. if (types_included.length > 1) {
  16323. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_logic_expression') + '<div class="menu">';
  16324. menu_final += getLogicOperators();
  16325. menu_final += '</div></div>';
  16326. } else {
  16327. menu_final += getLogicOperators();
  16328. }
  16329. }
  16330. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  16331. if (types_included.length > 1) {
  16332. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_relational_expression') + '<div class="menu">';
  16333. menu_final += getRelationalOperators();
  16334. menu_final += '</div></div>';
  16335. } else {
  16336. menu_final += getRelationalOperators();
  16337. }
  16338. }
  16339. menu_final += '</div></div>';
  16340. menu_final = $(menu_final);
  16341. var div_temp = $('<div class="single_element_expression ghost_element mouse_distance"></div>');
  16342. div_temp.append(menu_final);
  16343. var div_higher = $('<div class="higher_element"></div>');
  16344. div_higher.append(div_temp);
  16345. div_to_render.append(div_higher);
  16346. menu_final.dropdown('set selected', _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus);
  16347. div_temp.on('click', function () {
  16348. if (!window.open_or_close) {
  16349. var sera = position;
  16350. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  16351. console.log('p1');
  16352. 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));
  16353. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  16354. console.log('p2');
  16355. 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));
  16356. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  16357. console.log('p3');
  16358. 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));
  16359. }
  16360. renderExpression(command, function_obj, div_to_render, expression_array);
  16361. }
  16362. });
  16363. }
  16364. function renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, position) {
  16365. var is_last = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
  16366. var menu_final = '<div class="ui dropdown disabled usepointer"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  16367. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  16368. if (types_included.length > 1) {
  16369. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_arithmetic_expression') + '<div class="menu">';
  16370. menu_final += getArithmeticOperators();
  16371. menu_final += '</div></div>';
  16372. } else {
  16373. menu_final += getArithmeticOperators();
  16374. }
  16375. }
  16376. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  16377. if (types_included.length > 1) {
  16378. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_logic_expression') + '<div class="menu">';
  16379. menu_final += getLogicOperators();
  16380. menu_final += '</div></div>';
  16381. } else {
  16382. menu_final += getLogicOperators();
  16383. }
  16384. }
  16385. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  16386. if (types_included.length > 1) {
  16387. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_relational_expression') + '<div class="menu">';
  16388. menu_final += getRelationalOperators();
  16389. menu_final += '</div></div>';
  16390. } else {
  16391. menu_final += getRelationalOperators();
  16392. }
  16393. }
  16394. menu_final += '</div></div>';
  16395. menu_final = $(menu_final);
  16396. var div_temp = $('<div class="simple_add mouse_distance"></div>');
  16397. var div_higher = $('<div class="higher_element"></div>');
  16398. var button = $('<button class="ui button green add_expression"><i class="plus circle inverted icon"></i></button>');
  16399. div_temp.append(button);
  16400. if (!is_last) {
  16401. div_higher.append(div_temp);
  16402. div_to_render.append(div_higher); //div_temp.append(menu_final);
  16403. div_temp.css('opacity', '0', '!important');
  16404. } else {
  16405. div_temp.removeClass('mouse_distance');
  16406. div_temp.css('opacity', '1', '!important'); //div_temp.append(menu_final);
  16407. div_to_render.append(div_temp);
  16408. }
  16409. menu_final.dropdown('set selected', _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus);
  16410. div_temp.on('click', function () {
  16411. var sera = position;
  16412. if (expression_array[sera] == ')' && expression_array[sera - 1] == '(') {
  16413. 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));
  16414. renderExpression(command, function_obj, div_to_render, expression_array);
  16415. return;
  16416. }
  16417. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  16418. 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));
  16419. 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));
  16420. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  16421. 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));
  16422. 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));
  16423. } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  16424. 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));
  16425. 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));
  16426. }
  16427. renderExpression(command, function_obj, div_to_render, expression_array);
  16428. });
  16429. }
  16430. function renderOperatorMenu(command, function_obj, div_to_render, expression_element, types_included, position, expression_array) {
  16431. var menu_final = '<div class="ui dropdown"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
  16432. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
  16433. if (types_included.length > 1) {
  16434. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_arithmetic_expression') + '<div class="menu">';
  16435. menu_final += getArithmeticOperators();
  16436. menu_final += '</div></div>';
  16437. } else {
  16438. menu_final += getArithmeticOperators();
  16439. }
  16440. }
  16441. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
  16442. if (types_included.length > 1) {
  16443. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_logic_expression') + '<div class="menu">';
  16444. menu_final += getLogicOperators();
  16445. menu_final += '</div></div>';
  16446. } else {
  16447. menu_final += getLogicOperators();
  16448. }
  16449. }
  16450. if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
  16451. if (types_included.length > 1) {
  16452. menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_relational_expression') + '<div class="menu">';
  16453. menu_final += getRelationalOperators();
  16454. menu_final += '</div></div>';
  16455. } else {
  16456. menu_final += getRelationalOperators();
  16457. }
  16458. }
  16459. menu_final += '</div></div>';
  16460. menu_final = $(menu_final);
  16461. var div_temp = $('<div class="single_element_expression not_allowed" data-index="' + position + '"></div>');
  16462. div_temp.append(menu_final);
  16463. div_to_render.append(div_temp);
  16464. menu_final.dropdown({
  16465. onChange: function onChange(value, text, $selectedItem) {
  16466. expression_element.item = $selectedItem.data('value');
  16467. expression_element.type_op = $selectedItem.data('type');
  16468. }
  16469. });
  16470. menu_final.dropdown('set selected', expression_element.item);
  16471. }
  16472. function getArithmeticOperators() {
  16473. var arithmetic_operators;
  16474. 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>';
  16475. 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>';
  16476. 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>';
  16477. 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>';
  16478. 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>';
  16479. return arithmetic_operators;
  16480. }
  16481. function getLogicOperators() {
  16482. var logic_operators;
  16483. 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>';
  16484. 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>';
  16485. 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>';
  16486. 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>';
  16487. 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>';
  16488. return logic_operators;
  16489. }
  16490. function getRelationalOperators() {
  16491. var relational_operators;
  16492. 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>';
  16493. 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>';
  16494. 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>';
  16495. 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>';
  16496. 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>';
  16497. 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>';
  16498. return relational_operators;
  16499. }
  16500. /***/ }),
  16501. /***/ "./js/visualUI/commands/iftrue.js":
  16502. /*!****************************************!*\
  16503. !*** ./js/visualUI/commands/iftrue.js ***!
  16504. \****************************************/
  16505. /*! exports provided: createFloatingCommand, renderCommand */
  16506. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16507. "use strict";
  16508. __webpack_require__.r(__webpack_exports__);
  16509. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  16510. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  16511. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  16512. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  16513. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  16514. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  16515. function createFloatingCommand() {
  16516. return $('<div class="ui iftrue created_element"> <i class="ui icon small random"></i> <span> if (x < 1) { } </span></div>');
  16517. }
  16518. function renderCommand(command, function_obj) {
  16519. var ret = '';
  16520. 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>';
  16521. ret += '<span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_if') + '</span>';
  16522. ret += ' <span class="span_command_spec"> ( </span> <div class="conditional_expression"></div> <span class="span_command_spec"> ) </span>';
  16523. ret += '<span> </span> ';
  16524. ret += '<div class="ui block_commands commands_if conditional_comands_block" data-if="true">';
  16525. ret += '</div></div>';
  16526. 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>';
  16527. ret += '<div class="ui block_commands commands_else conditional_comands_block" data-else="true">';
  16528. ret += '</div>';
  16529. ret += '<span></span></div>';
  16530. ret += '</div>';
  16531. var el = $(ret);
  16532. el.data('command', command);
  16533. el.find('.block_commands').data('command', command);
  16534. el.find('.data_block_if').data('command', command);
  16535. el.find('.data_block_else').data('command', command);
  16536. el.find('.commands_if').data('command', command);
  16537. addHandlers(command, function_obj, el); //ConditionalExpressionManagement.renderExpression(command, command.expression, function_obj, el.find('.conditional_expression'));
  16538. _generic_expression__WEBPACK_IMPORTED_MODULE_3__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  16539. if (command.commands_block) {
  16540. for (var j = 0; j < command.commands_block.length; j++) {
  16541. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.commands_if')[0]), 3, function_obj);
  16542. }
  16543. }
  16544. if (command.commands_else) {
  16545. for (var j = 0; j < command.commands_else.length; j++) {
  16546. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_else[j], $(el.find('.commands_else')[0]), 3, function_obj);
  16547. }
  16548. }
  16549. return el;
  16550. }
  16551. function addHandlers(command, function_obj, iftrue_dom) {
  16552. iftrue_dom.find('.button_remove_command').on('click', function () {
  16553. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, iftrue_dom)) {
  16554. iftrue_dom.fadeOut(400, function () {
  16555. iftrue_dom.remove();
  16556. });
  16557. }
  16558. });
  16559. }
  16560. /***/ }),
  16561. /***/ "./js/visualUI/commands/reader.js":
  16562. /*!****************************************!*\
  16563. !*** ./js/visualUI/commands/reader.js ***!
  16564. \****************************************/
  16565. /*! exports provided: createFloatingCommand, renderCommand */
  16566. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16567. "use strict";
  16568. __webpack_require__.r(__webpack_exports__);
  16569. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  16570. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  16571. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  16572. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  16573. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  16574. function createFloatingCommand() {
  16575. 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>');
  16576. }
  16577. function renderCommand(command, function_obj) {
  16578. 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>';
  16579. el = $(el);
  16580. el.data('command', command);
  16581. _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__["renderMenu"](command, command.variable_value_menu, el.find('.var_value_menu_div'), function_obj);
  16582. addHandlers(command, function_obj, el);
  16583. return el;
  16584. }
  16585. function addHandlers(command, function_obj, reader_dom) {
  16586. reader_dom.find('.button_remove_command').on('click', function () {
  16587. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, reader_dom)) {
  16588. reader_dom.fadeOut(400, function () {
  16589. reader_dom.remove();
  16590. });
  16591. }
  16592. });
  16593. }
  16594. /***/ }),
  16595. /***/ "./js/visualUI/commands/repeatNtimes.js":
  16596. /*!**********************************************!*\
  16597. !*** ./js/visualUI/commands/repeatNtimes.js ***!
  16598. \**********************************************/
  16599. /*! exports provided: createFloatingCommand, renderCommand, manageExpressionElements, manageClearExpressionElements */
  16600. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16601. "use strict";
  16602. __webpack_require__.r(__webpack_exports__);
  16603. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  16604. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  16605. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageExpressionElements", function() { return manageExpressionElements; });
  16606. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageClearExpressionElements", function() { return manageClearExpressionElements; });
  16607. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  16608. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  16609. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  16610. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  16611. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  16612. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  16613. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  16614. function createFloatingCommand() {
  16615. 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>');
  16616. }
  16617. function renderCommand(command, function_obj) {
  16618. 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>'");
  16619. ret += '<div class="ui block_commands">';
  16620. ret += '</div>';
  16621. ret += '<span> </span>';
  16622. ret += '</div>';
  16623. var el = $(ret);
  16624. el.data('command', command);
  16625. el.find('.block_commands').data('command', command);
  16626. addHandlers(command, function_obj, el);
  16627. _contextualized_menu__WEBPACK_IMPORTED_MODULE_5__["renderMenu"](command, el.find('.context_menu'), function_obj, el);
  16628. _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'));
  16629. _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);
  16630. //VariableValueMenu.renderMenu(command, command.var_incrementation, el.find('.incrementation_variable'), function_obj);
  16631. //angle double right
  16632. if (!command.expression1) {
  16633. 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);
  16634. }
  16635. el.find('.text_receives').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_for_from"));
  16636. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression1, el.find('.var_value_expression'), function_obj);
  16637. if (!command.expression3) {
  16638. 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>');
  16639. el.find('.pass_button').find('button').on('click', function () {
  16640. togglePasso(command);
  16641. });
  16642. /*var exp = new Models.ExpressionElement(Models.EXPRESSION_ELEMENTS.exp_op_exp,
  16643. [command.var_attribution,
  16644. Models.ARITHMETIC_TYPES.plus,
  16645. new Models.VariableValueMenu(VariableValueMenu.VAR_OR_VALUE_TYPES.all, "1", null, null, true)]);
  16646. command.expression3 = exp;
  16647. command.var_incrementation = command.var_attribution;*/
  16648. } else {
  16649. 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>');
  16650. el.find('.pass_button').find('button').on('click', function () {
  16651. togglePasso(command);
  16652. });
  16653. renderOperator(command, function_obj, el.find('.operator'), command.expression3, 1);
  16654. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[2], el.find('.second_operand'), function_obj);
  16655. }
  16656. if (command.commands_block) {
  16657. for (var j = 0; j < command.commands_block.length; j++) {
  16658. _commands__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  16659. }
  16660. }
  16661. return el;
  16662. }
  16663. function togglePasso(command) {
  16664. if (!command.expression3) {
  16665. 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)]);
  16666. command.expression3 = exp;
  16667. command.var_incrementation = command.var_attribution;
  16668. } else {
  16669. command.expression3 = null;
  16670. }
  16671. renderAlgorithm();
  16672. }
  16673. function manageExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element) {
  16674. if (dom_object.hasClass('variable_attribution')) {
  16675. if (!command.expression3) {
  16676. 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)]);
  16677. command.expression3 = exp;
  16678. command.var_incrementation = command.var_attribution;
  16679. 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);
  16680. command.expression2.expression = cond_exp;
  16681. }
  16682. dom_object.parent().find('.text_receives').text('de');
  16683. 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);
  16684. dom_object.parent().find('.var_value_expression').empty();
  16685. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression1, dom_object.parent().find('.var_value_expression'), function_obj);
  16686. renderAlgorithm();
  16687. }
  16688. if (dom_object.hasClass('incrementation_variable')) {
  16689. dom_object.parent().find('.text_inc_receives').text('de');
  16690. 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)]);
  16691. command.expression3 = exp;
  16692. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[0], dom_object.parent().find('.first_operand'), function_obj);
  16693. renderOperator(command, function_obj, dom_object.parent().find('.operator'), command.expression3, 1);
  16694. _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[2], dom_object.parent().find('.second_operand'), function_obj);
  16695. }
  16696. }
  16697. function manageClearExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element) {
  16698. if (dom_object.hasClass('variable_attribution')) {
  16699. $(dom_object).parent().find('.text_receives').text('');
  16700. command.expression1 = null;
  16701. $(dom_object).parent().find('.var_value_expression').empty();
  16702. }
  16703. if (dom_object.hasClass('incrementation_variable')) {
  16704. $(dom_object).parent().find('.text_inc_receives').text('');
  16705. command.expression3 = null;
  16706. $(dom_object).parent().find('.first_operand').empty();
  16707. $(dom_object).parent().find('.operator').empty();
  16708. $(dom_object).parent().find('.second_operand').empty();
  16709. }
  16710. }
  16711. function addHandlers(command, function_obj, repeatNtimes_dom) {
  16712. repeatNtimes_dom.find('.button_remove_command').on('click', function () {
  16713. if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, repeatNtimes_dom)) {
  16714. repeatNtimes_dom.fadeOut(400, function () {
  16715. repeatNtimes_dom.remove();
  16716. });
  16717. }
  16718. });
  16719. }
  16720. function renderOperator(command, function_obj, temp_op, expression_element, index_op) {
  16721. var menu_operator = $('<div class="ui dropdown"><div class="text"></div></div>');
  16722. menu_operator.dropdown({
  16723. values: [{
  16724. name: '+',
  16725. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus,
  16726. selected: expression_element.itens[index_op] == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus
  16727. }, {
  16728. name: '-',
  16729. value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus,
  16730. selected: expression_element.itens[index_op] == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus
  16731. }],
  16732. onChange: function onChange(value, text, $selectedItem) {
  16733. expression_element.itens[index_op] = value;
  16734. }
  16735. });
  16736. temp_op.append(menu_operator);
  16737. }
  16738. /***/ }),
  16739. /***/ "./js/visualUI/commands/return.js":
  16740. /*!****************************************!*\
  16741. !*** ./js/visualUI/commands/return.js ***!
  16742. \****************************************/
  16743. /*! exports provided: createFloatingCommand, renderCommand */
  16744. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16745. "use strict";
  16746. __webpack_require__.r(__webpack_exports__);
  16747. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  16748. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  16749. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types */ "./js/visualUI/types.js");
  16750. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  16751. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  16752. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  16753. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  16754. function createFloatingCommand() {
  16755. 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>');
  16756. }
  16757. function renderCommand(command, function_obj) {
  16758. 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>');
  16759. el.data('command', command);
  16760. addHandlers(command, function_obj, el);
  16761. if (function_obj.return_type != _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID) {
  16762. //VariableValueMenu.renderMenu(command, command.variable_value_menu, el.find('.var_value_menu_div'), function_obj);
  16763. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.expression_elements'), command.variable_value_menu);
  16764. } else {
  16765. el.find('.expression_elements').remove();
  16766. command.variable_value_menu = null;
  16767. }
  16768. return el;
  16769. }
  16770. function addHandlers(command, function_obj, return_dom) {
  16771. return_dom.find('.button_remove_command').on('click', function () {
  16772. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, return_dom)) {
  16773. return_dom.fadeOut(400, function () {
  16774. return_dom.remove();
  16775. });
  16776. }
  16777. });
  16778. }
  16779. /***/ }),
  16780. /***/ "./js/visualUI/commands/switch.js":
  16781. /*!****************************************!*\
  16782. !*** ./js/visualUI/commands/switch.js ***!
  16783. \****************************************/
  16784. /*! exports provided: createFloatingCommand, renderCommand, renderCase */
  16785. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16786. "use strict";
  16787. __webpack_require__.r(__webpack_exports__);
  16788. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  16789. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  16790. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCase", function() { return renderCase; });
  16791. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  16792. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  16793. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  16794. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  16795. function createFloatingCommand() {
  16796. 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>');
  16797. }
  16798. function renderCommand(command, function_obj) {
  16799. var ret = '';
  16800. 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>';
  16801. ret += '</div>';
  16802. var el = $(ret);
  16803. el.data('command', command);
  16804. addHandlers(command, function_obj, el);
  16805. _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__["renderMenu"](command, el.find('.context_menu'), function_obj, el);
  16806. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.variable, el.find('.variable_to_switch'), function_obj);
  16807. if (command.cases) {
  16808. for (var i = 0; i < command.cases.length; i++) {
  16809. renderCase(command.cases[i], command, function_obj, el.find('.all_cases_div'));
  16810. }
  16811. }
  16812. return el;
  16813. }
  16814. function renderCase(switchcase, command, function_obj, el) {
  16815. 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>');
  16816. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, switchcase.variable_value_menu, casediv.find('.variable_case'), function_obj);
  16817. casediv.data('switchcase', switchcase);
  16818. casediv.find('.case_commands_block').data('switchcase', switchcase);
  16819. el.append(casediv);
  16820. if (switchcase.commands_block) {
  16821. for (var j = 0; j < switchcase.commands_block.length; j++) {
  16822. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](switchcase.commands_block[j], $(casediv.find('.case_commands_block')[0]), 3, function_obj);
  16823. }
  16824. }
  16825. casediv.find('.button_remove_command').on('click', function () {
  16826. for (var i = 0; i < command.cases.length; i++) {
  16827. if (switchcase == command.cases[i]) {
  16828. delete command.cases[i];
  16829. command.cases.splice(i, 1);
  16830. casediv.remove();
  16831. break;
  16832. }
  16833. }
  16834. });
  16835. }
  16836. function addHandlers(command, function_obj, switch_dom) {
  16837. switch_dom.find('.button_remove_command').on('click', function () {
  16838. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, switch_dom)) {
  16839. switch_dom.fadeOut(400, function () {
  16840. switch_dom.remove();
  16841. });
  16842. }
  16843. });
  16844. }
  16845. /***/ }),
  16846. /***/ "./js/visualUI/commands/variable_value_menu.js":
  16847. /*!*****************************************************!*\
  16848. !*** ./js/visualUI/commands/variable_value_menu.js ***!
  16849. \*****************************************************/
  16850. /*! exports provided: VAR_OR_VALUE_TYPES, renderMenu */
  16851. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16852. "use strict";
  16853. __webpack_require__.r(__webpack_exports__);
  16854. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VAR_OR_VALUE_TYPES", function() { return VAR_OR_VALUE_TYPES; });
  16855. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenu", function() { return renderMenu; });
  16856. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  16857. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  16858. /* harmony import */ var _attribution__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./attribution */ "./js/visualUI/commands/attribution.js");
  16859. /* harmony import */ var _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./repeatNtimes */ "./js/visualUI/commands/repeatNtimes.js");
  16860. var VAR_OR_VALUE_TYPES = Object.freeze({
  16861. only_variable: 1,
  16862. only_value: 2,
  16863. only_function: 3,
  16864. variable_and_function: 4,
  16865. variable_and_value_opt: 5,
  16866. value_and_function: 6,
  16867. all: 7
  16868. });
  16869. function renderMenu(command, ref_object, dom_object, function_obj) {
  16870. var size_field = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 2;
  16871. var expression_element = arguments.length > 5 ? arguments[5] : undefined;
  16872. // Verificar se o objeto atual trata-se de uma chamada de função e conferir se possui a quantidade correta de parâmetros
  16873. // Caso não possua, tem que adicionar as variáveis que servirão de parâmetros:
  16874. if (ref_object.function_called) {
  16875. if (ref_object.function_called.parameters_list) {
  16876. while (ref_object.function_called.parameters_list.length != ref_object.parameters_list.length) {
  16877. if (ref_object.parameters_list.length > ref_object.function_called.parameters_list.length) {
  16878. ref_object.parameters_list.pop();
  16879. } else {
  16880. ref_object.parameters_list.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true));
  16881. }
  16882. }
  16883. }
  16884. }
  16885. 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">';
  16886. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_variable) {
  16887. 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">';
  16888. menu_var_or_value += '</div>';
  16889. }
  16890. 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) {
  16891. 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');
  16892. menu_var_or_value += '<div class="menu menu_only_vars">';
  16893. menu_var_or_value += '</div></div>';
  16894. }
  16895. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_value) {
  16896. menu_var_or_value = '<input type="text" class="width-dynamic" size="' + size_field + '" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />';
  16897. }
  16898. 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) {
  16899. 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>';
  16900. }
  16901. if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_function) {
  16902. 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">';
  16903. menu_var_or_value += '</div>';
  16904. }
  16905. 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) {
  16906. 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');
  16907. menu_var_or_value += '<div class="menu menu_only_functions">';
  16908. menu_var_or_value += '</div></div>';
  16909. /* if (command.type == Models.COMMAND_TYPES.attribution) {
  16910. menu_var_or_value += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  16911. menu_var_or_value += '<div class="menu">';
  16912. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  16913. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  16914. menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  16915. menu_var_or_value += '</div></div>';
  16916. }*/
  16917. }
  16918. menu_var_or_value += '</div></div>';
  16919. menu_var_or_value = $(menu_var_or_value);
  16920. dom_object.append(menu_var_or_value);
  16921. ref_object.dom_object = menu_var_or_value;
  16922. addHandlers(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  16923. addVariablesToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  16924. addFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  16925. addIVProgFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
  16926. if (ref_object.content || ref_object.function_called) {
  16927. if (ref_object.content) {
  16928. // Verificar se a variável ainda existe:
  16929. var variable_fun = isVarInProgram(ref_object.content, function_obj);
  16930. if (variable_fun) {
  16931. ref_object.content = variable_fun;
  16932. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  16933. } else {
  16934. if (ref_object.content && ref_object.content.type) {
  16935. ref_object.content = null;
  16936. appendSelectText(ref_object, menu_var_or_value);
  16937. } else {
  16938. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  16939. }
  16940. }
  16941. } else if (ref_object.function_called) {
  16942. // Verificar se a função ainda existe:
  16943. var ret_function = isFunctionInProgram(ref_object.function_called);
  16944. if (ret_function) {
  16945. ref_object.function_called = ret_function;
  16946. renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
  16947. } else {
  16948. ref_object.content = null;
  16949. ref_object.row = null;
  16950. ref_object.column = null;
  16951. delete ref_object.function_called;
  16952. delete ref_object.parameters_list;
  16953. appendSelectText(ref_object, menu_var_or_value);
  16954. }
  16955. }
  16956. } else {
  16957. appendSelectText(ref_object, menu_var_or_value);
  16958. }
  16959. }
  16960. function appendSelectText(ref_object, menu_var_or_value) {
  16961. switch (ref_object.variable_and_value) {
  16962. case VAR_OR_VALUE_TYPES.only_variable:
  16963. menu_var_or_value.find('.text').append('<i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('var_menu_select_var') + '</i>');
  16964. break;
  16965. case VAR_OR_VALUE_TYPES.all:
  16966. menu_var_or_value.find('.text').append('<i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('var_menu_select_all') + '</i>');
  16967. break;
  16968. case VAR_OR_VALUE_TYPES.variable_and_function:
  16969. menu_var_or_value.find('.text').append('<i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('var_menu_select_all') + '</i>');
  16970. break;
  16971. case VAR_OR_VALUE_TYPES.only_function:
  16972. menu_var_or_value.find('.text').append('<i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('var_menu_select_function') + '</i>');
  16973. break;
  16974. }
  16975. }
  16976. function isFunctionInProgram(function_called_obj) {
  16977. if (function_called_obj.name) {
  16978. if (window.program_obj.functions) {
  16979. for (var i = 0; i < window.program_obj.functions.length; i++) {
  16980. if (window.program_obj.functions[i] == function_called_obj) {
  16981. return window.program_obj.functions[i];
  16982. }
  16983. }
  16984. for (var i = 0; i < window.program_obj.functions.length; i++) {
  16985. if (window.program_obj.functions[i].name == function_called_obj.name) {
  16986. return window.program_obj.functions[i];
  16987. }
  16988. }
  16989. }
  16990. } else if (function_called_obj.identifier) {
  16991. for (var i = 0; i < window.system_functions.length; i++) {
  16992. if (window.system_functions[i].identifier == function_called_obj.identifier) {
  16993. return window.system_functions[i];
  16994. }
  16995. }
  16996. }
  16997. return null;
  16998. }
  16999. function isVarInProgram(var_obj, function_obj) {
  17000. // Verify in locals:
  17001. if (function_obj.variables_list) {
  17002. for (var i = 0; i < function_obj.variables_list.length; i++) {
  17003. if (function_obj.variables_list[i] == var_obj) {
  17004. return function_obj.variables_list[i];
  17005. }
  17006. }
  17007. } // Verify in parameters:
  17008. if (function_obj.parameters_list) {
  17009. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  17010. if (function_obj.parameters_list[i] == var_obj) {
  17011. return function_obj.parameters_list[i];
  17012. }
  17013. }
  17014. } // Verify in globals:
  17015. if (window.program_obj.globals) {
  17016. for (var i = 0; i < window.program_obj.globals.length; i++) {
  17017. if (window.program_obj.globals[i] == var_obj) {
  17018. return window.program_obj.globals[i];
  17019. }
  17020. }
  17021. } // If not found, verify if the reference was lost
  17022. if (var_obj) {
  17023. if (function_obj.variables_list) {
  17024. for (var i = 0; i < function_obj.variables_list.length; i++) {
  17025. if (function_obj.variables_list[i].name == var_obj.name) {
  17026. return function_obj.variables_list[i];
  17027. }
  17028. }
  17029. }
  17030. if (function_obj.parameters_list) {
  17031. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  17032. if (function_obj.parameters_list[i].name == var_obj.name) {
  17033. return function_obj.parameters_list[i];
  17034. }
  17035. }
  17036. }
  17037. if (window.program_obj.globals) {
  17038. for (var i = 0; i < window.program_obj.globals.length; i++) {
  17039. if (window.program_obj.globals[i].name == var_obj.name) {
  17040. return window.program_obj.globals[i];
  17041. }
  17042. }
  17043. }
  17044. }
  17045. return null;
  17046. }
  17047. function renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element) {
  17048. if (ref_object.function_called) {
  17049. menu_var_or_value.remove();
  17050. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  17051. } else if (ref_object.content.type) {
  17052. menu_var_or_value.remove();
  17053. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  17054. } else {
  17055. menu_var_or_value.remove();
  17056. variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
  17057. }
  17058. }
  17059. function variableValueMenuCode(command, variable_obj, dom_object, function_obj, menu_var_or_value, expression_element) {
  17060. if (variable_obj.content || variable_obj.function_called) {
  17061. // Verificar se a variável ainda existe:
  17062. var var_fun = isVarInProgram(variable_obj.content, function_obj);
  17063. if (var_fun) {
  17064. variable_obj.content = var_fun;
  17065. } else {
  17066. if (variable_obj.content && variable_obj.content.type) {
  17067. variable_obj.content = null;
  17068. appendSelectText(variable_obj, menu_var_or_value);
  17069. }
  17070. }
  17071. } else {
  17072. appendSelectText(variable_obj, menu_var_or_value);
  17073. }
  17074. if (variable_obj.content == null && variable_obj.function_called == null) {
  17075. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  17076. return;
  17077. }
  17078. var ret = '';
  17079. if (variable_obj.function_called) {
  17080. if (variable_obj.function_called.parameters_list == null || variable_obj.function_called.length == 0) {
  17081. menu_var_or_value.find('.text').text(' ');
  17082. dom_object.find('.menu_var_or_value_dom').remove();
  17083. var parameters_menu;
  17084. if (variable_obj.function_called.name) {
  17085. parameters_menu = '<div class="parameters_function_called"> ' + variable_obj.function_called.name + ' <span> ( </span>';
  17086. } else {
  17087. 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>';
  17088. }
  17089. parameters_menu += '<span> ) </span></div>';
  17090. parameters_menu = $(parameters_menu);
  17091. dom_object.append(parameters_menu);
  17092. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  17093. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_clear') + '</div>';
  17094. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  17095. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  17096. context_menu += '<div class="menu">';
  17097. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  17098. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  17099. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  17100. context_menu += '</div></div>';
  17101. }*/
  17102. context_menu += '</div></div>';
  17103. context_menu = $(context_menu);
  17104. context_menu.insertAfter(dom_object.find('.parameters_function_called'));
  17105. context_menu.dropdown({
  17106. onChange: function onChange(value, text, $selectedItem) {
  17107. console.log('S1');
  17108. if ($selectedItem.data('clear')) {
  17109. console.log('PP1');
  17110. dom_object.text('');
  17111. variable_obj.content = null;
  17112. variable_obj.row = null;
  17113. variable_obj.column = null;
  17114. delete variable_obj.function_called;
  17115. delete variable_obj.parameters_list;
  17116. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  17117. }
  17118. if ($selectedItem.data('exp')) {
  17119. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  17120. }
  17121. },
  17122. selectOnKeydown: false
  17123. });
  17124. } else {
  17125. menu_var_or_value.find('.text').text(' ');
  17126. dom_object.find('.menu_var_or_value_dom').remove();
  17127. var parameters_menu;
  17128. if (variable_obj.function_called.name) {
  17129. parameters_menu = '<div class="parameters_function_called"> ' + variable_obj.function_called.name + ' <span> ( </span>';
  17130. } else {
  17131. 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>';
  17132. }
  17133. for (var j = 0; j < variable_obj.function_called.parameters_list.length; j++) {
  17134. parameters_menu += '<div class="render_style_param parameter_' + j + '"></div>';
  17135. if (j + 1 != variable_obj.function_called.parameters_list.length) {
  17136. parameters_menu += ' , ';
  17137. }
  17138. }
  17139. parameters_menu += '<span> ) </span></div>';
  17140. parameters_menu = $(parameters_menu);
  17141. dom_object.append(parameters_menu);
  17142. for (var j = 0; j < variable_obj.function_called.parameters_list.length; j++) {
  17143. renderMenu(command, variable_obj.parameters_list[j], parameters_menu.find('.parameter_' + j), function_obj, 2, expression_element);
  17144. }
  17145. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  17146. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_clear') + '</div>';
  17147. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  17148. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  17149. context_menu += '<div class="menu">';
  17150. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  17151. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  17152. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  17153. context_menu += '</div></div>';
  17154. }*/
  17155. context_menu += '</div></div>';
  17156. context_menu = $(context_menu);
  17157. context_menu.insertAfter(parameters_menu);
  17158. context_menu.dropdown({
  17159. onChange: function onChange(value, text, $selectedItem) {
  17160. console.log('S2');
  17161. if ($selectedItem.data('clear')) {
  17162. console.log('PP2');
  17163. dom_object.text('');
  17164. variable_obj.content = null;
  17165. variable_obj.row = null;
  17166. variable_obj.column = null;
  17167. delete variable_obj.function_called;
  17168. delete variable_obj.parameters_list;
  17169. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  17170. }
  17171. if ($selectedItem.data('exp')) {
  17172. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  17173. }
  17174. },
  17175. selectOnKeydown: false
  17176. });
  17177. }
  17178. } else if (variable_obj.content.type) {
  17179. var variable_render = "";
  17180. if (variable_obj.content.dimensions == 1 && variable_obj.dimensions != 1) {
  17181. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + '</span>';
  17182. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  17183. variable_render += '</div>';
  17184. variable_render = $(variable_render);
  17185. dom_object.append(variable_render);
  17186. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  17187. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_clear') + '</div>';
  17188. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  17189. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  17190. context_menu += '<div class="menu">';
  17191. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  17192. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  17193. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  17194. context_menu += '</div></div>';
  17195. }*/
  17196. context_menu += '</div></div>';
  17197. context_menu = $(context_menu);
  17198. variable_render.append(context_menu);
  17199. context_menu.dropdown({
  17200. onChange: function onChange(value, text, $selectedItem) {
  17201. console.log('S3');
  17202. if ($selectedItem.data('clear')) {
  17203. console.log('PP3');
  17204. dom_object.text('');
  17205. variable_obj.content = null;
  17206. variable_obj.row = null;
  17207. variable_obj.column = null;
  17208. delete variable_obj.function_called;
  17209. delete variable_obj.parameters_list;
  17210. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  17211. }
  17212. if ($selectedItem.data('exp')) {
  17213. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  17214. }
  17215. },
  17216. selectOnKeydown: false
  17217. });
  17218. if (!variable_obj.column) {
  17219. variable_obj.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  17220. }
  17221. variableValueMenuCode(command, variable_obj.column, $(variable_render.find('.column_container')), function_obj, menu_var_or_value, expression_element);
  17222. } else if (variable_obj.content.dimensions == 2 && variable_obj.dimensions != 2) {
  17223. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + '</span>';
  17224. variable_render += ' <span>[ </span> <div class="row_container"></div> <span> ]</span>';
  17225. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ] </span>';
  17226. variable_render += '</div>';
  17227. variable_render = $(variable_render);
  17228. dom_object.append(variable_render);
  17229. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  17230. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_clear') + '</div>';
  17231. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  17232. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  17233. context_menu += '<div class="menu">';
  17234. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  17235. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  17236. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  17237. context_menu += '</div></div>';
  17238. }*/
  17239. context_menu += '</div></div>';
  17240. context_menu = $(context_menu);
  17241. variable_render.append(context_menu);
  17242. context_menu.dropdown({
  17243. onChange: function onChange(value, text, $selectedItem) {
  17244. console.log('S4');
  17245. if ($selectedItem.data('clear')) {
  17246. console.log('PP4');
  17247. dom_object.text('');
  17248. variable_obj.content = null;
  17249. variable_obj.row = null;
  17250. variable_obj.column = null;
  17251. delete variable_obj.function_called;
  17252. delete variable_obj.parameters_list;
  17253. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  17254. }
  17255. if ($selectedItem.data('exp')) {
  17256. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  17257. }
  17258. },
  17259. selectOnKeydown: false
  17260. });
  17261. if (!variable_obj.column) {
  17262. variable_obj.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  17263. }
  17264. if (!variable_obj.row) {
  17265. variable_obj.row = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  17266. }
  17267. variableValueMenuCode(command, variable_obj.row, $(variable_render.find('.row_container')), function_obj, menu_var_or_value, expression_element);
  17268. variableValueMenuCode(command, variable_obj.column, $(variable_render.find('.column_container')), function_obj, menu_var_or_value, expression_element);
  17269. } else {
  17270. variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + '</span>';
  17271. variable_render += '</div>';
  17272. variable_render = $(variable_render);
  17273. dom_object.append(variable_render);
  17274. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  17275. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_clear') + '</div>';
  17276. /*if (command.type == Models.COMMAND_TYPES.attribution && !dom_object.hasClass('var_attributed')) {
  17277. console.log('dom_object6');
  17278. console.log(dom_object);
  17279. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  17280. context_menu += '<div class="menu">';
  17281. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  17282. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  17283. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  17284. context_menu += '</div></div>';
  17285. }*/
  17286. context_menu += '</div></div>';
  17287. context_menu = $(context_menu);
  17288. variable_render.append(context_menu);
  17289. context_menu.dropdown({
  17290. onChange: function onChange(value, text, $selectedItem) {
  17291. console.log('S5');
  17292. if ($selectedItem.data('clear')) {
  17293. console.log('PP5');
  17294. dom_object.text('');
  17295. variable_obj.content = null;
  17296. variable_obj.row = null;
  17297. variable_obj.column = null;
  17298. delete variable_obj.function_called;
  17299. delete variable_obj.parameters_list;
  17300. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  17301. }
  17302. if ($selectedItem.data('exp')) {
  17303. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  17304. }
  17305. },
  17306. selectOnKeydown: false
  17307. });
  17308. }
  17309. } else {
  17310. var variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content + '</span>';
  17311. variable_render += '</div>';
  17312. variable_render = $(variable_render);
  17313. dom_object.append(variable_render);
  17314. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  17315. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_clear') + '</div>';
  17316. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  17317. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  17318. context_menu += '<div class="menu">';
  17319. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  17320. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  17321. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  17322. context_menu += '</div></div>';
  17323. }*/
  17324. context_menu += '</div></div>';
  17325. context_menu = $(context_menu);
  17326. if (variable_obj.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  17327. context_menu.insertAfter(variable_render);
  17328. }
  17329. context_menu.dropdown({
  17330. onChange: function onChange(value, text, $selectedItem) {
  17331. console.log('S6');
  17332. if ($selectedItem.data('clear')) {
  17333. console.log('PP6');
  17334. dom_object.text('');
  17335. variable_obj.content = null;
  17336. variable_obj.row = null;
  17337. variable_obj.column = null;
  17338. delete variable_obj.function_called;
  17339. delete variable_obj.parameters_list;
  17340. dom_object.find('.value_rendered').remove();
  17341. dom_object.find('.context_menu_clear').remove();
  17342. dom_object.find('.width-dynamic-minus').remove();
  17343. renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
  17344. }
  17345. if ($selectedItem.data('exp')) {
  17346. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  17347. }
  17348. },
  17349. selectOnKeydown: false
  17350. });
  17351. variable_render.on('click', function (e) {
  17352. variable_render.remove();
  17353. variable_render.empty();
  17354. variable_render.remove();
  17355. dom_object.empty();
  17356. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  17357. openInputToValue(command, variable_obj, dom_object, menu_var_or_value, function_obj, expression_element);
  17358. });
  17359. }
  17360. }
  17361. function addIVProgFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  17362. var sub_menu = menu_var_or_value.find('.menu_only_functions');
  17363. sub_menu.append('<div class="divider"></div><div class="header">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_header_ivprog_functions') + '</div>');
  17364. 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>');
  17365. 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>');
  17366. 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>');
  17367. 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:
  17368. for (var i = 0; i < window.system_functions.length; i++) {
  17369. var t = $('<div class="item"></div>');
  17370. t.data('function_reference', window.system_functions[i]);
  17371. t.data('option', VAR_OR_VALUE_TYPES.only_function);
  17372. t.text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].translateInternalFunction(window.system_functions[i].identifier));
  17373. switch (window.system_functions[i].category) {
  17374. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].math:
  17375. sub_menu.find('.menu_math_functions').append(t);
  17376. break;
  17377. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].text:
  17378. sub_menu.find('.menu_text_functions').append(t);
  17379. break;
  17380. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].arrangement:
  17381. sub_menu.find('.menu_arrangement_functions').append(t);
  17382. break;
  17383. case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].conversion:
  17384. sub_menu.find('.menu_conversion_functions').append(t);
  17385. break;
  17386. }
  17387. }
  17388. }
  17389. function addFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  17390. var sub_menu = menu_var_or_value.find('.menu_only_functions');
  17391. sub_menu.text('');
  17392. for (var i = 0; i < window.program_obj.functions.length; i++) {
  17393. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_function + '">' + window.program_obj.functions[i].name + ' </div>');
  17394. temp.data('function_reference', window.program_obj.functions[i]);
  17395. sub_menu.append(temp);
  17396. }
  17397. }
  17398. function addVariablesToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
  17399. var sub_menu = menu_var_or_value.find('.menu_only_vars');
  17400. sub_menu.text('');
  17401. var is_there = false;
  17402. if (window.program_obj.globals) {
  17403. if (ref_object.include_constant) {
  17404. for (var i = 0; i < window.program_obj.globals.length; i++) {
  17405. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + window.program_obj.globals[i].name + ' </div>');
  17406. temp.data('variable_reference', window.program_obj.globals[i]);
  17407. sub_menu.append(temp);
  17408. is_there = true;
  17409. }
  17410. } else {
  17411. for (var i = 0; i < window.program_obj.globals.length; i++) {
  17412. if (!window.program_obj.globals[i].is_constant) {
  17413. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + window.program_obj.globals[i].name + ' </div>');
  17414. temp.data('variable_reference', window.program_obj.globals[i]);
  17415. sub_menu.append(temp);
  17416. is_there = true;
  17417. }
  17418. }
  17419. }
  17420. }
  17421. if (function_obj.parameters_list) {
  17422. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  17423. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + function_obj.parameters_list[i].name + ' </div>');
  17424. temp.data('variable_reference', function_obj.parameters_list[i]);
  17425. sub_menu.append(temp);
  17426. is_there = true;
  17427. }
  17428. }
  17429. if (function_obj.variables_list) {
  17430. for (var i = 0; i < function_obj.variables_list.length; i++) {
  17431. var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + function_obj.variables_list[i].name + ' </div>');
  17432. temp.data('variable_reference', function_obj.variables_list[i]);
  17433. sub_menu.append(temp);
  17434. is_there = true;
  17435. }
  17436. }
  17437. if (!is_there) {
  17438. sub_menu.append($('<div class="header">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_no_variable') + '</div>'));
  17439. sub_menu.append($('<div class="item disabled">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_no_variable_instruction') + '</div>'));
  17440. }
  17441. }
  17442. function addHandlers(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element) {
  17443. if (ref_object.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  17444. menu_var_or_value.dropdown({
  17445. onChange: function onChange(value, text, $selectedItem) {
  17446. console.log('S7');
  17447. dom_object.find('.var_name').remove();
  17448. switch ($selectedItem.data('option')) {
  17449. case VAR_OR_VALUE_TYPES.only_function:
  17450. openInputToFunction(command, ref_object, dom_object, menu_var_or_value, function_obj, $($selectedItem).data('function_reference'), expression_element);
  17451. break;
  17452. case VAR_OR_VALUE_TYPES.only_value:
  17453. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  17454. break;
  17455. case VAR_OR_VALUE_TYPES.only_variable:
  17456. openInputToVariable(command, ref_object, dom_object, menu_var_or_value, function_obj, $($selectedItem).data('variable_reference'), expression_element);
  17457. break;
  17458. }
  17459. if ($selectedItem.data('exp')) {
  17460. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  17461. }
  17462. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes) {
  17463. _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  17464. }
  17465. },
  17466. selectOnKeydown: false
  17467. });
  17468. }
  17469. dom_object.find('.width-dynamic').on('input', function () {
  17470. var inputWidth = $(this).textWidth() + 10;
  17471. $(this).focus();
  17472. var tmpStr = $(this).val();
  17473. $(this).val('');
  17474. $(this).val(tmpStr);
  17475. $(this).css({
  17476. width: inputWidth
  17477. });
  17478. }).trigger('input');
  17479. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment) {
  17480. dom_object.parent().on('click', function (e) {
  17481. dom_object.find('.value_rendered').remove();
  17482. dom_object.find('.value_rendered').empty();
  17483. dom_object.find('.value_rendered').remove();
  17484. dom_object.empty();
  17485. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  17486. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  17487. });
  17488. }
  17489. }
  17490. function openInputToFunction(command, ref_object, dom_object, menu_var_or_value, function_obj, function_selected, expression_element) {
  17491. ref_object.function_called = function_selected;
  17492. ref_object.parameters_list = [];
  17493. if (function_selected.parameters_list != null && function_selected.parameters_list.length > 0) {
  17494. menu_var_or_value.find('.text').text(' ');
  17495. dom_object.find('.menu_var_or_value_dom').remove();
  17496. var parameters_menu;
  17497. if (function_selected.name) {
  17498. parameters_menu = '<div class="parameters_function_called"> ' + function_selected.name + ' <span> ( </span>';
  17499. } else {
  17500. 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>';
  17501. }
  17502. for (var j = 0; j < function_selected.parameters_list.length; j++) {
  17503. parameters_menu += '<div class="render_style_param parameter_' + j + '"></div>';
  17504. if (j + 1 != function_selected.parameters_list.length) {
  17505. parameters_menu += ' , ';
  17506. }
  17507. }
  17508. parameters_menu += '<span> ) </span></div>';
  17509. parameters_menu = $(parameters_menu);
  17510. dom_object.append(parameters_menu);
  17511. for (var j = 0; j < function_selected.parameters_list.length; j++) {
  17512. var temp;
  17513. if (function_selected.parameters_list[j].dimensions > 0) {
  17514. 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);
  17515. } else {
  17516. temp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  17517. }
  17518. ref_object.parameters_list.push(temp);
  17519. renderMenu(command, temp, parameters_menu.find('.parameter_' + j), function_obj, 2, expression_element);
  17520. }
  17521. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  17522. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_clear') + '</div>';
  17523. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  17524. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  17525. context_menu += '<div class="menu">';
  17526. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  17527. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  17528. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  17529. context_menu += '</div></div>';
  17530. }*/
  17531. context_menu += '</div></div>';
  17532. context_menu = $(context_menu);
  17533. context_menu.insertAfter(dom_object.find('.parameters_function_called'));
  17534. context_menu.dropdown({
  17535. onChange: function onChange(value, text, $selectedItem) {
  17536. console.log('S8');
  17537. if ($selectedItem.data('clear')) {
  17538. console.log('PP7');
  17539. dom_object.text('');
  17540. ref_object.content = null;
  17541. ref_object.row = null;
  17542. ref_object.column = null;
  17543. delete ref_object.function_called;
  17544. delete ref_object.parameters_list;
  17545. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  17546. }
  17547. if ($selectedItem.data('exp')) {
  17548. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  17549. }
  17550. },
  17551. selectOnKeydown: false
  17552. });
  17553. } else {
  17554. menu_var_or_value.find('.text').text(' ');
  17555. dom_object.find('.menu_var_or_value_dom').remove();
  17556. var parameters_menu;
  17557. if (function_selected.name) {
  17558. parameters_menu = '<div class="parameters_function_called"> ' + function_selected.name + ' <span> ( </span>';
  17559. } else {
  17560. 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>';
  17561. }
  17562. parameters_menu += '<span> ) </span></div>';
  17563. parameters_menu = $(parameters_menu);
  17564. dom_object.append(parameters_menu);
  17565. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  17566. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_clear') + '</div>';
  17567. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  17568. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  17569. context_menu += '<div class="menu">';
  17570. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  17571. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  17572. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  17573. context_menu += '</div></div>';
  17574. }*/
  17575. context_menu += '</div></div>';
  17576. context_menu = $(context_menu);
  17577. context_menu.insertAfter(dom_object.find('.parameters_function_called'));
  17578. context_menu.dropdown({
  17579. onChange: function onChange(value, text, $selectedItem) {
  17580. console.log('S9');
  17581. if ($selectedItem.data('clear')) {
  17582. console.log('PP8');
  17583. dom_object.text('');
  17584. ref_object.content = null;
  17585. ref_object.row = null;
  17586. ref_object.column = null;
  17587. delete ref_object.function_called;
  17588. delete ref_object.parameters_list;
  17589. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  17590. }
  17591. if ($selectedItem.data('exp')) {
  17592. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  17593. }
  17594. },
  17595. selectOnKeydown: false
  17596. });
  17597. }
  17598. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  17599. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj);
  17600. }*/
  17601. }
  17602. function openInputToVariable(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected, expression_element) {
  17603. ref_object.content = variable_selected;
  17604. menu_var_or_value.find('.text').text(' ');
  17605. dom_object.find('.menu_var_or_value_dom').remove();
  17606. var variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_selected.name + '</span>';
  17607. if (variable_selected.dimensions == 1 && ref_object.dimensions != 1) {
  17608. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  17609. }
  17610. if (variable_selected.dimensions == 2 && ref_object.dimensions != 2) {
  17611. variable_render += ' <span>[ </span> <div class="row_container"></div> <span> ]</span> ';
  17612. variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
  17613. }
  17614. variable_render += '</div>';
  17615. variable_render = $(variable_render);
  17616. dom_object.append(variable_render);
  17617. if (variable_selected.dimensions == 1 && ref_object.dimensions != 1) {
  17618. ref_object.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  17619. renderMenu(command, ref_object.column, variable_render.find('.column_container'), function_obj, 2, expression_element);
  17620. }
  17621. if (variable_selected.dimensions == 2 && ref_object.dimensions != 2) {
  17622. ref_object.row = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  17623. renderMenu(command, ref_object.row, variable_render.find('.row_container'), function_obj, 2, expression_element);
  17624. ref_object.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
  17625. renderMenu(command, ref_object.column, variable_render.find('.column_container'), function_obj, 2, expression_element);
  17626. }
  17627. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  17628. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_clear') + '</div>';
  17629. /*if (command.type == Models.COMMAND_TYPES.attribution && !dom_object.hasClass('var_attributed')) {
  17630. console.log("dom_object 10: ");
  17631. console.log(dom_object);
  17632. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  17633. context_menu += '<div class="menu">';
  17634. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  17635. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  17636. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  17637. context_menu += '</div></div>';
  17638. }*/
  17639. context_menu += '</div></div>';
  17640. context_menu = $(context_menu);
  17641. context_menu.insertAfter(dom_object.find('.variable_rendered'));
  17642. context_menu.dropdown({
  17643. onChange: function onChange(value, text, $selectedItem) {
  17644. console.log('S10');
  17645. if ($selectedItem.data('clear')) {
  17646. console.log('PP9');
  17647. dom_object.text('');
  17648. ref_object.content = null;
  17649. ref_object.row = null;
  17650. ref_object.column = null;
  17651. delete ref_object.function_called;
  17652. delete ref_object.parameters_list;
  17653. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  17654. }
  17655. if ($selectedItem.data('exp')) {
  17656. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  17657. }
  17658. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes) {
  17659. _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__["manageClearExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  17660. }
  17661. },
  17662. selectOnKeydown: false
  17663. });
  17664. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  17665. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected);
  17666. }*/
  17667. }
  17668. function openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element) {
  17669. if (ref_object.content == null) {
  17670. ref_object.content = "";
  17671. }
  17672. menu_var_or_value.find('.text').text(' ');
  17673. var field = $('<input type="text" size="2" class="width-dynamic-minus" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />');
  17674. field.insertBefore(dom_object.find('.menu_var_or_value_dom'));
  17675. var rendered = $('<div class="value_rendered"></div>');
  17676. rendered.insertBefore(field);
  17677. field.focus();
  17678. field.val(ref_object.content);
  17679. var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
  17680. context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('btn_clear') + '</div>';
  17681. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  17682. context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
  17683. context_menu += '<div class="menu">';
  17684. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
  17685. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
  17686. context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
  17687. context_menu += '</div></div>';
  17688. }*/
  17689. context_menu += '</div></div>';
  17690. context_menu = $(context_menu);
  17691. dom_object.find('.menu_var_or_value_dom').remove();
  17692. if (ref_object.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
  17693. context_menu.insertAfter(field);
  17694. }
  17695. context_menu.dropdown({
  17696. onChange: function onChange(value, text, $selectedItem) {
  17697. console.log('S11');
  17698. if ($selectedItem.data('clear')) {
  17699. console.log('PP10');
  17700. dom_object.text('');
  17701. dom_object.find('.value_rendered').remove();
  17702. dom_object.find('.context_menu_clear').remove();
  17703. dom_object.find('.width-dynamic-minus').remove();
  17704. ref_object.content = null;
  17705. ref_object.row = null;
  17706. ref_object.column = null;
  17707. delete ref_object.function_called;
  17708. delete ref_object.parameters_list;
  17709. renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
  17710. }
  17711. if ($selectedItem.data('exp')) {
  17712. _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
  17713. }
  17714. },
  17715. selectOnKeydown: false
  17716. });
  17717. dom_object.find('.width-dynamic-minus').focusout(function () {
  17718. if ($(this).val().trim()) {
  17719. ref_object.content = $(this).val().trim();
  17720. }
  17721. rendered.text(ref_object.content);
  17722. $(this).remove();
  17723. });
  17724. dom_object.find('.width-dynamic-minus').on('keydown', function (e) {
  17725. var code = e.keyCode || e.which;
  17726. if (code == 13) {
  17727. if ($(this).val().trim()) {
  17728. ref_object.content = $(this).val().trim();
  17729. }
  17730. rendered.text(ref_object.content);
  17731. $(this).remove();
  17732. }
  17733. if (code == 27) {
  17734. rendered.text(ref_object.content);
  17735. $(this).remove();
  17736. }
  17737. });
  17738. if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment) {
  17739. /*rendered.parent().on('click', function(e) {
  17740. rendered.parent().off();
  17741. console.log("TTT14");
  17742. rendered.remove();
  17743. rendered.empty();
  17744. rendered.remove();
  17745. dom_object.empty();
  17746. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  17747. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element)
  17748. });*/
  17749. }
  17750. rendered.on('click', function (e) {
  17751. console.log("TTT2");
  17752. rendered.remove();
  17753. rendered.empty();
  17754. rendered.remove();
  17755. dom_object.empty();
  17756. dom_object.append('<span class="menu_var_or_value_dom"> </span>');
  17757. openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
  17758. });
  17759. /*if (command.type == Models.COMMAND_TYPES.attribution) {
  17760. AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj);
  17761. }*/
  17762. }
  17763. $.fn.textWidth = function (text, font) {
  17764. if (!$.fn.textWidth.fakeEl) $.fn.textWidth.fakeEl = $('<span>').hide().appendTo(document.body);
  17765. $.fn.textWidth.fakeEl.text(text || this.val() || this.text() || this.attr('placeholder')).css('font', font || this.css('font'));
  17766. return $.fn.textWidth.fakeEl.width();
  17767. };
  17768. /***/ }),
  17769. /***/ "./js/visualUI/commands/whiletrue.js":
  17770. /*!*******************************************!*\
  17771. !*** ./js/visualUI/commands/whiletrue.js ***!
  17772. \*******************************************/
  17773. /*! exports provided: createFloatingCommand, renderCommand */
  17774. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17775. "use strict";
  17776. __webpack_require__.r(__webpack_exports__);
  17777. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17778. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17779. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17780. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17781. /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
  17782. /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
  17783. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  17784. function createFloatingCommand() {
  17785. 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>');
  17786. }
  17787. function renderCommand(command, function_obj) {
  17788. var ret = '';
  17789. 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>';
  17790. ret += '<span class="span_command_spec"> ( </span> <div class="conditional_expression"></div> <span class="span_command_spec"> ) </span>';
  17791. ret += ' </span>';
  17792. ret += '<div class="ui block_commands">';
  17793. ret += '</div>';
  17794. ret += '<span> </span>';
  17795. ret += '</div>';
  17796. var el = $(ret);
  17797. el.data('command', command);
  17798. el.find('.block_commands').data('command', command);
  17799. addHandlers(command, function_obj, el);
  17800. _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'));
  17801. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
  17802. if (command.commands_block) {
  17803. for (var j = 0; j < command.commands_block.length; j++) {
  17804. _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
  17805. }
  17806. }
  17807. return el;
  17808. }
  17809. function addHandlers(command, function_obj, whiletrue_dom) {
  17810. whiletrue_dom.find('.button_remove_command').on('click', function () {
  17811. if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, whiletrue_dom)) {
  17812. whiletrue_dom.fadeOut(400, function () {
  17813. whiletrue_dom.remove();
  17814. });
  17815. }
  17816. });
  17817. }
  17818. /***/ }),
  17819. /***/ "./js/visualUI/commands/writer.js":
  17820. /*!****************************************!*\
  17821. !*** ./js/visualUI/commands/writer.js ***!
  17822. \****************************************/
  17823. /*! exports provided: createFloatingCommand, renderCommand, addContent */
  17824. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17825. "use strict";
  17826. __webpack_require__.r(__webpack_exports__);
  17827. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
  17828. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
  17829. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addContent", function() { return addContent; });
  17830. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17831. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17832. /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17833. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
  17834. /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
  17835. function createFloatingCommand() {
  17836. 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>');
  17837. }
  17838. function renderCommand(command, function_obj) {
  17839. var ret = '';
  17840. ret += '<div class="ui writer command_container"> <i class="ui icon small upload 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_command_write') + ' ( </span><div class="all_elements_write"></div> <span class="close_parentheses span_command_spec">)</span> </div>';
  17841. var el = $(ret);
  17842. el.data('command', command); //renderExpression (command, function_obj, div_to_render, expression_array)
  17843. _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.all_elements_write'), command.content);
  17844. /*for (var i = 0; i < command.content.length; i ++) {
  17845. var new_div_item = $( '<div class="var_value_menu_div"></div>' );
  17846. var div_parent_with_handler = $( '<div class="div_parent_handler"></div>' );
  17847. div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
  17848. div_parent_with_handler.append(new_div_item);
  17849. div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
  17850. el.find('.all_elements_write').append(div_parent_with_handler);
  17851. VariableValueMenu.renderMenu(command, command.content[i], new_div_item, function_obj);
  17852. addHandlerIconAdd(el.find('.all_elements_write'), command, function_obj);
  17853. addHandlersManager(command, function_obj, el, div_parent_with_handler, command.content[i]);
  17854. }
  17855. if (command.content.length == 0) {
  17856. addHandlerIconAdd(el.find('.all_elements_write'), command, function_obj);
  17857. }*/
  17858. addHandlers(command, function_obj, el);
  17859. return el;
  17860. }
  17861. function addHandlersManager(command, function_obj, writer_dom, item_div, content_element) {
  17862. item_div.find('.times').on('click', function () {
  17863. for (var i = 0; i < command.content.length; i++) {
  17864. if (command.content[i] == content_element) {
  17865. delete command.content[i];
  17866. command.content.splice(i, 1);
  17867. item_div.children().off();
  17868. item_div.off();
  17869. item_div.fadeOut();
  17870. if (command.content.length > 0) {
  17871. item_div.next('.icon_add_item_to_writer').fadeOut();
  17872. }
  17873. break;
  17874. }
  17875. }
  17876. });
  17877. }
  17878. function addHandlers(command, function_obj, writer_dom) {
  17879. writer_dom.find('.button_remove_command').on('click', function () {
  17880. if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, writer_dom)) {
  17881. writer_dom.fadeOut(400, function () {
  17882. writer_dom.remove();
  17883. });
  17884. }
  17885. });
  17886. Sortable.create(writer_dom.find(".all_elements_write")[0], {
  17887. handle: '.ellipsis',
  17888. animation: 100,
  17889. ghostClass: 'ghost',
  17890. group: 'writer_' + Math.floor(Math.random() * 10000000),
  17891. draggable: '.div_parent_handler',
  17892. onEnd: function onEnd(evt) {
  17893. command.content.splice(evt.newIndex, 0, command.content.splice(evt.oldIndex, 1)[0]);
  17894. writer_dom.empty();
  17895. writer_dom.replaceWith(renderCommand(command, function_obj));
  17896. }
  17897. });
  17898. }
  17899. function addHandlerIconAdd(dom_object, command, function_obj) {
  17900. var insert_after = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  17901. var after_which = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  17902. var icon_add_item = $('<i class="ui icon plus square outline icon_add_item_to_writer"></i> ');
  17903. if (!insert_after) {
  17904. dom_object.append(icon_add_item);
  17905. } else {
  17906. icon_add_item.insertAfter(after_which);
  17907. }
  17908. icon_add_item.on('click', function (e) {
  17909. var div_parent_with_handler = $('<div class="div_parent_handler" style="display:none;"></div>');
  17910. var new_div_item = $('<div class="var_value_menu_div"></div>');
  17911. div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
  17912. div_parent_with_handler.append(new_div_item);
  17913. div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
  17914. div_parent_with_handler.insertAfter(icon_add_item);
  17915. 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);
  17916. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, new_related_menu, new_div_item, function_obj);
  17917. addHandlerIconAdd(dom_object, command, function_obj, true, div_parent_with_handler);
  17918. addHandlersManager(command, function_obj, dom_object, div_parent_with_handler, new_related_menu);
  17919. var pos = 1;
  17920. dom_object.find('.icon_add_item_to_writer').each(function () {
  17921. if ($(this).get(0) === icon_add_item.get(0)) {
  17922. command.content.splice(pos, 0, new_related_menu);
  17923. } else {
  17924. pos++;
  17925. }
  17926. });
  17927. if (command.content.length == 1) {
  17928. icon_add_item.remove();
  17929. }
  17930. div_parent_with_handler.fadeIn();
  17931. });
  17932. }
  17933. function addContent(command, ref_object, dom_object, menu_var_or_value, function_obj, ref_object_content) {
  17934. if (dom_object.hasClass('var_value_menu_div')) {
  17935. var icon_add_item = $('<i class="ui icon plus square outline icon_add_item_to_writer"></i> ');
  17936. icon_add_item.insertAfter(dom_object);
  17937. icon_add_item.on('click', function (e) {
  17938. var div_parent_with_handler = $('<div class="div_parent_handler"></div>');
  17939. div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
  17940. div_parent_with_handler.append(new_div_item);
  17941. div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
  17942. div_parent_with_handler.insertAfter(icon_add_item);
  17943. 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);
  17944. _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, new_related_menu, new_div_item, function_obj);
  17945. addHandlersManager(command, function_obj, dom_object, div_parent_with_handler, new_related_menu);
  17946. command.content.push(new_related_menu);
  17947. if (command.content.length == 1) {
  17948. icon_add_item.remove();
  17949. }
  17950. });
  17951. }
  17952. }
  17953. /***/ }),
  17954. /***/ "./js/visualUI/functions.js":
  17955. /*!**********************************!*\
  17956. !*** ./js/visualUI/functions.js ***!
  17957. \**********************************/
  17958. /*! exports provided: renderFunction, initVisualUI, setTestCases, getTestCases, addFunctionChangeListener, addGlobalChangeListener, removeGlobalListener, removeFunctionListener */
  17959. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17960. "use strict";
  17961. __webpack_require__.r(__webpack_exports__);
  17962. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderFunction", function() { return renderFunction; });
  17963. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initVisualUI", function() { return initVisualUI; });
  17964. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTestCases", function() { return setTestCases; });
  17965. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTestCases", function() { return getTestCases; });
  17966. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addFunctionChangeListener", function() { return addFunctionChangeListener; });
  17967. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addGlobalChangeListener", function() { return addGlobalChangeListener; });
  17968. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeGlobalListener", function() { return removeGlobalListener; });
  17969. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFunctionListener", function() { return removeFunctionListener; });
  17970. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  17971. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  17972. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  17973. /* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./globals */ "./js/visualUI/globals.js");
  17974. /* harmony import */ var _variables__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./variables */ "./js/visualUI/variables.js");
  17975. /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./commands */ "./js/visualUI/commands.js");
  17976. /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./code_generator */ "./js/visualUI/code_generator.js");
  17977. /* harmony import */ var _commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./commands/variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
  17978. /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../io/domConsole */ "./js/io/domConsole.js");
  17979. /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
  17980. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  17981. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_10__);
  17982. /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
  17983. /* harmony import */ var _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../assessment/ivprogAssessment */ "./js/assessment/ivprogAssessment.js");
  17984. /* harmony import */ var _algorithm__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./algorithm */ "./js/visualUI/algorithm.js");
  17985. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  17986. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  17987. /* harmony import */ var _ima_version_json__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../../.ima_version.json */ "./.ima_version.json");
  17988. var _ima_version_json__WEBPACK_IMPORTED_MODULE_16___namespace = /*#__PURE__*/__webpack_require__.t(/*! ./../../.ima_version.json */ "./.ima_version.json", 1);
  17989. /* harmony import */ var _text_editor__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./text_editor */ "./js/visualUI/text_editor.js");
  17990. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  17991. /* harmony import */ var _processor_modes__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../processor/modes */ "./js/processor/modes.ts");
  17992. /* harmony import */ var _processor_modes__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_processor_modes__WEBPACK_IMPORTED_MODULE_19__);
  17993. var counter_new_functions = 0;
  17994. var counter_new_parameters = 0;
  17995. var ivprog_version = _ima_version_json__WEBPACK_IMPORTED_MODULE_16__.version;
  17996. var globalChangeListeners = [];
  17997. var functionsChangeListeners = [];
  17998. var proc = null;
  17999. var domConsole = null;
  18000. var _testCases = [];
  18001. var isRunning = false;
  18002. window.studentGrade = null;
  18003. window.LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"];
  18004. var program = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Program"]();
  18005. window.system_functions = []; // Adding math functions:
  18006. 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));
  18007. 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));
  18008. 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));
  18009. 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));
  18010. 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));
  18011. 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));
  18012. 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));
  18013. 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));
  18014. 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));
  18015. 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));
  18016. 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));
  18017. 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:
  18018. 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));
  18019. 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));
  18020. 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));
  18021. 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));
  18022. window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$charAt', _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)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].text)); // Adding arrangement functions:
  18023. 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));
  18024. 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));
  18025. 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:
  18026. 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));
  18027. 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));
  18028. 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));
  18029. 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));
  18030. 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));
  18031. 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));
  18032. 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));
  18033. 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');
  18034. 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);
  18035. mainFunction.function_comment = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Comment"](_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_comment_main'));
  18036. program.addFunction(mainFunction);
  18037. window.program_obj = program;
  18038. window.generator = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"];
  18039. window.runCodeAssessment = runCodeAssessment;
  18040. window.renderAlgorithm = _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"];
  18041. window.insertContext = false;
  18042. window.watchW = melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a;
  18043. melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a.watch(window.program_obj.globals, function () {
  18044. if (window.insertContext) {
  18045. setTimeout(function () {
  18046. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  18047. globalChangeListeners.forEach(function (x) {
  18048. return x();
  18049. });
  18050. }, 300);
  18051. window.insertContext = false;
  18052. } else {
  18053. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  18054. globalChangeListeners.forEach(function (x) {
  18055. return x();
  18056. });
  18057. }
  18058. }, 1);
  18059. melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a.watch(window.program_obj.functions, function () {
  18060. if (window.insertContext) {
  18061. setTimeout(function () {
  18062. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  18063. functionsChangeListeners.forEach(function (x) {
  18064. return x();
  18065. });
  18066. }, 300);
  18067. window.insertContext = false;
  18068. } else {
  18069. _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
  18070. functionsChangeListeners.forEach(function (x) {
  18071. return x();
  18072. });
  18073. }
  18074. }, 1);
  18075. function addFunctionHandler() {
  18076. 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')));
  18077. program.addFunction(new_function);
  18078. counter_new_functions++;
  18079. window.insertContext = true;
  18080. 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);
  18081. renderFunction(new_function);
  18082. /*newe.css('display', 'none');
  18083. newe.fadeIn();*/
  18084. }
  18085. function addParameter(function_obj, function_container
  18086. /*, is_from_click = false*/
  18087. ) {
  18088. if (function_obj.parameters_list == null) {
  18089. function_obj.parameters_list = [];
  18090. }
  18091. 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);
  18092. function_obj.parameters_list.push(new_parameter);
  18093. counter_new_parameters++;
  18094. 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);
  18095. renderParameter(function_obj, new_parameter, function_container); // if (is_from_click) {
  18096. // newe.css('display', 'none');
  18097. // newe.fadeIn();
  18098. // }
  18099. }
  18100. function updateReturnType(function_obj, new_type) {
  18101. var new_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  18102. 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);
  18103. function_obj.return_type = new_type;
  18104. function_obj.return_dimensions = new_dimensions;
  18105. }
  18106. function removeFunction(function_obj) {
  18107. var index = program.functions.indexOf(function_obj);
  18108. if (index > -1) {
  18109. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_FUNCTION);
  18110. program.functions.splice(index, 1);
  18111. }
  18112. }
  18113. function minimizeFunction(function_obj) {
  18114. function_obj.is_hidden = !function_obj.is_hidden;
  18115. }
  18116. function addHandlers(function_obj, function_container) {
  18117. function_container.find('.ui.dropdown.function_return').dropdown({
  18118. onChange: function onChange(value, text, $selectedItem) {
  18119. if ($selectedItem.data('dimensions')) {
  18120. updateReturnType(function_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], $selectedItem.data('dimensions'));
  18121. } else {
  18122. updateReturnType(function_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')]);
  18123. }
  18124. },
  18125. selectOnKeydown: false
  18126. });
  18127. function_container.find(".name_function_updated").on('click', function (e) {
  18128. enableNameFunctionUpdate(function_obj, function_container);
  18129. });
  18130. function_container.find(".add_parameter_button").on('click', function (e) {
  18131. window.insertContext = true;
  18132. addParameter(function_obj, function_container, true);
  18133. });
  18134. function_container.find('.menu_commands').dropdown({
  18135. on: 'hover'
  18136. });
  18137. function_container.find('.menu_commands a').on('click', function (evt) {
  18138. if (function_obj.commands == null || function_obj.commands.length == 0) {
  18139. function_obj.commands = [];
  18140. var new_cmd = _commands__WEBPACK_IMPORTED_MODULE_5__["genericCreateCommand"]($(this).data('command'));
  18141. function_obj.commands.push(new_cmd);
  18142. _commands__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](new_cmd, function_container.find('.commands_list_div'), 3, function_obj);
  18143. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, $(this).data('command'), '/', 0);
  18144. } else {
  18145. _commands__WEBPACK_IMPORTED_MODULE_5__["createFloatingCommand"](function_obj, function_container, $(this).data('command'), evt);
  18146. }
  18147. });
  18148. function_container.find('.add_var_button_function').on('click', function (e) {
  18149. window.insertContext = true;
  18150. _variables__WEBPACK_IMPORTED_MODULE_4__["addVariable"](function_obj, function_container, true);
  18151. });
  18152. function_container.find('.remove_function_button').on('click', function (e) {
  18153. removeFunction(function_obj);
  18154. function_container.fadeOut();
  18155. });
  18156. function_container.find('.minimize_function_button').on('click', function (e) {
  18157. minimizeFunction(function_obj);
  18158. if (function_obj.is_hidden) {
  18159. function_container.find(".add_var_button_function").toggle();
  18160. function_container.find(".inline_add_command").toggle();
  18161. function_container.find(".function_area").slideToggle();
  18162. } else {
  18163. function_container.find(".function_area").slideToggle(function () {
  18164. function_container.find(".add_var_button_function").toggle();
  18165. function_container.find(".inline_add_command").toggle();
  18166. });
  18167. }
  18168. });
  18169. } // Essa função imprime o tipo de retorno da função e cria o menu do tipo 'select' para alteração
  18170. function renderFunctionReturn(function_obj, function_element) {
  18171. var ret = '<div class="ui dropdown function_return">';
  18172. if (function_obj.return_dimensions == 1) {
  18173. 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()));
  18174. ret += ' [ ] </div>';
  18175. } else if (function_obj.return_dimensions == 2) {
  18176. 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()));
  18177. ret += ' [ ] [ ] </div>';
  18178. } else {
  18179. ret += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(function_obj.return_type.toLowerCase())) + '</div>';
  18180. }
  18181. ret += '<div class="menu">';
  18182. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  18183. 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>';
  18184. }
  18185. 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">';
  18186. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  18187. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  18188. continue;
  18189. }
  18190. 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>';
  18191. }
  18192. ret += '</div></div>';
  18193. 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">';
  18194. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  18195. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  18196. continue;
  18197. }
  18198. 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>';
  18199. }
  18200. ret += '</div></div>';
  18201. ret += '</div></div>';
  18202. ret = $(ret);
  18203. function_element.find('.function_return').append(ret);
  18204. }
  18205. var cont = 0;
  18206. function renderFunction(function_obj) {
  18207. var appender = '<div class="ui secondary segment function_div list-group-item function_cont_' + cont + '">';
  18208. if (function_obj.function_comment) {//appender += renderComment(function_obj.function_comment, sequence, true, -1);
  18209. }
  18210. appender += '<span class="glyphicon glyphicon-move move_function" aria-hidden="true"><i class="icon sort alternate vertical"></i></span>';
  18211. 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>';
  18212. appender += '<div class="function_signature_div">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("function") + ' ';
  18213. if (function_obj.is_main) {
  18214. 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">';
  18215. } else {
  18216. appender += '<div class="ui function_return"></div>';
  18217. 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">';
  18218. }
  18219. appender += '</div> <span class="parethesis_function"> ) </span> </div>' + (function_obj.is_hidden ? ' <div class="function_area" style="display: none;"> ' : ' <div class="function_area"> ');
  18220. appender += '<div class="ui add_var_context add_var_button_function" style="float: left;"> <div class="ui icon button purple"> ';
  18221. 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>';
  18222. appender += '</div></div>';
  18223. appender += '<div class="ui top attached segment variables_list_div"></div>';
  18224. 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;">';
  18225. 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"> ';
  18226. 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>';
  18227. appender += '</div></div>' + '</div>';
  18228. appender += '</div></div>';
  18229. appender = $(appender);
  18230. $('.all_functions').append(appender);
  18231. appender.data('fun', function_obj);
  18232. appender.find('.commands_list_div').data('fun', function_obj);
  18233. renderFunctionReturn(function_obj, appender);
  18234. addHandlers(function_obj, appender); // Rendering parameters:
  18235. for (var j = 0; j < function_obj.parameters_list.length; j++) {
  18236. renderParameter(function_obj, function_obj.parameters_list[j], appender);
  18237. } // Rendering variables:
  18238. for (var j = 0; j < function_obj.variables_list.length; j++) {
  18239. _variables__WEBPACK_IMPORTED_MODULE_4__["renderVariable"](appender, function_obj.variables_list[j], function_obj);
  18240. } // Rendering commands:
  18241. for (var j = 0; j < function_obj.commands.length; j++) {
  18242. _commands__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](function_obj.commands[j], $(appender.find('.commands_list_div')[0]), 3, function_obj);
  18243. }
  18244. $('.minimize_function_button').popup({
  18245. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_hide_function"),
  18246. delay: {
  18247. show: 750,
  18248. hide: 0
  18249. }
  18250. });
  18251. var function_index = program.functions.indexOf(function_obj);
  18252. Sortable.create(appender.find(".variables_list_div")[0], {
  18253. handle: '.ellipsis',
  18254. animation: 100,
  18255. ghostClass: 'ghost',
  18256. group: 'local_vars_drag_' + function_index,
  18257. onEnd: function onEnd(evt) {
  18258. updateSequenceLocals(evt.oldIndex, evt.newIndex, function_obj);
  18259. }
  18260. });
  18261. addSortableHandler(appender.find(".commands_list_div")[0], function_index);
  18262. if (!function_obj.is_main) {
  18263. Sortable.create(appender.find(".container_parameters_list")[0], {
  18264. handle: '.ellipsis',
  18265. animation: 100,
  18266. ghostClass: 'ghost',
  18267. group: 'parameters_drag_' + program.functions.indexOf(function_obj),
  18268. onEnd: function onEnd(evt) {
  18269. updateSequenceParameters(evt.oldIndex, evt.newIndex, function_obj);
  18270. }
  18271. });
  18272. }
  18273. if (function_obj.commands.length > 0) {
  18274. var teste = '.ui.sticky.sticky_cont_' + cont;
  18275. $(teste).sticky({
  18276. context: '.ui.bottom.attached.segment.commands_list_div.commands_cont_' + cont,
  18277. scrollContext: '.ivprog_visual_panel',
  18278. observeChanges: true,
  18279. offset: 40,
  18280. onStick: function onStick(evt) {
  18281. $(teste).css('top', '20px', 'important');
  18282. },
  18283. onBottom: function onBottom(evt) {
  18284. $(teste).css('top', '20px', 'important');
  18285. },
  18286. onUnstick: function onUnstick(evt) {
  18287. $(teste).css('top', '20px', 'important');
  18288. },
  18289. onReposition: function onReposition(evt) {
  18290. $(teste).css('top', '20px', 'important');
  18291. },
  18292. onScroll: function onScroll(evt) {
  18293. $(teste).css('top', '20px', 'important');
  18294. if (!isVisible($(teste), $(teste).parent())) {
  18295. $(teste).removeClass('fixed');
  18296. }
  18297. },
  18298. onTop: function onTop(evt) {
  18299. $(teste).css('top', '20px', 'important');
  18300. }
  18301. });
  18302. }
  18303. cont++;
  18304. return appender;
  18305. }
  18306. function isVisible(element, container) {
  18307. var elementTop = $(element).offset().top,
  18308. elementHeight = $(element).height(),
  18309. containerTop = $(container).offset().top,
  18310. containerHeight = $(container).height() - 30;
  18311. return elementTop - containerTop + elementHeight > 0 && elementTop - containerTop < containerHeight;
  18312. }
  18313. window.evento_drag;
  18314. function updateProgramObjDrag() {
  18315. var nodes = Array.prototype.slice.call($('.all_functions').children());
  18316. var function_index;
  18317. var start_index;
  18318. var function_obj;
  18319. $(evento_drag.item).parentsUntil(".all_functions").each(function (index) {
  18320. var ref = $(this);
  18321. if (ref.hasClass('function_div')) {
  18322. function_index = nodes.indexOf(this);
  18323. start_index = index;
  18324. function_obj = ref;
  18325. }
  18326. });
  18327. var path_target = [];
  18328. $(evento_drag.item).parentsUntil(".all_functions").each(function () {
  18329. if ($(this).hasClass('command_container')) {
  18330. path_target.push(this);
  18331. }
  18332. });
  18333. if (path_target.length == 0) {//console.log('soltou na raiz, na posição: ' + evento_drag.newIndex + ' mas ainda não sei de onde saiu ');
  18334. } else {//console.log('soltou dentro de algum bloco, sequência vem logo abaixo (de baixo pra cima): ');
  18335. //console.log(path_target);
  18336. }
  18337. var index_each = [];
  18338. var path_relative = [];
  18339. for (var i = path_target.length - 1; i >= 0; i--) {
  18340. console.log('da vez', $(path_target[i + 1]));
  18341. if (i == path_target.length - 1) {
  18342. // está na raiz
  18343. var indice_na_raiz = function_obj.find('.command_container').index(path_target[i]);
  18344. console.log('índice na raiz: ', indice_na_raiz);
  18345. } else {
  18346. if ($(path_target[i + 1]).hasClass('iftrue')) {
  18347. if ($(path_target[i]).parent().hasClass('commands_if')) {
  18348. path_relative.push('if');
  18349. index_each.push($(path_target[i]).parent().find('.command_container').index(path_target[i]));
  18350. } else {
  18351. path_relative.push('else');
  18352. index_each.push($(path_target[i]).parent().find('.command_container').index(path_target[i]));
  18353. }
  18354. } else if ($(path_target[i + 1]).hasClass('dowhiletrue')) {
  18355. path_relative.push('dowhiletrue');
  18356. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  18357. } else if ($(path_target[i + 1]).hasClass('repeatNtimes')) {
  18358. path_relative.push('repeatNtimes');
  18359. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  18360. } else if ($(path_target[i + 1]).hasClass('whiletrue')) {
  18361. path_relative.push('whiletrue');
  18362. index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  18363. } else if ($(path_target[i + 1]).hasClass('switch')) {
  18364. path_relative.push('switch'); //index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
  18365. }
  18366. }
  18367. } // var index_in_block = -1;
  18368. 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);
  18369. var is_in_case_switch = $(evento_drag.item).parent().hasClass('case_commands_block'); // var index_case_of_switch = -1;
  18370. // if (is_in_case_switch) {
  18371. // index_case_of_switch = $(evento_drag.item).parent().parent().parent().find('.case_div').index($(evento_drag.item).parent().parent());
  18372. // }
  18373. /*console.log('path_relative:');
  18374. console.log(path_relative);
  18375. console.log('index_each:');
  18376. console.log(index_each);
  18377. console.log('index_in_block:');
  18378. console.log(index_in_block);
  18379. console.log('ele está em algum bloco de senão? ');
  18380. console.log(is_in_else);
  18381. console.log('ele está dentro de um case de switch?');
  18382. console.log(is_in_case_switch);
  18383. console.log('qual é o índice do case: ');
  18384. console.log(index_case_of_switch);*/
  18385. // encontrar o elemento na árvore:
  18386. var command_start_point = window.program_obj.functions[function_index].commands[indice_na_raiz];
  18387. var block_to_insert = command_start_point;
  18388. for (var i = 0; i < index_each.length; i++) {
  18389. if (path_relative[i] == "else") {
  18390. block_to_insert = block_to_insert.commands_else[index_each[i]];
  18391. } else if (path_relative[i] == "switch") {} else {
  18392. block_to_insert = block_to_insert.commands_block[index_each[i]];
  18393. }
  18394. } //console.log('command_start_point', command_start_point);
  18395. //console.log('block_to_insert', block_to_insert);
  18396. // agora tem que alocar o comando na árvore, mas considerar as quatro situações:
  18397. // (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.
  18398. if (path_target.length == 0) {
  18399. // soltou na raiz:
  18400. window.program_obj.functions[function_index].commands.splice(evento_drag.newIndex - 1, 0, command_in_drag);
  18401. } else if (is_in_else) {
  18402. if (block_to_insert.commands_else) {
  18403. block_to_insert.commands_else.splice(evento_drag.newIndex, 0, command_in_drag);
  18404. } else {
  18405. block_to_insert.commands_else = [];
  18406. block_to_insert.commands_else.push(command_in_drag);
  18407. }
  18408. } else if (is_in_case_switch) {} else {
  18409. // verificar se tem alguma coisa no bloco:
  18410. if (block_to_insert.commands_block) {
  18411. console.log("existe alguma coisa dentro do bloco, index: ", evento_drag.newIndex);
  18412. block_to_insert.commands_block.splice(evento_drag.newIndex, 0, command_in_drag);
  18413. } else {
  18414. block_to_insert.commands_block = [];
  18415. block_to_insert.commands_block.push(command_in_drag);
  18416. }
  18417. }
  18418. window.draging = false;
  18419. renderAlgorithm();
  18420. }
  18421. function prepareDragHandler(evt) {
  18422. window.draging = true;
  18423. var nodes = Array.prototype.slice.call($('.all_functions').children());
  18424. var function_index;
  18425. var function_obj;
  18426. $(evt.item).parentsUntil(".all_functions").each(function (index) {
  18427. if ($(this).hasClass('function_div')) {
  18428. function_index = nodes.indexOf(this);
  18429. function_obj = window.program_obj.functions[function_index];
  18430. }
  18431. });
  18432. command_in_drag = $(evt.item).data("command"); //console.log('$(evt.item).parent(): ');
  18433. //console.log($(evt.item).parent());
  18434. // descobrir qual das quatro situações:
  18435. if ($(evt.item).parent().hasClass('commands_list_div')) {
  18436. // está na raiz:
  18437. if (function_obj.commands.indexOf(command_in_drag) > -1) {
  18438. function_obj.commands.splice(function_obj.commands.indexOf(command_in_drag), 1);
  18439. }
  18440. } else if ($(evt.item).parent().hasClass('commands_else')) {
  18441. // está no else:
  18442. if ($(evt.item).parent().data('command').commands_else.indexOf(command_in_drag) > -1) {
  18443. $(evt.item).parent().data('command').commands_else.splice($(evt.item).parent().data('command').commands_else.indexOf(command_in_drag), 1);
  18444. }
  18445. } else if ($(evt.item).parent().hasClass('case_commands_block')) {// está em um switch:
  18446. } else {
  18447. // caso padrão:
  18448. if ($(evt.item).parent().data('command').commands_block.indexOf(command_in_drag) > -1) {
  18449. $(evt.item).parent().data('command').commands_block.splice($(evt.item).parent().data('command').commands_block.indexOf(command_in_drag), 1);
  18450. }
  18451. }
  18452. }
  18453. var command_in_drag;
  18454. function addSortableHandler(element, id_function) {
  18455. var n_group = 'commands_drag_' + id_function;
  18456. Sortable.create(element, {
  18457. handle: '.command_drag',
  18458. ghostClass: 'ghost',
  18459. animation: 300,
  18460. group: {
  18461. name: n_group
  18462. },
  18463. onEnd: function onEnd(evt) {
  18464. var nodes = Array.prototype.slice.call($('.all_functions').children());
  18465. var function_index;
  18466. var function_obj;
  18467. $(evt.item).parentsUntil(".all_functions").each(function (index) {
  18468. if ($(this).hasClass('function_div')) {
  18469. function_index = nodes.indexOf(this);
  18470. function_obj = window.program_obj.functions[function_index];
  18471. }
  18472. });
  18473. 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);
  18474. var itemEl = evt.item; // dragged HTMLElement
  18475. evt.to; // target list
  18476. evt.from; // previous list
  18477. evt.oldIndex; // element's old index within old parent
  18478. evt.newIndex; // element's new index within new parent
  18479. //console.log('::EVT::');
  18480. //console.log(evt);
  18481. window.evento_drag = evt;
  18482. try {
  18483. updateProgramObjDrag();
  18484. } catch (e) {
  18485. console.error(e);
  18486. window.draging = false;
  18487. }
  18488. },
  18489. onStart: function onStart(evt) {
  18490. //console.log("START::EVT::");
  18491. //console.log(evt);
  18492. //console.log("\n\ncommand_in_drag");
  18493. try {
  18494. prepareDragHandler(evt);
  18495. } catch (e) {
  18496. window.draging = false;
  18497. }
  18498. }
  18499. });
  18500. element = $(element);
  18501. element.find(".iftrue").each(function (index) {
  18502. addSortableHandler($(this).find(".block_commands")[0], id_function);
  18503. addSortableHandler($(this).find(".block_commands")[1], id_function);
  18504. });
  18505. element.find(".repeatNtimes").each(function (index) {
  18506. addSortableHandler($(this).find(".block_commands")[0], id_function);
  18507. });
  18508. element.find(".dowhiletrue").each(function (index) {
  18509. addSortableHandler($(this).find(".block_commands")[0], id_function);
  18510. });
  18511. element.find(".whiletrue").each(function (index) {
  18512. addSortableHandler($(this).find(".block_commands")[0], id_function);
  18513. });
  18514. element.find(".switch").each(function (index) {
  18515. $(this).find(".case_div").each(function (index) {
  18516. addSortableHandler($(this).find(".case_commands_block")[0], id_function);
  18517. });
  18518. });
  18519. }
  18520. function initVisualUI() {
  18521. // MUST USE CONST, LET, OR VAR !!!!!!
  18522. // const mainDiv = $('#visual-main-div');
  18523. // fill mainDiv with functions and globals...
  18524. // renderAlgorithm()...
  18525. domConsole = new _io_domConsole__WEBPACK_IMPORTED_MODULE_8__["DOMConsole"]("ivprog-term-div");
  18526. domConsole.hide();
  18527. $(document.getElementById("ivprog-term-div")).draggable();
  18528. $('.add_function_button').on('click', function () {
  18529. addFunctionHandler();
  18530. });
  18531. $('.add_global_button').on('click', function () {
  18532. window.insertContext = true;
  18533. _globals__WEBPACK_IMPORTED_MODULE_3__["addGlobal"](program, true);
  18534. });
  18535. $('#run_button').on('click', function () {
  18536. showStopButton();
  18537. runCode();
  18538. });
  18539. $('#stop_button').on('click', function () {
  18540. showRunButton();
  18541. stopExecution();
  18542. });
  18543. $('.visual_coding_button').on('click', function () {
  18544. toggleVisualCoding();
  18545. });
  18546. $('.textual_coding_button').on('click', function () {
  18547. toggleTextualCoding();
  18548. });
  18549. $('.assessment').on('click', function () {
  18550. is_iassign = true;
  18551. runCodeAssessment();
  18552. });
  18553. $('.div_toggle_console').on('click', function () {
  18554. toggleConsole();
  18555. });
  18556. $('.expand_button').on('click', function () {
  18557. full_screen();
  18558. });
  18559. $('.help_button').on('click', function () {
  18560. window.open('https://www.usp.br/line/ivprog/', '_blank');
  18561. });
  18562. $('.main_title h2').prop('title', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_ivprog_description'));
  18563. var time_show = 750;
  18564. $('.visual_coding_button').popup({
  18565. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_visual"),
  18566. delay: {
  18567. show: time_show,
  18568. hide: 0
  18569. }
  18570. });
  18571. $('.textual_coding_button').popup({
  18572. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_textual"),
  18573. delay: {
  18574. show: time_show,
  18575. hide: 0
  18576. }
  18577. });
  18578. $('.upload_file_button').popup({
  18579. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_upload"),
  18580. delay: {
  18581. show: time_show,
  18582. hide: 0
  18583. }
  18584. });
  18585. $('.download_file_button').popup({
  18586. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_download"),
  18587. delay: {
  18588. show: time_show,
  18589. hide: 0
  18590. }
  18591. });
  18592. $('.undo_button').popup({
  18593. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_undo"),
  18594. delay: {
  18595. show: time_show,
  18596. hide: 0
  18597. }
  18598. });
  18599. $('.redo_button').popup({
  18600. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_redo"),
  18601. delay: {
  18602. show: time_show,
  18603. hide: 0
  18604. }
  18605. });
  18606. $('.run_button').popup({
  18607. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_run"),
  18608. delay: {
  18609. show: time_show,
  18610. hide: 0
  18611. }
  18612. });
  18613. $('.assessment_button').popup({
  18614. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_evaluate"),
  18615. delay: {
  18616. show: time_show,
  18617. hide: 0
  18618. }
  18619. });
  18620. $('.help_button').popup({
  18621. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_help") + ' - ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_ivprog_version") + ' ' + ivprog_version,
  18622. delay: {
  18623. show: time_show,
  18624. hide: 0
  18625. }
  18626. });
  18627. $('.add_global_button').popup({
  18628. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_add_global"),
  18629. delay: {
  18630. show: time_show,
  18631. hide: 0
  18632. }
  18633. });
  18634. $('.div_toggle_console').popup({
  18635. content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_console"),
  18636. delay: {
  18637. show: time_show,
  18638. hide: 0
  18639. }
  18640. });
  18641. Sortable.create(listWithHandle, {
  18642. handle: '.glyphicon-move',
  18643. animation: 100,
  18644. ghostClass: 'ghost',
  18645. group: 'functions_divs_drag',
  18646. onEnd: function onEnd(evt) {
  18647. updateSequenceFunction(evt.oldIndex, evt.newIndex);
  18648. }
  18649. });
  18650. var listGlobalsHandle = document.getElementById("listGlobalsHandle");
  18651. Sortable.create(listGlobalsHandle, {
  18652. handle: '.ellipsis',
  18653. animation: 100,
  18654. ghostClass: 'ghost',
  18655. group: 'globals_divs_drag',
  18656. onEnd: function onEnd(evt) {
  18657. updateSequenceGlobals(evt.oldIndex, evt.newIndex);
  18658. }
  18659. });
  18660. }
  18661. function setTestCases(testCases) {
  18662. _testCases = testCases;
  18663. }
  18664. function getTestCases() {
  18665. // Deep clone of test cases to avoid unauthorized modification
  18666. // TODO: It may be not possible to use this once custom test are fully implemented
  18667. return JSON.parse(JSON.stringify(_testCases));
  18668. }
  18669. var is_iassign = false;
  18670. function updateSequenceParameters(oldIndex, newIndex, function_obj) {
  18671. function_obj.parameters_list.splice(newIndex, 0, function_obj.parameters_list.splice(oldIndex, 1)[0]);
  18672. }
  18673. function updateSequenceLocals(oldIndex, newIndex, function_obj) {
  18674. function_obj.variables_list.splice(newIndex, 0, function_obj.variables_list.splice(oldIndex, 1)[0]);
  18675. }
  18676. function updateSequenceGlobals(oldIndex, newIndex) {
  18677. program_obj.globals.splice(newIndex, 0, program_obj.globals.splice(oldIndex, 1)[0]);
  18678. }
  18679. function updateSequenceFunction(oldIndex, newIndex) {
  18680. program_obj.functions.splice(newIndex, 0, program_obj.functions.splice(oldIndex, 1)[0]);
  18681. }
  18682. function runCodeAssessment() {
  18683. if (isRunning) {
  18684. // cannot run assessment or it's already running
  18685. return -1;
  18686. }
  18687. var strCode = null;
  18688. window.studentGrade = null;
  18689. if (settingsProgrammingTypes == "textual") {
  18690. strCode = _text_editor__WEBPACK_IMPORTED_MODULE_17__["getCode"]();
  18691. } else {
  18692. strCode = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  18693. }
  18694. if (strCode == null) {
  18695. // No code, so no assessment
  18696. return -1;
  18697. }
  18698. toggleConsole(true);
  18699. try {
  18700. var data = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__["SemanticAnalyser"].analyseFromSource(strCode);
  18701. isRunning = true;
  18702. var runner = new _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_12__["IVProgAssessment"](data, _testCases, domConsole);
  18703. runner.runTest().then(function (grade) {
  18704. if (!is_iassign) {
  18705. parent.getEvaluationCallback(grade);
  18706. } else {
  18707. is_iassign = false;
  18708. }
  18709. isRunning = false;
  18710. })["catch"](function (err) {
  18711. console.log(err);
  18712. isRunning = false;
  18713. });
  18714. } catch (error) {
  18715. isRunning = false;
  18716. domConsole.err(error.message);
  18717. console.log(error);
  18718. if (!is_iassign) {
  18719. parent.getEvaluationCallback(0);
  18720. } else {
  18721. is_iassign = false;
  18722. }
  18723. }
  18724. return 0;
  18725. }
  18726. function runCode() {
  18727. if (isRunning) {
  18728. return;
  18729. }
  18730. var strCode = null;
  18731. if (settingsProgrammingTypes == "textual") {
  18732. strCode = _text_editor__WEBPACK_IMPORTED_MODULE_17__["getCode"]();
  18733. } else {
  18734. strCode = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  18735. }
  18736. if (strCode == null) {
  18737. return;
  18738. }
  18739. toggleConsole(true); // if(domConsole == null)
  18740. // domConsole = new DOMConsole("#ivprog-term");
  18741. //$("#ivprog-term").slideDown(500);
  18742. try {
  18743. var data = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__["SemanticAnalyser"].analyseFromSource(strCode);
  18744. proc = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_9__["IVProgProcessor"](data);
  18745. proc.registerInput(domConsole);
  18746. proc.registerOutput(domConsole);
  18747. $("#ivprog-term").addClass('ivprog-term-active');
  18748. isRunning = true;
  18749. proc.interpretAST().then(function (_) {
  18750. scheduleCall(function () {
  18751. if (domConsole.pending_writes.length == 0) {
  18752. if (proc.mode === _processor_modes__WEBPACK_IMPORTED_MODULE_19__["Modes"].ABORT) {
  18753. domConsole.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getMessage("aborted_execution"));
  18754. } else {
  18755. domConsole.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getMessage("success_execution"));
  18756. }
  18757. $("#ivprog-term").removeClass('ivprog-term-active');
  18758. isRunning = false;
  18759. proc = null;
  18760. showRunButton();
  18761. return true;
  18762. }
  18763. return false;
  18764. }, 100);
  18765. })["catch"](function (err) {
  18766. scheduleCall(function () {
  18767. if (domConsole.pending_writes.length == 0) {
  18768. if (err instanceof Error) {
  18769. domConsole.err(err.message);
  18770. } else {
  18771. domConsole.err(err);
  18772. }
  18773. $("#ivprog-term").removeClass('ivprog-term-active');
  18774. isRunning = false;
  18775. proc = null;
  18776. showRunButton();
  18777. return true;
  18778. }
  18779. return false;
  18780. }, 100);
  18781. });
  18782. } catch (error) {
  18783. scheduleCall(function () {
  18784. if (domConsole.pending_writes.length == 0) {
  18785. isRunning = false;
  18786. proc = null;
  18787. showRunButton();
  18788. domConsole.err(error.message);
  18789. console.log(error);
  18790. return true;
  18791. }
  18792. return false;
  18793. }, 100);
  18794. }
  18795. }
  18796. function toggleConsole(is_running) {
  18797. if (is_running) {
  18798. $('.ivprog-term-div').css('display', 'block');
  18799. $('#ivprog-term').css('min-height', '160px');
  18800. if (domConsole != null) domConsole.focus(); //$('#ivprog-term').css('margin-top', '-170px');
  18801. return;
  18802. } else {
  18803. domConsole.hide();
  18804. return;
  18805. }
  18806. if ($('#ivprog-term').css('min-height') == '160px') {
  18807. // esconder
  18808. $('.ivprog-term-div').css('display', 'none');
  18809. $('#ivprog-term').css('min-height', '0'); //$('#ivprog-term').css('margin-top', '-30px');
  18810. //$('#ivprog-term').css('padding', '5px');
  18811. } else {
  18812. // mostrar
  18813. $('.ivprog-term-div').css('display', 'block');
  18814. $('#ivprog-term').css('min-height', '160px'); //$('#ivprog-term').css('margin-top', '-170px');
  18815. }
  18816. } // function waitToCloseConsole () {
  18817. // domConsole.info("Aperte qualquer tecla para fechar...");
  18818. // const p = new Promise((resolve, _) => {
  18819. // domConsole.requestInput(resolve, true);
  18820. // });
  18821. // p.then( _ => {
  18822. // domConsole.dispose();
  18823. // domConsole = null;
  18824. // $("#ivprog-term").hide();
  18825. // })
  18826. // }
  18827. function toggleTextualCoding() {
  18828. var code = null;
  18829. if (settingsProgrammingTypes != "textual") {
  18830. code = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
  18831. if (code == null) {
  18832. return;
  18833. }
  18834. }
  18835. $('.ivprog_visual_panel').css('display', 'none');
  18836. $('.ivprog_textual_panel').css('display', 'block');
  18837. $('.ivprog_textual_panel').removeClass('loading');
  18838. _text_editor__WEBPACK_IMPORTED_MODULE_17__["updateEditor"]();
  18839. if (code != null) _text_editor__WEBPACK_IMPORTED_MODULE_17__["setCode"](code); //$('.ivprog_textual_code').text(code);
  18840. $('.visual_coding_button').removeClass('active');
  18841. $('.textual_coding_button').addClass('active');
  18842. }
  18843. function toggleVisualCoding() {
  18844. $('.ivprog_textual_panel').addClass('loading');
  18845. $('.ivprog_textual_panel').css('display', 'none');
  18846. $('.ivprog_visual_panel').css('display', 'block');
  18847. $('.textual_coding_button').removeClass('active');
  18848. $('.visual_coding_button').addClass('active');
  18849. }
  18850. function removeParameter(function_obj, parameter_obj, parameter_container) {
  18851. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(parameter_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_FUNCTION_PARAM, function_obj.name);
  18852. var index = function_obj.parameters_list.indexOf(parameter_obj);
  18853. if (index > -1) {
  18854. window.insertContext = true;
  18855. function_obj.parameters_list.splice(index, 1);
  18856. }
  18857. $(parameter_container).fadeOut();
  18858. }
  18859. function updateParameterType(parameter_obj, new_type, function_name) {
  18860. var new_dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  18861. 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);
  18862. parameter_obj.type = new_type;
  18863. parameter_obj.dimensions = new_dimensions;
  18864. if (new_dimensions > 0) {
  18865. parameter_obj.rows = new_dimensions;
  18866. parameter_obj.columns = 2;
  18867. }
  18868. }
  18869. function renderParameter(function_obj, parameter_obj, function_container) {
  18870. var ret = "";
  18871. ret += '<div class="ui label function_name_parameter pink"><i class="ui icon ellipsis vertical inverted"></i>';
  18872. ret += '<div class="ui dropdown parameter_type">';
  18873. if (parameter_obj.dimensions > 0) {
  18874. 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()));
  18875. if (parameter_obj.dimensions == 1) {
  18876. ret += ' [ ] ';
  18877. } else {
  18878. ret += ' [ ] [ ] ';
  18879. }
  18880. ret += '</div>';
  18881. } else {
  18882. ret += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(parameter_obj.type.toLowerCase())) + '</div>';
  18883. }
  18884. ret += '<div class="menu">';
  18885. for (var _tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  18886. if (_tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  18887. continue;
  18888. }
  18889. 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>';
  18890. }
  18891. 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">';
  18892. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  18893. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  18894. continue;
  18895. }
  18896. 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>';
  18897. }
  18898. ret += '</div></div>';
  18899. 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">';
  18900. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  18901. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  18902. continue;
  18903. }
  18904. 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>';
  18905. }
  18906. ret += '</div></div>';
  18907. ret += '</div></div>';
  18908. ret += '<div class="parameter_div_edit"><span class="span_name_parameter label_enable_name_parameter">' + parameter_obj.name + '</span></div> ';
  18909. ret += ' <i class="yellow inverted icon times remove_parameter"></i></div>';
  18910. ret = $(ret);
  18911. function_container.find('.container_parameters_list').append(ret);
  18912. ret.find('.remove_parameter').on('click', function (e) {
  18913. removeParameter(function_obj, parameter_obj, ret);
  18914. });
  18915. ret.find('.ui.dropdown.parameter_type').dropdown({
  18916. onChange: function onChange(_, __, $selectedItem) {
  18917. if ($selectedItem.data('dimensions')) {
  18918. updateParameterType(parameter_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name, $selectedItem.data('dimensions'));
  18919. } else {
  18920. updateParameterType(parameter_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name);
  18921. }
  18922. },
  18923. selectOnKeydown: false
  18924. });
  18925. ret.find('.parameter_div_edit').on('click', function (e) {
  18926. 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);
  18927. enableNameParameterUpdate(parameter_obj, ret, function_obj);
  18928. });
  18929. return ret;
  18930. }
  18931. function updateParameterName(parameter_var, new_name, parameter_obj_dom, function_obj) {
  18932. if (parameter_var.name == new_name) {
  18933. return;
  18934. }
  18935. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_18__["isValidIdentifier"])(new_name)) {
  18936. if (variableNameAlreadyExists(new_name, function_obj)) {
  18937. _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]));
  18938. } else {
  18939. 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);
  18940. parameter_var.name = new_name;
  18941. }
  18942. } else {
  18943. _utils__WEBPACK_IMPORTED_MODULE_14__["renderErrorMessage"](parameter_obj_dom.find('.parameter_div_edit'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  18944. }
  18945. }
  18946. function variableNameAlreadyExists(name_var, function_obj) {
  18947. if (function_obj.parameters_list) {
  18948. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  18949. if (function_obj.parameters_list[i].name == name_var) {
  18950. return true;
  18951. }
  18952. }
  18953. }
  18954. if (function_obj.variables_list) {
  18955. for (var i = 0; i < function_obj.variables_list.length; i++) {
  18956. if (function_obj.variables_list[i].name == name_var) {
  18957. return true;
  18958. }
  18959. }
  18960. }
  18961. return false;
  18962. }
  18963. function updateFunctionName(function_var, new_name, function_obj_dom) {
  18964. if (function_var.name == new_name) {
  18965. return;
  18966. }
  18967. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_18__["isValidIdentifier"])(new_name)) {
  18968. if (functionNameAlreadyExists(new_name)) {
  18969. _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]));
  18970. } else {
  18971. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].RENAME_FUNCTION, new_name);
  18972. function_var.name = new_name;
  18973. }
  18974. } else {
  18975. _utils__WEBPACK_IMPORTED_MODULE_14__["renderErrorMessage"](function_obj_dom.find('.function_name_div'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  18976. }
  18977. }
  18978. function functionNameAlreadyExists(function_name) {
  18979. for (var i = 0; i < window.program_obj.functions.length; i++) {
  18980. if (window.program_obj.functions[i].name == function_name) {
  18981. return true;
  18982. }
  18983. }
  18984. return false;
  18985. }
  18986. var opened_name_parameter = false;
  18987. var opened_input_parameter = null;
  18988. function enableNameParameterUpdate(parameter_obj, parent_node, function_obj) {
  18989. if (opened_name_parameter) {
  18990. opened_input_parameter.focus();
  18991. return;
  18992. }
  18993. opened_name_parameter = true;
  18994. parent_node = $(parent_node);
  18995. var input_field;
  18996. parent_node.find('.span_name_parameter').text('');
  18997. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + parameter_obj.name + "' />");
  18998. input_field.insertBefore(parent_node.find('.span_name_parameter'));
  18999. input_field.on('input', function () {
  19000. var inputWidth = input_field.textWidth() + 10;
  19001. opened_input_parameter = input_field;
  19002. input_field.focus();
  19003. var tmpStr = input_field.val();
  19004. input_field.val('');
  19005. input_field.val(tmpStr);
  19006. input_field.css({
  19007. width: inputWidth
  19008. });
  19009. }).trigger('input');
  19010. input_field.focusout(function () {
  19011. /// update array:
  19012. if (input_field.val().trim()) {
  19013. updateParameterName(parameter_obj, input_field.val().trim(), parent_node, function_obj);
  19014. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  19015. }
  19016. input_field.off();
  19017. input_field.remove(); /// update elements:
  19018. opened_name_parameter = false;
  19019. opened_input_parameter = false;
  19020. });
  19021. input_field.on('keydown', function (e) {
  19022. var code = e.keyCode || e.which;
  19023. if (code == 13) {
  19024. if (input_field.val().trim()) {
  19025. updateParameterName(parameter_obj, input_field.val().trim(), parent_node, function_obj);
  19026. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  19027. }
  19028. input_field.off();
  19029. input_field.remove(); /// update elements:
  19030. opened_name_parameter = false;
  19031. opened_input_parameter = false;
  19032. }
  19033. if (code == 27) {
  19034. parent_node.find('.span_name_parameter').text(parameter_obj.name);
  19035. input_field.off();
  19036. input_field.remove(); /// update elements:
  19037. opened_name_parameter = false;
  19038. opened_input_parameter = false;
  19039. }
  19040. });
  19041. input_field.select();
  19042. }
  19043. var opened_name_function = false;
  19044. var opened_input = null;
  19045. var previousPadding = null;
  19046. function enableNameFunctionUpdate(function_obj, parent_node) {
  19047. if (opened_name_function) {
  19048. opened_input.focus();
  19049. return;
  19050. }
  19051. parent_node = $(parent_node);
  19052. parent_node.find('.span_name_function').text('');
  19053. var input_field;
  19054. if (!previousPadding) {
  19055. previousPadding = parent_node.find('.span_name_function').css('padding-left');
  19056. }
  19057. parent_node.find('.span_name_function').css('padding-left', '0');
  19058. parent_node.find('.span_name_function').css('padding-right', '0');
  19059. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + function_obj.name + "' />");
  19060. input_field.insertBefore(parent_node.find('.span_name_function'));
  19061. input_field.on('input', function () {
  19062. var inputWidth = input_field.textWidth() + 10;
  19063. opened_input = input_field;
  19064. input_field.focus();
  19065. var tmpStr = input_field.val();
  19066. input_field.val('');
  19067. input_field.val(tmpStr);
  19068. input_field.css({
  19069. width: inputWidth
  19070. });
  19071. }).trigger('input');
  19072. input_field.focusout(function () {
  19073. /// update array:
  19074. if (input_field.val().trim()) {
  19075. updateFunctionName(function_obj, input_field.val().trim(), parent_node);
  19076. }
  19077. input_field.off();
  19078. input_field.remove();
  19079. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  19080. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  19081. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  19082. opened_name_function = false;
  19083. opened_input = false;
  19084. });
  19085. input_field.on('keydown', function (e) {
  19086. var code = e.keyCode || e.which;
  19087. if (code == 13) {
  19088. if (input_field.val().trim()) {
  19089. updateFunctionName(function_obj, input_field.val().trim(), parent_node);
  19090. }
  19091. input_field.off();
  19092. input_field.remove();
  19093. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  19094. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  19095. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  19096. opened_name_function = false;
  19097. opened_input = false;
  19098. }
  19099. if (code == 27) {
  19100. input_field.off();
  19101. input_field.remove();
  19102. parent_node.find('.span_name_function').css('padding-left', previousPadding);
  19103. parent_node.find('.span_name_function').css('padding-right', previousPadding);
  19104. parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
  19105. opened_name_function = false;
  19106. opened_input = false;
  19107. }
  19108. });
  19109. input_field.select();
  19110. }
  19111. function addFunctionChangeListener(callback) {
  19112. functionsChangeListeners.push(callback);
  19113. return functionsChangeListeners.length - 1;
  19114. }
  19115. function addGlobalChangeListener(callback) {
  19116. globalChangeListeners.push(callback);
  19117. return globalChangeListeners.length - 1;
  19118. }
  19119. function removeGlobalListener(index) {
  19120. globalChangeListeners.splice(index, 1);
  19121. }
  19122. function removeFunctionListener(index) {
  19123. functionsChangeListeners.splice(index);
  19124. }
  19125. function scheduleCall(callback, time) {
  19126. var scheduled_call = function scheduled_call() {
  19127. var id = setInterval(function () {
  19128. if (callback()) {
  19129. clearInterval(id);
  19130. }
  19131. }, time);
  19132. };
  19133. scheduled_call();
  19134. }
  19135. function showRunButton() {
  19136. document.getElementById('run_button').style.display = 'inline';
  19137. document.getElementById('stop_button').style.display = 'none';
  19138. }
  19139. function showStopButton() {
  19140. document.getElementById('run_button').style.display = 'none';
  19141. document.getElementById('stop_button').style.display = 'inline';
  19142. }
  19143. function stopExecution() {
  19144. domConsole.clearPendingWrites();
  19145. domConsole.cancelPendingInputRequests();
  19146. if (!isRunning) {
  19147. return;
  19148. }
  19149. proc.mode = _processor_modes__WEBPACK_IMPORTED_MODULE_19__["Modes"].ABORT;
  19150. }
  19151. /***/ }),
  19152. /***/ "./js/visualUI/globals.js":
  19153. /*!********************************!*\
  19154. !*** ./js/visualUI/globals.js ***!
  19155. \********************************/
  19156. /*! exports provided: addGlobal, renderGlobal */
  19157. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19158. "use strict";
  19159. __webpack_require__.r(__webpack_exports__);
  19160. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addGlobal", function() { return addGlobal; });
  19161. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderGlobal", function() { return renderGlobal; });
  19162. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  19163. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  19164. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  19165. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  19166. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  19167. var counter_new_globals = 0;
  19168. function addGlobal(program) {
  19169. var is_from_click = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  19170. 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);
  19171. counter_new_globals++;
  19172. program.addGlobal(new_global);
  19173. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(new_global.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].INSERT_GLOBAL_VAR);
  19174. var newe = renderGlobal(new_global);
  19175. if (is_from_click) {
  19176. newe.css('display', 'none');
  19177. newe.fadeIn();
  19178. }
  19179. }
  19180. function toggleConstant(global_var) {
  19181. global_var.is_constant = !global_var.is_constant;
  19182. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].SET_GLOBAL_CONST);
  19183. }
  19184. function updateName(global_var, new_name, global_obj_dom) {
  19185. if (global_var.name == new_name) {
  19186. return;
  19187. }
  19188. if (isValidIdentifier(new_name)) {
  19189. if (globalNameAlreadyExists(new_name)) {
  19190. _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'));
  19191. } else {
  19192. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].RENAME_GLOBAL_VAR, new_name);
  19193. global_var.name = new_name;
  19194. }
  19195. } else {
  19196. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](global_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('inform_valid_name'));
  19197. }
  19198. }
  19199. function globalNameAlreadyExists(global_name) {
  19200. for (var i = 0; i < window.program_obj.globals.length; i++) {
  19201. if (window.program_obj.globals[i].name == global_name) {
  19202. return true;
  19203. }
  19204. }
  19205. return false;
  19206. }
  19207. function isValidIdentifier(identifier_str) {
  19208. return /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier_str);
  19209. }
  19210. function updateType(global_var, new_type) {
  19211. var new_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  19212. global_var.type = new_type;
  19213. global_var.dimensions = new_dimensions;
  19214. if (new_dimensions > 0) {
  19215. global_var.rows = new_dimensions;
  19216. global_var.columns = 2;
  19217. }
  19218. 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);
  19219. updateInitialValues(global_var);
  19220. }
  19221. function removeGlobal(global_var, global_container) {
  19222. var index = window.program_obj.globals.indexOf(global_var);
  19223. if (index > -1) {
  19224. window.insertContext = true;
  19225. window.program_obj.globals.splice(index, 1);
  19226. }
  19227. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].REMOVE_GLOBAL_VAR);
  19228. global_container.children().off();
  19229. global_container.off();
  19230. global_container.fadeOut();
  19231. }
  19232. function updateInitialValues(global_var) {
  19233. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  19234. if (global_var.dimensions == 0) {
  19235. global_var.value = 0;
  19236. }
  19237. if (global_var.dimensions == 1) {
  19238. global_var.value = [0, 0];
  19239. }
  19240. if (global_var.dimensions == 2) {
  19241. global_var.value = [[0, 0], [0, 0]];
  19242. }
  19243. }
  19244. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19245. if (global_var.dimensions == 0) {
  19246. global_var.value = 0.0;
  19247. }
  19248. if (global_var.dimensions == 1) {
  19249. global_var.value = [0.0, 0.0];
  19250. }
  19251. if (global_var.dimensions == 2) {
  19252. global_var.value = [[0.0, 0.0], [0.0, 0.0]];
  19253. }
  19254. }
  19255. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  19256. if (global_var.dimensions == 0) {
  19257. global_var.value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value');
  19258. }
  19259. if (global_var.dimensions == 1) {
  19260. 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')];
  19261. }
  19262. if (global_var.dimensions == 2) {
  19263. 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')]];
  19264. }
  19265. }
  19266. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  19267. if (global_var.dimensions == 0) {
  19268. global_var.value = true;
  19269. }
  19270. if (global_var.dimensions == 1) {
  19271. global_var.value = [true, true];
  19272. }
  19273. if (global_var.dimensions == 2) {
  19274. global_var.value = [[true, true], [true, true]];
  19275. }
  19276. }
  19277. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.name, global_var.value);
  19278. }
  19279. function alternateBooleanGlobalValue(global_var, value_container) {
  19280. global_var.value = !global_var.value;
  19281. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value)));
  19282. }
  19283. function alternateBooleanGlobalVectorValue(global_var, index, value_container) {
  19284. global_var.value[index] = !global_var.value[index];
  19285. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value[index])));
  19286. }
  19287. function removeGlobalColumnVector(global_var) {
  19288. if (global_var.columns == 0) {
  19289. return;
  19290. }
  19291. global_var.columns--;
  19292. global_var.value.splice(global_var.value.length - 1, 1);
  19293. }
  19294. function addGlobalColumnVector(global_var) {
  19295. global_var.columns++;
  19296. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  19297. global_var.value.push(0);
  19298. }
  19299. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19300. global_var.value.push(0.0);
  19301. }
  19302. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  19303. global_var.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  19304. }
  19305. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  19306. global_var.value.push(true);
  19307. }
  19308. }
  19309. function removeColumnGlobalMatrix(global_var) {
  19310. if (global_var.columns == 0) {
  19311. return;
  19312. }
  19313. global_var.columns--;
  19314. for (var i = 0; i < global_var.rows; i++) {
  19315. global_var.value[i].splice(global_var.value[i].length - 1, 1);
  19316. }
  19317. }
  19318. function addColumnGlobalMatrix(global_var) {
  19319. global_var.columns++;
  19320. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  19321. for (var i = 0; i < global_var.rows; i++) {
  19322. global_var.value[i].push(0);
  19323. }
  19324. }
  19325. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19326. for (var i = 0; i < global_var.rows; i++) {
  19327. global_var.value[i].push(0.0);
  19328. }
  19329. }
  19330. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  19331. for (var i = 0; i < global_var.rows; i++) {
  19332. global_var.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  19333. }
  19334. }
  19335. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  19336. for (var i = 0; i < global_var.rows; i++) {
  19337. global_var.value[i].push(true);
  19338. }
  19339. }
  19340. }
  19341. function removeLineGlobalMatrix(global_var) {
  19342. if (global_var.rows == 0) {
  19343. return;
  19344. }
  19345. global_var.rows--;
  19346. global_var.value.splice(global_var.value.length - 1, 1);
  19347. }
  19348. function addLineGlobalMatrix(global_var) {
  19349. global_var.rows++;
  19350. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  19351. var n_l = [];
  19352. for (var i = 0; i < global_var.columns; i++) {
  19353. n_l.push(0);
  19354. }
  19355. global_var.value.push(n_l);
  19356. }
  19357. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19358. var n_l = [];
  19359. for (i = 0; i < global_var.columns; i++) {
  19360. n_l.push(0.0);
  19361. }
  19362. global_var.value.push(n_l);
  19363. }
  19364. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  19365. var n_l = [];
  19366. for (i = 0; i < global_var.columns; i++) {
  19367. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  19368. }
  19369. global_var.value.push(n_l);
  19370. }
  19371. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  19372. var n_l = [];
  19373. for (i = 0; i < global_var.columns; i++) {
  19374. n_l.push(true);
  19375. }
  19376. global_var.value.push(n_l);
  19377. }
  19378. }
  19379. function alternateBooleanGlobalMatrixValue(global_var, row, index, value_container) {
  19380. global_var.value[row][index] = !global_var.value[row][index];
  19381. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value[row][index])));
  19382. }
  19383. function renderValues(global_var, global_container) {
  19384. var ret = "";
  19385. var j = 0;
  19386. if (global_var.dimensions == 0) {
  19387. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19388. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + global_var.value.toFixed(1) + '</span> </div> ';
  19389. } else {
  19390. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  19391. 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> ';
  19392. } else {
  19393. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + global_var.value + '</span> </div> ';
  19394. }
  19395. }
  19396. } else {
  19397. ret += '<table class="tabela_var">';
  19398. if (global_var.dimensions == 1) {
  19399. ret += '<tr>';
  19400. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19401. for (var k = 0; k < global_var.columns; k++) {
  19402. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + global_var.value[k].toFixed(1) + '</span></td>';
  19403. }
  19404. } else {
  19405. for (var k = 0; k < global_var.columns; k++) {
  19406. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  19407. 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>';
  19408. } else {
  19409. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + global_var.value[k] + '</span>' + '</td>';
  19410. }
  19411. }
  19412. }
  19413. ret += '</tr>';
  19414. ret += '</table>';
  19415. 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>';
  19416. }
  19417. if (global_var.dimensions == 2) {
  19418. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19419. for (var l = 0; l < global_var.rows; l++) {
  19420. ret += '<tr>';
  19421. for (var k = 0; k < global_var.columns; k++) {
  19422. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + global_var.value[l][k].toFixed(1) + '</span>' + '</td>';
  19423. }
  19424. ret += '</tr>';
  19425. }
  19426. } else {
  19427. for (var l = 0; l < global_var.rows; l++) {
  19428. ret += '<tr>';
  19429. for (var k = 0; k < global_var.columns; k++) {
  19430. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  19431. 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>';
  19432. } else {
  19433. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + global_var.value[l][k] + '</span></td>';
  19434. }
  19435. }
  19436. ret += '</tr>';
  19437. }
  19438. }
  19439. if (global_var.rows == 0) {
  19440. ret += '<tr><td></td></tr>';
  19441. }
  19442. 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>';
  19443. ret += '</table>';
  19444. 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>';
  19445. }
  19446. }
  19447. global_container.find(".div_valor_var").html('');
  19448. ret = $(ret);
  19449. ret.find('.span_value_variable').data('associatedOject', global_var);
  19450. ret.find(".boolean_simple_type").on('click', function (e) {
  19451. alternateBooleanGlobalValue(global_var, this.parentNode);
  19452. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  19453. });
  19454. ret.find(".simple_var").on('click', function (e) {
  19455. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  19456. enableGlobalValueUpdate(global_var, this.parentNode);
  19457. });
  19458. ret.find(".boolean_vector_var").on('click', function (e) {
  19459. alternateBooleanGlobalVectorValue(global_var, $(this).data('index'), this.parentNode);
  19460. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  19461. });
  19462. ret.find(".vector_var").on('click', function (e) {
  19463. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  19464. enableGlobalVectorValueUpdate(global_var, $(this).data('index'), this.parentNode);
  19465. });
  19466. ret.find(".remove_global_vector_column").on('click', function (e) {
  19467. removeGlobalColumnVector(global_var);
  19468. global_container.find(".div_valor_var").html('');
  19469. 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);
  19470. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  19471. renderValues(global_var, global_container);
  19472. });
  19473. ret.find(".add_global_vector_column").on('click', function (e) {
  19474. addGlobalColumnVector(global_var);
  19475. 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);
  19476. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  19477. global_container.find(".div_valor_var").html('');
  19478. renderValues(global_var, global_container);
  19479. });
  19480. ret.find(".remove_global_matrix_column").on('click', function (e) {
  19481. removeColumnGlobalMatrix(global_var);
  19482. 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);
  19483. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  19484. global_container.find(".div_valor_var").html('');
  19485. renderValues(global_var, global_container);
  19486. });
  19487. ret.find(".add_global_matrix_column").on('click', function (e) {
  19488. addColumnGlobalMatrix(global_var);
  19489. 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);
  19490. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  19491. global_container.find(".div_valor_var").html('');
  19492. renderValues(global_var, global_container);
  19493. });
  19494. ret.find(".remove_global_matrix_line").on('click', function (e) {
  19495. removeLineGlobalMatrix(global_var);
  19496. 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);
  19497. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  19498. global_container.find(".div_valor_var").html('');
  19499. renderValues(global_var, global_container);
  19500. });
  19501. ret.find(".add_global_matrix_line").on('click', function (e) {
  19502. addLineGlobalMatrix(global_var);
  19503. 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);
  19504. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  19505. global_container.find(".div_valor_var").html('');
  19506. renderValues(global_var, global_container);
  19507. });
  19508. ret.find(".boolean_matrix_var").on('click', function (e) {
  19509. alternateBooleanGlobalMatrixValue(global_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  19510. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  19511. });
  19512. ret.find(".matrix_var").on('click', function (e) {
  19513. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
  19514. enableGlobalMatrixValueUpdate(global_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  19515. });
  19516. global_container.find(".div_valor_var").append(ret);
  19517. updateColumnsAndRowsText(global_container, global_var);
  19518. }
  19519. function addHandlers(global_container) {
  19520. var global_var = global_container.data('associatedOject'); // Manage constant option:
  19521. global_container.find(".alternate_constant").on('click', function (e) {
  19522. toggleConstant(global_var);
  19523. $(this).removeClass("on off");
  19524. if (global_var.is_constant) {
  19525. $(this).addClass("on");
  19526. } else {
  19527. $(this).addClass("off");
  19528. }
  19529. }); // Manage global name:
  19530. global_container.find(".editing_name_var").on('click', function (e) {
  19531. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_NAME);
  19532. enableNameUpdate(global_container);
  19533. }); // Menu to change type:
  19534. global_container.find('.ui.dropdown.global_type').dropdown({
  19535. onChange: function onChange(_, __, $selectedItem) {
  19536. if ($selectedItem.data('dimensions')) {
  19537. updateType(global_var, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], $selectedItem.data('dimensions'));
  19538. } else {
  19539. updateType(global_var, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')]);
  19540. }
  19541. renderValues(global_var, global_container);
  19542. },
  19543. selectOnKeydown: false
  19544. }); // Remove global:
  19545. global_container.find(".remove_global").on('click', function (e) {
  19546. removeGlobal(global_var, global_container);
  19547. });
  19548. }
  19549. function updateColumnsAndRowsText(global_container, global_var) {
  19550. var prev = global_container.find('.text').text().split('[');
  19551. if (prev.length == 2) {
  19552. var ff = prev[0] + '[ ' + global_var.columns + ' ] ';
  19553. global_container.find('.text').empty();
  19554. global_container.find('.text').text(ff);
  19555. }
  19556. if (prev.length == 3) {
  19557. var ff = prev[0] + '[ ' + global_var.columns + ' ] [ ' + global_var.rows + ' ] ';
  19558. global_container.find('.text').empty();
  19559. global_container.find('.text').text(ff);
  19560. }
  19561. }
  19562. function renderGlobal(global_var) {
  19563. var element = '<div class="ui label global_container pink"><i class="ui icon ellipsis vertical inverted"></i><div class="global_const">const: ';
  19564. element += '<i class="ui icon toggle ' + (global_var.is_constant ? "on" : "off") + ' alternate_constant"></i></div>';
  19565. element += '<div class="ui dropdown global_type">';
  19566. if (global_var.dimensions == 1) {
  19567. 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));
  19568. element += ' [ <span class="dimensions_0"></span> ] ';
  19569. element += '</div>';
  19570. } else if (global_var.dimensions == 2) {
  19571. 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));
  19572. element += ' [ <span class="dimensions_0"></span> ] [ <span class="dimensions_1"></span> ] ';
  19573. element += '</div>';
  19574. } else {
  19575. element += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(global_var.type.toLowerCase())) + '</div>';
  19576. }
  19577. element += '<div class="menu">';
  19578. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  19579. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  19580. continue;
  19581. }
  19582. 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>';
  19583. }
  19584. 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">';
  19585. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  19586. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  19587. continue;
  19588. }
  19589. 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>';
  19590. }
  19591. element += '</div></div>';
  19592. 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">';
  19593. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  19594. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  19595. continue;
  19596. }
  19597. 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>';
  19598. }
  19599. element += '</div></div>';
  19600. 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> ';
  19601. element += '<div class="ui div_valor_var">' + global_var.value + '</div>';
  19602. element += ' <i class="yellow inverted icon times remove_global"></i></div>';
  19603. var complete_element = $(element);
  19604. complete_element.data('associatedOject', global_var);
  19605. $('.list_globals').append(complete_element);
  19606. addHandlers(complete_element);
  19607. renderValues(global_var, complete_element);
  19608. if (global_var.dimensions == 1) {
  19609. complete_element.find('.dimensions_0').text(global_var.columns);
  19610. }
  19611. if (global_var.dimensions == 2) {
  19612. complete_element.find('.dimensions_0').text(global_var.columns);
  19613. complete_element.find('.dimensions_1').text(global_var.rows);
  19614. }
  19615. return complete_element;
  19616. }
  19617. var opened_name_value_matrix_global_v = false;
  19618. var opened_input_value_matrix_global_v = null;
  19619. function enableGlobalMatrixValueUpdate(global_var, row, index, parent_node) {
  19620. if (opened_name_value_matrix_global_v) {
  19621. opened_input_value_matrix_global_v.focus();
  19622. return;
  19623. }
  19624. parent_node = $(parent_node);
  19625. opened_name_value_matrix_global_v = true;
  19626. parent_node.find('.span_value_variable').text('');
  19627. var input_field;
  19628. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19629. 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) + "' />");
  19630. input_field.insertBefore(parent_node.find('.span_value_variable'));
  19631. } else {
  19632. 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] + "' />");
  19633. input_field.insertBefore(parent_node.find('.span_value_variable'));
  19634. }
  19635. input_field.on('input', function () {
  19636. var inputWidth = input_field.textWidth() + 10;
  19637. opened_input_value_matrix_global_v = input_field;
  19638. input_field.focus();
  19639. var tmpStr = input_field.val();
  19640. input_field.val('');
  19641. input_field.val(tmpStr);
  19642. input_field.css({
  19643. width: inputWidth
  19644. });
  19645. }).trigger('input');
  19646. input_field.focusout(function () {
  19647. /// update array:
  19648. if (input_field.val().trim()) {
  19649. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19650. global_var.value[row][index] = parseFloat(input_field.val().trim());
  19651. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  19652. } else {
  19653. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  19654. global_var.value[row][index] = parseInt(input_field.val().trim());
  19655. } else {
  19656. global_var.value[row][index] = input_field.val().trim();
  19657. }
  19658. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  19659. }
  19660. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  19661. } else {
  19662. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19663. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  19664. } else {
  19665. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  19666. }
  19667. }
  19668. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  19669. global_var.value[row][index] = input_field.val();
  19670. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  19671. }
  19672. input_field.off();
  19673. input_field.remove(); /// update elements:
  19674. opened_name_value_matrix_global_v = false;
  19675. opened_input_value_matrix_global_v = false;
  19676. });
  19677. input_field.on('keydown', function (e) {
  19678. var code = e.keyCode || e.which;
  19679. if (code == 13) {
  19680. if (input_field.val().trim()) {
  19681. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19682. global_var.value[row][index] = parseFloat(input_field.val().trim());
  19683. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  19684. } else {
  19685. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  19686. global_var.value[row][index] = parseInt(input_field.val().trim());
  19687. } else {
  19688. global_var.value[row][index] = input_field.val().trim();
  19689. }
  19690. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  19691. }
  19692. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  19693. } else {
  19694. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19695. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  19696. } else {
  19697. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  19698. }
  19699. }
  19700. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  19701. global_var.value[row][index] = input_field.val();
  19702. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  19703. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  19704. }
  19705. input_field.off();
  19706. input_field.remove(); /// update elements:
  19707. opened_name_value_matrix_global_v = false;
  19708. opened_input_value_matrix_global_v = false;
  19709. }
  19710. if (code == 27) {
  19711. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19712. parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
  19713. } else {
  19714. parent_node.find('.span_value_variable').text(global_var.value[row][index]);
  19715. }
  19716. input_field.off();
  19717. input_field.remove(); /// update elements:
  19718. opened_name_value_matrix_global_v = false;
  19719. opened_input_value_matrix_global_v = false;
  19720. }
  19721. });
  19722. input_field.select();
  19723. }
  19724. var opened_name_value_global_var = false;
  19725. var opened_input_value_global_ar = null;
  19726. function enableGlobalValueUpdate(global_var, parent_node) {
  19727. if (opened_name_value_global_var) {
  19728. opened_input_value_global_ar.focus();
  19729. return;
  19730. }
  19731. parent_node = $(parent_node);
  19732. opened_name_value_global_var = true;
  19733. parent_node.find('.span_value_variable').text('');
  19734. var input_field;
  19735. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19736. 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) + "' />");
  19737. input_field.insertBefore(parent_node.find('.span_value_variable'));
  19738. } else {
  19739. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.value + "' />");
  19740. input_field.insertBefore(parent_node.find('.span_value_variable'));
  19741. }
  19742. input_field.on('input', function () {
  19743. var inputWidth = input_field.textWidth() + 10;
  19744. opened_input_value_global_ar = input_field;
  19745. input_field.focus();
  19746. var tmpStr = input_field.val();
  19747. input_field.val('');
  19748. input_field.val(tmpStr);
  19749. input_field.css({
  19750. width: inputWidth
  19751. });
  19752. }).trigger('input');
  19753. input_field.focusout(function () {
  19754. var changed = false; /// update array:
  19755. if (input_field.val().trim()) {
  19756. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19757. global_var.value = parseFloat(input_field.val().trim());
  19758. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  19759. } else {
  19760. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  19761. global_var.value = parseInt(input_field.val().trim());
  19762. } else {
  19763. global_var.value = input_field.val().trim();
  19764. }
  19765. parent_node.find('.span_value_variable').text(global_var.value);
  19766. }
  19767. changed = true;
  19768. } else {
  19769. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19770. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  19771. } else {
  19772. parent_node.find('.span_value_variable').text(global_var.value);
  19773. }
  19774. }
  19775. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  19776. global_var.value = input_field.val();
  19777. changed = true;
  19778. parent_node.find('.span_value_variable').text(global_var.value);
  19779. }
  19780. if (changed) {
  19781. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  19782. }
  19783. input_field.off();
  19784. input_field.remove(); /// update elements:
  19785. opened_name_value_global_var = false;
  19786. opened_input_value_global_ar = false;
  19787. });
  19788. input_field.on('keydown', function (e) {
  19789. var code = e.keyCode || e.which;
  19790. var changed = true;
  19791. if (code == 13) {
  19792. if (input_field.val().trim()) {
  19793. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19794. global_var.value = parseFloat(input_field.val().trim());
  19795. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  19796. } else {
  19797. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  19798. global_var.value = parseInt(input_field.val().trim());
  19799. } else {
  19800. global_var.value = input_field.val().trim();
  19801. }
  19802. parent_node.find('.span_value_variable').text(global_var.value);
  19803. }
  19804. changed = true;
  19805. } else {
  19806. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19807. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  19808. } else {
  19809. parent_node.find('.span_value_variable').text(global_var.value);
  19810. }
  19811. }
  19812. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  19813. global_var.value = input_field.val();
  19814. changed = true;
  19815. parent_node.find('.span_value_variable').text(global_var.value);
  19816. }
  19817. if (changed) {
  19818. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  19819. }
  19820. input_field.off();
  19821. input_field.remove(); /// update elements:
  19822. opened_name_value_global_var = false;
  19823. opened_input_value_global_ar = false;
  19824. }
  19825. if (code == 27) {
  19826. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19827. parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
  19828. } else {
  19829. parent_node.find('.span_value_variable').text(global_var.value);
  19830. }
  19831. input_field.off();
  19832. input_field.remove(); /// update elements:
  19833. opened_name_value_global_var = false;
  19834. opened_input_value_global_ar = false;
  19835. }
  19836. });
  19837. input_field.select();
  19838. }
  19839. var opened_name_global = false;
  19840. var opened_input_global = null;
  19841. function enableNameUpdate(global_container) {
  19842. var global_var = global_container.data('associatedOject');
  19843. if (opened_name_global) {
  19844. opened_input_global.focus();
  19845. return;
  19846. }
  19847. opened_name_global = true;
  19848. global_container.find('.span_name_variable').text('');
  19849. var input_name = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.name + "' />");
  19850. input_name.insertBefore(global_container.find('.span_name_variable'));
  19851. input_name.on('input', function () {
  19852. var inputWidth = input_name.textWidth() + 10;
  19853. opened_input_global = input_name;
  19854. opened_input_global.focus();
  19855. opened_input_global.css({
  19856. width: inputWidth
  19857. });
  19858. }).trigger('input');
  19859. input_name.focusout(function () {
  19860. /// update array:
  19861. if (input_name.val().trim().length > 0) {
  19862. updateName(global_var, input_name.val().trim(), global_container);
  19863. global_container.find('.span_name_variable').text(global_var.name);
  19864. } else {
  19865. global_container.find('.span_name_variable').text(global_var.name);
  19866. }
  19867. input_name.off();
  19868. input_name.remove(); /// update elements:
  19869. opened_name_global = false;
  19870. opened_input_global = false;
  19871. });
  19872. input_name.on('keydown', function (e) {
  19873. var code = e.keyCode || e.which;
  19874. if (code == 13) {
  19875. if (input_name.val().trim()) {
  19876. updateName(global_var, input_name.val().trim(), global_container);
  19877. global_container.find('.span_name_variable').text(global_var.name);
  19878. } else {
  19879. global_container.find('.span_name_variable').text(global_var.name);
  19880. }
  19881. input_name.off();
  19882. input_name.remove(); /// update elements:
  19883. opened_name_global = false;
  19884. opened_input_global = false;
  19885. }
  19886. if (code == 27) {
  19887. global_container.find('.span_name_variable').text(global_var.name);
  19888. input_name.off();
  19889. input_name.remove(); /// update elements:
  19890. opened_name_global = false;
  19891. opened_input_global = false;
  19892. }
  19893. });
  19894. input_name.select();
  19895. }
  19896. var opened_name_value_vector_global_ = false;
  19897. var opened_input_value_vector_global_ = null;
  19898. function enableGlobalVectorValueUpdate(global_var, index, parent_node) {
  19899. if (opened_name_value_vector_global_) {
  19900. opened_input_value_vector_global_.focus();
  19901. return;
  19902. }
  19903. parent_node = $(parent_node);
  19904. opened_name_value_vector_global_ = true;
  19905. parent_node.find('.span_value_variable').text('');
  19906. var input_field;
  19907. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19908. 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) + "' />");
  19909. input_field.insertBefore(parent_node.find('.span_value_variable'));
  19910. } else {
  19911. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.value[index] + "' />");
  19912. input_field.insertBefore(parent_node.find('.span_value_variable'));
  19913. }
  19914. input_field.on('input', function () {
  19915. var inputWidth = input_field.textWidth() + 10;
  19916. opened_input_value_vector_global_ = input_field;
  19917. input_field.focus();
  19918. var tmpStr = input_field.val();
  19919. input_field.val('');
  19920. input_field.val(tmpStr);
  19921. input_field.css({
  19922. width: inputWidth
  19923. });
  19924. }).trigger('input');
  19925. input_field.focusout(function () {
  19926. var changed = false; /// update array:
  19927. if (input_field.val().trim()) {
  19928. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19929. global_var.value[index] = parseFloat(input_field.val().trim());
  19930. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  19931. } else {
  19932. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  19933. global_var.value[index] = parseInt(input_field.val().trim());
  19934. } else {
  19935. global_var.value[index] = input_field.val().trim();
  19936. }
  19937. parent_node.find('.span_value_variable').text(global_var.value[index]);
  19938. }
  19939. changed = true;
  19940. } else {
  19941. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19942. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  19943. } else {
  19944. parent_node.find('.span_value_variable').text(global_var.value[index]);
  19945. }
  19946. }
  19947. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  19948. global_var.value[index] = input_field.val();
  19949. changed = true;
  19950. parent_node.find('.span_value_variable').text(global_var.value[index]);
  19951. }
  19952. if (changed) {
  19953. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  19954. }
  19955. input_field.off();
  19956. input_field.remove(); /// update elements:
  19957. opened_name_value_vector_global_ = false;
  19958. opened_input_value_vector_global_ = false;
  19959. });
  19960. input_field.on('keydown', function (e) {
  19961. var code = e.keyCode || e.which;
  19962. var changed = false;
  19963. if (code == 13) {
  19964. if (input_field.val().trim()) {
  19965. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19966. global_var.value[index] = parseFloat(input_field.val().trim());
  19967. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  19968. } else {
  19969. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  19970. global_var.value[index] = parseInt(input_field.val().trim());
  19971. } else {
  19972. global_var.value[index] = input_field.val().trim();
  19973. }
  19974. parent_node.find('.span_value_variable').text(global_var.value[index]);
  19975. }
  19976. changed = true;
  19977. } else {
  19978. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19979. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  19980. } else {
  19981. parent_node.find('.span_value_variable').text(global_var.value[index]);
  19982. }
  19983. }
  19984. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  19985. global_var.value[index] = input_field.val();
  19986. changed = true;
  19987. parent_node.find('.span_value_variable').text(global_var.value[index]);
  19988. }
  19989. if (changed) {
  19990. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
  19991. }
  19992. input_field.off();
  19993. input_field.remove(); /// update elements:
  19994. opened_name_value_vector_global_ = false;
  19995. opened_input_value_vector_global_ = false;
  19996. }
  19997. if (code == 27) {
  19998. if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  19999. parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
  20000. } else {
  20001. parent_node.find('.span_value_variable').text(global_var.value[index]);
  20002. }
  20003. input_field.off();
  20004. input_field.remove(); /// update elements:
  20005. opened_name_value_vector_global_ = false;
  20006. opened_input_value_vector_global_ = false;
  20007. }
  20008. });
  20009. input_field.select();
  20010. }
  20011. $.fn.textWidth = function (text, font) {
  20012. if (!$.fn.textWidth.fakeEl) $.fn.textWidth.fakeEl = $('<span>').hide().appendTo(document.body);
  20013. $.fn.textWidth.fakeEl.text(text || this.val() || this.text() || this.attr('placeholder')).css('font', font || this.css('font'));
  20014. return $.fn.textWidth.fakeEl.width();
  20015. };
  20016. /***/ }),
  20017. /***/ "./js/visualUI/ivprog_elements.js":
  20018. /*!****************************************!*\
  20019. !*** ./js/visualUI/ivprog_elements.js ***!
  20020. \****************************************/
  20021. /*! 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 */
  20022. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20023. "use strict";
  20024. __webpack_require__.r(__webpack_exports__);
  20025. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMMAND_TYPES", function() { return COMMAND_TYPES; });
  20026. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARITHMETIC_TYPES", function() { return ARITHMETIC_TYPES; });
  20027. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXPRESSION_ELEMENTS", function() { return EXPRESSION_ELEMENTS; });
  20028. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXPRESSION_TYPES", function() { return EXPRESSION_TYPES; });
  20029. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARITHMETIC_COMPARISON", function() { return ARITHMETIC_COMPARISON; });
  20030. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOGIC_COMPARISON", function() { return LOGIC_COMPARISON; });
  20031. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYSTEM_FUNCTIONS_CATEGORIES", function() { return SYSTEM_FUNCTIONS_CATEGORIES; });
  20032. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Variable", function() { return Variable; });
  20033. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Function", function() { return Function; });
  20034. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SystemFunction", function() { return SystemFunction; });
  20035. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Comment", function() { return Comment; });
  20036. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Break", function() { return Break; });
  20037. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Reader", function() { return Reader; });
  20038. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Writer", function() { return Writer; });
  20039. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Attribution", function() { return Attribution; });
  20040. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpressionOperator", function() { return ExpressionOperator; });
  20041. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpressionElement", function() { return ExpressionElement; });
  20042. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConditionalExpression", function() { return ConditionalExpression; });
  20043. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogicExpression", function() { return LogicExpression; });
  20044. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArithmeticExpression", function() { return ArithmeticExpression; });
  20045. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IfTrue", function() { return IfTrue; });
  20046. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RepeatNTimes", function() { return RepeatNTimes; });
  20047. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WhileTrue", function() { return WhileTrue; });
  20048. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DoWhileTrue", function() { return DoWhileTrue; });
  20049. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return Switch; });
  20050. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Return", function() { return Return; });
  20051. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SwitchCase", function() { return SwitchCase; });
  20052. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return FunctionCall; });
  20053. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VariableValueMenu", function() { return VariableValueMenu; });
  20054. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCallMenu", function() { return FunctionCallMenu; });
  20055. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Program", function() { return Program; });
  20056. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  20057. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
  20058. /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_1__);
  20059. /* harmony import */ var _algorithm__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./algorithm */ "./js/visualUI/algorithm.js");
  20060. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  20061. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  20062. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20063. var COMMAND_TYPES = Object.freeze({
  20064. "function": "function",
  20065. comment: "comment",
  20066. reader: "reader",
  20067. writer: "writer",
  20068. attribution: "attribution",
  20069. iftrue: "iftrue",
  20070. repeatNtimes: "repeatNtimes",
  20071. whiletrue: "whiletrue",
  20072. dowhiletrue: "dowhiletrue",
  20073. "switch": "switch",
  20074. switchcase: "switchcase",
  20075. functioncall: "functioncall",
  20076. "break": "break",
  20077. "return": "return"
  20078. });
  20079. var ARITHMETIC_TYPES = Object.freeze({
  20080. plus: "plus",
  20081. minus: "minus",
  20082. multiplication: "multiplication",
  20083. division: "division",
  20084. module: "module",
  20085. none: "none"
  20086. });
  20087. var EXPRESSION_ELEMENTS = Object.freeze({
  20088. exp_op_exp: "exp_op_exp",
  20089. op_exp: "op_exp",
  20090. par_exp_par: "par_exp_par",
  20091. start_point: "start_point"
  20092. });
  20093. var EXPRESSION_TYPES = Object.freeze({
  20094. exp_conditional: "exp_conditional",
  20095. exp_logic: "exp_logic",
  20096. exp_arithmetic: "exp_arithmetic"
  20097. });
  20098. var ARITHMETIC_COMPARISON = Object.freeze({
  20099. greater_than: "greater_than",
  20100. less_than: "less_than",
  20101. equals_to: "equals_to",
  20102. not_equals_to: "not_equals_to",
  20103. greater_than_or_equals_to: "greater_than_or_equals_to",
  20104. less_than_or_equals_to: "less_than_or_equals_to"
  20105. });
  20106. var LOGIC_COMPARISON = Object.freeze({
  20107. equals_to: "equals_to",
  20108. not_equals_to: "not_equals_to",
  20109. and: "and",
  20110. or: "or",
  20111. not: "not"
  20112. });
  20113. var SYSTEM_FUNCTIONS_CATEGORIES = Object.freeze({
  20114. math: '$mathLib',
  20115. text: '$strLib',
  20116. arrangement: '$arrayLib',
  20117. conversion: '$langLib'
  20118. });
  20119. var Variable = function Variable(type, name, value) {
  20120. var dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  20121. var is_constant = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  20122. var rows = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  20123. var columns = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;
  20124. _classCallCheck(this, Variable);
  20125. this.type = type;
  20126. this.name = name;
  20127. this.value = value;
  20128. this.dimensions = dimensions;
  20129. this.is_constant = is_constant;
  20130. this.rows = rows;
  20131. this.columns = columns;
  20132. };
  20133. var Function = function Function(name) {
  20134. var return_type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID;
  20135. var return_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  20136. var parameters_list = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  20137. var is_main = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  20138. var is_hidden = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
  20139. var variables_list = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [];
  20140. var function_comment = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
  20141. var commands = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : [];
  20142. _classCallCheck(this, Function);
  20143. this.type = COMMAND_TYPES["function"];
  20144. this.name = name;
  20145. this.return_type = return_type;
  20146. this.return_dimensions = return_dimensions;
  20147. this.parameters_list = parameters_list;
  20148. this.is_main = is_main;
  20149. this.is_hidden = is_hidden;
  20150. this.variables_list = variables_list;
  20151. this.function_comment = function_comment;
  20152. this.commands = commands;
  20153. };
  20154. var SystemFunction = function SystemFunction(identifier, return_type, return_dimensions, parameters_list) {
  20155. var function_comment = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
  20156. var category = arguments.length > 5 ? arguments[5] : undefined;
  20157. _classCallCheck(this, SystemFunction);
  20158. this.type = COMMAND_TYPES["function"];
  20159. this.identifier = identifier;
  20160. this.return_type = return_type;
  20161. this.return_dimensions = return_dimensions;
  20162. this.parameters_list = parameters_list;
  20163. this.function_comment = function_comment;
  20164. this.category = category;
  20165. };
  20166. var Comment = function Comment(comment_text) {
  20167. _classCallCheck(this, Comment);
  20168. this.type = COMMAND_TYPES.comment;
  20169. this.comment_text = comment_text;
  20170. };
  20171. var Break = function Break() {
  20172. _classCallCheck(this, Break);
  20173. this.type = COMMAND_TYPES["break"];
  20174. };
  20175. var Reader = function Reader() {
  20176. var variable_value_menu = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new VariableValueMenu();
  20177. _classCallCheck(this, Reader);
  20178. this.type = COMMAND_TYPES.reader;
  20179. this.variable_value_menu = variable_value_menu;
  20180. };
  20181. var Writer = function Writer(content) {
  20182. _classCallCheck(this, Writer);
  20183. this.type = COMMAND_TYPES.writer;
  20184. this.content = content;
  20185. };
  20186. var Attribution = function Attribution(variable) {
  20187. var expression = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  20188. _classCallCheck(this, Attribution);
  20189. this.type = COMMAND_TYPES.attribution;
  20190. this.variable = variable;
  20191. this.expression = expression;
  20192. };
  20193. var ExpressionOperator = function ExpressionOperator(type_op, item) {
  20194. _classCallCheck(this, ExpressionOperator);
  20195. this.type_op = type_op; // Logic, Arithmetic OR Relational
  20196. this.item = item;
  20197. };
  20198. var ExpressionElement = function ExpressionElement(type_exp) {
  20199. var itens = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  20200. _classCallCheck(this, ExpressionElement);
  20201. this.type_exp = type_exp;
  20202. this.itens = itens;
  20203. };
  20204. var ConditionalExpression = function ConditionalExpression(expression) {
  20205. _classCallCheck(this, ConditionalExpression);
  20206. this.type = EXPRESSION_TYPES.exp_conditional;
  20207. this.expression = expression;
  20208. };
  20209. var LogicExpression = function LogicExpression(has_neg, first_operand, second_operand, operator) {
  20210. _classCallCheck(this, LogicExpression);
  20211. this.type = EXPRESSION_TYPES.exp_logic;
  20212. this.has_neg = has_neg;
  20213. this.first_operand = first_operand;
  20214. this.second_operand = second_operand;
  20215. this.operator = operator;
  20216. };
  20217. var ArithmeticExpression = function ArithmeticExpression(first_operand, second_operand, operator) {
  20218. _classCallCheck(this, ArithmeticExpression);
  20219. this.type = EXPRESSION_TYPES.exp_arithmetic;
  20220. this.first_operand = first_operand;
  20221. this.second_operand = second_operand;
  20222. this.operator = operator;
  20223. };
  20224. var IfTrue = function IfTrue(expression, commands_block, commands_else) {
  20225. _classCallCheck(this, IfTrue);
  20226. this.type = COMMAND_TYPES.iftrue;
  20227. this.expression = expression;
  20228. this.commands_block = commands_block;
  20229. this.commands_else = commands_else;
  20230. };
  20231. var RepeatNTimes = function RepeatNTimes(var_attribution, var_incrementation, expression1, expression2, expression3, commands_block) {
  20232. _classCallCheck(this, RepeatNTimes);
  20233. this.type = COMMAND_TYPES.repeatNtimes;
  20234. this.var_attribution = var_attribution;
  20235. this.var_incrementation = var_incrementation;
  20236. this.expression1 = expression1;
  20237. this.expression2 = expression2;
  20238. this.expression3 = expression3;
  20239. this.commands_block = commands_block;
  20240. };
  20241. var WhileTrue = function WhileTrue(expression, commands_block) {
  20242. _classCallCheck(this, WhileTrue);
  20243. this.type = COMMAND_TYPES.whiletrue;
  20244. this.expression = expression;
  20245. this.commands_block = commands_block;
  20246. };
  20247. var DoWhileTrue = function DoWhileTrue(expression, commands_block) {
  20248. _classCallCheck(this, DoWhileTrue);
  20249. this.type = COMMAND_TYPES.dowhiletrue;
  20250. this.expression = expression;
  20251. this.commands_block = commands_block;
  20252. };
  20253. var Switch = function Switch(variable) {
  20254. var cases = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  20255. _classCallCheck(this, Switch);
  20256. this.type = COMMAND_TYPES["switch"];
  20257. this.variable = variable;
  20258. this.cases = cases;
  20259. };
  20260. var Return = function Return(variable_value_menu) {
  20261. _classCallCheck(this, Return);
  20262. this.type = COMMAND_TYPES["return"];
  20263. this.variable_value_menu = variable_value_menu;
  20264. };
  20265. var SwitchCase = function SwitchCase(variable_value_menu) {
  20266. var commands_block = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  20267. _classCallCheck(this, SwitchCase);
  20268. this.type = COMMAND_TYPES.switchcase;
  20269. this.variable_value_menu = variable_value_menu;
  20270. this.commands_block = commands_block;
  20271. };
  20272. var FunctionCall = function FunctionCall(function_called, parameters_list) {
  20273. _classCallCheck(this, FunctionCall);
  20274. this.type = COMMAND_TYPES.functioncall;
  20275. this.function_called = function_called;
  20276. this.parameters_list = parameters_list;
  20277. };
  20278. var VariableValueMenu = function VariableValueMenu() {
  20279. var variable_and_value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 7;
  20280. var content = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  20281. var row = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  20282. var column = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  20283. var include_constant = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
  20284. var dimensions = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  20285. _classCallCheck(this, VariableValueMenu);
  20286. this.type = "var_value";
  20287. this.variable_and_value = variable_and_value;
  20288. this.content = content;
  20289. this.row = row;
  20290. this.column = column;
  20291. this.include_constant = include_constant;
  20292. this.dimensions = dimensions;
  20293. };
  20294. var FunctionCallMenu = function FunctionCallMenu() {
  20295. var function_called = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  20296. var parameters_list = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  20297. _classCallCheck(this, FunctionCallMenu);
  20298. this.type = "function_call";
  20299. this.function_called = function_called;
  20300. this.parameters_list = parameters_list;
  20301. };
  20302. var Program =
  20303. /*#__PURE__*/
  20304. function () {
  20305. function Program() {
  20306. _classCallCheck(this, Program);
  20307. this.functions = [];
  20308. this.globals = [];
  20309. }
  20310. _createClass(Program, [{
  20311. key: "addFunction",
  20312. value: function addFunction(function_to_add) {
  20313. melanke_watchjs__WEBPACK_IMPORTED_MODULE_1___default.a.watch(function_to_add.parameters_list, function () {
  20314. if (window.insertContext) {
  20315. setTimeout(function () {
  20316. _algorithm__WEBPACK_IMPORTED_MODULE_2__["renderAlgorithm"]();
  20317. }, 300);
  20318. window.insertContext = false;
  20319. } else {
  20320. _algorithm__WEBPACK_IMPORTED_MODULE_2__["renderAlgorithm"]();
  20321. }
  20322. }, 1);
  20323. melanke_watchjs__WEBPACK_IMPORTED_MODULE_1___default.a.watch(function_to_add.variables_list, function () {
  20324. if (window.insertContext) {
  20325. setTimeout(function () {
  20326. _algorithm__WEBPACK_IMPORTED_MODULE_2__["renderAlgorithm"]();
  20327. }, 300);
  20328. window.insertContext = false;
  20329. } else {
  20330. _algorithm__WEBPACK_IMPORTED_MODULE_2__["renderAlgorithm"]();
  20331. }
  20332. }, 1);
  20333. this.functions.push(function_to_add);
  20334. }
  20335. }, {
  20336. key: "addVariable",
  20337. value: function addVariable(function_to_receive, variable) {
  20338. if (this.functions[function_to_receive].variable === null) {
  20339. this.functions[function_to_receive].variables_list = [];
  20340. }
  20341. this.functions[function_to_receive].variables_list.push(variable);
  20342. }
  20343. }, {
  20344. key: "addGlobal",
  20345. value: function addGlobal(variable) {
  20346. this.globals.push(variable);
  20347. }
  20348. }]);
  20349. return Program;
  20350. }();
  20351. /***/ }),
  20352. /***/ "./js/visualUI/text_editor.js":
  20353. /*!************************************!*\
  20354. !*** ./js/visualUI/text_editor.js ***!
  20355. \************************************/
  20356. /*! exports provided: initTextEditor, disable, updateEditor, setCode, getCode */
  20357. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20358. "use strict";
  20359. __webpack_require__.r(__webpack_exports__);
  20360. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initTextEditor", function() { return initTextEditor; });
  20361. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disable", function() { return disable; });
  20362. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateEditor", function() { return updateEditor; });
  20363. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCode", function() { return setCode; });
  20364. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCode", function() { return getCode; });
  20365. /* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! codemirror */ "./node_modules/codemirror/lib/codemirror.js");
  20366. /* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(codemirror__WEBPACK_IMPORTED_MODULE_0__);
  20367. /* harmony import */ var codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! codemirror/addon/edit/closebrackets */ "./node_modules/codemirror/addon/edit/closebrackets.js");
  20368. /* harmony import */ var codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1__);
  20369. /* harmony import */ var codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! codemirror/addon/edit/matchbrackets */ "./node_modules/codemirror/addon/edit/matchbrackets.js");
  20370. /* harmony import */ var codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2__);
  20371. /* 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");
  20372. /* 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__);
  20373. /* harmony import */ var _util_editorMode2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../util/editorMode2 */ "./js/util/editorMode2.js");
  20374. // import "codemirror/addon/hint/show-hint";
  20375. // import "codemirror/addon/hint/anyword-hint";
  20376. Object(_util_editorMode2__WEBPACK_IMPORTED_MODULE_4__["CodeEditorMode"])(codemirror__WEBPACK_IMPORTED_MODULE_0__);
  20377. var codeEditor = null;
  20378. function initTextEditor(element) {
  20379. var id = element;
  20380. if (element[0] == '#') {
  20381. id = element.substring(1);
  20382. }
  20383. codeEditor = codemirror__WEBPACK_IMPORTED_MODULE_0__["fromTextArea"](document.getElementById(id), {
  20384. theme: "ttcn",
  20385. value: "",
  20386. mode: "text/x-ivprog",
  20387. indentUnit: 4,
  20388. lineNumbers: true,
  20389. matchBrackets: true,
  20390. autoCloseBrackets: true,
  20391. fixedGutter: true,
  20392. styleActiveLine: true,
  20393. readOnly: true
  20394. });
  20395. }
  20396. function disable(flag) {
  20397. codeEditor.setOption("readOnly", flag);
  20398. updateEditor();
  20399. }
  20400. function updateEditor() {
  20401. codeEditor.refresh();
  20402. }
  20403. function setCode(code) {
  20404. codeEditor.setValue(code);
  20405. }
  20406. function getCode() {
  20407. return codeEditor.getValue();
  20408. }
  20409. /***/ }),
  20410. /***/ "./js/visualUI/types.js":
  20411. /*!******************************!*\
  20412. !*** ./js/visualUI/types.js ***!
  20413. \******************************/
  20414. /*! exports provided: Types */
  20415. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20416. "use strict";
  20417. __webpack_require__.r(__webpack_exports__);
  20418. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Types", function() { return Types; });
  20419. var Types = Object.freeze({
  20420. INTEGER: "integer",
  20421. REAL: "real",
  20422. TEXT: "text",
  20423. BOOLEAN: "boolean",
  20424. VOID: "void"
  20425. });
  20426. /***/ }),
  20427. /***/ "./js/visualUI/utils.js":
  20428. /*!******************************!*\
  20429. !*** ./js/visualUI/utils.js ***!
  20430. \******************************/
  20431. /*! exports provided: renderErrorMessage */
  20432. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20433. "use strict";
  20434. __webpack_require__.r(__webpack_exports__);
  20435. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderErrorMessage", function() { return renderErrorMessage; });
  20436. function renderErrorMessage(dom_obj_target, message_text) {
  20437. dom_obj_target.popup({
  20438. html: '<i class="ui icon inverted exclamation triangle yellow"></i>' + message_text,
  20439. transition: "fade up",
  20440. on: 'click',
  20441. closable: true,
  20442. movePopup: true,
  20443. boundary: window,
  20444. preserve: false,
  20445. target: false,
  20446. className: {
  20447. popup: 'ui popup invalid-identifier'
  20448. },
  20449. onHidden: function onHidden($module) {
  20450. dom_obj_target.popup('destroy');
  20451. }
  20452. }).popup('toggle');
  20453. }
  20454. /***/ }),
  20455. /***/ "./js/visualUI/variables.js":
  20456. /*!**********************************!*\
  20457. !*** ./js/visualUI/variables.js ***!
  20458. \**********************************/
  20459. /*! exports provided: addVariable, renderVariable */
  20460. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20461. "use strict";
  20462. __webpack_require__.r(__webpack_exports__);
  20463. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addVariable", function() { return addVariable; });
  20464. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderVariable", function() { return renderVariable; });
  20465. /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
  20466. /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
  20467. /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
  20468. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
  20469. /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
  20470. /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
  20471. var counter_new_variables = 0;
  20472. function addVariable(function_obj, function_container) {
  20473. var is_in_click = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  20474. 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);
  20475. if (function_obj.variables_list == null) {
  20476. function_obj.variables_list = [];
  20477. }
  20478. function_obj.variables_list.push(new_var);
  20479. counter_new_variables++;
  20480. 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);
  20481. var newe = renderVariable(function_container, new_var, function_obj);
  20482. if (is_in_click) {
  20483. newe.css('display', 'none');
  20484. newe.fadeIn();
  20485. }
  20486. }
  20487. function updateName(variable_obj, new_name, variable_obj_dom, function_obj) {
  20488. if (variable_obj.name == new_name) {
  20489. return;
  20490. }
  20491. if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_5__["isValidIdentifier"])(new_name)) {
  20492. if (variableNameAlreadyExists(new_name, function_obj)) {
  20493. _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]));
  20494. } else {
  20495. 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);
  20496. variable_obj.name = new_name;
  20497. }
  20498. } else {
  20499. _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](variable_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
  20500. }
  20501. }
  20502. function variableNameAlreadyExists(name_var, function_obj) {
  20503. if (function_obj.parameters_list) {
  20504. for (var i = 0; i < function_obj.parameters_list.length; i++) {
  20505. if (function_obj.parameters_list[i].name == name_var) {
  20506. return true;
  20507. }
  20508. }
  20509. }
  20510. if (function_obj.variables_list) {
  20511. for (var i = 0; i < function_obj.variables_list.length; i++) {
  20512. if (function_obj.variables_list[i].name == name_var) {
  20513. return true;
  20514. }
  20515. }
  20516. }
  20517. return false;
  20518. }
  20519. function removeVariable(variable_obj, variable_container, function_name) {
  20520. var function_associated = variable_container.data('associatedFunction');
  20521. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].REMOVE_FUNCTION_VAR, variable_obj.name);
  20522. var index = function_associated.variables_list.indexOf(variable_obj);
  20523. if (index > -1) {
  20524. window.insertContext = true;
  20525. delete function_associated.variables_list[index];
  20526. function_associated.variables_list.splice(index, 1);
  20527. }
  20528. variable_container.children().off();
  20529. variable_container.off();
  20530. variable_container.fadeOut();
  20531. }
  20532. function updateType(variable_obj, new_type, function_name) {
  20533. var new_dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  20534. variable_obj.type = new_type;
  20535. variable_obj.dimensions = new_dimensions;
  20536. if (new_dimensions > 0) {
  20537. variable_obj.rows = new_dimensions;
  20538. variable_obj.columns = 2;
  20539. }
  20540. 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);
  20541. updateInitialValues(variable_obj, function_name);
  20542. }
  20543. function addHandlers(variable_obj, variable_container, function_obj) {
  20544. // Manage variable name:
  20545. variable_container.find(".editing_name_var").on('click', function (e) {
  20546. 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);
  20547. enableNameUpdate(variable_obj, variable_container, function_obj);
  20548. }); // Menu to change type:
  20549. variable_container.find('.ui.dropdown.variable_type').dropdown({
  20550. onChange: function onChange(_, __, $selectedItem) {
  20551. if ($selectedItem.data('dimensions')) {
  20552. updateType(variable_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name, $selectedItem.data('dimensions'));
  20553. } else {
  20554. updateType(variable_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name);
  20555. }
  20556. renderValues(variable_obj, variable_container, function_obj.name);
  20557. },
  20558. selectOnKeydown: false
  20559. }); // Remove variable:
  20560. variable_container.find(".remove_variable").on('click', function (e) {
  20561. removeVariable(variable_obj, variable_container, function_obj.name);
  20562. });
  20563. }
  20564. function renderVariable(function_container, new_var, function_obj) {
  20565. var element = '<div class="ui label variable_container pink"><i class="ui icon ellipsis vertical inverted"></i>';
  20566. element += '<div class="ui dropdown variable_type">';
  20567. if (new_var.dimensions == 1) {
  20568. 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()));
  20569. element += ' [ ] </div>';
  20570. } else if (new_var.dimensions == 2) {
  20571. 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()));
  20572. element += ' [ ] [ ] </div>';
  20573. } else {
  20574. element += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(new_var.type.toLowerCase())) + '</div>';
  20575. }
  20576. element += '<div class="menu">';
  20577. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  20578. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  20579. continue;
  20580. }
  20581. 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>';
  20582. }
  20583. 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">';
  20584. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  20585. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  20586. continue;
  20587. }
  20588. 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>';
  20589. }
  20590. element += '</div></div>';
  20591. 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">';
  20592. for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
  20593. if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
  20594. continue;
  20595. }
  20596. 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>';
  20597. }
  20598. element += '</div></div>';
  20599. element += '</div></div> ';
  20600. element += '<div class="editing_name_var"><span class="span_name_variable enable_edit_name_variable">' + new_var.name + '</span> </div>';
  20601. element += ' <span class="character_equals"> <&#8212; </span> <div class="ui div_valor_var">' + new_var.value + '</div>';
  20602. element += ' <i class="yellow inverted icon times remove_variable"></i></div>';
  20603. element = $(element);
  20604. element.data('associatedFunction', function_obj);
  20605. function_container.find('.variables_list_div').append(element);
  20606. addHandlers(new_var, element, function_obj);
  20607. renderValues(new_var, element, function_obj.name);
  20608. return element;
  20609. }
  20610. function updateColumnsAndRowsText(variable_container, variable_var) {
  20611. var prev = variable_container.find('.text').text().split('[');
  20612. if (prev.length == 2) {
  20613. var ff = prev[0] + '[ ' + variable_var.columns + ' ] ';
  20614. variable_container.find('.text').empty();
  20615. variable_container.find('.text').text(ff);
  20616. }
  20617. if (prev.length == 3) {
  20618. var ff = prev[0] + '[ ' + variable_var.columns + ' ] [ ' + variable_var.rows + ' ] ';
  20619. variable_container.find('.text').empty();
  20620. variable_container.find('.text').text(ff);
  20621. }
  20622. }
  20623. function renderValues(new_var, variable_container, function_name) {
  20624. var ret = "";
  20625. var j = 0;
  20626. if (new_var.dimensions == 0) {
  20627. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  20628. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + new_var.value.toFixed(1) + '</span> </div> ';
  20629. } else {
  20630. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  20631. 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> ';
  20632. } else {
  20633. ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + new_var.value + '</span> </div> ';
  20634. }
  20635. }
  20636. } else {
  20637. ret += '<table class="tabela_var">';
  20638. if (new_var.dimensions == 1) {
  20639. ret += '<tr>';
  20640. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  20641. for (var k = 0; k < new_var.columns; k++) {
  20642. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + new_var.value[k].toFixed(1) + '</span></td>';
  20643. }
  20644. } else {
  20645. for (var k = 0; k < new_var.columns; k++) {
  20646. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  20647. 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>';
  20648. } else {
  20649. ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + new_var.value[k] + '</span>' + '</td>';
  20650. }
  20651. }
  20652. }
  20653. ret += '</tr>';
  20654. ret += '</table>';
  20655. 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>';
  20656. }
  20657. if (new_var.dimensions == 2) {
  20658. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  20659. for (var l = 0; l < new_var.rows; l++) {
  20660. ret += '<tr>';
  20661. for (var k = 0; k < new_var.columns; k++) {
  20662. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + new_var.value[l][k].toFixed(1) + '</span>' + '</td>';
  20663. }
  20664. ret += '</tr>';
  20665. }
  20666. } else {
  20667. for (var l = 0; l < new_var.rows; l++) {
  20668. ret += '<tr>';
  20669. for (var k = 0; k < new_var.columns; k++) {
  20670. if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  20671. 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>';
  20672. } else {
  20673. ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + new_var.value[l][k] + '</span></td>';
  20674. }
  20675. }
  20676. ret += '</tr>';
  20677. }
  20678. }
  20679. if (new_var.rows == 0) {
  20680. ret += '<tr><td></td></tr>';
  20681. }
  20682. 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>';
  20683. ret += '</table>';
  20684. 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>';
  20685. }
  20686. }
  20687. $(variable_container).find(".div_valor_var").html('');
  20688. ret = $(ret);
  20689. $(ret).find('.span_value_variable').data('associatedOject', new_var);
  20690. $(ret).find(".boolean_simple_type").on('click', function (e) {
  20691. 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);
  20692. alternateBooleanValue(new_var, this.parentNode);
  20693. });
  20694. $(ret).find(".simple_var").on('click', function (e) {
  20695. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_VAR_VALUE, new_var.name);
  20696. enableValueUpdate(new_var, this.parentNode, function_name);
  20697. });
  20698. $(ret).find(".boolean_vector_var").on('click', function (e) {
  20699. alternateBooleanVectorValue(new_var, $(this).data('index'), this.parentNode);
  20700. 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);
  20701. });
  20702. $(ret).find(".vector_var").on('click', function (e) {
  20703. enableVectorValueUpdate(new_var, $(this).data('index'), this.parentNode, function_name);
  20704. });
  20705. $(ret).find(".remove_global_vector_column").on('click', function (e) {
  20706. removeColumnVector(new_var);
  20707. 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);
  20708. 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);
  20709. $(variable_container).find(".div_valor_var").html('');
  20710. renderValues(new_var, variable_container, function_name);
  20711. });
  20712. $(ret).find(".add_global_vector_column").on('click', function (e) {
  20713. addColumnVector(new_var);
  20714. 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);
  20715. 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);
  20716. $(variable_container).find(".div_valor_var").html('');
  20717. renderValues(new_var, variable_container, function_name);
  20718. });
  20719. $(ret).find(".remove_global_matrix_column").on('click', function (e) {
  20720. removeColumnMatrix(new_var);
  20721. 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);
  20722. 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);
  20723. $(variable_container).find(".div_valor_var").html('');
  20724. renderValues(new_var, variable_container, function_name);
  20725. });
  20726. $(ret).find(".add_global_matrix_column").on('click', function (e) {
  20727. addColumnMatrix(new_var);
  20728. 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);
  20729. 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);
  20730. $(variable_container).find(".div_valor_var").html('');
  20731. renderValues(new_var, variable_container, function_name);
  20732. });
  20733. $(ret).find(".remove_global_matrix_line").on('click', function (e) {
  20734. removeLineMatrix(new_var);
  20735. 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);
  20736. 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);
  20737. $(variable_container).find(".div_valor_var").html('');
  20738. renderValues(new_var, variable_container, function_name);
  20739. });
  20740. $(ret).find(".add_global_matrix_line").on('click', function (e) {
  20741. addLineMatrix(new_var);
  20742. 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);
  20743. 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);
  20744. $(variable_container).find(".div_valor_var").html('');
  20745. renderValues(new_var, variable_container, function_name);
  20746. });
  20747. $(ret).find(".boolean_matrix_var").on('click', function (e) {
  20748. alternateBooleanMatrixValue(new_var, $(this).data('row'), $(this).data('index'), this.parentNode);
  20749. 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);
  20750. });
  20751. $(ret).find(".matrix_var").on('click', function (e) {
  20752. Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_VAR_VALUE, new_var.name);
  20753. enableMatrixValueUpdate(new_var, $(this).data('row'), $(this).data('index'), this.parentNode, function_name);
  20754. });
  20755. $(variable_container).find(".div_valor_var").append(ret);
  20756. updateColumnsAndRowsText(variable_container, new_var);
  20757. }
  20758. function alternateBooleanMatrixValue(var_obj, row, index, value_container) {
  20759. var_obj.value[row][index] = !var_obj.value[row][index];
  20760. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value[row][index])));
  20761. }
  20762. function addLineMatrix(var_obj) {
  20763. var_obj.rows++;
  20764. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  20765. var n_l = [];
  20766. for (var i = 0; i < var_obj.columns; i++) {
  20767. n_l.push(0);
  20768. }
  20769. var_obj.value.push(n_l);
  20770. }
  20771. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  20772. var n_l = [];
  20773. for (i = 0; i < var_obj.columns; i++) {
  20774. n_l.push(0.0);
  20775. }
  20776. var_obj.value.push(n_l);
  20777. }
  20778. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  20779. var n_l = [];
  20780. for (i = 0; i < var_obj.columns; i++) {
  20781. n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  20782. }
  20783. var_obj.value.push(n_l);
  20784. }
  20785. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  20786. var n_l = [];
  20787. for (i = 0; i < var_obj.columns; i++) {
  20788. n_l.push(true);
  20789. }
  20790. var_obj.value.push(n_l);
  20791. }
  20792. }
  20793. function removeLineMatrix(var_obj) {
  20794. if (var_obj.rows == 0) {
  20795. return;
  20796. }
  20797. var_obj.rows--;
  20798. var_obj.value.splice(var_obj.value.length - 1, 1);
  20799. }
  20800. function addColumnMatrix(var_obj) {
  20801. var_obj.columns++;
  20802. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  20803. for (var i = 0; i < var_obj.rows; i++) {
  20804. var_obj.value[i].push(0);
  20805. }
  20806. }
  20807. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  20808. for (var i = 0; i < var_obj.rows; i++) {
  20809. var_obj.value[i].push(0.0);
  20810. }
  20811. }
  20812. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  20813. for (var i = 0; i < var_obj.rows; i++) {
  20814. var_obj.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  20815. }
  20816. }
  20817. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  20818. for (var i = 0; i < var_obj.rows; i++) {
  20819. var_obj.value[i].push(true);
  20820. }
  20821. }
  20822. }
  20823. function removeColumnMatrix(var_obj) {
  20824. if (var_obj.columns == 0) {
  20825. return;
  20826. }
  20827. var_obj.columns--;
  20828. for (var i = 0; i < var_obj.rows; i++) {
  20829. var_obj.value[i].splice(var_obj.value[i].length - 1, 1);
  20830. }
  20831. }
  20832. function addColumnVector(var_obj) {
  20833. var_obj.columns++;
  20834. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  20835. var_obj.value.push(0);
  20836. }
  20837. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  20838. var_obj.value.push(0.0);
  20839. }
  20840. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  20841. var_obj.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
  20842. }
  20843. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  20844. var_obj.value.push(true);
  20845. }
  20846. }
  20847. function removeColumnVector(var_obj) {
  20848. if (var_obj.columns == 0) {
  20849. return;
  20850. }
  20851. var_obj.columns--;
  20852. var_obj.value.splice(var_obj.value.length - 1, 1);
  20853. }
  20854. function alternateBooleanValue(var_obj, value_container) {
  20855. var_obj.value = !var_obj.value;
  20856. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value)));
  20857. }
  20858. function alternateBooleanVectorValue(var_obj, index, value_container) {
  20859. var_obj.value[index] = !var_obj.value[index];
  20860. $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value[index])));
  20861. }
  20862. function updateInitialValues(variable_obj, function_name) {
  20863. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  20864. if (variable_obj.dimensions == 0) {
  20865. variable_obj.value = 0;
  20866. }
  20867. if (variable_obj.dimensions == 1) {
  20868. variable_obj.value = [0, 0];
  20869. }
  20870. if (variable_obj.dimensions == 2) {
  20871. variable_obj.value = [[0, 0], [0, 0]];
  20872. }
  20873. }
  20874. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  20875. if (variable_obj.dimensions == 0) {
  20876. variable_obj.value = 0.0;
  20877. }
  20878. if (variable_obj.dimensions == 1) {
  20879. variable_obj.value = [0.0, 0.0];
  20880. }
  20881. if (variable_obj.dimensions == 2) {
  20882. variable_obj.value = [[0.0, 0.0], [0.0, 0.0]];
  20883. }
  20884. }
  20885. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  20886. if (variable_obj.dimensions == 0) {
  20887. variable_obj.value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value');
  20888. }
  20889. if (variable_obj.dimensions == 1) {
  20890. 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')];
  20891. }
  20892. if (variable_obj.dimensions == 2) {
  20893. 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')]];
  20894. }
  20895. }
  20896. if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
  20897. if (variable_obj.dimensions == 0) {
  20898. variable_obj.value = true;
  20899. }
  20900. if (variable_obj.dimensions == 1) {
  20901. variable_obj.value = [true, true];
  20902. }
  20903. if (variable_obj.dimensions == 2) {
  20904. variable_obj.value = [[true, true], [true, true]];
  20905. }
  20906. }
  20907. 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);
  20908. }
  20909. var opened_name_value_vector_global_ = false;
  20910. var opened_input_value_vector_global_ = null;
  20911. function enableVectorValueUpdate(var_obj, index, parent_node, function_name) {
  20912. if (opened_name_value_vector_global_) {
  20913. opened_input_value_vector_global_.focus();
  20914. return;
  20915. }
  20916. parent_node = $(parent_node);
  20917. opened_name_value_vector_global_ = true;
  20918. parent_node.find('.span_value_variable').text('');
  20919. var input_field;
  20920. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  20921. 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) + "' />");
  20922. input_field.insertBefore(parent_node.find('.span_value_variable'));
  20923. } else {
  20924. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + var_obj.value[index] + "' />");
  20925. input_field.insertBefore(parent_node.find('.span_value_variable'));
  20926. }
  20927. input_field.on('input', function () {
  20928. var inputWidth = input_field.textWidth() + 10;
  20929. opened_input_value_vector_global_ = input_field;
  20930. input_field.focus();
  20931. var tmpStr = input_field.val();
  20932. input_field.val('');
  20933. input_field.val(tmpStr);
  20934. input_field.css({
  20935. width: inputWidth
  20936. });
  20937. }).trigger('input');
  20938. input_field.focusout(function () {
  20939. var changed = false; /// update array:
  20940. if (input_field.val().trim()) {
  20941. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  20942. var_obj.value[index] = parseFloat(input_field.val().trim());
  20943. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  20944. } else {
  20945. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  20946. var_obj.value[index] = parseInt(input_field.val().trim());
  20947. } else {
  20948. var_obj.value[index] = input_field.val().trim();
  20949. }
  20950. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  20951. }
  20952. changed = true;
  20953. } else {
  20954. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  20955. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  20956. } else {
  20957. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  20958. }
  20959. }
  20960. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  20961. var_obj.value[index] = input_field.val();
  20962. changed = true;
  20963. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  20964. }
  20965. if (changed) {
  20966. 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);
  20967. }
  20968. input_field.off();
  20969. input_field.remove(); /// update elements:
  20970. opened_name_value_vector_global_ = false;
  20971. opened_input_value_vector_global_ = false;
  20972. });
  20973. input_field.on('keydown', function (e) {
  20974. var code = e.keyCode || e.which;
  20975. var changed = false;
  20976. if (code == 13) {
  20977. if (input_field.val().trim()) {
  20978. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  20979. var_obj.value[index] = parseFloat(input_field.val().trim());
  20980. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  20981. } else {
  20982. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  20983. var_obj.value[index] = parseInt(input_field.val().trim());
  20984. } else {
  20985. var_obj.value[index] = input_field.val().trim();
  20986. }
  20987. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  20988. }
  20989. changed = true;
  20990. } else {
  20991. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  20992. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  20993. } else {
  20994. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  20995. }
  20996. }
  20997. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  20998. var_obj.value[index] = input_field.val();
  20999. changed = true;
  21000. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  21001. }
  21002. if (changed) {
  21003. 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);
  21004. }
  21005. input_field.off();
  21006. input_field.remove(); /// update elements:
  21007. opened_name_value_vector_global_ = false;
  21008. opened_input_value_vector_global_ = false;
  21009. }
  21010. if (code == 27) {
  21011. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21012. parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
  21013. } else {
  21014. parent_node.find('.span_value_variable').text(var_obj.value[index]);
  21015. }
  21016. input_field.off();
  21017. input_field.remove(); /// update elements:
  21018. opened_name_value_vector_global_ = false;
  21019. opened_input_value_vector_global_ = false;
  21020. }
  21021. });
  21022. input_field.select();
  21023. }
  21024. var opened_name_value_global_var = false;
  21025. var opened_input_value_global_ar = null;
  21026. function enableValueUpdate(var_obj, parent_node, function_name) {
  21027. if (opened_name_value_global_var) {
  21028. opened_input_value_global_ar.focus();
  21029. return;
  21030. }
  21031. parent_node = $(parent_node);
  21032. opened_name_value_global_var = true;
  21033. var input_field;
  21034. parent_node.find('.span_value_variable').text('');
  21035. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21036. 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) + "' />");
  21037. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21038. } else {
  21039. input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + var_obj.value + "' />");
  21040. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21041. }
  21042. input_field.on('input', function () {
  21043. var inputWidth = input_field.textWidth() + 10;
  21044. opened_input_value_global_ar = input_field;
  21045. input_field.focus();
  21046. var tmpStr = input_field.val();
  21047. input_field.val('');
  21048. input_field.val(tmpStr);
  21049. input_field.css({
  21050. width: inputWidth
  21051. });
  21052. }).trigger('input');
  21053. input_field.focusout(function () {
  21054. /// update array:
  21055. var changed = false;
  21056. if (input_field.val().trim()) {
  21057. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21058. var_obj.value = parseFloat(input_field.val().trim());
  21059. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  21060. } else {
  21061. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21062. var_obj.value = parseInt(input_field.val().trim());
  21063. } else {
  21064. var_obj.value = input_field.val().trim();
  21065. }
  21066. parent_node.find('.span_value_variable').text(var_obj.value);
  21067. }
  21068. changed = true;
  21069. } else {
  21070. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21071. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  21072. } else {
  21073. parent_node.find('.span_value_variable').text(var_obj.value);
  21074. }
  21075. }
  21076. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21077. var_obj.value = input_field.val();
  21078. changed = true;
  21079. parent_node.find('.span_value_variable').text(var_obj.value);
  21080. }
  21081. if (changed) {
  21082. 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);
  21083. }
  21084. input_field.off();
  21085. input_field.remove(); /// update elements:
  21086. opened_name_value_global_var = false;
  21087. opened_input_value_global_ar = false;
  21088. });
  21089. input_field.on('keydown', function (e) {
  21090. var code = e.keyCode || e.which;
  21091. var changed = false;
  21092. if (code == 13) {
  21093. if (input_field.val().trim()) {
  21094. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21095. var_obj.value = parseFloat(input_field.val().trim());
  21096. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  21097. } else {
  21098. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21099. var_obj.value = parseInt(input_field.val().trim());
  21100. } else {
  21101. var_obj.value = input_field.val().trim();
  21102. }
  21103. parent_node.find('.span_value_variable').text(var_obj.value);
  21104. }
  21105. changed = true;
  21106. } else {
  21107. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21108. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  21109. } else {
  21110. parent_node.find('.span_value_variable').text(var_obj.value);
  21111. }
  21112. }
  21113. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21114. var_obj.value = input_field.val();
  21115. changed = true;
  21116. parent_node.find('.span_value_variable').text(var_obj.value);
  21117. }
  21118. if (changed) {
  21119. 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);
  21120. }
  21121. input_field.off();
  21122. input_field.remove(); /// update elements:
  21123. opened_name_value_global_var = false;
  21124. opened_input_value_global_ar = false;
  21125. }
  21126. if (code == 27) {
  21127. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21128. parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
  21129. } else {
  21130. parent_node.find('.span_value_variable').text(var_obj.value);
  21131. }
  21132. input_field.off();
  21133. input_field.remove(); /// update elements:
  21134. opened_name_value_global_var = false;
  21135. opened_input_value_global_ar = false;
  21136. }
  21137. });
  21138. input_field.select();
  21139. }
  21140. var opened_name_global = false;
  21141. var opened_input_global = null;
  21142. function enableNameUpdate(variable_obj, variable_container, function_obj) {
  21143. if (opened_name_global) {
  21144. opened_input_global.focus();
  21145. return;
  21146. }
  21147. opened_name_global = true;
  21148. variable_container.find('.span_name_variable').text('');
  21149. var input_name;
  21150. input_name = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + variable_obj.name + "' />");
  21151. input_name.insertBefore(variable_container.find('.span_name_variable'));
  21152. input_name.on('input', function () {
  21153. var inputWidth = input_name.textWidth() + 10;
  21154. opened_input_global = input_name;
  21155. input_name.focus();
  21156. var tmpStr = input_name.val();
  21157. input_name.val('');
  21158. input_name.val(tmpStr);
  21159. input_name.css({
  21160. width: inputWidth
  21161. });
  21162. }).trigger('input');
  21163. input_name.focusout(function () {
  21164. /// update array:
  21165. if (input_name.val().trim().length > 0) {
  21166. updateName(variable_obj, input_name.val().trim(), variable_container, function_obj);
  21167. variable_container.find('.span_name_variable').text(variable_obj.name);
  21168. } else {
  21169. variable_container.find('.span_name_variable').text(variable_obj.name);
  21170. }
  21171. input_name.off();
  21172. input_name.remove(); /// update elements:
  21173. opened_name_global = false;
  21174. opened_input_global = false;
  21175. });
  21176. input_name.on('keydown', function (e) {
  21177. var code = e.keyCode || e.which;
  21178. if (code == 13) {
  21179. if (input_name.val().trim().length > 0) {
  21180. updateName(variable_obj, input_name.val().trim(), variable_container, function_obj);
  21181. variable_container.find('.span_name_variable').text(variable_obj.name);
  21182. } else {
  21183. variable_container.find('.span_name_variable').text(variable_obj.name);
  21184. }
  21185. input_name.off();
  21186. input_name.remove(); /// update elements:
  21187. opened_name_global = false;
  21188. opened_input_global = false;
  21189. }
  21190. if (code == 27) {
  21191. variable_container.find('.span_name_variable').text(variable_obj.name);
  21192. input_name.off();
  21193. input_name.remove(); /// update elements:
  21194. opened_name_global = false;
  21195. opened_input_global = false;
  21196. }
  21197. });
  21198. input_name.select();
  21199. }
  21200. var opened_name_value_matrix_global_v = false;
  21201. var opened_input_value_matrix_global_v = null;
  21202. function enableMatrixValueUpdate(var_obj, row, index, parent_node, function_name) {
  21203. if (opened_name_value_matrix_global_v) {
  21204. opened_input_value_matrix_global_v.focus();
  21205. return;
  21206. }
  21207. parent_node = $(parent_node);
  21208. opened_name_value_matrix_global_v = true;
  21209. parent_node.find('.span_value_variable').text('');
  21210. var input_field;
  21211. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21212. 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) + "' />");
  21213. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21214. } else {
  21215. 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] + "' />");
  21216. input_field.insertBefore(parent_node.find('.span_value_variable'));
  21217. }
  21218. input_field.on('input', function () {
  21219. var inputWidth = input_field.textWidth() + 10;
  21220. opened_input_value_matrix_global_v = input_field;
  21221. input_field.focus();
  21222. var tmpStr = input_field.val();
  21223. input_field.val('');
  21224. input_field.val(tmpStr);
  21225. input_field.css({
  21226. width: inputWidth
  21227. });
  21228. }).trigger('input');
  21229. input_field.focusout(function () {
  21230. var changed = false; /// update array:
  21231. if (input_field.val().trim()) {
  21232. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21233. var_obj.value[row][index] = parseFloat(input_field.val().trim());
  21234. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  21235. } else {
  21236. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21237. var_obj.value[row][index] = parseInt(input_field.val().trim());
  21238. } else {
  21239. var_obj.value[row][index] = input_field.val().trim();
  21240. }
  21241. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  21242. }
  21243. changed = true;
  21244. } else {
  21245. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21246. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  21247. } else {
  21248. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  21249. }
  21250. }
  21251. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21252. var_obj.value[row][index] = input_field.val();
  21253. changed = true;
  21254. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  21255. }
  21256. if (changed) {
  21257. 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);
  21258. }
  21259. input_field.off();
  21260. input_field.remove(); /// update elements:
  21261. opened_name_value_matrix_global_v = false;
  21262. opened_input_value_matrix_global_v = false;
  21263. });
  21264. input_field.on('keydown', function (e) {
  21265. var code = e.keyCode || e.which;
  21266. var changed = false;
  21267. if (code == 13) {
  21268. if (input_field.val().trim()) {
  21269. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21270. var_obj.value[row][index] = parseFloat(input_field.val().trim());
  21271. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  21272. } else {
  21273. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
  21274. var_obj.value[row][index] = parseInt(input_field.val().trim());
  21275. } else {
  21276. var_obj.value[row][index] = input_field.val().trim();
  21277. }
  21278. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  21279. }
  21280. changed = true;
  21281. } else {
  21282. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21283. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  21284. } else {
  21285. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  21286. }
  21287. }
  21288. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
  21289. var_obj.value[row][index] = input_field.val();
  21290. changed = true;
  21291. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  21292. }
  21293. if (changed) {
  21294. 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);
  21295. }
  21296. input_field.off();
  21297. input_field.remove(); /// update elements:
  21298. opened_name_value_matrix_global_v = false;
  21299. opened_input_value_matrix_global_v = false;
  21300. }
  21301. if (code == 27) {
  21302. if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
  21303. parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
  21304. } else {
  21305. parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
  21306. }
  21307. input_field.off();
  21308. input_field.remove(); /// update elements:
  21309. opened_name_value_matrix_global_v = false;
  21310. opened_input_value_matrix_global_v = false;
  21311. }
  21312. });
  21313. input_field.select();
  21314. }
  21315. /***/ })
  21316. /******/ });
  21317. });
  21318. //# sourceMappingURL=main.953c46193185032c68f7.js.map