1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635 |
- (function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory();
- else if(typeof define === 'function' && define.amd)
- define([], factory);
- else if(typeof exports === 'object')
- exports["ivprogCore"] = factory();
- else
- root["ivprogCore"] = factory();
- })(window, function() {
- return /******/ (function(modules) { // webpackBootstrap
- /******/ // install a JSONP callback for chunk loading
- /******/ function webpackJsonpCallback(data) {
- /******/ var chunkIds = data[0];
- /******/ var moreModules = data[1];
- /******/ var executeModules = data[2];
- /******/
- /******/ // add "moreModules" to the modules object,
- /******/ // then flag all "chunkIds" as loaded and fire callback
- /******/ var moduleId, chunkId, i = 0, resolves = [];
- /******/ for(;i < chunkIds.length; i++) {
- /******/ chunkId = chunkIds[i];
- /******/ if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {
- /******/ resolves.push(installedChunks[chunkId][0]);
- /******/ }
- /******/ installedChunks[chunkId] = 0;
- /******/ }
- /******/ for(moduleId in moreModules) {
- /******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
- /******/ modules[moduleId] = moreModules[moduleId];
- /******/ }
- /******/ }
- /******/ if(parentJsonpFunction) parentJsonpFunction(data);
- /******/
- /******/ while(resolves.length) {
- /******/ resolves.shift()();
- /******/ }
- /******/
- /******/ // add entry modules from loaded chunk to deferred list
- /******/ deferredModules.push.apply(deferredModules, executeModules || []);
- /******/
- /******/ // run deferred modules when all chunks ready
- /******/ return checkDeferredModules();
- /******/ };
- /******/ function checkDeferredModules() {
- /******/ var result;
- /******/ for(var i = 0; i < deferredModules.length; i++) {
- /******/ var deferredModule = deferredModules[i];
- /******/ var fulfilled = true;
- /******/ for(var j = 1; j < deferredModule.length; j++) {
- /******/ var depId = deferredModule[j];
- /******/ if(installedChunks[depId] !== 0) fulfilled = false;
- /******/ }
- /******/ if(fulfilled) {
- /******/ deferredModules.splice(i--, 1);
- /******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
- /******/ }
- /******/ }
- /******/
- /******/ return result;
- /******/ }
- /******/
- /******/ // The module cache
- /******/ var installedModules = {};
- /******/
- /******/ // object to store loaded and loading chunks
- /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
- /******/ // Promise = chunk loading, 0 = chunk loaded
- /******/ var installedChunks = {
- /******/ "main": 0
- /******/ };
- /******/
- /******/ var deferredModules = [];
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/
- /******/ // Check if module is in cache
- /******/ if(installedModules[moduleId]) {
- /******/ return installedModules[moduleId].exports;
- /******/ }
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = installedModules[moduleId] = {
- /******/ i: moduleId,
- /******/ l: false,
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/
- /******/ // Flag the module as loaded
- /******/ module.l = true;
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /******/
- /******/ // expose the modules object (__webpack_modules__)
- /******/ __webpack_require__.m = modules;
- /******/
- /******/ // expose the module cache
- /******/ __webpack_require__.c = installedModules;
- /******/
- /******/ // define getter function for harmony exports
- /******/ __webpack_require__.d = function(exports, name, getter) {
- /******/ if(!__webpack_require__.o(exports, name)) {
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
- /******/ }
- /******/ };
- /******/
- /******/ // define __esModule on exports
- /******/ __webpack_require__.r = function(exports) {
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
- /******/ }
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
- /******/ };
- /******/
- /******/ // create a fake namespace object
- /******/ // mode & 1: value is a module id, require it
- /******/ // mode & 2: merge all properties of value into the ns
- /******/ // mode & 4: return value when already ns object
- /******/ // mode & 8|1: behave like require
- /******/ __webpack_require__.t = function(value, mode) {
- /******/ if(mode & 1) value = __webpack_require__(value);
- /******/ if(mode & 8) return value;
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
- /******/ var ns = Object.create(null);
- /******/ __webpack_require__.r(ns);
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
- /******/ return ns;
- /******/ };
- /******/
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = function(module) {
- /******/ var getter = module && module.__esModule ?
- /******/ function getDefault() { return module['default']; } :
- /******/ function getModuleExports() { return module; };
- /******/ __webpack_require__.d(getter, 'a', getter);
- /******/ return getter;
- /******/ };
- /******/
- /******/ // Object.prototype.hasOwnProperty.call
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
- /******/
- /******/ // __webpack_public_path__
- /******/ __webpack_require__.p = "";
- /******/
- /******/ var jsonpArray = window["webpackJsonpivprogCore"] = window["webpackJsonpivprogCore"] || [];
- /******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
- /******/ jsonpArray.push = webpackJsonpCallback;
- /******/ jsonpArray = jsonpArray.slice();
- /******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
- /******/ var parentJsonpFunction = oldJsonpFunction;
- /******/
- /******/
- /******/ // add entry module to deferred list
- /******/ deferredModules.push(["./js/main.js","vendors~main"]);
- /******/ // run deferred modules when ready
- /******/ return checkDeferredModules();
- /******/ })
- /************************************************************************/
- /******/ ({
- /***/ "./.ima_version.json":
- /*!***************************!*\
- !*** ./.ima_version.json ***!
- \***************************/
- /*! exports provided: version, default */
- /***/ (function(module) {
- module.exports = JSON.parse("{\"version\":\"2020_12_03 16_39\"}");
- /***/ }),
- /***/ "./grammar/en/ivprog.g4":
- /*!******************************!*\
- !*** ./grammar/en/ivprog.g4 ***!
- \******************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports =
- /******/ (function(modules) { // webpackBootstrap
- /******/ // The module cache
- /******/ var installedModules = {};
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/
- /******/ // Check if module is in cache
- /******/ if(installedModules[moduleId]) {
- /******/ return installedModules[moduleId].exports;
- /******/ }
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = installedModules[moduleId] = {
- /******/ i: moduleId,
- /******/ l: false,
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/
- /******/ // Flag the module as loaded
- /******/ module.l = true;
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /******/
- /******/ // expose the modules object (__webpack_modules__)
- /******/ __webpack_require__.m = modules;
- /******/
- /******/ // expose the module cache
- /******/ __webpack_require__.c = installedModules;
- /******/
- /******/ // identity function for calling harmony imports with the correct context
- /******/ __webpack_require__.i = function(value) { return value; };
- /******/
- /******/ // define getter function for harmony exports
- /******/ __webpack_require__.d = function(exports, name, getter) {
- /******/ if(!__webpack_require__.o(exports, name)) {
- /******/ Object.defineProperty(exports, name, {
- /******/ configurable: false,
- /******/ enumerable: true,
- /******/ get: getter
- /******/ });
- /******/ }
- /******/ };
- /******/
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = function(module) {
- /******/ var getter = module && module.__esModule ?
- /******/ function getDefault() { return module['default']; } :
- /******/ function getModuleExports() { return module; };
- /******/ __webpack_require__.d(getter, 'a', getter);
- /******/ return getter;
- /******/ };
- /******/
- /******/ // Object.prototype.hasOwnProperty.call
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
- /******/
- /******/ // __webpack_public_path__
- /******/ __webpack_require__.p = "";
- /******/
- /******/ // Load entry module and return exports
- /******/ return __webpack_require__(__webpack_require__.s = 1);
- /******/ })
- /************************************************************************/
- /******/ ([
- /* 0 */
- /***/ (function(module, exports, __webpack_require__) {
- // Generated from /tmp/tmp-2715Xlfam4sP62FI/ivprog.g4 by ANTLR 4.7
- // jshint ignore: start
- var antlr4 = __webpack_require__(2);
- var serializedATN = ["\u0003\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964",
- "\u00026\u0207\b\u0001\u0004\u0002\t\u0002\u0004\u0003\t\u0003\u0004",
- "\u0004\t\u0004\u0004\u0005\t\u0005\u0004\u0006\t\u0006\u0004\u0007\t",
- "\u0007\u0004\b\t\b\u0004\t\t\t\u0004\n\t\n\u0004\u000b\t\u000b\u0004",
- "\f\t\f\u0004\r\t\r\u0004\u000e\t\u000e\u0004\u000f\t\u000f\u0004\u0010",
- "\t\u0010\u0004\u0011\t\u0011\u0004\u0012\t\u0012\u0004\u0013\t\u0013",
- "\u0004\u0014\t\u0014\u0004\u0015\t\u0015\u0004\u0016\t\u0016\u0004\u0017",
- "\t\u0017\u0004\u0018\t\u0018\u0004\u0019\t\u0019\u0004\u001a\t\u001a",
- "\u0004\u001b\t\u001b\u0004\u001c\t\u001c\u0004\u001d\t\u001d\u0004\u001e",
- "\t\u001e\u0004\u001f\t\u001f\u0004 \t \u0004!\t!\u0004\"\t\"\u0004#",
- "\t#\u0004$\t$\u0004%\t%\u0004&\t&\u0004\'\t\'\u0004(\t(\u0004)\t)\u0004",
- "*\t*\u0004+\t+\u0004,\t,\u0004-\t-\u0004.\t.\u0004/\t/\u00040\t0\u0004",
- "1\t1\u00042\t2\u00043\t3\u00044\t4\u00045\t5\u00046\t6\u00047\t7\u0004",
- "8\t8\u00049\t9\u0004:\t:\u0004;\t;\u0004<\t<\u0004=\t=\u0004>\t>\u0004",
- "?\t?\u0004@\t@\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0002\u0003",
- "\u0002\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0003\u0003\u0003\u0003",
- "\u0003\u0003\u0003\u0003\u0003\u0003\u0004\u0003\u0004\u0003\u0004\u0003",
- "\u0004\u0003\u0004\u0003\u0005\u0003\u0005\u0003\u0005\u0003\u0005\u0003",
- "\u0005\u0003\u0006\u0003\u0006\u0003\u0006\u0003\u0006\u0003\u0006\u0003",
- "\u0006\u0003\u0006\u0003\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0003",
- "\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003\t\u0003\t\u0003\t\u0003\t\u0003",
- "\t\u0003\t\u0003\t\u0003\n\u0003\n\u0003\n\u0003\n\u0003\n\u0003\u000b",
- "\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b",
- "\u0003\u000b\u0003\u000b\u0003\u000b\u0003\f\u0003\f\u0003\f\u0003\f",
- "\u0003\f\u0003\f\u0003\r\u0003\r\u0003\r\u0003\r\u0003\r\u0003\r\u0003",
- "\r\u0003\r\u0003\r\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0003",
- "\u000e\u0003\u000e\u0003\u000e\u0003\u000f\u0003\u000f\u0003\u000f\u0003",
- "\u000f\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003",
- "\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003",
- "\u0011\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0012\u0003",
- "\u0012\u0003\u0012\u0003\u0013\u0003\u0013\u0003\u0013\u0003\u0013\u0003",
- "\u0013\u0003\u0014\u0003\u0014\u0003\u0014\u0003\u0014\u0003\u0014\u0003",
- "\u0014\u0003\u0015\u0003\u0015\u0003\u0015\u0003\u0015\u0003\u0015\u0003",
- "\u0015\u0003\u0015\u0003\u0016\u0003\u0016\u0003\u0016\u0003\u0016\u0003",
- "\u0016\u0003\u0016\u0003\u0017\u0003\u0017\u0003\u0017\u0003\u0017\u0003",
- "\u0017\u0003\u0017\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003",
- "\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003",
- "\u0018\u0003\u0018\u0003\u0018\u0003\u0019\u0003\u0019\u0003\u0019\u0003",
- "\u001a\u0003\u001a\u0003\u001a\u0003\u001a\u0003\u001a\u0003\u001b\u0003",
- "\u001b\u0003\u001b\u0003\u001b\u0003\u001b\u0003\u001b\u0003\u001c\u0003",
- "\u001c\u0003\u001c\u0003\u001c\u0003\u001c\u0003\u001d\u0003\u001d\u0003",
- "\u001d\u0003\u001d\u0003\u001e\u0003\u001e\u0003\u001e\u0003\u001e\u0003",
- "\u001f\u0003\u001f\u0003\u001f\u0003 \u0003 \u0003!\u0003!\u0003\"\u0003",
- "\"\u0003#\u0003#\u0003$\u0003$\u0003%\u0003%\u0003&\u0003&\u0003\'\u0003",
- "\'\u0003(\u0003(\u0003(\u0005(\u0148\n(\u0003)\u0003)\u0003*\u0003*",
- "\u0003+\u0003+\u0003,\u0003,\u0003-\u0003-\u0003-\u0003-\u0003-\u0003",
- "-\u0003-\u0003-\u0003-\u0005-\u015b\n-\u0003.\u0003.\u0003/\u0003/\u0003",
- "0\u00030\u00070\u0163\n0\f0\u000e0\u0166\u000b0\u00031\u00031\u0003",
- "1\u00031\u00032\u00062\u016d\n2\r2\u000e2\u016e\u00032\u00032\u0003",
- "2\u00032\u00052\u0175\n2\u00032\u00062\u0178\n2\r2\u000e2\u0179\u0003",
- "2\u00032\u00032\u00032\u00052\u0180\n2\u00032\u00062\u0183\n2\r2\u000e",
- "2\u0184\u00052\u0187\n2\u00033\u00063\u018a\n3\r3\u000e3\u018b\u0003",
- "3\u00033\u00063\u0190\n3\r3\u000e3\u0191\u00033\u00063\u0195\n3\r3\u000e",
- "3\u0196\u00033\u00033\u00073\u019b\n3\f3\u000e3\u019e\u000b3\u00033",
- "\u00053\u01a1\n3\u00034\u00034\u00054\u01a5\n4\u00034\u00064\u01a8\n",
- "4\r4\u000e4\u01a9\u00035\u00035\u00075\u01ae\n5\f5\u000e5\u01b1\u000b",
- "5\u00035\u00035\u00036\u00036\u00056\u01b7\n6\u00037\u00037\u00037\u0005",
- "7\u01bc\n7\u00037\u00037\u00038\u00038\u00038\u00038\u00039\u00039\u0003",
- ":\u0006:\u01c7\n:\r:\u000e:\u01c8\u0003:\u0005:\u01cc\n:\u0003;\u0003",
- ";\u0003<\u0003<\u0003=\u0003=\u0003=\u0003=\u0005=\u01d6\n=\u0003>\u0003",
- ">\u0003>\u0003>\u0003>\u0003>\u0003>\u0003>\u0003>\u0003>\u0003>\u0005",
- ">\u01e3\n>\u0003?\u0003?\u0003?\u0003?\u0003?\u0003?\u0003?\u0003@\u0003",
- "@\u0003@\u0003@\u0007@\u01f0\n@\f@\u000e@\u01f3\u000b@\u0003@\u0005",
- "@\u01f6\n@\u0003@\u0003@\u0003@\u0003@\u0003@\u0007@\u01fd\n@\f@\u000e",
- "@\u0200\u000b@\u0003@\u0003@\u0005@\u0204\n@\u0003@\u0003@\u0003\u01fe",
- "\u0002A\u0003\u0003\u0005\u0004\u0007\u0005\t\u0006\u000b\u0007\r\b",
- "\u000f\t\u0011\n\u0013\u000b\u0015\f\u0017\r\u0019\u000e\u001b\u000f",
- "\u001d\u0010\u001f\u0011!\u0012#\u0013%\u0014\'\u0015)\u0016+\u0017",
- "-\u0018/\u00191\u001a3\u001b5\u001c7\u001d9\u0002;\u0002=\u0002?\u001e",
- "A\u001fC E!G\"I#K$M%O&Q\'S(U)W*Y+[,]-_.a/c0e1g\u0002i2k\u0002m3o4q\u0002",
- "s5u\u0002w\u0002y\u0002{\u0002}\u0002\u007f6\u0003\u0002\u0012\u0004",
- "\u0002--//\u0005\u0002\'\',,11\u0004\u0002>>@@\u0005\u0002C\\aac|\u0006",
- "\u00022;C\\aac|\u0003\u00022;\u0003\u000223\u0004\u0002GGgg\u0006\u0002",
- "\f\f\u000f\u000f$$^^\u0006\u0002\f\f\u000f\u000f))^^\u0004\u0002\u000b",
- "\u000b\"\"\u0004\u0002\f\f\u000f\u000f\u0005\u00022;CHch\u0003\u0002",
- "29\n\u0002$$))^^ddhhppttvv\u0003\u000225\u0002\u021c\u0002\u0003\u0003",
- "\u0002\u0002\u0002\u0002\u0005\u0003\u0002\u0002\u0002\u0002\u0007\u0003",
- "\u0002\u0002\u0002\u0002\t\u0003\u0002\u0002\u0002\u0002\u000b\u0003",
- "\u0002\u0002\u0002\u0002\r\u0003\u0002\u0002\u0002\u0002\u000f\u0003",
- "\u0002\u0002\u0002\u0002\u0011\u0003\u0002\u0002\u0002\u0002\u0013\u0003",
- "\u0002\u0002\u0002\u0002\u0015\u0003\u0002\u0002\u0002\u0002\u0017\u0003",
- "\u0002\u0002\u0002\u0002\u0019\u0003\u0002\u0002\u0002\u0002\u001b\u0003",
- "\u0002\u0002\u0002\u0002\u001d\u0003\u0002\u0002\u0002\u0002\u001f\u0003",
- "\u0002\u0002\u0002\u0002!\u0003\u0002\u0002\u0002\u0002#\u0003\u0002",
- "\u0002\u0002\u0002%\u0003\u0002\u0002\u0002\u0002\'\u0003\u0002\u0002",
- "\u0002\u0002)\u0003\u0002\u0002\u0002\u0002+\u0003\u0002\u0002\u0002",
- "\u0002-\u0003\u0002\u0002\u0002\u0002/\u0003\u0002\u0002\u0002\u0002",
- "1\u0003\u0002\u0002\u0002\u00023\u0003\u0002\u0002\u0002\u00025\u0003",
- "\u0002\u0002\u0002\u00027\u0003\u0002\u0002\u0002\u0002?\u0003\u0002",
- "\u0002\u0002\u0002A\u0003\u0002\u0002\u0002\u0002C\u0003\u0002\u0002",
- "\u0002\u0002E\u0003\u0002\u0002\u0002\u0002G\u0003\u0002\u0002\u0002",
- "\u0002I\u0003\u0002\u0002\u0002\u0002K\u0003\u0002\u0002\u0002\u0002",
- "M\u0003\u0002\u0002\u0002\u0002O\u0003\u0002\u0002\u0002\u0002Q\u0003",
- "\u0002\u0002\u0002\u0002S\u0003\u0002\u0002\u0002\u0002U\u0003\u0002",
- "\u0002\u0002\u0002W\u0003\u0002\u0002\u0002\u0002Y\u0003\u0002\u0002",
- "\u0002\u0002[\u0003\u0002\u0002\u0002\u0002]\u0003\u0002\u0002\u0002",
- "\u0002_\u0003\u0002\u0002\u0002\u0002a\u0003\u0002\u0002\u0002\u0002",
- "c\u0003\u0002\u0002\u0002\u0002e\u0003\u0002\u0002\u0002\u0002i\u0003",
- "\u0002\u0002\u0002\u0002m\u0003\u0002\u0002\u0002\u0002o\u0003\u0002",
- "\u0002\u0002\u0002s\u0003\u0002\u0002\u0002\u0002\u007f\u0003\u0002",
- "\u0002\u0002\u0003\u0081\u0003\u0002\u0002\u0002\u0005\u0089\u0003\u0002",
- "\u0002\u0002\u0007\u008e\u0003\u0002\u0002\u0002\t\u0093\u0003\u0002",
- "\u0002\u0002\u000b\u0098\u0003\u0002\u0002\u0002\r\u009f\u0003\u0002",
- "\u0002\u0002\u000f\u00a3\u0003\u0002\u0002\u0002\u0011\u00a8\u0003\u0002",
- "\u0002\u0002\u0013\u00af\u0003\u0002\u0002\u0002\u0015\u00b4\u0003\u0002",
- "\u0002\u0002\u0017\u00be\u0003\u0002\u0002\u0002\u0019\u00c4\u0003\u0002",
- "\u0002\u0002\u001b\u00cd\u0003\u0002\u0002\u0002\u001d\u00d4\u0003\u0002",
- "\u0002\u0002\u001f\u00d8\u0003\u0002\u0002\u0002!\u00e3\u0003\u0002",
- "\u0002\u0002#\u00e8\u0003\u0002\u0002\u0002%\u00eb\u0003\u0002\u0002",
- "\u0002\'\u00f0\u0003\u0002\u0002\u0002)\u00f6\u0003\u0002\u0002\u0002",
- "+\u00fd\u0003\u0002\u0002\u0002-\u0103\u0003\u0002\u0002\u0002/\u0109",
- "\u0003\u0002\u0002\u00021\u0116\u0003\u0002\u0002\u00023\u0119\u0003",
- "\u0002\u0002\u00025\u011e\u0003\u0002\u0002\u00027\u0124\u0003\u0002",
- "\u0002\u00029\u0129\u0003\u0002\u0002\u0002;\u012d\u0003\u0002\u0002",
- "\u0002=\u0131\u0003\u0002\u0002\u0002?\u0134\u0003\u0002\u0002\u0002",
- "A\u0136\u0003\u0002\u0002\u0002C\u0138\u0003\u0002\u0002\u0002E\u013a",
- "\u0003\u0002\u0002\u0002G\u013c\u0003\u0002\u0002\u0002I\u013e\u0003",
- "\u0002\u0002\u0002K\u0140\u0003\u0002\u0002\u0002M\u0142\u0003\u0002",
- "\u0002\u0002O\u0147\u0003\u0002\u0002\u0002Q\u0149\u0003\u0002\u0002",
- "\u0002S\u014b\u0003\u0002\u0002\u0002U\u014d\u0003\u0002\u0002\u0002",
- "W\u014f\u0003\u0002\u0002\u0002Y\u015a\u0003\u0002\u0002\u0002[\u015c",
- "\u0003\u0002\u0002\u0002]\u015e\u0003\u0002\u0002\u0002_\u0160\u0003",
- "\u0002\u0002\u0002a\u0167\u0003\u0002\u0002\u0002c\u0186\u0003\u0002",
- "\u0002\u0002e\u01a0\u0003\u0002\u0002\u0002g\u01a2\u0003\u0002\u0002",
- "\u0002i\u01ab\u0003\u0002\u0002\u0002k\u01b6\u0003\u0002\u0002\u0002",
- "m\u01b8\u0003\u0002\u0002\u0002o\u01bf\u0003\u0002\u0002\u0002q\u01c3",
- "\u0003\u0002\u0002\u0002s\u01cb\u0003\u0002\u0002\u0002u\u01cd\u0003",
- "\u0002\u0002\u0002w\u01cf\u0003\u0002\u0002\u0002y\u01d5\u0003\u0002",
- "\u0002\u0002{\u01e2\u0003\u0002\u0002\u0002}\u01e4\u0003\u0002\u0002",
- "\u0002\u007f\u0203\u0003\u0002\u0002\u0002\u0081\u0082\u0007r\u0002",
- "\u0002\u0082\u0083\u0007t\u0002\u0002\u0083\u0084\u0007q\u0002\u0002",
- "\u0084\u0085\u0007i\u0002\u0002\u0085\u0086\u0007t\u0002\u0002\u0086",
- "\u0087\u0007c\u0002\u0002\u0087\u0088\u0007o\u0002\u0002\u0088\u0004",
- "\u0003\u0002\u0002\u0002\u0089\u008a\u0007t\u0002\u0002\u008a\u008b",
- "\u0007g\u0002\u0002\u008b\u008c\u0007c\u0002\u0002\u008c\u008d\u0007",
- "n\u0002\u0002\u008d\u0006\u0003\u0002\u0002\u0002\u008e\u008f\u0007",
- "x\u0002\u0002\u008f\u0090\u0007q\u0002\u0002\u0090\u0091\u0007k\u0002",
- "\u0002\u0091\u0092\u0007f\u0002\u0002\u0092\b\u0003\u0002\u0002\u0002",
- "\u0093\u0094\u0007d\u0002\u0002\u0094\u0095\u0007q\u0002\u0002\u0095",
- "\u0096\u0007q\u0002\u0002\u0096\u0097\u0007n\u0002\u0002\u0097\n\u0003",
- "\u0002\u0002\u0002\u0098\u0099\u0007u\u0002\u0002\u0099\u009a\u0007",
- "v\u0002\u0002\u009a\u009b\u0007t\u0002\u0002\u009b\u009c\u0007k\u0002",
- "\u0002\u009c\u009d\u0007p\u0002\u0002\u009d\u009e\u0007i\u0002\u0002",
- "\u009e\f\u0003\u0002\u0002\u0002\u009f\u00a0\u0007k\u0002\u0002\u00a0",
- "\u00a1\u0007p\u0002\u0002\u00a1\u00a2\u0007v\u0002\u0002\u00a2\u000e",
- "\u0003\u0002\u0002\u0002\u00a3\u00a4\u0007e\u0002\u0002\u00a4\u00a5",
- "\u0007j\u0002\u0002\u00a5\u00a6\u0007c\u0002\u0002\u00a6\u00a7\u0007",
- "t\u0002\u0002\u00a7\u0010\u0003\u0002\u0002\u0002\u00a8\u00a9\u0007",
- "u\u0002\u0002\u00a9\u00aa\u0007y\u0002\u0002\u00aa\u00ab\u0007k\u0002",
- "\u0002\u00ab\u00ac\u0007v\u0002\u0002\u00ac\u00ad\u0007e\u0002\u0002",
- "\u00ad\u00ae\u0007j\u0002\u0002\u00ae\u0012\u0003\u0002\u0002\u0002",
- "\u00af\u00b0\u0007e\u0002\u0002\u00b0\u00b1\u0007c\u0002\u0002\u00b1",
- "\u00b2\u0007u\u0002\u0002\u00b2\u00b3\u0007g\u0002\u0002\u00b3\u0014",
- "\u0003\u0002\u0002\u0002\u00b4\u00b5\u0007q\u0002\u0002\u00b5\u00b6",
- "\u0007v\u0002\u0002\u00b6\u00b7\u0007j\u0002\u0002\u00b7\u00b8\u0007",
- "g\u0002\u0002\u00b8\u00b9\u0007t\u0002\u0002\u00b9\u00ba\u0007y\u0002",
- "\u0002\u00ba\u00bb\u0007k\u0002\u0002\u00bb\u00bc\u0007u\u0002\u0002",
- "\u00bc\u00bd\u0007g\u0002\u0002\u00bd\u0016\u0003\u0002\u0002\u0002",
- "\u00be\u00bf\u0007e\u0002\u0002\u00bf\u00c0\u0007q\u0002\u0002\u00c0",
- "\u00c1\u0007p\u0002\u0002\u00c1\u00c2\u0007u\u0002\u0002\u00c2\u00c3",
- "\u0007v\u0002\u0002\u00c3\u0018\u0003\u0002\u0002\u0002\u00c4\u00c5",
- "\u0007h\u0002\u0002\u00c5\u00c6\u0007w\u0002\u0002\u00c6\u00c7\u0007",
- "p\u0002\u0002\u00c7\u00c8\u0007e\u0002\u0002\u00c8\u00c9\u0007v\u0002",
- "\u0002\u00c9\u00ca\u0007k\u0002\u0002\u00ca\u00cb\u0007q\u0002\u0002",
- "\u00cb\u00cc\u0007p\u0002\u0002\u00cc\u001a\u0003\u0002\u0002\u0002",
- "\u00cd\u00ce\u0007t\u0002\u0002\u00ce\u00cf\u0007g\u0002\u0002\u00cf",
- "\u00d0\u0007v\u0002\u0002\u00d0\u00d1\u0007w\u0002\u0002\u00d1\u00d2",
- "\u0007t\u0002\u0002\u00d2\u00d3\u0007p\u0002\u0002\u00d3\u001c\u0003",
- "\u0002\u0002\u0002\u00d4\u00d5\u0007h\u0002\u0002\u00d5\u00d6\u0007",
- "q\u0002\u0002\u00d6\u00d7\u0007t\u0002\u0002\u00d7\u001e\u0003\u0002",
- "\u0002\u0002\u00d8\u00d9\u0007t\u0002\u0002\u00d9\u00da\u0007g\u0002",
- "\u0002\u00da\u00db\u0007r\u0002\u0002\u00db\u00dc\u0007g\u0002\u0002",
- "\u00dc\u00dd\u0007c\u0002\u0002\u00dd\u00de\u0007v\u0002\u0002\u00de",
- "\u00df\u0007a\u0002\u0002\u00df\u00e0\u0007h\u0002\u0002\u00e0\u00e1",
- "\u0007q\u0002\u0002\u00e1\u00e2\u0007t\u0002\u0002\u00e2 \u0003\u0002",
- "\u0002\u0002\u00e3\u00e4\u0007h\u0002\u0002\u00e4\u00e5\u0007t\u0002",
- "\u0002\u00e5\u00e6\u0007q\u0002\u0002\u00e6\u00e7\u0007o\u0002\u0002",
- "\u00e7\"\u0003\u0002\u0002\u0002\u00e8\u00e9\u0007v\u0002\u0002\u00e9",
- "\u00ea\u0007q\u0002\u0002\u00ea$\u0003\u0002\u0002\u0002\u00eb\u00ec",
- "\u0007r\u0002\u0002\u00ec\u00ed\u0007c\u0002\u0002\u00ed\u00ee\u0007",
- "u\u0002\u0002\u00ee\u00ef\u0007u\u0002\u0002\u00ef&\u0003\u0002\u0002",
- "\u0002\u00f0\u00f1\u0007d\u0002\u0002\u00f1\u00f2\u0007t\u0002\u0002",
- "\u00f2\u00f3\u0007g\u0002\u0002\u00f3\u00f4\u0007c\u0002\u0002\u00f4",
- "\u00f5\u0007m\u0002\u0002\u00f5(\u0003\u0002\u0002\u0002\u00f6\u00f7",
- "\u0007t\u0002\u0002\u00f7\u00f8\u0007g\u0002\u0002\u00f8\u00f9\u0007",
- "r\u0002\u0002\u00f9\u00fa\u0007g\u0002\u0002\u00fa\u00fb\u0007c\u0002",
- "\u0002\u00fb\u00fc\u0007v\u0002\u0002\u00fc*\u0003\u0002\u0002\u0002",
- "\u00fd\u00fe\u0007w\u0002\u0002\u00fe\u00ff\u0007p\u0002\u0002\u00ff",
- "\u0100\u0007v\u0002\u0002\u0100\u0101\u0007k\u0002\u0002\u0101\u0102",
- "\u0007n\u0002\u0002\u0102,\u0003\u0002\u0002\u0002\u0103\u0104\u0007",
- "y\u0002\u0002\u0104\u0105\u0007j\u0002\u0002\u0105\u0106\u0007k\u0002",
- "\u0002\u0106\u0107\u0007n\u0002\u0002\u0107\u0108\u0007g\u0002\u0002",
- "\u0108.\u0003\u0002\u0002\u0002\u0109\u010a\u0007t\u0002\u0002\u010a",
- "\u010b\u0007g\u0002\u0002\u010b\u010c\u0007r\u0002\u0002\u010c\u010d",
- "\u0007g\u0002\u0002\u010d\u010e\u0007c\u0002\u0002\u010e\u010f\u0007",
- "v\u0002\u0002\u010f\u0110\u0007a\u0002\u0002\u0110\u0111\u0007y\u0002",
- "\u0002\u0111\u0112\u0007j\u0002\u0002\u0112\u0113\u0007k\u0002\u0002",
- "\u0113\u0114\u0007n\u0002\u0002\u0114\u0115\u0007g\u0002\u0002\u0115",
- "0\u0003\u0002\u0002\u0002\u0116\u0117\u0007k\u0002\u0002\u0117\u0118",
- "\u0007h\u0002\u0002\u01182\u0003\u0002\u0002\u0002\u0119\u011a\u0007",
- "g\u0002\u0002\u011a\u011b\u0007n\u0002\u0002\u011b\u011c\u0007u\u0002",
- "\u0002\u011c\u011d\u0007g\u0002\u0002\u011d4\u0003\u0002\u0002\u0002",
- "\u011e\u011f\u0007h\u0002\u0002\u011f\u0120\u0007c\u0002\u0002\u0120",
- "\u0121\u0007n\u0002\u0002\u0121\u0122\u0007u\u0002\u0002\u0122\u0123",
- "\u0007g\u0002\u0002\u01236\u0003\u0002\u0002\u0002\u0124\u0125\u0007",
- "v\u0002\u0002\u0125\u0126\u0007t\u0002\u0002\u0126\u0127\u0007w\u0002",
- "\u0002\u0127\u0128\u0007g\u0002\u0002\u01288\u0003\u0002\u0002\u0002",
- "\u0129\u012a\u0007p\u0002\u0002\u012a\u012b\u0007q\u0002\u0002\u012b",
- "\u012c\u0007v\u0002\u0002\u012c:\u0003\u0002\u0002\u0002\u012d\u012e",
- "\u0007C\u0002\u0002\u012e\u012f\u0007P\u0002\u0002\u012f\u0130\u0007",
- "F\u0002\u0002\u0130<\u0003\u0002\u0002\u0002\u0131\u0132\u0007Q\u0002",
- "\u0002\u0132\u0133\u0007T\u0002\u0002\u0133>\u0003\u0002\u0002\u0002",
- "\u0134\u0135\u0007(\u0002\u0002\u0135@\u0003\u0002\u0002\u0002\u0136",
- "\u0137\u0007*\u0002\u0002\u0137B\u0003\u0002\u0002\u0002\u0138\u0139",
- "\u0007+\u0002\u0002\u0139D\u0003\u0002\u0002\u0002\u013a\u013b\u0007",
- "]\u0002\u0002\u013bF\u0003\u0002\u0002\u0002\u013c\u013d\u0007_\u0002",
- "\u0002\u013dH\u0003\u0002\u0002\u0002\u013e\u013f\u0007}\u0002\u0002",
- "\u013fJ\u0003\u0002\u0002\u0002\u0140\u0141\u0007\u007f\u0002\u0002",
- "\u0141L\u0003\u0002\u0002\u0002\u0142\u0143\u0007.\u0002\u0002\u0143",
- "N\u0003\u0002\u0002\u0002\u0144\u0145\u0007>\u0002\u0002\u0145\u0148",
- "\u0007/\u0002\u0002\u0146\u0148\u0007\u2192\u0002\u0002\u0147\u0144",
- "\u0003\u0002\u0002\u0002\u0147\u0146\u0003\u0002\u0002\u0002\u0148P",
- "\u0003\u0002\u0002\u0002\u0149\u014a\t\u0002\u0002\u0002\u014aR\u0003",
- "\u0002\u0002\u0002\u014b\u014c\t\u0003\u0002\u0002\u014cT\u0003\u0002",
- "\u0002\u0002\u014d\u014e\u0005;\u001e\u0002\u014eV\u0003\u0002\u0002",
- "\u0002\u014f\u0150\u0005=\u001f\u0002\u0150X\u0003\u0002\u0002\u0002",
- "\u0151\u0152\u0007@\u0002\u0002\u0152\u015b\u0007?\u0002\u0002\u0153",
- "\u0154\u0007?\u0002\u0002\u0154\u015b\u0007?\u0002\u0002\u0155\u0156",
- "\u0007>\u0002\u0002\u0156\u015b\u0007?\u0002\u0002\u0157\u015b\t\u0004",
- "\u0002\u0002\u0158\u0159\u0007#\u0002\u0002\u0159\u015b\u0007?\u0002",
- "\u0002\u015a\u0151\u0003\u0002\u0002\u0002\u015a\u0153\u0003\u0002\u0002",
- "\u0002\u015a\u0155\u0003\u0002\u0002\u0002\u015a\u0157\u0003\u0002\u0002",
- "\u0002\u015a\u0158\u0003\u0002\u0002\u0002\u015bZ\u0003\u0002\u0002",
- "\u0002\u015c\u015d\u0007<\u0002\u0002\u015d\\\u0003\u0002\u0002\u0002",
- "\u015e\u015f\u00059\u001d\u0002\u015f^\u0003\u0002\u0002\u0002\u0160",
- "\u0164\t\u0005\u0002\u0002\u0161\u0163\t\u0006\u0002\u0002\u0162\u0161",
- "\u0003\u0002\u0002\u0002\u0163\u0166\u0003\u0002\u0002\u0002\u0164\u0162",
- "\u0003\u0002\u0002\u0002\u0164\u0165\u0003\u0002\u0002\u0002\u0165`",
- "\u0003\u0002\u0002\u0002\u0166\u0164\u0003\u0002\u0002\u0002\u0167\u0168",
- "\u0005_0\u0002\u0168\u0169\u00070\u0002\u0002\u0169\u016a\u0005_0\u0002",
- "\u016ab\u0003\u0002\u0002\u0002\u016b\u016d\t\u0007\u0002\u0002\u016c",
- "\u016b\u0003\u0002\u0002\u0002\u016d\u016e\u0003\u0002\u0002\u0002\u016e",
- "\u016c\u0003\u0002\u0002\u0002\u016e\u016f\u0003\u0002\u0002\u0002\u016f",
- "\u0187\u0003\u0002\u0002\u0002\u0170\u0171\u00072\u0002\u0002\u0171",
- "\u0175\u0007z\u0002\u0002\u0172\u0173\u00072\u0002\u0002\u0173\u0175",
- "\u0007Z\u0002\u0002\u0174\u0170\u0003\u0002\u0002\u0002\u0174\u0172",
- "\u0003\u0002\u0002\u0002\u0175\u0177\u0003\u0002\u0002\u0002\u0176\u0178",
- "\u0005u;\u0002\u0177\u0176\u0003\u0002\u0002\u0002\u0178\u0179\u0003",
- "\u0002\u0002\u0002\u0179\u0177\u0003\u0002\u0002\u0002\u0179\u017a\u0003",
- "\u0002\u0002\u0002\u017a\u0187\u0003\u0002\u0002\u0002\u017b\u017c\u0007",
- "2\u0002\u0002\u017c\u0180\u0007d\u0002\u0002\u017d\u017e\u00072\u0002",
- "\u0002\u017e\u0180\u0007D\u0002\u0002\u017f\u017b\u0003\u0002\u0002",
- "\u0002\u017f\u017d\u0003\u0002\u0002\u0002\u0180\u0182\u0003\u0002\u0002",
- "\u0002\u0181\u0183\t\b\u0002\u0002\u0182\u0181\u0003\u0002\u0002\u0002",
- "\u0183\u0184\u0003\u0002\u0002\u0002\u0184\u0182\u0003\u0002\u0002\u0002",
- "\u0184\u0185\u0003\u0002\u0002\u0002\u0185\u0187\u0003\u0002\u0002\u0002",
- "\u0186\u016c\u0003\u0002\u0002\u0002\u0186\u0174\u0003\u0002\u0002\u0002",
- "\u0186\u017f\u0003\u0002\u0002\u0002\u0187d\u0003\u0002\u0002\u0002",
- "\u0188\u018a\t\u0007\u0002\u0002\u0189\u0188\u0003\u0002\u0002\u0002",
- "\u018a\u018b\u0003\u0002\u0002\u0002\u018b\u0189\u0003\u0002\u0002\u0002",
- "\u018b\u018c\u0003\u0002\u0002\u0002\u018c\u018d\u0003\u0002\u0002\u0002",
- "\u018d\u018f\u00070\u0002\u0002\u018e\u0190\t\u0007\u0002\u0002\u018f",
- "\u018e\u0003\u0002\u0002\u0002\u0190\u0191\u0003\u0002\u0002\u0002\u0191",
- "\u018f\u0003\u0002\u0002\u0002\u0191\u0192\u0003\u0002\u0002\u0002\u0192",
- "\u01a1\u0003\u0002\u0002\u0002\u0193\u0195\t\u0007\u0002\u0002\u0194",
- "\u0193\u0003\u0002\u0002\u0002\u0195\u0196\u0003\u0002\u0002\u0002\u0196",
- "\u0194\u0003\u0002\u0002\u0002\u0196\u0197\u0003\u0002\u0002\u0002\u0197",
- "\u0198\u0003\u0002\u0002\u0002\u0198\u019c\u00070\u0002\u0002\u0199",
- "\u019b\t\u0007\u0002\u0002\u019a\u0199\u0003\u0002\u0002\u0002\u019b",
- "\u019e\u0003\u0002\u0002\u0002\u019c\u019a\u0003\u0002\u0002\u0002\u019c",
- "\u019d\u0003\u0002\u0002\u0002\u019d\u019f\u0003\u0002\u0002\u0002\u019e",
- "\u019c\u0003\u0002\u0002\u0002\u019f\u01a1\u0005g4\u0002\u01a0\u0189",
- "\u0003\u0002\u0002\u0002\u01a0\u0194\u0003\u0002\u0002\u0002\u01a1f",
- "\u0003\u0002\u0002\u0002\u01a2\u01a4\t\t\u0002\u0002\u01a3\u01a5\t\u0002",
- "\u0002\u0002\u01a4\u01a3\u0003\u0002\u0002\u0002\u01a4\u01a5\u0003\u0002",
- "\u0002\u0002\u01a5\u01a7\u0003\u0002\u0002\u0002\u01a6\u01a8\t\u0007",
- "\u0002\u0002\u01a7\u01a6\u0003\u0002\u0002\u0002\u01a8\u01a9\u0003\u0002",
- "\u0002\u0002\u01a9\u01a7\u0003\u0002\u0002\u0002\u01a9\u01aa\u0003\u0002",
- "\u0002\u0002\u01aah\u0003\u0002\u0002\u0002\u01ab\u01af\u0007$\u0002",
- "\u0002\u01ac\u01ae\u0005k6\u0002\u01ad\u01ac\u0003\u0002\u0002\u0002",
- "\u01ae\u01b1\u0003\u0002\u0002\u0002\u01af\u01ad\u0003\u0002\u0002\u0002",
- "\u01af\u01b0\u0003\u0002\u0002\u0002\u01b0\u01b2\u0003\u0002\u0002\u0002",
- "\u01b1\u01af\u0003\u0002\u0002\u0002\u01b2\u01b3\u0007$\u0002\u0002",
- "\u01b3j\u0003\u0002\u0002\u0002\u01b4\u01b7\n\n\u0002\u0002\u01b5\u01b7",
- "\u0005y=\u0002\u01b6\u01b4\u0003\u0002\u0002\u0002\u01b6\u01b5\u0003",
- "\u0002\u0002\u0002\u01b7l\u0003\u0002\u0002\u0002\u01b8\u01bb\u0007",
- ")\u0002\u0002\u01b9\u01bc\u0005y=\u0002\u01ba\u01bc\n\u000b\u0002\u0002",
- "\u01bb\u01b9\u0003\u0002\u0002\u0002\u01bb\u01ba\u0003\u0002\u0002\u0002",
- "\u01bc\u01bd\u0003\u0002\u0002\u0002\u01bd\u01be\u0007)\u0002\u0002",
- "\u01ben\u0003\u0002\u0002\u0002\u01bf\u01c0\t\f\u0002\u0002\u01c0\u01c1",
- "\u0003\u0002\u0002\u0002\u01c1\u01c2\b8\u0002\u0002\u01c2p\u0003\u0002",
- "\u0002\u0002\u01c3\u01c4\u0007=\u0002\u0002\u01c4r\u0003\u0002\u0002",
- "\u0002\u01c5\u01c7\t\r\u0002\u0002\u01c6\u01c5\u0003\u0002\u0002\u0002",
- "\u01c7\u01c8\u0003\u0002\u0002\u0002\u01c8\u01c6\u0003\u0002\u0002\u0002",
- "\u01c8\u01c9\u0003\u0002\u0002\u0002\u01c9\u01cc\u0003\u0002\u0002\u0002",
- "\u01ca\u01cc\u0005q9\u0002\u01cb\u01c6\u0003\u0002\u0002\u0002\u01cb",
- "\u01ca\u0003\u0002\u0002\u0002\u01cct\u0003\u0002\u0002\u0002\u01cd",
- "\u01ce\t\u000e\u0002\u0002\u01cev\u0003\u0002\u0002\u0002\u01cf\u01d0",
- "\t\u000f\u0002\u0002\u01d0x\u0003\u0002\u0002\u0002\u01d1\u01d2\u0007",
- "^\u0002\u0002\u01d2\u01d6\t\u0010\u0002\u0002\u01d3\u01d6\u0005}?\u0002",
- "\u01d4\u01d6\u0005{>\u0002\u01d5\u01d1\u0003\u0002\u0002\u0002\u01d5",
- "\u01d3\u0003\u0002\u0002\u0002\u01d5\u01d4\u0003\u0002\u0002\u0002\u01d6",
- "z\u0003\u0002\u0002\u0002\u01d7\u01d8\u0007^\u0002\u0002\u01d8\u01d9",
- "\t\u0011\u0002\u0002\u01d9\u01da\u0005w<\u0002\u01da\u01db\u0005w<\u0002",
- "\u01db\u01e3\u0003\u0002\u0002\u0002\u01dc\u01dd\u0007^\u0002\u0002",
- "\u01dd\u01de\u0005w<\u0002\u01de\u01df\u0005w<\u0002\u01df\u01e3\u0003",
- "\u0002\u0002\u0002\u01e0\u01e1\u0007^\u0002\u0002\u01e1\u01e3\u0005",
- "w<\u0002\u01e2\u01d7\u0003\u0002\u0002\u0002\u01e2\u01dc\u0003\u0002",
- "\u0002\u0002\u01e2\u01e0\u0003\u0002\u0002\u0002\u01e3|\u0003\u0002",
- "\u0002\u0002\u01e4\u01e5\u0007^\u0002\u0002\u01e5\u01e6\u0007w\u0002",
- "\u0002\u01e6\u01e7\u0005u;\u0002\u01e7\u01e8\u0005u;\u0002\u01e8\u01e9",
- "\u0005u;\u0002\u01e9\u01ea\u0005u;\u0002\u01ea~\u0003\u0002\u0002\u0002",
- "\u01eb\u01ec\u00071\u0002\u0002\u01ec\u01ed\u00071\u0002\u0002\u01ed",
- "\u01f1\u0003\u0002\u0002\u0002\u01ee\u01f0\n\r\u0002\u0002\u01ef\u01ee",
- "\u0003\u0002\u0002\u0002\u01f0\u01f3\u0003\u0002\u0002\u0002\u01f1\u01ef",
- "\u0003\u0002\u0002\u0002\u01f1\u01f2\u0003\u0002\u0002\u0002\u01f2\u01f5",
- "\u0003\u0002\u0002\u0002\u01f3\u01f1\u0003\u0002\u0002\u0002\u01f4\u01f6",
- "\u0007\u000f\u0002\u0002\u01f5\u01f4\u0003\u0002\u0002\u0002\u01f5\u01f6",
- "\u0003\u0002\u0002\u0002\u01f6\u01f7\u0003\u0002\u0002\u0002\u01f7\u0204",
- "\u0007\f\u0002\u0002\u01f8\u01f9\u00071\u0002\u0002\u01f9\u01fa\u0007",
- ",\u0002\u0002\u01fa\u01fe\u0003\u0002\u0002\u0002\u01fb\u01fd\u000b",
- "\u0002\u0002\u0002\u01fc\u01fb\u0003\u0002\u0002\u0002\u01fd\u0200\u0003",
- "\u0002\u0002\u0002\u01fe\u01ff\u0003\u0002\u0002\u0002\u01fe\u01fc\u0003",
- "\u0002\u0002\u0002\u01ff\u0201\u0003\u0002\u0002\u0002\u0200\u01fe\u0003",
- "\u0002\u0002\u0002\u0201\u0202\u0007,\u0002\u0002\u0202\u0204\u0007",
- "1\u0002\u0002\u0203\u01eb\u0003\u0002\u0002\u0002\u0203\u01f8\u0003",
- "\u0002\u0002\u0002\u0204\u0205\u0003\u0002\u0002\u0002\u0205\u0206\b",
- "@\u0003\u0002\u0206\u0080\u0003\u0002\u0002\u0002\u001e\u0002\u0147",
- "\u015a\u0164\u016e\u0174\u0179\u017f\u0184\u0186\u018b\u0191\u0196\u019c",
- "\u01a0\u01a4\u01a9\u01af\u01b6\u01bb\u01c8\u01cb\u01d5\u01e2\u01f1\u01f5",
- "\u01fe\u0203\u0004\b\u0002\u0002\u0002\u0003\u0002"].join("");
- var atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);
- var decisionsToDFA = atn.decisionToState.map( function(ds, index) { return new antlr4.dfa.DFA(ds, index); });
- function ivprog(input) {
- antlr4.Lexer.call(this, input);
- this._interp = new antlr4.atn.LexerATNSimulator(this, atn, decisionsToDFA, new antlr4.PredictionContextCache());
- return this;
- }
- ivprog.prototype = Object.create(antlr4.Lexer.prototype);
- ivprog.prototype.constructor = ivprog;
- ivprog.EOF = antlr4.Token.EOF;
- ivprog.RK_PROGRAM = 1;
- ivprog.RK_REAL = 2;
- ivprog.RK_VOID = 3;
- ivprog.RK_BOOLEAN = 4;
- ivprog.RK_STRING = 5;
- ivprog.RK_INTEGER = 6;
- ivprog.RK_CHARACTER = 7;
- ivprog.RK_SWITCH = 8;
- ivprog.RK_CASE = 9;
- ivprog.RK_DEFAULT = 10;
- ivprog.RK_CONST = 11;
- ivprog.RK_FUNCTION = 12;
- ivprog.RK_RETURN = 13;
- ivprog.RK_FOR = 14;
- ivprog.RK_FOR_ALT = 15;
- ivprog.RK_FOR_FROM = 16;
- ivprog.RK_FOR_TO = 17;
- ivprog.RK_FOR_PASS = 18;
- ivprog.RK_BREAK = 19;
- ivprog.RK_DO = 20;
- ivprog.RK_DO_UNTIL = 21;
- ivprog.RK_WHILE = 22;
- ivprog.RK_WHILE_ALT = 23;
- ivprog.RK_IF = 24;
- ivprog.RK_ELSE = 25;
- ivprog.RK_FALSE = 26;
- ivprog.RK_TRUE = 27;
- ivprog.RK_REFERENCE = 28;
- ivprog.OPEN_PARENTHESIS = 29;
- ivprog.CLOSE_PARENTHESIS = 30;
- ivprog.OPEN_BRACE = 31;
- ivprog.CLOSE_BRACE = 32;
- ivprog.OPEN_CURLY = 33;
- ivprog.CLOSE_CURLY = 34;
- ivprog.COMMA = 35;
- ivprog.EQUAL = 36;
- ivprog.SUM_OP = 37;
- ivprog.MULTI_OP = 38;
- ivprog.AND_OPERATOR = 39;
- ivprog.OR_OPERATOR = 40;
- ivprog.RELATIONAL_OPERATOR = 41;
- ivprog.COLON = 42;
- ivprog.NOT_OPERATOR = 43;
- ivprog.ID = 44;
- ivprog.LIB_ID = 45;
- ivprog.INTEGER = 46;
- ivprog.REAL = 47;
- ivprog.STRING = 48;
- ivprog.CHARACTER = 49;
- ivprog.WHITESPACE = 50;
- ivprog.EOS = 51;
- ivprog.COMMENTS = 52;
- ivprog.prototype.channelNames = [ "DEFAULT_TOKEN_CHANNEL", "HIDDEN" ];
- ivprog.prototype.modeNames = [ "DEFAULT_MODE" ];
- ivprog.prototype.literalNames = [ null, "'program'", "'real'", "'void'",
- "'bool'", "'string'", "'int'", "'char'",
- "'switch'", "'case'", "'otherwise'", "'const'",
- "'function'", "'return'", "'for'", "'repeat_for'",
- "'from'", "'to'", "'pass'", "'break'",
- "'repeat'", "'until'", "'while'", "'repeat_while'",
- "'if'", "'else'", "'false'", "'true'",
- "'&'", "'('", "')'", "'['", "']'", "'{'",
- "'}'", "','", null, null, null, null,
- null, null, "':'" ];
- ivprog.prototype.symbolicNames = [ null, "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_FOR_ALT",
- "RK_FOR_FROM", "RK_FOR_TO", "RK_FOR_PASS",
- "RK_BREAK", "RK_DO", "RK_DO_UNTIL", "RK_WHILE",
- "RK_WHILE_ALT", "RK_IF", "RK_ELSE", "RK_FALSE",
- "RK_TRUE", "RK_REFERENCE", "OPEN_PARENTHESIS",
- "CLOSE_PARENTHESIS", "OPEN_BRACE", "CLOSE_BRACE",
- "OPEN_CURLY", "CLOSE_CURLY", "COMMA",
- "EQUAL", "SUM_OP", "MULTI_OP", "AND_OPERATOR",
- "OR_OPERATOR", "RELATIONAL_OPERATOR",
- "COLON", "NOT_OPERATOR", "ID", "LIB_ID",
- "INTEGER", "REAL", "STRING", "CHARACTER",
- "WHITESPACE", "EOS", "COMMENTS" ];
- ivprog.prototype.ruleNames = [ "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_FOR_ALT",
- "RK_FOR_FROM", "RK_FOR_TO", "RK_FOR_PASS",
- "RK_BREAK", "RK_DO", "RK_DO_UNTIL", "RK_WHILE",
- "RK_WHILE_ALT", "RK_IF", "RK_ELSE", "RK_FALSE",
- "RK_TRUE", "RK_LOGICAL_NOT", "RK_LOGICAL_AND",
- "RK_LOGICAL_OR", "RK_REFERENCE", "OPEN_PARENTHESIS",
- "CLOSE_PARENTHESIS", "OPEN_BRACE", "CLOSE_BRACE",
- "OPEN_CURLY", "CLOSE_CURLY", "COMMA", "EQUAL",
- "SUM_OP", "MULTI_OP", "AND_OPERATOR", "OR_OPERATOR",
- "RELATIONAL_OPERATOR", "COLON", "NOT_OPERATOR",
- "ID", "LIB_ID", "INTEGER", "REAL", "ExponentPart",
- "STRING", "STRING_CHARACTER", "CHARACTER",
- "WHITESPACE", "SEMICOLON", "EOS", "HEX_DIGIT",
- "OCTAL_DIGIT", "ESC_SEQ", "ESC_OCTAL", "ESC_UNICODE",
- "COMMENTS" ];
- ivprog.prototype.grammarFileName = "ivprog.g4";
- exports.ivprog = ivprog;
- /***/ }),
- /* 1 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = {
- ivprog: __webpack_require__(0).ivprog
- };
- /***/ }),
- /* 2 */
- /***/ (function(module, exports) {
- module.exports = __webpack_require__(/*! antlr4/index */ "./node_modules/antlr4/index.js");
- /***/ })
- /******/ ]);
- /***/ }),
- /***/ "./grammar/en/langFunctions.js":
- /*!*************************************!*\
- !*** ./grammar/en/langFunctions.js ***!
- \*************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* This is a dictionary of the language defined functions
- **/
- /* harmony default export */ __webpack_exports__["default"] = ({
- main_function: "main",
- $read: "read",
- $write: "write",
- $numElements: "total_of_elements",
- $matrixLines: "total_of_lines",
- $matrixColumns: "total_of_columns",
- $substring: "substring",
- $length: "length",
- $uppercase: "uppercase",
- $lowercase: "lowercase",
- $charAt: "char_at",
- $isReal: "is_real",
- $isInt: "is_integer",
- $isBool: "is_logic",
- $castReal: "to_real",
- $castInt: "to_integer",
- $castBool: "to_logic",
- $castString: "to_string",
- $castChar: "to_char",
- $sin: "sin",
- $cos: "cos",
- $tan: "tan",
- $sqrt: "sqrt",
- $pow: "pow",
- $log: "log",
- $abs: "abs",
- $negate: "negate",
- $invert: "invert",
- $max: "maximum",
- $min: "minimum",
- $rand: "random"
- });
- /***/ }),
- /***/ "./grammar/en/langLibs.js":
- /*!********************************!*\
- !*** ./grammar/en/langLibs.js ***!
- \********************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * This is the dictionary of the language defined libraries
- */
- /* harmony default export */ __webpack_exports__["default"] = ({
- $mathLib: "Mathematic",
- $ioLib: "IO",
- $strLib: "Text",
- $arrayLib: "Array",
- $langLib: "Conversion"
- });
- /***/ }),
- /***/ "./grammar/index.js":
- /*!**************************!*\
- !*** ./grammar/index.js ***!
- \**************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _pt_ivprog_g4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pt/ivprog.g4 */ "./grammar/pt/ivprog.g4");
- /* harmony import */ var _pt_ivprog_g4__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_pt_ivprog_g4__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _pt_langFunctions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pt/langFunctions */ "./grammar/pt/langFunctions.js");
- /* harmony import */ var _pt_langLibs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./pt/langLibs */ "./grammar/pt/langLibs.js");
- /* harmony import */ var _en_ivprog_g4__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./en/ivprog.g4 */ "./grammar/en/ivprog.g4");
- /* harmony import */ var _en_ivprog_g4__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_en_ivprog_g4__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _en_langFunctions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./en/langFunctions */ "./grammar/en/langFunctions.js");
- /* harmony import */ var _en_langLibs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./en/langLibs */ "./grammar/en/langLibs.js");
- /*import * as ES from "./es/ivprog.g4";
- import ESFuncs from "./es/langFunctions";
- import ESLibs from "./es/langLibs";*/
- /* harmony default export */ __webpack_exports__["default"] = ({
- pt: {
- lexer: _pt_ivprog_g4__WEBPACK_IMPORTED_MODULE_0__["ivprog"],
- langFuncs: _pt_langFunctions__WEBPACK_IMPORTED_MODULE_1__["default"],
- langLibs: _pt_langLibs__WEBPACK_IMPORTED_MODULE_2__["default"]
- },
- en: {
- lexer: _en_ivprog_g4__WEBPACK_IMPORTED_MODULE_3__["ivprog"],
- langFuncs: _en_langFunctions__WEBPACK_IMPORTED_MODULE_4__["default"],
- langLibs: _en_langLibs__WEBPACK_IMPORTED_MODULE_5__["default"]
- } //es: {lexer: ES.ivprog, langFuncs: ESFuncs, langLibs: ESLibs}
- });
- /***/ }),
- /***/ "./grammar/pt/ivprog.g4":
- /*!******************************!*\
- !*** ./grammar/pt/ivprog.g4 ***!
- \******************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports =
- /******/ (function(modules) { // webpackBootstrap
- /******/ // The module cache
- /******/ var installedModules = {};
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/
- /******/ // Check if module is in cache
- /******/ if(installedModules[moduleId]) {
- /******/ return installedModules[moduleId].exports;
- /******/ }
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = installedModules[moduleId] = {
- /******/ i: moduleId,
- /******/ l: false,
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/
- /******/ // Flag the module as loaded
- /******/ module.l = true;
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /******/
- /******/ // expose the modules object (__webpack_modules__)
- /******/ __webpack_require__.m = modules;
- /******/
- /******/ // expose the module cache
- /******/ __webpack_require__.c = installedModules;
- /******/
- /******/ // identity function for calling harmony imports with the correct context
- /******/ __webpack_require__.i = function(value) { return value; };
- /******/
- /******/ // define getter function for harmony exports
- /******/ __webpack_require__.d = function(exports, name, getter) {
- /******/ if(!__webpack_require__.o(exports, name)) {
- /******/ Object.defineProperty(exports, name, {
- /******/ configurable: false,
- /******/ enumerable: true,
- /******/ get: getter
- /******/ });
- /******/ }
- /******/ };
- /******/
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = function(module) {
- /******/ var getter = module && module.__esModule ?
- /******/ function getDefault() { return module['default']; } :
- /******/ function getModuleExports() { return module; };
- /******/ __webpack_require__.d(getter, 'a', getter);
- /******/ return getter;
- /******/ };
- /******/
- /******/ // Object.prototype.hasOwnProperty.call
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
- /******/
- /******/ // __webpack_public_path__
- /******/ __webpack_require__.p = "";
- /******/
- /******/ // Load entry module and return exports
- /******/ return __webpack_require__(__webpack_require__.s = 1);
- /******/ })
- /************************************************************************/
- /******/ ([
- /* 0 */
- /***/ (function(module, exports, __webpack_require__) {
- // Generated from /tmp/tmp-2715XQhuJHzzsmxx/ivprog.g4 by ANTLR 4.7
- // jshint ignore: start
- var antlr4 = __webpack_require__(2);
- var serializedATN = ["\u0003\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964",
- "\u00026\u0222\b\u0001\u0004\u0002\t\u0002\u0004\u0003\t\u0003\u0004",
- "\u0004\t\u0004\u0004\u0005\t\u0005\u0004\u0006\t\u0006\u0004\u0007\t",
- "\u0007\u0004\b\t\b\u0004\t\t\t\u0004\n\t\n\u0004\u000b\t\u000b\u0004",
- "\f\t\f\u0004\r\t\r\u0004\u000e\t\u000e\u0004\u000f\t\u000f\u0004\u0010",
- "\t\u0010\u0004\u0011\t\u0011\u0004\u0012\t\u0012\u0004\u0013\t\u0013",
- "\u0004\u0014\t\u0014\u0004\u0015\t\u0015\u0004\u0016\t\u0016\u0004\u0017",
- "\t\u0017\u0004\u0018\t\u0018\u0004\u0019\t\u0019\u0004\u001a\t\u001a",
- "\u0004\u001b\t\u001b\u0004\u001c\t\u001c\u0004\u001d\t\u001d\u0004\u001e",
- "\t\u001e\u0004\u001f\t\u001f\u0004 \t \u0004!\t!\u0004\"\t\"\u0004#",
- "\t#\u0004$\t$\u0004%\t%\u0004&\t&\u0004\'\t\'\u0004(\t(\u0004)\t)\u0004",
- "*\t*\u0004+\t+\u0004,\t,\u0004-\t-\u0004.\t.\u0004/\t/\u00040\t0\u0004",
- "1\t1\u00042\t2\u00043\t3\u00044\t4\u00045\t5\u00046\t6\u00047\t7\u0004",
- "8\t8\u00049\t9\u0004:\t:\u0004;\t;\u0004<\t<\u0004=\t=\u0004>\t>\u0004",
- "?\t?\u0004@\t@\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0002\u0003",
- "\u0002\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0002\u0003\u0003\u0003",
- "\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0004\u0003\u0004\u0003",
- "\u0004\u0003\u0004\u0003\u0004\u0003\u0004\u0003\u0005\u0003\u0005\u0003",
- "\u0005\u0003\u0005\u0003\u0005\u0003\u0005\u0003\u0005\u0003\u0006\u0003",
- "\u0006\u0003\u0006\u0003\u0006\u0003\u0006\u0003\u0006\u0003\u0006\u0003",
- "\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0003",
- "\u0007\u0003\u0007\u0003\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003",
- "\b\u0003\b\u0003\b\u0003\b\u0003\t\u0003\t\u0003\t\u0003\t\u0003\t\u0003",
- "\t\u0003\t\u0003\t\u0003\n\u0003\n\u0003\n\u0003\n\u0003\n\u0003\u000b",
- "\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b",
- "\u0003\u000b\u0003\u000b\u0003\u000b\u0003\f\u0003\f\u0003\f\u0003\f",
- "\u0003\f\u0003\f\u0003\r\u0003\r\u0003\r\u0003\r\u0003\r\u0003\r\u0003",
- "\r\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0003",
- "\u000e\u0003\u000e\u0003\u000e\u0003\u000f\u0003\u000f\u0003\u000f\u0003",
- "\u000f\u0003\u000f\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003",
- "\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003",
- "\u0010\u0003\u0010\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0012\u0003",
- "\u0012\u0003\u0012\u0003\u0012\u0003\u0013\u0003\u0013\u0003\u0013\u0003",
- "\u0013\u0003\u0013\u0003\u0013\u0003\u0014\u0003\u0014\u0003\u0014\u0003",
- "\u0014\u0003\u0014\u0003\u0015\u0003\u0015\u0003\u0015\u0003\u0015\u0003",
- "\u0015\u0003\u0015\u0003\u0015\u0003\u0016\u0003\u0016\u0003\u0016\u0003",
- "\u0016\u0003\u0016\u0003\u0016\u0003\u0016\u0003\u0016\u0003\u0017\u0003",
- "\u0017\u0003\u0017\u0003\u0017\u0003\u0017\u0003\u0017\u0003\u0017\u0003",
- "\u0017\u0003\u0017\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003",
- "\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003",
- "\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003\u0018\u0003",
- "\u0019\u0003\u0019\u0003\u0019\u0003\u001a\u0003\u001a\u0003\u001a\u0003",
- "\u001a\u0003\u001a\u0003\u001a\u0003\u001b\u0003\u001b\u0003\u001b\u0003",
- "\u001b\u0003\u001b\u0003\u001b\u0003\u001c\u0003\u001c\u0003\u001c\u0003",
- "\u001c\u0003\u001c\u0003\u001c\u0003\u001c\u0003\u001c\u0003\u001c\u0003",
- "\u001c\u0003\u001c\u0003\u001d\u0003\u001d\u0003\u001d\u0003\u001d\u0003",
- "\u001e\u0003\u001e\u0003\u001f\u0003\u001f\u0003\u001f\u0003 \u0003",
- " \u0003!\u0003!\u0003\"\u0003\"\u0003#\u0003#\u0003$\u0003$\u0003%\u0003",
- "%\u0003&\u0003&\u0003\'\u0003\'\u0003(\u0003(\u0003(\u0005(\u0163\n",
- "(\u0003)\u0003)\u0003*\u0003*\u0003+\u0003+\u0003,\u0003,\u0003-\u0003",
- "-\u0003-\u0003-\u0003-\u0003-\u0003-\u0003-\u0003-\u0005-\u0176\n-\u0003",
- ".\u0003.\u0003/\u0003/\u00030\u00030\u00070\u017e\n0\f0\u000e0\u0181",
- "\u000b0\u00031\u00031\u00031\u00031\u00032\u00062\u0188\n2\r2\u000e",
- "2\u0189\u00032\u00032\u00032\u00032\u00052\u0190\n2\u00032\u00062\u0193",
- "\n2\r2\u000e2\u0194\u00032\u00032\u00032\u00032\u00052\u019b\n2\u0003",
- "2\u00062\u019e\n2\r2\u000e2\u019f\u00052\u01a2\n2\u00033\u00063\u01a5",
- "\n3\r3\u000e3\u01a6\u00033\u00033\u00063\u01ab\n3\r3\u000e3\u01ac\u0003",
- "3\u00063\u01b0\n3\r3\u000e3\u01b1\u00033\u00033\u00073\u01b6\n3\f3\u000e",
- "3\u01b9\u000b3\u00033\u00053\u01bc\n3\u00034\u00034\u00054\u01c0\n4",
- "\u00034\u00064\u01c3\n4\r4\u000e4\u01c4\u00035\u00035\u00075\u01c9\n",
- "5\f5\u000e5\u01cc\u000b5\u00035\u00035\u00036\u00036\u00056\u01d2\n",
- "6\u00037\u00037\u00037\u00057\u01d7\n7\u00037\u00037\u00038\u00038\u0003",
- "8\u00038\u00039\u00039\u0003:\u0006:\u01e2\n:\r:\u000e:\u01e3\u0003",
- ":\u0005:\u01e7\n:\u0003;\u0003;\u0003<\u0003<\u0003=\u0003=\u0003=\u0003",
- "=\u0005=\u01f1\n=\u0003>\u0003>\u0003>\u0003>\u0003>\u0003>\u0003>\u0003",
- ">\u0003>\u0003>\u0003>\u0005>\u01fe\n>\u0003?\u0003?\u0003?\u0003?\u0003",
- "?\u0003?\u0003?\u0003@\u0003@\u0003@\u0003@\u0007@\u020b\n@\f@\u000e",
- "@\u020e\u000b@\u0003@\u0005@\u0211\n@\u0003@\u0003@\u0003@\u0003@\u0003",
- "@\u0007@\u0218\n@\f@\u000e@\u021b\u000b@\u0003@\u0003@\u0005@\u021f",
- "\n@\u0003@\u0003@\u0003\u0219\u0002A\u0003\u0003\u0005\u0004\u0007\u0005",
- "\t\u0006\u000b\u0007\r\b\u000f\t\u0011\n\u0013\u000b\u0015\f\u0017\r",
- "\u0019\u000e\u001b\u000f\u001d\u0010\u001f\u0011!\u0012#\u0013%\u0014",
- "\'\u0015)\u0016+\u0017-\u0018/\u00191\u001a3\u001b5\u001c7\u001d9\u0002",
- ";\u0002=\u0002?\u001eA\u001fC E!G\"I#K$M%O&Q\'S(U)W*Y+[,]-_.a/c0e1g",
- "\u0002i2k\u0002m3o4q\u0002s5u\u0002w\u0002y\u0002{\u0002}\u0002\u007f",
- "6\u0003\u0002\u0012\u0004\u0002--//\u0005\u0002\'\',,11\u0004\u0002",
- ">>@@\u0005\u0002C\\aac|\u0006\u00022;C\\aac|\u0003\u00022;\u0003\u0002",
- "23\u0004\u0002GGgg\u0006\u0002\f\f\u000f\u000f$$^^\u0006\u0002\f\f\u000f",
- "\u000f))^^\u0004\u0002\u000b\u000b\"\"\u0004\u0002\f\f\u000f\u000f\u0005",
- "\u00022;CHch\u0003\u000229\n\u0002$$))^^ddhhppttvv\u0003\u000225\u0002",
- "\u0237\u0002\u0003\u0003\u0002\u0002\u0002\u0002\u0005\u0003\u0002\u0002",
- "\u0002\u0002\u0007\u0003\u0002\u0002\u0002\u0002\t\u0003\u0002\u0002",
- "\u0002\u0002\u000b\u0003\u0002\u0002\u0002\u0002\r\u0003\u0002\u0002",
- "\u0002\u0002\u000f\u0003\u0002\u0002\u0002\u0002\u0011\u0003\u0002\u0002",
- "\u0002\u0002\u0013\u0003\u0002\u0002\u0002\u0002\u0015\u0003\u0002\u0002",
- "\u0002\u0002\u0017\u0003\u0002\u0002\u0002\u0002\u0019\u0003\u0002\u0002",
- "\u0002\u0002\u001b\u0003\u0002\u0002\u0002\u0002\u001d\u0003\u0002\u0002",
- "\u0002\u0002\u001f\u0003\u0002\u0002\u0002\u0002!\u0003\u0002\u0002",
- "\u0002\u0002#\u0003\u0002\u0002\u0002\u0002%\u0003\u0002\u0002\u0002",
- "\u0002\'\u0003\u0002\u0002\u0002\u0002)\u0003\u0002\u0002\u0002\u0002",
- "+\u0003\u0002\u0002\u0002\u0002-\u0003\u0002\u0002\u0002\u0002/\u0003",
- "\u0002\u0002\u0002\u00021\u0003\u0002\u0002\u0002\u00023\u0003\u0002",
- "\u0002\u0002\u00025\u0003\u0002\u0002\u0002\u00027\u0003\u0002\u0002",
- "\u0002\u0002?\u0003\u0002\u0002\u0002\u0002A\u0003\u0002\u0002\u0002",
- "\u0002C\u0003\u0002\u0002\u0002\u0002E\u0003\u0002\u0002\u0002\u0002",
- "G\u0003\u0002\u0002\u0002\u0002I\u0003\u0002\u0002\u0002\u0002K\u0003",
- "\u0002\u0002\u0002\u0002M\u0003\u0002\u0002\u0002\u0002O\u0003\u0002",
- "\u0002\u0002\u0002Q\u0003\u0002\u0002\u0002\u0002S\u0003\u0002\u0002",
- "\u0002\u0002U\u0003\u0002\u0002\u0002\u0002W\u0003\u0002\u0002\u0002",
- "\u0002Y\u0003\u0002\u0002\u0002\u0002[\u0003\u0002\u0002\u0002\u0002",
- "]\u0003\u0002\u0002\u0002\u0002_\u0003\u0002\u0002\u0002\u0002a\u0003",
- "\u0002\u0002\u0002\u0002c\u0003\u0002\u0002\u0002\u0002e\u0003\u0002",
- "\u0002\u0002\u0002i\u0003\u0002\u0002\u0002\u0002m\u0003\u0002\u0002",
- "\u0002\u0002o\u0003\u0002\u0002\u0002\u0002s\u0003\u0002\u0002\u0002",
- "\u0002\u007f\u0003\u0002\u0002\u0002\u0003\u0081\u0003\u0002\u0002\u0002",
- "\u0005\u008a\u0003\u0002\u0002\u0002\u0007\u008f\u0003\u0002\u0002\u0002",
- "\t\u0095\u0003\u0002\u0002\u0002\u000b\u009c\u0003\u0002\u0002\u0002",
- "\r\u00a3\u0003\u0002\u0002\u0002\u000f\u00ab\u0003\u0002\u0002\u0002",
- "\u0011\u00b5\u0003\u0002\u0002\u0002\u0013\u00bd\u0003\u0002\u0002\u0002",
- "\u0015\u00c2\u0003\u0002\u0002\u0002\u0017\u00cc\u0003\u0002\u0002\u0002",
- "\u0019\u00d2\u0003\u0002\u0002\u0002\u001b\u00d9\u0003\u0002\u0002\u0002",
- "\u001d\u00e1\u0003\u0002\u0002\u0002\u001f\u00e6\u0003\u0002\u0002\u0002",
- "!\u00f2\u0003\u0002\u0002\u0002#\u00f5\u0003\u0002\u0002\u0002%\u00f9",
- "\u0003\u0002\u0002\u0002\'\u00ff\u0003\u0002\u0002\u0002)\u0104\u0003",
- "\u0002\u0002\u0002+\u010b\u0003\u0002\u0002\u0002-\u0113\u0003\u0002",
- "\u0002\u0002/\u011c\u0003\u0002\u0002\u00021\u012c\u0003\u0002\u0002",
- "\u00023\u012f\u0003\u0002\u0002\u00025\u0135\u0003\u0002\u0002\u0002",
- "7\u013b\u0003\u0002\u0002\u00029\u0146\u0003\u0002\u0002\u0002;\u014a",
- "\u0003\u0002\u0002\u0002=\u014c\u0003\u0002\u0002\u0002?\u014f\u0003",
- "\u0002\u0002\u0002A\u0151\u0003\u0002\u0002\u0002C\u0153\u0003\u0002",
- "\u0002\u0002E\u0155\u0003\u0002\u0002\u0002G\u0157\u0003\u0002\u0002",
- "\u0002I\u0159\u0003\u0002\u0002\u0002K\u015b\u0003\u0002\u0002\u0002",
- "M\u015d\u0003\u0002\u0002\u0002O\u0162\u0003\u0002\u0002\u0002Q\u0164",
- "\u0003\u0002\u0002\u0002S\u0166\u0003\u0002\u0002\u0002U\u0168\u0003",
- "\u0002\u0002\u0002W\u016a\u0003\u0002\u0002\u0002Y\u0175\u0003\u0002",
- "\u0002\u0002[\u0177\u0003\u0002\u0002\u0002]\u0179\u0003\u0002\u0002",
- "\u0002_\u017b\u0003\u0002\u0002\u0002a\u0182\u0003\u0002\u0002\u0002",
- "c\u01a1\u0003\u0002\u0002\u0002e\u01bb\u0003\u0002\u0002\u0002g\u01bd",
- "\u0003\u0002\u0002\u0002i\u01c6\u0003\u0002\u0002\u0002k\u01d1\u0003",
- "\u0002\u0002\u0002m\u01d3\u0003\u0002\u0002\u0002o\u01da\u0003\u0002",
- "\u0002\u0002q\u01de\u0003\u0002\u0002\u0002s\u01e6\u0003\u0002\u0002",
- "\u0002u\u01e8\u0003\u0002\u0002\u0002w\u01ea\u0003\u0002\u0002\u0002",
- "y\u01f0\u0003\u0002\u0002\u0002{\u01fd\u0003\u0002\u0002\u0002}\u01ff",
- "\u0003\u0002\u0002\u0002\u007f\u021e\u0003\u0002\u0002\u0002\u0081\u0082",
- "\u0007r\u0002\u0002\u0082\u0083\u0007t\u0002\u0002\u0083\u0084\u0007",
- "q\u0002\u0002\u0084\u0085\u0007i\u0002\u0002\u0085\u0086\u0007t\u0002",
- "\u0002\u0086\u0087\u0007c\u0002\u0002\u0087\u0088\u0007o\u0002\u0002",
- "\u0088\u0089\u0007c\u0002\u0002\u0089\u0004\u0003\u0002\u0002\u0002",
- "\u008a\u008b\u0007t\u0002\u0002\u008b\u008c\u0007g\u0002\u0002\u008c",
- "\u008d\u0007c\u0002\u0002\u008d\u008e\u0007n\u0002\u0002\u008e\u0006",
- "\u0003\u0002\u0002\u0002\u008f\u0090\u0007x\u0002\u0002\u0090\u0091",
- "\u0007c\u0002\u0002\u0091\u0092\u0007|\u0002\u0002\u0092\u0093\u0007",
- "k\u0002\u0002\u0093\u0094\u0007q\u0002\u0002\u0094\b\u0003\u0002\u0002",
- "\u0002\u0095\u0096\u0007n\u0002\u0002\u0096\u0097\u0007q\u0002\u0002",
- "\u0097\u0098\u0007i\u0002\u0002\u0098\u0099\u0007k\u0002\u0002\u0099",
- "\u009a\u0007e\u0002\u0002\u009a\u009b\u0007q\u0002\u0002\u009b\n\u0003",
- "\u0002\u0002\u0002\u009c\u009d\u0007e\u0002\u0002\u009d\u009e\u0007",
- "c\u0002\u0002\u009e\u009f\u0007f\u0002\u0002\u009f\u00a0\u0007g\u0002",
- "\u0002\u00a0\u00a1\u0007k\u0002\u0002\u00a1\u00a2\u0007c\u0002\u0002",
- "\u00a2\f\u0003\u0002\u0002\u0002\u00a3\u00a4\u0007k\u0002\u0002\u00a4",
- "\u00a5\u0007p\u0002\u0002\u00a5\u00a6\u0007v\u0002\u0002\u00a6\u00a7",
- "\u0007g\u0002\u0002\u00a7\u00a8\u0007k\u0002\u0002\u00a8\u00a9\u0007",
- "t\u0002\u0002\u00a9\u00aa\u0007q\u0002\u0002\u00aa\u000e\u0003\u0002",
- "\u0002\u0002\u00ab\u00ac\u0007e\u0002\u0002\u00ac\u00ad\u0007c\u0002",
- "\u0002\u00ad\u00ae\u0007t\u0002\u0002\u00ae\u00af\u0007c\u0002\u0002",
- "\u00af\u00b0\u0007e\u0002\u0002\u00b0\u00b1\u0007v\u0002\u0002\u00b1",
- "\u00b2\u0007g\u0002\u0002\u00b2\u00b3\u0007t\u0002\u0002\u00b3\u00b4",
- "\u0007g\u0002\u0002\u00b4\u0010\u0003\u0002\u0002\u0002\u00b5\u00b6",
- "\u0007g\u0002\u0002\u00b6\u00b7\u0007u\u0002\u0002\u00b7\u00b8\u0007",
- "e\u0002\u0002\u00b8\u00b9\u0007q\u0002\u0002\u00b9\u00ba\u0007n\u0002",
- "\u0002\u00ba\u00bb\u0007j\u0002\u0002\u00bb\u00bc\u0007c\u0002\u0002",
- "\u00bc\u0012\u0003\u0002\u0002\u0002\u00bd\u00be\u0007e\u0002\u0002",
- "\u00be\u00bf\u0007c\u0002\u0002\u00bf\u00c0\u0007u\u0002\u0002\u00c0",
- "\u00c1\u0007q\u0002\u0002\u00c1\u0014\u0003\u0002\u0002\u0002\u00c2",
- "\u00c3\u0007e\u0002\u0002\u00c3\u00c4\u0007q\u0002\u0002\u00c4\u00c5",
- "\u0007p\u0002\u0002\u00c5\u00c6\u0007v\u0002\u0002\u00c6\u00c7\u0007",
- "t\u0002\u0002\u00c7\u00c8\u0007c\u0002\u0002\u00c8\u00c9\u0007t\u0002",
- "\u0002\u00c9\u00ca\u0007k\u0002\u0002\u00ca\u00cb\u0007q\u0002\u0002",
- "\u00cb\u0016\u0003\u0002\u0002\u0002\u00cc\u00cd\u0007e\u0002\u0002",
- "\u00cd\u00ce\u0007q\u0002\u0002\u00ce\u00cf\u0007p\u0002\u0002\u00cf",
- "\u00d0\u0007u\u0002\u0002\u00d0\u00d1\u0007v\u0002\u0002\u00d1\u0018",
- "\u0003\u0002\u0002\u0002\u00d2\u00d3\u0007h\u0002\u0002\u00d3\u00d4",
- "\u0007w\u0002\u0002\u00d4\u00d5\u0007p\u0002\u0002\u00d5\u00d6\u0007",
- "e\u0002\u0002\u00d6\u00d7\u0007c\u0002\u0002\u00d7\u00d8\u0007q\u0002",
- "\u0002\u00d8\u001a\u0003\u0002\u0002\u0002\u00d9\u00da\u0007f\u0002",
- "\u0002\u00da\u00db\u0007g\u0002\u0002\u00db\u00dc\u0007x\u0002\u0002",
- "\u00dc\u00dd\u0007q\u0002\u0002\u00dd\u00de\u0007n\u0002\u0002\u00de",
- "\u00df\u0007x\u0002\u0002\u00df\u00e0\u0007c\u0002\u0002\u00e0\u001c",
- "\u0003\u0002\u0002\u0002\u00e1\u00e2\u0007r\u0002\u0002\u00e2\u00e3",
- "\u0007c\u0002\u0002\u00e3\u00e4\u0007t\u0002\u0002\u00e4\u00e5\u0007",
- "c\u0002\u0002\u00e5\u001e\u0003\u0002\u0002\u0002\u00e6\u00e7\u0007",
- "t\u0002\u0002\u00e7\u00e8\u0007g\u0002\u0002\u00e8\u00e9\u0007r\u0002",
- "\u0002\u00e9\u00ea\u0007k\u0002\u0002\u00ea\u00eb\u0007v\u0002\u0002",
- "\u00eb\u00ec\u0007c\u0002\u0002\u00ec\u00ed\u0007a\u0002\u0002\u00ed",
- "\u00ee\u0007r\u0002\u0002\u00ee\u00ef\u0007c\u0002\u0002\u00ef\u00f0",
- "\u0007t\u0002\u0002\u00f0\u00f1\u0007c\u0002\u0002\u00f1 \u0003\u0002",
- "\u0002\u0002\u00f2\u00f3\u0007f\u0002\u0002\u00f3\u00f4\u0007g\u0002",
- "\u0002\u00f4\"\u0003\u0002\u0002\u0002\u00f5\u00f6\u0007c\u0002\u0002",
- "\u00f6\u00f7\u0007v\u0002\u0002\u00f7\u00f8\u0007g\u0002\u0002\u00f8",
- "$\u0003\u0002\u0002\u0002\u00f9\u00fa\u0007r\u0002\u0002\u00fa\u00fb",
- "\u0007c\u0002\u0002\u00fb\u00fc\u0007u\u0002\u0002\u00fc\u00fd\u0007",
- "u\u0002\u0002\u00fd\u00fe\u0007q\u0002\u0002\u00fe&\u0003\u0002\u0002",
- "\u0002\u00ff\u0100\u0007r\u0002\u0002\u0100\u0101\u0007c\u0002\u0002",
- "\u0101\u0102\u0007t\u0002\u0002\u0102\u0103\u0007g\u0002\u0002\u0103",
- "(\u0003\u0002\u0002\u0002\u0104\u0105\u0007t\u0002\u0002\u0105\u0106",
- "\u0007g\u0002\u0002\u0106\u0107\u0007r\u0002\u0002\u0107\u0108\u0007",
- "k\u0002\u0002\u0108\u0109\u0007v\u0002\u0002\u0109\u010a\u0007c\u0002",
- "\u0002\u010a*\u0003\u0002\u0002\u0002\u010b\u010c\u0007c\u0002\u0002",
- "\u010c\u010d\u0007v\u0002\u0002\u010d\u010e\u0007g\u0002\u0002\u010e",
- "\u010f\u0007a\u0002\u0002\u010f\u0110\u0007s\u0002\u0002\u0110\u0111",
- "\u0007w\u0002\u0002\u0111\u0112\u0007g\u0002\u0002\u0112,\u0003\u0002",
- "\u0002\u0002\u0113\u0114\u0007g\u0002\u0002\u0114\u0115\u0007p\u0002",
- "\u0002\u0115\u0116\u0007s\u0002\u0002\u0116\u0117\u0007w\u0002\u0002",
- "\u0117\u0118\u0007c\u0002\u0002\u0118\u0119\u0007p\u0002\u0002\u0119",
- "\u011a\u0007v\u0002\u0002\u011a\u011b\u0007q\u0002\u0002\u011b.\u0003",
- "\u0002\u0002\u0002\u011c\u011d\u0007t\u0002\u0002\u011d\u011e\u0007",
- "g\u0002\u0002\u011e\u011f\u0007r\u0002\u0002\u011f\u0120\u0007k\u0002",
- "\u0002\u0120\u0121\u0007v\u0002\u0002\u0121\u0122\u0007c\u0002\u0002",
- "\u0122\u0123\u0007a\u0002\u0002\u0123\u0124\u0007g\u0002\u0002\u0124",
- "\u0125\u0007p\u0002\u0002\u0125\u0126\u0007s\u0002\u0002\u0126\u0127",
- "\u0007w\u0002\u0002\u0127\u0128\u0007c\u0002\u0002\u0128\u0129\u0007",
- "p\u0002\u0002\u0129\u012a\u0007v\u0002\u0002\u012a\u012b\u0007q\u0002",
- "\u0002\u012b0\u0003\u0002\u0002\u0002\u012c\u012d\u0007u\u0002\u0002",
- "\u012d\u012e\u0007g\u0002\u0002\u012e2\u0003\u0002\u0002\u0002\u012f",
- "\u0130\u0007u\u0002\u0002\u0130\u0131\u0007g\u0002\u0002\u0131\u0132",
- "\u0007p\u0002\u0002\u0132\u0133\u0007c\u0002\u0002\u0133\u0134\u0007",
- "q\u0002\u0002\u01344\u0003\u0002\u0002\u0002\u0135\u0136\u0007h\u0002",
- "\u0002\u0136\u0137\u0007c\u0002\u0002\u0137\u0138\u0007n\u0002\u0002",
- "\u0138\u0139\u0007u\u0002\u0002\u0139\u013a\u0007q\u0002\u0002\u013a",
- "6\u0003\u0002\u0002\u0002\u013b\u013c\u0007x\u0002\u0002\u013c\u013d",
- "\u0007g\u0002\u0002\u013d\u013e\u0007t\u0002\u0002\u013e\u013f\u0007",
- "f\u0002\u0002\u013f\u0140\u0007c\u0002\u0002\u0140\u0141\u0007f\u0002",
- "\u0002\u0141\u0142\u0007g\u0002\u0002\u0142\u0143\u0007k\u0002\u0002",
- "\u0143\u0144\u0007t\u0002\u0002\u0144\u0145\u0007q\u0002\u0002\u0145",
- "8\u0003\u0002\u0002\u0002\u0146\u0147\u0007p\u0002\u0002\u0147\u0148",
- "\u0007c\u0002\u0002\u0148\u0149\u0007q\u0002\u0002\u0149:\u0003\u0002",
- "\u0002\u0002\u014a\u014b\u0007G\u0002\u0002\u014b<\u0003\u0002\u0002",
- "\u0002\u014c\u014d\u0007Q\u0002\u0002\u014d\u014e\u0007W\u0002\u0002",
- "\u014e>\u0003\u0002\u0002\u0002\u014f\u0150\u0007(\u0002\u0002\u0150",
- "@\u0003\u0002\u0002\u0002\u0151\u0152\u0007*\u0002\u0002\u0152B\u0003",
- "\u0002\u0002\u0002\u0153\u0154\u0007+\u0002\u0002\u0154D\u0003\u0002",
- "\u0002\u0002\u0155\u0156\u0007]\u0002\u0002\u0156F\u0003\u0002\u0002",
- "\u0002\u0157\u0158\u0007_\u0002\u0002\u0158H\u0003\u0002\u0002\u0002",
- "\u0159\u015a\u0007}\u0002\u0002\u015aJ\u0003\u0002\u0002\u0002\u015b",
- "\u015c\u0007\u007f\u0002\u0002\u015cL\u0003\u0002\u0002\u0002\u015d",
- "\u015e\u0007.\u0002\u0002\u015eN\u0003\u0002\u0002\u0002\u015f\u0160",
- "\u0007>\u0002\u0002\u0160\u0163\u0007/\u0002\u0002\u0161\u0163\u0007",
- "\u2192\u0002\u0002\u0162\u015f\u0003\u0002\u0002\u0002\u0162\u0161\u0003",
- "\u0002\u0002\u0002\u0163P\u0003\u0002\u0002\u0002\u0164\u0165\t\u0002",
- "\u0002\u0002\u0165R\u0003\u0002\u0002\u0002\u0166\u0167\t\u0003\u0002",
- "\u0002\u0167T\u0003\u0002\u0002\u0002\u0168\u0169\u0005;\u001e\u0002",
- "\u0169V\u0003\u0002\u0002\u0002\u016a\u016b\u0005=\u001f\u0002\u016b",
- "X\u0003\u0002\u0002\u0002\u016c\u016d\u0007@\u0002\u0002\u016d\u0176",
- "\u0007?\u0002\u0002\u016e\u016f\u0007?\u0002\u0002\u016f\u0176\u0007",
- "?\u0002\u0002\u0170\u0171\u0007>\u0002\u0002\u0171\u0176\u0007?\u0002",
- "\u0002\u0172\u0176\t\u0004\u0002\u0002\u0173\u0174\u0007#\u0002\u0002",
- "\u0174\u0176\u0007?\u0002\u0002\u0175\u016c\u0003\u0002\u0002\u0002",
- "\u0175\u016e\u0003\u0002\u0002\u0002\u0175\u0170\u0003\u0002\u0002\u0002",
- "\u0175\u0172\u0003\u0002\u0002\u0002\u0175\u0173\u0003\u0002\u0002\u0002",
- "\u0176Z\u0003\u0002\u0002\u0002\u0177\u0178\u0007<\u0002\u0002\u0178",
- "\\\u0003\u0002\u0002\u0002\u0179\u017a\u00059\u001d\u0002\u017a^\u0003",
- "\u0002\u0002\u0002\u017b\u017f\t\u0005\u0002\u0002\u017c\u017e\t\u0006",
- "\u0002\u0002\u017d\u017c\u0003\u0002\u0002\u0002\u017e\u0181\u0003\u0002",
- "\u0002\u0002\u017f\u017d\u0003\u0002\u0002\u0002\u017f\u0180\u0003\u0002",
- "\u0002\u0002\u0180`\u0003\u0002\u0002\u0002\u0181\u017f\u0003\u0002",
- "\u0002\u0002\u0182\u0183\u0005_0\u0002\u0183\u0184\u00070\u0002\u0002",
- "\u0184\u0185\u0005_0\u0002\u0185b\u0003\u0002\u0002\u0002\u0186\u0188",
- "\t\u0007\u0002\u0002\u0187\u0186\u0003\u0002\u0002\u0002\u0188\u0189",
- "\u0003\u0002\u0002\u0002\u0189\u0187\u0003\u0002\u0002\u0002\u0189\u018a",
- "\u0003\u0002\u0002\u0002\u018a\u01a2\u0003\u0002\u0002\u0002\u018b\u018c",
- "\u00072\u0002\u0002\u018c\u0190\u0007z\u0002\u0002\u018d\u018e\u0007",
- "2\u0002\u0002\u018e\u0190\u0007Z\u0002\u0002\u018f\u018b\u0003\u0002",
- "\u0002\u0002\u018f\u018d\u0003\u0002\u0002\u0002\u0190\u0192\u0003\u0002",
- "\u0002\u0002\u0191\u0193\u0005u;\u0002\u0192\u0191\u0003\u0002\u0002",
- "\u0002\u0193\u0194\u0003\u0002\u0002\u0002\u0194\u0192\u0003\u0002\u0002",
- "\u0002\u0194\u0195\u0003\u0002\u0002\u0002\u0195\u01a2\u0003\u0002\u0002",
- "\u0002\u0196\u0197\u00072\u0002\u0002\u0197\u019b\u0007d\u0002\u0002",
- "\u0198\u0199\u00072\u0002\u0002\u0199\u019b\u0007D\u0002\u0002\u019a",
- "\u0196\u0003\u0002\u0002\u0002\u019a\u0198\u0003\u0002\u0002\u0002\u019b",
- "\u019d\u0003\u0002\u0002\u0002\u019c\u019e\t\b\u0002\u0002\u019d\u019c",
- "\u0003\u0002\u0002\u0002\u019e\u019f\u0003\u0002\u0002\u0002\u019f\u019d",
- "\u0003\u0002\u0002\u0002\u019f\u01a0\u0003\u0002\u0002\u0002\u01a0\u01a2",
- "\u0003\u0002\u0002\u0002\u01a1\u0187\u0003\u0002\u0002\u0002\u01a1\u018f",
- "\u0003\u0002\u0002\u0002\u01a1\u019a\u0003\u0002\u0002\u0002\u01a2d",
- "\u0003\u0002\u0002\u0002\u01a3\u01a5\t\u0007\u0002\u0002\u01a4\u01a3",
- "\u0003\u0002\u0002\u0002\u01a5\u01a6\u0003\u0002\u0002\u0002\u01a6\u01a4",
- "\u0003\u0002\u0002\u0002\u01a6\u01a7\u0003\u0002\u0002\u0002\u01a7\u01a8",
- "\u0003\u0002\u0002\u0002\u01a8\u01aa\u00070\u0002\u0002\u01a9\u01ab",
- "\t\u0007\u0002\u0002\u01aa\u01a9\u0003\u0002\u0002\u0002\u01ab\u01ac",
- "\u0003\u0002\u0002\u0002\u01ac\u01aa\u0003\u0002\u0002\u0002\u01ac\u01ad",
- "\u0003\u0002\u0002\u0002\u01ad\u01bc\u0003\u0002\u0002\u0002\u01ae\u01b0",
- "\t\u0007\u0002\u0002\u01af\u01ae\u0003\u0002\u0002\u0002\u01b0\u01b1",
- "\u0003\u0002\u0002\u0002\u01b1\u01af\u0003\u0002\u0002\u0002\u01b1\u01b2",
- "\u0003\u0002\u0002\u0002\u01b2\u01b3\u0003\u0002\u0002\u0002\u01b3\u01b7",
- "\u00070\u0002\u0002\u01b4\u01b6\t\u0007\u0002\u0002\u01b5\u01b4\u0003",
- "\u0002\u0002\u0002\u01b6\u01b9\u0003\u0002\u0002\u0002\u01b7\u01b5\u0003",
- "\u0002\u0002\u0002\u01b7\u01b8\u0003\u0002\u0002\u0002\u01b8\u01ba\u0003",
- "\u0002\u0002\u0002\u01b9\u01b7\u0003\u0002\u0002\u0002\u01ba\u01bc\u0005",
- "g4\u0002\u01bb\u01a4\u0003\u0002\u0002\u0002\u01bb\u01af\u0003\u0002",
- "\u0002\u0002\u01bcf\u0003\u0002\u0002\u0002\u01bd\u01bf\t\t\u0002\u0002",
- "\u01be\u01c0\t\u0002\u0002\u0002\u01bf\u01be\u0003\u0002\u0002\u0002",
- "\u01bf\u01c0\u0003\u0002\u0002\u0002\u01c0\u01c2\u0003\u0002\u0002\u0002",
- "\u01c1\u01c3\t\u0007\u0002\u0002\u01c2\u01c1\u0003\u0002\u0002\u0002",
- "\u01c3\u01c4\u0003\u0002\u0002\u0002\u01c4\u01c2\u0003\u0002\u0002\u0002",
- "\u01c4\u01c5\u0003\u0002\u0002\u0002\u01c5h\u0003\u0002\u0002\u0002",
- "\u01c6\u01ca\u0007$\u0002\u0002\u01c7\u01c9\u0005k6\u0002\u01c8\u01c7",
- "\u0003\u0002\u0002\u0002\u01c9\u01cc\u0003\u0002\u0002\u0002\u01ca\u01c8",
- "\u0003\u0002\u0002\u0002\u01ca\u01cb\u0003\u0002\u0002\u0002\u01cb\u01cd",
- "\u0003\u0002\u0002\u0002\u01cc\u01ca\u0003\u0002\u0002\u0002\u01cd\u01ce",
- "\u0007$\u0002\u0002\u01cej\u0003\u0002\u0002\u0002\u01cf\u01d2\n\n\u0002",
- "\u0002\u01d0\u01d2\u0005y=\u0002\u01d1\u01cf\u0003\u0002\u0002\u0002",
- "\u01d1\u01d0\u0003\u0002\u0002\u0002\u01d2l\u0003\u0002\u0002\u0002",
- "\u01d3\u01d6\u0007)\u0002\u0002\u01d4\u01d7\u0005y=\u0002\u01d5\u01d7",
- "\n\u000b\u0002\u0002\u01d6\u01d4\u0003\u0002\u0002\u0002\u01d6\u01d5",
- "\u0003\u0002\u0002\u0002\u01d7\u01d8\u0003\u0002\u0002\u0002\u01d8\u01d9",
- "\u0007)\u0002\u0002\u01d9n\u0003\u0002\u0002\u0002\u01da\u01db\t\f\u0002",
- "\u0002\u01db\u01dc\u0003\u0002\u0002\u0002\u01dc\u01dd\b8\u0002\u0002",
- "\u01ddp\u0003\u0002\u0002\u0002\u01de\u01df\u0007=\u0002\u0002\u01df",
- "r\u0003\u0002\u0002\u0002\u01e0\u01e2\t\r\u0002\u0002\u01e1\u01e0\u0003",
- "\u0002\u0002\u0002\u01e2\u01e3\u0003\u0002\u0002\u0002\u01e3\u01e1\u0003",
- "\u0002\u0002\u0002\u01e3\u01e4\u0003\u0002\u0002\u0002\u01e4\u01e7\u0003",
- "\u0002\u0002\u0002\u01e5\u01e7\u0005q9\u0002\u01e6\u01e1\u0003\u0002",
- "\u0002\u0002\u01e6\u01e5\u0003\u0002\u0002\u0002\u01e7t\u0003\u0002",
- "\u0002\u0002\u01e8\u01e9\t\u000e\u0002\u0002\u01e9v\u0003\u0002\u0002",
- "\u0002\u01ea\u01eb\t\u000f\u0002\u0002\u01ebx\u0003\u0002\u0002\u0002",
- "\u01ec\u01ed\u0007^\u0002\u0002\u01ed\u01f1\t\u0010\u0002\u0002\u01ee",
- "\u01f1\u0005}?\u0002\u01ef\u01f1\u0005{>\u0002\u01f0\u01ec\u0003\u0002",
- "\u0002\u0002\u01f0\u01ee\u0003\u0002\u0002\u0002\u01f0\u01ef\u0003\u0002",
- "\u0002\u0002\u01f1z\u0003\u0002\u0002\u0002\u01f2\u01f3\u0007^\u0002",
- "\u0002\u01f3\u01f4\t\u0011\u0002\u0002\u01f4\u01f5\u0005w<\u0002\u01f5",
- "\u01f6\u0005w<\u0002\u01f6\u01fe\u0003\u0002\u0002\u0002\u01f7\u01f8",
- "\u0007^\u0002\u0002\u01f8\u01f9\u0005w<\u0002\u01f9\u01fa\u0005w<\u0002",
- "\u01fa\u01fe\u0003\u0002\u0002\u0002\u01fb\u01fc\u0007^\u0002\u0002",
- "\u01fc\u01fe\u0005w<\u0002\u01fd\u01f2\u0003\u0002\u0002\u0002\u01fd",
- "\u01f7\u0003\u0002\u0002\u0002\u01fd\u01fb\u0003\u0002\u0002\u0002\u01fe",
- "|\u0003\u0002\u0002\u0002\u01ff\u0200\u0007^\u0002\u0002\u0200\u0201",
- "\u0007w\u0002\u0002\u0201\u0202\u0005u;\u0002\u0202\u0203\u0005u;\u0002",
- "\u0203\u0204\u0005u;\u0002\u0204\u0205\u0005u;\u0002\u0205~\u0003\u0002",
- "\u0002\u0002\u0206\u0207\u00071\u0002\u0002\u0207\u0208\u00071\u0002",
- "\u0002\u0208\u020c\u0003\u0002\u0002\u0002\u0209\u020b\n\r\u0002\u0002",
- "\u020a\u0209\u0003\u0002\u0002\u0002\u020b\u020e\u0003\u0002\u0002\u0002",
- "\u020c\u020a\u0003\u0002\u0002\u0002\u020c\u020d\u0003\u0002\u0002\u0002",
- "\u020d\u0210\u0003\u0002\u0002\u0002\u020e\u020c\u0003\u0002\u0002\u0002",
- "\u020f\u0211\u0007\u000f\u0002\u0002\u0210\u020f\u0003\u0002\u0002\u0002",
- "\u0210\u0211\u0003\u0002\u0002\u0002\u0211\u0212\u0003\u0002\u0002\u0002",
- "\u0212\u021f\u0007\f\u0002\u0002\u0213\u0214\u00071\u0002\u0002\u0214",
- "\u0215\u0007,\u0002\u0002\u0215\u0219\u0003\u0002\u0002\u0002\u0216",
- "\u0218\u000b\u0002\u0002\u0002\u0217\u0216\u0003\u0002\u0002\u0002\u0218",
- "\u021b\u0003\u0002\u0002\u0002\u0219\u021a\u0003\u0002\u0002\u0002\u0219",
- "\u0217\u0003\u0002\u0002\u0002\u021a\u021c\u0003\u0002\u0002\u0002\u021b",
- "\u0219\u0003\u0002\u0002\u0002\u021c\u021d\u0007,\u0002\u0002\u021d",
- "\u021f\u00071\u0002\u0002\u021e\u0206\u0003\u0002\u0002\u0002\u021e",
- "\u0213\u0003\u0002\u0002\u0002\u021f\u0220\u0003\u0002\u0002\u0002\u0220",
- "\u0221\b@\u0003\u0002\u0221\u0080\u0003\u0002\u0002\u0002\u001e\u0002",
- "\u0162\u0175\u017f\u0189\u018f\u0194\u019a\u019f\u01a1\u01a6\u01ac\u01b1",
- "\u01b7\u01bb\u01bf\u01c4\u01ca\u01d1\u01d6\u01e3\u01e6\u01f0\u01fd\u020c",
- "\u0210\u0219\u021e\u0004\b\u0002\u0002\u0002\u0003\u0002"].join("");
- var atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);
- var decisionsToDFA = atn.decisionToState.map( function(ds, index) { return new antlr4.dfa.DFA(ds, index); });
- function ivprog(input) {
- antlr4.Lexer.call(this, input);
- this._interp = new antlr4.atn.LexerATNSimulator(this, atn, decisionsToDFA, new antlr4.PredictionContextCache());
- return this;
- }
- ivprog.prototype = Object.create(antlr4.Lexer.prototype);
- ivprog.prototype.constructor = ivprog;
- ivprog.EOF = antlr4.Token.EOF;
- ivprog.RK_PROGRAM = 1;
- ivprog.RK_REAL = 2;
- ivprog.RK_VOID = 3;
- ivprog.RK_BOOLEAN = 4;
- ivprog.RK_STRING = 5;
- ivprog.RK_INTEGER = 6;
- ivprog.RK_CHARACTER = 7;
- ivprog.RK_SWITCH = 8;
- ivprog.RK_CASE = 9;
- ivprog.RK_DEFAULT = 10;
- ivprog.RK_CONST = 11;
- ivprog.RK_FUNCTION = 12;
- ivprog.RK_RETURN = 13;
- ivprog.RK_FOR = 14;
- ivprog.RK_FOR_ALT = 15;
- ivprog.RK_FOR_FROM = 16;
- ivprog.RK_FOR_TO = 17;
- ivprog.RK_FOR_PASS = 18;
- ivprog.RK_BREAK = 19;
- ivprog.RK_DO = 20;
- ivprog.RK_DO_UNTIL = 21;
- ivprog.RK_WHILE = 22;
- ivprog.RK_WHILE_ALT = 23;
- ivprog.RK_IF = 24;
- ivprog.RK_ELSE = 25;
- ivprog.RK_FALSE = 26;
- ivprog.RK_TRUE = 27;
- ivprog.RK_REFERENCE = 28;
- ivprog.OPEN_PARENTHESIS = 29;
- ivprog.CLOSE_PARENTHESIS = 30;
- ivprog.OPEN_BRACE = 31;
- ivprog.CLOSE_BRACE = 32;
- ivprog.OPEN_CURLY = 33;
- ivprog.CLOSE_CURLY = 34;
- ivprog.COMMA = 35;
- ivprog.EQUAL = 36;
- ivprog.SUM_OP = 37;
- ivprog.MULTI_OP = 38;
- ivprog.AND_OPERATOR = 39;
- ivprog.OR_OPERATOR = 40;
- ivprog.RELATIONAL_OPERATOR = 41;
- ivprog.COLON = 42;
- ivprog.NOT_OPERATOR = 43;
- ivprog.ID = 44;
- ivprog.LIB_ID = 45;
- ivprog.INTEGER = 46;
- ivprog.REAL = 47;
- ivprog.STRING = 48;
- ivprog.CHARACTER = 49;
- ivprog.WHITESPACE = 50;
- ivprog.EOS = 51;
- ivprog.COMMENTS = 52;
- ivprog.prototype.channelNames = [ "DEFAULT_TOKEN_CHANNEL", "HIDDEN" ];
- ivprog.prototype.modeNames = [ "DEFAULT_MODE" ];
- ivprog.prototype.literalNames = [ null, "'programa'", "'real'", "'vazio'",
- "'logico'", "'cadeia'", "'inteiro'", "'caractere'",
- "'escolha'", "'caso'", "'contrario'",
- "'const'", "'funcao'", "'devolva'", "'para'",
- "'repita_para'", "'de'", "'ate'", "'passo'",
- "'pare'", "'repita'", "'ate_que'", "'enquanto'",
- "'repita_enquanto'", "'se'", "'senao'",
- "'falso'", "'verdadeiro'", "'&'", "'('",
- "')'", "'['", "']'", "'{'", "'}'", "','",
- null, null, null, null, null, null, "':'" ];
- ivprog.prototype.symbolicNames = [ null, "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_FOR_ALT",
- "RK_FOR_FROM", "RK_FOR_TO", "RK_FOR_PASS",
- "RK_BREAK", "RK_DO", "RK_DO_UNTIL", "RK_WHILE",
- "RK_WHILE_ALT", "RK_IF", "RK_ELSE", "RK_FALSE",
- "RK_TRUE", "RK_REFERENCE", "OPEN_PARENTHESIS",
- "CLOSE_PARENTHESIS", "OPEN_BRACE", "CLOSE_BRACE",
- "OPEN_CURLY", "CLOSE_CURLY", "COMMA",
- "EQUAL", "SUM_OP", "MULTI_OP", "AND_OPERATOR",
- "OR_OPERATOR", "RELATIONAL_OPERATOR",
- "COLON", "NOT_OPERATOR", "ID", "LIB_ID",
- "INTEGER", "REAL", "STRING", "CHARACTER",
- "WHITESPACE", "EOS", "COMMENTS" ];
- ivprog.prototype.ruleNames = [ "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_FOR_ALT",
- "RK_FOR_FROM", "RK_FOR_TO", "RK_FOR_PASS",
- "RK_BREAK", "RK_DO", "RK_DO_UNTIL", "RK_WHILE",
- "RK_WHILE_ALT", "RK_IF", "RK_ELSE", "RK_FALSE",
- "RK_TRUE", "RK_LOGICAL_NOT", "RK_LOGICAL_AND",
- "RK_LOGICAL_OR", "RK_REFERENCE", "OPEN_PARENTHESIS",
- "CLOSE_PARENTHESIS", "OPEN_BRACE", "CLOSE_BRACE",
- "OPEN_CURLY", "CLOSE_CURLY", "COMMA", "EQUAL",
- "SUM_OP", "MULTI_OP", "AND_OPERATOR", "OR_OPERATOR",
- "RELATIONAL_OPERATOR", "COLON", "NOT_OPERATOR",
- "ID", "LIB_ID", "INTEGER", "REAL", "ExponentPart",
- "STRING", "STRING_CHARACTER", "CHARACTER",
- "WHITESPACE", "SEMICOLON", "EOS", "HEX_DIGIT",
- "OCTAL_DIGIT", "ESC_SEQ", "ESC_OCTAL", "ESC_UNICODE",
- "COMMENTS" ];
- ivprog.prototype.grammarFileName = "ivprog.g4";
- exports.ivprog = ivprog;
- /***/ }),
- /* 1 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = {
- ivprog: __webpack_require__(0).ivprog
- };
- /***/ }),
- /* 2 */
- /***/ (function(module, exports) {
- module.exports = __webpack_require__(/*! antlr4/index */ "./node_modules/antlr4/index.js");
- /***/ })
- /******/ ]);
- /***/ }),
- /***/ "./grammar/pt/langFunctions.js":
- /*!*************************************!*\
- !*** ./grammar/pt/langFunctions.js ***!
- \*************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* This is a dictionary of the language defined functions
- **/
- /* harmony default export */ __webpack_exports__["default"] = ({
- main_function: "inicio",
- $read: "leia",
- $write: "escreva",
- $numElements: "total_de_elementos",
- $matrixLines: "total_de_linhas",
- $matrixColumns: "total_de_colunas",
- $substring: "subcadeia",
- $length: "comprimento",
- $uppercase: "caixa_alta",
- $lowercase: "caixa_baixa",
- $charAt: "caractere_na_posicao",
- $isReal: "e_real",
- $isInt: "e_inteiro",
- $isBool: "e_logico",
- $castReal: "como_real",
- $castInt: "como_inteiro",
- $castBool: "como_logico",
- $castString: "como_cadeia",
- $castChar: "como_caractere",
- $sin: "seno",
- $cos: "cosseno",
- $tan: "tangente",
- $sqrt: "raiz_quadrada",
- $pow: "potencia",
- $log: "logaritmo",
- $abs: "modulo",
- $negate: "trocar_sinal",
- $invert: "inverter_valor",
- $max: "maximo",
- $min: "minimo",
- $rand: "numero_aleatorio"
- });
- /***/ }),
- /***/ "./grammar/pt/langLibs.js":
- /*!********************************!*\
- !*** ./grammar/pt/langLibs.js ***!
- \********************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * This is the dictionary of the language defined libraries
- */
- /* harmony default export */ __webpack_exports__["default"] = ({
- $mathLib: "Matematica",
- $ioLib: "ES",
- $strLib: "Texto",
- $arrayLib: "Arranjo",
- $langLib: "Conversao"
- });
- /***/ }),
- /***/ "./i18n/error.csv":
- /*!************************!*\
- !*** ./i18n/error.csv ***!
- \************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = {"pt":{"token_missing_one":"Erro de sintaxe: Espera-se $0, mas encontrou-se $1 na linha:$2, coluna:$3","token_missing_two":"Erro de sintaxe: Esperava-se $0 ou $1 mas encontrou-se $2 na liha:$3, coluna: $4","eos_missing":"Falta uma nova linha ou ; na linha: $0, coluna: $1","invalid_type":"$0 na linha: $1, coluna: $2 é um tipo inválido. Os tipos válidos são: $3","invalid_array_dimension":"A dimensão inválida na linha: $0, coluna: $1. Insira um $2 ou identificador válido do mesmo tipo.","invalid_array_size":"O tamnho do vetor/matriz excede o máximo de 2 na linha $0","extra_lines":"Nenhum texto é permitido após '}' em 'programa {...}'","invalid_main_return":"A função $0 declarada na linha $2 deve retornar $1.","invalid_var_declaration":"Erro na linha $0: variáveis só podem ser declaradas no corpo principal da função e nas primeiras linhas, antes de qualquer comando.","invalid_break_command":"Erro na linha $0. O comando $1 não pode ser usado fora de uma estrutura de repetição ou 'escolha...caso'","invalid_terminal":"Não é possível utilizar $0 na expressão da linha: $1, coluna: $2. Tente um valor númerico, variável ou chamada de função.","const_not_init":"Erro na linha: $0, coluna: $1. Uma variável declarada como const deve ser inicializada","id_missing":"Esperava-se um identificador, mas encontrou-se $0 na linha: $1, coluna: $2","invalid_id_format":"$0 na linha: $1, coluna: $2 não é um identificador válido. O símbolo '.' não é permitido neste contexto.","main_missing":"A função principal não foi encontrada","invalid_global_var":"Erro crítico: Chamada inválida da função initGlobal fora do contexto BASE","not_implemented":"Erro interno crítico: A função definida pelo sistema $0 não foi implementada.","function_missing":"A função $0 não foi encontrada","function_missing_full":"A função $0 na linha: $1, coluna: $2 não foi encontrada","invalid_parameters_size_full":"Erro na linha $0: a quantidade de parâmetros fornecidos à função $1 está incorreta. Esperava-se $2, encontrou-se $3.","invalid_parameters_size":"A quantidade de parâmetros fornecidos à função $0 está incorreta. Esperava-se $1, encontrou-se $2","invalid_ref_full":"A expressão $0 fornecida como parâmetro para a função $1 na linha $2 não é válida para esta função. Use uma variável ou posição de vetor.","invalid_ref":"A expressão $0 fornecida como parâmetro para a função $1 não é válida para esta função. Use uma variável ou posição de vetor.","invalid_parameter_type_full":"A expressão $0 fornecida como parâmetro para a função $1 na linha $2 não é compatível com o tipo esperado.","invalid_parameter_type":"A expressão $0 fornecida como parâmetro para a função $1 não é compatível com o tipo esperado.","unknown_command_full":"Erro interno crítico: comando desconhecido encontrado na linha $0","unknown_command":"Erro interno crítico: comando desconhecido encontrado!","loop_condition_type_full":"Erro na linha: $0, coluna $1: a condição $2 do laço de repetição deve ser do tipo lógico","loop_condition_type":"A condição $0 do laço de repetição deve ser do tipo lógico","endless_loop_full":"Possível laço infinito detectado no seu código. Verifique a linha $0","endless_loop":"Possível laço infinito detectado no seu código.","for_condition_type_full":"Erro na linha: $0, coluna $1: a condição de parada $2 do comando para(...) deve ser do tipo lógico","for_condition_type":"A condição de parada $0 do comando para(...) deve ser do tipo lógico","if_condition_type_full":"Erro na linha: $0, coluna $1: a condição $2 do comando se...senao deve ser do tipo lógico","if_condition_type":"A condição $0 do comando se...senao deve ser do tipo lógico","invalid_return_type_full":"Erro na linha $0: a expressão não produz um tipo compatível com a função $1. Tipo esperado: $2.","invalid_return_type":"A expressão não produz um tipo compatível com a função $0. Tipo esperado: $1.","invalid_void_return_full":"Erro na linha $0: a função $1 não pode retornar uma expressão vazia, use uma espressão do tipo $2","invalid_void_return":"A função $0 não pode retornar uma expressão vazia, use uma espressão do tipo $1","unexpected_break_command_full":"Erro interno crítico: comando pare encontrado fora do contexto de um laço/escolha..caso na linha $0","unexpected_break_command":"Erro interno crítico: comando pare encontrado fora do contexto de um laço/escolha..caso","invalid_dimension":"As dimensões de um vetor/matriz devem ser do tipo inteiro","void_in_expression_full":"Erro na linha: $0, coluna: $1: a função $2 não pode ser utilizada em uma expressão pois seu tipo de retorno é vazio","void_in_expression":"A função $0 não pode ser utilizada em uma expressão pois seu tipo de retorno é vazio","invalid_array_access_full":"Identificador $0 na linha: $1, coluna: $2 não se refere a um vetor/matriz válido","invalid_array_access":"Identificador $0 não se refere a um vetor/matriz válido","invalid_matrix_access_full":"Identificador $0 na linha: $1, coluna: $2 não se refere a uma matriz válida","invalid_matrix_access":"Identificador $0 não se refere a uma matriz válida","matrix_column_outbounds_full":"Erro na linha $0: número de colunas $1 é inválido para a matriz $2 que possui $3 colunas","matrix_column_outbounds":"Número de colunas $0 é inválido para a matriz $1 que possui $2 colunas","matrix_line_outbounds_full":"Erro na linha $0: número de linhas $1 é inválido para a matriz $2 que possui $3 linhas","matrix_line_outbounds":"Número de linhas $0 é inválido para a matriz $1 que possui $2 linhas","vector_line_outbounds_full":"Erro na linha $0: O número de elementos $1 é inválido para a vetor $2 que possui $3 elementos.","vector_line_outbounds":"O número de elementos $1 é inválido para a vetor $2 que possui $3 elementos.","vector_not_matrix_full":"Erro na linha $0: $1 não é uma matriz","vector_not_matrix":"$0 não é uma matriz","invalid_infix_op_full":"Erro na linha $0: a expressão $1 é inválida, pois o operador $2 não pode ser aplicado aos tipos $3 e $4","invalid_infix_op":"A expressão $0 é inválida, pois o operador $1 não pode ser aplicado aos tipos $2 e $3","invalid_unary_op_full":"Erro na linha $0: a expressão $1 é inválida, pois o operador $2 não pode ser aplicado ao tipo $3","invalid_unary_op":"A expressão $0 é inválida, pois o operador $1 não pode ser aplicado ao tipo $2","unknown_op":"Erro interno crítico: Operação $0 desconhecida","duplicate_function":"A função $0 na linha: $1, coluna: $2 já foi definida anteriormente.","duplicate_variable":"A variável $0 na linha: $1, coluna: $2 já foi declarada anteriormente.","main_parameters":"A função inicio não pode ter parâmetros.","symbol_not_found_full":"A variável $0 na linha: $1, coluna: $2 não foi declarada","symbol_not_found":"A variável $0 não foi declarada","array_dimension_not_int_full":"As dimensões do arranjo (vetor ou matriz) na linha $0 devem ser do tipo inteiro.","array_dimension_not_int":"As dimensões de um arranjo (vetor ou matriz) devem ser do tipo inteiro.","array_dimension_not_positive_full":"As dimensões do arranjo (vetor ou matriz) na linha $0 devem ser valores positivos.","array_dimension_not_positive":"As dimensões de um arranjo (vetor ou matriz) devem ser valores positivos.","incompatible_types_full":"Era esperado um $0 mas a expressão $1 na linha $2 resulta em $3.","incompatible_types":"Era esperado um $0 mas a expressão $1 resulta em $2.","incompatible_types_array_full":"A expressão $0 na linha $2 é incompatível com o tipo $1.","incompatible_types_array":"A expressão $0 é incompatível com o tipo $1.","invalid_case_type_full":"O caso $0 na linha $1 é incompatível com o tipo $2.","invalid_case_type":"O caso $0 é incompatível com o tipo $1.","function_no_return":"A função $0 não possui um comando de devolução acessível. Toda função deve ter ao menos um comando 'devolva' no seu corpo principal.","invalid_array_literal_type_full":"Erro na linha $0: a expressão $1 não resulta em um tipo compatível.","invalid_array_literal_type":"A expressão $0 não resulta em um tipo compatível.","invalid_array_literal_line_full":"Erro na linha $0: esperava-se $1 linhas mas encontrou $2.","invalid_array_literal_line":"Esperava-se $0 linhas mas encontrou $1.","invalid_array_literal_column_full":"Erro na linha $0: esperava-se $1 colunas mas encontrou $2.","invalid_array_literal_column":"Esperava-se $0 colunas mas encontrou $1.","exceeded_input_request":"A quantidade de leituras requisitadas execedeu a quantidade de entradas disponíveis.","test_case_few_reads":"Caso de teste $0 falhou: ainda restam entradas!","test_case_failed":"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$1\"> <span>Caso de teste $0 não executou com sucesso.</span></div>","test_case_failed_exception":"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$2\"> <span>Caso de teste $0 falhou</span>: $1","test_case_exception":"Ocorreu uma exceção no caso de teste $0: $1","invalid_type_conversion":"O valor $0 não pode ser convertido para o tipo $1","invalid_read_type":"Erro na linha $0: A entrada \"$1\" não é do tipo $2, que é o tipo da variável <span class='ivprog-error-varname'>$3</span>.","invalid_read_type_array":"Erro na linha $0: A entrada \"$1\" não é do tipo $2, que é o tipo aceito pela variável <span class='ivprog-error-varname'>$3</span> que é um $4.","inform_valid_identifier":"Informe um nome válido! O nome não pode ser uma palavra reservadas e deve começar com letras ou _ e conter apenas letras, números e _.","inform_valid_global_duplicated":"Já existe uma variável global com o nome <span class='ivprog-error-varname'>$0</span>, você precisa de nomes distintos.","inform_valid_variable_duplicated":"Já existe uma variável com o nome <span class='ivprog-error-varname'>$0</span> na função <span class='ivprog-error-varname'>$1</span>, você precisa de nomes distintos.","inform_valid_function_duplicated":"Já existe uma função com o nome <span class='ivprog-error-varname'>$0</span>, você precisa de nomes distintos.","inform_valid_param_duplicated":"Já existe um parâmetro com o nome <span class='ivprog-error-varname'>$0</span> na função <span class='ivprog-error-varname'>$1</span>, você precisa de nomes distintos.","invalid_character":"O caractere $0 na linha $1 não pode ser utilizado neste contexto.","annonymous_array_literal":"Erro na linha $0: a notação de vetor/matriz só permitida durante a inicialização de uma variável desse tipo. Ex: inteiro vec[3] ← {1,2,3}.","invalid_matrix_literal_line":"A expressão $0 na linha $1 não possui um número de elementos igual a linha anterior. Todas as linhas de uma matriz devem ter a mesma quantidade de elementos.","cannot_infer_matrix_line":"Não é possível inferir o número de linhas da matriz $0 na linha $1. É necessário que ela seja inicializada ou que o valor seja informado de forma explícita.","cannot_infer_matrix_column":"Não é possível inferir o número de colunas da matriz $0 na linha $1. É necessário que ela seja inicializada ou que o valor seja informado de forma explícita.","cannot_infer_vector_size":"Não é possível inferir o número de elementos do vetor $0 na linha $1. É necessário que ele seja inicializado ou que o valor seja informado de forma explícita","matrix_to_vector_literal_attr":"Erro na linha $0: A expressão $1 representa uma matriz e não pode ser atribuída ao vetor $2.","vector_to_matrix_literal_attr":"Erro na linha $0: A expressão $1 representa um vetor e não pode ser atribuído a matriz $2.","invalid_const_ref_full":"A variável $0 fornecida como parâmetro para a função $1 na linha $2 é uma constante e não pode ser usada neste contexto. Use uma variável ou posição de vetor.","invalid_const_ref":"A variável $0 fornecida como parâmetro para a função $1 é uma constante e não pode ser usada neste contexto. Use uma variável ou posição de vetor.","invalid_const_assignment_full":"Erro na linha $0: $1 é uma constante e portanto não pode ter seu valor alterado","invalid_const_assignment":"$0 é uma constante e portanto não pode ter seu valor alterado","array_init_not_literal":"Erro na linha $0: Vetor/Matriz só pode ser inicializado por literal. Ex: real vetor[] <- {1,2,3}","array_exceeds_2d":"Erro na linha $0: O número máximo de dimensões que um arranjo pode ter é 2. Elemento de 3 ou mais dimensões encontrado!","invalid_matrix_id_dimension":"Erro na linha $0: Você deve definir todas as dimensões da matriz quando uma delas é definida por uma variável! Ex: real mat1[var][5], mat2[5][var]","invalid_vector_init":"Erro na linha $0: Não se pode inicializar um vetor que teve seu tamanho declarado utilizando uma variável! Utilize uma atribuição de vetores ou use um laço de repetição.","invalid_matrix_init":"Erro na linha $0: Não se pode inicializar uma matrix que teve ao menos uma das suas dimensões declaradas utilizando uma variável! Utilize uma atribuição de matrizes ou use um laço de repetição.","invalid_vector_assignment_full":"Erro na linha $0: Só se pode atribuir um vetor a outro desde que eles comportem o mesmo número de elementos. $1 comporta $2 e $3 comporta $4!","invalid_vector_assignment":"Só se pode atribuir um vetor a outro desde que eles comportem o mesmo número de elementos. $0 comporta $1 e $2 comporta $3!","invalid_matrix_assignment_full":"Erro na linha $0: Só se pode atribuir uma matriz a outra desde que ambas possuam dimensões de mesmo tamanho. $1 tem $2 linhas e $3 colunas, enquanto $4 possui $5 linhas e $6 colunas!","invalid_matrix_assignment":"Só se pode atribuir uma matriz a outra desde que ambas possuam dimensões de mesmo tamanho. $0 tem $1 linhas e $2 colunas, enquanto $3 possui $4 linhas e $5 colunas!","matrix_to_vector_attr":"Erro na linha $0: $1 representa uma matriz e não pode ser atribuída ao vetor $2.","vector_to_matrix_attr":"Erro na linha $0: $1 representa um vetor e não pode ser atribuído a matriz $2.","invalid_matrix_index_assign_full":"Erro na linha $0: A posição $1 da matriz $2 aceita apenas vetores de tamanho $3, mas $4 tem tamanho $5","invalid_matrix_index_assign":"A linha $0 da matriz $1 aceita apenas vetores de tamanho $2, mas $3 tem tamanho $4","invalid_number_elements_vector":"Esperava-se por $0 elementos na linha $1 mas a expressão $2 possui $3 elementos.","invalid_number_lines_matrix":"Esperava-se por uma matriz com $0 linhas na linha $1 mas a expressão $2 possui $3 linhas","divsion_by_zero_full":"Erro na linha $0: A expressão $1 resulta em uma divisão por 0.","divsion_by_zero":"A expressão $0 resulta em uma divisão por 0.","undefined_tanget_value":"Erro na linha $0: A tangente de $1° não é indefinida.","negative_log_value":"Erro na linha $0: Não se pode calcular o log de um valor negativo.","invalid_string_index":"Erro na linha $0 durante a execução da função $1: $2 é um índice inválido para a cadeia de texto $3. Os valores válidos vão de 0 à $4","negative_sqrt_value":"Erro na linha $0: Não é permitido calcular a raiz quadrada de um número negativo.","exceeded_recursive_calls":"Erro na execução da linha $0: Número de chamadas recursivas execedeu o limite máximo definido!","invalid_for_variable":"Erro na linha $0: A variavel $1 utilizada no comando repita_para deve ser do tipo inteiro.","invalid_for_from":"Erro na linha $0: O valor $1 passado para o parâmetro 'de' do comando repita_para deve ser do tipo inteiro.","invalid_for_to":"Erro na linha $0: O valor $1 passado para o parâmetro 'para' do comando repita_para deve ser do tipo inteiro.","invalid_for_pass":"Erro na linha $0: O valor $1 passado para o parâmetro 'passo' do comando repita_para deve ser do tipo inteiro.","exceed_max_instructions":"Número de instruções excedeu o limite definido. Certifique-se que seu código não possui laços infinitos ou muitas chamadas de funções recursivas."},"en":{"token_missing_one":"Syntax error: Expected $0 but found $1 at line:$2, column:$3","token_missing_two":"Syntax error: Expected $0 or $1 but found $2 at line:$3, column: $4","eos_missing":"A new line or a ‘;’ is missing at line: $0, column: $1","invalid_type":"$0 at line: $1, column: $2 is a invalid type. The valid types are: $3","invalid_array_dimension":"Invalid dimension at line: $0, column: $1. Insert a $2 or a valid identifier of the same type.","invalid_array_size":"The array at line $0 exceeds the maximum size of 2.","extra_lines":"No text is allowed after '}' in 'program { … }'","invalid_main_return":"The function $0 declared at line $2 must return $1.","invalid_var_declaration":"Error at line $0: Variables can only be declared in the main body of a function and at the first lines, before any command.","invalid_break_command":"Error at line $0. The command $1 cannot be used outside a loop command or ‘switch ...case’ structure.","invalid_terminal":"It is not possible to use $0 in the expression at line: $1, column: $2. Try a numeric value, variable or function call.","const_not_init":"Error at line: $0, column: $1. A variable declared as const must be initialized.","id_missing":"Expected an identifier but found $0 at line: $1, column: $2.","invalid_id_format":"$0 at line: $1, column: $2 is not a valid identifier. The symbol '.' is not permitted in this context.","main_missing":"The main function was not found. You need to declare a function of return type void named main.","invalid_global_var":"Critical Error: Invalid call of the function IVProgProcessor.initGlobal outside the BASE context.","not_implemented":"Critial internal error: The system defined function $0 was not found.","function_missing":"The function $0 was not found.","function_missing_full":"The function $0 at line: $1, column: $2 was not found.","invalid_parameters_size_full":"Error at line $0: The number of parameters provided to the function $1 is incorrect. It expected $2 but found $3.","invalid_parameters_size":"The number of parameters provided to the function $0 is incorrect. It expected $1 but found $2.","invalid_ref_full":"The expression $0 provided as a parameter to the function $1 at line $2 is not valid in this context. Use a variable or a position of a vector.","invalid_ref":"The expression $0 provided as a parameter to the function $1 is not valid in this context. Use a variable or a position of a vector.","invalid_parameter_type_full":"The expression $0 provided as a parameter to the function $1 at line $2 is not of the expected type.","invalid_parameter_type":"The expression $0 provided as a parameter to the function $1 is not of the expected type.","unknown_command_full":"Internal error: an unknown command found at line $0.","unknown_command":"Internal error: an unknown command found.","loop_condition_type_full":"Error at line: $0, column $1: the condition $2 of the loop must be of type bool (true or false).","loop_condition_type":"The condition $0 of the loop must be of type bool (true or false).","endless_loop_full":"Possible infinite loop detected in your code. Check line $0.","endless_loop":"Possible infinite loop detected in your code.","for_condition_type_full":"Erro na linha: $0, coluna $1: a condição de parada $2 do comando para(...) deve ser do tipo lógico","for_condition_type":"A condição de parada $0 do comando para(...) deve ser do tipo lógico","if_condition_type_full":"Error at line: $0, column $1: the condition $2 in the if … else command must result in a bool (true or false).","if_condition_type":"The condition $0 in the if … else command must result in a bool (true or false).","invalid_return_type_full":"Error at line $0: The expression doest not result in a type compatible with the function $1. Expected type: $2.","invalid_return_type":"The expression doest not result in a type compatible with the function $0. Expected type: $1.","invalid_void_return_full":"Error at line $0: The function $1 cannot return an empty expression, use an expression that results in a $2","invalid_void_return":"The function $0 cannot return an empty expression, use an expression that results in a $1","unexpected_break_command_full":"Critical error at line $0: a break command was found outside a valid context: loop or switch … case structure.","unexpected_break_command":"Critical error: a break command was found outside a valid context: loop or switch … case structure.","invalid_dimension":"Array (vector or matrix) dimensions must be of type int.","void_in_expression_full":"Error at line: $0, column: $1: The function $2 cannot be used inside an expression since its return type is void.","void_in_expression":"The function $0 cannot be used inside an expression since its return type is void.","invalid_array_access_full":"Identifier $0 at line: $1, column: $2 does not identify a valid vector or matrix.","invalid_array_access":"Identifier $0 does not identify a valid vector or matrix.","invalid_matrix_access_full":"Identifier $0 at line: $1, column: $2 does not identify a valid matrix.","invalid_matrix_access":"Identifier $0 does not identify a valid matrix.","matrix_column_outbounds_full":"Error at line $0: The number of columns $1 is invalid for the matrix $2 which has $3 columns.","matrix_column_outbounds":"The number of columns $0 is invalid for the matrix $1 which has $2 columns.","matrix_line_outbounds_full":"Error at line $0: The number of lines $1 is invalid for matrix $2 which has $3 lines.","matrix_line_outbounds":"The number of lines $0 is invalid for matrix $1 which has $2 lines.","vector_line_outbounds_full":"Error at line $0: The number of elements $1 is invalid for vector $2 which has $3 elements.","vector_line_outbounds":"Error at line $0: The number of elements $1 is invalid for vector $2 which has $3 elements.","vector_not_matrix_full":"Error at line $0: $1 is not a matrix.","vector_not_matrix":"$0 is not a matrix.","invalid_infix_op_full":"Error at line $0: The expression $1 is not valid because the operator $2 cannot be applied to the types $3 and $4.","invalid_infix_op":"The expression $0 is not valid because the operator $1 cannot be applied to the types $2 and $3.","invalid_unary_op_full":"Error at line $0: The expression $1 is not valid because the operator $2 cannot be applied to the type $3.","invalid_unary_op":"The expression $0 is not valid because the operator $1 cannot be applied to the type $2.","unknown_op":"Critical error: Unknown operator $0.","duplicate_function":"The function $0 at line: $1, column: $2 has already been declared.","duplicate_variable":"The variable $0 at line: $1, column: $2 has already been declared.","main_parameters":"The main function cannot have parameters.","symbol_not_found_full":"The variable $0 at line: $1, column: $2 has not been declared.","symbol_not_found":"The variable $0 has not been declared.","array_dimension_not_int_full":"The array (vector or matrix) dimensions at line $0 must be of type int.","array_dimension_not_int":"An array (vector or matrix) dimensions must be of type int.","array_dimension_not_positive_full":"The array (vector or matrix) dimensions at line $0 must be positive.","array_dimension_not_positive":"An array (vector or matrix) dimensions must be positive.","incompatible_types_full":"It expected $0 but the expression $1 at line $2 results in $3.","incompatible_types":"It expected $0 but the expression $1 results in $2.","incompatible_types_array_full":"The expression $0 at line $2 is not compatible with type $1.","incompatible_types_array":"The expression $0 is not compatible with type $1.","invalid_case_type_full":"The case expression $0 at line $1 is not compatible with type $2.","invalid_case_type":"The case expression $0 is not compatible with type $1.","function_no_return":"The function $0 does not have a reacheable return command. Every function must have at least one return command in its main body.","invalid_array_literal_type_full":"Error at line $0: the expression $1 does not result in a compatible type.","invalid_array_literal_type":"The expression $0 does not result in a compatible type.","invalid_array_literal_line_full":"Error at line $0: it expected $1 lines but found $2.","invalid_array_literal_line":"It expected $0 lines but found $1.","invalid_array_literal_column_full":"Error at line $0: it expected $1 column but found $2.","invalid_array_literal_column":"It expected $0 column but found $1.","exceeded_input_request":"The amount of reads requested exceeded the amount of inputs available.","test_case_few_reads":"Teste case $0 failed: there are available inputs remaining.","test_case_failed":"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$1\"> <span>Test case $0 did not executed successfully.</span></div>","test_case_failed_exception":"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$2\"> <span>Test case $0 failed</span>: $1","test_case_exception":"An exception has ocurred during the execution of test case $0: $1","invalid_type_conversion":"The value $0 cannot be converted to type $1.","invalid_read_type":"Error at line $0: The input \"$1\" is not of type $2 which is the type of the variable <span class='ivprog-error-varname'>$3</span>.","invalid_read_type_array":"Error at line $0: The input \"$1\" is not of type $2 which is the type accepted by the variable <span class='ivprog-error-varname'>$3</span> of type $4.","inform_valid_identifier":"Enter a valid identifier! The identifier cannot be a reserved word and it must begin with a letter or _, followed by numbers, letters and _ only.","inform_valid_global_duplicated":"A global variable named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each gloval variable.","inform_valid_variable_duplicated":"A variable named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each variable.","inform_valid_function_duplicated":"A function named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each function.","inform_valid_param_duplicated":"A parameter named <span class='ivprog-error-varname'>$0</span> already exists in function <span class='ivprog-error-varname'>$1</span>, you need distinc names for each parameter.","invalid_character":"The character $0 at line $1 cannot be used in this context.","annonymous_array_literal":"Error at line $0: the array notation is only permitted during initialization of an array variable. i. e.: int vec[3] ← {1, 2, 3}.","invalid_matrix_literal_line":"The expression $0 at line $1 does not have the same number of elements as the last line. All lines of a matrix must have the same number of elements.","cannot_infer_matrix_line":"It is not possible to infer the number of lines of matrix $0 at line $1. It must be initialized or have its lines explicitly declared.","cannot_infer_matrix_column":"It is not possible to infer the number of columns of matrix $0 at line $1. It must be initialized or have its columns explicitly declared.","cannot_infer_vector_size":"It is not possible to infer the number of elements of vector $0 at line $1. It must be initialized or have its size explicitly declard.","matrix_to_vector_literal_attr":"Error at line $0: The expression $1 represents a matrix and cannot be assigned to the vector $2.","vector_to_matrix_literal_attr":"Error at line $0: The expression $1 represents a vector and cannot be assigned to the matrix $2.","invalid_const_ref_full":"The variable $0 provided as a parameter to the function $1 at line $2 is a constant and cannot be used in this context. Use a non-constant variable or vector position.","invalid_const_ref":"The variable $0 provided as a parameter to the function $1 is a constant and cannot be used in this context. Use a non-constant variable or vector position.","invalid_const_assignment_full":"Error at line $0: $1 is a constant e therefore cannot have its value changed.","invalid_const_assignment":"$0 is a constant e therefore cannot have its value changed.","array_init_not_literal":"Error at line $0: An array (vector or matrix) can only be initialized by an array literal. i.e : real vector[] <- {1,2,3}","array_exceeds_2d":"Error at line $0: The maximum number of dimensions an array can have is 2. An element of 3 or dimensions was found.","invalid_matrix_id_dimension":"Error at line $0: You must define all dimensions of the matrix when one of them is defined by a variable! i.e: real mat1[var][5], mat2[5][var]","invalid_vector_init":"Error at line $0: You cannot initialize a vector when its size is defined by a variable. Use a vector assignment or loop command.","invalid_matrix_init":"Error at line $0: You cannot initialize a matrix when one of its dimensions is defined by a variable. Use a matrix assignment or loop command.","invalid_vector_assignment_full":"Error at line $0: You can only assign a vector to another when both have the same number of elements. $1 has $2 and $3 has $4 elements!","invalid_vector_assignment":"You can only assign a vector to another when both have the same number of elements. $0 has $1 and $2 has $3 elements!","invalid_matrix_assignment_full":"Error at line $0: You can only assign a matrix to another when both have dimensions of the same size. $1 has $2 lines e $3 columns while $4 has $5 lines and $6 columns!","invalid_matrix_assignment":"You can only assign a matrix to another when both have dimensions of the same size. $0 has $1 lines e $2 columns while $3 has $4 lines and $5 columns!","matrix_to_vector_attr":"Error at line $0: $1 represents a matrix and cannot be assigned to the vector $2.","vector_to_matrix_attr":"Error at line $0: $1 represents a vector and cannot be assigned to the matrix $2.","invalid_matrix_index_assign_full":"Error at line $0: The position $1 of the matrix $2 only accepts vectors of size $3 but $4 has size $5.","invalid_matrix_index_assign":"The position $0 of the matrix $1 only accepts vectors of size $2 but $3 has size $4.","invalid_number_elements_vector":"It expected $0 elements at line $1 but the expression $2 has $3 elements.","invalid_number_lines_matrix":"It expected a matrix with $0 lines at line $1 but the expression $2 has $3 lines.","divsion_by_zero_full":"Error at line $0: The expression $1 resuts in a division by zero.","divsion_by_zero":"The expression $0 resuts in a division by zero.","undefined_tanget_value":"Error at line $0: The tangent of $1° is undefined.","negative_log_value":"Error at line $0: You cannot calculate the logarithm of a negative value.","invalid_string_index":"Error at line $0 during the execution of the function $1: $2 is an invalid index for the text string $3. The valid indexes go from 0 to $4.","negative_sqrt_value":"Error at line $0: It is not allowd to calculate the square root of a negative number.","exceeded_recursive_calls":"Error during the execution of line $0: The number of recursive calls exceeded the allowed number of calls.","invalid_for_variable":"Error at line $0: The variable $1 used in the repeat_for command must be of type int.","invalid_for_from":"Error at line $0: The value $1 passed to the parameter 'from' of the repeat_for command must be of type int.","invalid_for_to":"Error at line $0: The value $1 passed to the parameter 'to' of the repeat_for command must be of type int.","invalid_for_pass":"Error at line $0: The value $1 passed to the parameter 'pass' of the repeat_for command must be of type int.","exceed_max_instructions":"The number of instructions executed by your program exceed the defined limit. Check your code for infinite loops or excessive recursive functions calls."},"es":{"token_missing_one":"Syntax error: Expected $0 but found $1 at line:$2, column:$3","token_missing_two":"Syntax error: Expected $0 or $1 but found $2 at line:$3, column: $4","eos_missing":"A new line or a ‘;’ is missing at line: $0, column: $1","invalid_type":"$0 at line: $1, column: $2 is a invalid type. The valid types are: $3","invalid_array_dimension":"Invalid dimension at line: $0, column: $1. Insert a $2 or a valid identifier of the same type.","invalid_array_size":"The array at line $0 exceeds the maximum size of 2.","extra_lines":"No text is allowed after '}' in 'program { … }'","invalid_main_return":"The function $0 declared at line $2 must return $1.","invalid_var_declaration":"Error at line $0: Variables can only be declared in the main body of a function and at the first lines, before any command.","invalid_break_command":"Error at line $0. The command $1 cannot be used outside a loop command or ‘switch ...case’ structure.","invalid_terminal":"It is not possible to use $0 in the expression at line: $1, column: $2. Try a numeric value, variable or function call.","const_not_init":"Error at line: $0, column: $1. A variable declared as const must be initialized.","id_missing":"Expected an identifier but found $0 at line: $1, column: $2.","invalid_id_format":"$0 at line: $1, column: $2 is not a valid identifier. The symbol '.' is not permitted in this context.","main_missing":"The main function was not found. You need to declare a function of return type void named main.","invalid_global_var":"Critical Error: Invalid call of the function IVProgProcessor.initGlobal outside the BASE context.","not_implemented":"Critial internal error: The system defined function $0 was not found.","function_missing":"The function $0 was not found.","function_missing_full":"The function $0 at line: $1, column: $2 was not found.","invalid_parameters_size_full":"Error at line $0: The number of parameters provided to the function $1 is incorrect. It expected $2 but found $3.","invalid_parameters_size":"The number of parameters provided to the function $0 is incorrect. It expected $1 but found $2.","invalid_ref_full":"The expression $0 provided as a parameter to the function $1 at line $2 is not valid in this context. Use a variable or a position of a vector.","invalid_ref":"The expression $0 provided as a parameter to the function $1 is not valid in this context. Use a variable or a position of a vector.","invalid_parameter_type_full":"The expression $0 provided as a parameter to the function $1 at line $2 is not of the expected type.","invalid_parameter_type":"The expression $0 provided as a parameter to the function $1 is not of the expected type.","unknown_command_full":"Internal error: an unknown command found at line $0.","unknown_command":"Internal error: an unknown command found.","loop_condition_type_full":"Error at line: $0, column $1: the condition $2 of the loop must be of type bool (true or false).","loop_condition_type":"The condition $0 of the loop must be of type bool (true or false).","endless_loop_full":"Possible infinite loop detected in your code. Check line $0.","endless_loop":"Possible infinite loop detected in your code.","for_condition_type_full":"Erro na linha: $0, coluna $1: a condição de parada $2 do comando para(...) deve ser do tipo lógico","for_condition_type":"A condição de parada $0 do comando para(...) deve ser do tipo lógico","if_condition_type_full":"Error at line: $0, column $1: the condition $2 in the if … else command must result in a bool (true or false).","if_condition_type":"The condition $0 in the if … else command must result in a bool (true or false).","invalid_return_type_full":"Error at line $0: The expression doest not result in a type compatible with the function $1. Expected type: $2.","invalid_return_type":"The expression doest not result in a type compatible with the function $0. Expected type: $1.","invalid_void_return_full":"Error at line $0: The function $1 cannot return an empty expression, use an expression that results in a $2","invalid_void_return":"The function $0 cannot return an empty expression, use an expression that results in a $1","unexpected_break_command_full":"Critical error at line $0: a break command was found outside a valid context: loop or switch … case structure.","unexpected_break_command":"Critical error: a break command was found outside a valid context: loop or switch … case structure.","invalid_dimension":"Array (vector or matrix) dimensions must be of type int.","void_in_expression_full":"Error at line: $0, column: $1: The function $2 cannot be used inside an expression since its return type is void.","void_in_expression":"The function $0 cannot be used inside an expression since its return type is void.","invalid_array_access_full":"Identifier $0 at line: $1, column: $2 does not identify a valid vector or matrix.","invalid_array_access":"Identifier $0 does not identify a valid vector or matrix.","invalid_matrix_access_full":"Identifier $0 at line: $1, column: $2 does not identify a valid matrix.","invalid_matrix_access":"Identifier $0 does not identify a valid matrix.","matrix_column_outbounds_full":"Error at line $0: The number of columns $1 is invalid for the matrix $2 which has $3 columns.","matrix_column_outbounds":"The number of columns $0 is invalid for the matrix $1 which has $2 columns.","matrix_line_outbounds_full":"Error at line $0: The number of lines $1 is invalid for matrix $2 which has $3 lines.","matrix_line_outbounds":"The number of lines $0 is invalid for matrix $1 which has $2 lines.","vector_line_outbounds_full":"Error at line $0: The number of elements $1 is invalid for vector $2 which has $3 elements.","vector_line_outbounds":"Error at line $0: The number of elements $1 is invalid for vector $2 which has $3 elements.","vector_not_matrix_full":"Error at line $0: $1 is not a matrix.","vector_not_matrix":"$0 is not a matrix.","invalid_infix_op_full":"Error at line $0: The expression $1 is not valid because the operator $2 cannot be applied to the types $3 and $4.","invalid_infix_op":"The expression $0 is not valid because the operator $1 cannot be applied to the types $2 and $3.","invalid_unary_op_full":"Error at line $0: The expression $1 is not valid because the operator $2 cannot be applied to the type $3.","invalid_unary_op":"The expression $0 is not valid because the operator $1 cannot be applied to the type $2.","unknown_op":"Critical error: Unknown operator $0.","duplicate_function":"The function $0 at line: $1, column: $2 has already been declared.","duplicate_variable":"The variable $0 at line: $1, column: $2 has already been declared.","main_parameters":"The main function cannot have parameters.","symbol_not_found_full":"The variable $0 at line: $1, column: $2 has not been declared.","symbol_not_found":"The variable $0 has not been declared.","array_dimension_not_int_full":"The array (vector or matrix) dimensions at line $0 must be of type int.","array_dimension_not_int":"An array (vector or matrix) dimensions must be of type int.","array_dimension_not_positive_full":"The array (vector or matrix) dimensions at line $0 must be positive.","array_dimension_not_positive":"An array (vector or matrix) dimensions must be positive.","incompatible_types_full":"It expected $0 but the expression $1 at line $2 results in $3.","incompatible_types":"It expected $0 but the expression $1 results in $2.","incompatible_types_array_full":"The expression $0 at line $2 is not compatible with type $1.","incompatible_types_array":"The expression $0 is not compatible with type $1.","invalid_case_type_full":"The case expression $0 at line $1 is not compatible with type $2.","invalid_case_type":"The case expression $0 is not compatible with type $1.","function_no_return":"The function $0 does not have a reacheable return command. Every function must have at least one return command in its main body.","invalid_array_literal_type_full":"Error at line $0: the expression $1 does not result in a compatible type.","invalid_array_literal_type":"The expression $0 does not result in a compatible type.","invalid_array_literal_line_full":"Error at line $0: it expected $1 lines but found $2.","invalid_array_literal_line":"It expected $0 lines but found $1.","invalid_array_literal_column_full":"Error at line $0: it expected $1 column but found $2.","invalid_array_literal_column":"It expected $0 column but found $1.","exceeded_input_request":"The amount of reads requested exceeded the amount of inputs available.","test_case_few_reads":"Teste case $0 failed: there are available inputs remaining.","test_case_failed":"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$1\"> <span>Test case $0 did not executed successfully.</span></div>","test_case_failed_exception":"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$2\"> <span>Test case $0 failed</span>: $1","test_case_exception":"An exception has ocurred during the execution of test case $0: $1","invalid_type_conversion":"The value $0 cannot be converted to type $1.","invalid_read_type":"Error at line $0: The input \"$1\" is not of type $2 which is the type of the variable <span class='ivprog-error-varname'>$3</span>.","invalid_read_type_array":"Error at line $0: The input \"$1\" is not of type $2 which is the type accepted by the variable <span class='ivprog-error-varname'>$3</span> of type $4.","inform_valid_identifier":"Enter a valid identifier! The identifier cannot be a reserved word and it must begin with a letter or _, followed by numbers, letters and _ only.","inform_valid_global_duplicated":"A global variable named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each gloval variable.","inform_valid_variable_duplicated":"A variable named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each variable.","inform_valid_function_duplicated":"A function named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each function.","inform_valid_param_duplicated":"A parameter named <span class='ivprog-error-varname'>$0</span> already exists in function <span class='ivprog-error-varname'>$1</span>, you need distinc names for each parameter.","invalid_character":"The character $0 at line $1 cannot be used in this context.","annonymous_array_literal":"Error at line $0: the array notation is only permitted during initialization of an array variable. i. e.: int vec[3] ← {1, 2, 3}.","invalid_matrix_literal_line":"The expression $0 at line $1 does not have the same number of elements as the last line. All lines of a matrix must have the same number of elements.","cannot_infer_matrix_line":"It is not possible to infer the number of lines of matrix $0 at line $1. It must be initialized or have its lines explicitly declared.","cannot_infer_matrix_column":"It is not possible to infer the number of columns of matrix $0 at line $1. It must be initialized or have its columns explicitly declared.","cannot_infer_vector_size":"It is not possible to infer the number of elements of vector $0 at line $1. It must be initialized or have its size explicitly declard.","matrix_to_vector_literal_attr":"Error at line $0: The expression $1 represents a matrix and cannot be assigned to the vector $2.","vector_to_matrix_literal_attr":"Error at line $0: The expression $1 represents a vector and cannot be assigned to the matrix $2.","invalid_const_ref_full":"The variable $0 provided as a parameter to the function $1 at line $2 is a constant and cannot be used in this context. Use a non-constant variable or vector position.","invalid_const_ref":"The variable $0 provided as a parameter to the function $1 is a constant and cannot be used in this context. Use a non-constant variable or vector position.","invalid_const_assignment_full":"Error at line $0: $1 is a constant e therefore cannot have its value changed.","invalid_const_assignment":"$0 is a constant e therefore cannot have its value changed.","array_init_not_literal":"Error at line $0: An array (vector or matrix) can only be initialized by an array literal. i.e : real vector[] <- {1,2,3}","array_exceeds_2d":"Error at line $0: The maximum number of dimensions an array can have is 2. An element of 3 or dimensions was found.","invalid_matrix_id_dimension":"Error at line $0: You must define all dimensions of the matrix when one of them is defined by a variable! i.e: real mat1[var][5], mat2[5][var]","invalid_vector_init":"Error at line $0: You cannot initialize a vector when its size is defined by a variable. Use a vector assignment or loop command.","invalid_matrix_init":"Error at line $0: You cannot initialize a matrix when one of its dimensions is defined by a variable. Use a matrix assignment or loop command.","invalid_vector_assignment_full":"Error at line $0: You can only assign a vector to another when both have the same number of elements. $1 has $2 and $3 has $4 elements!","invalid_vector_assignment":"You can only assign a vector to another when both have the same number of elements. $0 has $1 and $2 has $3 elements!","invalid_matrix_assignment_full":"Error at line $0: You can only assign a matrix to another when both have dimensions of the same size. $1 has $2 lines e $3 columns while $4 has $5 lines and $6 columns!","invalid_matrix_assignment":"You can only assign a matrix to another when both have dimensions of the same size. $0 has $1 lines e $2 columns while $3 has $4 lines and $5 columns!","matrix_to_vector_attr":"Error at line $0: $1 represents a matrix and cannot be assigned to the vector $2.","vector_to_matrix_attr":"Error at line $0: $1 represents a vector and cannot be assigned to the matrix $2.","invalid_matrix_index_assign_full":"Error at line $0: The position $1 of the matrix $2 only accepts vectors of size $3 but $4 has size $5.","invalid_matrix_index_assign":"The position $0 of the matrix $1 only accepts vectors of size $2 but $3 has size $4.","invalid_number_elements_vector":"It expected $0 elements at line $1 but the expression $2 has $3 elements.","invalid_number_lines_matrix":"It expected a matrix with $0 lines at line $1 but the expression $2 has $3 lines.","divsion_by_zero_full":"Error at line $0: The expression $1 resuts in a division by zero.","divsion_by_zero":"The expression $0 resuts in a division by zero.","undefined_tanget_value":"Error at line $0: The tangent of $1° is undefined.","negative_log_value":"Error at line $0: You cannot calculate the logarithm of a negative value.","invalid_string_index":"Error at line $0 during the execution of the function $1: $2 is an invalid index for the text string $3. The valid indexes go from 0 to $4.","negative_sqrt_value":"Error at line $0: It is not allowd to calculate the square root of a negative number.","exceeded_recursive_calls":"Error during the execution of line $0: The number of recursive calls exceeded the allowed number of calls.","invalid_for_variable":"Error at line $0: The variable $1 used in the repeat_for command must be of type int.","invalid_for_from":"Error at line $0: The value $1 passed to the parameter 'from' of the repeat_for command must be of type int.","invalid_for_to":"Error at line $0: The value $1 passed to the parameter 'to' of the repeat_for command must be of type int.","invalid_for_pass":"Error at line $0: The value $1 passed to the parameter 'pass' of the repeat_for command must be of type int.","exceed_max_instructions":"The number of instructions executed by your program exceed the defined limit. Check your code for infinite loops or excessive recursive functions calls."}}
- /***/ }),
- /***/ "./i18n/index.ts":
- /*!***********************!*\
- !*** ./i18n/index.ts ***!
- \***********************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- const Messages = __webpack_require__(/*! ./message.csv */ "./i18n/message.csv");
- const UI = __webpack_require__(/*! ./ui.csv */ "./i18n/ui.csv");
- const Errors = __webpack_require__(/*! ./error.csv */ "./i18n/error.csv");
- const MessagesObj = Messages;
- const UIObj = UI;
- const ErrorsObj = Errors;
- const i18n_data = {};
- for (const key in UIObj) {
- const data = {};
- data['error'] = ErrorsObj[key];
- data['message'] = MessagesObj[key];
- data['ui'] = UIObj[key];
- i18n_data[key] = data;
- }
- exports.default = i18n_data;
- /***/ }),
- /***/ "./i18n/message.csv":
- /*!**************************!*\
- !*** ./i18n/message.csv ***!
- \**************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = {"pt":{"test_case_success":"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$1\"><span>Caso de teste $0</span>: OK</div>","test_case_duration":"Levou $0ms","test_suite_grade":"A sua solução alcançou $0% da nota.","awaiting_input_message":"O seu programa está em execução e aguardando uma entrada! Digite algo e pressione ENTER...","assessment-empty-expected-tooltip":"A saída gerada foi além do esperado","assessment-empty-generated-tooltip":"O programa não gerou saídas suficientes","testcase_autogen_unused_input":"A solução submetida não lê todas entradas disponíveis no caso de teste 1","testcase_autogen_empty":"Sua solução não gerou qualquer saída para o caso de teste $0.","success_execution":"Execução do programa finalizada!","aborted_execution":"A execução do programa foi interrompida!","unexpected_execution_error":"Erro inesperado durante a execução do programa."},"en":{"test_case_success":"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$1\"><span>Test case $0</span>: OK</div>","test_case_duration":"Took $0ms","test_suite_grade":"Your solution scored $0% of the grade.","awaiting_input_message":"Your program is running and awaiting for an input. Type something and press ENTER…","assessment-empty-expected-tooltip":"The generated output was beyond the amount expected","assessment-empty-generated-tooltip":"The program did not generate enough outputs","testcase_autogen_unused_input":"The submitted solution does not read all inputs available in the test case $0","testcase_autogen_empty":"Your solution did not generate any output for test case $0.","success_execution":"Program execution finished!","aborted_execution":"Program execution was aborted!","unexpected_execution_error":"Unexpected error during program execution."},"es":{"test_case_success":"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$1\"><span>Test case $0</span>: OK</div>","test_case_duration":"Tardó $0ms","test_suite_grade":"Su solución obtuvo $0% de la calificación.","awaiting_input_message":"Su programa se está ejecutando y esperando una entrada. Escriba algo y presione ENTER ...","assessment-empty-expected-tooltip":"The generated output was beyond the amount expected","assessment-empty-generated-tooltip":"El programa no generó suficientes resultados.","testcase_autogen_unused_input":"La solución presentada no lee todas las entradas disponibles en el caso de prueba 1","testcase_autogen_empty":"Su solución no generó ningún resultado para el caso de prueba de $ 0.","success_execution":"¡Ejecución del programa terminada!","aborted_execution":"¡La ejecución del programa fue abortada!","unexpected_execution_error":"Error inesperado durante la ejecución del programa."}}
- /***/ }),
- /***/ "./i18n/ui.csv":
- /*!*********************!*\
- !*** ./i18n/ui.csv ***!
- \*********************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = {"pt":{"function":"funcao","btn_clear":"Limpar","btn_function":"Função","btn_arithmetic_plus":"Adição","btn_arithmetic_minus":"Subtração","btn_arithmetic_multiplication":"Multiplicação","btn_arithmetic_division":"Divisão","btn_arithmetic_module":"Módulo","btn_break":"Pare","btn_case":"Caso","start":"inicio","type_void":"vazio","type_integer":"inteiro","logic_operator_and":"E","logic_operator_or":"OU","logic_operator_not":"nao","type_real":"real","program":"programa","type_text":"cadeia","textvar_default_value":"texto","type_boolean":"logico","logic_value_true":"verdadeiro","logic_value_false":"falso","variable":"Variável","command":"Comando","new_parameter":"parametro","new_variable":"variavel","new_global":"global","new_function":"nova_funcao","matrix":"matriz","vector":"vetor","text_comment_start":"Comentário inicial da função...","text_comment_main":"Esta é a função principal...","text_read_var":"Entrada/Leitura de dados","text_write_var":"Saída/Escrita de dados","text_command_read":"leia","text_command_write":"escreva","text_return":"devolva","text_btn_return":"Devolver","text_comment":"Comentário","string_join_or":"ou","matrix_info_string":"matriz de $0","vector_info_string":"vetor de $0","text_attribution":"Atribuição","text_if":"se","text_break":"pare","text_else":"senao","text_for":"repita_para","text_code_while":"repita_enquanto","text_code_do":"repita","text_code_do_until":"ate_que","text_command_do":"repita","text_command_while":"repita enquanto","text_command_do_until":"até que","text_code_switch":"escolha","text_code_case":"caso","text_config_programming":"Programação","text_config_programming_both":"Visual e textual","text_config_programming_textual":"Textual","text_config_programming_visual":"Visual","text_logic_expression":"Lógicos","text_arithmetic_expression":"Aritméticos","text_iftrue":"Se verdadeiro então","text_message_error_activity_file":"Aconteceu um erro ao processar a atividade. <br> Recarregue a página para tentar novamente.","text_message_error_activity_reload":"Recarregar","text_repeatNtimes":"Repita N vezes","text_receives":"recebe","text_whiletrue":"Enquanto verdadeiro","text_dowhiletrue":"Repita até que verdadeiro","text_switch":"Escolha","text_functioncall":"Chamada de função","text_value":"Valor","text_operator":"Operador","text_parentheses":"Parênteses","text_change":"Alterar","text_teacher_algorithm":"Algoritmo","text_teacher_algorithm_include":"Incluir o algoritmo abaixo no exercício","text_teacher_test_case":"Casos de teste","text_teacher_config":"Configurações","text_teacher_data_types":"Tipos de dados","text_teacher_commands":"Comandos","text_teacher_functions":"Funções","text_teacher_create_functions":"Criar novas funções","text_teacher_create_movement_functions":"Movimentar funções","text_teacher_test_case_input":"Entrada","text_teacher_test_case_output":"Saída","text_teacher_test_case_actions":"Ações","text_teacher_test_case_add":"Adicionar caso de teste","text_header_ivprog_functions":"Funções do iVProg","text_menu_functions_math":"Matemática","text_menu_functions_text":"Texto","text_menu_functions_array":"Arranjo","text_menu_functions_conversion":"Conversão","text_no_variable":"Nenhuma variável declarada","text_no_variable_instruction":"Antes de utilizar uma variável, é necessário criá-la","text_ivprog_description":"Programação Visual interativa na Internet","tooltip_visual":"Programação visual","tooltip_textual":"Programação textual","tooltip_upload":"Upload de código fonte","tooltip_download":"Download do código fonte","tooltip_undo":"Desfazer","tooltip_redo":"Refazer","tooltip_run":"Executar o programa","tooltip_evaluate":"Avaliar o programa","tooltip_help":"Ajuda","tooltip_add_global":"Adicionar variável global","tooltip_hide_function":"Ocultar os elementos da função","var_menu_select_var":"Selecione uma variável","var_menu_select_all":"Selecione","var_menu_select_function":"Selecione uma função","expression_menu_select":"Construir uma expressão lógica","inform_valid_content":"Informe o conteúdo!","inform_valid_expression":"Construa uma expressão lógica!","tooltip_terminal_clear":"Limpa o terminal removendo todos os textos já escritos e os pendentes.","tooltip_terminal_show":"Exibe o terminal caso esteja escondido","tooltip_terminal_hide":"Esconde o terminal caso não esteja escondido","text_ivprog_version":"Versão","text_teacher_filter":"Filtro","text_teacher_filter_active":"Ativado","text_teacher_filter_help":"Ao ativar o filtro, as modificações do iVProg estarão bloqueadas.","text_join_assessment_outputs":" ; ","assessment-detail-time-label":"Duração","assessment-detail-grade-label":"Nota","assessment-detail-input-label":"Entradas","assessment-detail-output-label":"Saídas","assessment-detail-expected-label":"Esperava","assessment-detail-generated-label":"Gerou","assessment-detail-result-label":"Resultado","assessment-detail-title":"Caso de Teste $0","text_teacher_generate_outputs":"Gerar saídas","text_teacher_generate_outputs_algorithm":"Antes de gerar as saídas, elabore um algoritmo!","text_code_for_from":"de","text_code_for_to":"ate","text_code_for_pass":"passo","text_for_from":"de","text_for_to":"até","text_for_pass":"passo","text_relational_expression":"Relacionais","write_command_newline_on":"Quebra de linha ativada","write_command_newline_off":" Quebra de linha desativada","write_seprator_menu_text":"Espaço","initial_program_code":"programa {\\n\\n\\t\\tfuncao vazio inicio () {\\n\\t\\t\\t// Inicie seu codigo aqui!\\n\\t\\t}\\n}","type_char":"caractere","charvar_default_value":"A","write_seprator_menu_tooltip":"Separador para imprimir mais valores/variáveis"},"en":{"function":"function","btn_clear":"Clean","btn_function":"Function","btn_arithmetic_plus":"Addition","btn_arithmetic_minus":"Subtraction","btn_arithmetic_multiplication":"Multiplication","btn_arithmetic_division":"Division","btn_arithmetic_module":"Remainder","btn_break":"break","btn_case":"Case","start":"main","type_void":"void","type_integer":"int","logic_operator_and":"AND","logic_operator_or":"OR","logic_operator_not":"not","type_real":"real","program":"program","type_text":"string","textvar_default_value":"text","type_boolean":"bool","logic_value_true":"true","logic_value_false":"false","variable":"Variable","command":"Command","new_parameter":"parameter","new_variable":"variable","new_global":"global","new_function":"new_function","matrix":"matrix","vector":"vector","text_comment_start":"Function initial comment","text_comment_main":"This is the main funcion","text_read_var":"Input/Read data","text_write_var":"Output/Write data","text_command_read":"read","text_command_write":"write","text_return":"return","text_btn_return":"Return","text_comment":"Comment","string_join_or":"or","matrix_info_string":"matrix of $0","vector_info_string":"vector of $0","text_attribution":"Assignment","text_if":"if","text_break":"break","text_else":"else","text_for":"repeat_for","text_code_while":"repeat_while","text_code_do":"repeat","text_code_do_until":"until","text_command_do":"repeat","text_command_while":"repeat while","text_command_do_until":"until","text_code_switch":"switch","text_code_case":"case","text_config_programming":"Programming","text_config_programming_both":"Visual & Textual","text_config_programming_textual":"Textual","text_config_programming_visual":"Visual","text_logic_expression":"Logic","text_arithmetic_expression":"Arithmetics","text_iftrue":"If true then","text_message_error_activity_file":"There was an error processing the activity.<br> Reload the page to try again.","text_message_error_activity_reload":"Reload","text_repeatNtimes":"Repeat N times","text_receives":"receives","text_whiletrue":"While true","text_dowhiletrue":"Repeat until true","text_switch":"Switch","text_functioncall":"Function call","text_value":"Value","text_operator":"Operator","text_parentheses":"Parentheses","text_change":"Modify","text_teacher_algorithm":"Algorithm","text_teacher_algorithm_include":"Include the algorithm below in the activity","text_teacher_test_case":"Test cases","text_teacher_config":"Configurations","text_teacher_data_types":"Data types","text_teacher_commands":"Commands","text_teacher_functions":"Functions","text_teacher_create_functions":"Create new functions","text_teacher_create_movement_functions":"Move functions","text_teacher_test_case_input":"Input","text_teacher_test_case_output":"Output","text_teacher_test_case_actions":"Actions","text_teacher_test_case_add":"Add test case","text_header_ivprog_functions":"iVProg Functions","text_menu_functions_math":"Math","text_menu_functions_text":"Text","text_menu_functions_array":"Array","text_menu_functions_conversion":"Conversion","text_no_variable":"No variable declared","text_no_variable_instruction":"Before using a variable, you need to create it","text_ivprog_description":"Interactive and Visual Programming on the Internet","tooltip_visual":"Visual programming","tooltip_textual":"Textual programming","tooltip_upload":"Upload source code","tooltip_download":"Download source code","tooltip_undo":"Undo","tooltip_redo":"Redo","tooltip_run":"Run the program","tooltip_evaluate":"Evaluate the program","tooltip_help":"Help","tooltip_add_global":"Add a global variable","tooltip_hide_function":"Hide function elements","var_menu_select_var":"Select a variable","var_menu_select_all":"Select","var_menu_select_function":"Select a function","expression_menu_select":"Construct a logic expression","inform_valid_content":"Provide some data","inform_valid_expression":"Construct a logic expression","tooltip_terminal_clear":"Clears the terminal by removing all wrriten and pending text.","tooltip_terminal_show":"Shows the terminal if it is hidden","tooltip_terminal_hide":"Hides the terminal if it is not on display","text_ivprog_version":"Version","text_teacher_filter":"Filter","text_teacher_filter_active":"Activated","text_teacher_filter_help":"By activating the filter modifications in iVProg will be blocked","text_join_assessment_outputs":" ; ","assessment-detail-time-label":"Duration","assessment-detail-grade-label":"Grade","assessment-detail-input-label":"Inputs","assessment-detail-output-label":"Outputs","assessment-detail-expected-label":"Expected","assessment-detail-generated-label":"Generated","assessment-detail-result-label":"Result","assessment-detail-title":"Test Case $0","text_teacher_generate_outputs":"Generate outputs","text_teacher_generate_outputs_algorithm":"Before generating the outputs you need to create an algorithm","text_code_for_from":"from","text_code_for_to":"to","text_code_for_pass":"pass","text_for_from":"from","text_for_to":"to","text_for_pass":"pass","text_relational_expression":"Relational","write_command_newline_on":" Line break is on","write_command_newline_off":" Line break is off","write_seprator_menu_text":"Spacer","initial_program_code":"program {\\n\\n\\t\\tfunction void main () {\\n\\t\\t\\t// Start your code here!\\n\\t\\t}\\n}","type_char":"char","charvar_default_value":"A","write_seprator_menu_tooltip":"Separator used to print more values/variables"},"es":{"function":"function","btn_clear":"Limpiar","btn_function":"Funcíon","btn_arithmetic_plus":"Adición","btn_arithmetic_minus":"Sustracción","btn_arithmetic_multiplication":"Multiplicación","btn_arithmetic_division":"División","btn_arithmetic_module":"Resto","btn_break":"break","btn_case":"Caso","start":"main","type_void":"void","type_integer":"int","logic_operator_and":"AND","logic_operator_or":"OR","logic_operator_not":"not","type_real":"real","program":"program","type_text":"string","textvar_default_value":"texto","type_boolean":"bool","logic_value_true":"true","logic_value_false":"false","variable":"Variable","command":"Comando","new_parameter":"parametro","new_variable":"variable","new_global":"global","new_function":"nueva_función","matrix":"matriz","vector":"vector","text_comment_start":"Comentario inicial de la función","text_comment_main":"Esta es la función principal","text_read_var":"Entrada/Lectura de dados","text_write_var":"Salida/Escribir datos","text_command_read":"read","text_command_write":"write","text_return":"return","text_btn_return":"Devolución","text_comment":"Comentario","string_join_or":"or","matrix_info_string":"matriz de $0","vector_info_string":"vector de $0","text_attribution":"Asignación","text_if":"if","text_break":"break","text_else":"else","text_for":"repeat_for","text_code_while":"repeat_while","text_code_do":"repeat","text_code_do_until":"until","text_command_do":"repeat","text_command_while":"repeat while","text_command_do_until":"until","text_code_switch":"switch","text_code_case":"case","text_config_programming":"Programación","text_config_programming_both":"Visual & Textual","text_config_programming_textual":"Textual","text_config_programming_visual":"Visual","text_logic_expression":"Lógicos","text_arithmetic_expression":"Aritmética","text_iftrue":"Si verdad entonces","text_message_error_activity_file":"Se produjo un error al procesar la actividad.<br> Recargar la página para volver a intentarlo.","text_message_error_activity_reload":"Recargar","text_repeatNtimes":"Repetir N veces","text_receives":"receives","text_whiletrue":"Mientras verdad","text_dowhiletrue":"Repita hasta verdad","text_switch":"Switch","text_functioncall":"Llamada de función","text_value":"Valor","text_operator":"Operador","text_parentheses":"Paréntesis","text_change":"Modify","text_teacher_algorithm":"Algorithm","text_teacher_algorithm_include":"Incluir el algoritmo en la actividad.","text_teacher_test_case":"Test cases","text_teacher_config":"Configuraciones","text_teacher_data_types":"Data types","text_teacher_commands":"Commands","text_teacher_functions":"Funciones","text_teacher_create_functions":"Create new functions","text_teacher_create_movement_functions":"Move functions","text_teacher_test_case_input":"Input","text_teacher_test_case_output":"Output","text_teacher_test_case_actions":"Actions","text_teacher_test_case_add":"Add test case","text_header_ivprog_functions":"iVProg Functions","text_menu_functions_math":"Math","text_menu_functions_text":"Text","text_menu_functions_array":"Array","text_menu_functions_conversion":"Conversion","text_no_variable":"No variable declared","text_no_variable_instruction":"Antes de usar una variable, debe crearla","text_ivprog_description":"Interactive and Visual Programming on the Internet","tooltip_visual":"Visual programming","tooltip_textual":"Textual programming","tooltip_upload":"Upload source code","tooltip_download":"Download source code","tooltip_undo":"Undo","tooltip_redo":"Redo","tooltip_run":"Run the program","tooltip_evaluate":"Evaluate the program","tooltip_help":"Help","tooltip_add_global":"Add a global variable","tooltip_hide_function":"Hide function elements","var_menu_select_var":"Select a variable","var_menu_select_all":"Select","var_menu_select_function":"Select a function","expression_menu_select":"Construct a logic expression","inform_valid_content":"Proporcionar algunos datos","inform_valid_expression":"Construct a logic expression","tooltip_terminal_clear":"Borra el terminal eliminando todo el texto escrito y pendiente.","tooltip_terminal_show":"Muestra el terminal si está oculto.","tooltip_terminal_hide":"Oculta el terminal si no está en exhibición","text_ivprog_version":"Version","text_teacher_filter":"Filter","text_teacher_filter_active":"Activated","text_teacher_filter_help":"Al activar el filtro, las modificaciones en iVProg serán bloqueadas","text_join_assessment_outputs":" ;","assessment-detail-time-label":"Duration","assessment-detail-grade-label":"Grade","assessment-detail-input-label":"Inputs","assessment-detail-output-label":"Outputs","assessment-detail-expected-label":"Expected","assessment-detail-generated-label":"Generated","assessment-detail-result-label":"Result","assessment-detail-title":"Test Case $0","text_teacher_generate_outputs":"Generate outputs","text_teacher_generate_outputs_algorithm":"Antes de generar las salidas necesita crear un algoritmo","text_code_for_from":"from","text_code_for_to":"to","text_code_for_pass":"pass","text_for_from":"from","text_for_to":"to","text_for_pass":"pass","text_relational_expression":"Relational","write_command_newline_on":"El salto de línea está activado","write_command_newline_off":"El salto de línea está desactivado","write_seprator_menu_text":"Spacer","initial_program_code":"program {\\n\\n\\t\\tfunction void main () {\\n\\t\\t\\t// Start your code here!\\n\\t\\t}\\n}","type_char":"char","charvar_default_value":"A","write_seprator_menu_tooltip":"Separator used to print more values/variables"}}
- /***/ }),
- /***/ "./js/assessment/ivprogAssessment.js":
- /*!*******************************************!*\
- !*** ./js/assessment/ivprogAssessment.js ***!
- \*******************************************/
- /*! exports provided: IVProgAssessment */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IVProgAssessment", function() { return IVProgAssessment; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
- /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
- /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../io/domConsole */ "./js/io/domConsole.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _output_matching_output_matching__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./output_matching/output_matching */ "./js/assessment/output_matching/output_matching.js");
- /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
- /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_7__);
- var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_5__["getInstance"]();
- var StringTypes = line_i18n__WEBPACK_IMPORTED_MODULE_2__["default"].StringTypes;
- var AssessmentConfig = {
- max_instruction_count: 350250,
- suspend_threshold: 200
- };
- var IVProgAssessment = /*#__PURE__*/function () {
- function IVProgAssessment(ast_code, testCases, domConsole) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IVProgAssessment);
- this.ast_code = ast_code;
- this.testCases = testCases;
- this.domConsole = domConsole;
- this.old_config = JSON.parse(JSON.stringify(_util_config__WEBPACK_IMPORTED_MODULE_7__["Config"]));
- _util_config__WEBPACK_IMPORTED_MODULE_7__["Config"].setConfig(AssessmentConfig);
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IVProgAssessment, [{
- key: "runTest",
- value: function runTest() {
- var _this = this;
- try {
- // loop test cases and show messages through domconsole
- var partialTests = this.testCases.map(function (t, name) {
- return new _output_matching_output_matching__WEBPACK_IMPORTED_MODULE_6__["OutputMatching"](new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_3__["IVProgProcessor"](_this.ast_code), t.input, t.output, name);
- });
- var testResult = partialTests.map(function (om) {
- return om.eval();
- });
- return Promise.all(testResult).then(function (results) {
- var grade = 0;
- for (var i = 0; i < results.length; i += 1) {
- var result = results[i];
- grade += result.grade;
- if (result.grade == 1) {
- _this.writeToConsole(_io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].INFO, StringTypes.MESSAGE, 'test_case_success', result.name + 1, result.generateOutput());
- } else if (result.status == 1) {
- _this.writeToConsole(_io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].ERR, StringTypes.ERROR, 'test_case_failed_exception', result.name + 1, result.error_msg, result.generateOutput());
- } else {
- _this.writeToConsole(_io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].ERR, StringTypes.ERROR, 'test_case_failed', result.name + 1, result.generateOutput());
- }
- }
- grade /= results.length;
- var channel = grade == 1 ? _io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].INFO : _io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].ERR;
- _this.writeToConsole(channel, StringTypes.MESSAGE, "test_suite_grade", (grade * 100).toFixed(2));
- return grade;
- }); // return testResult.then(function (total) {
- // const grade = total / this.testCases.length;
- // const channel = grade == 1 ? DOMConsole.INFO : DOMConsole.ERR;
- // this.writeToConsole(channel, StringTypes.MESSAGE, "test_suite_grade", (grade * 100).toFixed(2));
- // return Promise.resolve(grade)
- // }).catch(err => {
- // this.domConsole.err("Erro inesperado durante o cálculo da nota.");// try and show error messages through domconsole
- // this.domConsole.err(err.message);
- // return Promise.resolve(0);
- // });
- } catch (error) {
- this.showErrorMessage(_io_domConsole__WEBPACK_IMPORTED_MODULE_4__["DOMConsole"].ERR, StringTypes.MESSAGE, "unexpected_execution_error");
- this.domConsole.err(error.message);
- return Promise.resolve(0);
- } finally {
- _util_config__WEBPACK_IMPORTED_MODULE_7__["Config"].setConfig(this.old_config);
- }
- }
- }, {
- key: "showErrorMessage",
- value: function showErrorMessage(errorID) {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
- this.domConsole.err(LocalizedStrings.getError(errorID, args));
- }
- }, {
- key: "showInfoMessage",
- value: function showInfoMessage(msgID) {
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
- args[_key2 - 1] = arguments[_key2];
- }
- this.domConsole.info(LocalizedStrings.getMessage(msgID, args));
- }
- }, {
- key: "writeToConsole",
- value: function writeToConsole(channel, msgType, msgID) {
- var msg = LocalizedStrings.getString(msgID, msgType);
- for (var _len3 = arguments.length, args = new Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) {
- args[_key3 - 3] = arguments[_key3];
- }
- msg = LocalizedStrings.processString(msg, args);
- this.domConsole.writeRawHTML(msg, channel);
- }
- }]);
- return IVProgAssessment;
- }();
- /***/ }),
- /***/ "./js/assessment/output_matching/assessment_result.js":
- /*!************************************************************!*\
- !*** ./js/assessment/output_matching/assessment_result.js ***!
- \************************************************************/
- /*! exports provided: OutputAssessmentResult */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputAssessmentResult", function() { return OutputAssessmentResult; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _util_string_diff__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../util/string_diff */ "./js/util/string_diff.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- var OutputAssessmentResult = /*#__PURE__*/function () {
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputAssessmentResult, null, [{
- key: "PAGE_TEMPLATE",
- get: function get() {
- 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>";
- }
- }, {
- key: "DETAIL_TEMPLATE",
- get: function get() {
- 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>";
- }
- }, {
- key: "OUPUT_TABLE_TEMPLATE",
- get: function get() {
- 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>";
- }
- }, {
- key: "OUTPUT_TEMPLATE",
- get: function get() {
- return "<tr><td class=':class-expected:'>$0</td>\n <td class=':class-generated:'>$1</td>\n <td class=':class-result:'>$2</td></tr>";
- }
- }, {
- key: "EMPTY_OUTPUT_TEMPLATE",
- get: function get() {
- return "<div class='assessment-popup'><img class='assessment-empty-output' src='img/empty.svg'>\n <span class='assessment-popuptext'>$0</span></div>";
- }
- }, {
- key: "FAILED_TEMPLATE",
- get: function get() {
- return "<p class='assessment-failed-execution'><span class='assessment-failed-case'>\u2717</span>$0</p>";
- }
- }, {
- key: "INPUT_INFO_TEMPLATE",
- get: function get() {
- return "<span class='$0'>$1</span>";
- } // Status code - it is not grade related!
- // 0 - Succesful execution
- // 1 - failed execution
- }]);
- function OutputAssessmentResult(name, status, inputs, result, store, time) {
- var error_msg = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : '';
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, OutputAssessmentResult);
- this.name = name;
- this.status = status;
- this.inputs = inputs;
- this.results = result;
- this.store = store;
- this.time = time;
- this.error_msg = error_msg;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputAssessmentResult, [{
- key: "prepareResults",
- value: function prepareResults() {
- var _this = this;
- var template = OutputAssessmentResult.DETAIL_TEMPLATE;
- var grade = (this.grade * 100).toFixed(2);
- var time = this.time || "-";
- template = template.replace(':test-name:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-title', [this.name + 1]));
- template = template.replace(':time-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-time-label'));
- template = template.replace(':time:', time);
- template = template.replace(':grade-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-grade-label'));
- template = template.replace(':grade:', grade);
- var input_spans = this.prepareInputList(this.inputs);
- template = template.replace(':input-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-input-label'));
- template = template.replace(':input-list:', input_spans);
- template = template.replace(':output-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-output-label'));
- if (this.status == 0) {
- var output_rows = this.results.map(function (result) {
- if (result.type == "string") {
- return _this.formatString(result);
- } else if (result.type == "number") {
- return _this.formatNumber(result);
- } else {
- return _this.formatBool(result);
- }
- }, this);
- template = template.replace(':output-result:', this.prepareOutputTable(output_rows));
- } else {
- var failed_text = OutputAssessmentResult.FAILED_TEMPLATE;
- failed_text = failed_text.replace("$0", this.error_msg);
- template = template.replace(":output-result:", failed_text);
- }
- return template;
- }
- }, {
- key: "prepareInputList",
- value: function prepareInputList(input_list) {
- var list = input_list.map(function (input) {
- var template = OutputAssessmentResult.INPUT_INFO_TEMPLATE;
- template = template.replace("$1", input.value);
- if (input.read) {
- template = template.replace("$0", "assessment-input-read");
- } else {
- template = template.replace("$0", "assessment-input-unread");
- }
- return template;
- }, this);
- return list.join(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('text_join_assessment_outputs'));
- }
- }, {
- key: "prepareOutputTable",
- value: function prepareOutputTable(output_rows) {
- var template = OutputAssessmentResult.OUPUT_TABLE_TEMPLATE;
- template = template.replace(':expected-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-expected-label'));
- template = template.replace(':generated-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-generated-label'));
- template = template.replace(':result-label:', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getUI('assessment-detail-result-label'));
- template = template.replace(':results:', output_rows.join(''));
- return template;
- }
- }, {
- key: "generateOutput",
- value: function generateOutput() {
- var assessment_result = this.prepareResults();
- var page = OutputAssessmentResult.PAGE_TEMPLATE;
- page = page.replace(':assessment-result:', assessment_result);
- page = page.replace(/(\r|\n|\t)/gm, '').replace(/> *</g, '><');
- return page;
- }
- }, {
- key: "formatNumber",
- value: function formatNumber(result) {
- var result_class = result.grade == 1 ? 'assessment-number-result' : 'assessment-number-result-failed';
- var template = this.formatOutput('assessment-number-expected', 'assessment-number-generated', result_class, result);
- return template;
- }
- }, {
- key: "formatBool",
- value: function formatBool(result) {
- var result_class = result.grade == 1 ? 'assessment-bool-result' : 'assessment-bool-result-failed';
- var template = this.formatOutput('assessment-bool-expected', 'assessment-bool-generated', result_class, result);
- return template;
- }
- }, {
- key: "formatOutput",
- value: function formatOutput(expected_class, generated_class, result_class, result) {
- var template = OutputAssessmentResult.OUTPUT_TEMPLATE;
- template = template.replace(":class-expected:", expected_class);
- template = template.replace(":class-generated:", generated_class);
- template = template.replace(":class-result:", result_class);
- var expected_tmpl = result.expected;
- var generated_tmpl = result.generated;
- if (expected_tmpl == null) {
- expected_tmpl = OutputAssessmentResult.EMPTY_OUTPUT_TEMPLATE.replace('$0', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getMessage('assessment-empty-expected-tooltip'));
- } else if (generated_tmpl == null) {
- generated_tmpl = OutputAssessmentResult.EMPTY_OUTPUT_TEMPLATE.replace('$0', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getMessage('assessment-empty-generated-tooltip'));
- }
- template = template.replace("$0", expected_tmpl);
- template = template.replace("$1", generated_tmpl);
- var final_result = result.grade == 1 ? "✓" : "✗";
- template = template.replace("$2", final_result);
- return template;
- }
- }, {
- key: "formatString",
- value: function formatString(result) {
- var _this2 = this;
- var expected_class = 'assessment-string-expected';
- var generated_class = 'assessment-string-generated'; //const result_class = 'assessment-string-result';
- var template = OutputAssessmentResult.OUTPUT_TEMPLATE;
- template = template.replace(":class-expected:", expected_class);
- template = template.replace(":class-generated:", generated_class); //template = template.replace(":class-result:", result_class);
- var g_string = result.generated || "";
- var e_string = result.expected || ""; // console.log("generated: ", g_string,"expected: ", e_string);
- var g_string_tmpl = g_string;
- var e_string_tmpl = e_string;
- if (result.generated == null) {
- g_string_tmpl = OutputAssessmentResult.EMPTY_OUTPUT_TEMPLATE.replace('$0', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getMessage('assessment-empty-generated-tooltip'));
- } else if (result.expected == null) {
- e_string_tmpl = OutputAssessmentResult.EMPTY_OUTPUT_TEMPLATE.replace('$0', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["LocalizedStrings"].getMessage('assessment-empty-expected-tooltip'));
- }
- template = template.replace("$0", e_string_tmpl);
- template = template.replace("$1", g_string_tmpl);
- if (result.grade == 1) {
- template = template.replace("$2", "✓");
- template = template.replace(":class-result:", 'assessment-string-result');
- } else {
- var diff = Object(_util_string_diff__WEBPACK_IMPORTED_MODULE_2__["default"])(g_string, e_string); // console.log(diff);
- var diff_vec = diff.map(function (part) {
- return _this2.getDiffStringStyle(part[1], part[0]);
- }, this);
- var diff_string = diff_vec.reduce(function (prev, actual) {
- return prev + actual;
- }, "");
- template = template.replace("$2", "<span class='assessment-failed-case'>✗</span>" + diff_string);
- template = template.replace(":class-result:", "assessment-string-diff");
- }
- return template;
- }
- }, {
- key: "getDiffStringStyle",
- value: function getDiffStringStyle(text, action) {
- var template = "<span class='$0'>$1</span>"; // Fix missing whitespace when its a single element
- text = text.replace(/\s/g, " ");
- switch (action) {
- case _util_string_diff__WEBPACK_IMPORTED_MODULE_2__["default"].INSERT:
- return template.replace("$0", "stringdiff-insert").replace("$1", text);
- case _util_string_diff__WEBPACK_IMPORTED_MODULE_2__["default"].DELETE:
- return template.replace("$0", "stringdiff-delete").replace("$1", text);
- case _util_string_diff__WEBPACK_IMPORTED_MODULE_2__["default"].EQUAL:
- return template.replace("$0", "stringdiff-equal").replace("$1", text);
- }
- }
- }, {
- key: "grade",
- get: function get() {
- if (this.results == null) {
- return 0;
- }
- return this.results.reduce(function (prev, val) {
- return prev + val.grade;
- }, 0) / this.results.length;
- }
- }]);
- return OutputAssessmentResult;
- }();
- /***/ }),
- /***/ "./js/assessment/output_matching/output_matching.js":
- /*!**********************************************************!*\
- !*** ./js/assessment/output_matching/output_matching.js ***!
- \**********************************************************/
- /*! exports provided: OutputMatching */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputMatching", function() { return OutputMatching; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! decimal.js */ "./node_modules/decimal.js/decimal.js");
- /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(decimal_js__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _util_input_assessment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/input_assessment */ "./js/util/input_assessment.js");
- /* harmony import */ var _util_outputTest__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../util/outputTest */ "./js/util/outputTest.js");
- /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/config */ "./js/util/config.ts");
- /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/utils */ "./js/util/utils.js");
- /* harmony import */ var _assessment_result__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./assessment_result */ "./js/assessment/output_matching/assessment_result.js");
- /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _output_result__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./output_result */ "./js/assessment/output_matching/output_result.js");
- var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_9__["getInstance"]();
- var OutputMatching = /*#__PURE__*/function () {
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputMatching, null, [{
- key: "NUM_REGEX",
- get: function get() {
- return /^[+-]?([0-9]+([.][0-9]*)?(e[+-]?[0-9]+)?)$/;
- }
- }, {
- key: "NUM_IN_STRING_REGEX",
- get: function get() {
- return /[+-]?([0-9]+([.][0-9]*)?(e[+-]?[0-9]+)?)/g;
- }
- }, {
- key: "BOOLEAN_REGEX",
- get: function get() {
- var str = "^(".concat(LocalizedStrings.getUI("logic_value_true"), "|").concat(LocalizedStrings.getUI("logic_value_false"), ")$");
- return new RegExp(str);
- }
- }, {
- key: "BOOLEAN_IN_STRING_REGEX",
- get: function get() {
- var str = "(".concat(LocalizedStrings.getUI("logic_value_true"), "|").concat(LocalizedStrings.getUI("logic_value_false"), ")");
- return new RegExp(str, 'g');
- }
- }]);
- function OutputMatching(program, input_list, expected_output, test_name) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, OutputMatching);
- this.program = program;
- this.name = test_name;
- this.input_list = input_list;
- this.expected_output = expected_output;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputMatching, [{
- key: "eval",
- value: function _eval() {
- var _this = this;
- var refThis = this;
- var input = new _util_input_assessment__WEBPACK_IMPORTED_MODULE_3__["InputAssessment"](this.input_list);
- var gen_output = new _util_outputTest__WEBPACK_IMPORTED_MODULE_4__["OutputTest"]();
- this.program.registerInput(input);
- this.program.registerOutput(gen_output);
- var start_time = Date.now();
- return this.program.interpretAST().then(function (sto) {
- var final_time = Date.now() - start_time;
- if (input.isInputAvailable()) {
- return new _assessment_result__WEBPACK_IMPORTED_MODULE_7__["OutputAssessmentResult"](_this.name, 1, input.input_list, null, sto, final_time, refThis.getErrorMessage('test_case_few_reads', _this.name + 1));
- }
- var result = gen_output.list.map(function (g_out, i) {
- if (i >= _this.expected_output.length) {
- return new _output_result__WEBPACK_IMPORTED_MODULE_10__["OutputMatchResult"](null, g_out, 0, _this.getPotentialOutputType(g_out));
- }
- return _this.outputMatch(g_out, _this.expected_output[i]);
- }, _this);
- if (_this.expected_output.length > gen_output.list.length) {
- console.log("Saída insuficientes!", _this.expected_output.length, gen_output.list.length);
- for (var i = gen_output.list.length; i < _this.expected_output.length; ++i) {
- var e_out = _this.expected_output[i];
- result.push(new _output_result__WEBPACK_IMPORTED_MODULE_10__["OutputMatchResult"](e_out, null, 0, _this.getPotentialOutputType(e_out)));
- }
- } else if (_this.expected_output.length == 0 && _this.expected_output.length == gen_output.list.length) {
- // no output expected....
- result.push(new _output_result__WEBPACK_IMPORTED_MODULE_10__["OutputMatchResult"]("", "", 1, "string"));
- }
- return new _assessment_result__WEBPACK_IMPORTED_MODULE_7__["OutputAssessmentResult"](_this.name, 0, input.input_list, result, sto, final_time);
- })["catch"](function (error) {
- return new _assessment_result__WEBPACK_IMPORTED_MODULE_7__["OutputAssessmentResult"](_this.name, 1, input.input_list, null, null, null, refThis.getErrorMessage('test_case_exception', _this.name + 1, error.message));
- });
- }
- }, {
- key: "getPotentialOutputType",
- value: function getPotentialOutputType(output) {
- if (OutputMatching.NUM_REGEX.test(output)) {
- return "number";
- } else if (OutputMatching.BOOLEAN_REGEX.test(output)) {
- return "bool";
- } else {
- return "string";
- }
- }
- }, {
- key: "outputMatch",
- value: function outputMatch(g_output, e_output) {
- if (OutputMatching.NUM_REGEX.test(e_output)) {
- if (!OutputMatching.NUM_REGEX.test(g_output)) {
- return this.checkStrings(g_output, e_output);
- }
- var g_num = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](g_output);
- var e_num = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](e_output);
- return this.checkNumbers(g_num, e_num);
- } else if (OutputMatching.BOOLEAN_REGEX.test(e_output)) {
- if (!OutputMatching.BOOLEAN_REGEX.test(g_output)) {
- return this.checkStrings(g_output, e_output);
- }
- var g_bool = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["toBool"](g_output);
- var e_bool = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["toBool"](e_output);
- return this.checkBoolean(g_bool, e_bool);
- } else {
- return this.checkStrings(g_output, e_output);
- }
- }
- }, {
- key: "checkNumbers",
- value: function checkNumbers(g_num, e_num) {
- var decimalPlaces = Math.min(e_num.dp(), _util_config__WEBPACK_IMPORTED_MODULE_5__["Config"].decimalPlaces);
- g_num = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](g_num.toFixed(decimalPlaces, decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"].ROUND_FLOOR));
- e_num = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](e_num.toFixed(decimalPlaces, decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"].ROUND_FLOOR));
- var result = g_num.eq(e_num);
- var grade = result ? 1 : 0;
- return _output_result__WEBPACK_IMPORTED_MODULE_10__["createNumberResult"](e_num.toNumber(), g_num.toNumber(), grade);
- }
- }, {
- key: "checkBoolean",
- value: function checkBoolean(g_bool, e_bool) {
- var grade = g_bool == e_bool ? 1 : 0;
- var g_bool_text = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["convertBoolToString"](g_bool);
- var e_bool_text = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["convertBoolToString"](e_bool);
- return _output_result__WEBPACK_IMPORTED_MODULE_10__["createBoolResult"](e_bool_text, g_bool_text, grade);
- }
- }, {
- key: "checkStrings",
- value: function checkStrings(g_output, e_ouput) {
- var _this2 = this;
- var assessmentList = [];
- var e_output_clean = e_ouput.trim();
- var g_output_clean = g_output.trim();
- if (OutputMatching.NUM_IN_STRING_REGEX.test(e_ouput)) {
- var expected_numbers = e_ouput.match(OutputMatching.NUM_IN_STRING_REGEX);
- var generated_numbers = g_output.match(OutputMatching.NUM_IN_STRING_REGEX) || [];
- var result = generated_numbers.map(function (val, i) {
- if (i >= expected_numbers.length) {
- return _output_result__WEBPACK_IMPORTED_MODULE_10__["createNumberResult"](null, val, 0);
- }
- var g_val = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](val);
- var e_val = new decimal_js__WEBPACK_IMPORTED_MODULE_2__["Decimal"](expected_numbers[i]);
- return _this2.checkNumbers(g_val, e_val);
- }, this);
- if (expected_numbers.length > generated_numbers.length) {
- for (var i = generated_numbers.length; i < expected_numbers.length; ++i) {
- result.push(_output_result__WEBPACK_IMPORTED_MODULE_10__["createNumberResult"](expected_numbers[i], null, 0));
- }
- }
- e_output_clean = e_output_clean.replace(OutputMatching.NUM_IN_STRING_REGEX, '');
- g_output_clean = g_output_clean.replace(OutputMatching.NUM_IN_STRING_REGEX, '');
- var numberGrade = result.reduce(function (prev, r) {
- return prev + r.grade;
- }, 0) / result.length;
- assessmentList.push(numberGrade);
- }
- if (OutputMatching.BOOLEAN_IN_STRING_REGEX.test(e_ouput)) {
- var expected_bools = e_ouput.match(OutputMatching.BOOLEAN_IN_STRING_REGEX);
- var generated_bools = g_output.match(OutputMatching.BOOLEAN_IN_STRING_REGEX) || [];
- var _result = generated_bools.map(function (val, i) {
- if (i >= expected_bools.length) {
- return _output_result__WEBPACK_IMPORTED_MODULE_10__["createBoolResult"](null, val, 0);
- }
- var g_bool = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["toBool"](val);
- var e_bool = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_8__["toBool"](expected_bools[i]);
- return _this2.checkBoolean(g_bool, e_bool);
- }, this);
- if (expected_bools.length > generated_bools.length) {
- for (var _i = generated_bools.length; _i < expected_bools.length; ++_i) {
- _result.push(_output_result__WEBPACK_IMPORTED_MODULE_10__["createBoolResult"](expected_bools[_i], null, 0));
- }
- }
- e_output_clean = e_output_clean.replace(OutputMatching.BOOLEAN_IN_STRING_REGEX, '');
- g_output_clean = g_output_clean.replace(OutputMatching.BOOLEAN_IN_STRING_REGEX, '');
- var boolGrade = _result.reduce(function (prev, r) {
- return prev + r.grade;
- }, 0) / _result.length;
- assessmentList.push(boolGrade);
- }
- var dist = Object(_util_utils__WEBPACK_IMPORTED_MODULE_6__["levenshteinDistance"])(g_output_clean, e_output_clean);
- var gradeDiff = Math.max(0, e_output_clean.length - dist) / e_output_clean.length;
- gradeDiff = Number.isNaN(gradeDiff) ? 0 : gradeDiff;
- var assessment_size = assessmentList.length + 1;
- var gradeAcc = assessmentList.reduce(function (prev, val) {
- return prev + val / assessment_size;
- }, 0);
- var finalGrade = 1 * (gradeDiff / assessment_size + gradeAcc);
- return _output_result__WEBPACK_IMPORTED_MODULE_10__["createStringResult"](e_ouput, g_output, finalGrade);
- }
- }, {
- key: "getErrorMessage",
- value: function getErrorMessage(errorID) {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
- return LocalizedStrings.getError(errorID, args);
- }
- }]);
- return OutputMatching;
- }();
- /***/ }),
- /***/ "./js/assessment/output_matching/output_result.js":
- /*!********************************************************!*\
- !*** ./js/assessment/output_matching/output_result.js ***!
- \********************************************************/
- /*! exports provided: createNumberResult, createBoolResult, createStringResult, OutputMatchResult */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNumberResult", function() { return createNumberResult; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createBoolResult", function() { return createBoolResult; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createStringResult", function() { return createStringResult; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputMatchResult", function() { return OutputMatchResult; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- function createNumberResult(expected, generated, grade) {
- return new OutputMatchResult(expected, generated, grade, "number");
- }
- function createBoolResult(expected, generated, grade) {
- return new OutputMatchResult(expected, generated, grade, "bool");
- }
- function createStringResult(expected, generated, grade) {
- return new OutputMatchResult(expected, generated, grade, "string");
- }
- var OutputMatchResult = function OutputMatchResult(expected, generated, grade, type) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, OutputMatchResult);
- this.expected = expected;
- this.generated = generated;
- this.grade = grade;
- this.type = type;
- };
- /***/ }),
- /***/ "./js/ast/ast_helpers.js":
- /*!*******************************!*\
- !*** ./js/ast/ast_helpers.js ***!
- \*******************************/
- /*! exports provided: recover */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recover", function() { return recover; });
- /* harmony import */ var _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./error/syntaxErrorFactory */ "./js/ast/error/syntaxErrorFactory.js");
- function recover(_) {
- var start = this._tokenStartCharIndex;
- var stop = this._input.index;
- var text = this._input.getText(start, stop);
- text = this.getErrorDisplay(text);
- var line = this._tokenStartLine;
- var column = this._tokenStartColumn;
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_0__["SyntaxErrorFactory"].invalid_character(text, line, column);
- }
- /***/ }),
- /***/ "./js/ast/commands/arrayAssign.js":
- /*!****************************************!*\
- !*** ./js/ast/commands/arrayAssign.js ***!
- \****************************************/
- /*! exports provided: ArrayIndexAssign */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayIndexAssign", function() { return ArrayIndexAssign; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _assign__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./assign */ "./js/ast/commands/assign.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
- 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; } }
- var ArrayIndexAssign = /*#__PURE__*/function (_Assign) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(ArrayIndexAssign, _Assign);
- var _super = _createSuper(ArrayIndexAssign);
- function ArrayIndexAssign(id, lineExpression, columnExpression, expression) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ArrayIndexAssign);
- _this = _super.call(this, id, expression);
- _this.line = lineExpression;
- _this.column = columnExpression;
- return _this;
- }
- return ArrayIndexAssign;
- }(_assign__WEBPACK_IMPORTED_MODULE_4__["Assign"]);
- /***/ }),
- /***/ "./js/ast/commands/arrayDeclaration.js":
- /*!*********************************************!*\
- !*** ./js/ast/commands/arrayDeclaration.js ***!
- \*********************************************/
- /*! exports provided: ArrayDeclaration */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayDeclaration", function() { return ArrayDeclaration; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _declaration__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./declaration */ "./js/ast/commands/declaration.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var ArrayDeclaration = /*#__PURE__*/function (_Declaration) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(ArrayDeclaration, _Declaration);
- var _super = _createSuper(ArrayDeclaration);
- function ArrayDeclaration(id, type, lines, columns, initial, isConst) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ArrayDeclaration);
- _this = _super.call(this, id, type, initial, isConst);
- _this.lines = lines;
- _this.columns = columns;
- return _this;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ArrayDeclaration, [{
- key: "isVector",
- get: function get() {
- return this.columns == null;
- }
- }]);
- return ArrayDeclaration;
- }(_declaration__WEBPACK_IMPORTED_MODULE_5__["Declaration"]);
- /***/ }),
- /***/ "./js/ast/commands/assign.js":
- /*!***********************************!*\
- !*** ./js/ast/commands/assign.js ***!
- \***********************************/
- /*! exports provided: Assign */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Assign", function() { return Assign; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
- 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; } }
- var Assign = /*#__PURE__*/function (_Command) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Assign, _Command);
- var _super = _createSuper(Assign);
- function Assign(id, expression) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Assign);
- _this = _super.call(this);
- _this.id = id;
- _this.expression = expression;
- return _this;
- }
- return Assign;
- }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
- /***/ }),
- /***/ "./js/ast/commands/break.js":
- /*!**********************************!*\
- !*** ./js/ast/commands/break.js ***!
- \**********************************/
- /*! exports provided: Break */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Break", function() { return Break; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
- 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; } }
- var Break = /*#__PURE__*/function (_Command) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Break, _Command);
- var _super = _createSuper(Break);
- function Break() {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Break);
- return _super.call(this);
- }
- return Break;
- }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
- /***/ }),
- /***/ "./js/ast/commands/case.js":
- /*!*********************************!*\
- !*** ./js/ast/commands/case.js ***!
- \*********************************/
- /*! exports provided: Case */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Case", function() { return Case; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var Case = /*#__PURE__*/function (_Command) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(Case, _Command);
- var _super = _createSuper(Case);
- function Case(expression) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Case);
- _this = _super.call(this);
- _this.expression = expression;
- /**
- * @type {Command[]}
- */
- _this.commands = [];
- return _this;
- }
- /**
- *
- * @param {Command[]} commands
- */
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Case, [{
- key: "setCommands",
- value: function setCommands(commands) {
- this.commands = commands;
- }
- }, {
- key: "isDefault",
- get: function get() {
- return this.expression === null;
- }
- }]);
- return Case;
- }(_command__WEBPACK_IMPORTED_MODULE_5__["Command"]);
- /***/ }),
- /***/ "./js/ast/commands/command.js":
- /*!************************************!*\
- !*** ./js/ast/commands/command.js ***!
- \************************************/
- /*! exports provided: Command */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return Command; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- var Command = /*#__PURE__*/function () {
- function Command() {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Command);
- this._sourceInfo = null;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Command, [{
- key: "sourceInfo",
- set: function set(sourceInfo) {
- this._sourceInfo = sourceInfo;
- },
- get: function get() {
- return this._sourceInfo;
- }
- }]);
- return Command;
- }();
- /***/ }),
- /***/ "./js/ast/commands/commandBlock.js":
- /*!*****************************************!*\
- !*** ./js/ast/commands/commandBlock.js ***!
- \*****************************************/
- /*! exports provided: CommandBlock */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CommandBlock", function() { return CommandBlock; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- var CommandBlock = /*#__PURE__*/function () {
- function CommandBlock(variables, commands) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CommandBlock);
- this.variables = variables;
- this.commands = commands;
- this._sourceInfo = null;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(CommandBlock, [{
- key: "sourceInfo",
- set: function set(sourceInfo) {
- this._sourceInfo = sourceInfo;
- },
- get: function get() {
- return this._sourceInfo;
- }
- }]);
- return CommandBlock;
- }();
- /***/ }),
- /***/ "./js/ast/commands/declaration.js":
- /*!****************************************!*\
- !*** ./js/ast/commands/declaration.js ***!
- \****************************************/
- /*! exports provided: Declaration */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Declaration", function() { return Declaration; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
- 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; } }
- var Declaration = /*#__PURE__*/function (_Command) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Declaration, _Command);
- var _super = _createSuper(Declaration);
- function Declaration(id, type, initial, isConst) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Declaration);
- _this = _super.call(this);
- _this.id = id;
- _this.type = type;
- _this.initial = initial;
- _this.isConst = isConst;
- return _this;
- }
- return Declaration;
- }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
- /***/ }),
- /***/ "./js/ast/commands/for.js":
- /*!********************************!*\
- !*** ./js/ast/commands/for.js ***!
- \********************************/
- /*! exports provided: For */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "For", function() { return For; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var For = /*#__PURE__*/function (_Command) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(For, _Command);
- var _super = _createSuper(For);
- function For(for_id, for_from, for_to, for_pass, commandBlock) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, For);
- _this = _super.call(this);
- _this.for_id = for_id;
- _this.for_from = for_from;
- _this.for_to = for_to;
- _this.for_pass = for_pass;
- _this.commandBlock = commandBlock;
- return _this;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(For, [{
- key: "commands",
- get: function get() {
- return this.commandBlock.commands;
- }
- }]);
- return For;
- }(_command__WEBPACK_IMPORTED_MODULE_5__["Command"]);
- /***/ }),
- /***/ "./js/ast/commands/formalParameter.js":
- /*!********************************************!*\
- !*** ./js/ast/commands/formalParameter.js ***!
- \********************************************/
- /*! exports provided: FormalParameter */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormalParameter", function() { return FormalParameter; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- var FormalParameter = /*#__PURE__*/function () {
- function FormalParameter(type, id) {
- var byRef = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- var variadic = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, FormalParameter);
- this.type = type;
- this.id = id;
- this.byRef = byRef;
- this.variadic = variadic;
- this._sourceInfo = null;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(FormalParameter, [{
- key: "sourceInfo",
- set: function set(sourceInfo) {
- this._sourceInfo = sourceInfo;
- },
- get: function get() {
- return this._sourceInfo;
- }
- }]);
- return FormalParameter;
- }();
- /***/ }),
- /***/ "./js/ast/commands/function.js":
- /*!*************************************!*\
- !*** ./js/ast/commands/function.js ***!
- \*************************************/
- /*! exports provided: Function */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Function", function() { return Function; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_2__);
- var Function = /*#__PURE__*/function () {
- /**
- *
- * @param {string} name
- * @param {import('./../../typeSystem/itype').IType} returnType
- * @param {import('./formalParameter').FormalParameter[]} formalParameters
- * @param {import('./commandBlock').CommandBlock} commandBlock
- */
- function Function(name, returnType, formalParameters, commandBlock) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Function);
- this.name = name;
- this.returnType = returnType;
- this.formalParameters = formalParameters;
- this.commandBlock = commandBlock;
- this._sourceInfo = null;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Function, [{
- key: "hasVariadic",
- value: function hasVariadic() {
- return this.formalParameters.some(function (p) {
- return p.variadic;
- });
- }
- }, {
- key: "isMain",
- get: function get() {
- return this.name === null && this.returnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_2__["Types"].VOID);
- }
- }, {
- key: "commands",
- get: function get() {
- return this.commandBlock.commands;
- }
- }, {
- key: "variablesDeclarations",
- get: function get() {
- return this.commandBlock.variables;
- }
- }, {
- key: "sourceInfo",
- set: function set(sourceInfo) {
- this._sourceInfo = sourceInfo;
- },
- get: function get() {
- return this._sourceInfo;
- }
- }]);
- return Function;
- }();
- /***/ }),
- /***/ "./js/ast/commands/ifThenElse.js":
- /*!***************************************!*\
- !*** ./js/ast/commands/ifThenElse.js ***!
- \***************************************/
- /*! exports provided: IfThenElse */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IfThenElse", function() { return IfThenElse; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
- 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; } }
- var IfThenElse = /*#__PURE__*/function (_Command) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(IfThenElse, _Command);
- var _super = _createSuper(IfThenElse);
- function IfThenElse(condition, ifTrue, ifFalse) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IfThenElse);
- _this = _super.call(this);
- _this.condition = condition;
- _this.ifTrue = ifTrue;
- _this.ifFalse = ifFalse;
- return _this;
- }
- return IfThenElse;
- }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
- /***/ }),
- /***/ "./js/ast/commands/index.js":
- /*!**********************************!*\
- !*** ./js/ast/commands/index.js ***!
- \**********************************/
- /*! exports provided: Break, Return, Assign, ArrayIndexAssign, Declaration, ArrayDeclaration, While, For, Function, IfThenElse, CommandBlock, RepeatUntil, Switch, Case, SysCall, FormalParameter, FunctionCall */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _break__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./break */ "./js/ast/commands/break.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Break", function() { return _break__WEBPACK_IMPORTED_MODULE_0__["Break"]; });
- /* harmony import */ var _return__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./return */ "./js/ast/commands/return.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Return", function() { return _return__WEBPACK_IMPORTED_MODULE_1__["Return"]; });
- /* harmony import */ var _assign__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./assign */ "./js/ast/commands/assign.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Assign", function() { return _assign__WEBPACK_IMPORTED_MODULE_2__["Assign"]; });
- /* harmony import */ var _arrayAssign__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./arrayAssign */ "./js/ast/commands/arrayAssign.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayIndexAssign", function() { return _arrayAssign__WEBPACK_IMPORTED_MODULE_3__["ArrayIndexAssign"]; });
- /* harmony import */ var _declaration__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./declaration */ "./js/ast/commands/declaration.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Declaration", function() { return _declaration__WEBPACK_IMPORTED_MODULE_4__["Declaration"]; });
- /* harmony import */ var _arrayDeclaration__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./arrayDeclaration */ "./js/ast/commands/arrayDeclaration.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayDeclaration", function() { return _arrayDeclaration__WEBPACK_IMPORTED_MODULE_5__["ArrayDeclaration"]; });
- /* harmony import */ var _while__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./while */ "./js/ast/commands/while.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "While", function() { return _while__WEBPACK_IMPORTED_MODULE_6__["While"]; });
- /* harmony import */ var _for__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./for */ "./js/ast/commands/for.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "For", function() { return _for__WEBPACK_IMPORTED_MODULE_7__["For"]; });
- /* harmony import */ var _function__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./function */ "./js/ast/commands/function.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Function", function() { return _function__WEBPACK_IMPORTED_MODULE_8__["Function"]; });
- /* harmony import */ var _ifThenElse__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ifThenElse */ "./js/ast/commands/ifThenElse.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IfThenElse", function() { return _ifThenElse__WEBPACK_IMPORTED_MODULE_9__["IfThenElse"]; });
- /* harmony import */ var _commandBlock__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./commandBlock */ "./js/ast/commands/commandBlock.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CommandBlock", function() { return _commandBlock__WEBPACK_IMPORTED_MODULE_10__["CommandBlock"]; });
- /* harmony import */ var _repeatUntil__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./repeatUntil */ "./js/ast/commands/repeatUntil.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RepeatUntil", function() { return _repeatUntil__WEBPACK_IMPORTED_MODULE_11__["RepeatUntil"]; });
- /* harmony import */ var _switch__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./switch */ "./js/ast/commands/switch.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return _switch__WEBPACK_IMPORTED_MODULE_12__["Switch"]; });
- /* harmony import */ var _case__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./case */ "./js/ast/commands/case.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Case", function() { return _case__WEBPACK_IMPORTED_MODULE_13__["Case"]; });
- /* harmony import */ var _sysCall__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./sysCall */ "./js/ast/commands/sysCall.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SysCall", function() { return _sysCall__WEBPACK_IMPORTED_MODULE_14__["SysCall"]; });
- /* harmony import */ var _formalParameter__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./formalParameter */ "./js/ast/commands/formalParameter.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormalParameter", function() { return _formalParameter__WEBPACK_IMPORTED_MODULE_15__["FormalParameter"]; });
- /* harmony import */ var _expressions_functionCall__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../expressions/functionCall */ "./js/ast/expressions/functionCall.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return _expressions_functionCall__WEBPACK_IMPORTED_MODULE_16__["FunctionCall"]; });
- //Proxy to expression since they do exatcly the same thing
- /***/ }),
- /***/ "./js/ast/commands/repeatUntil.js":
- /*!****************************************!*\
- !*** ./js/ast/commands/repeatUntil.js ***!
- \****************************************/
- /*! exports provided: RepeatUntil */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RepeatUntil", function() { return RepeatUntil; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _while__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./while */ "./js/ast/commands/while.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var RepeatUntil = /*#__PURE__*/function (_While) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(RepeatUntil, _While);
- var _super = _createSuper(RepeatUntil);
- function RepeatUntil(condition, commandBlock) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, RepeatUntil);
- return _super.call(this, condition, commandBlock);
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(RepeatUntil, [{
- key: "testFirst",
- get: function get() {
- return false;
- }
- }]);
- return RepeatUntil;
- }(_while__WEBPACK_IMPORTED_MODULE_5__["While"]);
- /***/ }),
- /***/ "./js/ast/commands/return.js":
- /*!***********************************!*\
- !*** ./js/ast/commands/return.js ***!
- \***********************************/
- /*! exports provided: Return */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Return", function() { return Return; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
- 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; } }
- var Return = /*#__PURE__*/function (_Command) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Return, _Command);
- var _super = _createSuper(Return);
- function Return(expression) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Return);
- _this = _super.call(this);
- _this.expression = expression;
- return _this;
- }
- return Return;
- }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
- /***/ }),
- /***/ "./js/ast/commands/switch.js":
- /*!***********************************!*\
- !*** ./js/ast/commands/switch.js ***!
- \***********************************/
- /*! exports provided: Switch */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return Switch; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
- /* harmony import */ var _expressions_expression__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../expressions/expression */ "./js/ast/expressions/expression.js");
- /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! . */ "./js/ast/commands/index.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
- 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; } }
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- var Switch = /*#__PURE__*/function (_Command) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Switch, _Command);
- var _super = _createSuper(Switch);
- /**
- *
- * @param {Expression} expression
- * @param {Case[]} cases
- */
- function Switch(expression, cases) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Switch);
- _this = _super.call(this);
- _this.expression = expression;
- _this.cases = cases;
- return _this;
- }
- return Switch;
- }(_command__WEBPACK_IMPORTED_MODULE_4__["Command"]);
- /***/ }),
- /***/ "./js/ast/commands/sysCall.js":
- /*!************************************!*\
- !*** ./js/ast/commands/sysCall.js ***!
- \************************************/
- /*! exports provided: SysCall */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SysCall", function() { return SysCall; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /**
- * This class represents all the language defined functions.
- * The language processor uses the id provided here to properly execute the desired function.
- * The function is actually implemented inside the language processor.
- * All the functions can be found at: js/processor/definedFunctions.js
- */
- var SysCall = function SysCall(langFunc) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SysCall);
- this.langFunc = langFunc;
- };
- /***/ }),
- /***/ "./js/ast/commands/while.js":
- /*!**********************************!*\
- !*** ./js/ast/commands/while.js ***!
- \**********************************/
- /*! exports provided: While */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "While", function() { return While; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./command */ "./js/ast/commands/command.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var While = /*#__PURE__*/function (_Command) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(While, _Command);
- var _super = _createSuper(While);
- function While(expression, commandBlock) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, While);
- _this = _super.call(this);
- _this.expression = expression;
- _this.commandBlock = commandBlock;
- return _this;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(While, [{
- key: "commands",
- get: function get() {
- return this.commandBlock.commands;
- }
- }, {
- key: "testFirst",
- get: function get() {
- return true;
- }
- }]);
- return While;
- }(_command__WEBPACK_IMPORTED_MODULE_5__["Command"]);
- /***/ }),
- /***/ "./js/ast/error/syntaxError.js":
- /*!*************************************!*\
- !*** ./js/ast/error/syntaxError.js ***!
- \*************************************/
- /*! exports provided: SyntaxError */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SyntaxError", function() { return SyntaxError; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
- /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "./node_modules/@babel/runtime/helpers/wrapNativeSuper.js");
- /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__);
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var SyntaxError = /*#__PURE__*/function (_Error) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(SyntaxError, _Error);
- var _super = _createSuper(SyntaxError);
- function SyntaxError() {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SyntaxError);
- for (var _len = arguments.length, msg = new Array(_len), _key = 0; _key < _len; _key++) {
- msg[_key] = arguments[_key];
- }
- _this = _super.call.apply(_super, [this].concat(msg));
- if (Error.captureStackTrace) Error.captureStackTrace(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default()(_this), SyntaxError);
- return _this;
- }
- return SyntaxError;
- }( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default()(Error));
- /***/ }),
- /***/ "./js/ast/error/syntaxErrorFactory.js":
- /*!********************************************!*\
- !*** ./js/ast/error/syntaxErrorFactory.js ***!
- \********************************************/
- /*! exports provided: SyntaxErrorFactory */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SyntaxErrorFactory", function() { return SyntaxErrorFactory; });
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _syntaxError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./syntaxError */ "./js/ast/error/syntaxError.js");
- var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["getInstance"]();
- function createError(message_id) {
- var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- return new _syntaxError__WEBPACK_IMPORTED_MODULE_1__["SyntaxError"](LocalizedStrings.getError(message_id, context));
- }
- var SyntaxErrorFactory = Object.freeze({
- extra_lines: function extra_lines() {
- return new _syntaxError__WEBPACK_IMPORTED_MODULE_1__["SyntaxError"](LocalizedStrings.getError("extra_lines"));
- },
- token_missing_one: function token_missing_one(expected, token) {
- var context = [expected, token.text, token.line, token.column];
- return createError("token_missing_one", context);
- },
- token_missing_list: function token_missing_list(expectedList, token) {
- var line = expectedList.join(LocalizedStrings.getOR());
- return SyntaxErrorFactory.token_missing_one(line, token);
- },
- id_missing: function id_missing(token) {
- var context = [token.text, token.line, token.column];
- return createError("id_missing", context);
- },
- eos_missing: function eos_missing(token) {
- var context = [token.line, token.column];
- return createError("eos_missing", context);
- },
- invalid_array_dimension: function invalid_array_dimension(typeName, token) {
- var context = [token.line, token.column, typeName];
- return createError("invalid_array_dimension", context);
- },
- invalid_array_size: function invalid_array_size(token) {
- var context = [token.line];
- return createError("invalid_array_size", context);
- },
- invalid_main_return: function invalid_main_return(name, typeName, token) {
- var context = [name, typeName, token.line];
- return createError("invalid_main_return", context);
- },
- invalid_var_declaration: function invalid_var_declaration(token) {
- var context = [token.line];
- return createError("invalid_var_declaration", context);
- },
- invalid_break_command: function invalid_break_command(cmdName, token) {
- var context = [token.line, cmdName];
- return createError("invalid_break_command", context);
- },
- invalid_terminal: function invalid_terminal(token) {
- var context = [token.text, token.line, token.column];
- return createError('invalid_terminal', context);
- },
- invalid_type: function invalid_type(list, token) {
- var line = list.join(LocalizedStrings.getOR());
- var context = [token.text, token.line, token.column, line];
- return createError("invalid_type", context);
- },
- const_not_init: function const_not_init(token) {
- var context = [token.line, token.column];
- return createError("const_not_init", context);
- },
- invalid_id_format: function invalid_id_format(token) {
- var context = [token.text, token.line, token.column];
- return createError("invalid_id_format", context);
- },
- duplicate_function: function duplicate_function(token) {
- var context = [token.text, token.line, token.column];
- return createError("duplicate_function", context);
- },
- main_parameters: function main_parameters() {
- return createError("main_parameters");
- },
- duplicate_variable: function duplicate_variable(token) {
- var context = [token.text, token.line, token.column];
- return createError("duplicate_variable", context);
- },
- invalid_character: function invalid_character(text, line, _column) {
- var context = [text, line];
- return createError("invalid_character", context);
- },
- annonymous_array_literal: function annonymous_array_literal(token) {
- var context = [token.line];
- return createError("annonymous_array_literal", context);
- },
- invalid_matrix_literal_line: function invalid_matrix_literal_line(exp, sourceInfo) {
- var context = [exp, sourceInfo.line];
- return createError("invalid_matrix_literal_line", context);
- },
- cannot_infer_matrix_line: function cannot_infer_matrix_line(name, sourceInfo) {
- var context = [name, sourceInfo.line];
- return createError("cannot_infer_matrix_line", context);
- },
- cannot_infer_matrix_column: function cannot_infer_matrix_column(name, sourceInfo) {
- var context = [name, sourceInfo.line];
- return createError("cannot_infer_matrix_column", context);
- },
- cannot_infer_vector_size: function cannot_infer_vector_size(name, sourceInfo) {
- var context = [name, sourceInfo.line];
- return createError("cannot_infer_vector_size", context);
- },
- matrix_to_vector_literal_attr: function matrix_to_vector_literal_attr(name, exp, sourceInfo) {
- var context = [sourceInfo.line, exp, name];
- return createError("matrix_to_vector_literal_attr", context);
- },
- vector_to_matrix_literal_attr: function vector_to_matrix_literal_attr(name, exp, sourceInfo) {
- var context = [sourceInfo.line, exp, name];
- return createError("vector_to_matrix_literal_attr", context);
- },
- array_init_not_literal: function array_init_not_literal(sourceInfo) {
- var context = [sourceInfo.line];
- return createError("array_init_not_literal", context);
- },
- array_exceeds_2d: function array_exceeds_2d(sourceInfo) {
- var context = [sourceInfo.line];
- return createError("array_exceeds_2d", context);
- },
- invalid_matrix_id_dimension: function invalid_matrix_id_dimension(sourceInfo) {
- var context = [sourceInfo.line];
- return createError("invalid_matrix_id_dimension", context);
- },
- invalid_vector_init: function invalid_vector_init(sourceInfo) {
- var context = [sourceInfo.line];
- return createError("invalid_vector_init", context);
- },
- invalid_matrix_init: function invalid_matrix_init(sourceInfo) {
- var context = [sourceInfo.line];
- return createError("invalid_matrix_init", context);
- }
- });
- /***/ }),
- /***/ "./js/ast/expressions/arrayAccess.js":
- /*!*******************************************!*\
- !*** ./js/ast/expressions/arrayAccess.js ***!
- \*******************************************/
- /*! exports provided: ArrayAccess */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayAccess", function() { return ArrayAccess; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var ArrayAccess = /*#__PURE__*/function (_Expression) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(ArrayAccess, _Expression);
- var _super = _createSuper(ArrayAccess);
- function ArrayAccess(id, line, column) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ArrayAccess);
- _this = _super.call(this);
- _this.id = id;
- _this.line = line;
- _this.column = column;
- return _this;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ArrayAccess, [{
- key: "toString",
- value: function toString() {
- var strLine = this.line.toString();
- var strColumn = null;
- if (this.column) {
- strColumn = this.column.toString();
- }
- var text = null;
- if (strColumn) {
- text = "".concat(this.id, "[").concat(strLine, "][").concat(strColumn, "]");
- } else {
- text = "".concat(this.id, "[").concat(strLine, "]");
- }
- if (this.parenthesis) {
- return "(".concat(text, ")");
- } else {
- return text;
- }
- }
- }]);
- return ArrayAccess;
- }(_expression__WEBPACK_IMPORTED_MODULE_5__["Expression"]);
- /***/ }),
- /***/ "./js/ast/expressions/arrayLiteral.js":
- /*!********************************************!*\
- !*** ./js/ast/expressions/arrayLiteral.js ***!
- \********************************************/
- /*! exports provided: ArrayLiteral */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayLiteral", function() { return ArrayLiteral; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var ArrayLiteral = /*#__PURE__*/function (_Literal) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(ArrayLiteral, _Literal);
- var _super = _createSuper(ArrayLiteral);
- /**
- *
- * @param {import('../../typeSystem/itype').IType} type
- * @param {import('./expression').Expression[]} value
- */
- function ArrayLiteral(type, value) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ArrayLiteral);
- _this = _super.call(this, type);
- _this.value = value;
- return _this;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ArrayLiteral, [{
- key: "validateType",
- value: function validateType() {
- var valid = true; // const subtype = this.subtype;
- // if(this.columns !== null) {
- // const len = this.lines;
- // const len2 = this.columns;
- // for (let i = len - 1; i >= 0 && valid; --i) {
- // for (let j = len2 - 1; j >= 0 && valid; --j) {
- // if(!this.value[i].value[j].type.isCompatilbe(subtype)) {
- // valid = false;
- // break;
- // }
- // }
- // }
- // } else {
- // const len = this.lines;
- // for (var i = len - 1; i >= 0 && valid; i--) {
- // if(!this.value[i].type.isCompatilbe(subtype)) {
- // valid = false;
- // break;
- // }
- // }
- // }
- // Cannot validate type since no information on variables literals are available
- return valid;
- }
- }, {
- key: "validateSize",
- value: function validateSize() {
- var valid = true; // if(this.columns !== null) {
- // const equalityTest = this.value.map(v => v.value.length)
- // .reduce((old, next) => {
- // console.log(next);
- // if (old == null) {
- // return next;
- // } else if (old === next) {
- // return old
- // } else {
- // return -1;
- // }
- // }, null);
- // valid = equalityTest !== -1;
- // }
- // check is now made inside IVProgParser.parseVectorList(...)
- return valid;
- }
- }, {
- key: "toString",
- value: function toString() {
- var strList = this.value.map(function (arrayLiteral) {
- return arrayLiteral.toString();
- });
- var text = "{" + strList.join(',') + "}";
- if (this.parenthesis) {
- return "(".concat(text, ")");
- } else {
- return text;
- }
- }
- }, {
- key: "subtype",
- get: function get() {
- var element = this.value[0];
- if (element instanceof ArrayLiteral) {
- return element.value[0].type;
- } else {
- return element.type;
- }
- }
- }, {
- key: "lines",
- get: function get() {
- return this.value.length;
- }
- }, {
- key: "columns",
- get: function get() {
- var element = this.value[0];
- if (!(element instanceof ArrayLiteral)) {
- return null;
- } else {
- return element.value.length;
- }
- }
- }, {
- key: "isVector",
- get: function get() {
- return this.columns === null;
- }
- }, {
- key: "isValid",
- get: function get() {
- return this.validateSize() && this.validateType();
- }
- }]);
- return ArrayLiteral;
- }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
- /***/ }),
- /***/ "./js/ast/expressions/boolLiteral.js":
- /*!*******************************************!*\
- !*** ./js/ast/expressions/boolLiteral.js ***!
- \*******************************************/
- /*! exports provided: BoolLiteral */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BoolLiteral", function() { return BoolLiteral; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
- /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var BoolLiteral = /*#__PURE__*/function (_Literal) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(BoolLiteral, _Literal);
- var _super = _createSuper(BoolLiteral);
- function BoolLiteral(value) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, BoolLiteral);
- _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].BOOLEAN);
- _this.value = value;
- return _this;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(BoolLiteral, [{
- key: "toString",
- value: function toString() {
- var text = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__["convertBoolToString"])(this.value);
- if (this.parenthesis) {
- return "(".concat(text, ")");
- } else {
- return text;
- }
- }
- }]);
- return BoolLiteral;
- }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
- /***/ }),
- /***/ "./js/ast/expressions/charLiteral.js":
- /*!*******************************************!*\
- !*** ./js/ast/expressions/charLiteral.js ***!
- \*******************************************/
- /*! exports provided: CharLiteral */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharLiteral", function() { return CharLiteral; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var CharLiteral = /*#__PURE__*/function (_Literal) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(CharLiteral, _Literal);
- var _super = _createSuper(CharLiteral);
- function CharLiteral(value) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CharLiteral);
- _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].CHAR);
- _this.value = value;
- return _this;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(CharLiteral, [{
- key: "toString",
- value: function toString() {
- var text = "'".concat(this.value, "'");
- if (this.parenthesis) {
- return "(".concat(text, ")");
- } else {
- return text;
- }
- }
- }]);
- return CharLiteral;
- }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
- /***/ }),
- /***/ "./js/ast/expressions/expression.js":
- /*!******************************************!*\
- !*** ./js/ast/expressions/expression.js ***!
- \******************************************/
- /*! exports provided: Expression */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Expression", function() { return Expression; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- var Expression = /*#__PURE__*/function () {
- function Expression() {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Expression);
- this._sourceInfo = null;
- this._parenthesis = false;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Expression, [{
- key: "sourceInfo",
- set: function set(sourceInfo) {
- this._sourceInfo = sourceInfo;
- },
- get: function get() {
- return this._sourceInfo;
- }
- }, {
- key: "parenthesis",
- set: function set(flag) {
- this._parenthesis = flag;
- },
- get: function get() {
- return this._parenthesis;
- }
- }]);
- return Expression;
- }();
- /***/ }),
- /***/ "./js/ast/expressions/functionCall.js":
- /*!********************************************!*\
- !*** ./js/ast/expressions/functionCall.js ***!
- \********************************************/
- /*! exports provided: FunctionCall */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return FunctionCall; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
- /* harmony import */ var _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../processor/definedFunctions */ "./js/processor/definedFunctions.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var FunctionCall = /*#__PURE__*/function (_Expression) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(FunctionCall, _Expression);
- var _super = _createSuper(FunctionCall);
- /**
- *
- * @param {string} id
- * @param {Expression[]} actualParameters
- */
- function FunctionCall(id, actualParameters) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, FunctionCall);
- _this = _super.call(this);
- _this.id = id;
- _this.actualParameters = actualParameters;
- return _this;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(FunctionCall, [{
- key: "toString",
- value: function toString() {
- var name = null;
- if (this.isMainCall) {
- name = _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_6__["LanguageDefinedFunction"].getMainFunctionName();
- } else {
- name = _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_6__["LanguageDefinedFunction"].getLocalName(this.id);
- }
- var params = null;
- if (this.actualParameters.length == 0) {
- params = "()";
- } else {
- var strParams = this.actualParameters.map(function (v) {
- return v.toString();
- });
- params = "(" + strParams.join(",") + ")";
- }
- if (this.parenthesis) {
- return "(".concat(name + params, ")");
- } else {
- return name + params;
- }
- }
- }, {
- key: "isMainCall",
- get: function get() {
- return this.id === null;
- }
- }, {
- key: "parametersSize",
- get: function get() {
- return this.actualParameters.length;
- }
- }]);
- return FunctionCall;
- }(_expression__WEBPACK_IMPORTED_MODULE_5__["Expression"]);
- /***/ }),
- /***/ "./js/ast/expressions/index.js":
- /*!*************************************!*\
- !*** ./js/ast/expressions/index.js ***!
- \*************************************/
- /*! exports provided: ArrayAccess, FunctionCall, IntLiteral, RealLiteral, BoolLiteral, CharLiteral, StringLiteral, ArrayLiteral, VariableLiteral, InfixApp, UnaryApp */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _arrayAccess__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayAccess */ "./js/ast/expressions/arrayAccess.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayAccess", function() { return _arrayAccess__WEBPACK_IMPORTED_MODULE_0__["ArrayAccess"]; });
- /* harmony import */ var _functionCall__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functionCall */ "./js/ast/expressions/functionCall.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return _functionCall__WEBPACK_IMPORTED_MODULE_1__["FunctionCall"]; });
- /* harmony import */ var _intLiteral__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./intLiteral */ "./js/ast/expressions/intLiteral.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "IntLiteral", function() { return _intLiteral__WEBPACK_IMPORTED_MODULE_2__["IntLiteral"]; });
- /* harmony import */ var _realLiteral__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./realLiteral */ "./js/ast/expressions/realLiteral.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RealLiteral", function() { return _realLiteral__WEBPACK_IMPORTED_MODULE_3__["RealLiteral"]; });
- /* harmony import */ var _boolLiteral__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./boolLiteral */ "./js/ast/expressions/boolLiteral.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BoolLiteral", function() { return _boolLiteral__WEBPACK_IMPORTED_MODULE_4__["BoolLiteral"]; });
- /* harmony import */ var _charLiteral__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./charLiteral */ "./js/ast/expressions/charLiteral.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CharLiteral", function() { return _charLiteral__WEBPACK_IMPORTED_MODULE_5__["CharLiteral"]; });
- /* harmony import */ var _stringLiteral__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./stringLiteral */ "./js/ast/expressions/stringLiteral.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "StringLiteral", function() { return _stringLiteral__WEBPACK_IMPORTED_MODULE_6__["StringLiteral"]; });
- /* harmony import */ var _arrayLiteral__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./arrayLiteral */ "./js/ast/expressions/arrayLiteral.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArrayLiteral", function() { return _arrayLiteral__WEBPACK_IMPORTED_MODULE_7__["ArrayLiteral"]; });
- /* harmony import */ var _variableLiteral__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./variableLiteral */ "./js/ast/expressions/variableLiteral.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VariableLiteral", function() { return _variableLiteral__WEBPACK_IMPORTED_MODULE_8__["VariableLiteral"]; });
- /* harmony import */ var _infixApp__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./infixApp */ "./js/ast/expressions/infixApp.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InfixApp", function() { return _infixApp__WEBPACK_IMPORTED_MODULE_9__["InfixApp"]; });
- /* harmony import */ var _unaryApp__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./unaryApp */ "./js/ast/expressions/unaryApp.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UnaryApp", function() { return _unaryApp__WEBPACK_IMPORTED_MODULE_10__["UnaryApp"]; });
- /***/ }),
- /***/ "./js/ast/expressions/infixApp.js":
- /*!****************************************!*\
- !*** ./js/ast/expressions/infixApp.js ***!
- \****************************************/
- /*! exports provided: InfixApp */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InfixApp", function() { return InfixApp; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var InfixApp = /*#__PURE__*/function (_Expression) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(InfixApp, _Expression);
- var _super = _createSuper(InfixApp);
- function InfixApp(op, left, right) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, InfixApp);
- _this = _super.call(this);
- _this.op = op;
- _this.left = left;
- _this.right = right;
- return _this;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(InfixApp, [{
- key: "toString",
- value: function toString() {
- var l = this.left.toString();
- var op = this.op.value;
- var r = this.right.toString();
- if (this.parenthesis) {
- return "(".concat(l + op + r, ")");
- } else {
- return l + op + r;
- }
- }
- }]);
- return InfixApp;
- }(_expression__WEBPACK_IMPORTED_MODULE_5__["Expression"]);
- /***/ }),
- /***/ "./js/ast/expressions/intLiteral.js":
- /*!******************************************!*\
- !*** ./js/ast/expressions/intLiteral.js ***!
- \******************************************/
- /*! exports provided: IntLiteral */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IntLiteral", function() { return IntLiteral; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
- /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var IntLiteral = /*#__PURE__*/function (_Literal) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(IntLiteral, _Literal);
- var _super = _createSuper(IntLiteral);
- function IntLiteral(value) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IntLiteral);
- _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].INTEGER);
- _this.value = value;
- return _this;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IntLiteral, [{
- key: "toString",
- value: function toString() {
- var text = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__["convertToString"])(this.value, this.type);
- if (this.parenthesis) {
- return "(".concat(text, ")");
- } else {
- return text;
- }
- }
- }]);
- return IntLiteral;
- }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
- /***/ }),
- /***/ "./js/ast/expressions/literal.js":
- /*!***************************************!*\
- !*** ./js/ast/expressions/literal.js ***!
- \***************************************/
- /*! exports provided: Literal */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Literal", function() { return Literal; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./expression */ "./js/ast/expressions/expression.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }
- 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; } }
- var Literal = /*#__PURE__*/function (_Expression) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(Literal, _Expression);
- var _super = _createSuper(Literal);
- function Literal(type) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Literal);
- _this = _super.call(this);
- _this.type = type;
- return _this;
- }
- return Literal;
- }(_expression__WEBPACK_IMPORTED_MODULE_4__["Expression"]);
- /***/ }),
- /***/ "./js/ast/expressions/realLiteral.js":
- /*!*******************************************!*\
- !*** ./js/ast/expressions/realLiteral.js ***!
- \*******************************************/
- /*! exports provided: RealLiteral */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RealLiteral", function() { return RealLiteral; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
- /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var RealLiteral = /*#__PURE__*/function (_Literal) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(RealLiteral, _Literal);
- var _super = _createSuper(RealLiteral);
- function RealLiteral(value) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, RealLiteral);
- _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].REAL);
- _this.value = value;
- return _this;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(RealLiteral, [{
- key: "toString",
- value: function toString() {
- var text = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_7__["convertToString"])(this.value, this.type);
- if (this.parenthesis) {
- return "(".concat(text, ")");
- } else {
- return text;
- }
- }
- }]);
- return RealLiteral;
- }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
- /***/ }),
- /***/ "./js/ast/expressions/stringLiteral.js":
- /*!*********************************************!*\
- !*** ./js/ast/expressions/stringLiteral.js ***!
- \*********************************************/
- /*! exports provided: StringLiteral */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StringLiteral", function() { return StringLiteral; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var StringLiteral = /*#__PURE__*/function (_Literal) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(StringLiteral, _Literal);
- var _super = _createSuper(StringLiteral);
- function StringLiteral(value) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, StringLiteral);
- _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].STRING);
- _this.value = value;
- return _this;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(StringLiteral, [{
- key: "toString",
- value: function toString() {
- var text = '"' + this.value + '"';
- if (this.parenthesis) {
- return "(".concat(text, ")");
- } else {
- return text;
- }
- }
- }]);
- return StringLiteral;
- }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
- /***/ }),
- /***/ "./js/ast/expressions/unaryApp.js":
- /*!****************************************!*\
- !*** ./js/ast/expressions/unaryApp.js ***!
- \****************************************/
- /*! exports provided: UnaryApp */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnaryApp", function() { return UnaryApp; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _infixApp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./infixApp */ "./js/ast/expressions/infixApp.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var UnaryApp = /*#__PURE__*/function (_InfixApp) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(UnaryApp, _InfixApp);
- var _super = _createSuper(UnaryApp);
- function UnaryApp(op, left) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, UnaryApp);
- return _super.call(this, op, left, null);
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(UnaryApp, [{
- key: "toString",
- value: function toString() {
- var l = this.left.toString();
- var op = this.op.value;
- if (this.parenthesis) {
- return "(".concat(op + l, ")");
- } else {
- return op + l;
- }
- }
- }]);
- return UnaryApp;
- }(_infixApp__WEBPACK_IMPORTED_MODULE_5__["InfixApp"]);
- /***/ }),
- /***/ "./js/ast/expressions/variableLiteral.js":
- /*!***********************************************!*\
- !*** ./js/ast/expressions/variableLiteral.js ***!
- \***********************************************/
- /*! exports provided: VariableLiteral */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VariableLiteral", function() { return VariableLiteral; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./literal */ "./js/ast/expressions/literal.js");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_6__);
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var VariableLiteral = /*#__PURE__*/function (_Literal) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(VariableLiteral, _Literal);
- var _super = _createSuper(VariableLiteral);
- function VariableLiteral(id) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, VariableLiteral);
- _this = _super.call(this, _typeSystem_types__WEBPACK_IMPORTED_MODULE_6__["Types"].UNDEFINED);
- _this.id = id;
- return _this;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(VariableLiteral, [{
- key: "toString",
- value: function toString() {
- if (this.parenthesis) {
- return "(".concat(this.id, ")");
- } else {
- return this.id;
- }
- }
- }]);
- return VariableLiteral;
- }(_literal__WEBPACK_IMPORTED_MODULE_5__["Literal"]);
- /***/ }),
- /***/ "./js/ast/ivprogParser.js":
- /*!********************************!*\
- !*** ./js/ast/ivprogParser.js ***!
- \********************************/
- /*! exports provided: IVProgParser */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IVProgParser", function() { return IVProgParser; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var antlr4_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! antlr4/index */ "./node_modules/antlr4/index.js");
- /* harmony import */ var antlr4_index__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(antlr4_index__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _expressions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./expressions */ "./js/ast/expressions/index.js");
- /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./commands */ "./js/ast/commands/index.js");
- /* harmony import */ var _ast_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ast_helpers */ "./js/ast/ast_helpers.js");
- /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../typeSystem/parsers */ "./js/typeSystem/parsers.js");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../typeSystem/types */ "./js/typeSystem/types.ts");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_7__);
- /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
- /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__);
- /* harmony import */ var _sourceInfo__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./sourceInfo */ "./js/ast/sourceInfo.js");
- /* harmony import */ var _operators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./operators */ "./js/ast/operators.ts");
- /* harmony import */ var _operators__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_operators__WEBPACK_IMPORTED_MODULE_10__);
- /* harmony import */ var _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./error/syntaxErrorFactory */ "./js/ast/error/syntaxErrorFactory.js");
- /* harmony import */ var _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../processor/definedFunctions */ "./js/processor/definedFunctions.js");
- /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../services/languageService */ "./js/services/languageService.js");
- var IVProgParser = /*#__PURE__*/function () {
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IVProgParser, null, [{
- key: "createParser",
- value: function createParser(input) {
- var lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_13__["LanguageService"].getCurrentLexer();
- return new IVProgParser(input, lexerClass);
- } // <BEGIN scope consts>
- }, {
- key: "BASE",
- get: function get() {
- return 0;
- }
- }, {
- key: "FUNCTION",
- get: function get() {
- return 1;
- }
- }, {
- key: "COMMAND",
- get: function get() {
- return 2;
- }
- }, {
- key: "BREAKABLE",
- get: function get() {
- return 4;
- } // </ END scope consts>
- }]);
- function IVProgParser(input, lexerClass) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IVProgParser);
- this.lexerClass = lexerClass;
- this.inputStream = new antlr4_index__WEBPACK_IMPORTED_MODULE_2__["InputStream"](input);
- this.lexer = new lexerClass(this.inputStream);
- this.lexer.recover = _ast_helpers__WEBPACK_IMPORTED_MODULE_5__["recover"].bind(this.lexer);
- this.tokenStream = new antlr4_index__WEBPACK_IMPORTED_MODULE_2__["CommonTokenStream"](this.lexer);
- this.tokenStream.fill();
- this.pos = 1;
- this.variableTypes = [this.lexerClass.RK_INTEGER, this.lexerClass.RK_REAL, this.lexerClass.RK_BOOLEAN, this.lexerClass.RK_STRING, this.lexerClass.RK_CHARACTER];
- this.functionTypes = this.variableTypes.concat(this.lexerClass.RK_VOID);
- this.parsingArrayDimension = 0;
- this.scope = [];
- this.langFuncs = _services_languageService__WEBPACK_IMPORTED_MODULE_13__["LanguageService"].getCurrentLangFuncs();
- this.definedFuncsNameList = [];
- this.definedVariablesStack = [];
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IVProgParser, [{
- key: "parseTree",
- value: function parseTree() {
- return this.parseProgram();
- }
- }, {
- key: "getToken",
- value: function getToken() {
- var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.pos;
- // if(index === null)
- // index = this.pos;
- return this.tokenStream.LT(index);
- }
- }, {
- key: "insideScope",
- value: function insideScope(scope) {
- if (this.scope.length <= 0) {
- return IVProgParser.BASE === scope;
- } else {
- return this.scope[this.scope.length - 1] === scope;
- }
- }
- }, {
- key: "pushScope",
- value: function pushScope(scope) {
- this.scope.push(scope);
- }
- }, {
- key: "pushVariableStack",
- value: function pushVariableStack() {
- this.definedVariablesStack.push([]);
- }
- }, {
- key: "popScope",
- value: function popScope() {
- return this.scope.pop();
- }
- }, {
- key: "popVariableStack",
- value: function popVariableStack() {
- return this.definedVariablesStack.pop();
- }
- }, {
- key: "getCurrentVariableStack",
- value: function getCurrentVariableStack() {
- return this.definedVariablesStack[this.definedVariablesStack.length - 1];
- }
- }, {
- key: "isEOF",
- value: function isEOF() {
- this.getToken(this.pos);
- return this.tokenStream.fetchedEOF;
- }
- }, {
- key: "parseProgram",
- value: function parseProgram() {
- this.consumeNewLines();
- var token = this.getToken();
- var globalVars = [];
- var functions = [];
- if (this.lexerClass.RK_PROGRAM === token.type) {
- this.pos++;
- this.consumeNewLines();
- this.checkOpenCurly();
- this.pos++;
- this.pushVariableStack();
- for (;;) {
- this.consumeNewLines();
- var _token = this.getToken();
- if (_token.type === this.lexerClass.RK_CONST || this.isVariableType(_token)) {
- globalVars = globalVars.concat(this.parseGlobalVariables());
- } else if (_token.type === this.lexerClass.RK_FUNCTION) {
- this.pushVariableStack();
- functions = functions.concat(this.parseFunction());
- this.popVariableStack();
- } else {
- break;
- }
- }
- this.consumeNewLines();
- this.checkCloseCurly();
- this.pos++;
- this.consumeNewLines();
- if (!this.isEOF()) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].extra_lines();
- }
- this.popVariableStack();
- return {
- global: globalVars,
- functions: functions
- };
- } else {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(this.lexer.literalNames[this.lexerClass.RK_PROGRAM], token);
- }
- }
- }, {
- key: "checkOpenCurly",
- value: function checkOpenCurly() {
- var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- var token = this.getToken();
- if (this.lexerClass.OPEN_CURLY !== token.type) {
- if (!attempt) throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one('{', token);else return false;
- }
- return true;
- }
- }, {
- key: "checkCloseCurly",
- value: function checkCloseCurly() {
- var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- var token = this.getToken();
- if (this.lexerClass.CLOSE_CURLY !== token.type) {
- if (!attempt) throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one('}', token);else return false;
- }
- return true;
- }
- /* It checks if the current token at position pos is a ']'.
- * As a check function it doesn't increment pos.
- *
- * @params bool:attempt, indicates that the token is optional. Defaults: false
- *
- * @returns true if the attempt is true and current token is '[',
- * false is attempt is true and current token is not '['
- **/
- }, {
- key: "checkOpenBrace",
- value: function checkOpenBrace() {
- var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- var token = this.getToken();
- if (this.lexerClass.OPEN_BRACE !== token.type) {
- if (!attempt) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one('[', token);
- } else {
- return false;
- }
- }
- return true;
- }
- }, {
- key: "checkCloseBrace",
- value: function checkCloseBrace() {
- var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- var token = this.getToken();
- if (this.lexerClass.CLOSE_BRACE !== token.type) {
- if (!attempt) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(']', token);
- } else {
- return false;
- }
- }
- return true;
- }
- }, {
- key: "checkOpenParenthesis",
- value: function checkOpenParenthesis() {
- var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- var token = this.getToken();
- if (this.lexerClass.OPEN_PARENTHESIS !== token.type) {
- if (!attempt) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one('(', token);
- } else {
- return false;
- }
- }
- return true;
- }
- }, {
- key: "checkCloseParenthesis",
- value: function checkCloseParenthesis() {
- var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- var token = this.getToken();
- if (this.lexerClass.CLOSE_PARENTHESIS !== token.type) {
- if (!attempt) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(')', token);
- } else {
- return false;
- }
- }
- return true;
- }
- }, {
- key: "checkEOS",
- value: function checkEOS() {
- var attempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- var eosToken = this.getToken();
- if (eosToken.type !== this.lexerClass.EOS) {
- if (!attempt) throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].eos_missing(eosToken);else return false;
- }
- return true;
- }
- }, {
- key: "checkFunctionDuplicate",
- value: function checkFunctionDuplicate(functionID, funcIDToken) {
- var id = functionID === null ? "$main" : functionID;
- var index = this.definedFuncsNameList.indexOf(id);
- if (index !== -1) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].duplicate_function(funcIDToken);
- }
- this.definedFuncsNameList.push(id);
- }
- }, {
- key: "checkVariableDuplicate",
- value: function checkVariableDuplicate(variableID, sourceInfo) {
- var index = this.getCurrentVariableStack().indexOf(variableID);
- if (index !== -1) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].duplicate_variable(sourceInfo);
- }
- this.getCurrentVariableStack().push(variableID);
- }
- }, {
- key: "consumeForSemiColon",
- value: function consumeForSemiColon() {
- var eosToken = this.getToken();
- if (eosToken.type === this.lexerClass.EOS && eosToken.text.match(';')) {
- this.pos++;
- return;
- }
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(';', eosToken);
- }
- }, {
- key: "parseGlobalVariables",
- value: function parseGlobalVariables() {
- var decl = this.parseMaybeConst();
- this.checkEOS();
- this.pos++;
- return decl;
- }
- /*
- * Checks if the next token is PR_CONST. It's only available
- * at global variables declaration level
- * @returns Declararion(const, type, id, initVal?)
- **/
- }, {
- key: "parseMaybeConst",
- value: function parseMaybeConst() {
- var constToken = this.getToken();
- if (constToken.type === this.lexerClass.RK_CONST) {
- this.pos++;
- var typeString = this.parseType();
- return this.parseDeclaration(typeString, true);
- } else if (this.isVariableType(constToken)) {
- var _typeString = this.parseType();
- return this.parseDeclaration(_typeString);
- } else {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_list([this.lexer.literalNames[this.lexerClass.RK_CONST]].concat(this.getTypeArray()), constToken);
- }
- }
- /*
- * Parses a declarion of the form: type --- id --- (= --- EAnd)?
- * @returns a list of Declararion(const, type, id, initVal?)
- **/
- }, {
- key: "parseDeclaration",
- value: function parseDeclaration(typeString) {
- var isConst = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var initial = null;
- var dim1 = null;
- var dim2 = null;
- var dimensions = 0;
- var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(this.getToken());
- var idString = this.parseID();
- this.checkVariableDuplicate(idString, sourceInfo); // Check for array or vector
- // ID[int/IDi?][int/IDj?]
- if (this.checkOpenBrace(true)) {
- this.pos += 1;
- this.consumeNewLines();
- dim1 = this.parseArrayDimension();
- this.consumeNewLines();
- this.checkCloseBrace();
- this.pos += 1;
- dimensions += 1;
- if (this.checkOpenBrace(true)) {
- this.pos += 1;
- this.consumeNewLines();
- dim2 = this.parseArrayDimension();
- this.consumeNewLines();
- this.checkCloseBrace();
- this.pos += 1;
- dimensions += 1;
- }
- return this.parseArrayDeclaration(typeString, isConst, idString, sourceInfo, dimensions, dim1, dim2);
- } else {
- var equalsToken = this.getToken();
- if (isConst && equalsToken.type !== this.lexerClass.EQUAL) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].const_not_init(sourceInfo);
- }
- if (equalsToken.type === this.lexerClass.EQUAL) {
- this.pos++;
- initial = this.parseExpressionOR();
- }
- var declaration = new _commands__WEBPACK_IMPORTED_MODULE_4__["Declaration"](idString, typeString, initial, isConst);
- declaration.sourceInfo = sourceInfo;
- var commaToken = this.getToken();
- if (commaToken.type === this.lexerClass.COMMA) {
- this.pos++;
- this.consumeNewLines();
- return [declaration].concat(this.parseDeclaration(typeString, isConst));
- } else {
- return [declaration];
- }
- }
- }
- }, {
- key: "parseArrayDeclaration",
- value: function parseArrayDeclaration(typeString, isConst, idString, sourceInfo, dimensions, dim1, dim2) {
- var equalsToken = this.getToken();
- var n_lines = dim1;
- var n_columns = dim2;
- var initial = null;
- var dim_is_id = false;
- if (dim1 instanceof _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"] || dim2 instanceof _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"]) {
- dim_is_id = true;
- if (dimensions > 1 && (dim1 == null || dim2 == null)) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_matrix_id_dimension(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalsToken));
- }
- }
- if (isConst && equalsToken.type !== this.lexerClass.EQUAL) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].const_not_init(sourceInfo);
- }
- if (equalsToken.type === this.lexerClass.EQUAL) {
- if (dim_is_id) {
- if (dimensions == 1) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_vector_init(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalsToken));
- } else {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_matrix_init(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalsToken));
- }
- }
- this.pos += 1;
- initial = this.parseArrayLiteral(typeString);
- }
- if (initial == null && dim1 == null) {
- if (dimensions > 1) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].cannot_infer_matrix_line(idString, sourceInfo);
- }
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].cannot_infer_vector_size(idString, sourceInfo);
- }
- if (dimensions > 1) {
- if (initial == null && dim2 == null) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].cannot_infer_matrix_column(idString, sourceInfo);
- }
- }
- if (dimensions === 1 && initial != null && !initial.isVector) {
- var expString = initial.toString();
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].matrix_to_vector_literal_attr(idString, expString, initial.sourceInfo);
- } else if (dimensions > 1 && initial != null && initial.isVector) {
- var _expString = initial.toString();
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].vector_to_matrix_literal_attr(idString, _expString, initial.sourceInfo);
- }
- if (dim1 == null) {
- n_lines = new _expressions__WEBPACK_IMPORTED_MODULE_3__["IntLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toInt"](initial.lines));
- n_lines.sourceInfo = sourceInfo;
- }
- if (dimensions > 1) {
- if (dim2 == null) {
- n_columns = new _expressions__WEBPACK_IMPORTED_MODULE_3__["IntLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toInt"](initial.columns));
- n_columns.sourceInfo = sourceInfo;
- }
- }
- var declaration = new _commands__WEBPACK_IMPORTED_MODULE_4__["ArrayDeclaration"](idString, new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](typeString, dimensions), n_lines, n_columns, initial, isConst);
- declaration.sourceInfo = sourceInfo;
- var commaToken = this.getToken();
- if (commaToken.type === this.lexerClass.COMMA) {
- this.pos++;
- this.consumeNewLines();
- return [declaration].concat(this.parseDeclaration(typeString, isConst));
- } else {
- return [declaration];
- }
- }
- }, {
- key: "consumeNewLines",
- value: function consumeNewLines() {
- var token = this.getToken();
- while (token.type === this.lexerClass.EOS && token.text.match('[\r\n]+')) {
- this.pos++;
- token = this.getToken();
- }
- }
- }, {
- key: "isVariableType",
- value: function isVariableType(token) {
- return this.variableTypes.find(function (v) {
- return v === token.type;
- });
- }
- /*
- * Reads the next token of the stream to check if it is a Integer or an ID.
- * @returns Integer | ID
- **/
- }, {
- key: "parseArrayDimension",
- value: function parseArrayDimension() {
- var dimToken = this.getToken();
- if (dimToken.type === this.lexerClass.INTEGER) {
- //parse as int literal
- this.pos++;
- return this.getIntLiteral(dimToken);
- } else if (dimToken.type === this.lexerClass.ID) {
- //parse as variable
- this.pos++;
- return this.parseVariable(dimToken);
- } else if (dimToken.type === this.lexerClass.CLOSE_BRACE) {
- return null;
- } else {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_array_dimension(this.lexer.literalNames[this.lexerClass.RK_INTEGER], dimToken);
- }
- }
- /*
- * Returns an object {type: 'int', value: value}.
- * It checks for binary and hexadecimal integers.
- * @returns object with fields type and value
- **/
- }, {
- key: "getIntLiteral",
- value: function getIntLiteral(token) {
- var text = token.text;
- var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
- var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["IntLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toInt"](text));
- exp.sourceInfo = sourceInfo;
- return exp;
- }
- }, {
- key: "getRealLiteral",
- value: function getRealLiteral(token) {
- var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
- var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["RealLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toReal"](token.text));
- exp.sourceInfo = sourceInfo;
- return exp;
- }
- }, {
- key: "getStringLiteral",
- value: function getStringLiteral(token) {
- var text = token.text;
- var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
- var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["StringLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toString"](text));
- exp.sourceInfo = sourceInfo;
- return exp;
- }
- }, {
- key: "getCharLiteral",
- value: function getCharLiteral(token) {
- var text = token.text;
- var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["CharLiteral"](_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toChar"](text));
- exp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
- return exp;
- }
- }, {
- key: "getBoolLiteral",
- value: function getBoolLiteral(token) {
- var val = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_6__["toBool"](token.text);
- var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["BoolLiteral"](val);
- exp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
- return exp;
- }
- }, {
- key: "parseArrayLiteral",
- value: function parseArrayLiteral(typeString) {
- var openCurly = this.checkOpenCurly(true);
- if (!openCurly) {
- var invalid_token = this.getToken();
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].array_init_not_literal(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(invalid_token));
- }
- var beginArray = this.getToken();
- if (this.parsingArrayDimension >= 2) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].array_exceeds_2d(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(beginArray));
- }
- this.pos += 1;
- this.parsingArrayDimension += 1;
- this.consumeNewLines();
- var data = null;
- var maybeCurlyOpen = this.checkOpenCurly(true);
- if (maybeCurlyOpen) {
- // This is potentially a list of vectors
- data = this.parseVectorList(typeString);
- } else {
- data = this.parseExpressionList();
- }
- this.consumeNewLines();
- this.checkCloseCurly();
- var endArray = this.getToken();
- this.pos += 1;
- this.parsingArrayDimension -= 1;
- var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(beginArray, endArray);
- var dataDim = 1;
- if (data[0] instanceof _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayLiteral"]) {
- dataDim += 1;
- } else if (data.length == 1) {
- console.log("Talvez uma variável seja uma melhor opção");
- }
- var type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](typeString, dataDim);
- var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayLiteral"](type, data);
- exp.sourceInfo = sourceInfo;
- return exp;
- }
- /**
- * Returns a list of ArrayLiterals. Helper function for parsing matrices
- */
- }, {
- key: "parseVectorList",
- value: function parseVectorList(typeString) {
- var list = [];
- var lastSize = null;
- for (;;) {
- this.checkOpenCurly();
- var beginArray = this.getToken();
- if (this.parsingArrayDimension >= 2) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].array_exceeds_2d(_sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(beginArray));
- }
- this.pos += 1;
- this.parsingArrayDimension += 1;
- this.consumeNewLines();
- var data = this.parseExpressionList();
- this.consumeNewLines();
- this.checkCloseCurly();
- var endArray = this.getToken();
- this.pos += 1;
- this.parsingArrayDimension -= 1;
- var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(beginArray, endArray);
- if (lastSize == null) {
- lastSize = data.length;
- } else if (lastSize !== data.length) {
- var expString = this.inputStream.getText(beginArray.start, endArray.stop);
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_matrix_literal_line(expString, sourceInfo);
- }
- var type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](typeString, 1);
- var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayLiteral"](type, data);
- exp.sourceInfo = sourceInfo;
- list.push(exp);
- var commaToken = this.getToken();
- if (commaToken.type !== this.lexerClass.COMMA) {
- break;
- }
- this.pos += 1;
- this.consumeNewLines();
- }
- if (list.length == 1) {
- console.log("Talvez um vetor seja uma melhor opção");
- }
- return list;
- }
- /*
- * Returns an object {type: 'variable', value: value}.
- * @returns object with fields type and value
- **/
- }, {
- key: "parseVariable",
- value: function parseVariable(token) {
- var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
- var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](token.text);
- exp.sourceInfo = sourceInfo;
- return exp;
- }
- /*
- * Returns an object representing a function. It has
- * four attributes: returnType, id, formalParams and block.
- * The block object has two attributes: declarations and commands
- **/
- }, {
- key: "parseFunction",
- value: function parseFunction() {
- this.pushScope(IVProgParser.FUNCTION);
- var formalParams = [];
- var token = this.getToken();
- if (token.type !== this.lexerClass.RK_FUNCTION) {
- //throw SyntaxError.createError(this.lexer.literalNames[this.lexerClass.PR_FUNCAO], token);
- return null;
- }
- this.pos++;
- var funType = this.parseType();
- var dimensions = 0;
- if (this.checkOpenBrace(true)) {
- this.pos++;
- this.checkCloseBrace();
- this.pos++;
- dimensions++;
- if (this.checkOpenBrace(true)) {
- this.pos++;
- this.checkCloseBrace();
- this.pos++;
- dimensions++;
- }
- }
- var funcIDToken = this.getToken();
- var functionID = this.parseID();
- this.checkFunctionDuplicate(functionID, funcIDToken);
- this.checkOpenParenthesis();
- this.pos++;
- this.consumeNewLines();
- if (!this.checkCloseParenthesis(true)) {
- formalParams = this.parseFormalParameters(); // formal parameters
- this.consumeNewLines();
- this.checkCloseParenthesis();
- this.pos++;
- } else {
- this.pos++;
- }
- this.consumeNewLines();
- var commandsBlock = this.parseCommandBlock();
- var returnType = funType;
- if (dimensions > 0) {
- returnType = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](funType, dimensions);
- }
- var func = new _commands__WEBPACK_IMPORTED_MODULE_4__["Function"](functionID, returnType, formalParams, commandsBlock);
- if (functionID === null && !func.isMain) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_main_return(_processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__["LanguageDefinedFunction"].getMainFunctionName(), this.lexer.literalNames[this.lexerClass.RK_VOID], token.line);
- } else if (func.isMain && formalParams.length !== 0) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].main_parameters();
- }
- this.popScope();
- return func;
- }
- /*
- * Parse the formal parameters of a function.
- * @returns a list of objects with the following attributes: type, id and dimensions.
- **/
- }, {
- key: "parseFormalParameters",
- value: function parseFormalParameters() {
- var list = [];
- for (;;) {
- var dimensions = 0;
- var reference = false;
- var typeString = this.parseType();
- var maybeIDToken = this.getToken();
- if (maybeIDToken.type === this.lexerClass.RK_REFERENCE) {
- reference = true;
- this.pos += 1;
- maybeIDToken = this.getToken();
- }
- var idString = this.parseID();
- this.checkVariableDuplicate(idString, maybeIDToken);
- if (this.checkOpenBrace(true)) {
- this.pos += 1;
- dimensions += 1;
- this.checkCloseBrace();
- this.pos += 1;
- if (this.checkOpenBrace(true)) {
- this.pos += 1;
- dimensions += 1;
- this.checkCloseBrace();
- this.pos += 1;
- }
- }
- var type = null;
- if (dimensions > 0) {
- type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](typeString, dimensions);
- } else {
- type = typeString;
- }
- var parameter = new _commands__WEBPACK_IMPORTED_MODULE_4__["FormalParameter"](type, idString, reference);
- parameter.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(maybeIDToken);
- list.push(parameter);
- var commaToken = this.getToken();
- if (commaToken.type !== this.lexerClass.COMMA) break;
- this.pos++;
- this.consumeNewLines();
- }
- return list;
- }
- }, {
- key: "parseID",
- value: function parseID() {
- var token = this.getToken();
- if (token.type !== this.lexerClass.ID) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].id_missing(token);
- }
- this.pos++;
- if (this.insideScope(IVProgParser.FUNCTION)) {
- if (token.text === _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__["LanguageDefinedFunction"].getMainFunctionName()) {
- return null;
- }
- }
- return token.text;
- }
- }, {
- key: "parseMaybeLibID",
- value: function parseMaybeLibID() {
- var token = this.getToken();
- if (token.type !== this.lexerClass.ID && token.type !== this.lexerClass.LIB_ID) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].id_missing(token);
- }
- this.pos++;
- return token.text;
- }
- }, {
- key: "parseType",
- value: function parseType() {
- var token = this.getToken();
- if (token.type === this.lexerClass.ID && this.insideScope(IVProgParser.FUNCTION)) {
- return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].VOID;
- } else if (token.type === this.lexerClass.RK_VOID && this.insideScope(IVProgParser.FUNCTION)) {
- this.pos++;
- return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].VOID;
- } else if (this.isVariableType(token)) {
- this.pos++;
- switch (token.type) {
- case this.lexerClass.RK_INTEGER:
- return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].INTEGER;
- case this.lexerClass.RK_BOOLEAN:
- return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].BOOLEAN;
- case this.lexerClass.RK_REAL:
- return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].REAL;
- case this.lexerClass.RK_STRING:
- return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].STRING;
- case this.lexerClass.RK_CHARACTER:
- return _typeSystem_types__WEBPACK_IMPORTED_MODULE_7__["Types"].CHAR;
- default:
- break;
- }
- }
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_type(this.getTypeArray(), token);
- }
- }, {
- key: "parseCommandBlock",
- value: function parseCommandBlock() {
- var optionalCurly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- var variablesDecl = [];
- var commands = [];
- var hasOpen = false;
- if (this.checkOpenCurly(optionalCurly)) {
- this.pos++;
- hasOpen = true;
- }
- this.consumeNewLines();
- var parsedCommand = false;
- for (;;) {
- var cmd = this.parseCommand();
- if (cmd === null) break;
- if (cmd !== -1) {
- if (cmd instanceof Array) {
- if (parsedCommand) {
- var lastToken = this.getToken(this.pos - 1);
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_var_declaration(lastToken);
- }
- variablesDecl = variablesDecl.concat(cmd);
- } else {
- parsedCommand = true;
- commands.push(cmd);
- }
- }
- }
- this.consumeNewLines();
- if (hasOpen) {
- this.checkCloseCurly();
- this.pos++;
- this.consumeNewLines();
- }
- return new _commands__WEBPACK_IMPORTED_MODULE_4__["CommandBlock"](variablesDecl, commands);
- }
- }, {
- key: "parseCommand",
- value: function parseCommand() {
- var token = this.getToken();
- if (this.isVariableType(token)) {
- if (!this.insideScope(IVProgParser.FUNCTION)) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_var_declaration(token);
- }
- this.pushScope(IVProgParser.BASE);
- var varType = this.parseType();
- this.popScope();
- var cmd = this.parseDeclaration(varType);
- this.checkEOS();
- this.pos++;
- return cmd;
- } else if (token.type === this.lexerClass.ID) {
- return this.parseIDCommand();
- } else if (token.type === this.lexerClass.LIB_ID) {
- return this.parseIDCommand();
- } else if (token.type === this.lexerClass.RK_RETURN) {
- return this.parseReturn();
- } else if (token.type === this.lexerClass.RK_WHILE || token.type === this.lexerClass.RK_WHILE_ALT) {
- return this.parseWhile();
- } else if (token.type === this.lexerClass.RK_FOR || token.type === this.lexerClass.RK_FOR_ALT) {
- return this.parseFor();
- } else if (token.type === this.lexerClass.RK_BREAK) {
- if (!this.insideScope(IVProgParser.BREAKABLE)) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_break_command(this.lexer.literalNames[this.lexerClass.RK_BREAK], token);
- }
- return this.parseBreak();
- } else if (token.type === this.lexerClass.RK_SWITCH) {
- return this.parseSwitchCase();
- } else if (token.type === this.lexerClass.RK_DO) {
- return this.parseRepeatUntil();
- } else if (token.type === this.lexerClass.RK_IF) {
- return this.parseIfThenElse();
- } else if (this.checkEOS(true)) {
- this.pos++;
- return -1;
- } else {
- return null;
- }
- }
- }, {
- key: "parseSwitchCase",
- value: function parseSwitchCase() {
- this.pushScope(IVProgParser.BREAKABLE);
- this.pos++;
- this.checkOpenParenthesis();
- this.pos++;
- this.consumeNewLines();
- var exp = this.parseExpressionOR();
- this.consumeNewLines();
- this.checkCloseParenthesis();
- this.pos++;
- this.consumeNewLines();
- this.checkOpenCurly();
- this.pos++;
- this.consumeNewLines();
- var casesList = this.parseCases();
- this.consumeNewLines();
- this.checkCloseCurly();
- this.pos++;
- this.consumeNewLines();
- this.popScope();
- return new _commands__WEBPACK_IMPORTED_MODULE_4__["Switch"](exp, casesList);
- }
- }, {
- key: "parseRepeatUntil",
- value: function parseRepeatUntil() {
- this.pos++;
- this.consumeNewLines();
- this.pushScope(IVProgParser.BREAKABLE);
- var commandsBlock = this.parseCommandBlock();
- this.consumeNewLines(); //Maybe not...
- var whileToken = this.getToken();
- if (whileToken.type !== this.lexerClass.RK_DO_UNTIL) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(this.lexer.literalNames[this.lexerClass.RK_DO_UNTIL], whileToken);
- }
- this.pos++;
- this.checkOpenParenthesis();
- this.pos++;
- this.consumeNewLines();
- var condition = this.parseExpressionOR();
- this.consumeNewLines();
- this.checkCloseParenthesis();
- this.pos++;
- this.checkEOS();
- this.popScope();
- return new _commands__WEBPACK_IMPORTED_MODULE_4__["RepeatUntil"](condition, commandsBlock);
- }
- }, {
- key: "parseIfThenElse",
- value: function parseIfThenElse() {
- if (this.insideScope(IVProgParser.BREAKABLE)) {
- this.pushScope(IVProgParser.BREAKABLE);
- } else {
- this.pushScope(IVProgParser.COMMAND);
- }
- var token = this.getToken();
- this.pos++;
- this.checkOpenParenthesis();
- this.pos++;
- this.consumeNewLines();
- var logicalExpression = this.parseExpressionOR();
- this.consumeNewLines();
- this.checkCloseParenthesis();
- this.pos++;
- this.consumeNewLines();
- var cmdBlocks = this.parseCommandBlock();
- var maybeElse = this.getToken();
- if (maybeElse.type === this.lexerClass.RK_ELSE) {
- this.pos++;
- this.consumeNewLines();
- var maybeIf = this.getToken();
- var elseBlock = null;
- if (this.checkOpenCurly(true)) {
- elseBlock = this.parseCommandBlock();
- } else if (maybeIf.type === this.lexerClass.RK_IF) {
- elseBlock = this.parseIfThenElse();
- } else {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_list([this.lexer.literalNames[this.lexerClass.RK_IF], '{'], maybeIf);
- }
- this.popScope();
- var _cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["IfThenElse"](logicalExpression, cmdBlocks, elseBlock);
- _cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
- return _cmd;
- }
- this.popScope();
- var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["IfThenElse"](logicalExpression, cmdBlocks, null);
- cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
- return cmd;
- }
- }, {
- key: "parseFor",
- value: function parseFor() {
- this.pushScope(IVProgParser.BREAKABLE);
- var for_token = this.getToken();
- this.pos += 1; // parse ID
- var id_token = this.getToken();
- var id = this.parseID();
- var for_id = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](id);
- for_id.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(id_token); // END parse ID
- var for_from = this.parseForParameters(this.lexerClass.RK_FOR_FROM);
- var for_to = this.parseForParameters(this.lexerClass.RK_FOR_TO);
- var maybePass = this.parseForParameters(this.lexerClass.RK_FOR_PASS);
- this.consumeNewLines();
- var commandsBlock = this.parseCommandBlock();
- this.popScope();
- var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["For"](for_id, for_from, for_to, maybePass, commandsBlock);
- cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(for_token);
- return cmd;
- }
- }, {
- key: "parseWhile",
- value: function parseWhile() {
- this.pushScope(IVProgParser.BREAKABLE);
- var token = this.getToken();
- this.pos++;
- this.checkOpenParenthesis();
- this.pos++;
- this.consumeNewLines();
- var logicalExpression = this.parseExpressionOR();
- this.consumeNewLines();
- this.checkCloseParenthesis();
- this.pos++;
- this.consumeNewLines();
- var cmdBlocks = this.parseCommandBlock();
- this.popScope();
- var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["While"](logicalExpression, cmdBlocks);
- cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
- return cmd;
- }
- }, {
- key: "parseBreak",
- value: function parseBreak() {
- this.pos++;
- this.checkEOS();
- this.pos++;
- return new _commands__WEBPACK_IMPORTED_MODULE_4__["Break"]();
- }
- }, {
- key: "parseReturn",
- value: function parseReturn() {
- this.pos++;
- var exp = null;
- if (!this.checkEOS(true)) {
- exp = this.parseExpressionOR();
- this.checkEOS();
- }
- this.pos++;
- return new _commands__WEBPACK_IMPORTED_MODULE_4__["Return"](exp);
- }
- }, {
- key: "parseIDCommand",
- value: function parseIDCommand() {
- var refToken = this.getToken();
- var isID = refToken.type === this.lexerClass.ID;
- var id = this.parseMaybeLibID();
- if (this.checkOpenBrace(true)) {
- this.pos++;
- var lineExpression = null;
- var columnExpression = null;
- this.consumeNewLines();
- lineExpression = this.parseExpression();
- this.consumeNewLines();
- this.checkCloseBrace();
- this.pos++;
- if (this.checkOpenBrace(true)) {
- this.pos++;
- this.consumeNewLines();
- columnExpression = this.parseExpression();
- this.consumeNewLines();
- this.checkCloseBrace();
- this.pos++;
- }
- var equalToken = this.getToken();
- if (equalToken.type !== this.lexerClass.EQUAL) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one('=', equalToken);
- }
- this.pos++;
- var exp = this.parseExpressionOR();
- this.checkEOS();
- this.pos++;
- var cmd = new _commands__WEBPACK_IMPORTED_MODULE_4__["ArrayIndexAssign"](id, lineExpression, columnExpression, exp);
- cmd.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalToken);
- return cmd;
- }
- var equalOrParenthesis = this.getToken();
- if (isID && equalOrParenthesis.type === this.lexerClass.EQUAL) {
- this.pos++;
- var _exp = this.parseExpressionOR();
- this.checkEOS();
- this.pos++;
- var _cmd2 = new _commands__WEBPACK_IMPORTED_MODULE_4__["Assign"](id, _exp);
- _cmd2.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(equalOrParenthesis);
- return _cmd2;
- } else if (equalOrParenthesis.type === this.lexerClass.OPEN_PARENTHESIS) {
- var funcCall = this.parseFunctionCallCommand(id);
- this.checkEOS();
- this.pos++;
- return funcCall;
- } else if (isID) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_list(['=', '('], equalOrParenthesis);
- } else {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_id_format(refToken);
- }
- }
- }, {
- key: "parseForParameters",
- value: function parseForParameters(keyword_code) {
- if (keyword_code === this.lexerClass.RK_FOR_PASS) {
- if (this.checkOpenCurly(true)) {
- return null;
- }
- }
- var from_token = this.getToken();
- if (from_token.type !== keyword_code) {
- // TODO better error message
- var keyword = this.lexer.literalNames[keyword_code];
- throw new Error("Error de sintaxe no comando repita_para: esperava-se " + keyword + " mas encontrou " + from_token.text);
- }
- this.pos += 1;
- var int_or_id = this.getToken();
- var is_unary_op = false;
- var op = null;
- if (int_or_id.type === this.lexerClass.SUM_OP) {
- is_unary_op = true;
- op = int_or_id.text;
- this.pos += 1;
- int_or_id = this.getToken();
- }
- var for_from = null;
- if (int_or_id.type === this.lexerClass.ID) {
- for_from = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](this.parseID());
- for_from.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(int_or_id);
- } else if (int_or_id.type === this.lexerClass.INTEGER) {
- this.pos += 1;
- for_from = this.getIntLiteral(int_or_id);
- }
- if (for_from == null) {
- // TODO better error message
- var _keyword = this.lexer.literalNames[keyword_code];
- 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.");
- }
- if (is_unary_op) {
- for_from = new _expressions__WEBPACK_IMPORTED_MODULE_3__["UnaryApp"](Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(op), for_from);
- }
- return for_from;
- }
- }, {
- key: "parseCases",
- value: function parseCases() {
- var token = this.getToken();
- if (token.type !== this.lexerClass.RK_CASE) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(this.lexer.literalNames[this.lexerClass.RK_CASE], token);
- }
- this.pos++;
- var nextToken = this.getToken();
- if (nextToken.type === this.lexerClass.RK_DEFAULT) {
- this.pos++;
- var colonToken = this.getToken();
- if (colonToken.type !== this.lexerClass.COLON) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(':', colonToken);
- }
- this.pos++;
- this.consumeNewLines();
- var block = this.parseCommandBlock(true);
- var defaultCase = new _commands__WEBPACK_IMPORTED_MODULE_4__["Case"](null);
- defaultCase.setCommands(block.commands);
- return [defaultCase];
- } else {
- var exp = this.parseExpressionOR();
- var _colonToken = this.getToken();
- if (_colonToken.type !== this.lexerClass.COLON) {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].token_missing_one(':', _colonToken);
- }
- this.pos++;
- this.consumeNewLines();
- var _block = this.parseCommandBlock(true);
- var aCase = new _commands__WEBPACK_IMPORTED_MODULE_4__["Case"](exp);
- aCase.setCommands(_block.commands);
- var caseToken = this.getToken();
- if (caseToken.type === this.lexerClass.RK_CASE) {
- return [aCase].concat(this.parseCases());
- } else {
- return [aCase];
- }
- }
- }
- /*
- * Parses an Expression following the structure:
- *
- * EOR => EAnd ( 'or' EOR)? #expression and
- *
- * EOR => ENot ('and' EOR)? #expression or
- *
- * ENot => 'not'? ER #expression not
- *
- * ER => E ((>=, <=, ==, >, <) E)? #expression relational
- *
- * E => factor ((+, -) E)? #expression
- *
- * factor=> term ((*, /, %) factor)?
- *
- * term => literal || arrayAccess || FuncCall || ID || '('EAnd')'
- **/
- }, {
- key: "parseExpressionOR",
- value: function parseExpressionOR() {
- var exp1 = this.parseExpressionAND();
- while (this.getToken().type === this.lexerClass.OR_OPERATOR) {
- var opToken = this.getToken();
- this.pos++;
- var or = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])('or');
- this.consumeNewLines();
- var exp2 = this.parseExpressionAND();
- var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](or, exp1, exp2);
- finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(opToken);
- exp1 = finalExp;
- }
- return exp1;
- }
- }, {
- key: "parseExpressionAND",
- value: function parseExpressionAND() {
- var exp1 = this.parseExpressionNot();
- while (this.getToken().type === this.lexerClass.AND_OPERATOR) {
- var opToken = this.getToken();
- this.pos++;
- var and = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])('and');
- this.consumeNewLines();
- var exp2 = this.parseExpressionNot();
- var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](and, exp1, exp2);
- finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(opToken);
- exp1 = finalExp;
- }
- return exp1;
- }
- }, {
- key: "parseExpressionNot",
- value: function parseExpressionNot() {
- var maybeNotToken = this.getToken();
- if (maybeNotToken.type === this.lexerClass.NOT_OPERATOR) {
- var opToken = this.getToken();
- this.pos++;
- var not = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])('not');
- var exp1 = this.parseExpressionRel();
- var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["UnaryApp"](not, exp1);
- finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(opToken);
- return finalExp;
- } else {
- return this.parseExpressionRel();
- }
- }
- }, {
- key: "parseExpressionRel",
- value: function parseExpressionRel() {
- var exp1 = this.parseExpression();
- while (this.getToken().type === this.lexerClass.RELATIONAL_OPERATOR) {
- var relToken = this.getToken();
- this.pos++;
- var rel = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(relToken.text);
- var exp2 = this.parseExpression();
- var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](rel, exp1, exp2);
- finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(relToken);
- exp1 = finalExp;
- }
- return exp1;
- }
- }, {
- key: "parseExpression",
- value: function parseExpression() {
- var factor = this.parseFactor();
- while (this.getToken().type === this.lexerClass.SUM_OP) {
- var sumOpToken = this.getToken();
- this.pos++;
- var op = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(sumOpToken.text);
- var factor2 = this.parseFactor();
- var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](op, factor, factor2);
- finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(sumOpToken);
- factor = finalExp;
- }
- return factor;
- }
- }, {
- key: "parseFactor",
- value: function parseFactor() {
- var term = this.parseTerm();
- while (this.getToken().type === this.lexerClass.MULTI_OP) {
- var multOpToken = this.getToken();
- this.pos++;
- var op = Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(multOpToken.text);
- var term2 = this.parseTerm();
- var finalExp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["InfixApp"](op, term, term2);
- finalExp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(multOpToken);
- term = finalExp;
- }
- return term;
- }
- }, {
- key: "parseTerm",
- value: function parseTerm() {
- var token = this.getToken();
- var sourceInfo = null;
- var exp = null;
- switch (token.type) {
- case this.lexerClass.SUM_OP:
- this.pos++;
- sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(token);
- exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["UnaryApp"](Object(_operators__WEBPACK_IMPORTED_MODULE_10__["convertFromString"])(token.text), this.parseTerm());
- exp.sourceInfo = sourceInfo;
- return exp;
- case this.lexerClass.INTEGER:
- this.pos++;
- return this.getIntLiteral(token);
- case this.lexerClass.REAL:
- this.pos++;
- return this.getRealLiteral(token);
- case this.lexerClass.STRING:
- this.pos++;
- return this.getStringLiteral(token);
- case this.lexerClass.CHARACTER:
- this.pos++;
- return this.getCharLiteral(token);
- case this.lexerClass.RK_TRUE:
- case this.lexerClass.RK_FALSE:
- this.pos++;
- return this.getBoolLiteral(token);
- case this.lexerClass.OPEN_CURLY:
- // No more annonymous array
- // return this.parseArrayLiteral();
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].annonymous_array_literal(token);
- case this.lexerClass.ID:
- case this.lexerClass.LIB_ID:
- return this.parseIDTerm();
- case this.lexerClass.OPEN_PARENTHESIS:
- return this.parseParenthesisExp();
- default:
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_terminal(token);
- }
- }
- }, {
- key: "parseIDTerm",
- value: function parseIDTerm() {
- var tokenA = this.getToken();
- var id = this.parseMaybeLibID();
- var isID = tokenA.type === this.lexerClass.ID;
- if (isID && this.checkOpenBrace(true)) {
- var tokenB = null;
- this.pos++;
- var firstIndex = this.parseExpression();
- var secondIndex = null;
- this.consumeNewLines();
- this.checkCloseBrace();
- tokenB = this.getToken();
- this.pos++;
- if (this.checkOpenBrace(true)) {
- this.pos++;
- secondIndex = this.parseExpression();
- this.consumeNewLines();
- this.checkCloseBrace();
- tokenB = this.getToken();
- this.pos++;
- }
- var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
- var exp = new _expressions__WEBPACK_IMPORTED_MODULE_3__["ArrayAccess"](id, firstIndex, secondIndex);
- exp.sourceInfo = sourceInfo;
- return exp;
- } else if (this.checkOpenParenthesis(true)) {
- return this.parseFunctionCallExpression(id);
- } else if (isID) {
- var _sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfo(tokenA);
- var _exp2 = new _expressions__WEBPACK_IMPORTED_MODULE_3__["VariableLiteral"](id);
- _exp2.sourceInfo = _sourceInfo;
- return _exp2;
- } else {
- throw _error_syntaxErrorFactory__WEBPACK_IMPORTED_MODULE_11__["SyntaxErrorFactory"].invalid_id_format(tokenA);
- }
- }
- }, {
- key: "getFunctionName",
- value: function getFunctionName(id) {
- var name = _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__["LanguageDefinedFunction"].getInternalName(id);
- if (name === null) {
- if (id === _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_12__["LanguageDefinedFunction"].getMainFunctionName()) {
- return null;
- }
- return id;
- } else {
- return name;
- }
- }
- }, {
- key: "parseFunctionCallExpression",
- value: function parseFunctionCallExpression(id) {
- var tokenA = this.getToken(this.pos - 1);
- var actualParameters = this.parseActualParameters();
- var tokenB = this.getToken(this.pos - 1);
- var funcName = this.getFunctionName(id);
- var sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
- var cmd = new _expressions__WEBPACK_IMPORTED_MODULE_3__["FunctionCall"](funcName, actualParameters);
- cmd.sourceInfo = sourceInfo;
- return cmd;
- }
- }, {
- key: "parseFunctionCallCommand",
- value: function parseFunctionCallCommand(id) {
- return this.parseFunctionCallExpression(id);
- }
- }, {
- key: "parseParenthesisExp",
- value: function parseParenthesisExp() {
- this.checkOpenParenthesis();
- var tokenA = this.getToken();
- this.pos += 1;
- this.consumeNewLines();
- var exp = this.parseExpressionOR();
- this.consumeNewLines();
- this.checkCloseParenthesis();
- var tokenB = this.getToken();
- this.pos += 1;
- exp.sourceInfo = _sourceInfo__WEBPACK_IMPORTED_MODULE_9__["SourceInfo"].createSourceInfoFromList(tokenA, tokenB);
- exp.parenthesis = true;
- return exp;
- }
- }, {
- key: "parseActualParameters",
- value: function parseActualParameters() {
- this.checkOpenParenthesis();
- this.pos++;
- if (this.checkCloseParenthesis(true)) {
- this.pos++;
- return [];
- }
- this.consumeNewLines();
- var list = this.parseExpressionList();
- this.consumeNewLines();
- this.checkCloseParenthesis();
- this.pos++;
- return list;
- }
- }, {
- key: "parseExpressionList",
- value: function parseExpressionList() {
- var list = [];
- for (;;) {
- var exp = this.parseExpressionOR();
- list.push(exp);
- var maybeToken = this.getToken();
- if (maybeToken.type !== this.lexerClass.COMMA) {
- break;
- } else {
- this.pos++;
- this.consumeNewLines();
- }
- }
- return list;
- }
- }, {
- key: "getTypeArray",
- value: function getTypeArray() {
- var _this = this;
- var types = this.insideScope(IVProgParser.FUNCTION) ? this.functionTypes : this.variableTypes;
- return types.map(function (x) {
- return _this.lexer.literalNames[x];
- });
- }
- }]);
- return IVProgParser;
- }();
- /***/ }),
- /***/ "./js/ast/operators.ts":
- /*!*****************************!*\
- !*** ./js/ast/operators.ts ***!
- \*****************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.convertFromString = exports.Operators = void 0;
- exports.Operators = Object.freeze({
- ADD: { ord: 0, value: "+" },
- SUB: { ord: 1, value: "-" },
- MULT: { ord: 2, value: '*' },
- DIV: { ord: 3, value: '/' },
- MOD: { ord: 4, value: '%' },
- GT: { ord: 5, value: '>' },
- GE: { ord: 6, value: '>=' },
- LT: { ord: 7, value: '<' },
- LE: { ord: 8, value: '<=' },
- EQ: { ord: 9, value: '==' },
- NEQ: { ord: 10, value: '!=' },
- AND: { ord: 11, value: 'and' },
- OR: { ord: 12, value: 'or' },
- NOT: { ord: 13, value: 'not' }
- });
- function convertFromString(op) {
- switch (op) {
- case '+': return exports.Operators.ADD;
- case '-': return exports.Operators.SUB;
- case '*': return exports.Operators.MULT;
- case '/': return exports.Operators.DIV;
- case '%': return exports.Operators.MOD;
- case '>': return exports.Operators.GT;
- case '>=': return exports.Operators.GE;
- case '<': return exports.Operators.LT;
- case '<=': return exports.Operators.LE;
- case '==': return exports.Operators.EQ;
- case '!=': return exports.Operators.NEQ;
- case 'and': return exports.Operators.AND;
- case 'or': return exports.Operators.OR;
- case 'not': return exports.Operators.NOT;
- }
- return null;
- }
- exports.convertFromString = convertFromString;
- /***/ }),
- /***/ "./js/ast/sourceInfo.js":
- /*!******************************!*\
- !*** ./js/ast/sourceInfo.js ***!
- \******************************/
- /*! exports provided: SourceInfo */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SourceInfo", function() { return SourceInfo; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- var SourceInfo = /*#__PURE__*/function () {
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SourceInfo, null, [{
- key: "createSourceInfo",
- value: function createSourceInfo(token) {
- return new SourceInfo(token.line, token.column, token.text, token.text.length);
- }
- }, {
- key: "createSourceInfoFromList",
- value: function createSourceInfoFromList(tokenA, tokenB) {
- var line = tokenA.line;
- 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
- // No idea why...
- var size = tokenB.tokenIndex + 1 - tokenA.tokenIndex;
- return new SourceInfo(line, column, "", size);
- }
- }]);
- function SourceInfo(line, column, text, size) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SourceInfo);
- this.line = line;
- this.column = column;
- this.text = text;
- this.size = size;
- }
- return SourceInfo;
- }();
- /***/ }),
- /***/ "./js/io/domConsole.js":
- /*!*****************************!*\
- !*** ./js/io/domConsole.js ***!
- \*****************************/
- /*! exports provided: DOMConsole */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOMConsole", function() { return DOMConsole; });
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
- /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../util/config */ "./js/util/config.ts");
- /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_6__);
- var DOMConsole = /*#__PURE__*/function () {
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(DOMConsole, null, [{
- key: "BASH_TEMPLATE",
- get: function get() {
- 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>";
- }
- }, {
- key: "INPUT_CARET_TEMPLATE",
- get: function get() {
- return "\n <div id=\"cmd\">\n <span></span>\n <div id=\"cursor\"></div>\n </div>";
- }
- }, {
- key: "USER",
- get: function get() {
- return 0;
- }
- }, {
- key: "INFO",
- get: function get() {
- return 1;
- }
- }, {
- key: "ERR",
- get: function get() {
- return 2;
- }
- }, {
- key: "INPUT",
- get: function get() {
- return 3;
- }
- }]);
- function DOMConsole(elementID) {
- var disableMarginTop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, DOMConsole);
- this.disableMarginTop = disableMarginTop;
- this.input = null;
- this.cursorInterval = null;
- this.idleInterval = null;
- this.inputDiv = null;
- this.inputCMD = null;
- this.inputSpan = null;
- this.cursorRef = null;
- this.needInput = false;
- this.clearBtn = null;
- this.hideBtn = null;
- this.showBtn = null;
- this.termDiv = null;
- this.anyKey = false;
- var actualID = elementID;
- if (elementID[0] === "#") {
- actualID = elementID.substring(1);
- }
- this.parent = document.getElementById(actualID);
- this.setup();
- this.inputListeners = [];
- this.hideInput();
- this.pending_writes = [];
- this.last_clear = -1;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(DOMConsole, [{
- key: "setup",
- value: function setup() {
- this._setupDom();
- this._setupEvents();
- }
- }, {
- key: "_setupEvents",
- value: function _setupEvents() {
- this.input.addEventListener("keydown", this.registerInput.bind(this));
- this.clearBtn.addEventListener("click", this.clearBtnClick.bind(this));
- this.hideBtn.addEventListener("click", this.hideBtnClick.bind(this));
- this.showBtn.addEventListener("click", this.showBtnClick.bind(this));
- }
- }, {
- key: "registerInput",
- value: function registerInput(event) {
- if (!this.needInput) {
- return;
- }
- var keyCode = event.which;
- if (keyCode === 13 || this.anyKey) {
- if (this.idleInterval != null) {
- clearInterval(this.idleInterval);
- this.idleInterval = null;
- }
- var text = this.input.value;
- text = text.replace("[\n\r]+", "");
- this.notifyListeners(text);
- this._appendUserInput(text);
- this.input.value = "";
- this.inputSpan.innerHTML = "";
- this.currentLine = null;
- }
- }
- }, {
- key: "_setupDom",
- value: function _setupDom() {
- var bashNode = document.createElement("div");
- bashNode.classList.add("bash");
- bashNode.innerHTML = DOMConsole.BASH_TEMPLATE;
- this.termDiv = bashNode.querySelector("#ivprog-term");
- this.termDiv.classList.add("ivprog-term-div");
- this.inputDiv = document.createElement("div");
- this.inputDiv.id = "ivprog-terminal-inputdiv";
- this.inputDiv.innerHTML = DOMConsole.INPUT_CARET_TEMPLATE;
- this.input = document.createElement("input");
- this.input.setAttribute("name", "command");
- this.input.setAttribute("value", "");
- this.input.setAttribute("type", "text");
- this.inputDiv.append(this.input);
- this.termDiv.append(this.inputDiv);
- bashNode.append(this.termDiv);
- this.parent.append(bashNode);
- this.inputCMD = this.inputDiv.querySelector("#cmd");
- this.cursorRef = this.inputCMD.querySelector("#cursor");
- this.inputSpan = this.inputCMD.querySelector("span");
- this.clearBtn = bashNode.querySelector("#ivprog-console-clearbtn");
- this.hideBtn = bashNode.querySelector("#ivprog-console-hidebtn");
- this.showBtn = bashNode.querySelector("#ivprog-console-showbtn");
- this._setupCursor(); //Jquery tooltips....
- window.$(this.clearBtn).popup({
- content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI("tooltip_terminal_clear")
- });
- window.$(this.showBtn).popup({
- content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI("tooltip_terminal_show")
- });
- window.$(this.hideBtn).popup({
- content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI("tooltip_terminal_hide")
- });
- }
- }, {
- key: "_setupCursor",
- value: function _setupCursor() {
- this.inputCMD.addEventListener("click", this.blinkCaretAndFocus.bind(this)); //this.inputCMD.click();
- this.input.addEventListener("keyup", this.updateSpanText.bind(this));
- this.input.addEventListener("blur", this.stopBlinkCaret.bind(this));
- }
- }, {
- key: "blinkCaretAndFocus",
- value: function blinkCaretAndFocus() {
- var _this = this;
- if (this.cursorInterval != null) {
- return;
- }
- this.input.focus();
- this.cursorInterval = window.setInterval(function () {
- if (_this.cursorRef.style.visibility === "visible") {
- _this.cursorRef.style.visibility = "hidden";
- } else {
- _this.cursorRef.style.visibility = "visible";
- }
- }, 500);
- }
- }, {
- key: "updateSpanText",
- value: function updateSpanText() {
- this.inputSpan.innerHTML = this.input.value;
- if (this.idleInterval != null) window.clearInterval(this.idleInterval);
- this.scheduleNotify();
- }
- }, {
- key: "stopBlinkCaret",
- value: function stopBlinkCaret() {
- clearInterval(this.cursorInterval);
- this.cursorInterval = null;
- this.cursorRef.style.visibility = "visible";
- }
- }, {
- key: "notifyListeners",
- value: function notifyListeners(text) {
- this.inputListeners.forEach(function (resolve) {
- return resolve(text);
- });
- this.inputListeners.splice(0, this.inputListeners.length);
- this.hideInput();
- this.anyKey = false;
- }
- }, {
- key: "writeRawHTML",
- value: function writeRawHTML(text, channel) {
- this._appendTextLn(text, channel, false);
- }
- }, {
- key: "write",
- value: function write(text) {
- var newLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- this._appendText(text, DOMConsole.USER, newLine);
- }
- }, {
- key: "info",
- value: function info(text) {
- this._appendTextLn(text, DOMConsole.INFO);
- }
- }, {
- key: "err",
- value: function err(text) {
- this._appendTextLn(text, DOMConsole.ERR);
- }
- }, {
- key: "_appendText",
- value: function () {
- var _appendText2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(text, type) {
- var newLine,
- write_time,
- divClass,
- textDiv,
- _args = arguments;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- newLine = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
- // console.debug("Caling appendText");
- write_time = Date.now();
- this.pending_writes.push(0);
- _context.next = 5;
- return _util_utils__WEBPACK_IMPORTED_MODULE_5__["sleep"](5);
- case 5:
- this.pending_writes.pop();
- if (!(this.last_clear >= write_time)) {
- _context.next = 8;
- break;
- }
- return _context.abrupt("return");
- case 8:
- if (this.currentLine == null) {
- divClass = this.getClassForType(type);
- textDiv = document.createElement("div");
- textDiv.classList.add(divClass);
- this.termDiv.insertBefore(textDiv, this.inputDiv);
- this.currentLine = textDiv;
- }
- this.currentLine.innerHTML += this.getOutputText(text);
- if (newLine) {
- // console.debug("append newline");
- this.currentLine = null;
- }
- this.scrollTerm();
- case 12:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function _appendText(_x, _x2) {
- return _appendText2.apply(this, arguments);
- }
- return _appendText;
- }()
- }, {
- key: "_appendTextLn",
- value: function () {
- var _appendTextLn2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2(text, type) {
- var filter,
- write_time,
- divClass,
- textDiv,
- _args2 = arguments;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- filter = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : true;
- write_time = Date.now();
- this.pending_writes.push(0);
- _context2.next = 5;
- return _util_utils__WEBPACK_IMPORTED_MODULE_5__["sleep"](5);
- case 5:
- this.pending_writes.pop();
- if (!(this.last_clear >= write_time)) {
- _context2.next = 8;
- break;
- }
- return _context2.abrupt("return");
- case 8:
- divClass = this.getClassForType(type);
- textDiv = document.createElement("div");
- textDiv.classList.add(divClass);
- if (filter) textDiv.innerHTML = this.getOutputText(text);else textDiv.innerHTML = "<span>".concat(text, "</span>");
- if (this.currentLine != null && this.currentLine.innerHTML.length === 0) {
- this.termDiv.removeChild(this.currentLine);
- }
- this.termDiv.insertBefore(textDiv, this.inputDiv);
- this.currentLine = null;
- this.scrollTerm();
- case 16:
- case "end":
- return _context2.stop();
- }
- }
- }, _callee2, this);
- }));
- function _appendTextLn(_x3, _x4) {
- return _appendTextLn2.apply(this, arguments);
- }
- return _appendTextLn;
- }()
- }, {
- key: "_appendUserInput",
- value: function () {
- var _appendUserInput2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee3(text) {
- var write_time, divClass, textDiv;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- write_time = Date.now();
- this.pending_writes.push(0);
- _context3.next = 4;
- return _util_utils__WEBPACK_IMPORTED_MODULE_5__["sleep"](5);
- case 4:
- this.pending_writes.pop();
- if (!(this.last_clear >= write_time)) {
- _context3.next = 7;
- break;
- }
- return _context3.abrupt("return");
- case 7:
- divClass = this.getClassForType(DOMConsole.INPUT);
- textDiv = document.createElement("div");
- textDiv.innerHTML = this.getUserInputText(text);
- textDiv.classList.add(divClass);
- this.termDiv.insertBefore(textDiv, this.inputDiv);
- this.currentLine = null;
- this.scrollTerm();
- case 14:
- case "end":
- return _context3.stop();
- }
- }
- }, _callee3, this);
- }));
- function _appendUserInput(_x5) {
- return _appendUserInput2.apply(this, arguments);
- }
- return _appendUserInput;
- }()
- }, {
- key: "getOutputText",
- value: function getOutputText(text) {
- text = text.replace(/\s/g, " ");
- return "<span>".concat(text, "</span>");
- }
- }, {
- key: "getUserInputText",
- value: function getUserInputText(text) {
- if (text.trim().length == 0) {
- text = " ";
- }
- return "<i class=\"icon keyboard outline\" style=\"float:left\"></i><span>".concat(text, "</span>");
- }
- }, {
- key: "scrollTerm",
- value: function scrollTerm() {
- //scrollIt(this.inputDiv.previousSibling,200);
- this.termDiv.scrollTop = this.termDiv.scrollHeight;
- }
- }, {
- key: "focus",
- value: function focus() {
- this.termDiv.style.display = "block"; // Is in draggable mode?
- if (!this.disableMarginTop && this.parent.style.top.length == 0) {
- this.parent.style.marginTop = "-160px";
- }
- if (this.needInput) {
- this.showInput();
- this.scheduleNotify();
- }
- if (!_util_utils__WEBPACK_IMPORTED_MODULE_5__["isElementInViewport"](this.termDiv)) this.termDiv.scrollIntoView(false);
- this.scrollTerm();
- }
- }, {
- key: "hide",
- value: function hide() {
- if (this.needInput) {
- clearInterval(this.idleInterval);
- this.hideInput();
- this.needInput = true;
- } // Is in draggable mode?
- if (!this.disableMarginTop && this.parent.style.top.length == 0) {
- this.parent.style.marginTop = "0";
- }
- this.termDiv.style.display = "none";
- }
- }, {
- key: "getClassForType",
- value: function getClassForType(type) {
- switch (type) {
- case DOMConsole.INPUT:
- return "ivprog-term-userInput";
- case DOMConsole.USER:
- return "ivprog-term-userText";
- case DOMConsole.INFO:
- return "ivprog-term-info";
- case DOMConsole.ERR:
- return "ivprog-term-error";
- }
- }
- }, {
- key: "dispose",
- value: function dispose() {
- this.input.removeEventListener("keyup", this.updateSpanText.bind(this));
- this.input.removeEventListener("blur", this.stopBlinkCaret.bind(this));
- this.input.removeEventListener("keydown", this.registerInput.bind(this));
- this.inputCMD.removeEventListener("click", this.blinkCaretAndFocus.bind(this));
- this.clearBtn.removeEventListener("click", this.clearBtnClick.bind(this));
- this.hideBtn.removeEventListener("click", this.hideBtnClick.bind(this));
- this.showBtn.removeEventListener("click", this.showBtnClick.bind(this));
- this.input = null;
- this.inputCMD = null;
- this.inputDiv = null;
- this.termDiv = null;
- this.inputSpan = null;
- this.cursorRef = null;
- this.clearBtn = null;
- this.hideBtn = null;
- this.showBtn = null;
- this.currentLine = null;
- var cNode = this.parent.cloneNode(false);
- this.parent.parentNode.replaceChild(cNode, this.parent);
- if (this.cursorInterval != null) {
- clearInterval(this.cursorInterval);
- }
- if (this.idleInterval != null) {
- clearInterval(this.idleInterval);
- }
- }
- }, {
- key: "showInput",
- value: function showInput() {
- this.needInput = true;
- this.inputDiv.style.display = "block";
- this.inputCMD.click(); //this.inputCMD.scrollIntoView();
- this.scrollTerm();
- }
- }, {
- key: "hideInput",
- value: function hideInput() {
- this.needInput = false;
- this.inputDiv.style.display = " none";
- clearInterval(this.cursorInterval);
- this.cursorInterval = null;
- }
- }, {
- key: "requestInput",
- value: function requestInput() {
- var _this2 = this;
- var anyKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- var promise = new Promise(function (resolve, _) {
- _this2.inputListeners.push(resolve);
- _this2.anyKey = anyKey;
- if (_this2.idleInterval == null) _this2.scheduleNotify();
- _this2.showInput();
- });
- return promise;
- }
- }, {
- key: "sendOutput",
- value: function sendOutput(text) {
- //console.debug(text);
- var output = "" + text;
- if (output.indexOf("\n") !== -1) {
- //console.debug("newline");
- var outputList = output.split("\n");
- var i = 0;
- for (; i < outputList.length - 1; i += 1) {
- //console.debug("newline write");
- var _t = outputList[i];
- _t = _t.replace(/\t/g, "  ");
- _t = _t.replace(/\s/g, " ");
- if (_t.length !== 0) {
- this.write(_t);
- }
- this.write("", true);
- }
- var t = outputList[i];
- t = t.replace(/\t/g, "  ");
- t = t.replace(/\s/g, " ");
- if (t.length != 0) this.write(t);
- } else {
- // console.debug("no newline");
- output = output.replace(/\t/g, "  ");
- output = output.replace(/\s/g, " ");
- if (output.length != 0) this.write(output);
- }
- }
- }, {
- key: "clearPendingWrites",
- value: function clearPendingWrites() {
- this.last_clear = Date.now();
- }
- }, {
- key: "clear",
- value: function clear() {
- this.clearPendingWrites();
- while (this.inputDiv.parentElement.childNodes.length > 1) {
- this.inputDiv.parentElement.removeChild(this.inputDiv.parentElement.firstChild);
- }
- this.input.value = "";
- this.inputSpan.innerHTML = "";
- this.currentLine = null;
- }
- }, {
- key: "clearBtnClick",
- value: function clearBtnClick() {
- this.clear();
- }
- }, {
- key: "showBtnClick",
- value: function showBtnClick() {
- this.focus();
- }
- }, {
- key: "hideBtnClick",
- value: function hideBtnClick() {
- this.hide();
- }
- }, {
- key: "notifyIdle",
- value: function notifyIdle() {
- this.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getMessage("awaiting_input_message"));
- this.inputCMD.click();
- }
- }, {
- key: "scheduleNotify",
- value: function scheduleNotify() {
- this.idleInterval = window.setInterval(this.notifyIdle.bind(this), _util_config__WEBPACK_IMPORTED_MODULE_6__["Config"].idle_input_interval);
- }
- }, {
- key: "cancelPendingInputRequests",
- value: function cancelPendingInputRequests() {
- this.inputListeners.forEach(function (resolve) {
- return resolve("");
- });
- this.inputListeners.splice(0, this.inputListeners.length);
- if (this.idleInterval != null) {
- clearInterval(this.idleInterval);
- this.idleInterval = null;
- }
- this.input.value = "";
- this.inputSpan.innerHTML = "";
- this.currentLine = null;
- this.hideInput();
- this.anyKey = false;
- }
- }]);
- return DOMConsole;
- }();
- /***/ }),
- /***/ "./js/io/input.js":
- /*!************************!*\
- !*** ./js/io/input.js ***!
- \************************/
- /*! exports provided: Input */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return Input; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- var Input = /*#__PURE__*/function () {
- function Input() {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Input);
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Input, [{
- key: "requestInput",
- value: function requestInput() {
- throw new Error("Must be implemented");
- }
- }, {
- key: "cancelPendingInputRequests",
- value: function cancelPendingInputRequests() {
- throw new Error("Must be implemented");
- }
- }]);
- return Input;
- }();
- /***/ }),
- /***/ "./js/io/output.js":
- /*!*************************!*\
- !*** ./js/io/output.js ***!
- \*************************/
- /*! exports provided: Output */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Output", function() { return Output; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- var Output = /*#__PURE__*/function () {
- function Output() {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Output);
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Output, [{
- key: "sendOutput",
- value: function sendOutput(text) {
- throw new Error("Must be implemented");
- }
- }]);
- return Output;
- }();
- /***/ }),
- /***/ "./js/main.js":
- /*!********************!*\
- !*** ./js/main.js ***!
- \********************/
- /*! exports provided: runner, initVisualUI, addFunctionChangeListener, addGlobalChangeListener, removeFunctionListener, removeGlobalListener, getTestCases, autoEval, prepareActivityToStudentHelper, LocalizedStrings, i18n, getLogs, getLogsAsString, registerClick, registerUserEvent, parseLogs, ActionTypes, CodeEditor, openAssessmentDetail, autoGenerateTestCaseOutput, Config */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocalizedStrings", function() { return LocalizedStrings; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i18n", function() { return i18n; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeEditor", function() { return CodeEditor; });
- /* harmony import */ var _runner__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./runner */ "./js/runner.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "runner", function() { return _runner__WEBPACK_IMPORTED_MODULE_0__["runner"]; });
- /* harmony import */ var _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./visualUI/functions */ "./js/visualUI/functions.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initVisualUI", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["initVisualUI"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addFunctionChangeListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["addFunctionChangeListener"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "addGlobalChangeListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["addGlobalChangeListener"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeFunctionListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["removeFunctionListener"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeGlobalListener", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["removeGlobalListener"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getTestCases", function() { return _visualUI_functions__WEBPACK_IMPORTED_MODULE_1__["getTestCases"]; });
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _services_i18nHelper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/i18nHelper */ "./js/services/i18nHelper.js");
- /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./services/userLog */ "./js/services/userLog.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLogs", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["getLogs"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getLogsAsString", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["getLogsAsString"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerClick", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerClick"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "registerUserEvent", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseLogs", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["parseLogs"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ActionTypes", function() { return _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"]; });
- /* harmony import */ var _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util/iassignHelpers */ "./js/util/iassignHelpers.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autoEval", function() { return _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__["autoEval"]; });
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareActivityToStudentHelper", function() { return _util_iassignHelpers__WEBPACK_IMPORTED_MODULE_5__["prepareActivityToStudentHelper"]; });
- /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util/utils */ "./js/util/utils.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "openAssessmentDetail", function() { return _util_utils__WEBPACK_IMPORTED_MODULE_6__["openAssessmentDetail"]; });
- /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./util/config */ "./js/util/config.ts");
- /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_7__);
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Config", function() { return _util_config__WEBPACK_IMPORTED_MODULE_7__["Config"]; });
- /* harmony import */ var _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./visualUI/text_editor */ "./js/visualUI/text_editor.js");
- /* harmony import */ var _util_auto_gen_output__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./util/auto_gen_output */ "./js/util/auto_gen_output.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "autoGenerateTestCaseOutput", function() { return _util_auto_gen_output__WEBPACK_IMPORTED_MODULE_9__["autoGenerateTestCaseOutput"]; });
- var CodeEditor = {
- initTextEditor: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__["initTextEditor"],
- setCode: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__["setCode"],
- getCode: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__["getCode"],
- updateEditor: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__["updateEditor"],
- disable: _visualUI_text_editor__WEBPACK_IMPORTED_MODULE_8__["disable"]
- };
- var i18n = _services_i18nHelper__WEBPACK_IMPORTED_MODULE_3__["i18nHelper"].i18n;
- var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["getInstance"]();
- /***/ }),
- /***/ "./js/memory/address.ts":
- /*!******************************!*\
- !*** ./js/memory/address.ts ***!
- \******************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.Address = void 0;
- class Address {
- /**
- *
- * @param {Number} id the address id
- * @param {never} value the value stored at this address
- */
- constructor(id, value) {
- this.id = id;
- this.value = value;
- }
- }
- exports.Address = Address;
- /***/ }),
- /***/ "./js/memory/location.ts":
- /*!*******************************!*\
- !*** ./js/memory/location.ts ***!
- \*******************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.Location = void 0;
- const address_1 = __webpack_require__(/*! ./address */ "./js/memory/address.ts");
- class LocationHolder {
- constructor() {
- this.data = [];
- this.address_id = 0;
- }
- /**
- *
- * @param {never} value the value to be allocated
- * @returns {number} - the address id
- */
- allocate(value) {
- const id = this.address_id;
- // console.log("Allocation address "+ id);
- const address = new address_1.Address(id, value);
- this.data.push(address);
- this.address_id += 1;
- return id;
- }
- /**
- *
- * @param {number} id
- */
- deallocate(id) {
- const index = this.findIndex(id);
- // console.log("Deallocation address "+ id);
- if (index !== -1) {
- this.data.splice(index, 1);
- return true;
- }
- return false;
- }
- /**
- *
- * @param {number} id
- * @returns {Address} the address identified by id
- */
- find(id) {
- let beg = 0;
- let end = this.data.length;
- // console.log("Finding address "+id);
- while (beg < end) {
- const med = Math.floor((beg + end) / 2);
- const address = this.getAddressAt(med);
- if (address.id === id) {
- return address;
- }
- else if (id > address.id) {
- beg = med;
- }
- else {
- end = med;
- }
- }
- return undefined;
- }
- getAddressAt(pos) {
- return this.data[pos];
- }
- /**
- *
- * @param {number} id address id
- * @returns {number} the index of the address identified by id
- */
- findIndex(id) {
- let beg = 0;
- let end = this.data.length;
- while (beg < end) {
- const med = Math.floor((beg + end) / 2);
- const address = this.getAddressAt(med);
- if (address.id === id) {
- return med;
- }
- else if (id > address.id) {
- beg = med;
- }
- else {
- end = med;
- }
- }
- return -1;
- }
- updateAddress(id, value) {
- const index = this.findIndex(id);
- if (index === -1) {
- throw new Error("Invalid address..." + id);
- }
- this.data[index].value = value;
- }
- clear() {
- for (let i = 0; i < this.data.length; i += 1) {
- delete this.data[i];
- }
- this.data = [];
- this.address_id = 0;
- }
- }
- const inner_ref = new LocationHolder();
- exports.Location = Object.freeze({
- allocate: inner_ref.allocate.bind(inner_ref),
- deallocate: inner_ref.deallocate.bind(inner_ref),
- find: inner_ref.find.bind(inner_ref),
- updateAddress: inner_ref.updateAddress.bind(inner_ref),
- clear: inner_ref.clear.bind(inner_ref),
- size: () => inner_ref.data.length
- });
- /***/ }),
- /***/ "./js/processor/compatibilityTable.ts":
- /*!********************************************!*\
- !*** ./js/processor/compatibilityTable.ts ***!
- \********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.resultTypeAfterUnaryOp = exports.resultTypeAfterInfixOp = void 0;
- const types_1 = __webpack_require__(/*! ../typeSystem/types */ "./js/typeSystem/types.ts");
- const operators_1 = __webpack_require__(/*! ../ast/operators */ "./js/ast/operators.ts");
- const multiType_1 = __webpack_require__(/*! ../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
- const config_1 = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
- function buildInfixAddTable() {
- const table = [[], [], [], [], []];
- table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
- table[types_1.Types.INTEGER.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
- table[types_1.Types.INTEGER.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
- table[types_1.Types.REAL.ord][types_1.Types.INTEGER.ord] = types_1.Types.REAL;
- table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
- table[types_1.Types.REAL.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
- table[types_1.Types.STRING.ord][types_1.Types.INTEGER.ord] = types_1.Types.STRING;
- table[types_1.Types.STRING.ord][types_1.Types.REAL.ord] = types_1.Types.STRING;
- table[types_1.Types.STRING.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
- table[types_1.Types.STRING.ord][types_1.Types.BOOLEAN.ord] = types_1.Types.STRING;
- table[types_1.Types.STRING.ord][types_1.Types.CHAR.ord] = types_1.Types.STRING;
- table[types_1.Types.CHAR.ord][types_1.Types.CHAR.ord] = types_1.Types.STRING;
- table[types_1.Types.CHAR.ord][types_1.Types.STRING.ord] = types_1.Types.STRING;
- return table;
- }
- function buildInfixMultiDivSubTable() {
- const table = [[], []];
- table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
- table[types_1.Types.INTEGER.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
- table[types_1.Types.REAL.ord][types_1.Types.INTEGER.ord] = types_1.Types.REAL;
- table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.REAL;
- return table;
- }
- function buildInfixEqualityInequalityTable() {
- const table = [[], [], [], [], []];
- table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.BOOLEAN;
- table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.BOOLEAN;
- table[types_1.Types.BOOLEAN.ord][types_1.Types.BOOLEAN.ord] = types_1.Types.BOOLEAN;
- table[types_1.Types.STRING.ord][types_1.Types.STRING.ord] = types_1.Types.BOOLEAN;
- table[types_1.Types.CHAR.ord][types_1.Types.CHAR.ord] = types_1.Types.BOOLEAN;
- return table;
- }
- function buildInfixRelationalTable() {
- const table = [[], [], [], [], []];
- table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.BOOLEAN;
- table[types_1.Types.REAL.ord][types_1.Types.REAL.ord] = types_1.Types.BOOLEAN;
- table[types_1.Types.STRING.ord][types_1.Types.STRING.ord] = types_1.Types.BOOLEAN;
- table[types_1.Types.CHAR.ord][types_1.Types.CHAR.ord] = types_1.Types.BOOLEAN;
- return table;
- }
- function buildInfixAndOrTable() {
- const table = [[], [], [], []];
- table[types_1.Types.BOOLEAN.ord][types_1.Types.BOOLEAN.ord] = types_1.Types.BOOLEAN;
- return table;
- }
- function buildInfixModTable() {
- const table = [[]];
- table[types_1.Types.INTEGER.ord][types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
- return table;
- }
- function buildUnarySumSubList() {
- const list = [];
- list[types_1.Types.INTEGER.ord] = types_1.Types.INTEGER;
- list[types_1.Types.REAL.ord] = types_1.Types.REAL;
- return list;
- }
- function buildUnaryNegList() {
- const list = [];
- list[types_1.Types.BOOLEAN.ord] = types_1.Types.BOOLEAN;
- return list;
- }
- function buildInfixCompatibilityTable() {
- const compatibilityMap = new WeakMap();
- compatibilityMap.set(operators_1.Operators.ADD, buildInfixAddTable());
- compatibilityMap.set(operators_1.Operators.SUB, buildInfixMultiDivSubTable());
- compatibilityMap.set(operators_1.Operators.MULT, buildInfixMultiDivSubTable());
- compatibilityMap.set(operators_1.Operators.DIV, buildInfixMultiDivSubTable());
- compatibilityMap.set(operators_1.Operators.EQ, buildInfixEqualityInequalityTable());
- compatibilityMap.set(operators_1.Operators.NEQ, buildInfixEqualityInequalityTable());
- compatibilityMap.set(operators_1.Operators.GE, buildInfixRelationalTable());
- compatibilityMap.set(operators_1.Operators.GT, buildInfixRelationalTable());
- compatibilityMap.set(operators_1.Operators.LE, buildInfixRelationalTable());
- compatibilityMap.set(operators_1.Operators.LT, buildInfixRelationalTable());
- compatibilityMap.set(operators_1.Operators.OR, buildInfixAndOrTable());
- compatibilityMap.set(operators_1.Operators.AND, buildInfixAndOrTable());
- compatibilityMap.set(operators_1.Operators.MOD, buildInfixModTable());
- return compatibilityMap;
- }
- function buildUnaryCompatibilityTable() {
- const compatibilityMap = new WeakMap();
- compatibilityMap.set(operators_1.Operators.ADD, buildUnarySumSubList());
- compatibilityMap.set(operators_1.Operators.SUB, buildUnarySumSubList());
- compatibilityMap.set(operators_1.Operators.NOT, buildUnaryNegList());
- return compatibilityMap;
- }
- const infixMap = buildInfixCompatibilityTable();
- const unaryMap = buildUnaryCompatibilityTable();
- function resultTypeAfterInfixOp(operator, leftExpressionType, rightExpressionType) {
- try {
- if (leftExpressionType instanceof multiType_1.MultiType && rightExpressionType instanceof multiType_1.MultiType) {
- let newMulti = [];
- for (let i = 0; i < leftExpressionType.types.length; ++i) {
- const typeA = leftExpressionType.types[i];
- for (let j = 0; j < rightExpressionType.types.length; ++i) {
- const typeB = rightExpressionType.types[j];
- newMulti.push(resultTypeAfterInfixOp(operator, typeA, typeB));
- }
- }
- newMulti = newMulti.filter(x => !x.isCompatible(types_1.Types.UNDEFINED));
- if (newMulti.length <= 0) {
- if (config_1.Config.enable_type_casting) {
- if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
- if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
- return new multiType_1.MultiType([types_1.Types.INTEGER, types_1.Types.REAL]);
- }
- }
- }
- return types_1.Types.UNDEFINED;
- }
- else {
- return new multiType_1.MultiType(newMulti);
- }
- }
- else if (leftExpressionType instanceof multiType_1.MultiType) {
- if (leftExpressionType.isCompatible(rightExpressionType)) {
- return resultTypeAfterInfixOp(operator, rightExpressionType, rightExpressionType);
- }
- else {
- if (config_1.Config.enable_type_casting) {
- if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
- if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
- return rightExpressionType;
- }
- }
- }
- return types_1.Types.UNDEFINED;
- }
- }
- else if (rightExpressionType instanceof multiType_1.MultiType) {
- if (rightExpressionType.isCompatible(leftExpressionType)) {
- return resultTypeAfterInfixOp(operator, leftExpressionType, leftExpressionType);
- }
- else {
- if (config_1.Config.enable_type_casting) {
- if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
- if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
- return leftExpressionType;
- }
- }
- }
- return types_1.Types.UNDEFINED;
- }
- }
- const resultTable = infixMap.get(operator) || [];
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- const resultType = resultTable[leftExpressionType.ord][rightExpressionType.ord];
- if (resultType === null || resultType === undefined) {
- if (config_1.Config.enable_type_casting) {
- if (leftExpressionType.isCompatible(types_1.Types.INTEGER) || leftExpressionType.isCompatible(types_1.Types.REAL)) {
- if (rightExpressionType.isCompatible(types_1.Types.INTEGER) || rightExpressionType.isCompatible(types_1.Types.REAL)) {
- if (operator === operators_1.Operators.MOD) {
- return types_1.Types.INTEGER;
- }
- else if (operator.ord >= 5 && operator.ord <= 10) {
- return types_1.Types.BOOLEAN;
- }
- }
- }
- }
- return types_1.Types.UNDEFINED;
- }
- return resultType;
- }
- catch (e) {
- if (e instanceof TypeError) {
- return types_1.Types.UNDEFINED;
- }
- else {
- throw e;
- }
- }
- }
- exports.resultTypeAfterInfixOp = resultTypeAfterInfixOp;
- function resultTypeAfterUnaryOp(operator, leftExpressionType) {
- try {
- if (leftExpressionType instanceof multiType_1.MultiType) {
- let newMulti = [];
- for (let i = 0; i < leftExpressionType.types.length; ++i) {
- const type = leftExpressionType.types[i];
- newMulti.push(resultTypeAfterUnaryOp(operator, type));
- }
- newMulti = newMulti.filter(x => !x.isCompatible(types_1.Types.UNDEFINED));
- if (newMulti.length <= 0) {
- return types_1.Types.UNDEFINED;
- }
- return new multiType_1.MultiType(newMulti);
- }
- const resultTable = unaryMap.get(operator) || [];
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- const resultType = resultTable[leftExpressionType.ord];
- if (resultType == null) {
- return types_1.Types.UNDEFINED;
- }
- return resultType;
- }
- catch (e) {
- if (e instanceof TypeError) {
- return types_1.Types.UNDEFINED;
- }
- else {
- throw e;
- }
- }
- }
- exports.resultTypeAfterUnaryOp = resultTypeAfterUnaryOp;
- /***/ }),
- /***/ "./js/processor/context.ts":
- /*!*********************************!*\
- !*** ./js/processor/context.ts ***!
- \*********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.Context = void 0;
- exports.Context = Object.freeze({
- BASE: Symbol('context:base'),
- BREAKABLE: Symbol('context:breakable'),
- FUNCTION: Symbol('context:function')
- });
- /***/ }),
- /***/ "./js/processor/definedFunctions.js":
- /*!******************************************!*\
- !*** ./js/processor/definedFunctions.js ***!
- \******************************************/
- /*! exports provided: LanguageDefinedFunction */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LanguageDefinedFunction", function() { return LanguageDefinedFunction; });
- /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../services/languageService */ "./js/services/languageService.js");
- /* harmony import */ var _lib_io__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/io */ "./js/processor/lib/io.js");
- /* harmony import */ var _lib_strings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/strings */ "./js/processor/lib/strings.js");
- /* harmony import */ var _lib_arrays__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/arrays */ "./js/processor/lib/arrays.js");
- /* harmony import */ var _lib_lang__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/lang */ "./js/processor/lib/lang.js");
- /* harmony import */ var _lib_math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/math */ "./js/processor/lib/math.js");
- function valueToKey(value, object) {
- for (var key in object) {
- if (Object.prototype.hasOwnProperty.call(object, key)) {
- if (object[key] === value) {
- return key;
- }
- }
- }
- return null;
- }
- function concatObjects() {
- var result = {};
- for (var i = 0; i < arguments.length; i++) {
- var obj = i < 0 || arguments.length <= i ? undefined : arguments[i];
- for (var key in obj) {
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
- result[key] = obj[key];
- }
- }
- }
- return result;
- }
- var libsObject = {
- $mathLib: {
- $sin: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createSinFun"])(),
- $cos: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createCosFun"])(),
- $tan: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createTanFun"])(),
- $sqrt: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createSqrtFun"])(),
- $pow: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createPowFun"])(),
- $log: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createLogFun"])(),
- $abs: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createAbsFun"])(),
- $negate: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createNegateFun"])(),
- $invert: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createInvertFun"])(),
- $max: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createMaxFun"])(),
- $min: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createMinFun"])(),
- $rand: Object(_lib_math__WEBPACK_IMPORTED_MODULE_5__["createRandFun"])()
- },
- $ioLib: {
- $read: Object(_lib_io__WEBPACK_IMPORTED_MODULE_1__["createInputFun"])(),
- $write: Object(_lib_io__WEBPACK_IMPORTED_MODULE_1__["createOutputFun"])()
- },
- $strLib: {
- $substring: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createSubstringFun"])(),
- $length: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createLengthFun"])(),
- $uppercase: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createUppercaseFun"])(),
- $lowercase: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createLowercaseFun"])(),
- $charAt: Object(_lib_strings__WEBPACK_IMPORTED_MODULE_2__["createrCharAtFun"])()
- },
- $arrayLib: {
- $numElements: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createNumElementsFun"])(),
- $matrixLines: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createMatrixLinesFun"])(),
- $matrixColumns: Object(_lib_arrays__WEBPACK_IMPORTED_MODULE_3__["createMatrixColumnsFun"])()
- },
- $langLib: {
- $isReal: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsRealFun"])(),
- $isInt: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsIntFun"])(),
- $isBool: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createIsBoolFun"])(),
- $castReal: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastRealFun"])(),
- $castInt: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastIntFun"])(),
- $castBool: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastBoolFun"])(),
- $castString: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastStringFun"])(),
- $castChar: Object(_lib_lang__WEBPACK_IMPORTED_MODULE_4__["createCastCharFun"])()
- }
- };
- var funcsObject = concatObjects(libsObject.$ioLib, libsObject.$langLib, libsObject.$strLib, libsObject.$arrayLib);
- var LanguageDefinedFunction = Object.freeze({
- getMainFunctionName: function getMainFunctionName() {
- return _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs().main_function;
- },
- getInternalName: function getInternalName(localName) {
- if (localName.indexOf(".") !== -1) {
- var names = localName.split(".");
- var lib = valueToKey(names[0], _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangLibs());
- var internalName = valueToKey(names[1], _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs());
- if (lib === null || internalName === null) {
- return null;
- }
- return lib + "." + internalName;
- }
- var funcName = valueToKey(localName, _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs());
- if (funcName !== null) {
- if (funcsObject[funcName]) {
- return funcName;
- }
- }
- return null;
- },
- getFunction: function getFunction(internalName) {
- if (internalName.indexOf(".") !== -1) {
- var names = internalName.split(".");
- var libName = names[0];
- var funName = names[1];
- return libsObject[libName][funName];
- }
- return funcsObject[internalName];
- },
- getLocalName: function getLocalName(internalName) {
- if (internalName.indexOf(".") !== -1) {
- var names = internalName.split(".");
- var libName = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangLibs()[names[0]];
- var funName = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[names[1]];
- return "".concat(libName, ".").concat(funName);
- } else if (_services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[internalName]) {
- return _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLangFuncs()[internalName];
- } else {
- return internalName;
- }
- }
- });
- /***/ }),
- /***/ "./js/processor/error/processorErrorFactory.js":
- /*!*****************************************************!*\
- !*** ./js/processor/error/processorErrorFactory.js ***!
- \*****************************************************/
- /*! exports provided: ProcessorErrorFactory */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ProcessorErrorFactory", function() { return ProcessorErrorFactory; });
- /* harmony import */ var _runtimeError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./runtimeError */ "./js/processor/error/runtimeError.js");
- /* harmony import */ var _semanticError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./semanticError */ "./js/processor/error/semanticError.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../definedFunctions */ "./js/processor/definedFunctions.js");
- var LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["getInstance"]();
- function createRuntimeError(i18n_id) {
- var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- return new _runtimeError__WEBPACK_IMPORTED_MODULE_0__["RuntimeError"](LocalizedStrings.getError(i18n_id, context));
- }
- function createSemanticError(i18n_id) {
- var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- return new _semanticError__WEBPACK_IMPORTED_MODULE_1__["SemanticError"](LocalizedStrings.getError(i18n_id, context));
- }
- var ProcessorErrorFactory = Object.freeze({
- symbol_not_found_full: function symbol_not_found_full(id, sourceInfo) {
- if (sourceInfo) {
- var context = [id, sourceInfo.line, sourceInfo.column];
- return createSemanticError("symbol_not_found_full", context);
- } else {
- return ProcessorErrorFactory.symbol_not_found(id);
- }
- },
- symbol_not_found: function symbol_not_found(id) {
- var context = [id];
- return createSemanticError("symbol_not_found", context);
- },
- function_missing_full: function function_missing_full(id, sourceInfo) {
- if (sourceInfo) {
- var context = [id, sourceInfo.line, sourceInfo.column];
- return createSemanticError("function_missing_full", context);
- } else {
- return ProcessorErrorFactory.function_missing(id);
- }
- },
- function_missing: function function_missing(id) {
- var context = [id];
- return createSemanticError("function_missing", context);
- },
- main_missing: function main_missing() {
- return createSemanticError("main_missing");
- },
- array_dimension_not_int_full: function array_dimension_not_int_full(sourceInfo) {
- if (sourceInfo) {
- var context = [sourceInfo.line];
- return createSemanticError("array_dimension_not_int_full", context);
- } else {
- return ProcessorErrorFactory.array_dimension_not_int();
- }
- },
- array_dimension_not_int: function array_dimension_not_int() {
- return createSemanticError("array_dimension_not_int");
- },
- unknown_command_full: function unknown_command_full(sourceInfo) {
- if (sourceInfo) {
- var context = [sourceInfo.line];
- return createRuntimeError("unknown_command_full", context);
- } else {
- return ProcessorErrorFactory.unknown_command();
- }
- },
- unknown_command: function unknown_command() {
- return createRuntimeError("unknown_command");
- },
- incompatible_types_full: function incompatible_types_full(left_type, left_dim, right_type, right_dim, exp, source_info) {
- if (source_info) {
- var context = [LocalizedStrings.translateType(left_type, left_dim), exp, source_info.line, LocalizedStrings.translateType(right_type, right_dim)];
- return createSemanticError("incompatible_types_full", context);
- } else {
- return ProcessorErrorFactory.incompatible_types(left_type, left_dim, right_type, right_dim, exp);
- }
- },
- incompatible_types: function incompatible_types(left_type, left_dim, right_type, right_dim, exp) {
- var context = [LocalizedStrings.translateType(left_type, left_dim), exp, LocalizedStrings.translateType(right_type, right_dim)];
- return createSemanticError("incompatible_types", context);
- },
- incompatible_types_array_full: function incompatible_types_array_full(exp, type, dim, sourceInfo) {
- if (sourceInfo) {
- var context = [exp, LocalizedStrings.translateType(type, dim), sourceInfo.line, sourceInfo.column];
- return createSemanticError("incompatible_types_array_full", context);
- } else {
- return ProcessorErrorFactory.incompatible_types_array(exp, type, dim);
- }
- },
- incompatible_types_array: function incompatible_types_array(exp, type, dim) {
- var context = [exp, LocalizedStrings.translateType(type, dim)];
- return createSemanticError("incompatible_types_array", context);
- },
- loop_condition_type_full: function loop_condition_type_full(exp, sourceInfo) {
- if (sourceInfo) {
- var context = [sourceInfo.line, sourceInfo.column, exp];
- return createSemanticError("loop_condition_type_full", context);
- } else {
- return ProcessorErrorFactory.loop_condition_type(exp);
- }
- },
- loop_condition_type: function loop_condition_type(exp) {
- var context = [exp];
- return createSemanticError("loop_condition_type", context);
- },
- /**
- * @deprecated 01/10/2019
- */
- endless_loop_full: function endless_loop_full(sourceInfo) {
- if (sourceInfo) {
- var context = [sourceInfo.line];
- return createSemanticError("endless_loop_full", context);
- } else {
- return ProcessorErrorFactory.endless_loop();
- }
- },
- endless_loop: function endless_loop() {
- return createSemanticError("endless_loop");
- },
- if_condition_type_full: function if_condition_type_full(exp, sourceInfo) {
- if (sourceInfo) {
- var context = [sourceInfo.line, sourceInfo.column, exp];
- return createSemanticError("if_condition_type_full", context);
- } else {
- return ProcessorErrorFactory.if_condition_type(exp);
- }
- },
- if_condition_type: function if_condition_type(exp) {
- var context = [exp];
- return createSemanticError("if_condition_type", context);
- },
- invalid_global_var: function invalid_global_var() {
- return createRuntimeError("invalid_global_var");
- },
- not_implemented: function not_implemented(id) {
- var context = [id];
- return createRuntimeError("not_implemented", context);
- },
- invalid_case_type_full: function invalid_case_type_full(exp, type, dim, sourceInfo) {
- if (sourceInfo) {
- var context = [exp, LocalizedStrings.translateType(type, dim), sourceInfo.line, sourceInfo.column];
- return createSemanticError("invalid_case_type_full", context);
- } else {
- return ProcessorErrorFactory.invalid_case_type(exp, type, dim);
- }
- },
- invalid_case_type: function invalid_case_type(exp, type, dim) {
- var context = [exp, LocalizedStrings.translateType(type, dim)];
- return createSemanticError("invalid_case_type", context);
- },
- void_in_expression_full: function void_in_expression_full(id, sourceInfo) {
- if (sourceInfo) {
- var context = [sourceInfo.line, sourceInfo.column, id];
- return createSemanticError("void_in_expression_full", context);
- } else {
- return ProcessorErrorFactory.void_in_expression(id);
- }
- },
- void_in_expression: function void_in_expression(id) {
- var context = [id];
- return createSemanticError("void_in_expression", context);
- },
- invalid_array_access_full: function invalid_array_access_full(id, sourceInfo) {
- if (sourceInfo) {
- var context = [id, sourceInfo.line, sourceInfo.column];
- return createSemanticError("invalid_array_access_full", context);
- } else {
- return ProcessorErrorFactory.invalid_array_access(id);
- }
- },
- invalid_array_access: function invalid_array_access(id) {
- var context = [id];
- return createSemanticError("invalid_array_access", context);
- },
- invalid_matrix_access_full: function invalid_matrix_access_full(id, sourceInfo) {
- if (sourceInfo) {
- var context = [id, sourceInfo.line, sourceInfo.column];
- return createSemanticError("invalid_matrix_access_full", context);
- } else {
- return ProcessorErrorFactory.invalid_matrix_access(id);
- }
- },
- invalid_matrix_access: function invalid_matrix_access(id) {
- var context = [id];
- return createSemanticError("invalid_matrix_access", context);
- },
- matrix_column_outbounds_full: function matrix_column_outbounds_full(id, value, columns, sourceInfo) {
- if (sourceInfo) {
- var context = [sourceInfo.line, value, id, columns];
- return createRuntimeError("matrix_column_outbounds_full", context);
- } else {
- return ProcessorErrorFactory.matrix_column_outbounds(id, value, columns);
- }
- },
- matrix_column_outbounds: function matrix_column_outbounds(id, value, columns) {
- var context = [value, id, columns];
- return createRuntimeError("matrix_column_outbounds", context);
- },
- matrix_line_outbounds_full: function matrix_line_outbounds_full(id, value, lines, sourceInfo) {
- if (sourceInfo) {
- var context = [sourceInfo.line, value, id, lines];
- return createRuntimeError("matrix_line_outbounds_full", context);
- } else {
- return ProcessorErrorFactory.matrix_line_outbounds(id, value, lines);
- }
- },
- matrix_line_outbounds: function matrix_line_outbounds(id, value, lines) {
- var context = [value, id, lines];
- return createRuntimeError("matrix_line_outbounds", context);
- },
- vector_line_outbounds_full: function vector_line_outbounds_full(id, value, lines, sourceInfo) {
- if (sourceInfo) {
- var context = [sourceInfo.line, value, id, lines];
- return createRuntimeError("vector_line_outbounds_full", context);
- } else {
- return ProcessorErrorFactory.vector_line_outbounds(id, value, lines);
- }
- },
- vector_line_outbounds: function vector_line_outbounds(id, value, lines) {
- var context = [value, id, lines];
- return createRuntimeError("vector_line_outbounds", context);
- },
- vector_not_matrix_full: function vector_not_matrix_full(id, sourceInfo) {
- if (sourceInfo) {
- var context = [sourceInfo.line, id];
- return createRuntimeError("vector_not_matrix_full", context);
- } else {
- return ProcessorErrorFactory.vector_not_matrix(id);
- }
- },
- vector_not_matrix: function vector_not_matrix(id) {
- var context = [id];
- return createRuntimeError("vector_not_matrix", context);
- },
- function_no_return: function function_no_return(id) {
- var context = [id];
- return createSemanticError("function_no_return", context);
- },
- invalid_void_return_full: function invalid_void_return_full(id, type, dim, sourceInfo) {
- if (sourceInfo) {
- var context = [sourceInfo.line, id, LocalizedStrings.translateType(type, dim)];
- return createSemanticError("invalid_void_return_full", context);
- } else {
- return ProcessorErrorFactory.invalid_void_return(id, type, dim);
- }
- },
- invalid_void_return: function invalid_void_return(id, type, dim) {
- var context = [id, LocalizedStrings.translateType(type, dim)];
- return createSemanticError("invalid_void_return_full", context);
- },
- invalid_return_type_full: function invalid_return_type_full(id, type, dim, sourceInfo) {
- if (sourceInfo) {
- var context = [sourceInfo.line, id, LocalizedStrings.translateType(type, dim)];
- return createSemanticError("invalid_return_type_full", context);
- } else {
- return ProcessorErrorFactory.invalid_return_type(id, type, dim);
- }
- },
- invalid_return_type: function invalid_return_type(id, type, dim) {
- var context = [id, LocalizedStrings.translateType(type, dim)];
- return createSemanticError("invalid_return_type", context);
- },
- invalid_parameters_size_full: function invalid_parameters_size_full(id, expected, actual, sourceInfo) {
- if (sourceInfo) {
- var context = [sourceInfo.line, id, expected, actual];
- return createSemanticError("invalid_parameters_size_full", context);
- } else {
- return ProcessorErrorFactory.invalid_parameters_size(id, expected, actual);
- }
- },
- invalid_parameters_size: function invalid_parameters_size(id, expected, actual) {
- var context = [id, expected, actual];
- return createSemanticError("invalid_parameters_size", context);
- },
- invalid_parameter_type_full: function invalid_parameter_type_full(fun_name, exp, sourceInfo) {
- if (sourceInfo) {
- var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name), sourceInfo.line];
- return createSemanticError("invalid_parameter_type_full", context);
- } else {
- return ProcessorErrorFactory.invalid_parameter_type(fun_name, exp);
- }
- },
- invalid_parameter_type: function invalid_parameter_type(fun_name, exp) {
- var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name)];
- return createSemanticError("invalid_parameter_type_full", context);
- },
- invalid_ref_full: function invalid_ref_full(id, exp, sourceInfo) {
- if (sourceInfo) {
- var context = [exp, id, sourceInfo.line];
- return createSemanticError("invalid_ref_full", context);
- } else {
- return ProcessorErrorFactory.invalid_ref(id, exp);
- }
- },
- invalid_ref: function invalid_ref(id, exp) {
- var context = [exp, id];
- return createSemanticError("invalid_ref", context);
- },
- unexpected_break_command_full: function unexpected_break_command_full(sourceInfo) {
- if (sourceInfo) {
- var context = [sourceInfo.line];
- return createRuntimeError("unexpected_break_command_full", context);
- } else {
- return ProcessorErrorFactory.unexpected_break_command();
- }
- },
- unexpected_break_command: function unexpected_break_command() {
- return createRuntimeError("unexpected_break_command");
- },
- invalid_array_literal_type_full: function invalid_array_literal_type_full(exp, sourceInfo) {
- if (sourceInfo) {
- var context = [sourceInfo.line, exp];
- return createRuntimeError("invalid_array_literal_type_full", context);
- } else {
- return ProcessorErrorFactory.invalid_array_literal_type(exp);
- }
- },
- invalid_array_literal_type: function invalid_array_literal_type(exp) {
- var context = [exp];
- return createRuntimeError("invalid_array_literal_type", context);
- },
- invalid_array_literal_line_full: function invalid_array_literal_line_full(expected, actual, sourceInfo) {
- if (sourceInfo) {
- var context = [sourceInfo.line, expected, actual];
- return createRuntimeError("invalid_array_literal_line_full", context);
- } else {
- return ProcessorErrorFactory.invalid_array_literal_type(expected, actual);
- }
- },
- invalid_array_literal_line: function invalid_array_literal_line(expected, actual) {
- var context = [expected, actual];
- return createRuntimeError("invalid_array_literal_line", context);
- },
- invalid_array_literal_column_full: function invalid_array_literal_column_full(expected, actual, sourceInfo) {
- if (sourceInfo) {
- var context = [sourceInfo.line, expected, actual];
- return createRuntimeError("invalid_array_literal_column_full", context);
- } else {
- return ProcessorErrorFactory.invalid_array_literal_column(expected, actual);
- }
- },
- invalid_array_literal_column: function invalid_array_literal_column(expected, actual) {
- var context = [expected, actual];
- return createRuntimeError("invalid_array_literal_column", context);
- },
- invalid_unary_op_full: function invalid_unary_op_full(expString, opName, type, dim, sourceInfo) {
- if (sourceInfo) {
- var context = [sourceInfo.line, expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(type, dim)];
- return createRuntimeError("invalid_unary_op_full", context);
- } else {
- return ProcessorErrorFactory.invalid_unary_op(opName, type, dim);
- }
- },
- invalid_unary_op: function invalid_unary_op(expString, opName, type, dim) {
- var context = [expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(type, dim)];
- return createRuntimeError("invalid_unary_op", context);
- },
- invalid_infix_op_full: function invalid_infix_op_full(expString, opName, typeLeft, dimLeft, typeRight, dimRight, sourceInfo) {
- if (sourceInfo) {
- var context = [sourceInfo.line, expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(typeLeft, dimLeft), LocalizedStrings.translateType(typeRight, dimRight)];
- return createRuntimeError("invalid_infix_op_full", context);
- } else {
- return ProcessorErrorFactory.invalid_infix_op(opName, typeLeft, dimLeft, typeRight, dimRight);
- }
- },
- invalid_infix_op: function invalid_infix_op(expString, opName, typeLeft, dimLeft, typeRight, dimRight) {
- var context = [expString, LocalizedStrings.translateOp(opName), LocalizedStrings.translateType(typeLeft, dimLeft), LocalizedStrings.translateType(typeRight, dimRight)];
- return createRuntimeError("invalid_infix_op", context);
- },
- array_dimension_not_positive_full: function array_dimension_not_positive_full(sourceInfo) {
- if (sourceInfo) {
- var context = [sourceInfo.line];
- return createSemanticError("array_dimension_not_positive_full", context);
- } else {
- return ProcessorErrorFactory.array_dimension_not_positive();
- }
- },
- array_dimension_not_positive: function array_dimension_not_positive() {
- return createSemanticError("array_dimension_not_positive");
- },
- invalid_type_conversion: function invalid_type_conversion(value, type, dim) {
- var context = [value, LocalizedStrings.translateType(type, dim)];
- return createRuntimeError("invalid_type_conversion", context);
- },
- invalid_read_type: function invalid_read_type(exp, type, dim, name, source_info) {
- var context = [source_info.line, exp, LocalizedStrings.translateType(type, dim), name];
- return createRuntimeError("invalid_read_type", context);
- },
- invalid_read_type_array: function invalid_read_type_array(exp, typePos, dimPos, name, typeArray, dimArray, sourceInfo) {
- var context = [sourceInfo.line, exp, LocalizedStrings.translateType(typePos, dimPos), name, LocalizedStrings.translateType(typeArray, dimArray)];
- return createRuntimeError("invalid_read_type_array", context);
- },
- invalid_const_ref_full: function invalid_const_ref_full(fun_name, exp, sourceInfo) {
- if (sourceInfo) {
- var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name), sourceInfo.line];
- return createSemanticError("invalid_const_ref_full", context);
- } else {
- return ProcessorErrorFactory.invalid_const_ref(fun_name, exp);
- }
- },
- invalid_const_ref: function invalid_const_ref(fun_name, exp) {
- var context = [exp, _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName(fun_name)];
- return createSemanticError("invalid_const_ref", context);
- },
- invalid_const_assignment_full: function invalid_const_assignment_full(var_id, source_info) {
- if (source_info) {
- var context = [source_info.line, var_id];
- return createSemanticError("invalid_const_assignment_full", context);
- } else {
- return ProcessorErrorFactory.invalid_const_assignment(var_id);
- }
- },
- invalid_const_assignment: function invalid_const_assignment(var_id) {
- var context = [var_id];
- return createSemanticError("invalid_const_assignment", context);
- },
- invalid_vector_assignment_full: function invalid_vector_assignment_full(left_id, left_size, right_id, right_size, source_info) {
- if (source_info) {
- var context = [source_info.line, left_id, left_size, right_id, right_size];
- return createRuntimeError("invalid_vector_assignment_full", context);
- } else {
- return ProcessorErrorFactory.invalid_vector_assignment(left_id, left_size, right_id, right_size);
- }
- },
- invalid_vector_assignment: function invalid_vector_assignment(left_id, left_size, right_id, right_size) {
- var context = [left_id, left_size, right_id, right_size];
- return createRuntimeError("invalid_vector_assignment", context);
- },
- invalid_matrix_assignment_full: function invalid_matrix_assignment_full(left_id, left_line, left_column, right_id, right_line, right_column, source_info) {
- if (source_info) {
- var context = [source_info.line, left_id, left_line, left_column, right_id, right_line, right_column];
- return createRuntimeError("invalid_matrix_assignment_full", context);
- } else {
- return ProcessorErrorFactory.invalid_matrix_assignment(left_id, left_line, left_column, right_id, right_line, right_column);
- }
- },
- invalid_matrix_assignment: function invalid_matrix_assignment(left_id, left_line, left_column, right_id, right_line, right_column) {
- var context = [left_id, left_line, left_column, right_id, right_line, right_column];
- return createRuntimeError("invalid_matrix_assignment", context);
- },
- matrix_to_vector_attr: function matrix_to_vector_attr(left_id, right_id, source_info) {
- // SourceInfo have to be valid...
- var context = [source_info.line, right_id, left_id];
- return createSemanticError("matrix_to_vector_attr", context);
- },
- vector_to_matrix_attr: function vector_to_matrix_attr(left_id, right_id, source_info) {
- // SourceInfo have to be valid...
- var context = [source_info.line, right_id, left_id];
- return createSemanticError("vector_to_matrix_attr", context);
- },
- invalid_matrix_index_assign_full: function invalid_matrix_index_assign_full(mat_id, mat_line, mat_size, exp, exp_size, source_info) {
- if (source_info) {
- var context = [source_info.line, mat_line, mat_id, mat_size, exp, exp_size];
- return createRuntimeError("invalid_matrix_index_assign_full", context);
- } else {
- return ProcessorErrorFactory.invalid_matrix_index_assign(mat_id, mat_line, mat_size, exp, exp_size);
- }
- },
- invalid_matrix_index_assign: function invalid_matrix_index_assign(mat_id, mat_line, mat_size, exp, exp_size) {
- var context = [mat_line, mat_id, mat_size, exp, exp_size];
- return createRuntimeError("invalid_matrix_index_assign", context);
- },
- invalid_number_elements_vector: function invalid_number_elements_vector(expected_num, exp, actual_num, source_info) {
- // SourceInfo have to be valid...
- var context = [expected_num, source_info.line, exp, actual_num];
- return createRuntimeError("invalid_number_elements_vector", context);
- },
- invalid_number_lines_matrix: function invalid_number_lines_matrix(expected_num, exp, actual_num, source_info) {
- // SourceInfo have to be valid...
- var context = [expected_num, source_info.line, exp, actual_num];
- return createRuntimeError("invalid_number_lines_matrix", context);
- },
- divsion_by_zero_full: function divsion_by_zero_full(exp, source_info) {
- if (source_info) {
- var context = [source_info.line, exp];
- return createRuntimeError("divsion_by_zero_full", context);
- } else {
- return ProcessorErrorFactory.divsion_by_zero(exp);
- }
- },
- divsion_by_zero: function divsion_by_zero(exp) {
- var context = [exp];
- return createRuntimeError("divsion_by_zero", context);
- },
- undefined_tanget_value: function undefined_tanget_value(value, source_info) {
- var context = [source_info.line, value];
- return createRuntimeError("undefined_tanget_value", context);
- },
- negative_log_value: function negative_log_value(source_info) {
- return createRuntimeError("negative_log_value", [source_info.line]);
- },
- invalid_string_index: function invalid_string_index(index, str, source_info) {
- var local_fun_name = _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getLocalName("$charAt");
- var context = [source_info.line, local_fun_name, index, str, str.length - 1];
- return createRuntimeError("invalid_string_index", context);
- },
- negative_sqrt_value: function negative_sqrt_value(source_info) {
- return createRuntimeError("negative_sqrt_value", [source_info.line]);
- },
- /**
- * @deprecated 01/10/2019
- */
- exceeded_recursive_calls: function exceeded_recursive_calls(source_info) {
- var context = [source_info.line];
- return createRuntimeError("exceeded_recursive_calls", context);
- },
- invalid_for_variable: function invalid_for_variable(id, source_info) {
- var context = [source_info.line, id];
- return createSemanticError("invalid_for_variable", context);
- },
- invalid_for_from: function invalid_for_from(exp, source_info) {
- var context = [source_info.line, exp];
- return createSemanticError("invalid_for_from", context);
- },
- invalid_for_to: function invalid_for_to(exp, source_info) {
- var context = [source_info.line, exp];
- return createSemanticError("invalid_for_to", context);
- },
- invalid_for_pass: function invalid_for_pass(exp, source_info) {
- var context = [source_info.line, exp];
- return createSemanticError("invalid_for_pass", context);
- },
- exceed_max_instructions: function exceed_max_instructions() {
- return createRuntimeError('exceed_max_instructions');
- }
- });
- /***/ }),
- /***/ "./js/processor/error/runtimeError.js":
- /*!********************************************!*\
- !*** ./js/processor/error/runtimeError.js ***!
- \********************************************/
- /*! exports provided: RuntimeError */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RuntimeError", function() { return RuntimeError; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
- /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "./node_modules/@babel/runtime/helpers/wrapNativeSuper.js");
- /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__);
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var RuntimeError = /*#__PURE__*/function (_Error) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(RuntimeError, _Error);
- var _super = _createSuper(RuntimeError);
- function RuntimeError() {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, RuntimeError);
- for (var _len = arguments.length, msg = new Array(_len), _key = 0; _key < _len; _key++) {
- msg[_key] = arguments[_key];
- }
- _this = _super.call.apply(_super, [this].concat(msg));
- if (Error.captureStackTrace) Error.captureStackTrace(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default()(_this), RuntimeError);
- return _this;
- }
- return RuntimeError;
- }( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default()(Error));
- /***/ }),
- /***/ "./js/processor/error/semanticError.js":
- /*!*********************************************!*\
- !*** ./js/processor/error/semanticError.js ***!
- \*********************************************/
- /*! exports provided: SemanticError */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SemanticError", function() { return SemanticError; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
- /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "./node_modules/@babel/runtime/helpers/wrapNativeSuper.js");
- /* harmony import */ var _babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5__);
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var SemanticError = /*#__PURE__*/function (_Error) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(SemanticError, _Error);
- var _super = _createSuper(SemanticError);
- function SemanticError() {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SemanticError);
- for (var _len = arguments.length, msg = new Array(_len), _key = 0; _key < _len; _key++) {
- msg[_key] = arguments[_key];
- }
- _this = _super.call.apply(_super, [this].concat(msg));
- if (Error.captureStackTrace) Error.captureStackTrace(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default()(_this), SemanticError);
- return _this;
- }
- return SemanticError;
- }( /*#__PURE__*/_babel_runtime_helpers_wrapNativeSuper__WEBPACK_IMPORTED_MODULE_5___default()(Error));
- /***/ }),
- /***/ "./js/processor/ivprogProcessor.js":
- /*!*****************************************!*\
- !*** ./js/processor/ivprogProcessor.js ***!
- \*****************************************/
- /*! exports provided: IVProgProcessor */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IVProgProcessor", function() { return IVProgProcessor; });
- /* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "./node_modules/@babel/runtime/helpers/slicedToArray.js");
- /* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./store/store */ "./js/processor/store/store.ts");
- /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_store_store__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modes */ "./js/processor/modes.ts");
- /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_6__);
- /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./context */ "./js/processor/context.ts");
- /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_context__WEBPACK_IMPORTED_MODULE_7__);
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../typeSystem/types */ "./js/typeSystem/types.ts");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__);
- /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.ts");
- /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_ast_operators__WEBPACK_IMPORTED_MODULE_9__);
- /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./definedFunctions */ "./js/processor/definedFunctions.js");
- /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./compatibilityTable */ "./js/processor/compatibilityTable.ts");
- /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_compatibilityTable__WEBPACK_IMPORTED_MODULE_11__);
- /* harmony import */ var _ast_commands___WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./../ast/commands/ */ "./js/ast/commands/index.js");
- /* harmony import */ var _ast_commands_command__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./../ast/commands/command */ "./js/ast/commands/command.js");
- /* harmony import */ var _ast_expressions___WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./../ast/expressions/ */ "./js/ast/expressions/index.js");
- /* harmony import */ var _ast_expressions_expression__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../ast/expressions/expression */ "./js/ast/expressions/expression.js");
- /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
- /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
- /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__);
- /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../typeSystem/parsers */ "./js/typeSystem/parsers.js");
- /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
- /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_19__);
- /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
- /* harmony import */ var _error_runtimeError__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./error/runtimeError */ "./js/processor/error/runtimeError.js");
- /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../memory/location */ "./js/memory/location.ts");
- /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_memory_location__WEBPACK_IMPORTED_MODULE_22__);
- /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./store/value/store_value */ "./js/processor/store/value/store_value.ts");
- /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_23__);
- /* harmony import */ var _store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./store/value/store_value_ref */ "./js/processor/store/value/store_value_ref.ts");
- /* harmony import */ var _store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_24__);
- /* harmony import */ var _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./store/value/array_store_value */ "./js/processor/store/value/array_store_value.ts");
- /* harmony import */ var _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(_store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__);
- /* harmony import */ var _store_value_array_store_value_ref__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./store/value/array_store_value_ref */ "./js/processor/store/value/array_store_value_ref.ts");
- /* harmony import */ var _store_value_array_store_value_ref__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(_store_value_array_store_value_ref__WEBPACK_IMPORTED_MODULE_26__);
- /* harmony import */ var _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./store/value/store_value_address */ "./js/processor/store/value/store_value_address.ts");
- /* harmony import */ var _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__);
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- var IVProgProcessor = /*#__PURE__*/function () {
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(IVProgProcessor, null, [{
- key: "MAIN_INTERNAL_ID",
- get: function get() {
- return "$main";
- }
- }]);
- function IVProgProcessor(ast) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, IVProgProcessor);
- this.ast = ast;
- this.globalStore = new _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"]("$global");
- this.stores = [this.globalStore];
- this.context = [_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BASE];
- this.input = null;
- this.forceKill = false;
- this.output = null;
- this.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
- /**
- * Stores the sourceInfo of every function call, command or expression
- */
- this.function_call_stack = [];
- this.instruction_count = 0;
- this.function_call_count = 0;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(IVProgProcessor, [{
- key: "registerInput",
- value: function registerInput(input) {
- if (this.input !== null) this.input = null;
- this.input = input;
- }
- }, {
- key: "registerOutput",
- value: function registerOutput(output) {
- if (this.output !== null) this.output = null;
- this.output = output;
- }
- }, {
- key: "checkContext",
- value: function checkContext(context) {
- return this.context[this.context.length - 1] === context;
- }
- }, {
- key: "ignoreSwitchCases",
- value: function ignoreSwitchCases(store) {
- if (store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN) {
- return true;
- } else if (store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK) {
- return true;
- } else {
- return false;
- }
- }
- }, {
- key: "prepareState",
- value: function prepareState() {
- if (this.stores !== null) {
- for (var i = 0; i < this.stores.length; i++) {
- delete this.stores[i];
- }
- this.stores = null;
- }
- if (this.globalStore !== null) this.globalStore = null;
- this.globalStore = new _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"]("$global");
- this.stores = [this.globalStore];
- this.context = [_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BASE];
- this.instruction_count = 0;
- this.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
- }
- }, {
- key: "interpretAST",
- value: function () {
- var _interpretAST = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee() {
- var mainFunc;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- this.prepareState();
- _memory_location__WEBPACK_IMPORTED_MODULE_22__["Location"].clear();
- _context.next = 4;
- return this.initGlobal();
- case 4:
- mainFunc = this.findMainFunction();
- if (!(mainFunc === null)) {
- _context.next = 7;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].main_missing();
- case 7:
- return _context.abrupt("return", this.runFunction(mainFunc, [], this.globalStore));
- case 8:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- function interpretAST() {
- return _interpretAST.apply(this, arguments);
- }
- return interpretAST;
- }()
- }, {
- key: "initGlobal",
- value: function () {
- var _initGlobal = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee2() {
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee2$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- if (this.checkContext(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BASE)) {
- _context2.next = 2;
- break;
- }
- return _context2.abrupt("return", _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_global_var());
- case 2:
- return _context2.abrupt("return", this.executeCommands(this.globalStore, this.ast.global));
- case 3:
- case "end":
- return _context2.stop();
- }
- }
- }, _callee2, this);
- }));
- function initGlobal() {
- return _initGlobal.apply(this, arguments);
- }
- return initGlobal;
- }()
- }, {
- key: "findMainFunction",
- value: function findMainFunction() {
- return this.ast.functions.find(function (v) {
- return v.isMain;
- });
- }
- }, {
- key: "findFunction",
- value: function findFunction(name) {
- if (name.match(/^\$.+$/)) {
- if (name === IVProgProcessor.MAIN_INTERNAL_ID) {
- return this.findMainFunction();
- }
- var fun = _definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getFunction(name);
- if (!fun) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].not_implemented(name);
- }
- return fun;
- } else {
- var val = this.ast.functions.find(function (v) {
- return v.name === name;
- });
- if (!val) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].function_missing(name);
- }
- return val;
- }
- }
- }, {
- key: "runFunction",
- value: function () {
- var _runFunction = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee3(func, actualParameters, store) {
- var funcName, funcStore, stoWithVars, finalSto;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee3$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- funcName = func.isMain ? IVProgProcessor.MAIN_INTERNAL_ID : func.name;
- funcStore = new _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"](funcName);
- funcStore.extendStore(this.globalStore);
- _context3.next = 5;
- return this.associateParameters(func.formalParameters, actualParameters, store, funcStore);
- case 5:
- this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].FUNCTION);
- this.stores.push(funcStore);
- _context3.next = 9;
- return this.executeCommands(funcStore, func.variablesDeclarations);
- case 9:
- stoWithVars = _context3.sent;
- finalSto = this.executeCommands(stoWithVars, func.commands);
- this.stores.pop();
- this.context.pop();
- return _context3.abrupt("return", finalSto);
- case 14:
- case "end":
- return _context3.stop();
- }
- }
- }, _callee3, this);
- }));
- function runFunction(_x, _x2, _x3) {
- return _runFunction.apply(this, arguments);
- }
- return runFunction;
- }()
- /**
- *
- * @param {import('./../ast/commands/formalParameter').FormalParameter[]} formal_params
- * @param {Expression[]} effective_params
- * @param {Store} caller_store
- * @param {Store} callee_store
- */
- }, {
- key: "associateParameters",
- value: function () {
- var _associateParameters = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee4(formal_params, effective_params, caller_store, callee_store) {
- var funcName, hasVariadic, i, j, formalParameter, _yield$this$associate, _yield$this$associate2, actualParam;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee4$(_context4) {
- while (1) {
- switch (_context4.prev = _context4.next) {
- case 0:
- funcName = callee_store.name === IVProgProcessor.MAIN_INTERNAL_ID ? _definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName() : callee_store.name;
- hasVariadic = formal_params.some(function (p) {
- return p.variadic;
- });
- if (!(formal_params.length != effective_params.length && !hasVariadic || formal_params.length > effective_params.length)) {
- _context4.next = 4;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_parameters_size(funcName, formal_params.length, effective_params.length);
- case 4:
- i = 0, j = 0;
- case 5:
- if (!(i < formal_params.length && j < effective_params.length)) {
- _context4.next = 23;
- break;
- }
- formalParameter = formal_params[i];
- if (!formalParameter.variadic) {
- _context4.next = 16;
- break;
- }
- _context4.next = 10;
- return this.associateVariadicParameter(funcName, formalParameter, j, effective_params, caller_store, callee_store);
- case 10:
- _yield$this$associate = _context4.sent;
- _yield$this$associate2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_yield$this$associate, 2);
- j = _yield$this$associate2[0];
- callee_store = _yield$this$associate2[1];
- _context4.next = 20;
- break;
- case 16:
- actualParam = effective_params[i];
- _context4.next = 19;
- return this.associateParameter(funcName, formalParameter, actualParam, caller_store, callee_store);
- case 19:
- callee_store = _context4.sent;
- case 20:
- i += 1, j += 1;
- _context4.next = 5;
- break;
- case 23:
- return _context4.abrupt("return", callee_store);
- case 24:
- case "end":
- return _context4.stop();
- }
- }
- }, _callee4, this);
- }));
- function associateParameters(_x4, _x5, _x6, _x7) {
- return _associateParameters.apply(this, arguments);
- }
- return associateParameters;
- }()
- /**
- *
- * @param {string} funcName
- * @param {import('./../ast/commands/formalParameter').FormalParameter} formalParameter
- * @param {number} index
- * @param {Expression[]} effective_params
- * @param {Store} caller_store
- * @param {Store} callee_store
- */
- }, {
- key: "associateVariadicParameter",
- value: function () {
- var _associateVariadicParameter = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee5(funcName, formalParameter, index, effective_params, caller_store, callee_store) {
- var i, count, actualParam, variadicCount;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee5$(_context5) {
- while (1) {
- switch (_context5.prev = _context5.next) {
- case 0:
- count = 1;
- i = index;
- case 2:
- if (!(i < effective_params.length)) {
- _context5.next = 11;
- break;
- }
- actualParam = effective_params[i];
- _context5.next = 6;
- return this.associateParameter(funcName, formalParameter, actualParam, caller_store, callee_store, count);
- case 6:
- callee_store = _context5.sent;
- count += 1;
- case 8:
- i += 1;
- _context5.next = 2;
- break;
- case 11:
- variadicCount = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER, count, undefined, true);
- callee_store.insertStore("".concat(formalParameter.id, ".0"), variadicCount);
- return _context5.abrupt("return", [i - 1, callee_store]);
- case 14:
- case "end":
- return _context5.stop();
- }
- }
- }, _callee5, this);
- }));
- function associateVariadicParameter(_x8, _x9, _x10, _x11, _x12, _x13) {
- return _associateVariadicParameter.apply(this, arguments);
- }
- return associateVariadicParameter;
- }()
- /**
- *
- * @param {string} funcName
- * @param {import('./../ast/commands/formalParameter').FormalParameter} formalParameter
- * @param {Expression} actualParameter
- * @param {Store} callerStore
- * @param {Store} calleeStore
- * @param {number} variadicCount The number of the current value being assigned to the variadic parameter, default 0
- */
- }, {
- key: "associateParameter",
- value: function () {
- var _associateParameter = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee6(funcName, formalParameter, actualParameter, callerStore, calleeStore) {
- var variadicCount,
- actualValue,
- shouldTypeCast,
- realObj,
- ref,
- values,
- array_type,
- addresses,
- columns,
- line,
- column,
- varID,
- realValue,
- _varID,
- _args6 = arguments;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee6$(_context6) {
- while (1) {
- switch (_context6.prev = _context6.next) {
- case 0:
- variadicCount = _args6.length > 5 && _args6[5] !== undefined ? _args6[5] : 0;
- _context6.next = 3;
- return this.evaluateExpression(callerStore, actualParameter);
- case 3:
- actualValue = _context6.sent;
- shouldTypeCast = false;
- if (formalParameter.type.isCompatible(actualValue.type)) {
- _context6.next = 11;
- break;
- }
- if (!(_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting && !formalParameter.byRef && _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(formalParameter.type, actualValue.type))) {
- _context6.next = 10;
- break;
- }
- shouldTypeCast = true;
- _context6.next = 11;
- break;
- case 10:
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_parameter_type(funcName, actualParameter.toString());
- case 11:
- if (!(formalParameter.byRef && !actualValue.inStore())) {
- _context6.next = 13;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_ref(funcName, actualParameter.toString());
- case 13:
- if (formalParameter.byRef) {
- realObj = callerStore.getStoreObject(actualValue.id);
- ref = null;
- if (actualValue instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"]) {
- // it's a vector or matrix...
- values = actualValue.get();
- array_type = actualValue.type;
- addresses = values.map(function (v) {
- return realObj.getLocAddressOf(v.line, v.column);
- });
- columns = actualValue.isVector() ? 0 : actualValue.columns;
- ref = new _store_value_array_store_value_ref__WEBPACK_IMPORTED_MODULE_26__["ArrayStoreValueRef"](array_type, values, addresses, actualValue.lines, columns, realObj.id);
- } else {
- if (actualValue instanceof _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__["StoreValueAddress"]) {
- line = actualValue.line;
- column = actualValue.column;
- ref = new _store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_24__["StoreValueRef"](actualValue.type, actualValue.get(), realObj.getLocAddressOf(line, column), realObj.id);
- ref.setReferenceDimension(realObj.type.dimensions);
- } else {
- ref = new _store_value_store_value_ref__WEBPACK_IMPORTED_MODULE_24__["StoreValueRef"](actualValue.type, actualValue.get(), realObj.locAddress, realObj.id);
- }
- }
- varID = formalParameter.id;
- if (formalParameter.variadic) varID = "".concat(varID, ".").concat(variadicCount);
- calleeStore.insertStore(varID, ref);
- } else {
- realValue = actualValue;
- if (shouldTypeCast) {
- realValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(formalParameter.type, realValue);
- }
- _varID = formalParameter.id;
- if (formalParameter.variadic) _varID = "".concat(_varID, ".").concat(variadicCount);
- calleeStore.insertStore(_varID, realValue);
- }
- return _context6.abrupt("return", calleeStore);
- case 15:
- case "end":
- return _context6.stop();
- }
- }
- }, _callee6, this);
- }));
- function associateParameter(_x14, _x15, _x16, _x17, _x18) {
- return _associateParameter.apply(this, arguments);
- }
- return associateParameter;
- }()
- /**
- *
- * @param {Store} store
- * @param {Command[]} cmds
- *
- * @returns {Promise<Store>}
- */
- }, {
- key: "executeCommands",
- value: function () {
- var _executeCommands = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee7(store, cmds) {
- var sto, i;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee7$(_context7) {
- while (1) {
- switch (_context7.prev = _context7.next) {
- case 0:
- // helper to partially apply a function, in this case executeCommand
- sto = store;
- i = 0;
- case 2:
- if (!(i < cmds.length)) {
- _context7.next = 9;
- break;
- }
- _context7.next = 5;
- return this.executeCommand(sto, cmds[i]);
- case 5:
- sto = _context7.sent;
- case 6:
- i += 1;
- _context7.next = 2;
- break;
- case 9:
- return _context7.abrupt("return", sto);
- case 10:
- case "end":
- return _context7.stop();
- }
- }
- }, _callee7, this);
- }));
- function executeCommands(_x19, _x20) {
- return _executeCommands.apply(this, arguments);
- }
- return executeCommands;
- }()
- /**
- *
- * @param {Store} store
- * @param {Command} cmd
- *
- * @returns {Promise<Store>}
- */
- }, {
- key: "executeCommand",
- value: function () {
- var _executeCommand = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee8(store, cmd) {
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee8$(_context8) {
- while (1) {
- switch (_context8.prev = _context8.next) {
- case 0:
- this.instruction_count += 1;
- if (!(this.instruction_count % _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].suspend_threshold == 0)) {
- _context8.next = 4;
- break;
- }
- _context8.next = 4;
- return _util_utils__WEBPACK_IMPORTED_MODULE_16__["sleep"](5);
- case 4:
- if (!(this.instruction_count >= _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].max_instruction_count)) {
- _context8.next = 8;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].exceed_max_instructions();
- case 8:
- if (!this.forceKill) {
- _context8.next = 12;
- break;
- }
- throw "FORCED_KILL!";
- case 12:
- if (!(store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].PAUSE)) {
- _context8.next = 16;
- break;
- }
- return _context8.abrupt("return", this.executeCommand(store, cmd));
- case 16:
- if (!(store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN)) {
- _context8.next = 20;
- break;
- }
- return _context8.abrupt("return", store);
- case 20:
- if (!(this.checkContext(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE) && store.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK)) {
- _context8.next = 24;
- break;
- }
- return _context8.abrupt("return", store);
- case 24:
- if (!(this.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].ABORT)) {
- _context8.next = 26;
- break;
- }
- throw _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_28__["LocalizedStrings"].getMessage("aborted_execution");
- case 26:
- if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Declaration"])) {
- _context8.next = 30;
- break;
- }
- return _context8.abrupt("return", this.executeDeclaration(store, cmd));
- case 30:
- if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["ArrayIndexAssign"])) {
- _context8.next = 34;
- break;
- }
- return _context8.abrupt("return", this.executeArrayIndexAssign(store, cmd));
- case 34:
- if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Assign"])) {
- _context8.next = 38;
- break;
- }
- return _context8.abrupt("return", this.executeAssign(store, cmd));
- case 38:
- if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Break"])) {
- _context8.next = 42;
- break;
- }
- return _context8.abrupt("return", this.executeBreak(store, cmd));
- case 42:
- if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Return"])) {
- _context8.next = 46;
- break;
- }
- return _context8.abrupt("return", this.executeReturn(store, cmd));
- case 46:
- if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["IfThenElse"])) {
- _context8.next = 50;
- break;
- }
- return _context8.abrupt("return", this.executeIfThenElse(store, cmd));
- case 50:
- if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["RepeatUntil"])) {
- _context8.next = 54;
- break;
- }
- return _context8.abrupt("return", this.executeRepeatUntil(store, cmd));
- case 54:
- if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["While"])) {
- _context8.next = 58;
- break;
- }
- return _context8.abrupt("return", this.executeWhile(store, cmd));
- case 58:
- if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["For"])) {
- _context8.next = 62;
- break;
- }
- return _context8.abrupt("return", this.executeFor(store, cmd));
- case 62:
- if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Switch"])) {
- _context8.next = 66;
- break;
- }
- return _context8.abrupt("return", this.executeSwitch(store, cmd));
- case 66:
- if (!(cmd instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["FunctionCall"])) {
- _context8.next = 70;
- break;
- }
- return _context8.abrupt("return", this.executeFunctionCall(store, cmd));
- case 70:
- if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["SysCall"])) {
- _context8.next = 74;
- break;
- }
- return _context8.abrupt("return", this.executeSysCall(store, cmd));
- case 74:
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].unknown_command(cmd.sourceInfo);
- case 75:
- case "end":
- return _context8.stop();
- }
- }
- }, _callee8, this);
- }));
- function executeCommand(_x21, _x22) {
- return _executeCommand.apply(this, arguments);
- }
- return executeCommand;
- }()
- /**
- *
- * @param {Store} store
- * @param {Commands.SysCall} cmd
- *
- * @returns {Promise<Store>}
- */
- }, {
- key: "executeSysCall",
- value: function () {
- var _executeSysCall = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee9(store, cmd) {
- var func;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee9$(_context9) {
- while (1) {
- switch (_context9.prev = _context9.next) {
- case 0:
- func = cmd.langFunc.bind(this);
- return _context9.abrupt("return", func(store, cmd));
- case 2:
- case "end":
- return _context9.stop();
- }
- }
- }, _callee9, this);
- }));
- function executeSysCall(_x23, _x24) {
- return _executeSysCall.apply(this, arguments);
- }
- return executeSysCall;
- }()
- /**
- *
- * @param {Store} store
- * @param {Commands.FunctionCall} cmd
- *
- * @returns {Promise<Store>}
- */
- }, {
- key: "executeFunctionCall",
- value: function () {
- var _executeFunctionCall = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee10(store, cmd) {
- var func, sto, funcName;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee10$(_context10) {
- while (1) {
- switch (_context10.prev = _context10.next) {
- case 0:
- func = null;
- if (cmd.isMainCall) {
- func = this.findMainFunction();
- } else {
- func = this.findFunction(cmd.id);
- }
- this.function_call_stack.push(cmd.sourceInfo);
- _context10.next = 5;
- return this.runFunction(func, cmd.actualParameters, store);
- case 5:
- sto = _context10.sent;
- sto.destroy();
- if (!(!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].VOID.isCompatible(func.returnType) && sto.mode !== _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN)) {
- _context10.next = 12;
- break;
- }
- funcName = func.name === IVProgProcessor.MAIN_INTERNAL_ID ? _definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName() : func.name;
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].function_no_return(funcName);
- case 12:
- this.function_call_stack.pop();
- return _context10.abrupt("return", store);
- case 14:
- case "end":
- return _context10.stop();
- }
- }
- }, _callee10, this);
- }));
- function executeFunctionCall(_x25, _x26) {
- return _executeFunctionCall.apply(this, arguments);
- }
- return executeFunctionCall;
- }()
- /**
- *
- * @param {Store} store
- * @param {Commands.Switch} cmd
- *
- * @returns {Promise<Store>}
- */
- }, {
- key: "executeSwitch",
- value: function () {
- var _executeSwitch = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee11(store, cmd) {
- var switchCases, lastStore, lastCaseCheckResult, i, switchCase, equalityInfixApp, result;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee11$(_context11) {
- while (1) {
- switch (_context11.prev = _context11.next) {
- case 0:
- this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE);
- switchCases = cmd.cases;
- lastStore = store;
- lastCaseCheckResult = false;
- i = 0;
- case 5:
- if (!(i < switchCases.length && !this.ignoreSwitchCases(lastStore))) {
- _context11.next = 26;
- break;
- }
- switchCase = switchCases[i];
- if (!(lastCaseCheckResult || switchCase.isDefault)) {
- _context11.next = 13;
- break;
- }
- _context11.next = 10;
- return this.executeCommands(lastStore, switchCase.commands);
- case 10:
- lastStore = _context11.sent;
- _context11.next = 23;
- break;
- case 13:
- equalityInfixApp = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].EQ, cmd.expression, switchCase.expression);
- equalityInfixApp.sourceInfo = switchCase.sourceInfo;
- _context11.next = 17;
- return this.evaluateExpression(lastStore, equalityInfixApp);
- case 17:
- result = _context11.sent;
- if (!result.get()) {
- _context11.next = 22;
- break;
- }
- _context11.next = 21;
- return this.executeCommands(lastStore, switchCase.commands);
- case 21:
- lastStore = _context11.sent;
- case 22:
- lastCaseCheckResult = result.get();
- case 23:
- i += 1;
- _context11.next = 5;
- break;
- case 26:
- this.context.pop();
- if (lastStore.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK) {
- lastStore.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
- }
- return _context11.abrupt("return", lastStore);
- case 29:
- case "end":
- return _context11.stop();
- }
- }
- }, _callee11, this);
- }));
- function executeSwitch(_x27, _x28) {
- return _executeSwitch.apply(this, arguments);
- }
- return executeSwitch;
- }()
- /**
- *
- * @param {Store} store
- * @param {Commands.For} cmd
- *
- * @returns {Promise<Store>}
- */
- }, {
- key: "executeFor",
- value: function () {
- var _executeFor = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee12(store, cmd) {
- var initCmd, passValue, condition, checkEndGTBegin, isForward, increment, whileBlock, forAsWhile, newCmdList;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee12$(_context12) {
- while (1) {
- switch (_context12.prev = _context12.next) {
- case 0:
- //BEGIN for -> while rewrite
- initCmd = new _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Assign"](cmd.for_id.id, cmd.for_from);
- initCmd.sourceInfo = cmd.sourceInfo; // Assume for is iterating forward and that pass is not missing
- passValue = cmd.for_pass;
- condition = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].LT, cmd.for_id, cmd.for_to);
- if (!(cmd.for_pass == null)) {
- _context12.next = 12;
- break;
- }
- passValue = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["IntLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["toInt"])(1));
- _context12.next = 8;
- return this.evaluateExpression(store, new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].GE, cmd.for_to, cmd.for_from));
- case 8:
- checkEndGTBegin = _context12.sent;
- if (!checkEndGTBegin.get()) {
- passValue = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["IntLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["toInt"])(-1));
- condition = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].GT, cmd.for_id, cmd.for_to);
- }
- _context12.next = 16;
- break;
- case 12:
- _context12.next = 14;
- return this.evaluateExpression(store, new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].GE, cmd.for_pass, new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["IntLiteral"](Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["toInt"])(0))));
- case 14:
- isForward = _context12.sent;
- if (!isForward.get()) {
- condition = new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].GT, cmd.for_id, cmd.for_to);
- }
- case 16:
- condition.sourceInfo = cmd.sourceInfo;
- increment = new _ast_commands___WEBPACK_IMPORTED_MODULE_12__["Assign"](cmd.for_id.id, new _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"](_ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].ADD, cmd.for_id, passValue));
- increment.sourceInfo = cmd.sourceInfo;
- whileBlock = new _ast_commands___WEBPACK_IMPORTED_MODULE_12__["CommandBlock"]([], cmd.commands.concat(increment));
- forAsWhile = new _ast_commands___WEBPACK_IMPORTED_MODULE_12__["While"](condition, whileBlock);
- forAsWhile.sourceInfo = cmd.sourceInfo; //END for -> while rewrite
- newCmdList = [initCmd, forAsWhile];
- return _context12.abrupt("return", this.executeCommands(store, newCmdList));
- case 24:
- case "end":
- return _context12.stop();
- }
- }
- }, _callee12, this);
- }));
- function executeFor(_x29, _x30) {
- return _executeFor.apply(this, arguments);
- }
- return executeFor;
- }()
- /**
- *
- * @param {Store} store
- * @param {Commands.RepeatUntil} cmd
- *
- * @returns {Promise<Store>}
- */
- }, {
- key: "executeRepeatUntil",
- value: function () {
- var _executeRepeatUntil = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee13(store, cmd) {
- var sto, checkCondition;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee13$(_context13) {
- while (1) {
- switch (_context13.prev = _context13.next) {
- case 0:
- this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE);
- _context13.next = 3;
- return this.executeCommands(store, cmd.commands);
- case 3:
- sto = _context13.sent;
- if (!(sto.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK)) {
- _context13.next = 8;
- break;
- }
- this.context.pop();
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
- return _context13.abrupt("return", sto);
- case 8:
- _context13.next = 10;
- return this.evaluateExpression(sto, cmd.expression);
- case 10:
- checkCondition = _context13.sent;
- if (checkCondition.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN)) {
- _context13.next = 13;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].loop_condition_type_full(cmd.sourceInfo);
- case 13:
- this.context.pop();
- if (!checkCondition.get()) {
- _context13.next = 18;
- break;
- }
- return _context13.abrupt("return", sto);
- case 18:
- return _context13.abrupt("return", this.executeCommand(sto, cmd));
- case 19:
- case "end":
- return _context13.stop();
- }
- }
- }, _callee13, this);
- }));
- function executeRepeatUntil(_x31, _x32) {
- return _executeRepeatUntil.apply(this, arguments);
- }
- return executeRepeatUntil;
- }()
- /**
- *
- * @param {Store} store
- * @param {Commands.While} cmd
- *
- * @returns {Promise<Store>}
- */
- }, {
- key: "executeWhile",
- value: function () {
- var _executeWhile = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee14(store, cmd) {
- var checkCondition, sto;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee14$(_context14) {
- while (1) {
- switch (_context14.prev = _context14.next) {
- case 0:
- this.context.push(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE);
- _context14.next = 3;
- return this.evaluateExpression(store, cmd.expression);
- case 3:
- checkCondition = _context14.sent;
- if (checkCondition.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN)) {
- _context14.next = 6;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].loop_condition_type_full(cmd.expression.toString(), cmd.sourceInfo);
- case 6:
- if (!checkCondition.get()) {
- _context14.next = 17;
- break;
- }
- _context14.next = 9;
- return this.executeCommands(store, cmd.commands);
- case 9:
- sto = _context14.sent;
- this.context.pop();
- if (!(sto.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK)) {
- _context14.next = 14;
- break;
- }
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RUN;
- return _context14.abrupt("return", sto);
- case 14:
- return _context14.abrupt("return", this.executeCommand(sto, cmd));
- case 17:
- this.context.pop();
- return _context14.abrupt("return", store);
- case 19:
- case "end":
- return _context14.stop();
- }
- }
- }, _callee14, this);
- }));
- function executeWhile(_x33, _x34) {
- return _executeWhile.apply(this, arguments);
- }
- return executeWhile;
- }()
- /**
- *
- * @param {Store} store
- * @param {Commands.IfThenElse} cmd
- *
- * @returns {Promise<Store>}
- */
- }, {
- key: "executeIfThenElse",
- value: function () {
- var _executeIfThenElse = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee15(store, cmd) {
- var isTrue;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee15$(_context15) {
- while (1) {
- switch (_context15.prev = _context15.next) {
- case 0:
- _context15.next = 2;
- return this.evaluateExpression(store, cmd.condition);
- case 2:
- isTrue = _context15.sent;
- if (isTrue.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN)) {
- _context15.next = 5;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].if_condition_type_full(cmd.condition.toString(), cmd.sourceInfo);
- case 5:
- if (!isTrue.get()) {
- _context15.next = 9;
- break;
- }
- return _context15.abrupt("return", this.executeCommands(store, cmd.ifTrue.commands));
- case 9:
- if (!(cmd.ifFalse !== null)) {
- _context15.next = 17;
- break;
- }
- if (!(cmd.ifFalse instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["IfThenElse"])) {
- _context15.next = 14;
- break;
- }
- return _context15.abrupt("return", this.executeCommand(store, cmd.ifFalse));
- case 14:
- return _context15.abrupt("return", this.executeCommands(store, cmd.ifFalse.commands));
- case 15:
- _context15.next = 18;
- break;
- case 17:
- return _context15.abrupt("return", store);
- case 18:
- case "end":
- return _context15.stop();
- }
- }
- }, _callee15, this);
- }));
- function executeIfThenElse(_x35, _x36) {
- return _executeIfThenElse.apply(this, arguments);
- }
- return executeIfThenElse;
- }()
- /**
- *
- * @param {Store} store
- * @param {Commands.Return} cmd
- *
- * @returns {Promise<Store>}
- */
- }, {
- key: "executeReturn",
- value: function () {
- var _executeReturn = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee16(store, cmd) {
- var funcName, func, funcType, value, real_value, stringInfo, info;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee16$(_context16) {
- while (1) {
- switch (_context16.prev = _context16.next) {
- case 0:
- funcName = store.name === IVProgProcessor.MAIN_INTERNAL_ID ? _definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName() : store.name; // console.log(funcName, store.name === IVProgProcessor.MAIN_INTERNAL_ID);
- func = this.findFunction(store.name);
- funcType = func.returnType;
- _context16.next = 5;
- return this.evaluateExpression(store, cmd.expression);
- case 5:
- value = _context16.sent;
- if (!(value === null && funcType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].VOID))) {
- _context16.next = 9;
- break;
- }
- store.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
- return _context16.abrupt("return", store);
- case 9:
- real_value = value;
- if (!(value === null || !funcType.isCompatible(value.type))) {
- _context16.next = 16;
- break;
- }
- if (!(!_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(funcType, value.type))) {
- _context16.next = 15;
- break;
- }
- stringInfo = funcType.stringInfo();
- info = stringInfo[0];
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_return_type_full(funcName, info.type, info.dim, cmd.sourceInfo);
- case 15:
- real_value = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(funcType, value);
- case 16:
- store.insertStore("$", real_value);
- store.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
- return _context16.abrupt("return", store);
- case 19:
- case "end":
- return _context16.stop();
- }
- }
- }, _callee16, this);
- }));
- function executeReturn(_x37, _x38) {
- return _executeReturn.apply(this, arguments);
- }
- return executeReturn;
- }()
- /**
- *
- * @param {Store} store
- * @param {Commands.Break} cmd
- *
- * @returns {Promise<Store>}
- */
- }, {
- key: "executeBreak",
- value: function () {
- var _executeBreak = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee17(store, cmd) {
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee17$(_context17) {
- while (1) {
- switch (_context17.prev = _context17.next) {
- case 0:
- if (!this.checkContext(_context__WEBPACK_IMPORTED_MODULE_7__["Context"].BREAKABLE)) {
- _context17.next = 5;
- break;
- }
- store.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].BREAK;
- return _context17.abrupt("return", store);
- case 5:
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].unexpected_break_command_full(cmd.sourceInfo);
- case 6:
- case "end":
- return _context17.stop();
- }
- }
- }, _callee17, this);
- }));
- function executeBreak(_x39, _x40) {
- return _executeBreak.apply(this, arguments);
- }
- return executeBreak;
- }()
- /**
- *
- * @param {Store} store
- * @param {Commands.Assign} cmd
- *
- * @returns {Promise<Store>}
- */
- }, {
- key: "executeAssign",
- value: function () {
- var _executeAssign = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee18(store, cmd) {
- var inStore, value, realValue, stringInfo, info, exp_type_string_info, exp_type_info, exp, columns, _exp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee18$(_context18) {
- while (1) {
- switch (_context18.prev = _context18.next) {
- case 0:
- inStore = store.applyStore(cmd.id);
- if (!inStore.isConst) {
- _context18.next = 3;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
- case 3:
- _context18.next = 5;
- return this.evaluateExpression(store, cmd.expression);
- case 5:
- value = _context18.sent;
- realValue = value;
- if (inStore.type.isCompatible(realValue.type)) {
- _context18.next = 18;
- break;
- }
- if (!(_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(inStore.type, value.type))) {
- _context18.next = 12;
- break;
- }
- realValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(inStore.type, realValue);
- _context18.next = 18;
- break;
- case 12:
- stringInfo = inStore.type.stringInfo();
- info = stringInfo[0];
- exp_type_string_info = value.type.stringInfo();
- exp_type_info = exp_type_string_info[0];
- exp = cmd.expression.toString();
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].incompatible_types_full(info.type, info.dim, exp_type_info.type, exp_type_info.dim, exp, cmd.sourceInfo);
- case 18:
- if (!(inStore instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"])) {
- _context18.next = 27;
- break;
- }
- columns = realValue.columns == null ? 0 : realValue.columns;
- if (!(inStore.lines !== realValue.lines || inStore.columns !== columns)) {
- _context18.next = 27;
- break;
- }
- _exp = cmd.expression.toString();
- if (!inStore.isVector()) {
- _context18.next = 26;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_vector_assignment_full(cmd.id, inStore.lines, _exp, realValue.lines, cmd.sourceInfo);
- case 26:
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_matrix_assignment_full(cmd.id, inStore.lines, inStore.columns, _exp, realValue.lines, realValue.columns, cmd.sourceInfo);
- case 27:
- store.updateStore(cmd.id, realValue);
- return _context18.abrupt("return", store);
- case 29:
- case "end":
- return _context18.stop();
- }
- }
- }, _callee18, this);
- }));
- function executeAssign(_x41, _x42) {
- return _executeAssign.apply(this, arguments);
- }
- return executeAssign;
- }()
- /**
- *
- * @param {Store} store
- * @param {Commands.ArrayIndexAssign} cmd
- *
- * @returns {Promise<Store>}
- */
- }, {
- key: "executeArrayIndexAssign",
- value: function () {
- var _executeArrayIndexAssign = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee19(store, cmd) {
- var mustBeArray, used_dims, lineSV, line, columnSV, column, value, actualValue, type, stringInfo, info, exp_type_string_info, exp_type_info, exp, current_value, _exp2;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee19$(_context19) {
- while (1) {
- switch (_context19.prev = _context19.next) {
- case 0:
- mustBeArray = store.applyStore(cmd.id);
- used_dims = 0;
- if (!mustBeArray.isConst) {
- _context19.next = 4;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
- case 4:
- if (mustBeArray.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__["ArrayType"]) {
- _context19.next = 6;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_array_access_full(cmd.id, cmd.sourceInfo);
- case 6:
- _context19.next = 8;
- return this.evaluateExpression(store, cmd.line);
- case 8:
- lineSV = _context19.sent;
- if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(lineSV.type)) {
- _context19.next = 11;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
- case 11:
- used_dims += 1;
- line = lineSV.get().toNumber();
- _context19.next = 15;
- return this.evaluateExpression(store, cmd.column);
- case 15:
- columnSV = _context19.sent;
- column = null;
- if (!(columnSV != null)) {
- _context19.next = 22;
- break;
- }
- if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(columnSV.type)) {
- _context19.next = 20;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
- case 20:
- column = columnSV.get().toNumber();
- used_dims += 1;
- case 22:
- _context19.next = 24;
- return this.evaluateExpression(store, cmd.expression);
- case 24:
- value = _context19.sent;
- actualValue = value;
- if (!(line >= mustBeArray.lines)) {
- _context19.next = 34;
- break;
- }
- if (!mustBeArray.isVector) {
- _context19.next = 31;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_line_outbounds_full(cmd.id, line, mustBeArray.lines, cmd.sourceInfo);
- case 31:
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_line_outbounds_full(cmd.id, line, mustBeArray.lines, cmd.sourceInfo);
- case 32:
- _context19.next = 36;
- break;
- case 34:
- if (!(line < 0)) {
- _context19.next = 36;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo);
- case 36:
- if (!(column != null && mustBeArray.columns === 0)) {
- _context19.next = 38;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_not_matrix_full(cmd.id, cmd.sourceInfo);
- case 38:
- if (!(column != null)) {
- _context19.next = 45;
- break;
- }
- if (!(column >= mustBeArray.columns)) {
- _context19.next = 43;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_column_outbounds_full(cmd.id, column, mustBeArray.columns, cmd.sourceInfo);
- case 43:
- if (!(column < 0)) {
- _context19.next = 45;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo);
- case 45:
- if (mustBeArray.type.canAccept(value.type, used_dims)) {
- _context19.next = 55;
- break;
- }
- if (!(!_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(mustBeArray.type.innerType, value.type))) {
- _context19.next = 54;
- break;
- }
- type = mustBeArray.type.innerType;
- stringInfo = type.stringInfo();
- info = stringInfo[0];
- exp_type_string_info = value.type.stringInfo();
- exp_type_info = exp_type_string_info[0];
- exp = cmd.expression.toString();
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].incompatible_types_full(info.type, info.dim, exp_type_info.type, exp_type_info.dim, exp, cmd.sourceInfo);
- case 54:
- actualValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(mustBeArray.type.innerType, value);
- case 55:
- current_value = mustBeArray.getAt(line, column);
- if (!(current_value instanceof _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"])) {
- _context19.next = 60;
- break;
- }
- if (!(current_value.lines !== actualValue.lines || current_value.columns !== actualValue.columns)) {
- _context19.next = 60;
- break;
- }
- _exp2 = cmd.expression.toString();
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_matrix_index_assign_full(cmd.id, line, current_value.lines, _exp2, actualValue.lines, cmd.sourceInfo);
- case 60:
- return _context19.abrupt("return", store.updateStoreArray(cmd.id, actualValue, line, column));
- case 61:
- case "end":
- return _context19.stop();
- }
- }
- }, _callee19, this);
- }));
- function executeArrayIndexAssign(_x43, _x44) {
- return _executeArrayIndexAssign.apply(this, arguments);
- }
- return executeArrayIndexAssign;
- }()
- /**
- *
- * @param {Store} store
- * @param {Commands.Declaration} cmd
- *
- * @returns {Promise<Store>}
- */
- }, {
- key: "executeDeclaration",
- value: function () {
- var _executeDeclaration = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee20(store, cmd) {
- var temp, value, realValue, stringInfo, info, exp_type_string_info, exp_type_info, exp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee20$(_context20) {
- while (1) {
- switch (_context20.prev = _context20.next) {
- case 0:
- if (!(cmd instanceof _ast_commands___WEBPACK_IMPORTED_MODULE_12__["ArrayDeclaration"])) {
- _context20.next = 4;
- break;
- }
- return _context20.abrupt("return", this.executeArrayDeclaration(store, cmd));
- case 4:
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](cmd.type, null, null, cmd.isConst);
- if (!(cmd.initial !== null)) {
- _context20.next = 22;
- break;
- }
- _context20.next = 8;
- return this.evaluateExpression(store, cmd.initial);
- case 8:
- value = _context20.sent;
- realValue = value;
- if (value.type.isCompatible(cmd.type)) {
- _context20.next = 21;
- break;
- }
- if (!(_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(cmd.type, value.type))) {
- _context20.next = 15;
- break;
- }
- realValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(cmd.type, realValue);
- _context20.next = 21;
- break;
- case 15:
- stringInfo = value.type.stringInfo();
- info = stringInfo[0];
- exp_type_string_info = value.type.stringInfo();
- exp_type_info = exp_type_string_info[0];
- exp = cmd.expression.toString();
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].incompatible_types_full(info.type, info.dim, exp_type_info.type, exp_type_info.dim, exp, cmd.sourceInfo);
- case 21:
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](cmd.type, realValue.get(), null, cmd.isConst);
- case 22:
- store.insertStore(cmd.id, temp);
- return _context20.abrupt("return", store);
- case 24:
- case "end":
- return _context20.stop();
- }
- }
- }, _callee20, this);
- }));
- function executeDeclaration(_x45, _x46) {
- return _executeDeclaration.apply(this, arguments);
- }
- return executeDeclaration;
- }()
- /**
- *
- * @param {Store} store
- * @param {Commands.ArrayDeclaration} cmd
- *
- * @returns {Promise<Store>}
- */
- }, {
- key: "executeArrayDeclaration",
- value: function () {
- var _executeArrayDeclaration = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee21(store, cmd) {
- var linesSV, line, columnsSV, column, temp, valueList;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee21$(_context21) {
- while (1) {
- switch (_context21.prev = _context21.next) {
- case 0:
- _context21.next = 2;
- return this.evaluateExpression(store, cmd.lines);
- case 2:
- linesSV = _context21.sent;
- if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(linesSV.type)) {
- _context21.next = 5;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
- case 5:
- line = linesSV.get().toNumber();
- _context21.next = 8;
- return this.evaluateExpression(store, cmd.columns);
- case 8:
- columnsSV = _context21.sent;
- column = null;
- if (!(columnsSV !== null)) {
- _context21.next = 16;
- break;
- }
- if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(columnsSV.type)) {
- _context21.next = 13;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
- case 13:
- column = columnsSV.get().toNumber();
- if (!(column < 0)) {
- _context21.next = 16;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(cmd.sourceInfo);
- case 16:
- temp = new _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"](cmd.type, [], line, column, null, cmd.isConst);
- if (!(cmd.initial !== null)) {
- _context21.next = 22;
- break;
- }
- _context21.next = 20;
- return this.evaluateArrayLiteral(store, cmd.initial, cmd.type, line, column);
- case 20:
- valueList = _context21.sent;
- temp = new _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"](cmd.type, valueList, line, column, null, cmd.isConst);
- case 22:
- store.insertStore(cmd.id, temp);
- return _context21.abrupt("return", store);
- case 24:
- case "end":
- return _context21.stop();
- }
- }
- }, _callee21, this);
- }));
- function executeArrayDeclaration(_x47, _x48) {
- return _executeArrayDeclaration.apply(this, arguments);
- }
- return executeArrayDeclaration;
- }()
- /**
- *
- * @param {Store} store
- * @param {Expression} exp
- *
- * @returns {Promise<import('./store/value/istore_value').IStoreValue>}
- */
- }, {
- key: "evaluateExpression",
- value: function () {
- var _evaluateExpression = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee22(store, exp) {
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee22$(_context22) {
- while (1) {
- switch (_context22.prev = _context22.next) {
- case 0:
- this.instruction_count += 1;
- if (!(this.instruction_count % _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].suspend_threshold == 0)) {
- _context22.next = 4;
- break;
- }
- _context22.next = 4;
- return _util_utils__WEBPACK_IMPORTED_MODULE_16__["sleep"](5);
- case 4:
- if (!(this.mode === _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].ABORT)) {
- _context22.next = 6;
- break;
- }
- throw _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_28__["LocalizedStrings"].getMessage("aborted_execution");
- case 6:
- if (!(this.instruction_count >= _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].max_instruction_count)) {
- _context22.next = 8;
- break;
- }
- throw new Error("Número de instruções excedeu o limite definido. Verifique se seu código não possui laços infinitos ou muitas chamadas de funções recursivas.");
- case 8:
- if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["UnaryApp"])) {
- _context22.next = 12;
- break;
- }
- return _context22.abrupt("return", this.evaluateUnaryApp(store, exp));
- case 12:
- if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["InfixApp"])) {
- _context22.next = 16;
- break;
- }
- return _context22.abrupt("return", this.evaluateInfixApp(store, exp));
- case 16:
- if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["ArrayAccess"])) {
- _context22.next = 20;
- break;
- }
- return _context22.abrupt("return", this.evaluateArrayAccess(store, exp));
- case 20:
- if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["VariableLiteral"])) {
- _context22.next = 24;
- break;
- }
- return _context22.abrupt("return", this.evaluateVariableLiteral(store, exp));
- case 24:
- if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["IntLiteral"])) {
- _context22.next = 28;
- break;
- }
- return _context22.abrupt("return", this.evaluateLiteral(store, exp));
- case 28:
- if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["RealLiteral"])) {
- _context22.next = 32;
- break;
- }
- return _context22.abrupt("return", this.evaluateLiteral(store, exp));
- case 32:
- if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["BoolLiteral"])) {
- _context22.next = 36;
- break;
- }
- return _context22.abrupt("return", this.evaluateLiteral(store, exp));
- case 36:
- if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["StringLiteral"])) {
- _context22.next = 40;
- break;
- }
- return _context22.abrupt("return", this.evaluateLiteral(store, exp));
- case 40:
- if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["CharLiteral"])) {
- _context22.next = 44;
- break;
- }
- return _context22.abrupt("return", this.evaluateLiteral(store, exp));
- case 44:
- if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["ArrayLiteral"])) {
- _context22.next = 48;
- break;
- }
- throw new Error("Internal Error: The system should not eval an array literal.");
- case 48:
- if (!(exp instanceof _ast_expressions___WEBPACK_IMPORTED_MODULE_14__["FunctionCall"])) {
- _context22.next = 50;
- break;
- }
- return _context22.abrupt("return", this.evaluateFunctionCall(store, exp));
- case 50:
- return _context22.abrupt("return", null);
- case 51:
- case "end":
- return _context22.stop();
- }
- }
- }, _callee22, this);
- }));
- function evaluateExpression(_x49, _x50) {
- return _evaluateExpression.apply(this, arguments);
- }
- return evaluateExpression;
- }()
- }, {
- key: "evaluateFunctionCall",
- value: function () {
- var _evaluateFunctionCall = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee23(store, exp) {
- var func, sto, val;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee23$(_context23) {
- while (1) {
- switch (_context23.prev = _context23.next) {
- case 0:
- if (!exp.isMainCall) {
- _context23.next = 2;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].void_in_expression_full(_definedFunctions__WEBPACK_IMPORTED_MODULE_10__["LanguageDefinedFunction"].getMainFunctionName(), exp.sourceInfo);
- case 2:
- func = this.findFunction(exp.id);
- if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].VOID.isCompatible(func.returnType)) {
- _context23.next = 5;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].void_in_expression_full(exp.id, exp.sourceInfo);
- case 5:
- if (!(this.function_call_stack.length >= _util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].max_call_stack)) {
- _context23.next = 7;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].exceeded_recursive_calls(exp.sourceInfo);
- case 7:
- this.function_call_stack.push(exp.sourceInfo);
- _context23.next = 10;
- return this.runFunction(func, exp.actualParameters, store);
- case 10:
- sto = _context23.sent;
- if (!(sto.mode !== _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN)) {
- _context23.next = 13;
- break;
- }
- throw new Error("!!!Internal error: the function that was called did not have a return command or did not set the store mode properly -> " + exp.id);
- case 13:
- val = sto.applyStore("$");
- sto.destroy();
- this.function_call_stack.pop();
- return _context23.abrupt("return", val);
- case 17:
- case "end":
- return _context23.stop();
- }
- }
- }, _callee23, this);
- }));
- function evaluateFunctionCall(_x51, _x52) {
- return _evaluateFunctionCall.apply(this, arguments);
- }
- return evaluateFunctionCall;
- }()
- /**
- *
- * @param {Store} store
- * @param {Expressions.ArrayLiteral} exp
- * @param {ArrayType} type
- *
- * @returns {Promise<StoreValue[]>}
- */
- }, {
- key: "evaluateArrayLiteral",
- value: function () {
- var _evaluateArrayLiteral = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee24(store, exp, type, lines, columns) {
- var storeValueMatrix;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee24$(_context24) {
- while (1) {
- switch (_context24.prev = _context24.next) {
- case 0:
- if (exp.isVector) {
- _context24.next = 9;
- break;
- }
- if (!(columns == null)) {
- _context24.next = 3;
- break;
- }
- throw new Error("This should never happen: Vector cannot be initialized by a matrix");
- case 3:
- _context24.next = 5;
- return this.evaluateMatrix(store, exp, type, lines, columns);
- case 5:
- storeValueMatrix = _context24.sent;
- return _context24.abrupt("return", storeValueMatrix.reduce(function (prev, next) {
- return prev.concat(next);
- }, []));
- case 9:
- if (!(columns != null)) {
- _context24.next = 11;
- break;
- }
- throw new Error("This should never happen: Matrix cannot be initialized by a vector");
- case 11:
- return _context24.abrupt("return", this.evaluateVector(store, exp, type, lines));
- case 12:
- case "end":
- return _context24.stop();
- }
- }
- }, _callee24, this);
- }));
- function evaluateArrayLiteral(_x53, _x54, _x55, _x56, _x57) {
- return _evaluateArrayLiteral.apply(this, arguments);
- }
- return evaluateArrayLiteral;
- }()
- /**
- * Evalautes a list of literals and expression composing the vector
- * @param {Store} store
- * @param {Expressions.ArrayLiteral} exps
- * @param {ArrayType} type
- * @param {number} n_elements
- *
- * @returns {Promise<StoreValue[]>} store object list
- */
- }, {
- key: "evaluateVector",
- value: function () {
- var _evaluateVector = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee25(store, exps, type, n_elements) {
- var _this = this;
- var values, actualValues;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee25$(_context25) {
- while (1) {
- switch (_context25.prev = _context25.next) {
- case 0:
- values = exps.value;
- if (!(n_elements !== values.length)) {
- _context25.next = 3;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_number_elements_vector(n_elements, exps.toString(), values.length, exps.sourceInfo);
- case 3:
- _context25.next = 5;
- return Promise.all(values.map(function (exp) {
- return _this.evaluateExpression(store, exp);
- }));
- case 5:
- actualValues = _context25.sent;
- return _context25.abrupt("return", actualValues.map(function (v, index) {
- if (!type.canAccept(v.type, 1)) {
- if (!_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(type.innerType, v.type)) {
- // const stringInfo = v.type.stringInfo();
- // const info = stringInfo[0];
- var exp_str = values[index].toString(); // TODO - fix error message
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_array_literal_type_full(exp_str, values[index].sourceInfo);
- }
- var newValue = _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].doImplicitCasting(type.innerType, v);
- return newValue;
- }
- return v;
- }));
- case 7:
- case "end":
- return _context25.stop();
- }
- }
- }, _callee25);
- }));
- function evaluateVector(_x58, _x59, _x60, _x61) {
- return _evaluateVector.apply(this, arguments);
- }
- return evaluateVector;
- }()
- /**
- * Evaluates a list of array literals composing the matrix
- * @param {Store} store
- * @param {Expressions.ArrayLiteral} exps
- * @param {ArrayType} type
- *
- * @returns {Promise<StoreValue[][]>}
- */
- }, {
- key: "evaluateMatrix",
- value: function () {
- var _evaluateMatrix = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee26(store, exps, type, lines, columns) {
- var _this2 = this;
- var values, vectors;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee26$(_context26) {
- while (1) {
- switch (_context26.prev = _context26.next) {
- case 0:
- values = exps.value;
- if (!(values.length !== lines)) {
- _context26.next = 3;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_number_lines_matrix(lines, exps.toString(), values.length, exps.sourceInfo);
- case 3:
- vectors = values.map(function (vector) {
- var vec_type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__["ArrayType"](type.innerType, 1);
- return _this2.evaluateVector(store, vector, vec_type, columns);
- });
- _context26.next = 6;
- return Promise.all(vectors);
- case 6:
- return _context26.abrupt("return", _context26.sent);
- case 7:
- case "end":
- return _context26.stop();
- }
- }
- }, _callee26);
- }));
- function evaluateMatrix(_x62, _x63, _x64, _x65, _x66) {
- return _evaluateMatrix.apply(this, arguments);
- }
- return evaluateMatrix;
- }()
- /**
- *
- * @param {Store} _
- * @param {import('../ast/expressions/literal').Literal} exp
- *
- * @returns {import('./store/value/istore_value').IStoreValue}
- */
- }, {
- key: "evaluateLiteral",
- value: function () {
- var _evaluateLiteral = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee27(_, exp) {
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee27$(_context27) {
- while (1) {
- switch (_context27.prev = _context27.next) {
- case 0:
- return _context27.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](exp.type, exp.value));
- case 1:
- case "end":
- return _context27.stop();
- }
- }
- }, _callee27);
- }));
- function evaluateLiteral(_x67, _x68) {
- return _evaluateLiteral.apply(this, arguments);
- }
- return evaluateLiteral;
- }()
- /**
- *
- * @param {Store} store
- * @param {Expressions.VariableLiteral} exp
- *
- * @returns {import('./store/value/istore_value').IStoreValue}
- */
- }, {
- key: "evaluateVariableLiteral",
- value: function () {
- var _evaluateVariableLiteral = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee28(store, exp) {
- var val;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee28$(_context28) {
- while (1) {
- switch (_context28.prev = _context28.next) {
- case 0:
- val = store.applyStore(exp.id);
- return _context28.abrupt("return", val);
- case 2:
- case "end":
- return _context28.stop();
- }
- }
- }, _callee28);
- }));
- function evaluateVariableLiteral(_x69, _x70) {
- return _evaluateVariableLiteral.apply(this, arguments);
- }
- return evaluateVariableLiteral;
- }()
- /**
- *
- * @param {Store} store
- * @param {Expressions.ArrayAccess} exp
- *
- * @returns {import('./store/value/istore_value').IStoreValue}
- */
- }, {
- key: "evaluateArrayAccess",
- value: function () {
- var _evaluateArrayAccess = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee29(store, exp) {
- var mustBeArray, lineSV, line, columnSV, column, result, type, values;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee29$(_context29) {
- while (1) {
- switch (_context29.prev = _context29.next) {
- case 0:
- mustBeArray = store.getStoreObject(exp.id);
- if (mustBeArray.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__["ArrayType"]) {
- _context29.next = 3;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_array_access_full(exp.id, exp.sourceInfo);
- case 3:
- _context29.next = 5;
- return this.evaluateExpression(store, exp.line);
- case 5:
- lineSV = _context29.sent;
- if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(lineSV.type)) {
- _context29.next = 8;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(exp.sourceInfo);
- case 8:
- line = lineSV.get().toNumber();
- _context29.next = 11;
- return this.evaluateExpression(store, exp.column);
- case 11:
- columnSV = _context29.sent;
- column = null;
- if (!(columnSV !== null)) {
- _context29.next = 17;
- break;
- }
- if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(columnSV.type)) {
- _context29.next = 16;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_int_full(exp.sourceInfo);
- case 16:
- column = columnSV.get().toNumber();
- case 17:
- if (!(line >= mustBeArray.lines)) {
- _context29.next = 25;
- break;
- }
- if (!mustBeArray.isVector) {
- _context29.next = 22;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_line_outbounds_full(exp.id, line, mustBeArray.lines, exp.sourceInfo);
- case 22:
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_line_outbounds_full(exp.id, line, mustBeArray.lines, exp.sourceInfo);
- case 23:
- _context29.next = 27;
- break;
- case 25:
- if (!(line < 0)) {
- _context29.next = 27;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(exp.sourceInfo);
- case 27:
- if (!(column !== null && mustBeArray.columns === 0)) {
- _context29.next = 29;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].vector_not_matrix_full(exp.id, exp.sourceInfo);
- case 29:
- if (!(column !== null)) {
- _context29.next = 36;
- break;
- }
- if (!(column >= mustBeArray.columns)) {
- _context29.next = 34;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].matrix_column_outbounds_full(exp.id, column, mustBeArray.columns, exp.sourceInfo);
- case 34:
- if (!(column < 0)) {
- _context29.next = 36;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].array_dimension_not_positive_full(exp.sourceInfo);
- case 36:
- result = mustBeArray.getAt(line, column);
- type = mustBeArray.type.innerType;
- if (!Array.isArray(result)) {
- _context29.next = 43;
- break;
- }
- values = result.map(function (val, col) {
- return new _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__["StoreValueAddress"](type, val, line, col, mustBeArray.id, mustBeArray.readOnly);
- });
- return _context29.abrupt("return", new _store_value_array_store_value__WEBPACK_IMPORTED_MODULE_25__["ArrayStoreValue"](new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_17__["ArrayType"](type, 1), values, mustBeArray.columns, null, mustBeArray.id, mustBeArray.readOnly));
- case 43:
- return _context29.abrupt("return", new _store_value_store_value_address__WEBPACK_IMPORTED_MODULE_27__["StoreValueAddress"](type, result, line, column, mustBeArray.id, mustBeArray.readOnly));
- case 44:
- case "end":
- return _context29.stop();
- }
- }
- }, _callee29, this);
- }));
- function evaluateArrayAccess(_x71, _x72) {
- return _evaluateArrayAccess.apply(this, arguments);
- }
- return evaluateArrayAccess;
- }()
- /**
- *
- * @param {Store} store
- * @param {Expressions.UnaryApp} unaryApp
- *
- * @returns {import('./store/value/istore_value').IStoreValue}
- */
- }, {
- key: "evaluateUnaryApp",
- value: function () {
- var _evaluateUnaryApp = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee30(store, unaryApp) {
- var left, resultType, stringInfo, info;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee30$(_context30) {
- while (1) {
- switch (_context30.prev = _context30.next) {
- case 0:
- _context30.next = 2;
- return this.evaluateExpression(store, unaryApp.left);
- case 2:
- left = _context30.sent;
- resultType = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_11__["resultTypeAfterUnaryOp"])(unaryApp.op, left.type);
- if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].UNDEFINED.isCompatible(resultType)) {
- _context30.next = 8;
- break;
- }
- stringInfo = left.type.stringInfo();
- info = stringInfo[0];
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_unary_op_full(unaryApp.op, info.type, info.dim, unaryApp.sourceInfo);
- case 8:
- _context30.t0 = unaryApp.op.ord;
- _context30.next = _context30.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].ADD.ord ? 11 : _context30.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].SUB.ord ? 12 : _context30.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].NOT.ord ? 13 : 14;
- break;
- case 11:
- return _context30.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get()));
- case 12:
- return _context30.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get().negated()));
- case 13:
- return _context30.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, !left.get()));
- case 14:
- throw new _error_runtimeError__WEBPACK_IMPORTED_MODULE_21__["RuntimeError"]("!!!Critical Invalid UnaryApp " + unaryApp.op);
- case 15:
- case "end":
- return _context30.stop();
- }
- }
- }, _callee30, this);
- }));
- function evaluateUnaryApp(_x73, _x74) {
- return _evaluateUnaryApp.apply(this, arguments);
- }
- return evaluateUnaryApp;
- }()
- /**
- *
- * @param {Store} store
- * @param {Expressions.InfixApp} infixApp
- *
- * @returns {import('./store/value/istore_value').IStoreValue}
- */
- }, {
- key: "evaluateInfixApp",
- value: function () {
- var _evaluateInfixApp = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee31(store, infixApp) {
- var left, right, shouldImplicitCast, resultType, stringInfoLeft, infoLeft, stringInfoRight, infoRight, result, rightStr, leftStr, strLeft, strRight, leftValue, rightValue, _leftValue, _rightValue, _leftValue2, _rightValue2, _leftValue3, _rightValue3, _leftValue4, _rightValue4, _leftValue5, _rightValue5, _leftValue6, _rightValue6;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee31$(_context31) {
- while (1) {
- switch (_context31.prev = _context31.next) {
- case 0:
- _context31.next = 2;
- return this.evaluateExpression(store, infixApp.left);
- case 2:
- left = _context31.sent;
- _context31.next = 5;
- return this.evaluateExpression(store, infixApp.right);
- case 5:
- right = _context31.sent;
- shouldImplicitCast = false;
- resultType = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_11__["resultTypeAfterInfixOp"])(infixApp.op, left.type, right.type);
- if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].UNDEFINED.isCompatible(resultType)) {
- _context31.next = 18;
- break;
- }
- if (!(_util_config__WEBPACK_IMPORTED_MODULE_19__["Config"].enable_type_casting && _store_store__WEBPACK_IMPORTED_MODULE_5__["Store"].canImplicitTypeCast(left.type, right.type))) {
- _context31.next = 13;
- break;
- }
- shouldImplicitCast = true;
- _context31.next = 18;
- break;
- case 13:
- stringInfoLeft = left.type.stringInfo();
- infoLeft = stringInfoLeft[0];
- stringInfoRight = right.type.stringInfo();
- infoRight = stringInfoRight[0];
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].invalid_infix_op_full(infixApp.op, infoLeft.type, infoLeft.dim, infoRight.type, infoRight.dim, infixApp.sourceInfo);
- case 18:
- result = null;
- _context31.t0 = infixApp.op.ord;
- _context31.next = _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].ADD.ord ? 22 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].SUB.ord ? 39 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].MULT.ord ? 40 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].DIV.ord ? 42 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].MOD.ord ? 46 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].GT.ord ? 51 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].GE.ord ? 55 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].LT.ord ? 59 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].LE.ord ? 63 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].EQ.ord ? 67 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].NEQ.ord ? 71 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].AND.ord ? 75 : _context31.t0 === _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].OR.ord ? 76 : 77;
- break;
- case 22:
- if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
- _context31.next = 27;
- break;
- }
- rightStr = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(right.get(), right.type);
- return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get() + rightStr));
- case 27:
- if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(right.type)) {
- _context31.next = 32;
- break;
- }
- leftStr = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(left.get(), left.type);
- return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, leftStr + right.get()));
- case 32:
- if (!_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
- _context31.next = 38;
- break;
- }
- strLeft = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(left.get(), left.type);
- strRight = Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_18__["convertToString"])(right.get(), right.type);
- return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, strLeft + strRight));
- case 38:
- return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get().plus(right.get())));
- case 39:
- return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get().minus(right.get())));
- case 40:
- result = left.get().times(right.get());
- return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
- case 42:
- if (!(right.get() == 0)) {
- _context31.next = 44;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_20__["ProcessorErrorFactory"].divsion_by_zero_full(infixApp.toString(), infixApp.sourceInfo);
- case 44:
- if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(resultType)) result = left.get().divToInt(right.get());else result = left.get().div(right.get());
- return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
- case 46:
- leftValue = left.get();
- rightValue = right.get();
- if (shouldImplicitCast) {
- resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER;
- leftValue = leftValue.trunc();
- rightValue = rightValue.trunc();
- }
- result = leftValue.modulo(rightValue);
- return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
- case 51:
- _leftValue = left.get();
- _rightValue = right.get();
- if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
- result = _leftValue.length > _rightValue.length;
- } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
- result = _leftValue.charCodeAt(0) > _rightValue.charCodeAt(0);
- } else {
- if (shouldImplicitCast) {
- resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
- _leftValue = _leftValue.trunc();
- _rightValue = _rightValue.trunc();
- }
- result = _leftValue.gt(_rightValue);
- }
- return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
- case 55:
- _leftValue2 = left.get();
- _rightValue2 = right.get();
- if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
- result = _leftValue2.length >= _rightValue2.length;
- } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
- result = _leftValue2.charCodeAt(0) >= _rightValue2.charCodeAt(0);
- } else {
- if (shouldImplicitCast) {
- resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
- _leftValue2 = _leftValue2.trunc();
- _rightValue2 = _rightValue2.trunc();
- }
- result = _leftValue2.gte(_rightValue2);
- }
- return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
- case 59:
- _leftValue3 = left.get();
- _rightValue3 = right.get();
- if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
- result = _leftValue3.length < _rightValue3.length;
- } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
- result = _leftValue3.charCodeAt(0) < _rightValue3.charCodeAt(0);
- } else {
- if (shouldImplicitCast) {
- resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
- _leftValue3 = _leftValue3.trunc();
- _rightValue3 = _rightValue3.trunc();
- }
- result = _leftValue3.lt(_rightValue3);
- }
- return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
- case 63:
- _leftValue4 = left.get();
- _rightValue4 = right.get();
- if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].STRING.isCompatible(left.type)) {
- result = _leftValue4.length <= _rightValue4.length;
- } else if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].CHAR.isCompatible(left.type)) {
- result = _leftValue4.charCodeAt(0) <= _rightValue4.charCodeAt(0);
- } else {
- if (shouldImplicitCast) {
- resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
- _leftValue4 = _leftValue4.trunc();
- _rightValue4 = _rightValue4.trunc();
- }
- result = _leftValue4.lte(_rightValue4);
- }
- return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
- case 67:
- _leftValue5 = left.get();
- _rightValue5 = right.get();
- if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(left.type) || _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].REAL.isCompatible(left.type)) {
- if (shouldImplicitCast) {
- resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
- _leftValue5 = _leftValue5.trunc();
- _rightValue5 = _rightValue5.trunc();
- }
- result = _leftValue5.eq(_rightValue5);
- } else {
- result = _leftValue5 === _rightValue5;
- }
- return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
- case 71:
- _leftValue6 = left.get();
- _rightValue6 = right.get();
- if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].INTEGER.isCompatible(left.type) || _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].REAL.isCompatible(left.type)) {
- if (shouldImplicitCast) {
- resultType = _typeSystem_types__WEBPACK_IMPORTED_MODULE_8__["Types"].BOOLEAN;
- _leftValue6 = _leftValue6.trunc();
- _rightValue6 = _rightValue6.trunc();
- }
- result = !_leftValue6.eq(_rightValue6);
- } else {
- result = _leftValue6 !== _rightValue6;
- }
- return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, result));
- case 75:
- return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get() && right.get()));
- case 76:
- return _context31.abrupt("return", new _store_value_store_value__WEBPACK_IMPORTED_MODULE_23__["StoreValue"](resultType, left.get() || right.get()));
- case 77:
- throw new _error_runtimeError__WEBPACK_IMPORTED_MODULE_21__["RuntimeError"]("!!!Critical Invalid InfixApp " + infixApp.op);
- case 78:
- case "end":
- return _context31.stop();
- }
- }
- }, _callee31, this);
- }));
- function evaluateInfixApp(_x75, _x76) {
- return _evaluateInfixApp.apply(this, arguments);
- }
- return evaluateInfixApp;
- }()
- }]);
- return IVProgProcessor;
- }();
- /***/ }),
- /***/ "./js/processor/lib/arrays.js":
- /*!************************************!*\
- !*** ./js/processor/lib/arrays.js ***!
- \************************************/
- /*! exports provided: createNumElementsFun, createMatrixLinesFun, createMatrixColumnsFun */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNumElementsFun", function() { return createNumElementsFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMatrixLinesFun", function() { return createMatrixLinesFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMatrixColumnsFun", function() { return createMatrixColumnsFun; });
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
- /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
- /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
- /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_6__);
- /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
- /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_7__);
- /**
- * num_elements
- * matrix_lines
- * matrix_columns
- */
- function createNumElementsFun() {
- var numElementsFun = /*#__PURE__*/function () {
- var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(sto, _) {
- var vector, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- vector = sto.applyStore("vector");
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toInt"])(vector.lines));
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
- sto.insertStore("$", temp);
- return _context.abrupt("return", sto);
- case 5:
- case "end":
- return _context.stop();
- }
- }
- }, _callee);
- }));
- return function numElementsFun(_x, _x2) {
- return _ref.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](numElementsFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$numElements', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__["ArrayType"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].ALL, 1), 'vector', false)], block);
- return func;
- }
- function createMatrixLinesFun() {
- var matrixLinesFun = /*#__PURE__*/function () {
- var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2(sto, _) {
- var matrix, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- matrix = sto.applyStore("matrix");
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toInt"])(matrix.lines));
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
- sto.insertStore("$", temp);
- return _context2.abrupt("return", sto);
- case 5:
- case "end":
- return _context2.stop();
- }
- }
- }, _callee2);
- }));
- return function matrixLinesFun(_x3, _x4) {
- return _ref2.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](matrixLinesFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$matrixLines', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__["ArrayType"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].ALL, 2), 'matrix', false)], block);
- return func;
- }
- function createMatrixColumnsFun() {
- var matrixColumnsFun = /*#__PURE__*/function () {
- var _ref3 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee3(sto, _) {
- var matrix, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- matrix = sto.applyStore("matrix");
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toInt"])(matrix.columns));
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_6__["Modes"].RETURN;
- sto.insertStore("$", temp);
- return _context3.abrupt("return", sto);
- case 5:
- case "end":
- return _context3.stop();
- }
- }
- }, _callee3);
- }));
- return function matrixColumnsFun(_x5, _x6) {
- return _ref3.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](matrixColumnsFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$matrixColumns', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_5__["ArrayType"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].ALL, 2), 'matrix', false)], block);
- return func;
- }
- /***/ }),
- /***/ "./js/processor/lib/io.js":
- /*!********************************!*\
- !*** ./js/processor/lib/io.js ***!
- \********************************/
- /*! exports provided: createOutputFun, createInputFun */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createOutputFun", function() { return createOutputFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createInputFun", function() { return createInputFun; });
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
- /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
- /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
- /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
- /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_7__);
- function createOutputFun() {
- var writeFunction = /*#__PURE__*/function () {
- var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(store, _) {
- var totalSV, total, i, val;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- totalSV = store.applyStore("p1.0");
- total = totalSV.get();
- for (i = 1; i < total; i += 1) {
- val = store.applyStore("p1.".concat(i));
- this.output.sendOutput(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["convertToString"](val.get(), val.type));
- }
- store.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
- return _context.abrupt("return", store);
- case 5:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- return function writeFunction(_x, _x2) {
- return _ref.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](writeFunction)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]("$write", _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].VOID, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].ALL, "p1", false, true)], block);
- return func;
- }
- function createInputFun() {
- var readFunction = /*#__PURE__*/function () {
- var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2(store, _) {
- var text, typeToConvert, type, result, stringInfo, realObject, arrayInfo, dim, stoValue;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- _context2.next = 2;
- return this.input.requestInput();
- case 2:
- text = _context2.sent;
- typeToConvert = store.applyStore("p1").type;
- type = null;
- result = null;
- _context2.prev = 6;
- if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].INTEGER)) {
- _context2.next = 12;
- break;
- }
- result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toInt"](text.trim()).trunc();
- type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].INTEGER;
- _context2.next = 33;
- break;
- case 12:
- if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].REAL)) {
- _context2.next = 17;
- break;
- }
- result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toReal"](text.trim());
- type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].REAL;
- _context2.next = 33;
- break;
- case 17:
- if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].BOOLEAN)) {
- _context2.next = 22;
- break;
- }
- result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toBool"](text.trim());
- type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].BOOLEAN;
- _context2.next = 33;
- break;
- case 22:
- if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].STRING)) {
- _context2.next = 27;
- break;
- }
- result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toString"](text);
- type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].STRING;
- _context2.next = 33;
- break;
- case 27:
- if (!typeToConvert.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].CHAR)) {
- _context2.next = 32;
- break;
- }
- result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toChar"](text);
- type = _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].CHAR;
- _context2.next = 33;
- break;
- case 32:
- throw new Error("!!!!Critical error: Unknown type in readFunction!!!!");
- case 33:
- _context2.next = 47;
- break;
- case 35:
- _context2.prev = 35;
- _context2.t0 = _context2["catch"](6);
- if (!(this.mode == _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].ABORT)) {
- _context2.next = 40;
- break;
- }
- store.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
- return _context2.abrupt("return", store);
- case 40:
- stringInfo = typeToConvert.stringInfo()[0];
- realObject = store.getStoreObject("p1");
- if (!(realObject.getReferenceDimension() > 0)) {
- _context2.next = 46;
- break;
- }
- arrayInfo = realObject.type.stringInfo()[0];
- dim = realObject.getReferenceDimension();
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_6__["ProcessorErrorFactory"].invalid_read_type_array(text, stringInfo.type, stringInfo.dim, realObject.getRefObj(), arrayInfo.type, dim, this.function_call_stack.pop());
- case 46:
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_6__["ProcessorErrorFactory"].invalid_read_type(text, stringInfo.type, stringInfo.dim, realObject.getRefObj(), this.function_call_stack.pop());
- case 47:
- stoValue = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_7__["StoreValue"](type, result);
- store.updateStore("p1", stoValue);
- store.mode = _modes__WEBPACK_IMPORTED_MODULE_3__["Modes"].RETURN;
- return _context2.abrupt("return", store);
- case 51:
- case "end":
- return _context2.stop();
- }
- }
- }, _callee2, this, [[6, 35]]);
- }));
- return function readFunction(_x3, _x4) {
- return _ref2.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](readFunction)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]("$read", _typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].VOID, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_5__["Types"].ALL, "p1", true)], block);
- return func;
- }
- /***/ }),
- /***/ "./js/processor/lib/lang.js":
- /*!**********************************!*\
- !*** ./js/processor/lib/lang.js ***!
- \**********************************/
- /*! exports provided: createIsRealFun, createIsIntFun, createIsBoolFun, createCastRealFun, createCastIntFun, createCastBoolFun, createCastStringFun, createCastCharFun */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsRealFun", function() { return createIsRealFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsIntFun", function() { return createIsIntFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createIsBoolFun", function() { return createIsBoolFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastRealFun", function() { return createCastRealFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastIntFun", function() { return createCastIntFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastBoolFun", function() { return createCastBoolFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastStringFun", function() { return createCastStringFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCastCharFun", function() { return createCastCharFun; });
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
- /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ast/ivprogParser */ "./js/ast/ivprogParser.js");
- /* harmony import */ var _ast_expressions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../ast/expressions */ "./js/ast/expressions/index.js");
- /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
- /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_7__);
- /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
- /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8__);
- /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
- /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
- /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_10__);
- /**
- *
- * is_real
- * is_int
- * is_bool
- * cast_real
- * cast_int
- * cast_bool
- * cast_string
- * cast_char
- */
- function createIsRealFun() {
- var isRealFun = /*#__PURE__*/function () {
- var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(sto, _) {
- var str, parser, result, val, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- str = sto.applyStore("str");
- parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(str.get());
- result = false;
- try {
- val = parser.parseTerm();
- if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["RealLiteral"]) {
- result = true;
- }
- } catch (error) {// ignore
- }
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, result);
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
- return _context.abrupt("return", sto);
- case 8:
- case "end":
- return _context.stop();
- }
- }
- }, _callee);
- }));
- return function isRealFun(_x, _x2) {
- return _ref.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](isRealFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$isReal', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, 'str', false)], block);
- return func;
- }
- function createIsIntFun() {
- var isIntFun = /*#__PURE__*/function () {
- var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2(sto, _) {
- var str, parser, result, val, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- str = sto.applyStore("str");
- parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(str.get());
- result = false;
- try {
- val = parser.parseTerm();
- if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["IntLiteral"]) {
- result = true;
- }
- } catch (_unused) {// ignore
- }
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, result);
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
- return _context2.abrupt("return", sto);
- case 8:
- case "end":
- return _context2.stop();
- }
- }
- }, _callee2);
- }));
- return function isIntFun(_x3, _x4) {
- return _ref2.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](isIntFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$isInt', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, 'str', false)], block);
- return func;
- }
- function createIsBoolFun() {
- var isBoolFun = function isBoolFun(sto, _) {
- var str = sto.applyStore("str");
- var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(str.get());
- var result = false;
- try {
- var val = parser.parseTerm();
- if (val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["BoolLiteral"]) {
- result = true;
- }
- } catch (error) {// ignore
- }
- var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, result);
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
- return sto;
- };
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](isBoolFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$isBool', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, 'str', false)], block);
- return func;
- }
- function createCastRealFun() {
- var castRealFun = /*#__PURE__*/function () {
- var _ref3 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee3(sto, _) {
- var val, value, temp, parser, result, _temp, typeStringInfoArray, typeInfo;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- val = sto.applyStore("val");
- value = val.get();
- _context3.t0 = val.type.ord;
- _context3.next = _context3.t0 === _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER.ord ? 5 : _context3.t0 === _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING.ord ? 10 : 22;
- break;
- case 5:
- value = value.toNumber();
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL, _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toReal"](value));
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
- return _context3.abrupt("return", sto);
- case 10:
- parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(value);
- _context3.prev = 11;
- result = parser.parseTerm();
- if (!(result instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["RealLiteral"])) {
- _context3.next = 18;
- break;
- }
- _temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL, result.value);
- sto.insertStore("$", _temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
- return _context3.abrupt("return", sto);
- case 18:
- _context3.next = 22;
- break;
- case 20:
- _context3.prev = 20;
- _context3.t1 = _context3["catch"](11);
- case 22:
- typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL.stringInfo();
- typeInfo = typeStringInfoArray[0];
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim);
- case 25:
- case "end":
- return _context3.stop();
- }
- }
- }, _callee3, null, [[11, 20]]);
- }));
- return function castRealFun(_x5, _x6) {
- return _ref3.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castRealFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$castReal', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING]), 'val', false)], block);
- return func;
- }
- function createCastIntFun() {
- var castIntFun = /*#__PURE__*/function () {
- var _ref4 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee4(sto, _) {
- var val, value, temp, _temp2, parser, result, _temp3, typeStringInfoArray, typeInfo;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee4$(_context4) {
- while (1) {
- switch (_context4.prev = _context4.next) {
- case 0:
- val = sto.applyStore("val");
- value = val.get();
- _context4.t0 = val.type.ord;
- _context4.next = _context4.t0 === _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL.ord ? 5 : _context4.t0 === _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].CHAR.ord ? 10 : _context4.t0 === _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING.ord ? 14 : 26;
- break;
- case 5:
- value = value.toNumber();
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, Math.floor(value));
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
- return _context4.abrupt("return", sto);
- case 10:
- _temp2 = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, value.charCodeAt(0));
- sto.insertStore("$", _temp2);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
- return _context4.abrupt("return", sto);
- case 14:
- parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(value);
- _context4.prev = 15;
- result = parser.parseTerm();
- if (!(result instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["IntLiteral"])) {
- _context4.next = 22;
- break;
- }
- _temp3 = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, result.value);
- sto.insertStore("$", _temp3);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
- return _context4.abrupt("return", sto);
- case 22:
- _context4.next = 26;
- break;
- case 24:
- _context4.prev = 24;
- _context4.t1 = _context4["catch"](15);
- case 26:
- typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER.stringInfo();
- typeInfo = typeStringInfoArray[0];
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim);
- case 29:
- case "end":
- return _context4.stop();
- }
- }
- }, _callee4, null, [[15, 24]]);
- }));
- return function castIntFun(_x7, _x8) {
- return _ref4.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castIntFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$castInt', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_8__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].REAL, _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING]), 'val', false)], block);
- return func;
- }
- function createCastBoolFun() {
- var castBoolFun = /*#__PURE__*/function () {
- var _ref5 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee5(sto, _) {
- var str, value, parser, val, temp, typeStringInfoArray, typeInfo;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee5$(_context5) {
- while (1) {
- switch (_context5.prev = _context5.next) {
- case 0:
- str = sto.applyStore("str");
- value = str.get();
- parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_5__["IVProgParser"].createParser(value);
- _context5.prev = 3;
- val = parser.parseTerm();
- if (!(val instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_6__["BoolLiteral"])) {
- _context5.next = 10;
- break;
- }
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, val.value);
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
- return _context5.abrupt("return", sto);
- case 10:
- _context5.next = 14;
- break;
- case 12:
- _context5.prev = 12;
- _context5.t0 = _context5["catch"](3);
- case 14:
- typeStringInfoArray = _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN.stringInfo();
- typeInfo = typeStringInfoArray[0];
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_9__["ProcessorErrorFactory"].invalid_type_conversion(value, typeInfo.type, typeInfo.dim);
- case 17:
- case "end":
- return _context5.stop();
- }
- }
- }, _callee5, null, [[3, 12]]);
- }));
- return function castBoolFun(_x9, _x10) {
- return _ref5.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castBoolFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$castBool', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].BOOLEAN, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, 'str', false)], block);
- return func;
- }
- function createCastStringFun() {
- var castStringFun = /*#__PURE__*/function () {
- var _ref6 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee6(store, _) {
- var val, result, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee6$(_context6) {
- while (1) {
- switch (_context6.prev = _context6.next) {
- case 0:
- val = store.applyStore('str');
- result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["convertToString"](val.get(), val.type);
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, result);
- store.insertStore("$", temp);
- store.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
- return _context6.abrupt("return", store);
- case 6:
- case "end":
- return _context6.stop();
- }
- }
- }, _callee6);
- }));
- return function castStringFun(_x11, _x12) {
- return _ref6.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castStringFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$castString', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].ALL, 'str', false)], block);
- return func;
- }
- function createCastCharFun() {
- var castCharFun = function castCharFun(store, _) {
- var valSV = store.applyStore('charCode'); // Force the int value to the range [0, 255]
- var value = valSV.get().toNumber() & 0xFF;
- var result = String.fromCharCode(value);
- var temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].CHAR, result);
- store.insertStore("$", temp);
- store.mode = _modes__WEBPACK_IMPORTED_MODULE_7__["Modes"].RETURN;
- return store;
- };
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](castCharFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$castChar', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].CHAR, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, 'charCode', false)], block);
- return func;
- }
- /***/ }),
- /***/ "./js/processor/lib/math.js":
- /*!**********************************!*\
- !*** ./js/processor/lib/math.js ***!
- \**********************************/
- /*! exports provided: createSinFun, createCosFun, createTanFun, createSqrtFun, createPowFun, createLogFun, createAbsFun, createNegateFun, createInvertFun, createMaxFun, createMinFun, createRandFun, createSetSeedFun */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSinFun", function() { return createSinFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createCosFun", function() { return createCosFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createTanFun", function() { return createTanFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSqrtFun", function() { return createSqrtFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPowFun", function() { return createPowFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLogFun", function() { return createLogFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createAbsFun", function() { return createAbsFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNegateFun", function() { return createNegateFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createInvertFun", function() { return createInvertFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMaxFun", function() { return createMaxFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMinFun", function() { return createMinFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRandFun", function() { return createRandFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSetSeedFun", function() { return createSetSeedFun; });
- /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
- /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
- /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! decimal.js */ "./node_modules/decimal.js/decimal.js");
- /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(decimal_js__WEBPACK_IMPORTED_MODULE_6__);
- /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
- /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__);
- /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
- /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__);
- /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
- /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_9__);
- /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
- /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_10__);
- /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
- /**
- * sin
- * cos
- * tan
- * sqrt
- * pow
- * log
- * abs
- * negate
- * invert
- * max
- * min
- */
- function convertToRadians(degrees) {
- return degrees.times(decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].acos(-1)).div(180);
- }
- function createSinFun() {
- var sinFun = /*#__PURE__*/function () {
- var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(sto, _) {
- var x, angle, result, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- x = sto.applyStore('x');
- angle = x.get().mod(360);
- result = null;
- if (angle.eq(90)) {
- result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](1);
- } else if (angle.eq(180)) {
- result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](0);
- } else if (angle.eq(270)) {
- result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](-1);
- } else {
- result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].sin(convertToRadians(angle));
- }
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
- return _context.abrupt("return", sto);
- case 8:
- case "end":
- return _context.stop();
- }
- }
- }, _callee);
- }));
- return function sinFun(_x, _x2) {
- return _ref.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](sinFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$sin", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), "x", false)], block);
- return func;
- }
- function createCosFun() {
- var cosFun = /*#__PURE__*/function () {
- var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee2(sto, _) {
- var x, angle, result, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee2$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- x = sto.applyStore('x');
- angle = x.get().mod(360);
- result = null;
- if (angle.eq(90)) {
- result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](0);
- } else if (angle.eq(180)) {
- result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](-1);
- } else if (angle.eq(270)) {
- result = new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](0);
- }
- result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].cos(convertToRadians(angle));
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
- return _context2.abrupt("return", sto);
- case 9:
- case "end":
- return _context2.stop();
- }
- }
- }, _callee2);
- }));
- return function cosFun(_x3, _x4) {
- return _ref2.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](cosFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$cos", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), "x", false)], block);
- return func;
- }
- function createTanFun() {
- var tanFun = /*#__PURE__*/function () {
- var _ref3 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee3(sto, _) {
- var x, angle, result, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee3$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- x = sto.applyStore('x');
- angle = x.get().mod(360);
- if (!(angle.eq(90) || angle.eq(270))) {
- _context3.next = 4;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__["ProcessorErrorFactory"].undefined_tanget_value(x.get().toNumber(), this.function_call_stack.pop());
- case 4:
- result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].tan(convertToRadians(angle));
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
- return _context3.abrupt("return", sto);
- case 9:
- case "end":
- return _context3.stop();
- }
- }
- }, _callee3, this);
- }));
- return function tanFun(_x5, _x6) {
- return _ref3.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](tanFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$tan", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), "x", false)], block);
- return func;
- }
- function createSqrtFun() {
- var sqrtFun = /*#__PURE__*/function () {
- var _ref4 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee4(sto, _) {
- var x, result, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee4$(_context4) {
- while (1) {
- switch (_context4.prev = _context4.next) {
- case 0:
- x = sto.applyStore('x');
- if (!x.get().isNeg()) {
- _context4.next = 3;
- break;
- }
- return _context4.abrupt("return", Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__["ProcessorErrorFactory"].negative_sqrt_value(this.function_call_stack.pop())));
- case 3:
- result = x.get().sqrt();
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
- return _context4.abrupt("return", sto);
- case 8:
- case "end":
- return _context4.stop();
- }
- }
- }, _callee4, this);
- }));
- return function sqrtFun(_x7, _x8) {
- return _ref4.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](sqrtFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$sqrt", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), "x", false)], block);
- return func;
- }
- function createPowFun() {
- var powFun = /*#__PURE__*/function () {
- var _ref5 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee5(sto, _) {
- var x, y, result, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee5$(_context5) {
- while (1) {
- switch (_context5.prev = _context5.next) {
- case 0:
- x = sto.applyStore('x');
- y = sto.applyStore('y');
- result = x.get().pow(y.get());
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
- return _context5.abrupt("return", sto);
- case 7:
- case "end":
- return _context5.stop();
- }
- }
- }, _callee5);
- }));
- return function powFun(_x9, _x10) {
- return _ref5.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](powFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$pow", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), "x", false), new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), "y", false)], block);
- return func;
- }
- function createLogFun() {
- var logFun = /*#__PURE__*/function () {
- var _ref6 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee6(sto, _) {
- var x, result, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee6$(_context6) {
- while (1) {
- switch (_context6.prev = _context6.next) {
- case 0:
- x = sto.applyStore('x');
- if (!x.get().isNegative()) {
- _context6.next = 3;
- break;
- }
- return _context6.abrupt("return", Promise.reject(_error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_11__["ProcessorErrorFactory"].negative_log_value(this.function_call_stack.pop())));
- case 3:
- result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].log10(x.get());
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
- return _context6.abrupt("return", sto);
- case 8:
- case "end":
- return _context6.stop();
- }
- }
- }, _callee6, this);
- }));
- return function logFun(_x11, _x12) {
- return _ref6.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](logFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$log", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), "x", false)], block);
- return func;
- }
- function createAbsFun() {
- var absFun = /*#__PURE__*/function () {
- var _ref7 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee7(sto, _) {
- var x, result, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee7$(_context7) {
- while (1) {
- switch (_context7.prev = _context7.next) {
- case 0:
- x = sto.applyStore('x');
- result = x.get().abs();
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type, result);
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
- return _context7.abrupt("return", sto);
- case 6:
- case "end":
- return _context7.stop();
- }
- }
- }, _callee7);
- }));
- return function absFun(_x13, _x14) {
- return _ref7.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](absFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$abs", new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), "x", false)], block);
- return func;
- }
- function createNegateFun() {
- var negateFun = /*#__PURE__*/function () {
- var _ref8 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee8(sto, _) {
- var x, result, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee8$(_context8) {
- while (1) {
- switch (_context8.prev = _context8.next) {
- case 0:
- x = sto.applyStore('x');
- result = x.get().negated();
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type, result);
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
- return _context8.abrupt("return", sto);
- case 6:
- case "end":
- return _context8.stop();
- }
- }
- }, _callee8);
- }));
- return function negateFun(_x15, _x16) {
- return _ref8.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](negateFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$negate", new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), "x", false)], block);
- return func;
- }
- function createInvertFun() {
- var invertFun = /*#__PURE__*/function () {
- var _ref9 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee9(sto, _) {
- var x, result, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee9$(_context9) {
- while (1) {
- switch (_context9.prev = _context9.next) {
- case 0:
- x = sto.applyStore('x');
- result = _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_5__["toReal"](1).dividedBy(x.get());
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, result);
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
- return _context9.abrupt("return", sto);
- case 6:
- case "end":
- return _context9.stop();
- }
- }
- }, _callee9);
- }));
- return function invertFun(_x17, _x18) {
- return _ref9.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](invertFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$invert", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), "x", false)], block);
- return func;
- }
- function createMaxFun() {
- var maxFun = /*#__PURE__*/function () {
- var _ref10 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee10(sto, _) {
- var x, numbers, result, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee10$(_context10) {
- while (1) {
- switch (_context10.prev = _context10.next) {
- case 0:
- x = sto.applyStore('x');
- numbers = x.get().map(function (sto_addrs) {
- return sto_addrs.get();
- });
- result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].max.apply(decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"], _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(numbers));
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type.innerType, result);
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
- return _context10.abrupt("return", sto);
- case 7:
- case "end":
- return _context10.stop();
- }
- }
- }, _callee10);
- }));
- return function maxFun(_x19, _x20) {
- return _ref10.apply(this, arguments);
- };
- }();
- var paramType = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), 1);
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](maxFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$max", new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](paramType, "x", false)], block);
- return func;
- }
- function createMinFun() {
- var minFun = /*#__PURE__*/function () {
- var _ref11 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee11(sto, _) {
- var x, numbers, result, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee11$(_context11) {
- while (1) {
- switch (_context11.prev = _context11.next) {
- case 0:
- x = sto.applyStore('x');
- numbers = x.get().map(function (sto_addrs) {
- return sto_addrs.get();
- });
- result = decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"].min.apply(decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"], _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(numbers));
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](x.type.innerType, result);
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
- return _context11.abrupt("return", sto);
- case 7:
- case "end":
- return _context11.stop();
- }
- }
- }, _callee11);
- }));
- return function minFun(_x21, _x22) {
- return _ref11.apply(this, arguments);
- };
- }();
- var paramType = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_8__["ArrayType"](new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), 1);
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](minFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$min", new _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_7__["MultiType"]([_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL]), [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](paramType, "x", false)], block);
- return func;
- }
- var seed = Date.now();
- function createRandFun() {
- var a = 16807;
- var m = 2147483647;
- var c = 12345;
- var randFun = /*#__PURE__*/function () {
- var _ref12 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee12(sto, _) {
- var val, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee12$(_context12) {
- while (1) {
- switch (_context12.prev = _context12.next) {
- case 0:
- seed = (a * seed + c) % m;
- val = seed / (m - 1);
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_10__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, new decimal_js__WEBPACK_IMPORTED_MODULE_6__["Decimal"](val));
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
- return _context12.abrupt("return", sto);
- case 6:
- case "end":
- return _context12.stop();
- }
- }
- }, _callee12);
- }));
- return function randFun(_x23, _x24) {
- return _ref12.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](randFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$rand", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].REAL, [], block);
- return func;
- }
- function createSetSeedFun() {
- var setSeedFun = /*#__PURE__*/function () {
- var _ref13 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee13(sto, _) {
- var value;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee13$(_context13) {
- while (1) {
- switch (_context13.prev = _context13.next) {
- case 0:
- value = sto.applyStore("x");
- seed = value.get().toNumber();
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_9__["Modes"].RETURN;
- return _context13.abrupt("return", sto);
- case 4:
- case "end":
- return _context13.stop();
- }
- }
- }, _callee13);
- }));
- return function setSeedFun(_x25, _x26) {
- return _ref13.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["SysCall"](setSeedFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["Function"]("$setSeed", _typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].VOID, [new _ast_commands__WEBPACK_IMPORTED_MODULE_3__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_4__["Types"].INTEGER, "x", false)], block);
- return func;
- }
- /***/ }),
- /***/ "./js/processor/lib/strings.js":
- /*!*************************************!*\
- !*** ./js/processor/lib/strings.js ***!
- \*************************************/
- /*! exports provided: createSubstringFun, createLengthFun, createUppercaseFun, createLowercaseFun, createrCharAtFun */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSubstringFun", function() { return createSubstringFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLengthFun", function() { return createLengthFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUppercaseFun", function() { return createUppercaseFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLowercaseFun", function() { return createLowercaseFun; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createrCharAtFun", function() { return createrCharAtFun; });
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../ast/commands */ "./js/ast/commands/index.js");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../typeSystem/types */ "./js/typeSystem/types.ts");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../typeSystem/parsers */ "./js/typeSystem/parsers.js");
- /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
- /* harmony import */ var _modes__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_modes__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../store/value/store_value */ "./js/processor/store/value/store_value.ts");
- /* harmony import */ var _store_value_store_value__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_store_value_store_value__WEBPACK_IMPORTED_MODULE_6__);
- /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
- /*
- * substring
- * length
- * uppercase
- * lowercase
- * charAt
- **/
- function createSubstringFun() {
- var substringFun = /*#__PURE__*/function () {
- var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(sto, _) {
- var str, start, end, result, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- str = sto.applyStore("str");
- start = sto.applyStore("start");
- end = sto.applyStore("end");
- result = str.get().substring(start.get(), end.get());
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, result);
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
- return _context.abrupt("return", sto);
- case 8:
- case "end":
- return _context.stop();
- }
- }
- }, _callee);
- }));
- return function substringFun(_x, _x2) {
- return _ref.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](substringFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$substring', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, 'str', false), new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, 'start', false), new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, 'end', false)], block);
- return func;
- }
- function createLengthFun() {
- var lengthFun = /*#__PURE__*/function () {
- var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2(sto, _) {
- var str, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- str = sto.applyStore("str");
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, Object(_typeSystem_parsers__WEBPACK_IMPORTED_MODULE_4__["toInt"])(str.value.length));
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
- return _context2.abrupt("return", sto);
- case 5:
- case "end":
- return _context2.stop();
- }
- }
- }, _callee2);
- }));
- return function lengthFun(_x3, _x4) {
- return _ref2.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](lengthFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$length', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, 'str', false)], block);
- return func;
- }
- function createUppercaseFun() {
- var uppercaseFun = /*#__PURE__*/function () {
- var _ref3 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee3(sto, _) {
- var str, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- str = sto.applyStore("str");
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, str.get().toUpperCase());
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
- return _context3.abrupt("return", sto);
- case 5:
- case "end":
- return _context3.stop();
- }
- }
- }, _callee3);
- }));
- return function uppercaseFun(_x5, _x6) {
- return _ref3.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](uppercaseFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$uppercase', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, 'str', false)], block);
- return func;
- }
- function createLowercaseFun() {
- var lowercaseFun = /*#__PURE__*/function () {
- var _ref4 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee4(sto, _) {
- var str, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee4$(_context4) {
- while (1) {
- switch (_context4.prev = _context4.next) {
- case 0:
- str = sto.applyStore("str");
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, str.get().toLowerCase());
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
- return _context4.abrupt("return", sto);
- case 5:
- case "end":
- return _context4.stop();
- }
- }
- }, _callee4);
- }));
- return function lowercaseFun(_x7, _x8) {
- return _ref4.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](lowercaseFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$lowercase', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, 'str', false)], block);
- return func;
- }
- function createrCharAtFun() {
- var charAtFun = /*#__PURE__*/function () {
- var _ref5 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee5(sto, _) {
- var str, idx, temp;
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee5$(_context5) {
- while (1) {
- switch (_context5.prev = _context5.next) {
- case 0:
- str = sto.applyStore("str");
- idx = sto.applyStore("index");
- if (!(idx.get().toNumber() < 0 || idx.get().toNumber() >= str.get().length)) {
- _context5.next = 4;
- break;
- }
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_7__["ProcessorErrorFactory"].invalid_string_index(idx.get().toNumber(), str.get(), this.function_call_stack.pop());
- case 4:
- temp = new _store_value_store_value__WEBPACK_IMPORTED_MODULE_6__["StoreValue"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].CHAR, str.get().charAt(idx.get().toNumber()));
- sto.insertStore("$", temp);
- sto.mode = _modes__WEBPACK_IMPORTED_MODULE_5__["Modes"].RETURN;
- return _context5.abrupt("return", sto);
- case 8:
- case "end":
- return _context5.stop();
- }
- }
- }, _callee5, this);
- }));
- return function charAtFun(_x9, _x10) {
- return _ref5.apply(this, arguments);
- };
- }();
- var block = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["CommandBlock"]([], [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["SysCall"](charAtFun)]);
- var func = new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["Function"]('$charAt', _typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].CHAR, [new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].STRING, 'str', false), new _ast_commands__WEBPACK_IMPORTED_MODULE_2__["FormalParameter"](_typeSystem_types__WEBPACK_IMPORTED_MODULE_3__["Types"].INTEGER, 'index', false)], block);
- return func;
- }
- /***/ }),
- /***/ "./js/processor/modes.ts":
- /*!*******************************!*\
- !*** ./js/processor/modes.ts ***!
- \*******************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.Modes = void 0;
- exports.Modes = Object.freeze({
- RETURN: Symbol('mode:return'),
- BREAK: Symbol('mode:break'),
- PAUSE: Symbol('mode:pause'),
- RUN: Symbol('mode:run'),
- ABORT: Symbol('mode:abort')
- });
- /***/ }),
- /***/ "./js/processor/semantic/semanticAnalyser.js":
- /*!***************************************************!*\
- !*** ./js/processor/semantic/semanticAnalyser.js ***!
- \***************************************************/
- /*! exports provided: SemanticAnalyser */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SemanticAnalyser", function() { return SemanticAnalyser; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../error/processorErrorFactory */ "./js/processor/error/processorErrorFactory.js");
- /* harmony import */ var _definedFunctions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../definedFunctions */ "./js/processor/definedFunctions.js");
- /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../services/languageService */ "./js/services/languageService.js");
- /* harmony import */ var _ast_commands__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ast/commands */ "./js/ast/commands/index.js");
- /* harmony import */ var _ast_expressions_expression__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../ast/expressions/expression */ "./js/ast/expressions/expression.js");
- /* harmony import */ var _ast_expressions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../ast/expressions */ "./js/ast/expressions/index.js");
- /* harmony import */ var _ast_expressions_literal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../ast/expressions/literal */ "./js/ast/expressions/literal.js");
- /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../compatibilityTable */ "./js/processor/compatibilityTable.ts");
- /* harmony import */ var _compatibilityTable__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_compatibilityTable__WEBPACK_IMPORTED_MODULE_9__);
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../typeSystem/types */ "./js/typeSystem/types.ts");
- /* harmony import */ var _typeSystem_types__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__);
- /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
- /* harmony import */ var _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__);
- /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../typeSystem/multiType */ "./js/typeSystem/multiType.ts");
- /* harmony import */ var _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__);
- /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../util/config */ "./js/util/config.ts");
- /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_13__);
- /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../store/store */ "./js/processor/store/store.ts");
- /* harmony import */ var _store_store__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_store_store__WEBPACK_IMPORTED_MODULE_14__);
- /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../ast/ivprogParser */ "./js/ast/ivprogParser.js");
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- var SemanticAnalyser = /*#__PURE__*/function () {
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SemanticAnalyser, null, [{
- key: "analyseFromSource",
- value: function analyseFromSource(stringCode) {
- var parser = _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_15__["IVProgParser"].createParser(stringCode);
- var semantic = new SemanticAnalyser(parser.parseTree());
- return semantic.analyseTree();
- }
- }]);
- function SemanticAnalyser(ast) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SemanticAnalyser);
- this.ast = ast;
- this.lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_4__["LanguageService"].getCurrentLexer();
- var lexer = new this.lexerClass(null);
- this.literalNames = lexer.literalNames;
- this.symbolMap = null;
- this.currentFunction = null;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SemanticAnalyser, [{
- key: "pushMap",
- value: function pushMap() {
- if (this.symbolMap === null) {
- this.symbolMap = {
- map: {},
- next: null
- };
- } else {
- var n = {
- map: {},
- next: this.symbolMap
- };
- this.symbolMap = n;
- }
- }
- }, {
- key: "popMap",
- value: function popMap() {
- if (this.symbolMap !== null) {
- this.symbolMap = this.symbolMap.next;
- }
- }
- }, {
- key: "insertSymbol",
- value: function insertSymbol(id, typeInfo) {
- this.symbolMap.map[id] = typeInfo;
- }
- }, {
- key: "findSymbol",
- value: function findSymbol(id, symbol_map) {
- if (!symbol_map.map[id]) {
- if (symbol_map.next) {
- return this.findSymbol(id, symbol_map.next);
- }
- return null;
- } else {
- return symbol_map.map[id];
- }
- }
- }, {
- key: "getMainFunction",
- value: function getMainFunction() {
- return this.ast.functions.find(function (v) {
- return v.isMain;
- });
- }
- }, {
- key: "findFunction",
- value: function findFunction(name) {
- if (name.match(/^\$.+$/)) {
- var fun = _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getFunction(name);
- if (!fun) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].not_implemented(name);
- }
- return fun;
- } else {
- var val = this.ast.functions.find(function (v) {
- return v.name === name;
- });
- if (!val) {
- return null;
- }
- return val;
- }
- }
- }, {
- key: "analyseTree",
- value: function analyseTree() {
- var globalVars = this.ast.global;
- this.pushMap();
- this.assertDeclarations(globalVars);
- var functions = this.ast.functions;
- var mainFunc = functions.filter(function (f) {
- return f.name === null;
- });
- if (mainFunc.length <= 0) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].main_missing();
- }
- for (var i = 0; i < functions.length; i++) {
- var fun = functions[i];
- this.assertFunction(fun);
- }
- return this.ast;
- }
- }, {
- key: "assertDeclarations",
- value: function assertDeclarations(list) {
- for (var i = 0; i < list.length; i++) {
- this.assertDeclaration(list[i]);
- }
- }
- }, {
- key: "assertDeclaration",
- value: function assertDeclaration(declaration) {
- if (declaration instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["ArrayDeclaration"]) {
- this.assertArrayDeclaration(declaration);
- this.insertSymbol(declaration.id, {
- id: declaration.id,
- lines: declaration.lines,
- columns: declaration.columns,
- type: declaration.type,
- isConst: declaration.isConst
- });
- } else {
- if (declaration.initial === null) {
- this.insertSymbol(declaration.id, {
- id: declaration.id,
- type: declaration.type,
- isConst: declaration.isConst
- });
- return;
- }
- var resultType = this.evaluateExpressionType(declaration.initial);
- if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
- if (!resultType.isCompatible(declaration.type)) {
- var stringInfo = declaration.type.stringInfo();
- var info = stringInfo[0];
- var result_string_info = resultType.stringInfo();
- var result_info = result_string_info[0];
- var exp = declaration.initial;
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_full(info.type, info.dim, result_info.type, result_info.dim, exp.toString(), declaration.sourceInfo);
- }
- this.insertSymbol(declaration.id, {
- id: declaration.id,
- type: declaration.type,
- isConst: declaration.isConst
- });
- } else if (!declaration.type.isCompatible(resultType) && !_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !declaration.type.isCompatible(resultType) && _util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting && !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(declaration.type, resultType)) {
- var _stringInfo = declaration.type.stringInfo();
- var _info = _stringInfo[0];
- var _result_string_info = resultType.stringInfo();
- var _result_info = _result_string_info[0];
- var _exp = declaration.initial;
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_full(_info.type, _info.dim, _result_info.type, _result_info.dim, _exp.toString(), declaration.sourceInfo);
- } else {
- this.insertSymbol(declaration.id, {
- id: declaration.id,
- type: declaration.type,
- isConst: declaration.isConst
- });
- }
- }
- }
- }, {
- key: "assertArrayDeclaration",
- value: function assertArrayDeclaration(declaration) {
- if (declaration.initial === null) {
- var lineType = this.evaluateExpressionType(declaration.lines);
- if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(declaration.sourceInfo);
- }
- if (declaration.columns !== null) {
- var columnType = this.evaluateExpressionType(declaration.columns);
- if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(declaration.sourceInfo);
- }
- }
- } else {
- this.evaluateArrayLiteral(declaration);
- }
- this.insertSymbol(declaration.id, {
- id: declaration.id,
- lines: declaration.lines,
- columns: declaration.columns,
- type: declaration.type
- });
- return;
- }
- }, {
- key: "evaluateExpressionType",
- value: function evaluateExpressionType(expression) {
- // TODO: Throw operator error in case type == UNDEFINED
- if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["UnaryApp"]) {
- var op = expression.op;
- var resultType = this.evaluateExpressionType(expression.left);
- var finalResult = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_9__["resultTypeAfterUnaryOp"])(op, resultType);
- if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].UNDEFINED.isCompatible(finalResult)) {
- var stringInfo = resultType.stringInfo();
- var info = stringInfo[0];
- var expString = expression.toString();
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_unary_op_full(expString, op, info.type, info.dim, expression.sourceInfo);
- }
- return finalResult;
- } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["InfixApp"]) {
- var _op = expression.op;
- var resultTypeLeft = this.evaluateExpressionType(expression.left);
- var resultTypeRight = this.evaluateExpressionType(expression.right);
- var _finalResult = Object(_compatibilityTable__WEBPACK_IMPORTED_MODULE_9__["resultTypeAfterInfixOp"])(_op, resultTypeLeft, resultTypeRight);
- if (_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].UNDEFINED.isCompatible(_finalResult)) {
- var stringInfoLeft = resultTypeLeft.stringInfo();
- var infoLeft = stringInfoLeft[0];
- var stringInfoRight = resultTypeRight.stringInfo();
- var infoRight = stringInfoRight[0];
- var _expString = expression.toString();
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_infix_op_full(_expString, _op, infoLeft.type, infoLeft.dim, infoRight.type, infoRight.dim, expression.sourceInfo);
- }
- return _finalResult;
- } else if (expression instanceof _ast_expressions_literal__WEBPACK_IMPORTED_MODULE_8__["Literal"]) {
- return this.evaluateLiteralType(expression);
- } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["FunctionCall"]) {
- if (expression.isMainCall) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].void_in_expression_full(_definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getMainFunctionName(), expression.sourceInfo);
- }
- var fun = this.findFunction(expression.id);
- if (fun === null) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].function_missing_full(expression.id, expression.sourceInfo);
- }
- if (fun.returnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].VOID)) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].void_in_expression_full(expression.id, expression.sourceInfo);
- }
- this.assertParameters(fun, expression.actualParameters);
- return fun.returnType;
- } else if (expression instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["ArrayAccess"]) {
- var arrayTypeInfo = this.findSymbol(expression.id, this.symbolMap);
- if (arrayTypeInfo === null) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(expression.id, expression.sourceInfo);
- }
- if (!(arrayTypeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"])) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_array_access_full(expression.id, expression.sourceInfo);
- }
- var lineType = this.evaluateExpressionType(expression.line);
- if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(expression.sourceInfo);
- }
- if (expression.column !== null) {
- if (arrayTypeInfo.columns === null) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_matrix_access_full(expression.id, expression.sourceInfo);
- }
- var columnType = this.evaluateExpressionType(expression.column);
- if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(expression.sourceInfo);
- }
- }
- var arrType = arrayTypeInfo.type;
- if (expression.column !== null) {
- // indexing matrix
- return arrType.innerType;
- } else {
- if (arrayTypeInfo.columns === null) {
- return arrType.innerType;
- }
- return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](arrType.innerType, 1);
- }
- }
- }
- }, {
- key: "evaluateLiteralType",
- value: function evaluateLiteralType(literal) {
- if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["IntLiteral"]) {
- return literal.type;
- } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["RealLiteral"]) {
- return literal.type;
- } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["StringLiteral"]) {
- return literal.type;
- } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["BoolLiteral"]) {
- return literal.type;
- } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["CharLiteral"]) {
- return literal.type;
- } else if (literal instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["VariableLiteral"]) {
- var typeInfo = this.findSymbol(literal.id, this.symbolMap);
- if (typeInfo === null) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(literal.id, literal.sourceInfo);
- }
- if (typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
- return typeInfo.type;
- }
- return typeInfo.type;
- } else {
- // console.warn("Evaluating type only for an array literal...");
- var last = null;
- if (literal.value.length === 1) {
- last = this.evaluateExpressionType(literal.value[0]);
- } else {
- for (var i = 0; i < literal.value.length; i++) {
- var e = this.evaluateExpressionType(literal.value[i]);
- if (last === null) {
- last = e;
- } else if (!last.isCompatible(e)) {
- var strInfo = last.stringInfo();
- var info = strInfo[0];
- var strExp = literal.toString();
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_array_full(strExp, info.type, info.dim, literal.sourceInfo);
- }
- }
- }
- if (last instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
- return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](last.innerType, last.dimensions + 1);
- }
- return new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](last, 1);
- }
- }
- }, {
- key: "evaluateArrayLiteral",
- value: function evaluateArrayLiteral(arrayDeclaration) {
- var type = arrayDeclaration.type;
- var literal = arrayDeclaration.initial; // console.log(arrayDeclaration);
- if (arrayDeclaration.isVector) {
- this.evaluateVectorLiteralType(literal, type);
- } else {
- // TODO matrix type check
- for (var i = 0; i < literal.lines; ++i) {
- var line_literal = literal.value[i];
- this.evaluateVectorLiteralType(line_literal, new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](type.innerType, 1));
- }
- }
- return true;
- }
- }, {
- key: "assertFunction",
- value: function assertFunction(fun) {
- var _this = this;
- this.pushMap();
- this.currentFunction = fun;
- fun.formalParameters.forEach(function (formalParam) {
- if (formalParam.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
- if (formalParam.type.dimensions > 1) {
- _this.insertSymbol(formalParam.id, {
- id: formalParam.id,
- lines: -1,
- columns: -1,
- type: formalParam.type
- });
- } else {
- _this.insertSymbol(formalParam.id, {
- id: formalParam.id,
- lines: -1,
- columns: null,
- type: formalParam.type
- });
- }
- } else {
- _this.insertSymbol(formalParam.id, {
- id: formalParam.id,
- type: formalParam.type
- });
- }
- });
- this.assertDeclarations(fun.variablesDeclarations);
- var optional = fun.returnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].VOID);
- var valid = this.assertReturn(fun, optional);
- if (!valid) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].function_no_return(fun.name);
- }
- this.popMap();
- }
- }, {
- key: "assertReturn",
- value: function assertReturn(fun, optional) {
- var _this2 = this;
- return fun.commands.reduce(function (last, next) {
- return _this2.checkCommand(fun.returnType, next, optional) || last;
- }, optional);
- }
- }, {
- key: "checkCommand",
- value: function checkCommand(type, cmd, optional) {
- if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["While"]) {
- var resultType = this.evaluateExpressionType(cmd.expression);
- if (!resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].BOOLEAN)) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].loop_condition_type_full(cmd.expression.toString(), cmd.sourceInfo);
- }
- this.checkCommands(type, cmd.commands, optional);
- return false;
- } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["For"]) {
- var var_type = this.evaluateExpressionType(cmd.for_id);
- if (!var_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_variable(cmd.for_id, cmd.sourceInfo);
- }
- var from_type = this.evaluateExpressionType(cmd.for_from);
- if (!from_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_from(cmd.for_from, cmd.sourceInfo);
- }
- var to_type = this.evaluateExpressionType(cmd.for_to);
- if (!to_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_to(cmd.for_to, cmd.sourceInfo);
- }
- if (cmd.for_pass != null) {
- var pass_type = this.evaluateExpressionType(cmd.for_pass);
- if (!pass_type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_for_pass(cmd.for_pass, cmd.sourceInfo);
- }
- }
- this.checkCommands(type, cmd.commands, optional);
- return false;
- } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Switch"]) {
- var sType = this.evaluateExpressionType(cmd.expression);
- var result = optional;
- var hasDefault = false;
- for (var i = 0; i < cmd.cases.length; i++) {
- var aCase = cmd.cases[i];
- if (aCase.expression !== null) {
- var caseType = this.evaluateExpressionType(aCase.expression);
- if (!sType.isCompatible(caseType)) {
- var strInfo = sType.stringInfo();
- var info = strInfo[0];
- var strExp = aCase.expression.toString();
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_case_type_full(strExp, info.type, info.dim, aCase.sourceInfo);
- }
- } else {
- hasDefault = true;
- }
- result = result && this.checkCommands(type, aCase.commands, result);
- }
- return result && hasDefault;
- } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["ArrayIndexAssign"]) {
- // TODO - rework!!!!!
- var used_dims = 0;
- var typeInfo = this.findSymbol(cmd.id, this.symbolMap);
- if (typeInfo === null) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(cmd.id, cmd.sourceInfo);
- }
- if (typeInfo.isConst) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
- }
- if (!(typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"])) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_array_access_full(cmd.id, cmd.sourceInfo);
- }
- var exp = cmd.expression;
- var lineExp = cmd.line;
- var lineType = this.evaluateExpressionType(lineExp);
- if (!lineType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
- }
- used_dims += 1;
- var columnExp = cmd.column;
- if (typeInfo.columns === null && columnExp !== null) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_matrix_access_full(cmd.id, cmd.sourceInfo);
- } else if (columnExp !== null) {
- var columnType = this.evaluateExpressionType(columnExp);
- if (!columnType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER)) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].array_dimension_not_int_full(cmd.sourceInfo);
- }
- used_dims += 1;
- } // exp a single value exp or an array access
- var exp_type = this.evaluateExpressionType(exp);
- var access_type = typeInfo.type;
- var compatible = false;
- if (exp_type instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
- var _type = access_type;
- if (access_type.dimensions - used_dims == 0) {
- _type = access_type.innerType;
- } else {
- _type = new _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"](access_type.innerType, Math.max(0, access_type.dimensions - used_dims));
- }
- compatible = exp_type.isCompatible(_type);
- } else {
- compatible = access_type.canAccept(exp_type, used_dims);
- }
- if (!compatible) {
- if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(access_type, exp_type)) {
- var access_type_string_info = access_type.stringInfo();
- var access_type_info = access_type_string_info[0];
- var exp_type_string_info = exp_type.stringInfo();
- var exp_type_info = exp_type_string_info[0];
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_full(access_type_info.type, access_type_info.dim - used_dims, exp_type_info.type, exp_type_info.dim, exp.toString(), cmd.sourceInfo);
- }
- }
- return optional;
- } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Assign"]) {
- // TODO - rework since there is no literal array assignment
- var _typeInfo = this.findSymbol(cmd.id, this.symbolMap);
- if (_typeInfo === null) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].symbol_not_found_full(cmd.id, cmd.sourceInfo);
- }
- if (_typeInfo.isConst) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_const_assignment_full(cmd.id, cmd.sourceInfo);
- }
- var _exp2 = cmd.expression;
- var _exp_type = this.evaluateExpressionType(_exp2);
- if (_exp_type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"]) {
- if (!(_typeInfo.type instanceof _typeSystem_array_type__WEBPACK_IMPORTED_MODULE_11__["ArrayType"])) {
- // TODO better error message
- throw new Error("Cannot assign an array to a non-array variable ");
- } // Both are arrays...
- // if both don't have same dimensions and type, cannot perform assignment
- if (!_exp_type.isCompatible(_typeInfo.type)) {
- if (_exp_type.dimensions === _typeInfo.type.dimensions && !_exp_type.innerType.isCompatible(_typeInfo.type.innerType)) {
- if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(_typeInfo.type.innerType, _exp_type.innerType)) {
- var stringInfo = _typeInfo.type.stringInfo();
- var _info2 = stringInfo[0];
- var _exp_type_string_info = _exp_type.stringInfo();
- var _exp_type_info = _exp_type_string_info[0];
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_full(_info2.type, _info2.dim, _exp_type_info.type, _exp_type_info.dim, _exp2.toString(), cmd.sourceInfo);
- }
- } else {
- switch (_exp_type.dimensions) {
- case 1:
- {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].vector_to_matrix_attr(cmd.id, _exp2.toString(), cmd.sourceInfo);
- }
- case 2:
- {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].matrix_to_vector_attr(cmd.id, _exp2.toString(), cmd.sourceInfo);
- }
- }
- }
- }
- } else if (!_exp_type.isCompatible(_typeInfo.type)) {
- if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(_typeInfo.type, _exp_type)) {
- var _stringInfo2 = _typeInfo.type.stringInfo();
- var _info3 = _stringInfo2[0];
- var _exp_type_string_info2 = _exp_type.stringInfo();
- var _exp_type_info2 = _exp_type_string_info2[0];
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_full(_info3.type, _info3.dim, _exp_type_info2.type, _exp_type_info2.dim, _exp2.toString(), cmd.sourceInfo);
- }
- }
- return optional;
- } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Break"]) {
- return optional;
- } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["IfThenElse"]) {
- var _resultType = this.evaluateExpressionType(cmd.condition);
- if (!_resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].BOOLEAN)) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].if_condition_type_full(cmd.condition.toString(), cmd.sourceInfo);
- }
- if (cmd.ifFalse instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["IfThenElse"]) {
- return this.checkCommands(type, cmd.ifTrue.commands, optional) && this.checkCommand(type, cmd.ifFalse, optional);
- } else if (cmd.ifFalse != null) {
- return this.checkCommands(type, cmd.ifTrue.commands, optional) && this.checkCommands(type, cmd.ifFalse.commands, optional);
- } else {
- return this.checkCommands(type, cmd.ifTrue.commands, optional);
- }
- } else if (cmd instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["FunctionCall"]) {
- var fun = null;
- if (cmd.isMainCall) {
- fun = this.getMainFunction();
- } else {
- fun = this.findFunction(cmd.id);
- }
- if (fun === null) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].function_missing_full(cmd.id, cmd.sourceInfo);
- }
- this.assertParameters(fun, cmd.actualParameters);
- return optional;
- } else if (cmd instanceof _ast_commands__WEBPACK_IMPORTED_MODULE_5__["Return"]) {
- var funcName = this.currentFunction.isMain ? _definedFunctions__WEBPACK_IMPORTED_MODULE_3__["LanguageDefinedFunction"].getMainFunctionName() : this.currentFunction.name;
- if (cmd.expression === null && !type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].VOID)) {
- var _stringInfo3 = type.stringInfo();
- var _info4 = _stringInfo3[0];
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_void_return_full(funcName, _info4.type, _info4.dim, cmd.sourceInfo);
- } else if (cmd.expression !== null) {
- var _resultType2 = this.evaluateExpressionType(cmd.expression);
- if (!type.isCompatible(_resultType2)) {
- if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(type, _resultType2)) {
- var _stringInfo4 = type.stringInfo();
- var _info5 = _stringInfo4[0];
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_return_type_full(funcName, _info5.type, _info5.dim, cmd.sourceInfo);
- }
- }
- return true;
- } else {
- return true;
- }
- }
- }
- }, {
- key: "checkCommands",
- value: function checkCommands(type, cmds, optional) {
- var _this3 = this;
- return cmds.reduce(function (last, next) {
- return _this3.checkCommand(type, next, optional) || last;
- }, optional);
- }
- /**
- *
- * @param {import('./../../ast/commands/function').Function} fun
- * @param {Expression[]} actualParametersList
- */
- }, {
- key: "assertParameters",
- value: function assertParameters(fun, actualParametersList) {
- var parameterList = fun.formalParameters;
- if (parameterList.length > actualParametersList.length || parameterList.length !== actualParametersList.length && !fun.hasVariadic()) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameters_size_full(fun.name, actualParametersList.length, fun.formalParameters.length, null);
- }
- for (var i = 0, j = 0; i < parameterList.length && j < actualParametersList.length; i += 1, j += 1) {
- var formalParam = parameterList[i];
- if (formalParam.variadic && i + 1 !== parameterList.length) {
- throw "A function variadic parameter must be its last parameter!";
- }
- if (formalParam.variadic) {
- j = this.assertVariadicParameter(fun, formalParam, j, actualParametersList);
- } else {
- var param = actualParametersList[j];
- this.assertParameter(fun, formalParam, param);
- }
- }
- }
- }, {
- key: "evaluateVectorLiteralType",
- value: function evaluateVectorLiteralType(literal, type) {
- // console.log(literal);
- for (var i = 0; i < literal.value.length; i += 1) {
- var exp = literal.value[i];
- var expType = this.evaluateExpressionType(exp);
- var compatible = false;
- if (expType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
- compatible = expType.isCompatible(type.innerType);
- } else {
- compatible = type.canAccept(expType, 1);
- }
- if (!compatible) {
- if (!_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting || !_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(type.innerType, expType)) {
- var stringInfo = type.stringInfo();
- var info = stringInfo[0];
- var result_string_info = expType.stringInfo();
- var result_info = result_string_info[0];
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].incompatible_types_full(info.type, 0, result_info.type, result_info.dim, exp.toString(), literal.sourceInfo);
- }
- }
- }
- return type;
- }
- /**
- *
- * @param {import('./../../ast/commands/function').Function} fun
- * @param {import('./../../ast/commands/formalParameter').FormalParameter} formalParam
- * @param {number} index
- * @param {Expression[]} actualParametersList
- */
- }, {
- key: "assertVariadicParameter",
- value: function assertVariadicParameter(fun, formalParam, index, actualParametersList) {
- var i;
- for (i = index; i < actualParametersList.length; i += 1) {
- this.assertParameter(fun, formalParam, actualParametersList[i]);
- }
- return i - 1;
- }
- /**
- *
- * @param {import('./../../ast/commands/function').Function} fun
- * @param {import('./../../ast/commands/formalParameter').FormalParameter} formalParam
- * @param {Expression} actualParameter
- */
- }, {
- key: "assertParameter",
- value: function assertParameter(fun, formalParam, actualParameter) {
- // const id = formalParam.id;
- if (formalParam.byRef) {
- if (actualParameter instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["VariableLiteral"]) {
- var variable = this.findSymbol(actualParameter.id, this.symbolMap);
- if (variable.isConst) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_const_ref_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
- }
- } else if (!(actualParameter instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["VariableLiteral"] || actualParameter instanceof _ast_expressions__WEBPACK_IMPORTED_MODULE_7__["ArrayAccess"])) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
- }
- }
- var resultType = this.evaluateExpressionType(actualParameter);
- if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"] && formalParam.type instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
- var shared = 0;
- for (var j = 0; j < resultType.types.length; ++j) {
- var element = resultType.types[j];
- if (formalParam.type.types.indexOf(element) !== -1) {
- shared += 1;
- }
- }
- if (shared <= 0) {
- if (_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting && !formalParam.byRef) {
- if (!resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER) && !resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].REAL) || formalParam.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER) || formalParam.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].REAL)) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
- }
- }
- }
- } else if (resultType instanceof _typeSystem_multiType__WEBPACK_IMPORTED_MODULE_12__["MultiType"]) {
- if (!resultType.isCompatible(formalParam.type)) {
- if (_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting && !formalParam.byRef) {
- if (!resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER) && !resultType.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].REAL) || formalParam.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].INTEGER) || formalParam.type.isCompatible(_typeSystem_types__WEBPACK_IMPORTED_MODULE_10__["Types"].REAL)) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
- }
- }
- }
- } else if (!formalParam.type.isCompatible(resultType)) {
- if (_util_config__WEBPACK_IMPORTED_MODULE_13__["Config"].enable_type_casting && !formalParam.byRef) {
- if (!_store_store__WEBPACK_IMPORTED_MODULE_14__["Store"].canImplicitTypeCast(formalParam.type, resultType)) {
- throw _error_processorErrorFactory__WEBPACK_IMPORTED_MODULE_2__["ProcessorErrorFactory"].invalid_parameter_type_full(fun.name, actualParameter.toString(), actualParameter.sourceInfo);
- }
- }
- }
- }
- }]);
- return SemanticAnalyser;
- }();
- /***/ }),
- /***/ "./js/processor/store/store.ts":
- /*!*************************************!*\
- !*** ./js/processor/store/store.ts ***!
- \*************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.Store = void 0;
- /* eslint-disable @typescript-eslint/no-non-null-assertion */
- const modes_1 = __webpack_require__(/*! ../modes */ "./js/processor/modes.ts");
- const types_1 = __webpack_require__(/*! ../../typeSystem/types */ "./js/typeSystem/types.ts");
- const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
- const storeObjectRef_1 = __webpack_require__(/*! ./storeObjectRef */ "./js/processor/store/storeObjectRef.ts");
- const array_type_1 = __webpack_require__(/*! ../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
- const array_store_value_1 = __webpack_require__(/*! ./value/array_store_value */ "./js/processor/store/value/array_store_value.ts");
- const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
- const storeObjectArray_1 = __webpack_require__(/*! ./storeObjectArray */ "./js/processor/store/storeObjectArray.ts");
- const store_value_1 = __webpack_require__(/*! ./value/store_value */ "./js/processor/store/value/store_value.ts");
- const store_value_address_1 = __webpack_require__(/*! ./value/store_value_address */ "./js/processor/store/value/store_value_address.ts");
- const store_value_ref_1 = __webpack_require__(/*! ./value/store_value_ref */ "./js/processor/store/value/store_value_ref.ts");
- const array_store_value_ref_1 = __webpack_require__(/*! ./value/array_store_value_ref */ "./js/processor/store/value/array_store_value_ref.ts");
- const store_object_array_ref_1 = __webpack_require__(/*! ./store_object_array_ref */ "./js/processor/store/store_object_array_ref.ts");
- class Store {
- constructor(name) {
- this.name = name;
- this.store = new Map();
- this.mode = modes_1.Modes.RUN;
- }
- static canImplicitTypeCast(castType, sourceType) {
- if (castType.isCompatible(types_1.Types.INTEGER) || castType.isCompatible(types_1.Types.REAL)) {
- if (sourceType.isCompatible(types_1.Types.INTEGER) || sourceType.isCompatible(types_1.Types.REAL)) {
- return true;
- }
- }
- return false;
- }
- static doImplicitCasting(castType, stoObj) {
- if (!Store.canImplicitTypeCast(castType, stoObj.type)) {
- throw new Error("!!!Critical error: attempted to type cast invalid types");
- }
- if (castType.isCompatible(types_1.Types.INTEGER)) {
- return new store_value_1.StoreValue(types_1.Types.INTEGER, stoObj.get().trunc());
- }
- else {
- return new store_value_1.StoreValue(types_1.Types.REAL, stoObj.get());
- }
- }
- extendStore(nextStore) {
- this.nextStore = nextStore;
- }
- applyStore(id) {
- if (!this.store.has(id)) {
- if (this.nextStore != null) {
- return this.nextStore.applyStore(id);
- }
- else {
- throw new Error(`Variable ${id} not found.`);
- }
- }
- const val = this.store.get(id);
- let result = null;
- if (val.type instanceof array_type_1.ArrayType) {
- const array = val;
- const array_type = array.type;
- let l = 0, c = 0;
- const values = array.value.map(v => {
- if (array.isVector) {
- return new store_value_address_1.StoreValueAddress(array_type.innerType, v, l++, undefined, array.id, array.readOnly);
- }
- else {
- if (c >= array.columns) {
- c = 0;
- l += 1;
- }
- return new store_value_address_1.StoreValueAddress(array_type.innerType, v, l, c++, array.id, array.readOnly);
- }
- });
- result = new array_store_value_1.ArrayStoreValue(array_type, values, array.lines, array.columns, val.id, val.readOnly);
- }
- else {
- result = new store_value_1.StoreValue(val.type, val.value, val.id, val.readOnly);
- }
- return result;
- }
- updateStore(id, stoValue) {
- if (!this.store.has(id)) {
- if (this.nextStore != null) {
- this.nextStore.updateStore(id, stoValue);
- return this;
- }
- else {
- // TODO: better error message
- throw new Error(`Variable ${id} not found.`);
- }
- }
- else {
- const oldObj = this.store.get(id);
- if (oldObj.readOnly) {
- // TODO: better error message
- throw new Error("Cannot change value of a read only variable: " + id);
- }
- if (oldObj instanceof storeObjectArray_1.StoreObjectArray) {
- const array_value = stoValue;
- if (oldObj.isCompatible(array_value)) {
- if (oldObj.isVector) {
- array_value.get().forEach((val, index) => {
- oldObj.setAt(val, index, undefined);
- });
- }
- else {
- let line = 0;
- let column = 0;
- array_value.get().forEach((val) => {
- oldObj.setAt(val, line, column);
- column += 1;
- if (column >= oldObj.columns) {
- line += 1;
- column = 0;
- }
- });
- }
- return this;
- }
- }
- else if (oldObj.isCompatible(stoValue)) {
- const loc_address = oldObj.locAddress;
- location_1.Location.updateAddress(loc_address, stoValue.get());
- return this;
- }
- const oldType = oldObj.type;
- const stoType = stoValue.type;
- // TODO: better error message
- throw new Error(`${oldType.value} is not compatible with type ${stoType.value} given`);
- }
- }
- /**
- * Method used to update regions of an array (vector or matrix). The should only be used when update an specific
- * possition since it will only update the required addresses.
- * @param {string} id the variable id to be updated
- * @param {IStoreValue} sto_value the value to be used in the update process
- * @param {number} line the line address of the vector/matrix
- * @param {number} column the matrix column, which can be undefined
- */
- updateStoreArray(id, sto_value, line, column) {
- if (!this.store.has(id)) {
- if (this.nextStore != null) {
- this.nextStore.updateStoreArray(id, sto_value, line, column);
- return this;
- }
- else {
- // TODO: better error message
- throw new Error(`Variable ${id} not found.`);
- }
- }
- else {
- const oldObj = this.store.get(id);
- if (oldObj.readOnly) {
- // TODO: better error message
- throw new Error("Cannot change value of a read only variable: " + id);
- }
- if (oldObj instanceof storeObjectArray_1.StoreObjectArray) {
- if (sto_value instanceof array_store_value_1.ArrayStoreValue) {
- // this must be a vector or matrix line update
- const actual_values = sto_value.get();
- if (oldObj.isVector && sto_value.isVector()) {
- for (let i = 0; i < sto_value.lines; i += 1) {
- const val = actual_values[i];
- oldObj.setAt(val, i, undefined);
- }
- }
- else if (!oldObj.isVector && column == null && sto_value.isVector()) {
- for (let i = 0; i < oldObj.columns; i += 1) {
- const val = actual_values[i];
- oldObj.setAt(val, line, i);
- }
- }
- else {
- // TODO: better error message
- throw new Error(`Attempting to assign an invalid value to array ${id}`);
- }
- }
- else {
- if (!oldObj.isVector && column == null) {
- // TODO: better error message
- throw new Error(`Attempting to assign an invalid value to array ${id}`);
- }
- oldObj.setAt(sto_value, line, column);
- }
- }
- else {
- throw new Error("Cannot update a non-array variable using updateStoreArray");
- }
- // const oldType = oldObj.type;
- // const stoType = sto_value.type;
- // // TODO: better error message
- // throw new Error(`${oldType.value} is not compatible with type ${stoType.value} given`);
- return this;
- }
- }
- /**
- * Inserts a new variable into the Store. This method should be used when declaring a new variable,
- * including the special return variable $.
- * @param id variable id
- * @param stoValue the value to be used as the initial value of id
- */
- insertStore(id, stoValue) {
- if (this.store.has(id)) {
- // TODO: better error message
- throw new Error(`${id} is already defined`);
- }
- // TODO check for array....
- let newObj;
- if (stoValue instanceof store_value_ref_1.StoreValueRef) {
- newObj = new storeObjectRef_1.StoreObjectRef(stoValue);
- }
- else if (stoValue instanceof array_store_value_ref_1.ArrayStoreValueRef) {
- newObj = new store_object_array_ref_1.StoreObjectArrayRef(stoValue, stoValue.lines, stoValue.columns);
- }
- else if (stoValue instanceof array_store_value_1.ArrayStoreValue) {
- const columns = stoValue.isVector() ? 0 : stoValue.columns;
- const addresses = [];
- const all_values = stoValue.get();
- if (all_values.length > 0) {
- for (let i = 0; i < stoValue.get().length; i += 1) {
- const val = all_values[i].get();
- addresses.push(location_1.Location.allocate(val));
- }
- }
- else {
- let total = stoValue.lines;
- total = stoValue.isVector() ? total : total * columns;
- for (let i = 0; i < total; i += 1) {
- addresses.push(location_1.Location.allocate(null));
- }
- }
- newObj = new storeObjectArray_1.StoreObjectArray(stoValue.type, stoValue.lines, columns, addresses, stoValue.isConst);
- }
- else {
- const loc_address = location_1.Location.allocate(stoValue.get());
- newObj = new storeObject_1.StoreObject(stoValue.type, loc_address, stoValue.isConst);
- }
- newObj.setID(id);
- this.store.set(id, newObj);
- return this;
- }
- /**
- * Helper function similar to applyStore. But it returns the actual object in the store be it ref or not
- * applyStore will return the refferenced object if the object in the store is a ref
- */
- getStoreObject(id) {
- if (!this.store.has(id)) {
- if (this.nextStore != null) {
- return this.nextStore.getStoreObject(id);
- }
- else {
- throw new Error(`Variable ${id} not found.`);
- }
- }
- return this.store.get(id);
- }
- destroy() {
- this.store.forEach(sto => sto.destroy(), this);
- }
- isDefined(id) {
- if (!this.store.has(id)) {
- if (this.nextStore != null) {
- return this.nextStore.isDefined(id);
- }
- else {
- return false;
- }
- }
- return true;
- }
- }
- exports.Store = Store;
- /***/ }),
- /***/ "./js/processor/store/storeObject.ts":
- /*!*******************************************!*\
- !*** ./js/processor/store/storeObject.ts ***!
- \*******************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.StoreObject = void 0;
- const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
- class StoreObject {
- /**
- *
- * @param {Type} type
- * @param {Number} loc_address
- * @param {Boolean} readOnly
- */
- constructor(type, loc_address, readOnly = false) {
- this._loc_address = loc_address;
- this._type = type;
- this._readOnly = readOnly;
- this._id = undefined;
- }
- setID(id) {
- this._id = id;
- }
- get id() {
- return this._id;
- }
- get inStore() {
- return this.id !== null;
- }
- get type() {
- return this._type;
- }
- /**
- * Returns the actual value stored at the loccation address present in this object.
- * The returned value is compatible with @prop{StoreObject.type}
- */
- get value() {
- const address = location_1.Location.find(this._loc_address);
- if (address != null) {
- return address.value;
- }
- else {
- throw new Error("!!!Critical Error: variable " + this.id + " does not have a valid address. Loc-Address " + this.locAddress);
- }
- }
- get number() {
- throw new Error("DOT NOT USE THIS PROPERTY!");
- }
- get readOnly() {
- return this._readOnly;
- }
- set readOnly(value) {
- this._readOnly = value;
- }
- isCompatible(another) {
- return this.type.isCompatible(another.type);
- }
- destroy() {
- return location_1.Location.deallocate(this._loc_address);
- }
- get locAddress() {
- return this._loc_address;
- }
- }
- exports.StoreObject = StoreObject;
- /***/ }),
- /***/ "./js/processor/store/storeObjectArray.ts":
- /*!************************************************!*\
- !*** ./js/processor/store/storeObjectArray.ts ***!
- \************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.StoreObjectArray = void 0;
- const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
- const array_store_value_1 = __webpack_require__(/*! ./value/array_store_value */ "./js/processor/store/value/array_store_value.ts");
- const location_1 = __webpack_require__(/*! ../../memory/location */ "./js/memory/location.ts");
- class StoreObjectArray extends storeObject_1.StoreObject {
- constructor(type, _lines, _columns, loc_addresses, readOnly = false) {
- super(type, -1, readOnly);
- this._lines = _lines;
- this._columns = _columns;
- this.loc_addresses = loc_addresses;
- }
- get lines() {
- return this._lines;
- }
- get columns() {
- return this._columns;
- }
- isCompatible(another) {
- if (another instanceof array_store_value_1.ArrayStoreValue) {
- const cols = another.columns == null ? 0 : another.columns;
- if (this.lines === another.lines && this.columns === cols) {
- return super.isCompatible(another);
- }
- }
- return false;
- }
- get isVector() {
- return this.type.dimensions === 1;
- }
- /**@override
- * Returns the list of values stored by this array.
- * All returned values are compatible with @prop{StoreObject.type}
- */
- get value() {
- const values = [];
- for (let i = 0; i < this.addresses.length; i += 1) {
- const address = location_1.Location.find(this.addresses[i]);
- if (address != null) {
- values.push(address.value);
- }
- else {
- throw new Error("!!!Critical Error: variable " + this.id + " does not have a valid address. Loc-Address " + this.locAddress);
- }
- }
- return values;
- }
- destroy() {
- let bool = true;
- for (let i = 0; i < this.addresses.length; i += 1) {
- bool = bool && location_1.Location.deallocate(this.addresses[i]);
- }
- return bool;
- }
- /**
- * @override
- *
- * Returns the address that contains a list of all addresses of the values present in the array
- */
- get locAddress() {
- throw new Error("!!!Internal Error: Cannot invoke locAddress on StoreObjectArray");
- }
- get addresses() {
- return this.loc_addresses;
- }
- getAt(line, column) {
- if (this.isVector) {
- if (column != null) {
- throw new Error(this.id + " is not a matrix!");
- }
- column = line;
- line = 0;
- }
- else if (column == null) {
- // this is a whole line...
- const values = [];
- for (let col = 0; col < this.columns; col += 1) {
- const index = this.getIndexOf(line, col);
- const address = location_1.Location.find(this.addresses[index]);
- values.push(address.value);
- }
- return values;
- }
- const index = this.getIndexOf(line, column);
- const address = location_1.Location.find(this.addresses[index]);
- return address.value;
- }
- setAt(value, line, column) {
- let used_dims = 1;
- if (column != null) {
- used_dims += 1;
- }
- if (!this.type.canAccept(value.type, used_dims)) {
- throw new Error("!!!Internal Error: Attempting to insert an invalid value inside array " + this.id);
- }
- if (this.isVector) {
- if (column != null) {
- throw new Error(this.id + " is not a matrix!");
- }
- column = line;
- line = 0;
- }
- else if (column == null) {
- throw new Error("!!!Internal Error: Attempting to insert a line into matrix " + this.id);
- }
- const pos = this.getIndexOf(line, column);
- location_1.Location.updateAddress(this.addresses[pos], value.get());
- }
- getIndexOf(line, column) {
- return line * this.columns + column;
- }
- getLocAddressOf(line, column) {
- if (this.isVector) {
- if (column != null) {
- throw new Error(this.id + " is not a matrix!");
- }
- column = line;
- line = 0;
- }
- else if (column == null) {
- // this is a whole line...
- const values = [];
- for (let col = 0; col < this.columns; col += 1) {
- const index = this.getIndexOf(line, col);
- values.push(this.addresses[index]);
- }
- return values;
- }
- const index = this.getIndexOf(line, column);
- return this.addresses[index];
- }
- }
- exports.StoreObjectArray = StoreObjectArray;
- /***/ }),
- /***/ "./js/processor/store/storeObjectRef.ts":
- /*!**********************************************!*\
- !*** ./js/processor/store/storeObjectRef.ts ***!
- \**********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.StoreObjectRef = void 0;
- const storeObject_1 = __webpack_require__(/*! ./storeObject */ "./js/processor/store/storeObject.ts");
- class StoreObjectRef extends storeObject_1.StoreObject {
- /**
- *
- * @param {StoreObject} stoValue
- */
- constructor(stoValue) {
- super(stoValue.type, stoValue.getRefAddress(), false);
- this.refObj = stoValue.id;
- this.reference_dimension = stoValue.getReferenceDimension();
- }
- get isRef() {
- return true;
- }
- getRefObj() {
- return this.refObj;
- }
- getReferenceDimension() {
- return this.reference_dimension;
- }
- destroy() {
- return false;
- }
- }
- exports.StoreObjectRef = StoreObjectRef;
- /***/ }),
- /***/ "./js/processor/store/store_object_array_ref.ts":
- /*!******************************************************!*\
- !*** ./js/processor/store/store_object_array_ref.ts ***!
- \******************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.StoreObjectArrayRef = void 0;
- const storeObjectArray_1 = __webpack_require__(/*! ./storeObjectArray */ "./js/processor/store/storeObjectArray.ts");
- class StoreObjectArrayRef extends storeObjectArray_1.StoreObjectArray {
- constructor(stoValue, lines, columns) {
- super(stoValue.type, lines, columns, stoValue.getAddresses(), false);
- this.refObj = stoValue.id;
- }
- get isRef() {
- return true;
- }
- getRefObj() {
- return this.refObj;
- }
- destroy() {
- return false;
- }
- }
- exports.StoreObjectArrayRef = StoreObjectArrayRef;
- /***/ }),
- /***/ "./js/processor/store/value/array_store_value.ts":
- /*!*******************************************************!*\
- !*** ./js/processor/store/value/array_store_value.ts ***!
- \*******************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.ArrayStoreValue = void 0;
- const array_type_1 = __webpack_require__(/*! ../../../typeSystem/array_type */ "./js/typeSystem/array_type.ts");
- const store_value_address_1 = __webpack_require__(/*! ./store_value_address */ "./js/processor/store/value/store_value_address.ts");
- class ArrayStoreValue {
- constructor(type, values, lines, columns, id, isConst = false) {
- this.type = type;
- this.id = id;
- this.isConst = isConst;
- this.values = values;
- this.lines = lines;
- this.columns = columns;
- }
- get() {
- return this.values;
- }
- /**
- * @deprecated
- * Potential not necessary since array access is occuring directly in the StoreObject
- * @param line
- * @param column
- */
- getAt(line, column) {
- console.log("Column ", column);
- if (this.isVector()) {
- if (column != null) {
- throw new Error(this.id + " is not a matrix!");
- }
- column = line;
- line = 0;
- }
- else if (column == null) {
- const values = [];
- for (let col = 0; col < this.columns; col += 1) {
- const index = line * this.lines + col;
- values.push(this.values[index]);
- }
- const array_type = this.type;
- const vector_type = new array_type_1.ArrayType(array_type.innerType, array_type.dimensions - 1);
- return new ArrayStoreValue(vector_type, values, this.columns, 0, this.id, this.isConst);
- }
- const index = line * this.lines + column;
- console.log("Get at: ", index);
- return this.values[index];
- }
- setAt(value, line, column) {
- let used_dims = 1;
- if (column != null) {
- used_dims += 1;
- }
- let actual_line = line;
- let actual_column = column;
- if (!this.type.canAccept(value.type, used_dims)) {
- throw new Error("!!!Internal Error: Attempting to insert an invalid value inside array " + this.id);
- }
- if (this.isVector()) {
- if (column != null) {
- throw new Error(this.id + " is not a matrix!");
- }
- actual_column = actual_line;
- actual_line = 0;
- }
- else if (column == null) {
- if (!(value instanceof ArrayStoreValue)) {
- throw new Error("Attempting to insert a single value as a line of matrix " + this.id);
- }
- const actual_values = value.get();
- for (let i = 0; i < this.columns; i += 1) {
- const pos = actual_line * this.columns + i;
- const val = actual_values[i];
- this.values[pos] = new store_value_address_1.StoreValueAddress(value.type, val.get(), actual_line, i, this.id, this.isConst);
- }
- }
- const columns = this.columns == null ? 0 : this.columns;
- const pos = actual_line * columns + actual_column;
- this.values[pos] = new store_value_address_1.StoreValueAddress(value.type, value.get(), line, column, this.id, this.isConst);
- }
- inStore() {
- return this.id != null;
- }
- isVector() {
- return this.type.dimensions == 1;
- }
- }
- exports.ArrayStoreValue = ArrayStoreValue;
- /***/ }),
- /***/ "./js/processor/store/value/array_store_value_ref.ts":
- /*!***********************************************************!*\
- !*** ./js/processor/store/value/array_store_value_ref.ts ***!
- \***********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.ArrayStoreValueRef = void 0;
- class ArrayStoreValueRef {
- constructor(type, values, addresses, lines, columns, id) {
- this.type = type;
- this.values = values;
- this.addresses = addresses;
- this.lines = lines;
- this.columns = columns;
- this.id = id;
- this.isConst = false;
- }
- get() {
- return this.values;
- }
- getAddresses() {
- return this.addresses;
- }
- inStore() {
- return this.id != null;
- }
- }
- exports.ArrayStoreValueRef = ArrayStoreValueRef;
- /***/ }),
- /***/ "./js/processor/store/value/store_value.ts":
- /*!*************************************************!*\
- !*** ./js/processor/store/value/store_value.ts ***!
- \*************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.StoreValue = void 0;
- class StoreValue {
- constructor(type, value, id, isConst = false) {
- this.type = type;
- this.id = id;
- this.isConst = isConst;
- this.value = value;
- }
- get() {
- return this.value;
- }
- inStore() {
- return this.id != null;
- }
- }
- exports.StoreValue = StoreValue;
- /***/ }),
- /***/ "./js/processor/store/value/store_value_address.ts":
- /*!*********************************************************!*\
- !*** ./js/processor/store/value/store_value_address.ts ***!
- \*********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.StoreValueAddress = void 0;
- const store_value_1 = __webpack_require__(/*! ./store_value */ "./js/processor/store/value/store_value.ts");
- class StoreValueAddress extends store_value_1.StoreValue {
- constructor(type, value, line, column, id, isConst = false) {
- super(type, value, id, isConst);
- this.line = line;
- this.column = column;
- }
- }
- exports.StoreValueAddress = StoreValueAddress;
- /***/ }),
- /***/ "./js/processor/store/value/store_value_ref.ts":
- /*!*****************************************************!*\
- !*** ./js/processor/store/value/store_value_ref.ts ***!
- \*****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.StoreValueRef = void 0;
- class StoreValueRef {
- constructor(type, value, loc_address, id) {
- this.type = type;
- this.value = value;
- this.loc_address = loc_address;
- this.id = id;
- this.isConst = false;
- this.reference_dimesion = 0;
- }
- get() {
- return this.value;
- }
- getRefAddress() {
- return this.loc_address;
- }
- inStore() {
- return this.id != null;
- }
- getReferenceDimension() {
- return this.reference_dimesion;
- }
- setReferenceDimension(dimension) {
- this.reference_dimesion = dimension;
- }
- }
- exports.StoreValueRef = StoreValueRef;
- /***/ }),
- /***/ "./js/runner.js":
- /*!**********************!*\
- !*** ./js/runner.js ***!
- \**********************/
- /*! exports provided: runner */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runner", function() { return runner; });
- /* harmony import */ var _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ast/ivprogParser */ "./js/ast/ivprogParser.js");
- /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
- /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./io/domConsole */ "./js/io/domConsole.js");
- /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/languageService */ "./js/services/languageService.js");
- /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
- /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./memory/location */ "./js/memory/location.ts");
- /* harmony import */ var _memory_location__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_memory_location__WEBPACK_IMPORTED_MODULE_5__);
- function runner() {
- var ivprogLexer = _services_languageService__WEBPACK_IMPORTED_MODULE_3__["LanguageService"].getCurrentLexer(); // const lexer = new ivprogLexer(new InputStream(input));
- // const stream = new CommonTokenStream(lexer);
- // stream.fill();
- // let i = 1;
- // let token = null;
- // while ((token = stream.LT(i)).type !== ivprogLexer.EOF && token.type !== ivprogLexer.WHITESPACE) {
- // console.log(`${token.type}-${token.text}`);
- // console.log('\n')
- // i++;
- // }
- // const anaSin = new IVProgParser(input, ivprogLexer);
- var editor = new window.JsonEditor('#json-renderer', {});
- var domConsole = new _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"]("#console", true);
- domConsole.hide(); // proc.interpretAST().then( sto => {
- // console.log(sto.applyStore('a'));
- // }).catch(e => console.log(e));
- try {
- window.$('#btn').click(function () {
- var input = window.$('#input').val();
- var analiser = new _ast_ivprogParser__WEBPACK_IMPORTED_MODULE_0__["IVProgParser"](input, ivprogLexer);
- try {
- var data = analiser.parseTree();
- var semAna = new _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_4__["SemanticAnalyser"](data);
- var proc = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__["IVProgProcessor"](semAna.analyseTree());
- proc.registerInput(domConsole);
- domConsole.clear();
- proc.registerOutput(domConsole);
- proc.interpretAST().then(function (sto) {
- console.log(sto);
- editor.load(sto.store);
- console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
- })["catch"](function (e) {
- alert(e);
- console.log(e);
- console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
- });
- } catch (error) {
- alert(error);
- console.log(error);
- console.log(_memory_location__WEBPACK_IMPORTED_MODULE_5__["Location"].size());
- }
- });
- } catch (a) {
- console.log(a);
- }
- }
- /***/ }),
- /***/ "./js/services/i18nHelper.js":
- /*!***********************************!*\
- !*** ./js/services/i18nHelper.js ***!
- \***********************************/
- /*! exports provided: i18nHelper */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i18nHelper", function() { return i18nHelper; });
- /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
- /* harmony import */ var _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./localizedStringsService */ "./js/services/localizedStringsService.js");
- var StringTypes = line_i18n__WEBPACK_IMPORTED_MODULE_0__["default"].StringTypes;
- var i18nHelper = Object.freeze({
- i18n: function i18n(identifier) {
- var opts = identifier.split(':');
- var type = opts[0].toLowerCase();
- var id = opts[1];
- if (StringTypes.ERROR === type) {
- return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getError(id);
- } else if (StringTypes.MESSAGE === type) {
- return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getMessage(id);
- } else if (StringTypes.UI === type) {
- return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI(id);
- } else {
- console.warn("A string has been passed to the i18n helper function that was not in the form type:id -> " + identifier);
- return _localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getString(identifier, type);
- }
- }
- });
- /***/ }),
- /***/ "./js/services/languageService.js":
- /*!****************************************!*\
- !*** ./js/services/languageService.js ***!
- \****************************************/
- /*! exports provided: LanguageService */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LanguageService", function() { return LanguageService; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _grammar___WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../../grammar/ */ "./grammar/index.js");
- /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
- /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../util/config */ "./js/util/config.ts");
- /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_7__);
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- /* global iLMparameters*/
- var LanguageServiceExtended = /*#__PURE__*/function (_line_i18n$LanguageSe) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(LanguageServiceExtended, _line_i18n$LanguageSe);
- var _super = _createSuper(LanguageServiceExtended);
- function LanguageServiceExtended() {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, LanguageServiceExtended);
- return _super.call(this, typeof iLMparameters === "undefined" ? _util_config__WEBPACK_IMPORTED_MODULE_7__["Config"].default_lang : iLMparameters.lang);
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(LanguageServiceExtended, [{
- key: "getDefaultLang",
- value: function getDefaultLang() {
- return "en";
- }
- }, {
- key: "getCurrentLexer",
- value: function getCurrentLexer() {
- var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getLang()];
- if (langInfo === null || langInfo === undefined) {
- return _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getDefaultLang()].lexer;
- } else {
- return langInfo.lexer;
- }
- }
- }, {
- key: "getCurrentLangFuncs",
- value: function getCurrentLangFuncs() {
- var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getLang()];
- if (langInfo === null || langInfo === undefined) {
- return _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getDefaultLang()].langFuncs;
- } else {
- return langInfo.langFuncs;
- }
- }
- }, {
- key: "getCurrentLangLibs",
- value: function getCurrentLangLibs() {
- var langInfo = _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getLang()];
- if (langInfo === null || langInfo === undefined) {
- return _grammar___WEBPACK_IMPORTED_MODULE_5__["default"][this.getDefaultLang()].langLibs;
- }
- return langInfo.langLibs;
- }
- }]);
- return LanguageServiceExtended;
- }(line_i18n__WEBPACK_IMPORTED_MODULE_6__["default"].LanguageServiceNoLS);
- var LanguageService = new LanguageServiceExtended();
- /***/ }),
- /***/ "./js/services/localizedStringsService.js":
- /*!************************************************!*\
- !*** ./js/services/localizedStringsService.js ***!
- \************************************************/
- /*! exports provided: LocalizedStrings, getInstance */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocalizedStrings", function() { return LocalizedStrings; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getInstance", function() { return getInstance; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var line_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! line-i18n */ "./node_modules/line-i18n/dist/index.js");
- /* harmony import */ var _languageService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./languageService */ "./js/services/languageService.js");
- /* harmony import */ var _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../processor/definedFunctions */ "./js/processor/definedFunctions.js");
- /* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../../i18n */ "./i18n/index.ts");
- /* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_i18n__WEBPACK_IMPORTED_MODULE_8__);
- /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.ts");
- /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_ast_operators__WEBPACK_IMPORTED_MODULE_9__);
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var IVProgLocalizedStrings = /*#__PURE__*/function (_line_i18n$LocalizedS) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(IVProgLocalizedStrings, _line_i18n$LocalizedS);
- var _super = _createSuper(IVProgLocalizedStrings);
- function IVProgLocalizedStrings(langService, langsJsons) {
- var shouldListenToChange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IVProgLocalizedStrings);
- return _super.call(this, langService, langsJsons, shouldListenToChange);
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IVProgLocalizedStrings, [{
- key: "translateType",
- value: function translateType(type, dim) {
- var type_string = this.getUI("type_".concat(type));
- switch (dim) {
- case 0:
- return type_string;
- default:
- if (dim > 1) return this.getUI("matrix_info_string", [type_string]);else return this.getUI("vector_info_string", [type_string]);
- }
- }
- }, {
- key: "translateOp",
- value: function translateOp(op) {
- switch (op.ord) {
- case _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].AND.ord:
- case _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].OR.ord:
- case _ast_operators__WEBPACK_IMPORTED_MODULE_9__["Operators"].NOT.ord:
- return this.getUI("logic_operator_".concat(op.value));
- default:
- return op.value;
- }
- }
- }, {
- key: "translateInternalFunction",
- value: function translateInternalFunction(name) {
- var category = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
- if (category == null) {
- return _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_7__["LanguageDefinedFunction"].getLocalName(name);
- } else {
- return _processor_definedFunctions__WEBPACK_IMPORTED_MODULE_7__["LanguageDefinedFunction"].getLocalName("".concat(category, ".").concat(name));
- }
- }
- }]);
- return IVProgLocalizedStrings;
- }(line_i18n__WEBPACK_IMPORTED_MODULE_5__["default"].LocalizedStrings);
- var LocalizedStrings = Object.freeze(new IVProgLocalizedStrings(_languageService__WEBPACK_IMPORTED_MODULE_6__["LanguageService"], _i18n__WEBPACK_IMPORTED_MODULE_8___default.a, true));
- var _instance = null;
- function getInstance() {
- if (_instance == null) {
- _instance = new IVProgLocalizedStrings(_languageService__WEBPACK_IMPORTED_MODULE_6__["LanguageService"], _i18n__WEBPACK_IMPORTED_MODULE_8___default.a);
- }
- return _instance;
- }
- /***/ }),
- /***/ "./js/services/userLog.js":
- /*!********************************!*\
- !*** ./js/services/userLog.js ***!
- \********************************/
- /*! exports provided: ActionTypes, registerClick, registerUserEvent, registerSystemEvent, getLogs, setRebuildMode, getLogsAsString, parseLogs */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ActionTypes", function() { return ActionTypes; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerClick", function() { return registerClick; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerUserEvent", function() { return registerUserEvent; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerSystemEvent", function() { return registerSystemEvent; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLogs", function() { return getLogs; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setRebuildMode", function() { return setRebuildMode; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLogsAsString", function() { return getLogsAsString; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseLogs", function() { return parseLogs; });
- var clicks = [];
- var inRebuildMode = false;
- var ActionTypes = Object.freeze({
- // registerUserEvent payload:
- // (function_name, insert action)
- INSERT_FUNCTION: "INSERT_FUNCTION",
- // (function_name, remove action)
- REMOVE_FUNCTION: "REMOVE_FUNCTION",
- // (var_name,insert action, type, dim)
- INSERT_GLOBAL_VAR: "INSERT_GLOBAL_VAR",
- // (var name, remove action)
- REMOVE_GLOBAL_VAR: "REMOVE_GLOBAL_VAR",
- // (old function name, rename action, new function name)
- RENAME_FUNCTION: "RENAME_FUNCTION",
- // (old var name, rename action. new var name)
- RENAME_GLOBAL_VAR: "RENAME_GLOBAL_VAR",
- // (var name, set const action)
- SET_GLOBAL_CONST: "SET_GLOBAL_CONST",
- // (function name, change return action, type, dim)
- CHANGE_FUNCTION_RETURN: "CHANGE_FUNCTION_RETURN",
- // (var name, change type action, type, dim, rows?, columns?)
- CHANGE_GLOBAL_TYPE: "CHANGE_GLOBAL_TYPE",
- // (var name, change value action, value)
- CHANGE_GLOBAL_VALUE: "CHANGE_GLOBAL_VALUE",
- // (function name, insert param action, param varname, type, dim)
- INSERT_FUNCTION_PARAM: "INSERT_FUNCTION_PARAM",
- // (function name, remove param action, param varname)
- REMOVE_FUNCTION_PARAM: "REMOVE_FUNCTION_PARAM",
- // (function name, change param type action, type, dim)
- CHANGE_PARAM_TYPE: "CHANGE_PARAM_TYPE",
- // (function name, rename param action, old param name, new param name)
- RENAME_FUNCTION_PARAM: "RENAME_FUNCTION_PARAM",
- // (function name, insert var action, var name, type, dim)
- INSERT_FUNCTION_VAR: "INSERT_FUCNTION_VAR",
- // (function name, remove var action, var name)
- REMOVE_FUNCTION_VAR: "REMOVE_FUNCTION_VAR",
- // (function name, rename var action, old var name, new var name)
- RENAME_FUNCTION_VAR: "RENAME_FUNCTION_VAR",
- // (function name, change var type action, var name, type, dim, rows?, columns?)
- CHANGE_VAR_TYPE: "CHANGE_VAR_TYPE",
- // (function name, change var value action, var name, value)
- CHANGE_VAR_VALUE: "CHANGE_VAR_VALUE",
- // (function name, insert command action, command, path)
- INSERT_COMMAND: "INSERT_COMMAND",
- // (function name, remove command action, path)
- REMOVE_COMMAND: "REMOVE_COMMAND",
- // (function name, change command exp action, path, exp)
- CHANGE_COMMAND_EXP: "CHANGE_COMMAND_EXP",
- // (function name, change attrib exp action, path, exp)
- CHANGE_ATTRIB_EXP: "CHANGE_ATTRIB_EXP",
- // (function name, change attrib var action, path, var name, row_exp?, column_exp?)
- CHANGE_ATTRIB_VAR: "CHANGE_ATTRIB_VAR",
- // (function name, move command action, old path, new path)
- MOVE_COMMAND: "MOVE_COMMAND",
- // (function name, enter change name action, var name)
- ENTER_CHANGE_VAR_NAME: 'ENTER_CHANGE_VAR_NAME',
- // (function name, enter change value action, var name)
- ENTER_CHANGE_VAR_VALUE: 'ENTER_CHANGE_VAR_VALUE',
- // (var name, enter change name action)
- ENTER_CHANGE_GLOBAL_NAME: 'ENTER_CHANGE_GLOBAL_NAME',
- // (var name, enter change value action)
- ENTER_CHANGE_GLOBAL_VALUE: 'ENTER_CHANGE_GLOBAL_VALUE',
- // (function name, enter change name action, param name)
- ENTER_CHANGE_PARAM_NAME: 'ENTER_CHANGE_PARAM_NAME'
- });
- function registerClick(x, y, details) {
- if (inRebuildMode) {
- return;
- }
- clicks.push([x, y, Date.now(), details]);
- }
- function registerUserEvent(command, action) {
- for (var _len = arguments.length, params = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
- params[_key - 2] = arguments[_key];
- }
- registerEvent('user_event', command, action, params);
- }
- function registerSystemEvent(command, action) {
- for (var _len2 = arguments.length, params = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
- params[_key2 - 2] = arguments[_key2];
- }
- registerEvent('system_event', command, action, params);
- }
- function registerEvent(tag, command, action, params) {
- if (inRebuildMode) {
- return;
- }
- var event = {
- context: command,
- action: action,
- params: params
- };
- clicks.push([tag, Date.now(), event]);
- }
- function getLogs() {
- return clicks;
- }
- function setRebuildMode(flag) {
- inRebuildMode = flag;
- }
- function getLogsAsString() {
- return JSON.stringify(clicks);
- }
- function parseLogs(logData) {
- clicks = JSON.parse(logData);
- }
- /***/ }),
- /***/ "./js/typeSystem/array_type.ts":
- /*!*************************************!*\
- !*** ./js/typeSystem/array_type.ts ***!
- \*************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.ArrayType = void 0;
- class ArrayType {
- constructor(type, dimensions) {
- this.dimensions = dimensions;
- this.innerType = type;
- }
- get isVector() {
- return this.dimensions == 1;
- }
- isCompatible(another) {
- if (another instanceof ArrayType) {
- if (this.dimensions !== another.dimensions) {
- return false;
- }
- return this.innerType.isCompatible(another.innerType);
- }
- return false;
- }
- stringInfo() {
- const list = this.innerType.stringInfo();
- list.forEach(v => {
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const tmp = v;
- tmp.dim = this.dimensions;
- });
- return list;
- }
- get value() {
- return undefined;
- }
- get ord() {
- return undefined;
- }
- canAccept(another, used_dims) {
- const free_dims = this.dimensions - used_dims;
- if (another instanceof ArrayType) {
- return free_dims == another.dimensions && this.innerType.isCompatible(another.innerType);
- }
- else {
- return free_dims == 0 && this.innerType.isCompatible(another);
- }
- }
- }
- exports.ArrayType = ArrayType;
- /***/ }),
- /***/ "./js/typeSystem/multiType.ts":
- /*!************************************!*\
- !*** ./js/typeSystem/multiType.ts ***!
- \************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.MultiType = void 0;
- class MultiType {
- constructor(types) {
- this.types = types;
- }
- get value() {
- return undefined;
- }
- get ord() {
- return undefined;
- }
- stringInfo() {
- let list = [];
- for (let i = 0; i < this.types.length; i++) {
- const t = this.types[i];
- list = list.concat(t.stringInfo());
- }
- return list;
- }
- isCompatible(another) {
- for (let i = 0; i < this.types.length; i++) {
- const t = this.types[i];
- if (another.isCompatible(t)) {
- return true;
- }
- }
- return false;
- }
- }
- exports.MultiType = MultiType;
- /***/ }),
- /***/ "./js/typeSystem/parsers.js":
- /*!**********************************!*\
- !*** ./js/typeSystem/parsers.js ***!
- \**********************************/
- /*! exports provided: toInt, toString, toChar, toReal, toBool, convertBoolToString, convertToString */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toInt", function() { return toInt; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toString", function() { return toString; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toChar", function() { return toChar; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toReal", function() { return toReal; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toBool", function() { return toBool; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertBoolToString", function() { return convertBoolToString; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToString", function() { return convertToString; });
- /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../services/languageService */ "./js/services/languageService.js");
- /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./types */ "./js/typeSystem/types.ts");
- /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_types__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! decimal.js */ "./node_modules/decimal.js/decimal.js");
- /* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(decimal_js__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/config */ "./js/util/config.ts");
- /* harmony import */ var _util_config__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_util_config__WEBPACK_IMPORTED_MODULE_3__);
- function toInt(str) {
- return new decimal_js__WEBPACK_IMPORTED_MODULE_2___default.a(str);
- }
- function toString(str) {
- var value = str.replace(/^"/, "");
- value = value.replace(/"$/, "");
- value = value.replace(/\\b/g, "\b");
- value = value.replace(/\\t/g, "\t");
- value = value.replace(/\\n/g, "\n");
- value = value.replace(/\\r/g, "\r");
- value = value.replace(/\\"/g, '"');
- value = value.replace(/\\'/g, "'");
- value = value.replace(/\\\\/g, "\\");
- return value;
- }
- function toChar(str) {
- console.debug(str, str.length);
- var value = str.replace(/^'/, "");
- value = value.replace(/'$/, "");
- value = value.replace(/\\b/g, "\b");
- value = value.replace(/\\t/g, "\t");
- value = value.replace(/\\n/g, "\n");
- value = value.replace(/\\r/g, "\r");
- value = value.replace(/\\"/g, '"');
- value = value.replace(/\\'/g, "'");
- value = value[0];
- return value;
- }
- function toReal(value) {
- return new decimal_js__WEBPACK_IMPORTED_MODULE_2___default.a(value);
- }
- function toBool(str) {
- var val = "'" + str + "'";
- var lexer = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLexer();
- var instance = new lexer(null);
- if (instance.literalNames[lexer.RK_TRUE] === val) {
- return true;
- } else if (instance.literalNames[lexer.RK_FALSE] === val) {
- return false;
- } else {
- // TODO: better error message
- throw new Error(str + "not a valid boolean");
- }
- }
- function convertBoolToString(bool) {
- var lexer = _services_languageService__WEBPACK_IMPORTED_MODULE_0__["LanguageService"].getCurrentLexer();
- var instance = new lexer(null);
- var result = null;
- if (bool) {
- result = instance.literalNames[lexer.RK_TRUE];
- } else {
- result = instance.literalNames[lexer.RK_FALSE];
- }
- return result.replace(/'/g, "");
- }
- function convertToString(value, type) {
- switch (type.ord) {
- case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].INTEGER.ord:
- return value.toString();
- case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].REAL.ord:
- {
- if (value.dp() <= 0) {
- return value.toFixed(1);
- } else {
- return value.toFixed(_util_config__WEBPACK_IMPORTED_MODULE_3__["Config"].decimalPlaces);
- }
- }
- case _types__WEBPACK_IMPORTED_MODULE_1__["Types"].BOOLEAN.ord:
- return convertBoolToString(value);
- default:
- return value;
- }
- }
- /***/ }),
- /***/ "./js/typeSystem/type.ts":
- /*!*******************************!*\
- !*** ./js/typeSystem/type.ts ***!
- \*******************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.Type = void 0;
- class Type {
- constructor(value, ord) {
- this.value = value;
- this.ord = ord;
- }
- stringInfo() {
- return [{ type: this.value, dim: 0 }];
- }
- isCompatible(another) {
- return this.value === another.value && this.ord === another.ord;
- }
- }
- exports.Type = Type;
- /***/ }),
- /***/ "./js/typeSystem/types.ts":
- /*!********************************!*\
- !*** ./js/typeSystem/types.ts ***!
- \********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.fromOrdToType = exports.Types = void 0;
- const type_1 = __webpack_require__(/*! ./type */ "./js/typeSystem/type.ts");
- const multiType_1 = __webpack_require__(/*! ./multiType */ "./js/typeSystem/multiType.ts");
- const maybe_1 = __webpack_require__(/*! ../util/maybe */ "./js/util/maybe.ts");
- const INTEGER = new type_1.Type("integer", 0);
- const REAL = new type_1.Type("real", 1);
- const STRING = new type_1.Type("text", 2);
- const BOOLEAN = new type_1.Type("boolean", 3);
- const CHAR = new type_1.Type("char", 4);
- const VOID = new type_1.Type("void", 5);
- const UNDEFINED = new type_1.Type("undefined", 6);
- const ALL = new multiType_1.MultiType([INTEGER, REAL, STRING, CHAR, BOOLEAN]);
- exports.Types = Object.freeze({
- INTEGER: INTEGER,
- REAL: REAL,
- STRING: STRING,
- CHAR: CHAR,
- BOOLEAN: BOOLEAN,
- VOID: VOID,
- UNDEFINED: UNDEFINED,
- ALL: ALL
- });
- function fromOrdToType(ord) {
- const typeMap = exports.Types;
- for (const t in typeMap) {
- if (typeMap[t].ord && typeMap[t].ord === ord) {
- return maybe_1.Maybe.some(typeMap[t]);
- }
- }
- return maybe_1.Maybe.none();
- }
- exports.fromOrdToType = fromOrdToType;
- /***/ }),
- /***/ "./js/util/auto_gen_output.js":
- /*!************************************!*\
- !*** ./js/util/auto_gen_output.js ***!
- \************************************/
- /*! exports provided: autoGenerateTestCaseOutput */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoGenerateTestCaseOutput", function() { return autoGenerateTestCaseOutput; });
- /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
- /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
- /* harmony import */ var _inputTest__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./inputTest */ "./js/util/inputTest.js");
- /* harmony import */ var _outputTest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./outputTest */ "./js/util/outputTest.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- function autoGenerateTestCaseOutput(program_text, testCases) {
- var copyTestCases = testCases.map(function (test) {
- return Object.assign({}, test);
- });
- try {
- var program = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_0__["SemanticAnalyser"].analyseFromSource(program_text);
- var resultList = testCases.map(function (test, id) {
- var input = new _inputTest__WEBPACK_IMPORTED_MODULE_2__["InputTest"](test.input);
- var output = new _outputTest__WEBPACK_IMPORTED_MODULE_3__["OutputTest"]();
- var exec = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_1__["IVProgProcessor"](program);
- exec.registerInput(input);
- exec.registerOutput(output);
- return exec.interpretAST().then(function (_) {
- return {
- id: id,
- program: exec
- };
- });
- });
- return Promise.all(resultList).then(function (result_final) {
- for (var i = 0; i < result_final.length; ++i) {
- var result = result_final[i];
- var output = result.program.output.list;
- var input = result.program.input;
- if (input.index != input.inputList.length) {
- window.showAlert(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getMessage("testcase_autogen_unused_input", [result.id + 1]));
- return Promise.resolve(false);
- }
- if (output.length == 0) {
- window.showAlert(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getMessage("testcase_autogen_empty", [result.id + 1]));
- }
- copyTestCases[result.id].output = output;
- }
- window.outputGenerated(copyTestCases);
- return Promise.resolve(true);
- });
- } catch (error) {
- return Promise.reject(error);
- }
- }
- /***/ }),
- /***/ "./js/util/config.ts":
- /*!***************************!*\
- !*** ./js/util/config.ts ***!
- \***************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.Config = void 0;
- class ConfigObject {
- constructor() {
- this.decimalPlaces = 8;
- this.intConvertRoundMode = 2;
- this.default_lang = 'pt';
- this.enable_type_casting = true;
- this.idle_input_interval = 5000;
- this.suspend_threshold = 100;
- // this.max_instruction_count = 350250; - automated evaluation limit
- this.max_instruction_count = Number.MAX_SAFE_INTEGER;
- }
- setConfig(opts) {
- const otherConfig = opts;
- for (const key in otherConfig) {
- if (Object.prototype.hasOwnProperty.call(this, key)) {
- this[key] = otherConfig[key];
- }
- }
- }
- }
- const config = new ConfigObject();
- exports.Config = config;
- /***/ }),
- /***/ "./js/util/editorMode2.js":
- /*!********************************!*\
- !*** ./js/util/editorMode2.js ***!
- \********************************/
- /*! exports provided: CodeEditorMode */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeEditorMode", function() { return CodeEditorMode; });
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./js/util/utils.js");
- /**
- * Source: https://raw.githubusercontent.com/codemirror/CodeMirror/master/mode/clike/clike.js
- * @author arijn Haverbeke and others
- * @author Lucas de Souza
- * @param {CodeMirror} CodeMirror
- */
- function CodeEditorMode(CodeMirror) {
- "use strict";
- function Context(indented, column, type, info, align, prev) {
- this.indented = indented;
- this.column = column;
- this.type = type;
- this.info = info;
- this.align = align;
- this.prev = prev;
- }
- function pushContext(state, col, type, info) {
- var indent = state.indented;
- if (state.context && state.context.type == "statement" && type != "statement") indent = state.context.indented;
- return state.context = new Context(indent, col, type, info, null, state.context);
- }
- function popContext(state) {
- var t = state.context.type;
- if (t == ")" || t == "]" || t == "}") state.indented = state.context.indented;
- return state.context = state.context.prev;
- }
- function typeBefore(stream, state, pos) {
- if (state.prevToken == "variable" || state.prevToken == "type") return true;
- if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, pos))) return true;
- if (state.typeAtEndOfLine && stream.column() == stream.indentation()) return true;
- }
- function isTopScope(context) {
- for (;;) {
- if (!context || context.type == "top") return true;
- if (context.type == "}" && context.prev.info != "namespace") return false;
- context = context.prev;
- }
- }
- function contains(words, word) {
- if (typeof words === "function") {
- return words(word);
- } else {
- return Object.propertyIsEnumerable.call(words, word);
- }
- }
- function tokenComment(stream, state) {
- var maybeEnd = false,
- ch;
- while (ch = stream.next()) {
- if (ch == "/" && maybeEnd) {
- state.tokenize = null;
- break;
- }
- maybeEnd = ch == "*";
- }
- return "comment";
- }
- CodeMirror.defineMode("ivprog", function (config, parserConfig) {
- var indentUnit = config.indentUnit,
- statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
- dontAlignCalls = parserConfig.dontAlignCalls,
- keywords = parserConfig.keywords || {},
- switchKeyword = parserConfig.switchKeyword,
- caseKeyword = parserConfig.caseKeyword,
- defaultKeyword = parserConfig.defaultKeyword,
- caseRegex = new RegExp("^\\s*(?:".concat(caseKeyword, " .*?:|").concat(defaultKeyword, ":|\\{\\}?|\\})$")),
- ////,
- types = parserConfig.types || {},
- builtin = parserConfig.builtin || {},
- blockKeywords = parserConfig.blockKeywords || {},
- defKeywords = parserConfig.defKeywords || {},
- atoms = parserConfig.atoms || {},
- hooks = parserConfig.hooks || {},
- multiLineStrings = parserConfig.multiLineStrings,
- indentStatements = false,
- namespaceSeparator = null,
- isPunctuationChar = /[[\]{}(),;:\n]/,
- numberStart = /[\d.]/,
- number = /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)$/i,
- isOperatorChar = /[+\-*%=<>!/&]/,
- isIdentifierChar = /[a-zA-Z0-9_]/,
- // An optional function that takes a {string} token and returns true if it
- // should be treated as a builtin.
- isReservedIdentifier = parserConfig.isReservedIdentifier || false;
- var curPunc, isDefKeyword;
- var tokenString = function tokenString() {
- /*SKIP*/
- };
- function tokenBase(stream, state) {
- var ch = stream.next();
- if (hooks[ch]) {
- var result = hooks[ch](stream, state);
- if (result !== false) return result;
- }
- if (ch == '"') {
- state.tokenize = tokenString(ch);
- return state.tokenize(stream, state);
- }
- if (isPunctuationChar.test(ch)) {
- curPunc = ch;
- return null;
- }
- if (numberStart.test(ch)) {
- stream.backUp(1);
- if (stream.match(number)) return "number";
- stream.next();
- }
- if (ch == "/") {
- if (stream.eat("*")) {
- state.tokenize = tokenComment;
- return tokenComment(stream, state);
- }
- if (stream.eat("/")) {
- stream.skipToEnd();
- return "comment";
- }
- }
- if (isOperatorChar.test(ch)) {
- while (!stream.match(/^\/[/*]/, false) && stream.eat(isOperatorChar)) {
- /* SKIP */
- }
- return "operator";
- }
- stream.eatWhile(isIdentifierChar);
- if (namespaceSeparator) while (stream.match(namespaceSeparator)) {
- stream.eatWhile(isIdentifierChar);
- }
- var cur = stream.current();
- if (contains(keywords, cur)) {
- if (contains(blockKeywords, cur)) curPunc = "newstatement";
- if (contains(defKeywords, cur)) isDefKeyword = true;
- return "keyword";
- }
- if (contains(types, cur)) return "type";
- if (contains(builtin, cur) || isReservedIdentifier && isReservedIdentifier(cur)) {
- if (contains(blockKeywords, cur)) curPunc = "newstatement";
- return "builtin";
- }
- if (contains(atoms, cur)) return "atom";
- return "variable";
- }
- tokenString = function tokenString(quote) {
- return function (stream, state) {
- var escaped = false,
- next,
- end = false;
- while ((next = stream.next()) != null) {
- if (next == quote && !escaped) {
- end = true;
- break;
- }
- escaped = !escaped && next == "\\";
- }
- if (end || !(escaped || multiLineStrings)) state.tokenize = null;
- return "string";
- };
- };
- function maybeEOL(stream, state) {
- if (parserConfig.typeFirstDefinitions && stream.eol() && isTopScope(state.context)) state.typeAtEndOfLine = typeBefore(stream, state, stream.pos);
- } // Interface
- return {
- startState: function startState(basecolumn) {
- return {
- tokenize: null,
- context: new Context((basecolumn || 0) - indentUnit, 0, "top", null, false),
- indented: 0,
- startOfLine: true,
- prevToken: null
- };
- },
- token: function token(stream, state) {
- var ctx = state.context;
- if (stream.sol()) {
- if (ctx.align == null) ctx.align = false;
- state.indented = stream.indentation();
- state.startOfLine = true;
- }
- if (stream.eatSpace()) {
- maybeEOL(stream, state);
- return null;
- }
- curPunc = isDefKeyword = null;
- var style = (state.tokenize || tokenBase)(stream, state);
- if (style == "comment" || style == "meta") return style;
- if (ctx.align == null) ctx.align = true;
- if (curPunc == ";" || curPunc == ":" || curPunc == "," && stream.match(/^\s*(?:\/\/.*)?$/, false)) while (state.context.type == "statement") {
- popContext(state);
- } else if (curPunc == "{") pushContext(state, stream.column(), "}");else if (curPunc == "[") pushContext(state, stream.column(), "]");else if (curPunc == "(") pushContext(state, stream.column(), ")");else if (curPunc == "}") {
- while (ctx.type == "statement") {
- ctx = popContext(state);
- }
- if (ctx.type == "}") ctx = popContext(state);
- while (ctx.type == "statement") {
- ctx = popContext(state);
- }
- } else if (curPunc == ctx.type) popContext(state);else if (indentStatements && ((ctx.type == "}" || ctx.type == "top") && curPunc != ";" || ctx.type == "statement" && curPunc == "newstatement")) {
- pushContext(state, stream.column(), "statement", stream.current());
- }
- if (style == "variable" && (state.prevToken == "def" || parserConfig.typeFirstDefinitions && typeBefore(stream, state, stream.start) && isTopScope(state.context) && stream.match(/^\s*\(/, false))) style = "def";
- if (hooks.token) {
- var result = hooks.token(stream, state, style);
- if (result !== undefined) style = result;
- }
- if (style == "def" && parserConfig.styleDefs === false) style = "variable";
- state.startOfLine = false;
- state.prevToken = isDefKeyword ? "def" : style || curPunc;
- maybeEOL(stream, state);
- return style;
- },
- indent: function indent(state, textAfter) {
- if (state.tokenize != tokenBase && state.tokenize != null || state.typeAtEndOfLine) return CodeMirror.Pass;
- var ctx = state.context;
- var firstChar = textAfter && textAfter.charAt(0);
- var closing = firstChar == ctx.type;
- if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
- if (parserConfig.dontIndentStatements) while (ctx.type == "statement" && parserConfig.dontIndentStatements.test(ctx.info)) {
- ctx = ctx.prev;
- }
- if (hooks.indent) {
- var hook = hooks.indent(state, ctx, textAfter, indentUnit);
- if (typeof hook == "number") return hook;
- }
- var switchBlock = ctx.prev && ctx.prev.info == switchKeyword;
- if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
- while (ctx.type != "top" && ctx.type != "}") {
- ctx = ctx.prev;
- }
- return ctx.indented;
- }
- if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
- if (ctx.align && (!dontAlignCalls || ctx.type != ")")) return ctx.column + (closing ? 0 : 1);
- if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit;
- var caseTestRegex = new RegExp("^(?:".concat(caseKeyword, "|").concat(defaultKeyword, ")\b"));
- return ctx.indented + (closing ? 0 : indentUnit) + (!closing && switchBlock && !caseTestRegex.test(textAfter) ? indentUnit : 0);
- },
- electricInput: caseRegex,
- blockCommentStart: "/*",
- blockCommentEnd: "*/",
- blockCommentContinue: " * ",
- lineComment: "//",
- fold: "brace"
- };
- });
- function words(str) {
- var obj = {},
- words = str.split(" ");
- for (var i = 0; i < words.length; ++i) {
- obj[words[i]] = true;
- }
- return obj;
- }
- var codeConfig = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getCodeEditorModeConfig"])();
- var ivprogKeywords = codeConfig.keywords.join(" ");
- var basicTypes = words(codeConfig.types.join(" "));
- function ivprogTypes(identifier) {
- return contains(basicTypes, identifier);
- }
- var ivprogBlockKeywords = codeConfig.blocks.join(" ");
- var ivprogDefKeywords = "funcao const";
- function def(mimes, mode) {
- if (typeof mimes == "string") mimes = [mimes];
- var words = [];
- function add(obj) {
- if (obj) {
- for (var prop in obj) {
- if (Object.hasOwnProperty.call(obj, prop)) {
- words.push(prop);
- }
- }
- }
- }
- add(mode.keywords);
- add(mode.types);
- add(mode.builtin);
- add(mode.atoms);
- if (words.length) {
- mode.helperType = mimes[0];
- CodeMirror.registerHelper("hintWords", mimes[0], words);
- }
- for (var i = 0; i < mimes.length; ++i) {
- CodeMirror.defineMIME(mimes[i], mode);
- }
- }
- def(["text/x-ivprog"], {
- name: "ivprog",
- keywords: words(ivprogKeywords),
- types: ivprogTypes,
- blockKeywords: words(ivprogBlockKeywords),
- defKeywords: words(ivprogDefKeywords),
- typeFirstDefinitions: true,
- atoms: words(codeConfig.atoms.join(" ")),
- switchKeyword: codeConfig.switchString,
- caseKeyword: codeConfig.case_default[0],
- defaultKeyword: codeConfig.case_default[1],
- modeProps: {
- fold: ["brace"]
- }
- });
- }
- /***/ }),
- /***/ "./js/util/iassignHelpers.js":
- /*!***********************************!*\
- !*** ./js/util/iassignHelpers.js ***!
- \***********************************/
- /*! exports provided: prepareActivityToStudentHelper, autoEval */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prepareActivityToStudentHelper", function() { return prepareActivityToStudentHelper; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoEval", function() { return autoEval; });
- /* harmony import */ var _visualUI_functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../visualUI/functions */ "./js/visualUI/functions.js");
- /* harmony import */ var _visualUI_code_generator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../visualUI/code_generator */ "./js/visualUI/code_generator.js");
- /* harmony import */ var _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../assessment/ivprogAssessment */ "./js/assessment/ivprogAssessment.js");
- /* harmony import */ var _testConsole__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./testConsole */ "./js/util/testConsole.js");
- /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
- /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
- /* harmony import */ var _maybe__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./maybe */ "./js/util/maybe.ts");
- /* harmony import */ var _maybe__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_maybe__WEBPACK_IMPORTED_MODULE_6__);
- function parseActivityData(data) {
- var algorithm_in_ilm = null;
- if (data.split("\n::algorithm::")[1]) {
- algorithm_in_ilm = data.split("\n::algorithm::")[1].split("\n::logs::")[0];
- var logs = data.split("\n::algorithm::")[1].split("\n::logs::")[1];
- if (logs != null) {
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["parseLogs"])(logs);
- }
- }
- var content;
- try {
- content = JSON.parse(data.split("\n::algorithm::")[0]);
- content["algorithm_in_ilm"] = algorithm_in_ilm;
- } catch (e) {
- console.error(e);
- return _maybe__WEBPACK_IMPORTED_MODULE_6__["Maybe"].none();
- }
- return _maybe__WEBPACK_IMPORTED_MODULE_6__["Maybe"].some(content);
- }
- function prepareActivityToStudentHelper(ilm_cont) {
- var maybe_content = parseActivityData(ilm_cont);
- return maybe_content.map(function (content) {
- var testCases = content.testcases;
- Object(_visualUI_functions__WEBPACK_IMPORTED_MODULE_0__["setTestCases"])(testCases);
- var prog_type = null;
- if (content.settings_programming_type) {
- prog_type = content.settings_programming_type[0].value;
- } else {
- prog_type = "visual";
- }
- return {
- settingsProgrammingType: prog_type,
- settingsDataTypes: content.settings_data_types,
- settingsCommands: content.settings_commands,
- settingsFunctions: content.settings_functions,
- algorithmInIlm: content.algorithm_in_ilm,
- settingsFilter: content.settings_filter
- };
- });
- }
- function compareArray(a, b) {
- for (var i = 0; i < a.length; ++i) {
- var elementA = a[i];
- var elementB = b[i];
- if (elementA != elementB) {
- return false;
- }
- }
- return true;
- }
- function compareTestcases(original, student) {
- if (original.length != student.length) {
- return false;
- }
- for (var i = 0; i < original.length; ++i) {
- var elementO = original[i];
- var elementS = student[i];
- if (!compareArray(elementO.input, elementS.input)) {
- return false;
- }
- if (!compareArray(elementO.output, elementS.output)) {
- return false;
- }
- }
- return true;
- }
- function autoEval(originalData, callback) {
- var code = Object(_visualUI_code_generator__WEBPACK_IMPORTED_MODULE_1__["generate"])(); //console.debug(code);
- var original = parseActivityData(originalData).getOrElse(undefined);
- if (original == null) {
- alert("iAssign did not provide the original activity data!");
- return callback(null);
- }
- if (code == null) {
- return callback(-1); // @FeedbackConvention Casos de teste vazios
- } else {
- if (!compareTestcases(original.testcases, Object(_visualUI_functions__WEBPACK_IMPORTED_MODULE_0__["getTestCases"])())) {
- return callback(-2); // @FeedbackConvention Casos de teste alterados pelo aluno
- }
- try {
- var ast_code = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_5__["SemanticAnalyser"].analyseFromSource(code);
- var con = new _testConsole__WEBPACK_IMPORTED_MODULE_3__["TestConsole"]([]);
- var autoAssessment = new _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_2__["IVProgAssessment"](ast_code, original.testcases, con);
- autoAssessment.runTest().then(function (grade) {
- return callback(grade);
- })["catch"](function (err) {
- console.log(err);
- callback(-5); // @FeedbackConvention Falha na execução
- });
- } catch (e) {
- console.error(e);
- callback(-5);
- }
- }
- }
- /***/ }),
- /***/ "./js/util/inputTest.js":
- /*!******************************!*\
- !*** ./js/util/inputTest.js ***!
- \******************************/
- /*! exports provided: InputTest */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputTest", function() { return InputTest; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _io_input__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../io/input */ "./js/io/input.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var InputTest = /*#__PURE__*/function (_Input) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(InputTest, _Input);
- var _super = _createSuper(InputTest);
- function InputTest(inputList) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, InputTest);
- _this = _super.call(this);
- _this.index = 0;
- _this.inputList = inputList;
- return _this;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(InputTest, [{
- key: "requestInput",
- value: function requestInput() {
- var _this2 = this;
- var promise = new Promise(function (resolve, reject) {
- if (_this2.index < _this2.inputList.length) {
- resolve(_this2.inputList[_this2.index]);
- _this2.index++;
- } else {
- reject(new Error(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__["LocalizedStrings"].getError("exceeded_input_request")));
- }
- });
- return promise;
- }
- }]);
- return InputTest;
- }(_io_input__WEBPACK_IMPORTED_MODULE_5__["Input"]);
- /***/ }),
- /***/ "./js/util/input_assessment.js":
- /*!*************************************!*\
- !*** ./js/util/input_assessment.js ***!
- \*************************************/
- /*! exports provided: InputAssessment */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputAssessment", function() { return InputAssessment; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _io_input__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../io/input */ "./js/io/input.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var InputAssessment = /*#__PURE__*/function (_Input) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(InputAssessment, _Input);
- var _super = _createSuper(InputAssessment);
- function InputAssessment(input_list) {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, InputAssessment);
- _this = _super.call(this);
- _this.index = 0;
- _this.input_list = input_list.map(function (val) {
- return {
- "value": val,
- "read": false
- };
- });
- return _this;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(InputAssessment, [{
- key: "requestInput",
- value: function requestInput() {
- var _this2 = this;
- var promise = new Promise(function (resolve, reject) {
- if (_this2.index < _this2.input_list.length) {
- var input = _this2.input_list[_this2.index];
- input.read = true;
- _this2.index += 1;
- resolve(input.value);
- } else {
- reject(new Error(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_6__["LocalizedStrings"].getError("exceeded_input_request")));
- }
- });
- return promise;
- }
- }, {
- key: "isInputAvailable",
- value: function isInputAvailable() {
- return this.index < this.input_list.length;
- }
- }]);
- return InputAssessment;
- }(_io_input__WEBPACK_IMPORTED_MODULE_5__["Input"]);
- /***/ }),
- /***/ "./js/util/maybe.ts":
- /*!**************************!*\
- !*** ./js/util/maybe.ts ***!
- \**************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.Maybe = void 0;
- /**
- *
- * Maybe Monad
- * @Source: https://codewithstyle.info/advanced-functional-programming-in-typescript-maybe-monad/
- * @Modified by: @lucascalion - 28/08/2019
- *
- **/
- class Maybe {
- constructor(value) {
- this.value = value;
- }
- static some(value) {
- if (!value) {
- throw Error("Provided value must not be empty");
- }
- return new Maybe(value);
- }
- static none() {
- return new Maybe(null);
- }
- static fromValue(value) {
- return value ? Maybe.some(value) : Maybe.none();
- }
- getOrElse(defaultValue) {
- return this.value === null ? defaultValue : this.value;
- }
- map(f) {
- if (this.value === null) {
- return Maybe.none();
- }
- else {
- return Maybe.fromValue(f(this.value));
- }
- }
- }
- exports.Maybe = Maybe;
- /***/ }),
- /***/ "./js/util/outputTest.js":
- /*!*******************************!*\
- !*** ./js/util/outputTest.js ***!
- \*******************************/
- /*! exports provided: OutputTest */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OutputTest", function() { return OutputTest; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ "./node_modules/@babel/runtime/helpers/inherits.js");
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js");
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js");
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _io_output__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../io/output */ "./js/io/output.js");
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
- 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; } }
- var OutputTest = /*#__PURE__*/function (_Output) {
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(OutputTest, _Output);
- var _super = _createSuper(OutputTest);
- function OutputTest() {
- var _this;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, OutputTest);
- _this = _super.call(this);
- _this.list = [];
- _this.currentLine = null;
- return _this;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(OutputTest, [{
- key: "write",
- value: function write(text) {
- var newLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- if (this.currentLine == null) {
- this.currentLine = this.list.push('') - 1;
- }
- this.list[this.currentLine] += text;
- if (newLine) {
- this.currentLine = null;
- }
- }
- }, {
- key: "sendOutput",
- value: function sendOutput(text) {
- var _this2 = this;
- var output = '' + text;
- if (output.indexOf('\n') !== -1) {
- var outputList = output.split('\n');
- var last = outputList.pop();
- outputList.forEach(function (t) {
- t = t.replace(/\t/g, '  ');
- t = t.replace(/\s/g, " ");
- if (t.length == 0) _this2.currentLine = null;else _this2.write(t, true);
- });
- last = last.replace(/\t/g, '  ');
- last = last.replace(/\s/g, " ");
- if (last.length != 0) this.write(last);
- } else {
- output = output.replace(/\t/g, '  ');
- output = output.replace(/\s/g, " ");
- this.write(output);
- }
- }
- }]);
- return OutputTest;
- }(_io_output__WEBPACK_IMPORTED_MODULE_5__["Output"]);
- /***/ }),
- /***/ "./js/util/string_diff.js":
- /*!********************************!*\
- !*** ./js/util/string_diff.js ***!
- \********************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Author: @jhchen - https://github.com/jhchen
- * Modified by: @lucascalion - 23/07/2019
- * This library modifies the diff-patch-match library by Neil Fraser
- * by removing the patch and match functionality and certain advanced
- * options in the diff function. The original license is as follows:
- *
- * ===
- *
- * Diff Match and Patch
- *
- * Copyright 2006 Google Inc.
- * http://code.google.com/p/google-diff-match-patch/
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- /**
- * The data structure representing a diff is an array of tuples:
- * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]
- * which means: delete 'Hello', add 'Goodbye' and keep ' world.'
- */
- var DIFF_DELETE = -1;
- var DIFF_INSERT = 1;
- var DIFF_EQUAL = 0;
- /**
- * Find the differences between two texts. Simplifies the problem by stripping
- * any common prefix or suffix off the texts before diffing.
- * @param {string} text1 Old string to be diffed.
- * @param {string} text2 New string to be diffed.
- * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info
- * @return {Array} Array of diff tuples.
- */
- function diff_main(text1, text2, cursor_pos, _fix_unicode) {
- // Check for equality
- if (text1 === text2) {
- if (text1) {
- return [[DIFF_EQUAL, text1]];
- }
- return [];
- }
- if (cursor_pos != null) {
- var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);
- if (editdiff) {
- return editdiff;
- }
- } // Trim off common prefix (speedup).
- var commonlength = diff_commonPrefix(text1, text2);
- var commonprefix = text1.substring(0, commonlength);
- text1 = text1.substring(commonlength);
- text2 = text2.substring(commonlength); // Trim off common suffix (speedup).
- commonlength = diff_commonSuffix(text1, text2);
- var commonsuffix = text1.substring(text1.length - commonlength);
- text1 = text1.substring(0, text1.length - commonlength);
- text2 = text2.substring(0, text2.length - commonlength); // Compute the diff on the middle block.
- var diffs = diff_compute_(text1, text2); // Restore the prefix and suffix.
- if (commonprefix) {
- diffs.unshift([DIFF_EQUAL, commonprefix]);
- }
- if (commonsuffix) {
- diffs.push([DIFF_EQUAL, commonsuffix]);
- }
- diff_cleanupMerge(diffs, _fix_unicode);
- return diffs;
- }
- /**
- * Find the differences between two texts. Assumes that the texts do not
- * have any common prefix or suffix.
- * @param {string} text1 Old string to be diffed.
- * @param {string} text2 New string to be diffed.
- * @return {Array} Array of diff tuples.
- */
- function diff_compute_(text1, text2) {
- var diffs;
- if (!text1) {
- // Just add some text (speedup).
- return [[DIFF_INSERT, text2]];
- }
- if (!text2) {
- // Just delete some text (speedup).
- return [[DIFF_DELETE, text1]];
- }
- var longtext = text1.length > text2.length ? text1 : text2;
- var shorttext = text1.length > text2.length ? text2 : text1;
- var i = longtext.indexOf(shorttext);
- if (i !== -1) {
- // Shorter text is inside the longer text (speedup).
- 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.
- if (text1.length > text2.length) {
- diffs[0][0] = diffs[2][0] = DIFF_DELETE;
- }
- return diffs;
- }
- if (shorttext.length === 1) {
- // Single character string.
- // After the previous speedup, the character can't be an equality.
- return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
- } // Check to see if the problem can be split in two.
- var hm = diff_halfMatch_(text1, text2);
- if (hm) {
- // A half-match was found, sort out the return data.
- var text1_a = hm[0];
- var text1_b = hm[1];
- var text2_a = hm[2];
- var text2_b = hm[3];
- var mid_common = hm[4]; // Send both pairs off for separate processing.
- var diffs_a = diff_main(text1_a, text2_a);
- var diffs_b = diff_main(text1_b, text2_b); // Merge the results.
- return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);
- }
- return diff_bisect_(text1, text2);
- }
- /**
- * Find the 'middle snake' of a diff, split the problem in two
- * and return the recursively constructed diff.
- * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.
- * @param {string} text1 Old string to be diffed.
- * @param {string} text2 New string to be diffed.
- * @return {Array} Array of diff tuples.
- * @private
- */
- function diff_bisect_(text1, text2) {
- // Cache the text lengths to prevent multiple calls.
- var text1_length = text1.length;
- var text2_length = text2.length;
- var max_d = Math.ceil((text1_length + text2_length) / 2);
- var v_offset = max_d;
- var v_length = 2 * max_d;
- var v1 = new Array(v_length);
- var v2 = new Array(v_length); // Setting all elements to -1 is faster in Chrome & Firefox than mixing
- // integers and undefined.
- for (var x = 0; x < v_length; x++) {
- v1[x] = -1;
- v2[x] = -1;
- }
- v1[v_offset + 1] = 0;
- v2[v_offset + 1] = 0;
- var delta = text1_length - text2_length; // If the total number of characters is odd, then the front path will collide
- // with the reverse path.
- var front = delta % 2 !== 0; // Offsets for start and end of k loop.
- // Prevents mapping of space beyond the grid.
- var k1start = 0;
- var k1end = 0;
- var k2start = 0;
- var k2end = 0;
- for (var d = 0; d < max_d; d++) {
- // Walk the front path one step.
- for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {
- var k1_offset = v_offset + k1;
- var x1 = void 0;
- if (k1 === -d || k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1]) {
- x1 = v1[k1_offset + 1];
- } else {
- x1 = v1[k1_offset - 1] + 1;
- }
- var y1 = x1 - k1;
- while (x1 < text1_length && y1 < text2_length && text1.charAt(x1) === text2.charAt(y1)) {
- x1++;
- y1++;
- }
- v1[k1_offset] = x1;
- if (x1 > text1_length) {
- // Ran off the right of the graph.
- k1end += 2;
- } else if (y1 > text2_length) {
- // Ran off the bottom of the graph.
- k1start += 2;
- } else if (front) {
- var k2_offset = v_offset + delta - k1;
- if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {
- // Mirror x2 onto top-left coordinate system.
- var x2 = text1_length - v2[k2_offset];
- if (x1 >= x2) {
- // Overlap detfrontected.
- return diff_bisectSplit_(text1, text2, x1, y1);
- }
- }
- }
- } // Walk the reverse path one step.
- for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {
- var _k2_offset = v_offset + k2;
- var _x = void 0;
- if (k2 === -d || k2 !== d && v2[_k2_offset - 1] < v2[_k2_offset + 1]) {
- _x = v2[_k2_offset + 1];
- } else {
- _x = v2[_k2_offset - 1] + 1;
- }
- var y2 = _x - k2;
- while (_x < text1_length && y2 < text2_length && text1.charAt(text1_length - _x - 1) === text2.charAt(text2_length - y2 - 1)) {
- _x++;
- y2++;
- }
- v2[_k2_offset] = _x;
- if (_x > text1_length) {
- // Ran off the left of the graph.
- k2end += 2;
- } else if (y2 > text2_length) {
- // Ran off the top of the graph.
- k2start += 2;
- } else if (!front) {
- var _k1_offset = v_offset + delta - k2;
- if (_k1_offset >= 0 && _k1_offset < v_length && v1[_k1_offset] !== -1) {
- var _x2 = v1[_k1_offset];
- var _y = v_offset + _x2 - _k1_offset; // Mirror x2 onto top-left coordinate system.
- _x = text1_length - _x;
- if (_x2 >= _x) {
- // Overlap detected.
- return diff_bisectSplit_(text1, text2, _x2, _y);
- }
- }
- }
- }
- } // Diff took too long and hit the deadline or
- // number of diffs equals number of characters, no commonality at all.
- return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
- }
- /**
- * Given the location of the 'middle snake', split the diff in two parts
- * and recurse.
- * @param {string} text1 Old string to be diffed.
- * @param {string} text2 New string to be diffed.
- * @param {number} x Index of split point in text1.
- * @param {number} y Index of split point in text2.
- * @return {Array} Array of diff tuples.
- */
- function diff_bisectSplit_(text1, text2, x, y) {
- var text1a = text1.substring(0, x);
- var text2a = text2.substring(0, y);
- var text1b = text1.substring(x);
- var text2b = text2.substring(y); // Compute both diffs serially.
- var diffs = diff_main(text1a, text2a);
- var diffsb = diff_main(text1b, text2b);
- return diffs.concat(diffsb);
- }
- /**
- * Determine the common prefix of two strings.
- * @param {string} text1 First string.
- * @param {string} text2 Second string.
- * @return {number} The number of characters common to the start of each
- * string.
- */
- function diff_commonPrefix(text1, text2) {
- // Quick check for common null cases.
- if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {
- return 0;
- } // Binary search.
- // Performance analysis: http://neil.fraser.name/news/2007/10/09/
- var pointermin = 0;
- var pointermax = Math.min(text1.length, text2.length);
- var pointermid = pointermax;
- var pointerstart = 0;
- while (pointermin < pointermid) {
- if (text1.substring(pointerstart, pointermid) == text2.substring(pointerstart, pointermid)) {
- pointermin = pointermid;
- pointerstart = pointermin;
- } else {
- pointermax = pointermid;
- }
- pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
- }
- if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {
- pointermid--;
- }
- return pointermid;
- }
- /**
- * Determine the common suffix of two strings.
- * @param {string} text1 First string.
- * @param {string} text2 Second string.
- * @return {number} The number of characters common to the end of each string.
- */
- function diff_commonSuffix(text1, text2) {
- // Quick check for common null cases.
- if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {
- return 0;
- } // Binary search.
- // Performance analysis: http://neil.fraser.name/news/2007/10/09/
- var pointermin = 0;
- var pointermax = Math.min(text1.length, text2.length);
- var pointermid = pointermax;
- var pointerend = 0;
- while (pointermin < pointermid) {
- if (text1.substring(text1.length - pointermid, text1.length - pointerend) == text2.substring(text2.length - pointermid, text2.length - pointerend)) {
- pointermin = pointermid;
- pointerend = pointermin;
- } else {
- pointermax = pointermid;
- }
- pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
- }
- if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {
- pointermid--;
- }
- return pointermid;
- }
- /**
- * Do the two texts share a substring which is at least half the length of the
- * longer text?
- * This speedup can produce non-minimal diffs.
- * @param {string} text1 First string.
- * @param {string} text2 Second string.
- * @return {Array.<string>} Five element Array, containing the prefix of
- * text1, the suffix of text1, the prefix of text2, the suffix of
- * text2 and the common middle. Or null if there was no match.
- */
- function diff_halfMatch_(text1, text2) {
- var longtext = text1.length > text2.length ? text1 : text2;
- var shorttext = text1.length > text2.length ? text2 : text1;
- if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {
- return null; // Pointless.
- }
- /**
- * Does a substring of shorttext exist within longtext such that the substring
- * is at least half the length of longtext?
- * Closure, but does not reference any external variables.
- * @param {string} longtext Longer string.
- * @param {string} shorttext Shorter string.
- * @param {number} i Start index of quarter length substring within longtext.
- * @return {Array.<string>} Five element Array, containing the prefix of
- * longtext, the suffix of longtext, the prefix of shorttext, the suffix
- * of shorttext and the common middle. Or null if there was no match.
- * @private
- */
- function diff_halfMatchI_(longtext, shorttext, i) {
- // Start with a 1/4 length substring at position i as a seed.
- var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));
- var j = -1;
- var best_common = '';
- var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
- while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {
- var prefixLength = diff_commonPrefix(longtext.substring(i), shorttext.substring(j));
- var suffixLength = diff_commonSuffix(longtext.substring(0, i), shorttext.substring(0, j));
- if (best_common.length < suffixLength + prefixLength) {
- best_common = shorttext.substring(j - suffixLength, j) + shorttext.substring(j, j + prefixLength);
- best_longtext_a = longtext.substring(0, i - suffixLength);
- best_longtext_b = longtext.substring(i + prefixLength);
- best_shorttext_a = shorttext.substring(0, j - suffixLength);
- best_shorttext_b = shorttext.substring(j + prefixLength);
- }
- }
- if (best_common.length * 2 >= longtext.length) {
- return [best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b, best_common];
- } else {
- return null;
- }
- } // First check if the second quarter is the seed for a half-match.
- var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4)); // Check again based on the third quarter.
- var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));
- var hm;
- if (!hm1 && !hm2) {
- return null;
- } else if (!hm2) {
- hm = hm1;
- } else if (!hm1) {
- hm = hm2;
- } else {
- // Both matched. Select the longest.
- hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
- } // A half-match was found, sort out the return data.
- var text1_a, text1_b, text2_a, text2_b;
- if (text1.length > text2.length) {
- text1_a = hm[0];
- text1_b = hm[1];
- text2_a = hm[2];
- text2_b = hm[3];
- } else {
- text2_a = hm[0];
- text2_b = hm[1];
- text1_a = hm[2];
- text1_b = hm[3];
- }
- var mid_common = hm[4];
- return [text1_a, text1_b, text2_a, text2_b, mid_common];
- }
- /**
- * Reorder and merge like edit sections. Merge equalities.
- * Any edit section can move as long as it doesn't cross an equality.
- * @param {Array} diffs Array of diff tuples.
- * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff
- */
- function diff_cleanupMerge(diffs, fix_unicode) {
- diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.
- var pointer = 0;
- var count_delete = 0;
- var count_insert = 0;
- var text_delete = '';
- var text_insert = '';
- var commonlength;
- var previous_equality;
- while (pointer < diffs.length) {
- if (pointer < diffs.length - 1 && !diffs[pointer][1]) {
- diffs.splice(pointer, 1);
- continue;
- }
- switch (diffs[pointer][0]) {
- case DIFF_INSERT:
- count_insert++;
- text_insert += diffs[pointer][1];
- pointer++;
- break;
- case DIFF_DELETE:
- count_delete++;
- text_delete += diffs[pointer][1];
- pointer++;
- break;
- case DIFF_EQUAL:
- previous_equality = pointer - count_insert - count_delete - 1;
- if (fix_unicode) {
- // prevent splitting of unicode surrogate pairs. when fix_unicode is true,
- // we assume that the old and new text in the diff are complete and correct
- // unicode-encoded JS strings, but the tuple boundaries may fall between
- // surrogate pairs. we fix this by shaving off stray surrogates from the end
- // of the previous equality and the beginning of this equality. this may create
- // empty equalities or a common prefix or suffix. for example, if AB and AC are
- // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and
- // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this
- // particular case, both equalities go away, we absorb any previous inequalities,
- // and we keep scanning for the next equality before rewriting the tuples.
- if (previous_equality >= 0 && ends_with_pair_start(diffs[previous_equality][1])) {
- var stray = diffs[previous_equality][1].slice(-1);
- diffs[previous_equality][1] = diffs[previous_equality][1].slice(0, -1);
- text_delete = stray + text_delete;
- text_insert = stray + text_insert;
- if (!diffs[previous_equality][1]) {
- // emptied out previous equality, so delete it and include previous delete/insert
- diffs.splice(previous_equality, 1);
- pointer--;
- var k = previous_equality - 1;
- if (diffs[k] && diffs[k][0] === DIFF_INSERT) {
- count_insert++;
- text_insert = diffs[k][1] + text_insert;
- k--;
- }
- if (diffs[k] && diffs[k][0] === DIFF_DELETE) {
- count_delete++;
- text_delete = diffs[k][1] + text_delete;
- k--;
- }
- previous_equality = k;
- }
- }
- if (starts_with_pair_end(diffs[pointer][1])) {
- var _stray = diffs[pointer][1].charAt(0);
- diffs[pointer][1] = diffs[pointer][1].slice(1);
- text_delete += _stray;
- text_insert += _stray;
- }
- }
- if (pointer < diffs.length - 1 && !diffs[pointer][1]) {
- // for empty equality not at end, wait for next equality
- diffs.splice(pointer, 1);
- break;
- }
- if (text_delete.length > 0 || text_insert.length > 0) {
- // note that diff_commonPrefix and diff_commonSuffix are unicode-aware
- if (text_delete.length > 0 && text_insert.length > 0) {
- // Factor out any common prefixes.
- commonlength = diff_commonPrefix(text_insert, text_delete);
- if (commonlength !== 0) {
- if (previous_equality >= 0) {
- diffs[previous_equality][1] += text_insert.substring(0, commonlength);
- } else {
- diffs.splice(0, 0, [DIFF_EQUAL, text_insert.substring(0, commonlength)]);
- pointer++;
- }
- text_insert = text_insert.substring(commonlength);
- text_delete = text_delete.substring(commonlength);
- } // Factor out any common suffixes.
- commonlength = diff_commonSuffix(text_insert, text_delete);
- if (commonlength !== 0) {
- diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];
- text_insert = text_insert.substring(0, text_insert.length - commonlength);
- text_delete = text_delete.substring(0, text_delete.length - commonlength);
- }
- } // Delete the offending records and add the merged ones.
- var n = count_insert + count_delete;
- if (text_delete.length === 0 && text_insert.length === 0) {
- diffs.splice(pointer - n, n);
- pointer = pointer - n;
- } else if (text_delete.length === 0) {
- diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);
- pointer = pointer - n + 1;
- } else if (text_insert.length === 0) {
- diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);
- pointer = pointer - n + 1;
- } else {
- diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]);
- pointer = pointer - n + 2;
- }
- }
- if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {
- // Merge this equality with the previous one.
- diffs[pointer - 1][1] += diffs[pointer][1];
- diffs.splice(pointer, 1);
- } else {
- pointer++;
- }
- count_insert = 0;
- count_delete = 0;
- text_delete = '';
- text_insert = '';
- break;
- }
- }
- if (diffs[diffs.length - 1][1] === '') {
- diffs.pop(); // Remove the dummy entry at the end.
- } // Second pass: look for single edits surrounded on both sides by equalities
- // which can be shifted sideways to eliminate an equality.
- // e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC
- var changes = false;
- pointer = 1; // Intentionally ignore the first and last element (don't need checking).
- while (pointer < diffs.length - 1) {
- if (diffs[pointer - 1][0] === DIFF_EQUAL && diffs[pointer + 1][0] === DIFF_EQUAL) {
- // This is a single edit surrounded by equalities.
- if (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {
- // Shift the edit over the previous equality.
- diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length);
- diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
- diffs.splice(pointer - 1, 1);
- changes = true;
- } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == diffs[pointer + 1][1]) {
- // Shift the edit over the next equality.
- diffs[pointer - 1][1] += diffs[pointer + 1][1];
- diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1];
- diffs.splice(pointer + 1, 1);
- changes = true;
- }
- }
- pointer++;
- } // If shifts were made, the diff needs reordering and another shift sweep.
- if (changes) {
- diff_cleanupMerge(diffs, fix_unicode);
- }
- }
- function is_surrogate_pair_start(charCode) {
- return charCode >= 0xD800 && charCode <= 0xDBFF;
- }
- function is_surrogate_pair_end(charCode) {
- return charCode >= 0xDC00 && charCode <= 0xDFFF;
- }
- function starts_with_pair_end(str) {
- return is_surrogate_pair_end(str.charCodeAt(0));
- }
- function ends_with_pair_start(str) {
- return is_surrogate_pair_start(str.charCodeAt(str.length - 1));
- }
- function remove_empty_tuples(tuples) {
- var ret = [];
- for (var i = 0; i < tuples.length; i++) {
- if (tuples[i][1].length > 0) {
- ret.push(tuples[i]);
- }
- }
- return ret;
- }
- function make_edit_splice(before, oldMiddle, newMiddle, after) {
- if (ends_with_pair_start(before) || starts_with_pair_end(after)) {
- return null;
- }
- return remove_empty_tuples([[DIFF_EQUAL, before], [DIFF_DELETE, oldMiddle], [DIFF_INSERT, newMiddle], [DIFF_EQUAL, after]]);
- }
- function find_cursor_edit_diff(oldText, newText, cursor_pos) {
- // note: this runs after equality check has ruled out exact equality
- var oldRange = typeof cursor_pos === 'number' ? {
- index: cursor_pos,
- length: 0
- } : cursor_pos.oldRange;
- var newRange = typeof cursor_pos === 'number' ? null : cursor_pos.newRange; // take into account the old and new selection to generate the best diff
- // possible for a text edit. for example, a text change from "xxx" to "xx"
- // could be a delete or forwards-delete of any one of the x's, or the
- // result of selecting two of the x's and typing "x".
- var oldLength = oldText.length;
- var newLength = newText.length;
- if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {
- // see if we have an insert or delete before or after cursor
- var oldCursor = oldRange.index;
- var oldBefore = oldText.slice(0, oldCursor);
- var oldAfter = oldText.slice(oldCursor);
- var maybeNewCursor = newRange ? newRange.index : null;
- editBefore: {
- // is this an insert or delete right before oldCursor?
- var newCursor = oldCursor + newLength - oldLength;
- if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {
- break editBefore;
- }
- if (newCursor < 0 || newCursor > newLength) {
- break editBefore;
- }
- var newBefore = newText.slice(0, newCursor);
- var newAfter = newText.slice(newCursor);
- if (newAfter !== oldAfter) {
- break editBefore;
- }
- var prefixLength = Math.min(oldCursor, newCursor);
- var oldPrefix = oldBefore.slice(0, prefixLength);
- var newPrefix = newBefore.slice(0, prefixLength);
- if (oldPrefix !== newPrefix) {
- break editBefore;
- }
- var oldMiddle = oldBefore.slice(prefixLength);
- var newMiddle = newBefore.slice(prefixLength);
- return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);
- }
- editAfter: {
- // is this an insert or delete right after oldCursor?
- if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {
- break editAfter;
- }
- var cursor = oldCursor;
- var _newBefore = newText.slice(0, cursor);
- var _newAfter = newText.slice(cursor);
- if (_newBefore !== oldBefore) {
- break editAfter;
- }
- var suffixLength = Math.min(oldLength - cursor, newLength - cursor);
- var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);
- var newSuffix = _newAfter.slice(_newAfter.length - suffixLength);
- if (oldSuffix !== newSuffix) {
- break editAfter;
- }
- var _oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);
- var _newMiddle = _newAfter.slice(0, _newAfter.length - suffixLength);
- return make_edit_splice(oldBefore, _oldMiddle, _newMiddle, oldSuffix);
- }
- }
- if (oldRange.length > 0 && newRange && newRange.length === 0) {
- replaceRange: {
- // see if diff could be a splice of the old selection range
- var _oldPrefix = oldText.slice(0, oldRange.index);
- var _oldSuffix = oldText.slice(oldRange.index + oldRange.length);
- var _prefixLength = _oldPrefix.length;
- var _suffixLength = _oldSuffix.length;
- if (newLength < _prefixLength + _suffixLength) {
- break replaceRange;
- }
- var _newPrefix = newText.slice(0, _prefixLength);
- var _newSuffix = newText.slice(newLength - _suffixLength);
- if (_oldPrefix !== _newPrefix || _oldSuffix !== _newSuffix) {
- break replaceRange;
- }
- var _oldMiddle2 = oldText.slice(_prefixLength, oldLength - _suffixLength);
- var _newMiddle2 = newText.slice(_prefixLength, newLength - _suffixLength);
- return make_edit_splice(_oldPrefix, _oldMiddle2, _newMiddle2, _oldSuffix);
- }
- }
- return null;
- }
- function diff(text1, text2, cursor_pos) {
- // only pass fix_unicode=true at the top level, not when diff_main is
- // recursively invoked
- return diff_main(text1, text2, cursor_pos, true);
- }
- diff.INSERT = DIFF_INSERT;
- diff.DELETE = DIFF_DELETE;
- diff.EQUAL = DIFF_EQUAL;
- /* harmony default export */ __webpack_exports__["default"] = (diff);
- /***/ }),
- /***/ "./js/util/testConsole.js":
- /*!********************************!*\
- !*** ./js/util/testConsole.js ***!
- \********************************/
- /*! exports provided: TestConsole */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TestConsole", function() { return TestConsole; });
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../io/domConsole */ "./js/io/domConsole.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- var LocalizedStrings = Object(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_3__["getInstance"])();
- var TestConsole = /*#__PURE__*/function () {
- function TestConsole(inputList) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, TestConsole);
- this.index = 0;
- this.inputList = inputList;
- this.list = [];
- this.currentLine = null;
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(TestConsole, [{
- key: "writeRawHTML",
- value: function writeRawHTML(text) {
- this._appendTextLn(text);
- }
- }, {
- key: "write",
- value: function write(text) {
- var newLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- this._appendText(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].USER, newLine);
- }
- }, {
- key: "info",
- value: function info(text) {
- this._appendTextLn(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].INFO);
- }
- }, {
- key: "err",
- value: function err(text) {
- this._appendTextLn(text, _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].ERR);
- }
- }, {
- key: "_appendText",
- value: function _appendText(text, _type) {
- var newLine = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- if (this.currentLine == null) {
- this.currentLine = this.list.push('') - 1;
- }
- this.list[this.currentLine] += text;
- if (newLine) {
- this.currentLine = null;
- }
- }
- }, {
- key: "_appendTextLn",
- value: function _appendTextLn(text) {
- this.list.push(text);
- this.currentLine = null;
- }
- }, {
- key: "getClassForType",
- value: function getClassForType(type) {
- switch (type) {
- case _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].USER:
- return "ivprog-term-userText";
- case _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].INFO:
- return "ivprog-term-info";
- case _io_domConsole__WEBPACK_IMPORTED_MODULE_2__["DOMConsole"].ERR:
- return "ivprog-term-error";
- }
- }
- }, {
- key: "requestInput",
- value: function requestInput() {
- var _this = this;
- var promise = new Promise(function (resolve, reject) {
- if (_this.index < _this.inputList.length) {
- resolve(_this.inputList[_this.index]);
- _this.index++;
- } else {
- reject(new Error(LocalizedStrings.getError("exceeded_input_request")));
- }
- });
- return promise;
- }
- }, {
- key: "sendOutput",
- value: function sendOutput(text) {
- var _this2 = this;
- var output = '' + text;
- if (output.indexOf('\n') !== -1) {
- var outputList = output.split('\n');
- var last = outputList.pop();
- outputList.forEach(function (t) {
- t = t.replace(/\t/g, '  ');
- t = t.replace(/\s/g, " ");
- if (t.length == 0) _this2.currentLine = null;else _this2.write(t, true);
- });
- last = last.replace(/\t/g, '  ');
- last = last.replace(/\s/g, " ");
- if (last.length != 0) this.write(last);
- } else {
- output = output.replace(/\t/g, '  ');
- output = output.replace(/\s/g, " ");
- this.write(output);
- }
- }
- }]);
- return TestConsole;
- }();
- /***/ }),
- /***/ "./js/util/utils.js":
- /*!**************************!*\
- !*** ./js/util/utils.js ***!
- \**************************/
- /*! exports provided: scrollIt, isElementInViewport, isKeyword, isValidIdentifier, getCodeEditorModeConfig, levenshteinDistance, openAssessmentDetail, range, sleep */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollIt", function() { return scrollIt; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isElementInViewport", function() { return isElementInViewport; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isKeyword", function() { return isKeyword; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidIdentifier", function() { return isValidIdentifier; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCodeEditorModeConfig", function() { return getCodeEditorModeConfig; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "levenshteinDistance", function() { return levenshteinDistance; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "openAssessmentDetail", function() { return openAssessmentDetail; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return range; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sleep", function() { return sleep; });
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
- /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _services_languageService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../services/languageService */ "./js/services/languageService.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../ast/operators */ "./js/ast/operators.ts");
- /* harmony import */ var _ast_operators__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_ast_operators__WEBPACK_IMPORTED_MODULE_5__);
- /**
- * source: https://pawelgrzybek.com/page-scroll-in-vanilla-javascript/
- *
- */
- function scrollIt(destination) {
- var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
- var easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'linear';
- var callback = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
- var easings = {
- linear: function linear(t) {
- return t;
- },
- easeInQuad: function easeInQuad(t) {
- return t * t;
- },
- easeOutQuad: function easeOutQuad(t) {
- return t * (2 - t);
- },
- easeInOutQuad: function easeInOutQuad(t) {
- return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
- },
- easeInCubic: function easeInCubic(t) {
- return t * t * t;
- },
- easeOutCubic: function easeOutCubic(t) {
- return --t * t * t + 1;
- },
- easeInOutCubic: function easeInOutCubic(t) {
- return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
- },
- easeInQuart: function easeInQuart(t) {
- return t * t * t * t;
- },
- easeOutQuart: function easeOutQuart(t) {
- return 1 - --t * t * t * t;
- },
- easeInOutQuart: function easeInOutQuart(t) {
- return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
- },
- easeInQuint: function easeInQuint(t) {
- return t * t * t * t * t;
- },
- easeOutQuint: function easeOutQuint(t) {
- return 1 + --t * t * t * t * t;
- },
- easeInOutQuint: function easeInOutQuint(t) {
- return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;
- }
- };
- var start = window.pageYOffset;
- var startTime = 'now' in window.performance ? performance.now() : new Date().getTime();
- var documentHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);
- var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;
- var destinationOffset = typeof destination === 'number' ? destination : destination.offsetTop;
- var destinationOffsetToScroll = Math.round(documentHeight - destinationOffset < windowHeight ? documentHeight - windowHeight : destinationOffset);
- if ('requestAnimationFrame' in window === false) {
- window.scroll(0, destinationOffsetToScroll);
- if (callback) {
- callback();
- }
- return;
- }
- function scroll() {
- var now = 'now' in window.performance ? performance.now() : new Date().getTime();
- var time = Math.min(1, (now - startTime) / duration);
- var timeFunction = easings[easing](time);
- window.scroll(0, Math.ceil(timeFunction * (destinationOffsetToScroll - start) + start));
- if (window.pageYOffset === destinationOffsetToScroll) {
- if (callback) {
- callback();
- }
- return;
- }
- requestAnimationFrame(scroll);
- }
- scroll();
- }
- /**
- *
- * source: https://stackoverflow.com/a/16270434
- */
- function isElementInViewport(el) {
- var rect = el.getBoundingClientRect();
- return rect.bottom > 0 && rect.right > 0 && rect.left < (window.innerWidth || document.documentElement.clientWidth) && rect.top < (window.innerHeight || document.documentElement.clientHeight);
- }
- var cacheMainList = null;
- var cacheOp = null;
- function fillCache() {
- if (cacheMainList == null) {
- cacheMainList = [];
- 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"];
- var lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_3__["LanguageService"].getCurrentLexer();
- var nullLexer = new lexerClass();
- for (var key = 0; key < mainList.length; ++key) {
- var word = mainList[key];
- var keyword = nullLexer.literalNames[lexerClass[word]];
- cacheMainList.push(keyword.substring(1, keyword.length - 1));
- }
- }
- if (cacheOp == null) {
- cacheOp = [];
- var logicOpList = [_ast_operators__WEBPACK_IMPORTED_MODULE_5__["Operators"].AND.value, _ast_operators__WEBPACK_IMPORTED_MODULE_5__["Operators"].OR.value, _ast_operators__WEBPACK_IMPORTED_MODULE_5__["Operators"].NOT.value];
- for (var op = 0; op < logicOpList.length; ++op) {
- var lOp = "logic_operator_".concat(logicOpList[op]);
- cacheOp.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI(lOp));
- }
- }
- }
- function isKeyword(text) {
- fillCache();
- for (var key = 0; key < cacheMainList.length; ++key) {
- var keyword = cacheMainList[key];
- if (keyword == text) {
- return true;
- }
- } // not in main list, check op
- for (var op = 0; op < cacheOp.length; op++) {
- var lOp = cacheOp[op];
- if (lOp == text) {
- return true;
- }
- }
- return false;
- }
- function isValidIdentifier(identifier_str) {
- var validRegex = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier_str);
- if (!validRegex) {
- return false;
- }
- return !isKeyword(identifier_str);
- }
- function getCodeEditorModeConfig() {
- 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"];
- var keywordsList = ["RK_CONST", "RK_RETURN", "RK_BREAK", "RK_FOR_FROM", "RK_FOR_TO", "RK_FOR_PASS", "RK_DO_UNTIL"];
- var typeList = ["RK_REAL", "RK_VOID", "RK_BOOLEAN", "RK_STRING", "RK_INTEGER", "RK_CHARACTER"];
- var atomList = ["RK_FALSE", "RK_TRUE"];
- var case_default = [];
- var blocks = [];
- var keywords = [];
- var types = [];
- var atoms = [];
- var switchString = "";
- cacheMainList = [];
- var lexerClass = _services_languageService__WEBPACK_IMPORTED_MODULE_3__["LanguageService"].getCurrentLexer();
- var nullLexer = new lexerClass();
- blockList.forEach(function (v) {
- var keyword = nullLexer.literalNames[lexerClass[v]];
- var value = keyword.substring(1, keyword.length - 1);
- cacheMainList.push(value);
- keywords.push(value);
- blocks.push(value);
- if (v == "RK_SWITCH") {
- switchString = value;
- } else if (v == "RK_CASE" || v == "RK_DEFAULT") {
- case_default.push(value);
- }
- });
- keywordsList.forEach(function (v) {
- var keyword = nullLexer.literalNames[lexerClass[v]];
- var value = keyword.substring(1, keyword.length - 1);
- cacheMainList.push(value);
- keywords.push(value);
- });
- typeList.forEach(function (v) {
- var keyword = nullLexer.literalNames[lexerClass[v]];
- var value = keyword.substring(1, keyword.length - 1);
- cacheMainList.push(value);
- types.push(value);
- });
- atomList.forEach(function (v) {
- var keyword = nullLexer.literalNames[lexerClass[v]];
- var value = keyword.substring(1, keyword.length - 1);
- cacheMainList.push(value);
- atoms.push(value);
- });
- cacheOp = [];
- var logicOpList = [_ast_operators__WEBPACK_IMPORTED_MODULE_5__["Operators"].AND.value, _ast_operators__WEBPACK_IMPORTED_MODULE_5__["Operators"].OR.value, _ast_operators__WEBPACK_IMPORTED_MODULE_5__["Operators"].NOT.value];
- for (var op = 0; op < logicOpList.length; ++op) {
- var lOp = "logic_operator_".concat(logicOpList[op]);
- var value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_4__["LocalizedStrings"].getUI(lOp);
- cacheOp.push(value);
- keywords.push(value);
- }
- return {
- case_default: case_default,
- atoms: atoms,
- keywords: keywords,
- switchString: switchString,
- types: types,
- blocks: blocks
- };
- }
- /**
- * Source: https://gist.github.com/andrei-m/982927
- * @param {string} a
- * @param {string} b
- */
- function levenshteinDistance(a, b) {
- if (a.length == 0) return b.length;
- if (b.length == 0) return a.length;
- var matrix = []; // increment along the first column of each row
- var i;
- for (i = 0; i <= b.length; i++) {
- matrix[i] = [i];
- } // increment each column in the first row
- var j;
- for (j = 0; j <= a.length; j++) {
- matrix[0][j] = j;
- } // Fill in the rest of the matrix
- for (i = 1; i <= b.length; i++) {
- for (j = 1; j <= a.length; j++) {
- if (b.charCodeAt(i - 1) == a.charCodeAt(j - 1)) {
- matrix[i][j] = matrix[i - 1][j - 1];
- } else {
- matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution
- Math.min(matrix[i][j - 1] + 1, // insertion
- matrix[i - 1][j] + 1)); // deletion
- }
- }
- }
- return matrix[b.length][a.length];
- }
- var win = null;
- function openAssessmentDetail(event) {
- event.preventDefault();
- var page_code = event.currentTarget.dataset.page;
- if (win != null) {
- win.close();
- }
- win = window.open("", "DetailWindow", "width=550,height=600");
- win.document.open();
- win.document.write(page_code);
- win.document.close();
- }
- function range(size) {
- var startAt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- return _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(Array(size).keys()).map(function (i) {
- return i + startAt;
- });
- }
- /**
- *
- * @param {number} ms
- */
- function sleep(_x) {
- return _sleep.apply(this, arguments);
- }
- function _sleep() {
- _sleep = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(ms) {
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- return _context.abrupt("return", new Promise(function (res, _) {
- return setTimeout(res, ms);
- }));
- case 1:
- case "end":
- return _context.stop();
- }
- }
- }, _callee);
- }));
- return _sleep.apply(this, arguments);
- }
- /***/ }),
- /***/ "./js/visualUI/algorithm.js":
- /*!**********************************!*\
- !*** ./js/visualUI/algorithm.js ***!
- \**********************************/
- /*! exports provided: renderAlgorithm */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderAlgorithm", function() { return renderAlgorithm; });
- /* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./globals */ "./js/visualUI/globals.js");
- /* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functions */ "./js/visualUI/functions.js");
- window.block_render = false;
- function renderAlgorithm() {
- if (window.block_render) {
- return;
- }
- if (window.draging) {
- return;
- }
- window.block_render = true;
- console.log('rendering algorithm');
- $('.all_functions').children().off();
- $('.all_functions').empty();
- $('.list_globals').children().off();
- $('.list_globals').empty();
- for (var i = 0; i < window.program_obj.functions.length; i++) {
- _functions__WEBPACK_IMPORTED_MODULE_1__["renderFunction"](window.program_obj.functions[i]);
- }
- for (var i = 0; i < window.program_obj.globals.length; i++) {
- _globals__WEBPACK_IMPORTED_MODULE_0__["renderGlobal"](window.program_obj.globals[i]);
- }
- setTimeout(function () {
- window.block_render = false;
- }, 100);
- console.log('fim do render');
- if (settingsFilter && settingsFilter[0]) {
- blockAllEditingOptions();
- }
- }
- /***/ }),
- /***/ "./js/visualUI/code_generator.js":
- /*!***************************************!*\
- !*** ./js/visualUI/code_generator.js ***!
- \***************************************/
- /*! exports provided: generate */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return generate; });
- /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
- /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
- /* eslint-disable @typescript-eslint/no-use-before-define */
- /* globals $*/
- function generate() {
- $(".ivprog_visual_panel").find(".error_icon").remove();
- var code = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("program") + " { ";
- code += globalsCode();
- code += "\n";
- var has_error = false;
- for (var i = 0; i < window.program_obj.functions.length; i++) {
- var n_code = functionsCode(window.program_obj.functions[i]);
- if (n_code == null) {
- has_error = true;
- }
- code += n_code;
- code += "\n";
- }
- code += "\n}";
- if (has_error) {
- return null;
- } else {
- return code;
- }
- }
- function functionsCode(function_obj) {
- var ret = "\n\t" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("function") + " ";
- var has_error = false;
- switch (function_obj.return_type) {
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer");
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real");
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text");
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean");
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char");
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID:
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_void");
- break;
- }
- ret += " ";
- if (function_obj.return_dimensions == 1) {
- ret += "[] ";
- } else if (function_obj.return_dimensions == 2) {
- ret += "[][] ";
- }
- if (function_obj.is_main) {
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("start");
- } else {
- ret += function_obj.name;
- }
- ret += " ( ";
- for (var j = 0; j < function_obj.parameters_list.length; j++) {
- ret += parametersCode(function_obj.parameters_list[j]);
- if (j + 1 < function_obj.parameters_list.length) {
- ret += ", ";
- }
- }
- ret += " ) {";
- for (var _j = 0; _j < function_obj.variables_list.length; _j++) {
- ret += variablesCode(function_obj.variables_list[_j]);
- }
- for (var _j2 = 0; _j2 < function_obj.commands.length; _j2++) {
- //try {
- ret += commandsCode(function_obj.commands[_j2]);
- /*} catch (err) {
- has_error = true;
- console.error(err.message);
- var todos = $('body').find('.command_container');
- for (var i = 0; i < todos.length; i++) {
- if ($(todos[i]).data('command') == function_obj.commands[j]) {
- $( todos[i] ).prepend( ' <i class="ui icon red exclamation triangle error_icon"></i> ' );
- break;
- }
- }
- }*/
- }
- ret += "\n\t}";
- if (has_error) {
- return null;
- } else {
- return ret;
- }
- }
- function commandsCode(command_obj) {
- var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
- switch (command_obj.type) {
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["break"]:
- return breaksCode(command_obj, indentation);
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].comment:
- return commentsCode(command_obj, indentation);
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].reader:
- return readersCode(command_obj, indentation);
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].writer:
- return writersCode(command_obj, indentation);
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].functioncall:
- return functioncallsCode(command_obj, indentation);
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].attribution:
- return attributionsCode(command_obj, indentation);
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].whiletrue:
- return whiletruesCode(command_obj, indentation);
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].dowhiletrue:
- return doWhilesCode(command_obj, indentation);
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].iftrue:
- return iftruesCode(command_obj, indentation);
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].repeatNtimes:
- return repeatNtimesCode(command_obj, indentation);
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["switch"]:
- return switchsCode(command_obj, indentation);
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"]["return"]:
- return returnsCode(command_obj, indentation);
- }
- }
- function returnsCode(command_obj, indentation) {
- var ret = "\n";
- for (var i = 0; i < indentation; i++) {
- ret += "\t";
- }
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_return");
- if (command_obj.variable_value_menu) {
- try {
- ret += " " + elementExpressionCode(command_obj.variable_value_menu); //ret += ' ' + variableValueMenuCode(command_obj.variable_value_menu, true);
- } catch (err) {//Empty block
- }
- }
- return ret;
- }
- function breaksCode(_command_obj, indentation) {
- var ret = "\n";
- for (var i = 0; i < indentation; i++) {
- ret += "\t";
- }
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_break");
- return ret;
- }
- function switchsCode(command_obj, indentation) {
- var ret = "\n";
- for (var i = 0; i < indentation; i++) {
- ret += "\t";
- }
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_switch") + " ( ";
- ret += variableValueMenuCode(command_obj.variable);
- ret += " ) { ";
- if (command_obj.cases) {
- for (var _i = 0; _i < command_obj.cases.length; _i++) {
- ret += switchcasesCode(command_obj.cases[_i], indentation + 1);
- }
- }
- ret += "\n";
- for (var _i2 = 0; _i2 < indentation; _i2++) {
- ret += "\t";
- }
- ret += "} ";
- return ret;
- }
- function switchcasesCode(switchcase, indentation) {
- var ret = "\n";
- for (var i = 0; i < indentation; i++) {
- ret += "\t";
- }
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_case") + " ";
- ret += variableValueMenuCode(switchcase.variable_value_menu);
- ret += " :";
- if (switchcase.commands_block) {
- for (var _i3 = 0; _i3 < switchcase.commands_block.length; _i3++) {
- ret += commandsCode(switchcase.commands_block[_i3], indentation + 1);
- }
- }
- return ret;
- }
- function repeatNtimesCode(command_obj, indentation) {
- var ret = "\n";
- for (var i = 0; i < indentation; i++) {
- ret += "\t";
- }
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_for") + " ";
- if (command_obj.var_attribution) {
- ret += variableValueMenuCode(command_obj.var_attribution);
- ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_from"), " ");
- ret += variableValueMenuCode(command_obj.expression1);
- }
- if (command_obj.expression2) {
- ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_to"), " ");
- ret += variableValueMenuCode(command_obj.expression2);
- }
- if (command_obj.expression3) {
- ret += " ".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_for_pass"), " ");
- switch (command_obj.expression3.itens[1]) {
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus:
- ret += " +";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus:
- ret += " -";
- break;
- }
- ret += variableValueMenuCode(command_obj.expression3.itens[2]);
- }
- /*if (command_obj.var_incrementation) {
- ret += variableValueMenuCode(command_obj.var_incrementation);
- ret += ' <- ';
- ret += variableValueMenuCode(command_obj.expression3.itens[0]);
- switch (command_obj.expression3.itens[1]) {
- case Models.ARITHMETIC_TYPES.plus:
- ret += ' + ';
- break;
- case Models.ARITHMETIC_TYPES.minus:
- ret += ' - ';
- break;
- case Models.ARITHMETIC_TYPES.multiplication:
- ret += ' * ';
- break;
- case Models.ARITHMETIC_TYPES.division:
- ret += ' / ';
- break;
- case Models.ARITHMETIC_TYPES.module:
- ret += ' % ';
- break;
- }
- ret += variableValueMenuCode(command_obj.expression3.itens[2]);
- }*/
- ret += " { ";
- if (command_obj.commands_block) {
- for (var _i4 = 0; _i4 < command_obj.commands_block.length; _i4++) {
- ret += commandsCode(command_obj.commands_block[_i4], indentation + 1);
- }
- }
- ret += "\n";
- for (var _i5 = 0; _i5 < indentation; _i5++) {
- ret += "\t";
- }
- ret += "}";
- return ret;
- }
- function iftruesCode(command_obj, indentation) {
- var ret = "\n";
- for (var i = 0; i < indentation; i++) {
- ret += "\t";
- }
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_if");
- if (!command_obj.expression) {
- _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
- } else {
- ret += " ( ";
- ret += elementExpressionCode(command_obj.expression);
- ret += " ) ";
- }
- /*switch (command_obj.expression.expression.type) {
- case Models.EXPRESSION_TYPES.exp_logic:
- ret += logicExpressionCode(command_obj.expression.expression);
- break;
- case Models.EXPRESSION_TYPES.exp_arithmetic:
- ret += arithmeticExpressionCode(command_obj.expression.expression);
- break;
- }*/
- ret += " { ";
- if (command_obj.commands_block) {
- for (var _i6 = 0; _i6 < command_obj.commands_block.length; _i6++) {
- ret += commandsCode(command_obj.commands_block[_i6], indentation + 1);
- }
- }
- ret += "\n";
- for (var _i7 = 0; _i7 < indentation; _i7++) {
- ret += "\t";
- }
- ret += "} " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_else") + " {";
- if (command_obj.commands_else) {
- for (var _i8 = 0; _i8 < command_obj.commands_else.length; _i8++) {
- ret += commandsCode(command_obj.commands_else[_i8], indentation + 1);
- }
- }
- ret += "\n";
- for (var _i9 = 0; _i9 < indentation; _i9++) {
- ret += "\t";
- }
- ret += "}";
- return ret;
- }
- function doWhilesCode(command_obj, indentation) {
- var ret = "\n";
- for (var i = 0; i < indentation; i++) {
- ret += "\t";
- }
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_do") + " { ";
- if (command_obj.commands_block) {
- for (var _i10 = 0; _i10 < command_obj.commands_block.length; _i10++) {
- ret += commandsCode(command_obj.commands_block[_i10], indentation + 1);
- }
- }
- ret += "\n";
- for (var _i11 = 0; _i11 < indentation; _i11++) {
- ret += "\t";
- }
- ret += "} " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_do_until");
- if (!command_obj.expression) {
- _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
- }
- /*switch (command_obj.expression.expression.type) {
- case Models.EXPRESSION_TYPES.exp_logic:
- ret += logicExpressionCode(command_obj.expression.expression);
- break;
- case Models.EXPRESSION_TYPES.exp_arithmetic:
- ret += arithmeticExpressionCode(command_obj.expression.expression);
- break;
- }*/
- if (command_obj.expression) {
- ret += " ( ";
- ret += elementExpressionCode(command_obj.expression);
- ret += " ) ";
- }
- return ret;
- }
- function whiletruesCode(command_obj, indentation) {
- var ret = "\n";
- for (var i = 0; i < indentation; i++) {
- ret += "\t";
- }
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_code_while");
- if (!command_obj.expression) {
- _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](command_obj.expression.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_expression"));
- }
- /*switch (command_obj.expression.expression.type) {
- case Models.EXPRESSION_TYPES.exp_logic:
- ret += logicExpressionCode(command_obj.expression.expression);
- break;
- case Models.EXPRESSION_TYPES.exp_arithmetic:
- ret += arithmeticExpressionCode(command_obj.expression.expression);
- break;
- }*/
- if (command_obj.expression) {
- ret += " ( ";
- ret += elementExpressionCode(command_obj.expression);
- ret += " ) ";
- }
- ret += " { ";
- if (command_obj.commands_block) {
- for (var _i12 = 0; _i12 < command_obj.commands_block.length; _i12++) {
- ret += commandsCode(command_obj.commands_block[_i12], indentation + 1);
- }
- }
- ret += "\n";
- for (var _i13 = 0; _i13 < indentation; _i13++) {
- ret += "\t";
- }
- ret += "}";
- return ret;
- }
- function logicExpressionCode(expression) {
- var ret = " ( ";
- if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
- ret += logicExpressionCode(expression.first_operand);
- } else if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
- ret += arithmeticExpressionCode(expression.first_operand);
- } else {
- ret += variableValueMenuCode(expression.first_operand);
- }
- if (expression.operator) {
- switch (expression.operator) {
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to:
- ret += " == ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not_equals_to:
- ret += " != ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].and:
- ret += " && ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].or:
- ret += " || ";
- break;
- }
- if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
- ret += logicExpressionCode(expression.second_operand);
- } else if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
- ret += arithmeticExpressionCode(expression.second_operand);
- } else {
- ret += variableValueMenuCode(expression.second_operand);
- }
- }
- ret += " ) ";
- return ret;
- }
- function arithmeticExpressionCode(expression) {
- var ret = " ( ";
- if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
- ret += logicExpressionCode(expression.first_operand);
- } else if (expression.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
- ret += arithmeticExpressionCode(expression.first_operand);
- } else {
- ret += variableValueMenuCode(expression.first_operand);
- }
- switch (expression.operator) {
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than:
- ret += " > ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than:
- ret += " < ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].equals_to:
- ret += " == ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].not_equals_to:
- ret += " != ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to:
- ret += " >= ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than_or_equals_to:
- ret += " <= ";
- break;
- }
- if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) {
- ret += logicExpressionCode(expression.second_operand);
- } else if (expression.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) {
- ret += arithmeticExpressionCode(expression.second_operand);
- } else {
- ret += variableValueMenuCode(expression.second_operand);
- }
- ret += " ) ";
- return ret;
- }
- function attributionsCode(command_obj, indentation) {
- var ret = "\n";
- for (var i = 0; i < indentation; i++) {
- ret += "\t";
- }
- ret += variableValueMenuCode(command_obj.variable) + " <- ";
- /*for (var i = 0; i < command_obj.expression.length; i++) {
- ret += elementExpressionCode(command_obj.expression[i]);
- }*/
- ret += elementExpressionCode(command_obj.expression);
- return ret;
- }
- function elementExpressionCode(expression_obj) {
- var ret = "";
- for (var i = 0; i < expression_obj.length; i++) {
- if (expression_obj[i].type) {
- ret += variableValueMenuCode(expression_obj[i]);
- } else if (expression_obj[i].type_op) {
- switch (expression_obj[i].item) {
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus:
- ret += " + ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus:
- ret += " - ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].multiplication:
- ret += " * ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].division:
- ret += " / ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].module:
- ret += " % ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].equals_to:
- ret += " == ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not_equals_to:
- ret += " != ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].and:
- ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_and") + " ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].or:
- ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_or") + " ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["LOGIC_COMPARISON"].not:
- ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_operator_not") + " ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than:
- ret += " > ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than:
- ret += " < ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to:
- ret += " >= ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_COMPARISON"].less_than_or_equals_to:
- ret += " <= ";
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep:
- ret += ", ";
- break;
- }
- } else {
- ret += " " + expression_obj[i] + " ";
- }
- }
- return ret;
- }
- function functioncallsCode(command_obj, indentation) {
- var ret = "\n";
- for (var i = 0; i < indentation; i++) {
- ret += "\t";
- }
- ret += variableValueMenuCode(command_obj.function_called);
- return ret;
- }
- function readersCode(command_obj, indentation) {
- var ret = "\n";
- for (var i = 0; i < indentation; i++) {
- ret += "\t";
- }
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_command_read") + " ( ";
- ret += variableValueMenuCode(command_obj.variable_value_menu);
- ret += " ) ";
- return ret;
- }
- function variableValueMenuCode(variable_obj) {
- var is_return = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var ret = "";
- try {
- if (variable_obj.function_called) {
- if (variable_obj.function_called.name) {
- ret += variable_obj.function_called.name + " ( ";
- } else {
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].translateInternalFunction(variable_obj.function_called.identifier, variable_obj.function_called.category) + " ( ";
- }
- if (variable_obj.parameters_list) {
- for (var i = 0; i < variable_obj.parameters_list.length; i++) {
- ret += variableValueMenuCode(variable_obj.parameters_list[i]);
- if (i + 1 < variable_obj.parameters_list.length) {
- ret += ", ";
- }
- }
- }
- ret += " )";
- } else if (variable_obj.content.type) {
- ret += variable_obj.content.name;
- if (variable_obj.content.dimensions == 1 && variable_obj.dimensions != 1) {
- ret += " [ " + variableValueMenuCode(variable_obj.column) + " ] ";
- }
- if (variable_obj.content.dimensions == 2 && variable_obj.dimensions != 2) {
- ret += " [ " + variableValueMenuCode(variable_obj.row) + " ] ";
- ret += " [ " + variableValueMenuCode(variable_obj.column) + " ] ";
- }
- } else {
- var content = String(variable_obj.content);
- if (isNaN(content)) {
- // console.debug("Content length: ", content.length);
- // console.debug("Char code at 0", content.charCodeAt(0));
- var isBackslash = content.charCodeAt(0) === 92;
- if (content.length === 1 || content.length === 2 && isBackslash) {
- ret += "'".concat(content, "'");
- } else {
- ret += '"' + variable_obj.content + '"';
- }
- } else if (content.length == 0) {
- ret += '""';
- } else if (content.trim().length == 0) {
- ret += '"' + content + '"';
- } else {
- ret += variable_obj.content;
- }
- }
- } catch (err) {
- if (!is_return) {
- _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](variable_obj.dom_object, _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("inform_valid_content"));
- throw err;
- }
- }
- return ret;
- }
- function writersCode(command_obj, indentation) {
- var ret = "\n";
- for (var i = 0; i < indentation; i++) {
- ret += "\t";
- }
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_command_write") + " ( ";
- /*for (var i = 0; i < command_obj.content.length; i++) {
- ret += variableValueMenuCode(command_obj.content[i]);
- if ((i + 1) < command_obj.content.length) {
- ret += ' + ';
- }
- }*/
- ret += elementExpressionCode(command_obj.content);
- if (command_obj.newline) {
- ret += ', "\\n"';
- }
- ret += " ) ";
- return ret;
- }
- function commentsCode(command_obj, indentation) {
- var ret = "\n";
- for (var i = 0; i < indentation; i++) {
- ret += "\t";
- }
- ret += "// ";
- ret += command_obj.comment_text.content;
- return ret;
- }
- function parametersCode(parameter_obj) {
- var ret = "";
- switch (parameter_obj.type) {
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
- ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer") + " ";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
- ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real") + " ";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
- ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text") + " ";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
- ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean") + " ";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
- ret += " " + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char") + " ";
- break;
- }
- ret += parameter_obj.name + "";
- if (parameter_obj.dimensions == 1) {
- ret += " []";
- } else if (parameter_obj.dimensions == 2) {
- ret += " [][]";
- }
- return ret;
- }
- function variablesCode(variable_obj) {
- var ret = "";
- var temp = variable_obj;
- ret += "\n\t\t";
- if (temp.is_constant) {
- ret += "const ";
- }
- switch (temp.type) {
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer") + " ";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real") + " ";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text") + " ";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean") + " ";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char") + " ";
- break;
- }
- ret += temp.name + " ";
- if (temp.dimensions == 1) {
- ret += "[" + temp.columns + "] ";
- switch (temp.type) {
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
- ret += "<- {";
- for (var j = 0; j < temp.value.length; j++) {
- ret += temp.value[j];
- if (j + 1 < temp.value.length) {
- ret += ", ";
- }
- }
- ret += "}";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
- ret += "<- {";
- for (var _j3 = 0; _j3 < temp.value.length; _j3++) {
- ret += temp.value[_j3].toFixed(2);
- if (_j3 + 1 < temp.value.length) {
- ret += ", ";
- }
- }
- ret += "}";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
- ret += "<- {";
- for (var _j4 = 0; _j4 < temp.value.length; _j4++) {
- ret += '"' + temp.value[_j4] + '"';
- if (_j4 + 1 < temp.value.length) {
- ret += ", ";
- }
- }
- ret += "}";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
- ret += "<- {";
- for (var _j5 = 0; _j5 < temp.value.length; _j5++) {
- if (temp.value[_j5]) {
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
- } else {
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
- }
- if (_j5 + 1 < temp.value.length) {
- ret += ", ";
- }
- }
- ret += "}";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
- ret += "<- {";
- for (var _j6 = 0; _j6 < temp.value.length; _j6++) {
- ret += "'" + temp.value[_j6] + "'";
- if (_j6 + 1 < temp.value.length) {
- ret += ", ";
- }
- }
- ret += "}";
- break;
- }
- } else if (temp.dimensions == 2) {
- ret += "[" + temp.rows + "][" + temp.columns + "] ";
- switch (temp.type) {
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
- ret += "<- {";
- for (var _j7 = 0; _j7 < temp.rows; _j7++) {
- ret += "{";
- for (var k = 0; k < temp.columns; k++) {
- ret += temp.value[_j7][k];
- if (k + 1 < temp.columns) {
- ret += ", ";
- }
- }
- ret += "}";
- if (_j7 + 1 < temp.rows) {
- ret += ", ";
- }
- }
- ret += "}";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
- ret += "<- {";
- for (var _j8 = 0; _j8 < temp.rows; _j8++) {
- ret += "{";
- for (var _k = 0; _k < temp.columns; _k++) {
- ret += temp.value[_j8][_k].toFixed(2);
- if (_k + 1 < temp.columns) {
- ret += ", ";
- }
- }
- ret += "}";
- if (_j8 + 1 < temp.rows) {
- ret += ", ";
- }
- }
- ret += "}";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
- ret += "<- {";
- for (var _j9 = 0; _j9 < temp.rows; _j9++) {
- ret += "{";
- for (var _k2 = 0; _k2 < temp.columns; _k2++) {
- ret += '"' + temp.value[_j9][_k2] + '"';
- if (_k2 + 1 < temp.columns) {
- ret += ", ";
- }
- }
- ret += "}";
- if (_j9 + 1 < temp.rows) {
- ret += ", ";
- }
- }
- ret += "}";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
- ret += "<- {";
- for (var _j10 = 0; _j10 < temp.rows; _j10++) {
- ret += "{";
- for (var _k3 = 0; _k3 < temp.columns; _k3++) {
- if (temp.value[_j10][_k3]) {
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
- } else {
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
- }
- if (_k3 + 1 < temp.columns) {
- ret += ", ";
- }
- }
- ret += "}";
- if (_j10 + 1 < temp.rows) {
- ret += ", ";
- }
- }
- ret += "}";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
- ret += "<- {";
- for (var _j11 = 0; _j11 < temp.rows; _j11++) {
- ret += "{";
- for (var _k4 = 0; _k4 < temp.columns; _k4++) {
- ret += "'" + temp.value[_j11][_k4] + "'";
- if (_k4 + 1 < temp.columns) {
- ret += ", ";
- }
- }
- ret += "}";
- if (_j11 + 1 < temp.rows) {
- ret += ", ";
- }
- }
- ret += "}";
- break;
- }
- } else {
- switch (temp.type) {
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
- ret += "<- " + temp.value;
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
- ret += "<- " + temp.value.toFixed(2);
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
- ret += '<- "' + temp.value + '"';
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
- ret += "<- ";
- if (temp.value) {
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
- } else {
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
- }
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
- ret += "<- '" + temp.value + "'";
- break;
- }
- }
- return ret;
- }
- function globalsCode() {
- var ret = "";
- if (window.program_obj.globals) {
- for (var i = 0; i < window.program_obj.globals.length; i++) {
- var temp = window.program_obj.globals[i];
- ret += "\n\t";
- if (temp.is_constant) {
- ret += "const ";
- }
- switch (temp.type) {
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_integer");
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_real");
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_text");
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_boolean");
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_char");
- break;
- }
- ret += " " + temp.name + " ";
- if (temp.dimensions == 1) {
- ret += "[" + temp.columns + "] ";
- switch (temp.type) {
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
- ret += "<- {";
- for (var j = 0; j < temp.value.length; j++) {
- ret += temp.value[j];
- if (j + 1 < temp.value.length) {
- ret += ", ";
- }
- }
- ret += "}";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
- ret += "<- {";
- for (var _j12 = 0; _j12 < temp.value.length; _j12++) {
- ret += temp.value[_j12].toFixed(2);
- if (_j12 + 1 < temp.value.length) {
- ret += ", ";
- }
- }
- ret += "}";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
- ret += "<- {";
- for (var _j13 = 0; _j13 < temp.value.length; _j13++) {
- ret += '"' + temp.value[_j13] + '"';
- if (_j13 + 1 < temp.value.length) {
- ret += ", ";
- }
- }
- ret += "}";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
- ret += "<- {";
- for (var _j14 = 0; _j14 < temp.value.length; _j14++) {
- if (temp.value[_j14]) {
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
- } else {
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
- }
- if (_j14 + 1 < temp.value.length) {
- ret += ", ";
- }
- }
- ret += "}";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
- ret += "<- {";
- for (var _j15 = 0; _j15 < temp.value.length; _j15++) {
- ret += "'" + temp.value[_j15] + "'";
- if (_j15 + 1 < temp.value.length) {
- ret += ", ";
- }
- }
- ret += "}";
- break;
- }
- } else if (temp.dimensions == 2) {
- ret += "[" + temp.rows + "][" + temp.columns + "] ";
- switch (temp.type) {
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
- ret += "<- {";
- for (var _j16 = 0; _j16 < temp.rows; _j16++) {
- ret += "{";
- for (var k = 0; k < temp.columns; k++) {
- ret += temp.value[_j16][k];
- if (k + 1 < temp.columns) {
- ret += ", ";
- }
- }
- ret += "}";
- if (_j16 + 1 < temp.rows) {
- ret += ", ";
- }
- }
- ret += "}";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
- ret += "<- {";
- for (var _j17 = 0; _j17 < temp.rows; _j17++) {
- ret += "{";
- for (var _k5 = 0; _k5 < temp.columns; _k5++) {
- ret += temp.value[_j17][_k5].toFixed(2);
- if (_k5 + 1 < temp.columns) {
- ret += ", ";
- }
- }
- ret += "}";
- if (_j17 + 1 < temp.rows) {
- ret += ", ";
- }
- }
- ret += "}";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
- ret += "<- {";
- for (var _j18 = 0; _j18 < temp.rows; _j18++) {
- ret += "{";
- for (var _k6 = 0; _k6 < temp.columns; _k6++) {
- ret += '"' + temp.value[_j18][_k6] + '"';
- if (_k6 + 1 < temp.columns) {
- ret += ", ";
- }
- }
- ret += "}";
- if (_j18 + 1 < temp.rows) {
- ret += ", ";
- }
- }
- ret += "}";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
- ret += "<- {";
- for (var _j19 = 0; _j19 < temp.rows; _j19++) {
- ret += "{";
- for (var _k7 = 0; _k7 < temp.columns; _k7++) {
- if (temp.value[_j19][_k7]) {
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
- } else {
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
- }
- if (_k7 + 1 < temp.columns) {
- ret += ", ";
- }
- }
- ret += "}";
- if (_j19 + 1 < temp.rows) {
- ret += ", ";
- }
- }
- ret += "}";
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
- ret += "<- {";
- for (var _j20 = 0; _j20 < temp.rows; _j20++) {
- ret += "{";
- for (var _k8 = 0; _k8 < temp.columns; _k8++) {
- ret += "'" + temp.value[_j20][_k8] + "'";
- if (_k8 + 1 < temp.columns) {
- ret += ", ";
- }
- }
- ret += "}";
- if (_j20 + 1 < temp.rows) {
- ret += ", ";
- }
- }
- ret += "}";
- break;
- }
- } else {
- switch (temp.type) {
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER:
- ret += "<- " + temp.value;
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL:
- ret += "<- " + temp.value.toFixed(2);
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT:
- ret += '<- "' + temp.value + '"';
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN:
- ret += "<- ";
- if (temp.value) {
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_true");
- } else {
- ret += _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_false");
- }
- break;
- case _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR:
- ret += "<- '" + temp.value + "'";
- break;
- }
- }
- }
- }
- return ret;
- }
- /***/ }),
- /***/ "./js/visualUI/commands.js":
- /*!*********************************!*\
- !*** ./js/visualUI/commands.js ***!
- \*********************************/
- /*! exports provided: removeCommand, createFloatingCommand, renderCommand, genericCreateCommand */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeCommand", function() { return removeCommand; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "genericCreateCommand", function() { return genericCreateCommand; });
- /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _commands_comment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commands/comment */ "./js/visualUI/commands/comment.js");
- /* harmony import */ var _commands_reader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./commands/reader */ "./js/visualUI/commands/reader.js");
- /* harmony import */ var _commands_writer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./commands/writer */ "./js/visualUI/commands/writer.js");
- /* harmony import */ var _commands_attribution__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./commands/attribution */ "./js/visualUI/commands/attribution.js");
- /* harmony import */ var _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./commands/iftrue */ "./js/visualUI/commands/iftrue.js");
- /* harmony import */ var _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./commands/repeatNtimes */ "./js/visualUI/commands/repeatNtimes.js");
- /* harmony import */ var _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./commands/whiletrue */ "./js/visualUI/commands/whiletrue.js");
- /* harmony import */ var _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./commands/dowhiletrue */ "./js/visualUI/commands/dowhiletrue.js");
- /* harmony import */ var _commands_switch__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./commands/switch */ "./js/visualUI/commands/switch.js");
- /* harmony import */ var _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./commands/functioncall */ "./js/visualUI/commands/functioncall.js");
- /* harmony import */ var _commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./commands/variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
- /* harmony import */ var _commands_break__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./commands/break */ "./js/visualUI/commands/break.js");
- /* harmony import */ var _commands_return__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./commands/return */ "./js/visualUI/commands/return.js");
- /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
- // let has_element_created_draged = false;
- // let which_element_is_draged = null;
- function removeCommand(command, function_obj, dom_obj) {
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_COMMAND, command.type, '/', 0);
- if (function_obj.commands.indexOf(command) > -1) {
- function_obj.commands.splice(function_obj.commands.indexOf(command), 1);
- return true;
- } // Utilize dois parantNode, pois o primeiro é o div de comandos
- try {
- if (dom_obj.parent().parent().data('command').commands_block.indexOf(command) > -1) {
- dom_obj.parent().parent().data('command').commands_block.splice(dom_obj.parent().parent().data('command').commands_block.indexOf(command), 1);
- return true;
- }
- } catch (err) {}
- try {
- if (dom_obj.parent().parent().data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
- if (dom_obj.parent().parent().data('command').commands_else.indexOf(command) > -1) {
- dom_obj.parent().parent().data('command').commands_else.splice(dom_obj.parent().parent().data('command').commands_else.indexOf(command), 1);
- return true;
- }
- }
- } catch (err) {}
- if (dom_obj.parent().data('switchcase')) {
- console.log("o que encontrei: ");
- console.log(dom_obj.parent().data('switchcase'));
- dom_obj.parent().data('switchcase').commands_block.splice(dom_obj.parent().data('switchcase').commands_block.indexOf(command), 1);
- return true;
- }
- return false;
- }
- window.function_container_active = null;
- function createFloatingCommand(function_obj, function_container, command_type, mouse_event) {
- var floatingObject;
- switch (command_type) {
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
- floatingObject = _commands_break__WEBPACK_IMPORTED_MODULE_13__["createFloatingCommand"]();
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
- floatingObject = _commands_comment__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"]();
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
- floatingObject = _commands_reader__WEBPACK_IMPORTED_MODULE_3__["createFloatingCommand"]();
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
- floatingObject = _commands_writer__WEBPACK_IMPORTED_MODULE_4__["createFloatingCommand"]();
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
- floatingObject = _commands_attribution__WEBPACK_IMPORTED_MODULE_5__["createFloatingCommand"]();
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
- floatingObject = _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__["createFloatingCommand"]();
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
- floatingObject = _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__["createFloatingCommand"]();
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
- floatingObject = _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__["createFloatingCommand"]();
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
- floatingObject = _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__["createFloatingCommand"]();
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
- floatingObject = _commands_switch__WEBPACK_IMPORTED_MODULE_10__["createFloatingCommand"]();
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
- floatingObject = _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__["createFloatingCommand"]();
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
- floatingObject = _commands_return__WEBPACK_IMPORTED_MODULE_14__["createFloatingCommand"]();
- break;
- }
- floatingObject.draggable().appendTo("body");
- $('body').mouseup(function (evt) {
- manageCommand(function_obj, function_container, evt, command_type);
- $('body').off('mouseup');
- $('body').off('mouseover');
- });
- if (!function_container.hasClass('function_div') || function_container.length < 1) {
- window.mouse_event = mouse_event;
- function_container = $(mouse_event.originalEvent.srcElement.closest('.function_div'));
- }
- console.log('function_container', function_container);
- function_container_active = function_container;
- function_container.find('.commands_list_div').on('mousemove', function (evt) {
- addGhostDiv(evt);
- });
- function_container.find('.commands_list_div').find("*").on('mousemove', function (evt) {
- addGhostDiv(evt);
- });
- function_container.on('mouseout', function (event) {
- var el = $(document.elementFromPoint(event.clientX, event.clientY));
- if (el.closest('.commands_list_div').length < 1) {
- window.ghostDiv.remove();
- }
- });
- floatingObject.css("position", "absolute");
- mouse_event.type = "mousedown.draggable";
- mouse_event.target = floatingObject[0];
- floatingObject.css("left", mouse_event.pageX - window.divx);
- floatingObject.css("top", mouse_event.pageY);
- floatingObject.trigger(mouse_event);
- }
- window.divx = 100;
- window.ghostDiv = $('<div class="ghost_div">');
- window.active_container = null;
- function addGhostToEmptyBlock(element, evt) {
- $('.ghost_div').remove();
- var container = element.closest('.command_container');
- if (container.hasClass('switch')) {
- container = $(evt.target).closest('.case_div');
- }
- if (!container.hasClass('dowhiletrue') && !container.hasClass('iftrue') && !container.hasClass('repeatNtimes') && !container.hasClass('case_div') && !container.hasClass('whiletrue')) {
- addGhostToNotEmptyBlock(element, evt);
- return;
- }
- if (window.active_container != null) {
- if (window.active_container.is(container)) {
- console.log('é o mesmo, não mudou!');
- } else {
- if (container.length < 1) {
- container = element.closest('.commands_list_div');
- if (window.active_container.is(container)) {
- console.log('é o mesmo command list');
- } else {
- console.log('mudou para um command list');
- window.active_container = container;
- }
- } else {
- console.log('mudou para um outro container?');
- }
- }
- }
- window.active_container = container;
- if (container.hasClass('iftrue')) {
- var containerIf = container.find('.commands_if').get(0);
- var containerElse = container.find('.commands_else').get(0);
- var topIfDistance = Math.abs(evt.clientY - containerIf.getBoundingClientRect().top);
- var bottomIfDistance = Math.abs(containerIf.getBoundingClientRect().top + containerIf.getBoundingClientRect().height - evt.clientY);
- var topElseDistance = Math.abs(evt.clientY - containerElse.getBoundingClientRect().top);
- var bottomElseDistance = Math.abs(containerElse.getBoundingClientRect().top + containerElse.getBoundingClientRect().height - evt.clientY);
- if (topIfDistance < topElseDistance && topIfDistance < bottomElseDistance) {
- $(containerIf).append(window.ghostDiv);
- } else {
- $(containerElse).append(window.ghostDiv);
- }
- } else if (container.hasClass('case_div')) {
- container.find('.case_commands_block').append(window.ghostDiv);
- } else {
- container.find('.block_commands').append(window.ghostDiv);
- }
- }
- function addGhostToNotEmptyBlock(element, evt) {
- $('.ghost_div').remove();
- var container = element.closest('.dowhiletrue, .iftrue, .repeatNtimes, .case_div, .whiletrue'); //console.log("\n\nNOT EMPTY: ", container);
- //if (window.active_container != null) {
- //}
- if (container.length < 1) {
- container = element.closest('.commands_list_div');
- window.active_container = container;
- addGhostToFunctionArea(element, evt);
- } else {//console.log('mudou para um outro container?');
- }
- window.active_container = container; // quem está mais próximo? // Essa regra se aplica somente quando o over está sobre um comando
- var allfilhos;
- console.log('olha o container: ', container);
- if (container.hasClass('iftrue')) {
- if ($(evt.target).closest('.data_block_if').length > 0) {
- allfilhos = container.find('.commands_if').children('.command_container');
- } else if ($(evt.target).closest('.data_block_else').length > 0) {
- allfilhos = container.find('.commands_else').children('.command_container');
- } else {
- var containerIf = container.find('.commands_if').get(0);
- var containerElse = container.find('.commands_else').get(0);
- var topIfDistance = Math.abs(evt.clientY - containerIf.getBoundingClientRect().top);
- var bottomIfDistance = Math.abs(containerIf.getBoundingClientRect().top + containerIf.getBoundingClientRect().height - evt.clientY);
- var topElseDistance = Math.abs(evt.clientY - containerElse.getBoundingClientRect().top);
- var bottomElseDistance = Math.abs(containerElse.getBoundingClientRect().top + containerElse.getBoundingClientRect().height - evt.clientY);
- if (topIfDistance < topElseDistance && topIfDistance < bottomElseDistance) {
- allfilhos = $(containerIf).children('.command_container');
- } else {
- allfilhos = $(containerElse).children('.command_container');
- }
- }
- } else if (container.hasClass('case_div')) {
- allfilhos = container.children('.case_commands_block').children('.command_container');
- } else if (container.hasClass('commands_list_div')) {
- allfilhos = container.children('.command_container');
- } else {
- allfilhos = container.children('.block_commands').children('.command_container');
- }
- var topDistances = [];
- var bottomDistances = [];
- for (var i = 0; i < allfilhos.length; i++) {
- var topD = Math.abs(evt.clientY - allfilhos.get(i).getBoundingClientRect().top);
- topDistances.push(topD);
- var botD = Math.abs(allfilhos.get(i).getBoundingClientRect().top + allfilhos.get(i).getBoundingClientRect().height - evt.clientY);
- bottomDistances.push(botD);
- }
- console.log('topDistances\n', topDistances, '\nbottomDistances\n', bottomDistances);
- var menorTop = Math.min.apply(null, topDistances);
- var indiceTop = topDistances.indexOf(menorTop);
- var menorBot = Math.min.apply(null, bottomDistances);
- var indiceBot = bottomDistances.indexOf(menorBot);
- if (menorTop < menorBot) {
- window.ghostDiv.insertBefore($(allfilhos.get(indiceTop)));
- } else {
- window.ghostDiv.insertAfter($(allfilhos.get(indiceBot)));
- }
- console.log('distancias: menorTop ', menorTop, ' menorBot ', menorBot);
- }
- function addGhostToFunctionArea(undermouse, evt) {
- $('.ghost_div').remove();
- var allfilhos = undermouse.closest('.commands_list_div').children('.command_container');
- var topDistances = [];
- var bottomDistances = [];
- for (var i = 0; i < allfilhos.length; i++) {
- var topD = Math.abs(evt.clientY - allfilhos.get(i).getBoundingClientRect().top);
- topDistances.push(topD);
- var botD = Math.abs(allfilhos.get(i).getBoundingClientRect().top + allfilhos.get(i).getBoundingClientRect().height - evt.clientY);
- bottomDistances.push(botD);
- }
- var menorTop = Math.min.apply(null, topDistances);
- var indiceTop = topDistances.indexOf(menorTop);
- var menorBot = Math.min.apply(null, bottomDistances);
- var indiceBot = bottomDistances.indexOf(menorBot);
- if (menorTop < menorBot) {
- window.ghostDiv.insertBefore($(allfilhos.get(indiceTop)));
- } else {
- window.ghostDiv.insertAfter($(allfilhos.get(indiceBot)));
- }
- }
- function addGhostDiv(evt) {
- var undermouse = $(evt.target);
- if (undermouse.hasClass('ghost_div')) {
- return;
- } else if (undermouse.hasClass('commands_list_div')) {
- addGhostToFunctionArea(undermouse, evt);
- return;
- } else if (undermouse.hasClass('block_commands')) {
- if (undermouse.find('.command_container').length > 0) {
- addGhostToNotEmptyBlock(undermouse, evt);
- } else {
- addGhostToEmptyBlock(undermouse, evt);
- }
- } else if (undermouse.hasClass('case_div')) {
- if (undermouse.find('.case_commands_block').find('.command_container').length > 0) {
- addGhostToNotEmptyBlock(undermouse, evt);
- } else {
- addGhostToEmptyBlock(undermouse, evt);
- }
- } else {
- addGhostToNotEmptyBlock(undermouse, evt);
- }
- }
- function borderMouseDragCommand(function_obj, function_container, evt) {
- function_container.find('.over_command_drag').each(function (index) {
- $(this).removeClass('over_command_drag');
- });
- var prev = null;
- function_container.find('.commands_list_div').each(function (index) {
- prev = $(this);
- if (prev) {
- var objLeft = prev.offset().left;
- var objTop = prev.offset().top;
- var objRight = objLeft + prev.width();
- var objBottom = objTop + prev.height();
- if (evt.pageX > objLeft && evt.pageX < objRight && evt.pageY > objTop && evt.pageY < objBottom) {
- prev.addClass("over_command_drag");
- }
- }
- });
- function_container.find('.command_container').each(function (index) {
- var obj = $(this);
- var objLeft = obj.offset().left;
- var objTop = obj.offset().top;
- var objRight = objLeft + obj.width();
- var objBottom = objTop + obj.height();
- if (evt.pageX > objLeft && evt.pageX < objRight && evt.pageY > objTop && evt.pageY < objBottom) {
- if (prev) {
- prev.removeClass('over_command_drag');
- }
- obj.addClass("over_command_drag");
- return;
- }
- });
- } // before_after_inside: 1 -> before, 2 -> after, 3 -> inside
- function renderCommand(command, element_reference, before_after_inside, function_obj) {
- var createdElement;
- switch (command.type) {
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
- createdElement = _commands_comment__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](command, function_obj);
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
- createdElement = _commands_break__WEBPACK_IMPORTED_MODULE_13__["renderCommand"](command, function_obj);
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
- createdElement = _commands_reader__WEBPACK_IMPORTED_MODULE_3__["renderCommand"](command, function_obj);
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
- createdElement = _commands_writer__WEBPACK_IMPORTED_MODULE_4__["renderCommand"](command, function_obj);
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
- createdElement = _commands_attribution__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](command, function_obj);
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
- createdElement = _commands_functioncall__WEBPACK_IMPORTED_MODULE_11__["renderCommand"](command, function_obj);
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
- createdElement = _commands_iftrue__WEBPACK_IMPORTED_MODULE_6__["renderCommand"](command, function_obj);
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
- createdElement = _commands_repeatNtimes__WEBPACK_IMPORTED_MODULE_7__["renderCommand"](command, function_obj);
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
- createdElement = _commands_whiletrue__WEBPACK_IMPORTED_MODULE_8__["renderCommand"](command, function_obj);
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
- createdElement = _commands_dowhiletrue__WEBPACK_IMPORTED_MODULE_9__["renderCommand"](command, function_obj);
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
- createdElement = _commands_switch__WEBPACK_IMPORTED_MODULE_10__["renderCommand"](command, function_obj);
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
- createdElement = _commands_return__WEBPACK_IMPORTED_MODULE_14__["renderCommand"](command, function_obj);
- break;
- }
- switch (before_after_inside) {
- case 1:
- createdElement.insertBefore(element_reference);
- break;
- case 2:
- createdElement.insertAfter(element_reference);
- break;
- case 3:
- element_reference.append(createdElement);
- break;
- }
- }
- function genericCreateCommand(command_type) {
- switch (command_type) {
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
- return new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["Break"]();
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment:
- 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));
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].reader:
- 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));
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].writer:
- 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)]);
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].attribution:
- 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), []);
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].functioncall:
- 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);
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
- 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)]);
- //(var_attribution, var_incrementation, expression1, expression2, expression3, commands_block)
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
- 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);
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
- 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);
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
- 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);
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
- 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))];
- 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);
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["return"]:
- 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)]);
- }
- }
- function dragTrash(event) {
- $('.ghost_div').remove();
- var trash = $('<i class="ui icon trash alternate outline"></i>');
- $('body').append(trash);
- trash.css('position', 'absolute');
- trash.css('top', event.clientY);
- trash.css('left', event.clientX - 20);
- trash.css('font-size', '3em');
- trash.css('display', 'none');
- function_container_active.find('.commands_list_div').off('mousemove');
- function_container_active.find('.commands_list_div').find("*").off('mousemove');
- trash.fadeIn(200, function () {
- trash.fadeOut(200, function () {
- trash.remove();
- });
- });
- }
- function findSingleElement(searching, query) {
- if (!searching || !query) {
- return '';
- }
- 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) {
- if (searching.commands_block) {
- return '' + searching.commands_block.indexOf(query);
- } else {
- return '0';
- }
- } else if (searching.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
- if (searching.commands_block == null) {
- searching.commands_block = [];
- }
- if (searching.commands_else == null) {
- searching.commands_else = [];
- }
- console.log('\n\nveja onde: ', searching.commands_block, ' \n\nquery: ', query);
- if (searching.commands_block.indexOf(query) >= 0) {
- return 'if[' + searching.commands_block.indexOf(query) + ']';
- } else {
- return 'else[' + searching.commands_else.indexOf(query) + ']';
- }
- } else if (searching.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]) {
- for (var i = 0; i < searching.cases.length; i++) {
- if (searching.cases[i].commands_block.indexOf(query) >= 0) {
- return 'case[' + searching.cases[i].commands_block.indexOf(query) + ']';
- }
- }
- }
- }
- function findPathRecursive(starter_index, hierarquia_bottom_up, function_obj) {
- var index_command = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1;
- var actual = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
- var full_path = '';
- for (var i = 0; i <= hierarquia_bottom_up.length; i++) {
- console.log('\n\n:: ', i, ':\n', hierarquia_bottom_up[i]);
- full_path += findSingleElement(hierarquia_bottom_up[i], hierarquia_bottom_up[i + 1]) + '-';
- }
- return full_path;
- }
- function manageCommand(function_obj, function_container, event, command_type) {
- $(".created_element").each(function (index) {
- $(this).remove();
- });
- var el = $(document.elementFromPoint(event.clientX, event.clientY));
- if (el.hasClass('ghost_div')) {
- if (el.closest('.command_container').length < 1) {
- console.log('\n\nvou tentar!!!!');
- console.log(el.closest('.commands_list_div'), '\n\n');
- el.closest('.commands_list_div').css('height', el.closest('.commands_list_div').css('height') + 30); //$('.ghost_div').remove();
- el = el.closest('.commands_list_div');
- }
- }
- console.log('soltou no: ');
- console.log(el);
- console.log(el.data('fun')); // Primeiro verificar se ele soltou no espaço da função correta:
- var hier = el.parentsUntil(".all_functions");
- var esta_correto = false;
- var esta_na_div_correta = false;
- if (el.hasClass("commands_list_div")) {
- esta_na_div_correta = true;
- }
- for (var i = 0; i < hier.length; i++) {
- var temp = $(hier[i]);
- if (temp.hasClass("commands_list_div")) {
- esta_na_div_correta = true;
- }
- if (temp.data('fun') == function_obj) {
- esta_correto = true;
- break;
- }
- }
- if (!esta_correto) {
- // has_element_created_draged = false;
- // which_element_is_draged = null;
- dragTrash(event);
- return;
- } else {
- if (!esta_na_div_correta) {
- // has_element_created_draged = false;
- // which_element_is_draged = null;
- dragTrash(event);
- return;
- }
- }
- var hierarquia_bottom_up = null; // Agora é descobrir qual o escopo para adicionar o comando:
- console.log('ev0'); // Se o elemento clicado possuir o atributo "fun", então, é direto na div dos comandos:
- if (typeof el.data('fun') !== 'undefined') {
- // Se a lista de comandos estiver vazia, então é o primeiro.
- // Portanto, ele deve soltar o elemento obrigatoriamente no objeto vazio
- if (el.data('fun').commands == null || el.data('fun').commands.length == 0) {
- // pode adicionar
- el.data('fun').commands = [];
- var new_cmd = genericCreateCommand(command_type);
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', 0);
- el.data('fun').commands.push(new_cmd);
- renderCommand(new_cmd, $(function_container).find('.commands_list_div'), 3, function_obj);
- } else {
- // Entra nesse else, caso já existam outros comandos no bloco:
- findNearbyCommandToAddInFunctionScope(el, event, $(function_container).find('.commands_list_div'), function_obj, command_type);
- }
- } else {
- console.log("soltou em um comando"); // descobrir em qual comando ele soltou:
- var hier_find = el.parentsUntil(".commands_list_div");
- hierarquia_bottom_up = [];
- if (typeof el.data('command') !== 'undefined') {
- hierarquia_bottom_up.push(el.data('command'));
- }
- for (var i = 0; i < hier_find.length; i++) {
- if (typeof $(hier_find[i]).data('command') !== 'undefined') {
- hierarquia_bottom_up.push($(hier_find[i]).data('command'));
- }
- }
- console.log("comando em que soltou: ");
- console.log(hierarquia_bottom_up[0]);
- console.log("hierarquia de baixo para cima na árvore, de onde ele soltou: ");
- for (var i = 0; i < hierarquia_bottom_up.length; i++) {
- console.log(hierarquia_bottom_up[i]);
- } // Se for do tipo break, verificar se está no contexto correto:
- // Caso não esteja no contexto, apenas retorna sem dar continuidade:
- var is_correct_context = false;
- if (command_type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]) {
- for (var i = 0; i < hierarquia_bottom_up.length; i++) {
- 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"]) {
- is_correct_context = true;
- break;
- }
- }
- if (!is_correct_context) {
- console.error("Context not allowed to insert BREAK COMMAND!");
- return;
- }
- } // se a hierarquia possuir apenas um elemento, então está na raiz dos comandos:
- if (hierarquia_bottom_up.length == 1) {
- console.log('QQ1');
- var sub_elemento = false;
- for (var i = 0; i < hier_find.length; i++) {
- if (typeof $(hier_find[i]).data('command') !== 'undefined') {
- console.log('QQ2');
- findBeforeOrAfterCommandToAdd(hier_find[i], event, function_obj, command_type);
- sub_elemento = true;
- break;
- }
- }
- if (!sub_elemento) {
- console.log('QQ3');
- findBeforeOrAfterCommandToAdd(el[0], event, function_obj, command_type);
- }
- } else {
- console.log('QQ4'); // caso exista mais de um elemento na hierarquia:
- if (typeof $(el).data('command') !== 'undefined') {
- console.log('QQ5');
- console.log("PPP1");
- insertCommandInBlockHierar(el[0], event, function_obj, command_type, hier_find, hierarquia_bottom_up);
- } else {
- console.log('QQ6');
- var sub_elemento = false;
- for (var i = 0; i < hier_find.length; i++) {
- if (typeof $(hier_find[i]).data('command') !== 'undefined') {
- console.log('QQ7');
- insertCommandInBlockHierar(hier_find[i], event, function_obj, command_type, hier_find, hierarquia_bottom_up);
- sub_elemento = true;
- break;
- }
- }
- }
- }
- } // has_element_created_draged = false;
- // which_element_is_draged = null;
- if (hierarquia_bottom_up) {
- console.log('\n\n:::índices::\n\n');
- var i = hierarquia_bottom_up.length - 1;
- var starter_index = window.program_obj.functions[window.program_obj.functions.indexOf(function_obj)].commands.indexOf(hierarquia_bottom_up[i]);
- var all_str_path = starter_index + '-' + findPathRecursive(starter_index, hierarquia_bottom_up, function_obj);
- 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);
- console.log('\n\nfull path: \n\n', all_str_path);
- console.log('fim dos índices');
- }
- renderAlgorithm();
- }
- function insertCommandInBlockHierar(el, event, function_obj, command_type, hier_dom, hier_obj) {
- var el_jq = $(el);
- var command_parent = el_jq.data('command');
- 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"]) {
- console.log('QQ17');
- 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) {
- console.log('QQ18'); // Se não tiver outro comando ainda no bloco, só adiciona:
- if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
- command_parent.commands_block = [];
- var recentComand = genericCreateCommand(command_type);
- command_parent.commands_block.push(recentComand);
- 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);
- renderCommand(recentComand, el_jq.find('.block_commands'), 3, function_obj);
- } else {
- // Se já tem algum comando no bloco:
- findNearbyCommandToAddInBlockScope(el, event, el, function_obj, command_type, command_parent);
- }
- } else {
- // QUANDO FOR BLOCO DO TIPO IF OU SWITCH/CASE:
- addCommandToSwitchCase(event, function_obj, command_type);
- }
- } else {
- console.log('QQ19'); // entra neste bloco, se soltou o comando sobre outro comando dentro de um subbloco:
- findBeforeOrAfterCommandToAddInsertBlock(el, event, function_obj, command_type);
- }
- }
- function findNearbyCommandToAddInBlockScope(el, event, node_list_commands, function_obj, command_type, command_parent) {
- console.log("\n\n\n::COMANDOS:\n\n", el, event, node_list_commands, function_obj, command_type, command_parent);
- var all_sub = $(node_list_commands).find('div.command_container');
- var menor_distancia = 999999999;
- var elemento_menor_distancia = null;
- var antes = true;
- var t_bot;
- var t_top; // Descobrindo o elemento mais próximo:
- for (var i = 0; i < all_sub.length; i++) {
- t_top = all_sub[i].getBoundingClientRect().top;
- t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
- if (t_top - event.clientY < menor_distancia) {
- menor_distancia = event.clientY - t_top;
- elemento_menor_distancia = all_sub[i];
- }
- }
- 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:
- if (borda_inferior - event.clientY < menor_distancia) {
- var recentComand = genericCreateCommand(command_type);
- command_parent.commands_block.push(recentComand); //
- renderCommand(recentComand, node_list_commands, 3, function_obj);
- } else {
- var recentComand = genericCreateCommand(command_type);
- var index = command_parent.commands_block.indexOf($(elemento_menor_distancia).data('command'));
- if (index > -1) {
- command_parent.commands_block.splice(index, 0, recentComand);
- }
- renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
- }
- }
- function findBeforeOrAfterCommandToAddInsertBlock(el, event, function_obj, command_type) {
- var el_jq = $(el);
- var command_parent = $(el.parentNode.parentNode).data('command');
- var command_target = el_jq.data('command');
- var temp_parent = $(el.parentNode.parentNode);
- var is_in_else = false;
- if (!command_parent) {
- command_parent = el_jq.data('command');
- temp_parent = el_jq;
- var hier = el_jq.parentsUntil(".command_container");
- for (var i = 0; i < hier.length; i++) {
- var temp = $(hier[i]);
- if (typeof temp.data('else') != 'undefined') {
- is_in_else = true;
- }
- if (typeof temp.data('command') != 'undefined') {
- command_parent = temp.data('command');
- temp_parent = temp;
- }
- }
- }
- var hier = el_jq.parentsUntil(".command_container");
- for (var i = 0; i < hier.length; i++) {
- var temp = $(hier[i]);
- if (typeof temp.data('else') != 'undefined') {
- is_in_else = true;
- }
- }
- if (command_parent == command_target) {
- var hier = el_jq.parentsUntil(".command_container");
- for (var i = 0; i < hier.length; i++) {
- var temp = $(hier[i]);
- if (typeof temp.data('else') !== 'undefined') {
- is_in_else = true;
- break;
- }
- }
- }
- 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"]) {
- var hier = temp_parent.parentsUntil(".all_cases_div");
- console.log("vou procurar!!");
- for (var i = 0; i < hier.length; i++) {
- console.log("estou vasculhando...");
- var temp = $(hier[i]);
- if (typeof temp.data('switchcase') !== 'undefined') {
- console.log("encontrei");
- command_parent = temp.data('switchcase');
- is_in_else = false;
- break;
- }
- }
- }
- console.log('debugging:');
- console.log('el_jq');
- console.log(el_jq);
- console.log('command_parent');
- console.log(command_parent);
- console.log('command_target');
- console.log(command_target);
- var menor_distancia = 999999999;
- var antes = true;
- var t_bot;
- var t_top;
- t_top = el.getBoundingClientRect().top;
- t_bot = el.getBoundingClientRect().top + el.getBoundingClientRect().height;
- var d_top = event.clientY - t_top; // distancia topo
- var d_bot = t_bot - event.clientY; // distancia baixo
- // Está mais próximo da borda de baixo, ou seja.. inserir por último:
- if (d_top < d_bot) {
- var recentComand = genericCreateCommand(command_type);
- console.log('MMM1');
- if (is_in_else) {
- console.log('MMM2');
- if (command_parent == command_target) {
- console.log('MMM3');
- if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
- command_parent.commands_else = [];
- var recentComand = genericCreateCommand(command_type);
- command_parent.commands_else.push(recentComand);
- renderCommand(recentComand, el_jq, 3, function_obj);
- } else {
- // Se já tem algum comando no bloco:
- findInBlockCorrectPlace(el_jq, event, function_obj, command_type, true);
- }
- return;
- }
- console.log('MMM7');
- var index = command_parent.commands_else.indexOf(command_target);
- if (index > -1) {
- command_parent.commands_else.splice(index, 0, recentComand);
- }
- renderCommand(recentComand, el, 1, function_obj);
- } else {
- console.log('MMM4');
- if (command_parent == command_target) {
- console.log('Nxxxx5');
- if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
- command_parent.commands_block = [];
- console.log('SSS4');
- var recentComand = genericCreateCommand(command_type);
- command_parent.commands_block.push(recentComand);
- renderCommand(recentComand, el_jq, 3, function_obj);
- } else {
- console.log('SSS5');
- findInBlockCorrectPlace(el_jq, event, function_obj, command_type);
- }
- return;
- }
- console.log('MMM6');
- var index = command_parent.commands_block.indexOf(command_target);
- if (index > -1) {
- command_parent.commands_block.splice(index, 0, recentComand);
- }
- renderCommand(recentComand, el, 1, function_obj);
- }
- } else {
- console.log('XXX1');
- var recentComand = genericCreateCommand(command_type);
- if (is_in_else) {
- if (command_parent == command_target) {
- console.log('MMM3');
- if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
- command_parent.commands_else = [];
- console.log('SSS1');
- var recentComand = genericCreateCommand(command_type);
- command_parent.commands_else.push(recentComand);
- renderCommand(recentComand, el_jq, 3, function_obj);
- } else {
- // Se já tem algum comando no bloco:
- console.log('SSS2');
- findInBlockCorrectPlace(el_jq, event, function_obj, command_type, true);
- }
- return;
- }
- console.log('XXX2');
- var index = command_parent.commands_else.indexOf(command_target);
- if (index > -1) {
- command_parent.commands_else.splice(index + 1, 0, recentComand);
- }
- renderCommand(recentComand, el, 2, function_obj);
- } else {
- if (command_parent == command_target) {
- console.log('Nxxxx78');
- if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
- command_parent.commands_block = [];
- var recentComand = genericCreateCommand(command_type);
- command_parent.commands_block.push(recentComand);
- console.log('SSS6');
- renderCommand(recentComand, el_jq, 3, function_obj);
- } else {
- console.log('SSS7');
- findInBlockCorrectPlace(el_jq, event, function_obj, command_type);
- }
- return;
- }
- console.log('XXX3');
- var index = command_parent.commands_block.indexOf(command_target);
- if (index > -1) {
- command_parent.commands_block.splice(index + 1, 0, recentComand);
- }
- renderCommand(recentComand, el, 2, function_obj);
- }
- }
- }
- function insertCommandInBlock(el, event, function_obj, command_type) {
- var el_jq = $(el);
- var command_parent = el_jq.data('command');
- 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) {
- // Se não tiver outro comando ainda no bloco, só adiciona:
- if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
- command_parent.commands_block = [];
- var recentComand = genericCreateCommand(command_type);
- command_parent.commands_block.push(recentComand);
- renderCommand(recentComand, el_jq.find('.block_commands'), 3, function_obj);
- } else {
- // Se já tem algum comando no bloco:
- findInBlockCorrectPlace(el, event, function_obj, command_type);
- }
- } else if (el_jq.data('command').type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue) {
- console.log('QQ9'); // no if ou no else?
- var correct_div = $(document.elementFromPoint(event.pageX, event.pageY));
- var is_in_if = true;
- if (correct_div.data('if')) {
- is_in_if = true;
- } else if (correct_div.data('else')) {
- is_in_if = false;
- } else {
- var hier = correct_div.parentsUntil(".command_container");
- for (var i = 0; i < hier.length; i++) {
- var temp = $(hier[i]);
- if (typeof temp.data('if') !== 'undefined') {
- is_in_if = true;
- break;
- }
- if (typeof temp.data('else') !== 'undefined') {
- is_in_if = false;
- break;
- }
- }
- }
- if (is_in_if) {
- if (command_parent.commands_block == null || command_parent.commands_block.length == 0) {
- command_parent.commands_block = [];
- var recentComand = genericCreateCommand(command_type);
- command_parent.commands_block.push(recentComand);
- renderCommand(recentComand, el_jq.find('.commands_if'), 3, function_obj);
- } else {
- // Se já tem algum comando no bloco:
- findInBlockCorrectPlace(el_jq.find('.commands_if'), event, function_obj, command_type);
- }
- } else {
- if (command_parent.commands_else == null || command_parent.commands_else.length == 0) {
- command_parent.commands_else = [];
- var recentComand = genericCreateCommand(command_type);
- command_parent.commands_else.push(recentComand);
- renderCommand(recentComand, el_jq.find('.commands_else'), 3, function_obj);
- } else {
- // Se já tem algum comando no bloco:
- findInBlockCorrectPlace(el_jq.find('.commands_else'), event, function_obj, command_type, true);
- }
- }
- } else {
- // é do tipo switch
- console.log("está tentando inserir em um switch que está na raiz!");
- addCommandToSwitchCase(event, function_obj, command_type);
- }
- }
- function addCommandToSwitchCase(event, function_obj, command_type) {
- var el = $(document.elementFromPoint(event.clientX, event.clientY));
- var which_case = el.data('switchcase');
- var case_div = el;
- if (!which_case) {
- var hier_find = el.parentsUntil(".all_cases_div");
- for (var i = 0; i < hier_find.length; i++) {
- if (typeof $(hier_find[i]).data('switchcase') !== 'undefined') {
- which_case = $(hier_find[i]).data('switchcase');
- case_div = $(hier_find[i]);
- break;
- }
- }
- }
- if (which_case.commands_block == null || which_case.commands_block.length < 1) {
- which_case.commands_block = [];
- var recentComand = genericCreateCommand(command_type);
- which_case.commands_block.push(recentComand);
- renderCommand(recentComand, case_div.find('.case_commands_block'), 3, function_obj);
- } else {
- findInBlockCorrectPlaceInSwitchCase(which_case, case_div, event, function_obj, command_type);
- }
- }
- function findInBlockCorrectPlaceInSwitchCase(which_case, case_div, event, function_obj, command_type) {
- var all_sub = case_div.find('div.command_container');
- var menor_distancia = 999999999;
- var elemento_menor_distancia = null;
- var antes = true;
- var t_bot;
- var t_top; // Descobrindo o elemento mais próximo:
- for (var i = 0; i < all_sub.length; i++) {
- t_top = all_sub[i].getBoundingClientRect().top;
- t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
- if (t_top - event.clientY < menor_distancia) {
- menor_distancia = event.clientY - t_top;
- elemento_menor_distancia = all_sub[i];
- }
- }
- 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:
- if (borda_inferior - event.clientY < menor_distancia) {
- var recentComand = genericCreateCommand(command_type);
- which_case.commands_block.push(recentComand);
- renderCommand(recentComand, $(case_div.find('.case_commands_block')[0]), 3, function_obj);
- } else {
- var recentComand = genericCreateCommand(command_type);
- var index = which_case.commands_block.indexOf($(elemento_menor_distancia).data('command'));
- if (index > -1) {
- which_case.commands_block.splice(index, 0, recentComand);
- renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
- }
- }
- }
- function findInBlockCorrectPlace(el, event, function_obj, command_type) {
- var is_in_else = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
- var el_jq = $(el);
- var all_sub = el_jq.find('div.command_container');
- var menor_distancia = 999999999;
- var elemento_menor_distancia = null;
- var antes = true;
- var t_bot;
- var t_top; // Descobrindo o elemento mais próximo:
- for (var i = 0; i < all_sub.length; i++) {
- t_top = all_sub[i].getBoundingClientRect().top;
- t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
- if (t_top - event.clientY < menor_distancia) {
- menor_distancia = event.clientY - t_top;
- elemento_menor_distancia = all_sub[i];
- }
- }
- var borda_inferior = elemento_menor_distancia.parentNode.getBoundingClientRect().top + elemento_menor_distancia.parentNode.getBoundingClientRect().height;
- console.log("menor_distancia: ");
- console.log(elemento_menor_distancia); // Está mais próximo da borda de baixo, ou seja.. inserir por último:
- if (borda_inferior - event.clientY < menor_distancia) {
- console.log('QQ11');
- var recentComand = genericCreateCommand(command_type);
- var command_parent = el_jq.data('command');
- if (is_in_else) {
- console.log('QQ15');
- command_parent.commands_else.push(recentComand);
- console.log('el_jq');
- console.log(el_jq);
- console.log("$(el_jq.find('.commands_else')[0]):: ");
- console.log($(el_jq.find('.commands_else')[0]));
- renderCommand(recentComand, el_jq, 3, function_obj);
- } else {
- console.log('QQ16');
- command_parent.commands_block.push(recentComand);
- renderCommand(recentComand, $(el_jq.find('.block_commands')[0]), 3, function_obj);
- }
- } else {
- console.log('QQ12');
- var recentComand = genericCreateCommand(command_type);
- var command_parent = el_jq.data('command');
- if (is_in_else) {
- var index = command_parent.commands_else.indexOf($(elemento_menor_distancia).data('command'));
- if (index > -1) {
- command_parent.commands_else.splice(index, 0, recentComand);
- renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
- }
- } else {
- var index = command_parent.commands_block.indexOf($(elemento_menor_distancia).data('command'));
- if (index > -1) {
- command_parent.commands_block.splice(index, 0, recentComand);
- renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
- }
- }
- }
- }
- function findBeforeOrAfterCommandToAdd(el, event, function_obj, command_type) {
- switch ($(el).data('command').type) {
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].iftrue:
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["switch"]:
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes:
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].whiletrue:
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].dowhiletrue:
- insertCommandInBlock(el, event, function_obj, command_type);
- return;
- }
- var menor_distancia = 999999999;
- var antes = true;
- var t_bot;
- var t_top;
- t_top = el.getBoundingClientRect().top;
- t_bot = el.getBoundingClientRect().top + el.getBoundingClientRect().height;
- var d_top = event.clientY - t_top; // distancia topo
- var d_bot = t_bot - event.clientY; // distancia baixo
- // Está mais próximo da borda de baixo, ou seja.. inserir por último:
- if (d_top < d_bot) {
- var recentComand = genericCreateCommand(command_type);
- var index = function_obj.commands.indexOf($(el).data('command'));
- if (index > -1) {
- function_obj.commands.splice(index, 0, recentComand);
- }
- renderCommand(recentComand, el, 1, function_obj);
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
- } else {
- var recentComand = genericCreateCommand(command_type);
- var index = function_obj.commands.indexOf($(el).data('command'));
- if (index > -1) {
- function_obj.commands.splice(index + 1, 0, recentComand);
- }
- renderCommand(recentComand, el, 2, function_obj);
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
- }
- }
- function findNearbyCommandToAddInFunctionScope(el, event, node_list_commands, function_obj, command_type) {
- var all_sub = $(node_list_commands).find('div.command_container');
- var menor_distancia = 999999999;
- var elemento_menor_distancia = null;
- var antes = true;
- var t_bot;
- var t_top; // Descobrindo o elemento mais próximo:
- for (var i = 0; i < all_sub.length; i++) {
- t_top = all_sub[i].getBoundingClientRect().top;
- t_bot = all_sub[i].getBoundingClientRect().top + all_sub[i].getBoundingClientRect().height;
- if (t_top - event.clientY < menor_distancia) {
- menor_distancia = event.clientY - t_top;
- elemento_menor_distancia = all_sub[i];
- }
- }
- 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:
- if (borda_inferior - event.clientY < menor_distancia) {
- var recentComand = genericCreateCommand(command_type);
- function_obj.commands.push(recentComand); //
- renderCommand(recentComand, node_list_commands, 3, function_obj);
- 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);
- } else {
- var recentComand = genericCreateCommand(command_type);
- var index = function_obj.commands.indexOf($(elemento_menor_distancia).data('command'));
- if (index > -1) {
- function_obj.commands.splice(index, 0, recentComand);
- }
- renderCommand(recentComand, elemento_menor_distancia, 1, function_obj);
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, command_type, '/', index);
- }
- }
- /***/ }),
- /***/ "./js/visualUI/commands/attribution.js":
- /*!*********************************************!*\
- !*** ./js/visualUI/commands/attribution.js ***!
- \*********************************************/
- /*! exports provided: createFloatingCommand, renderCommand, manageExpressionElements, renderMenuOperations */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageExpressionElements", function() { return manageExpressionElements; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenuOperations", function() { return renderMenuOperations; });
- /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
- /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
- /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
- function createFloatingCommand() {
- return $('<div class="ui attribution created_element"> <i class="ui icon small arrow left"></i> <span> x <— 1 + 1 </span></div>');
- }
- function renderCommand(command, function_obj) {
- 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>');
- el.data('command', command);
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.variable, el.find('.var_attributed'), function_obj);
- if (!command.expression || command.expression.length < 1) {
- 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);
- command.expression.push(exp);
- }
- addHandlers(command, function_obj, el);
- _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.expression_elements'), command.expression); //renderExpressionElements(command, function_obj, el);
- return el;
- }
- function manageExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, selectedItem, expression_element) {
- var index_to_move = expression_element.itens.indexOf(ref_object);
- switch (selectedItem.data('exp')) {
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
- 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)]);
- expression_element.itens[index_to_move] = exp;
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
- 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]]);
- expression_element.itens[index_to_move] = exp;
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
- 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]]);
- expression_element.itens[index_to_move] = exp;
- break;
- }
- renderExpressionElements(command, function_obj, dom_object);
- }
- function renderExpressionElements(command, function_obj, el) {
- var expression_div = el.find('.expression_elements');
- var command_container;
- if (el.hasClass("command_container") == false) {
- var hier = el.parentsUntil(".command_container");
- for (var i = 0; i < hier.length; i++) {
- if ($(hier[i]).hasClass("command_container")) {
- command_container = $(hier[i]);
- break;
- }
- if ($(hier[i]).hasClass("expression_elements")) {
- expression_div = $(hier[i]);
- break;
- }
- }
- }
- if (command_container) {
- expression_div = command_container.find('.expression_elements');
- }
- expression_div.text('');
- for (var i = 0; i < command.expression.length; i++) {
- var temp = $('<div class="expression_element"></div>');
- temp.data('ref_element', command.expression[i]);
- temp.data('ref_index', i);
- expression_div.append(temp);
- renderElement(command, function_obj, temp, command.expression[i]);
- }
- }
- function renderOperator(command, function_obj, temp_op, expression_element, index_op) {
- var context_menu = '<div class="ui dropdown"><div class="text">';
- switch (expression_element.itens[index_op]) {
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus:
- context_menu += '+';
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus:
- context_menu += '-';
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication:
- context_menu += '*';
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division:
- context_menu += '/';
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module:
- context_menu += '%';
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].none:
- context_menu += '...';
- break;
- }
- context_menu += '</div><div class="menu">';
- context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus + '">+</div>';
- context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus + '">-</div>';
- context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication + '">*</div>';
- context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division + '">/</div>';
- context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module + '">%</div>';
- context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].none + '" data-text="...">Nenhum</div>';
- context_menu += '</div></div>';
- context_menu = $(context_menu);
- temp_op.append(context_menu);
- context_menu.dropdown({
- onChange: function onChange(value, text, $selectedItem) {
- expression_element.itens[index_op] = value;
- }
- });
- }
- function renderMenuAddExpression(command, function_obj, el, dom_append_menu, expression_append_new_expression) {
- if (el.hasClass("command_container") == false) {
- var hier = el.parentsUntil(".commands_list_div");
- for (var i = 0; i < hier.length; i++) {
- if ($(hier[i]).hasClass("command_container")) {
- el = $(hier[i]);
- break;
- }
- }
- }
- if (dom_append_menu.hasClass("expression_elements") == false) {
- var hier = el.parentsUntil(".commands_list_div");
- for (var i = 0; i < hier.length; i++) {
- if ($(hier[i]).hasClass("expression_elements")) {
- dom_append_menu = $(hier[i]);
- break;
- }
- }
- }
- var context_menu = '<div class="ui dropdown"><div class="text"></div><i class="ui icon arrow alternate circle right outline"></i><div class="menu">';
- context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp + '">EXP OP EXP</div>';
- context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp + '">OP EXP</div>';
- context_menu += '<div class="item" data-value="' + _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par + '">( EXP )</div>';
- context_menu += '</div></div>';
- context_menu = $(context_menu);
- dom_append_menu.append(context_menu);
- context_menu.dropdown({
- onChange: function onChange(value, text, $selectedItem) {
- switch (value) {
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
- 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)]);
- expression_append_new_expression.push(exp);
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
- 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)]);
- expression_append_new_expression.push(exp);
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
- 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)]);
- expression_append_new_expression.push(exp);
- break;
- }
- renderExpressionElements(command, function_obj, el);
- }
- });
- }
- function renderElement(command, function_obj, el, expression_element) {
- switch (expression_element.type_exp) {
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].exp_op_exp:
- var temp_op = $('<div class="component_element"></div>');
- var temp_exp_1 = $('<div class="component_element"></div>');
- var temp_exp_2 = $('<div class="component_element"></div>');
- el.append(temp_exp_1);
- el.append(temp_op);
- el.append(temp_exp_2);
- if (expression_element.itens[0].type) {
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[0], temp_exp_1, function_obj, 2, expression_element);
- } else {
- renderElement(command, function_obj, temp_exp_1, expression_element.itens[0]);
- }
- renderOperator(command, function_obj, temp_op, expression_element, 1);
- if (expression_element.itens[2].type) {
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[2], temp_exp_2, function_obj, 2, expression_element);
- } else {
- renderElement(command, function_obj, temp_exp_2, expression_element.itens[2]);
- }
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].op_exp:
- var temp_op = $('<div class="component_element"></div>');
- var temp_exp = $('<div class="component_element"></div>');
- el.append(temp_op);
- el.append(temp_exp);
- renderOperator(command, function_obj, temp_op, expression_element, 0);
- if (expression_element.itens[1].type) {
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[1], temp_exp, function_obj, 2, expression_element);
- } else {
- renderElement(command, function_obj, temp_exp, expression_element.itens[1]);
- }
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_ELEMENTS"].par_exp_par:
- var temp_par_1 = $('<div class="component_element"> ( </div>');
- var temp_exp = $('<div class="component_element"></div>');
- var temp_par_2 = $('<div class="component_element"> ) </div>');
- el.append(temp_par_1);
- el.append(temp_exp);
- for (var j = 0; j < expression_element.itens.length; j++) {
- if (expression_element.itens[j].type) {
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_element.itens[j], temp_exp, function_obj, 2, expression_element);
- } else {
- renderElement(command, function_obj, temp_exp, expression_element.itens[j]);
- }
- } //renderMenuAddExpression(command, function_obj, el, el, expression_element.itens);
- el.append(temp_par_2);
- break;
- }
- }
- function renderExpression(command, function_obj, el) {
- var expression_div = el.find('.expression_elements');
- expression_div.text('');
- var menu_add_item = $('<div class="menu_add_item"></div>');
- menu_add_item.data('index_add', 0);
- expression_div.append(menu_add_item);
- for (var i = 0; i < command.expression.length; i++) {
- if (command.expression[i].type) {
- var temp = $('<div class="expression_element"></div>');
- temp.data('ref_element', command.expression[i]);
- temp.data('ref_index', i);
- expression_div.append(temp);
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.expression[i], temp, function_obj);
- } else if (command.expression[i] == "(" || command.expression[i] == ")") {
- var temp = $('<div class="expression_element">' + command.expression[i] + '</div>');
- temp.data('ref_element', command.expression[i]);
- temp.data('ref_index', i);
- expression_div.append(temp);
- } else {
- var temp = '<div class="expression_element">';
- switch (command.expression[i]) {
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus:
- temp += '+';
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus:
- temp += '-';
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].multiplication:
- temp += '*';
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].division:
- temp += '/';
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].module:
- temp += '%';
- break;
- }
- temp += '</div>';
- temp = $(temp);
- temp.data('ref_element', command.expression[i]);
- temp.data('ref_index', i);
- expression_div.append(temp);
- }
- var menu_add_item_seq = $('<div class="menu_add_item"></div>');
- var index_temp = i + 1;
- menu_add_item_seq.data('index_add', index_temp);
- expression_div.append(menu_add_item_seq);
- }
- addMenuItens(command, function_obj, el);
- }
- function addMenuItens(command, function_obj, expression_div) {
- var divs_expression = expression_div.find('.menu_add_item');
- for (var i = 0; i < divs_expression.length; i++) {
- var temp = $(divs_expression[i]).data('index_add');
- var context_menu = '<div class="ui dropdown context_menu_clear"><i class="ui icon plus square outline"></i><div class="menu">';
- context_menu += '<div class="item" data-option="value" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_value') + '</div>';
- context_menu += '<div class="item" data-option="operator" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_operator') + '</div>';
- context_menu += '<div class="item" data-option="parentheses" data-index="' + temp + '">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI('text_parentheses') + '</div>';
- context_menu += '</div></div>';
- context_menu = $(context_menu);
- $(divs_expression[i]).append(context_menu);
- context_menu.dropdown({
- on: 'hover',
- onChange: function onChange(value, text, $selectedItem) {
- switch ($selectedItem.data('option')) {
- case "value":
- 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));
- renderExpression(command, function_obj, expression_div);
- break;
- case "operator":
- command.expression.splice($selectedItem.data('index'), 0, _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus);
- renderExpression(command, function_obj, expression_div);
- break;
- case "parentheses":
- command.expression.splice($selectedItem.data('index'), 0, "(");
- 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));
- command.expression.splice($selectedItem.data('index') + 2, 0, ")");
- renderExpression(command, function_obj, expression_div);
- break;
- }
- }
- });
- }
- }
- function addHandlers(command, function_obj, attribution_dom) {
- attribution_dom.find('.button_remove_command').on('click', function () {
- if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, attribution_dom)) {
- attribution_dom.fadeOut(400, function () {
- attribution_dom.remove();
- });
- }
- });
- attribution_dom.find('.button_refresh_attribution').on('click', function () {
- renderExpressionElements(command, function_obj, attribution_dom);
- });
- }
- function renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected) {
- /*console.log("recebido o seguinte DOM: ");
- console.log(dom_object);
- if (dom_object.hasClass('var_attributed')) {
- return;
- } else {
- var hier = dom_object.parentsUntil(".command_container");
- for (var i = 0; i < hier.length; i++) {
- if ($(hier[i]).hasClass('var_attributed') || $(hier[i]).hasClass('parameters_function_called')) {
- return;
- }
- }
-
-
- }
- dom_object.find('.context_menu_clear').remove();
-
- var menu_operations = '<div class="ui dropdown menu_operations"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
- for (var tm in Models.ARITHMETIC_TYPES) {
- menu_operations += '<div class="item" data-option="'+tm+'">'+LocalizedStrings.getUI('btn_arithmetic_' + tm)+'</div>';
- }
- menu_operations += '<div class="item" data-option="clear">'+LocalizedStrings.getUI('btn_clear')+'</div>';
-
- menu_operations += '</div></div>';
- menu_operations = $(menu_operations);
- dom_object.append(menu_operations);
- menu_operations.dropdown({
- onChange: function(value, text, $selectedItem) {
- switch ($($selectedItem).data('option')) {
- case "clear":
- $(dom_object).text('');
- VariableValueMenu.renderMenu(command, ref_object, dom_object, function_obj);
- break;
- default:
- createExpressionAround(command, ref_object, dom_object, function_obj);
- menu_operations.find('.text').text('');
- }
- }
- });*/
- }
- function createExpressionAround(command, ref_object, dom_object, function_obj) {
- $('<span> ( </span>').insertBefore(dom_object);
- $('<span> ) </span>').insertAfter(dom_object);
- _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);
- }
- /***/ }),
- /***/ "./js/visualUI/commands/break.js":
- /*!***************************************!*\
- !*** ./js/visualUI/commands/break.js ***!
- \***************************************/
- /*! exports provided: createFloatingCommand, renderCommand */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
- function createFloatingCommand() {
- 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>');
- }
- function renderCommand(command, function_obj) {
- 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>');
- el.data('command', command);
- addHandlers(command, function_obj, el);
- return el;
- }
- function addHandlers(command, function_obj, break_dom) {
- break_dom.find('.button_remove_command').on('click', function () {
- if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, break_dom)) {
- break_dom.fadeOut(400, function () {
- break_dom.remove();
- });
- }
- });
- }
- /***/ }),
- /***/ "./js/visualUI/commands/comment.js":
- /*!*****************************************!*\
- !*** ./js/visualUI/commands/comment.js ***!
- \*****************************************/
- /*! exports provided: createFloatingCommand, renderCommand */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
- /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
- function createFloatingCommand() {
- 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>');
- }
- function renderCommand(command, function_obj) {
- 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>');
- el.data('command', command);
- addHandlers(command, function_obj, el);
- renderTextComment(command, function_obj, el);
- return el;
- }
- function renderTextComment(command, function_obj, el) {
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__["renderMenu"](command, command.comment_text, el.find('.var_value_menu_div'), function_obj, 20);
- }
- function addHandlers(command, function_obj, comment_dom) {
- comment_dom.find('.button_remove_command').on('click', function () {
- if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, comment_dom)) {
- comment_dom.fadeOut(400, function () {
- comment_dom.remove();
- });
- }
- });
- }
- /***/ }),
- /***/ "./js/visualUI/commands/conditional_expression.js":
- /*!********************************************************!*\
- !*** ./js/visualUI/commands/conditional_expression.js ***!
- \********************************************************/
- /*! exports provided: renderExpression */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderExpression", function() { return renderExpression; });
- /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
- function renderExpression(command, expression, function_obj, initial_el_to_render) {
- expression.dom_object = initial_el_to_render;
- if (expression.expression == null || expression.expression.length < 1) {
- renderStartMenu(command, expression, function_obj, initial_el_to_render);
- } else {
- var main_div = $('<div class="expression_elements"></div>');
- switch (expression.expression.type) {
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic:
- renderLogicExpression(command, expression, expression.expression, function_obj, main_div, initial_el_to_render);
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic:
- renderArithmeticExpression(command, expression, expression.expression, function_obj, main_div);
- break;
- }
- initial_el_to_render.append(main_div);
- var restartMenu = $('<div class="ui restart_expression"><i class="ui icon undo"></i></div>');
- initial_el_to_render.append(restartMenu);
- restartMenu.on('click', function (e) {
- expression.expression = null;
- initial_el_to_render.empty();
- renderExpression(command, expression, function_obj, initial_el_to_render);
- });
- }
- }
- function renderArithmeticOperator(command, all_expression, expression_arithmetic, arithmetic_operator, function_obj, element_to_append) {
- var menu_operator = $('<div class="ui dropdown"><div class="text"></div><i class="dropdown icon"></i></div>');
- menu_operator.dropdown({
- values: [{
- name: '>',
- value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than,
- selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than
- }, {
- name: '<',
- value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than,
- selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than
- }, {
- name: '==',
- value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].equals_to,
- selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].equals_to
- }, {
- name: '!=',
- value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].not_equals_to,
- selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].not_equals_to
- }, {
- name: '>=',
- value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to,
- selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].greater_than_or_equals_to
- }, {
- name: '<=',
- value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than_or_equals_to,
- selected: arithmetic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_COMPARISON"].less_than_or_equals_to
- }],
- onChange: function onChange(value, text, $selectedItem) {
- expression_arithmetic.operator = value;
- }
- });
- element_to_append.append(menu_operator);
- }
- function renderLogicOperator(command, all_expression, expression_logic, logic_operator, function_obj, element_to_append, initial_el_to_render) {
- var menu_operator = $('<div class="ui dropdown"><div class="text"></div><i class="dropdown icon"></i></div>');
- menu_operator.dropdown({
- values: [{
- name: '==',
- value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].equals_to,
- selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].equals_to
- }, {
- name: '!=',
- value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].not_equals_to,
- selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].not_equals_to
- }, {
- name: '&&',
- value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].and,
- selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].and
- }, {
- name: '||',
- value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].or,
- selected: logic_operator == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["LOGIC_COMPARISON"].or
- }],
- onChange: function onChange(value, text, $selectedItem) {
- if ($selectedItem) {
- expression_logic.operator = value;
- if (expression_logic.second_operand == null) {
- 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);
- initial_el_to_render.empty();
- renderExpression(command, all_expression, function_obj, initial_el_to_render);
- }
- }
- }
- });
- element_to_append.append(menu_operator);
- }
- function renderLogicExpression(command, all_expression, expression_logic, function_obj, element_to_append, initial_el_to_render) {
- var exp_el_par_1 = $(' <span class="span_command_spec"> </span> ');
- var exp_el_expr_el_1 = $('<div class="expression_element"></div>');
- var exp_el_expr_operand = $('<div class="expression_element"></div>');
- var exp_el_expr_el_2 = $('<div class="expression_element"></div>');
- var exp_el_par_2 = $(' <span class="span_command_spec"> </span> ');
- if (expression_logic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
- renderLogicExpression(command, all_expression, expression_logic.first_operand, function_obj, exp_el_expr_el_1);
- } else if (expression_logic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
- renderArithmeticExpression(command, all_expression, expression_logic.first_operand, function_obj, exp_el_expr_el_1);
- } else {
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_logic.first_operand, exp_el_expr_el_1, function_obj);
- }
- element_to_append.append(exp_el_par_1);
- element_to_append.append(exp_el_expr_el_1);
- renderLogicOperator(command, all_expression, expression_logic, expression_logic.operator, function_obj, exp_el_expr_operand, initial_el_to_render);
- element_to_append.append(exp_el_expr_operand);
- if (expression_logic.second_operand) {
- if (expression_logic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
- renderLogicExpression(command, all_expression, expression_logic.second_operand, function_obj, exp_el_expr_el_2);
- } else if (expression_logic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
- renderArithmeticExpression(command, all_expression, expression_logic.second_operand, function_obj, exp_el_expr_el_2);
- } else {
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_logic.second_operand, exp_el_expr_el_2, function_obj);
- }
- element_to_append.append(exp_el_expr_el_2);
- }
- element_to_append.append(exp_el_par_2);
- }
- function renderArithmeticExpression(command, all_expression, expression_arithmetic, function_obj, element_to_append) {
- var exp_el_par_1 = $(' <span class="span_command_spec"> </span> ');
- var exp_el_expr_el_1 = $('<div class="expression_element"></div>');
- var exp_el_expr_operand = $('<div class="expression_element"></div>');
- var exp_el_expr_el_2 = $('<div class="expression_element"></div>');
- var exp_el_par_2 = $(' <span class="span_command_spec"> </span> ');
- if (expression_arithmetic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
- renderLogicExpression(command, all_expression, expression_arithmetic.first_operand, function_obj, exp_el_expr_el_1);
- } else if (expression_arithmetic.first_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
- renderArithmeticExpression(command, all_expression, expression_arithmetic.first_operand, function_obj, exp_el_expr_el_1);
- } else {
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_arithmetic.first_operand, exp_el_expr_el_1, function_obj);
- }
- if (expression_arithmetic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic) {
- renderLogicExpression(command, all_expression, expression_arithmetic.second_operand, function_obj, exp_el_expr_el_2);
- } else if (expression_arithmetic.second_operand.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic) {
- renderArithmeticExpression(command, all_expression, expression_arithmetic.second_operand, function_obj, exp_el_expr_el_2);
- } else {
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, expression_arithmetic.second_operand, exp_el_expr_el_2, function_obj);
- }
- renderArithmeticOperator(command, all_expression, expression_arithmetic, expression_arithmetic.operator, function_obj, exp_el_expr_operand);
- element_to_append.append(exp_el_par_1);
- element_to_append.append(exp_el_expr_el_1);
- element_to_append.append(exp_el_expr_operand);
- element_to_append.append(exp_el_expr_el_2);
- element_to_append.append(exp_el_par_2);
- }
- function renderStartMenu(command, expression, function_obj, initial_el_to_render) {
- var start_menu = '';
- 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">';
- 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>';
- 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>';
- start_menu += '</div></div>';
- start_menu = $(start_menu);
- start_menu.dropdown({
- onChange: function onChange(value, text, $selectedItem) {
- switch ($selectedItem.data('exp')) {
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_logic:
- 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));
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["EXPRESSION_TYPES"].exp_arithmetic:
- 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);
- break;
- }
- initial_el_to_render.html('');
- renderExpression(command, expression, function_obj, initial_el_to_render);
- },
- selectOnKeydown: false
- });
- initial_el_to_render.append(' <span class="span_command_spec"> </span> ');
- initial_el_to_render.append(start_menu);
- initial_el_to_render.append(' <span class="span_command_spec"> </span> ');
- }
- /***/ }),
- /***/ "./js/visualUI/commands/contextualized_menu.js":
- /*!*****************************************************!*\
- !*** ./js/visualUI/commands/contextualized_menu.js ***!
- \*****************************************************/
- /*! exports provided: renderMenu */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenu", function() { return renderMenu; });
- /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
- /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
- /* harmony import */ var _switch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./switch */ "./js/visualUI/commands/switch.js");
- function renderMenu(command, dom_where_render, function_obj, dom_command) {
- var menu_div = '<div class="ui dropdown menu_commands" ><i class="icon code"></i> <div class="menu"> ';
- 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) {
- 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>';
- } else {
- 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>';
- 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>';
- }
- menu_div += '</div></div>';
- menu_div = $(menu_div);
- dom_where_render.append(menu_div);
- addHandlers(command, dom_where_render, function_obj, dom_command);
- }
- function addHandlers(command, dom_where_render, function_obj, dom_command) {
- dom_where_render.find('.menu_commands').dropdown({
- on: 'hover'
- });
- dom_where_render.find('.menu_commands a').on('click', function (evt) {
- 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) {
- if (command.commands_block == null || command.commands_block.length == 0) {
- command.commands_block = [];
- var new_cmd = _commands__WEBPACK_IMPORTED_MODULE_2__["genericCreateCommand"]($(this).data('command'));
- command.commands_block.push(new_cmd);
- _commands__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](new_cmd, dom_command.find('.block_commands'), 3, function_obj);
- } else {
- _commands__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"](function_obj, dom_command.find('.block_commands'), $(this).data('command'), evt);
- }
- } else {
- switch ($(this).data('command')) {
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"]["break"]:
- _commands__WEBPACK_IMPORTED_MODULE_2__["createFloatingCommand"](function_obj, dom_command.find('.block_commands'), $(this).data('command'), evt);
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].switchcase:
- addCaseToSwitch(command, dom_where_render, function_obj, dom_command);
- break;
- }
- }
- });
- }
- function addCaseToSwitch(command, dom_where_render, function_obj, dom_command) {
- if (command.cases == null) {
- command.cases = [];
- }
- 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));
- command.cases.push(sc);
- _switch__WEBPACK_IMPORTED_MODULE_4__["renderCase"](sc, command, function_obj, dom_command.find('.all_cases_div'));
- }
- /***/ }),
- /***/ "./js/visualUI/commands/dowhiletrue.js":
- /*!*********************************************!*\
- !*** ./js/visualUI/commands/dowhiletrue.js ***!
- \*********************************************/
- /*! exports provided: createFloatingCommand, renderCommand */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
- /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
- /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
- /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
- function createFloatingCommand() {
- 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>');
- }
- function renderCommand(command, function_obj) {
- var ret = '';
- 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>';
- ret += '<div class="ui block_commands" data-subblock="" data-idcommand="">';
- ret += '</div>';
- 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>';
- ret += '</div>';
- var el = $(ret);
- el.data('command', command);
- el.find('.block_commands').data('command', command);
- addHandlers(command, function_obj, el);
- _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'));
- if (command.expression) {
- _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
- }
- if (command.commands_block) {
- for (var j = 0; j < command.commands_block.length; j++) {
- _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
- }
- }
- return el;
- }
- function addHandlers(command, function_obj, dowhiletrue_dom) {
- dowhiletrue_dom.find('.button_remove_command').on('click', function () {
- if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, dowhiletrue_dom)) {
- dowhiletrue_dom.fadeOut(400, function () {
- dowhiletrue_dom.remove();
- });
- }
- });
- }
- /***/ }),
- /***/ "./js/visualUI/commands/functioncall.js":
- /*!**********************************************!*\
- !*** ./js/visualUI/commands/functioncall.js ***!
- \**********************************************/
- /*! exports provided: createFloatingCommand, renderCommand */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
- /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
- /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
- function createFloatingCommand() {
- return $('<div class="ui functioncall created_element"> <i class="hand point right icon"></i> <span> funcao() </span></div>');
- }
- function renderCommand(command, function_obj) {
- 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>');
- el.data('command', command);
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_0__["renderMenu"](command, command.function_called, el.find('.var_value_menu_div'), function_obj);
- addHandlers(command, function_obj, el);
- return el;
- }
- function addHandlers(command, function_obj, functioncall_dom) {
- functioncall_dom.find('.button_remove_command').on('click', function () {
- if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, functioncall_dom)) {
- functioncall_dom.fadeOut(400, function () {
- functioncall_dom.remove();
- });
- }
- });
- }
- /***/ }),
- /***/ "./js/visualUI/commands/generic_expression.js":
- /*!****************************************************!*\
- !*** ./js/visualUI/commands/generic_expression.js ***!
- \****************************************************/
- /*! exports provided: renderExpression */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderExpression", function() { return renderExpression; });
- /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types */ "./js/visualUI/types.js");
- /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
- /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../services/userLog */ "./js/services/userLog.js");
- /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
- /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_5__);
- window.timer = false;
- function renderExpression(command, function_obj, div_to_render, expression_array) {
- div_to_render.empty();
- melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.unwatch(command, "expression");
- melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.watch(command, "expression", function () {
- if (window.timer) return;
- var m = div_to_render.find(".single_element_expression").not(".mouse_distance").not(".add_parentheses");
- var s = "";
- m.each(function (e) {
- if ($(this).hasClass("parentheses_in_expression")) {
- s += $(this).text() + " ";
- } else {
- s += $(this).find(".text").text();
- s += $(this).find(".var_name").text();
- s += $(this).find(".parameters_function_called").text();
- s += $(this).find(".value_rendered").text();
- s += " ";
- }
- });
- if (s) {
- window.timer = true;
- } else {
- return;
- }
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_COMMAND_EXP, command.type, "/", s);
- setTimeout(function () {
- window.timer = false;
- }, 200);
- }, 20, true);
- if (command.type === _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].attribution) {
- melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.unwatch(command.variable);
- melanke_watchjs__WEBPACK_IMPORTED_MODULE_5___default.a.watch(command.variable, function () {
- renderExpression(command, function_obj, div_to_render, expression_array);
- }, 0);
- if (command.variable.content) {
- var types_included = [];
- if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER || command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
- } else if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
- types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional);
- types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic);
- types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
- } else if (command.variable.content.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional);
- types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic);
- types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
- } else {
- console.log("NÃO RECONHECI! VEJA: ", command.variable.content.type);
- }
- renderElements(command, function_obj, div_to_render, expression_array, types_included);
- } else {
- div_to_render.text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("var_menu_select_var").toLowerCase());
- }
- } else {
- var _types_included = [];
- _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional);
- _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic);
- if (command.type === _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["COMMAND_TYPES"].writer) _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep);
- _types_included.push(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic);
- renderElements(command, function_obj, div_to_render, expression_array, _types_included);
- }
- div_to_render.children(".mouse_distance").addClass("mouse_distance_hidden");
- div_to_render.children(".higher_element").on("mousemove", function (evt) {
- if (!window.open_or_close) {
- $(this).css("position", "relative", "!important");
- $(this).children(".mouse_distance").css("opacity", "1");
- }
- });
- div_to_render.children(".higher_element").on("mouseout", function (evt) {
- if (!window.open_or_close) {
- $(this).css("position", "absolute", "!important");
- $(this).children(".mouse_distance").css("opacity", "0");
- }
- });
- var lixeira = $('<div class="lixeira" draggable="true"></div>');
- div_to_render.find(".single_element_expression").on("mousedown", function (evt) {
- window.posX = evt.clientX;
- window.posY = evt.clientY;
- });
- Sortable.create(div_to_render[0], {
- animation: 100,
- ghostClass: "ghost",
- group: {
- name: "shared",
- put: false // Do not allow items to be put into this list
- },
- draggable: ".single_element_expression",
- sort: false,
- filter: ".not_allowed",
- onStart: function onStart() {
- $("body").append(lixeira);
- lixeira.css("display", "block");
- lixeira.css("top", window.posY + 70, "!important");
- lixeira.css("left", window.posX - 20, "!important");
- },
- onMove: function onMove() {
- lixeira.addClass("color_test");
- },
- onEnd: function onEnd() {
- lixeira.remove();
- div_to_render.find(".ghost").removeClass("ghost");
- }
- });
- new Sortable(lixeira[0], {
- group: "shared",
- animation: 150,
- onAdd: function onAdd(evt) {
- lixeira.css("display", "none");
- lixeira.find(".single_element_expression").remove();
- lixeira.css("background-color", "");
- lixeira.remove();
- removeElement(evt, expression_array);
- renderExpression(command, function_obj, div_to_render, expression_array);
- }
- });
- }
- function removeElement(event, expression_array) {
- var indice = $(event.item).data("index");
- var first = expression_array[0];
- console.log("indice: ", indice);
- if (expression_array[indice].type) {
- // if is alone in expression:
- if (expression_array.length == 1) {
- //function_obj.commands.splice(function_obj.commands.indexOf(command), 1);
- expression_array.splice(0, 1);
- } else if (expression_array.length > 1) {
- if (indice > 0 && expression_array[indice - 1].type_op) {
- if (indice < expression_array.length && expression_array[indice - 2] == "(" && expression_array[indice + 1].type_op) {
- expression_array.splice(indice + 1, 1);
- }
- expression_array.splice(indice, 1);
- expression_array.splice(indice - 1, 1);
- if (indice - 2 < expression_array.length && expression_array[indice - 2] == "(" && expression_array[indice - 1] == ")") {
- expression_array.splice(indice - 1, 1);
- expression_array.splice(indice - 2, 1);
- if (indice - 3 >= 0 && indice - 3 < expression_array.length && expression_array[indice - 3].type_op) {
- expression_array.splice(indice - 3, 1);
- }
- }
- } else if (indice < expression_array.length - 1 && expression_array[indice + 1].type_op) {
- expression_array.splice(indice + 1, 1);
- expression_array.splice(indice, 1);
- } else if (indice < expression_array.length - 1 && indice > 0 && expression_array[indice - 1] == "(" && expression_array[indice + 1] == ")") {
- if (indice > 1 && expression_array[indice - 2].type_op) {
- expression_array.splice(indice + 1, 1);
- expression_array.splice(indice, 1);
- expression_array.splice(indice - 1, 1);
- expression_array.splice(indice - 2, 1);
- } else if (indice < expression_array.length - 2 && expression_array[indice + 2].type_op) {
- expression_array.splice(indice + 1, 1);
- expression_array.splice(indice, 1);
- expression_array.splice(indice - 1, 1);
- } else {
- expression_array.splice(indice + 1, 1);
- expression_array.splice(indice, 1);
- expression_array.splice(indice - 1, 1);
- }
- }
- }
- } else if (expression_array[indice].type_op) {// iVProg doesn't support operator remove
- } else {
- var opening = -1;
- var closing = -1;
- if (expression_array[indice] == "(") {
- opening = indice;
- for (var i = indice + 1; i < expression_array.length; i++) {
- if (expression_array[i] == ")") {
- closing = i;
- break;
- }
- }
- } else {
- closing = indice;
- for (var i = indice - 1; i >= 0; i--) {
- if (expression_array[i] == "(") {
- opening = i;
- break;
- }
- }
- }
- if (expression_array[opening + 1].type_op) {
- expression_array.splice(closing, 1);
- expression_array.splice(opening + 1, 1);
- expression_array.splice(opening, 1);
- } else {
- expression_array.splice(closing, 1);
- expression_array.splice(opening, 1);
- }
- } // if expression is empty, add a new var value:
- if (expression_array.length == 0) {
- 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));
- }
- if (first != expression_array[0] && expression_array[0].type_op) {
- expression_array.splice(0, 1);
- }
- }
- function renderElements(command, function_obj, div_to_render, expression_array, types_included) {
- /*if (expression_array.length > 0) {
- if (!expression_array[0].type_op) {
- renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, 0);
- }
- }*/
- var i = 0;
- for (i = 0; i < expression_array.length; i++) {
- if (expression_array[i].type == "var_value") {
- var div_temp = $('<div class="single_element_expression" data-index="' + i + '"></div>');
- if (i == 0) {
- if (expression_array.length > 0 && !expression_array[0].type_op) {//renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, 0);
- }
- }
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_3__["renderMenu"](command, expression_array[i], div_temp, function_obj);
- div_to_render.append(div_temp);
- } else if (expression_array[i] == "(" || expression_array[i] == ")") {
- if (expression_array[i] == ")") {
- renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, i);
- renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
- } else if (expression_array[i] == "(" && !expression_array[i + 1].type_op) {
- renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
- renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, i + 1);
- } else {
- renderParenthesis(div_to_render, expression_array[i], command, function_obj, i, expression_array);
- }
- } else {
- if (i == 0) {
- console.log("NEGAÇÃO NO PRIMEIRO ELEMENTO");
- } else if (expression_array[i - 1] == "(") {
- console.log("NEGAÇÃO APÓS O PARÊNTESES");
- }
- renderOperatorMenu(command, function_obj, div_to_render, expression_array[i], types_included, i, expression_array);
- }
- }
- renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, i, true);
- renderAddParenthesis(command, function_obj, div_to_render, expression_array, types_included);
- }
- window.parentheses_activate = false;
- window.open_or_close = null;
- function renderAddParenthesis(command, function_obj, div_to_render, expression_array, types_included) {
- 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>');
- div_to_render.append(addParentheses);
- addParentheses.popup({
- content: "Adicionar parênteses",
- delay: {
- show: 750,
- hide: 0
- }
- });
- addParentheses.on("click", function (mouse_event) {
- // verificar se já está ativado
- if (window.parentheses_activate) {
- return;
- }
- div_to_render.find(".usepointer").off("click");
- window.parentheses_activate = true;
- window.open_or_close = "open";
- div_to_render.find(".dropdown").addClass("disabled");
- div_to_render.find(".ghost_element").addClass("temp_class");
- div_to_render.find(".ghost_element").removeClass("ghost_element");
- var floatingObject = $('<div class="floating_parenthesis"> ( </div>');
- floatingObject.draggable().appendTo("body");
- floatingObject.css("position", "absolute");
- mouse_event.type = "mousedown.draggable";
- mouse_event.target = floatingObject[0];
- floatingObject.css("left", mouse_event.pageX + 10);
- floatingObject.css("top", mouse_event.pageY + 10);
- floatingObject.trigger(mouse_event);
- div_to_render.on("mousemove", function (evt) {
- var actual_target = null;
- if ($(evt.target).hasClass("single_element_expression")) {
- actual_target = $(evt.target);
- } else {
- actual_target = $(evt.target).closest(".single_element_expression");
- }
- 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")) {
- return;
- }
- renderGhostParentheses(actual_target, command, function_obj, div_to_render, expression_array);
- });
- div_to_render.on("mouseleave", function () {
- /*window.open_parentheses.remove();
- window.close_parentheses.remove();*/
- });
- var floating;
- $("body").on("mouseup", function (evt) {
- if (window.open_or_close == "open") {
- window.open_or_close = "close";
- floatingObject.remove();
- var comando_que_esta = $(evt.target).closest(".command_container");
- var comando_certo = div_to_render.closest(".command_container");
- if (!comando_que_esta.is(comando_certo)) {
- window.parentheses_activate = false;
- div_to_render.find(".temp_class").addClass("ghost_element");
- div_to_render.find(".temp_class").removeClass("temp_class");
- div_to_render.off("mousemove");
- div_to_render.off("mouseleave");
- $("body").off("mouseup");
- window.open_parentheses.remove();
- window.close_parentheses.remove();
- window.inserir_open = -1;
- window.inserir_close = -1;
- window.open_or_close = null;
- renderExpression(command, function_obj, div_to_render, expression_array);
- return;
- }
- window.open_parentheses.addClass("parentheses_fixed");
- floating = $('<div class="floating_parenthesis"> ) </div>');
- floating.draggable().appendTo("body");
- floating.css("position", "absolute");
- floating.css("left", evt.pageX + 10);
- floating.css("top", evt.pageY + 10);
- $("body").on("mousemove", function (evts) {
- floating.css("left", evts.pageX + 10);
- floating.css("top", evts.pageY + 10);
- });
- } else {
- floating.remove();
- window.open_parentheses.removeClass("parentheses_fixed");
- div_to_render.off("mousemove");
- div_to_render.off("mouseleave");
- $("body").off("mouseup");
- setTimeout(function () {
- window.parentheses_activate = false;
- }, 50);
- var comando_que_esta = $(evt.target).closest(".command_container");
- var comando_certo = div_to_render.closest(".command_container");
- var is_correct = false;
- if (comando_que_esta.is(comando_certo)) {
- is_correct = true;
- }
- if (is_correct) {
- expression_array.splice(window.inserir_open, 0, "(");
- expression_array.splice(window.inserir_close, 0, ")");
- }
- window.inserir_open = -1;
- window.inserir_close = -1;
- window.open_or_close = null;
- renderExpression(command, function_obj, div_to_render, expression_array);
- }
- });
- });
- }
- window.open_parentheses = $('<div class="parentheses_ghost">(</div>');
- window.close_parentheses = $('<div class="parentheses_ghost">)</div>');
- window.inserir_open = -1;
- window.inserir_close = -1;
- function renderGhostParentheses(actual_target, command, function_obj, div_to_render, expression_array) {
- /*window.open_parentheses.remove();
- window.close_parentheses.remove();*/
- var index_in_array = actual_target.data("index");
- if (expression_array[index_in_array] == "(" || expression_array[index_in_array] == ")") {
- return;
- }
- if (window.open_or_close == "close") {
- if (index_in_array < window.inserir_open) {
- return;
- }
- } // Tratando a situação quando é na primeira posição:
- if (index_in_array == 0) {
- if (expression_array[index_in_array].type == "var_value") {
- if (window.open_or_close == "open") {
- window.open_parentheses.insertBefore(actual_target);
- window.inserir_open = index_in_array;
- }
- /*if (expression_array.length == 1) {
- if (window.open_or_close == "close") {
- window.close_parentheses.insertAfter(actual_target);
- window.inserir_close = index_in_array + 2;
- }*/
- //} else {
- var count_opened = 0;
- var count_closed = 0;
- for (var i = 0; i < expression_array.length; i++) {
- if (expression_array[i] == "(") {
- count_opened++;
- }
- if (expression_array[i] == ")") {
- count_closed++;
- }
- if (count_opened != count_closed) {} else {
- if (count_opened > 0) {
- if (window.open_or_close == "close") {
- window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
- window.inserir_close = i + 2;
- }
- break;
- } else {
- if (expression_array[i].type == "var_value") {
- if (window.open_or_close == "close") {
- window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
- window.inserir_close = i + 2;
- }
- break;
- }
- }
- }
- } //}
- } else if (expression_array[index_in_array].type_op) {
- if (window.open_or_close == "open") {
- window.open_parentheses.insertBefore(actual_target);
- window.inserir_open = index_in_array;
- }
- var count_opened = 0;
- var count_closed = 0;
- for (var i = 1; i < expression_array.length; i++) {
- // $('.slide-link[data-slide="0"]')
- if (expression_array[i] == "(") {
- count_opened++;
- }
- if (expression_array[i] == ")") {
- count_closed++;
- }
- if (count_opened != count_closed) {} else {
- if (count_opened > 0) {
- if (expression_array[i].type == "var_value") {
- window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
- window.inserir_close = i + 2;
- }
- break;
- } else {
- if (expression_array[i].type == "var_value") {
- if (expression_array[i].type == "var_value") {
- window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + i + '"]'));
- window.inserir_close = i + 2;
- }
- break;
- }
- }
- }
- }
- }
- return;
- } // Tratando quando não é no índice 0:
- if (expression_array[index_in_array].type == "var_value") {
- if (window.open_or_close == "open") {
- window.open_parentheses.insertBefore(actual_target);
- window.inserir_open = index_in_array;
- }
- if (window.open_or_close == "close") {
- window.close_parentheses.insertAfter(actual_target);
- window.inserir_close = index_in_array + 2;
- }
- return;
- }
- if (expression_array[index_in_array].type_op) {
- // buscar para a esquerda primeiro:
- if (expression_array[index_in_array - 1] == "(") {
- if (window.open_or_close == "open") {
- window.open_parentheses.insertBefore(actual_target);
- window.inserir_open = index_in_array;
- }
- } else if (expression_array[index_in_array - 1] == ")") {
- // buscar a abertura
- var count_opened = 0;
- var count_closed = 0;
- for (var j = index_in_array - 1; j >= 0; j--) {
- if (expression_array[j] == "(") {
- count_opened++;
- }
- if (expression_array[j] == ")") {
- count_closed++;
- }
- if (count_opened != count_closed) {} else {
- if (count_closed > 0) {
- if (window.open_or_close == "open") {
- window.open_parentheses.insertBefore(div_to_render.find('.single_element_expression[data-index="' + j + '"]'));
- window.inserir_open = j;
- }
- break;
- }
- }
- }
- } else if (expression_array[index_in_array - 1].type == "var_value") {
- if (window.open_or_close == "open") {
- window.open_parentheses.insertBefore(div_to_render.find('.single_element_expression[data-index="' + (index_in_array - 1) + '"]'));
- window.inserir_open = index_in_array - 1;
- }
- } // buscar para a direita agora:
- if (expression_array[index_in_array + 1] == "(") {
- // buscar o fechamento:
- var count_opened = 0;
- var count_closed = 0;
- for (var j = index_in_array + 1; j < expression_array.length; j++) {
- if (expression_array[j] == "(") {
- count_opened++;
- }
- if (expression_array[j] == ")") {
- count_closed++;
- }
- if (count_opened != count_closed) {} else {
- if (count_opened > 0) {
- if (window.open_or_close == "close") {
- window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + j + '"]'));
- window.inserir_close = j + 2;
- }
- break;
- }
- }
- }
- } else if (expression_array[index_in_array + 1].type == "var_value") {
- if (window.open_or_close == "close") {
- window.close_parentheses.insertAfter(div_to_render.find('.single_element_expression[data-index="' + (index_in_array + 1) + '"]'));
- window.inserir_close = index_in_array + 3;
- }
- }
- }
- }
- function renderParenthesis(div_to_render, expression_content, command, function_obj, position, expression_array) {
- var ghost_parenthesis = $('<div class="single_element_expression parentheses_in_expression" data-index="' + position + '">' + expression_content + "</div>");
- div_to_render.append(ghost_parenthesis);
- }
- function renderStartAddOperator(div_to_render, types_included, expression_array, command, function_obj, position) {
- var menu_final = '<div class="ui dropdown disabled usepointer"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
- if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
- if (types_included.length > 1) {
- menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
- menu_final += getArithmeticOperators();
- menu_final += "</div></div>";
- } else {
- menu_final += getArithmeticOperators();
- }
- }
- if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
- if (types_included.length > 1) {
- menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
- menu_final += getLogicOperators();
- menu_final += "</div></div>";
- } else {
- menu_final += getLogicOperators();
- }
- }
- if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
- if (types_included.length > 1) {
- menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
- menu_final += getRelationalOperators();
- menu_final += "</div></div>";
- } else {
- menu_final += getRelationalOperators();
- }
- }
- menu_final += "</div></div>";
- menu_final = $(menu_final);
- var div_temp = $('<div class="single_element_expression ghost_element mouse_distance"></div>');
- div_temp.append(menu_final);
- var div_higher = $('<div class="higher_element"></div>');
- div_higher.append(div_temp);
- div_to_render.append(div_higher);
- menu_final.dropdown("set selected", _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].minus);
- div_temp.on("click", function () {
- if (!window.open_or_close) {
- var sera = position;
- if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
- console.log("p1");
- 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));
- } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
- console.log("p2");
- 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));
- } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
- console.log("p3");
- 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));
- }
- renderExpression(command, function_obj, div_to_render, expression_array);
- }
- });
- }
- function renderFinalAddElements(div_to_render, types_included, expression_array, command, function_obj, position) {
- var is_last = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
- var menu_final = '<div class="ui dropdown disabled usepointer"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
- if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
- if (types_included.length > 1) {
- menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
- menu_final += getArithmeticOperators();
- menu_final += "</div></div>";
- } else {
- menu_final += getArithmeticOperators();
- }
- }
- if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
- if (types_included.length > 1) {
- menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
- menu_final += getLogicOperators();
- menu_final += "</div></div>";
- } else {
- menu_final += getLogicOperators();
- }
- }
- if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
- if (types_included.length > 1) {
- menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
- menu_final += getRelationalOperators();
- menu_final += "</div></div>";
- } else {
- menu_final += getRelationalOperators();
- }
- }
- menu_final += "</div></div>";
- menu_final = $(menu_final);
- var div_temp = $('<div class="simple_add mouse_distance"></div>');
- var div_higher = $('<div class="higher_element"></div>');
- var button = $('<button class="ui button green add_expression"><i class="plus circle inverted icon"></i></button>');
- div_temp.append(button);
- if (!is_last) {
- div_higher.append(div_temp);
- div_to_render.append(div_higher); //div_temp.append(menu_final);
- div_temp.css("opacity", "0", "!important");
- } else {
- div_temp.removeClass("mouse_distance");
- div_temp.css("opacity", "1", "!important"); //div_temp.append(menu_final);
- div_to_render.append(div_temp);
- }
- menu_final.dropdown("set selected", _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["ARITHMETIC_TYPES"].plus);
- div_temp.on("click", function () {
- var sera = position;
- if (expression_array[sera] == ")" && expression_array[sera - 1] == "(") {
- 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));
- renderExpression(command, function_obj, div_to_render, expression_array);
- return;
- }
- if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
- 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));
- 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));
- } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
- 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));
- 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));
- } else if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
- 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));
- 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));
- }
- renderExpression(command, function_obj, div_to_render, expression_array);
- });
- }
- function renderOperatorMenu(command, function_obj, div_to_render, expression_element, types_included, position, expression_array) {
- var menu_final = '<div class="ui dropdown"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
- if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep) >= 0) {
- menu_final += getSeparator();
- }
- if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_arithmetic) >= 0) {
- if (types_included.length > 1) {
- menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_arithmetic_expression") + '<div class="menu">';
- menu_final += getArithmeticOperators();
- menu_final += "</div></div>";
- } else {
- menu_final += getArithmeticOperators();
- }
- }
- if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_logic) >= 0) {
- if (types_included.length > 1) {
- menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_logic_expression") + '<div class="menu">';
- menu_final += getLogicOperators();
- menu_final += "</div></div>";
- } else {
- menu_final += getLogicOperators();
- }
- }
- if (types_included.indexOf(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].exp_conditional) >= 0) {
- if (types_included.length > 1) {
- menu_final += '<div class="item"><i class="dropdown icon"></i>' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_relational_expression") + '<div class="menu">';
- menu_final += getRelationalOperators();
- menu_final += "</div></div>";
- } else {
- menu_final += getRelationalOperators();
- }
- }
- menu_final += "</div></div>";
- menu_final = $(menu_final);
- menu_final.find(".ivprog-write-sep").popup({
- content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("write_seprator_menu_tooltip"),
- delay: {
- show: 500,
- hide: 0
- }
- });
- var div_temp = $('<div class="single_element_expression not_allowed" data-index="' + position + '"></div>');
- div_temp.append(menu_final);
- div_to_render.append(div_temp);
- menu_final.dropdown({
- onChange: function onChange(_value, _text, $selectedItem) {
- expression_element.item = $selectedItem.data("value");
- expression_element.type_op = $selectedItem.data("type");
- }
- });
- menu_final.dropdown("set selected", expression_element.item);
- }
- function getArithmeticOperators() {
- var arithmetic_operators;
- 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>';
- 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>';
- 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>';
- 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>';
- 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>';
- return arithmetic_operators;
- }
- function getLogicOperators() {
- var logic_operators;
- 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>';
- 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>';
- 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>";
- 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>";
- 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>";
- return logic_operators;
- }
- function getRelationalOperators() {
- var relational_operators;
- 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>';
- 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>';
- 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>';
- 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>';
- 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>';
- 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>';
- return relational_operators;
- }
- function getSeparator() {
- return "<div class=\"item ivprog-write-sep\" data-type=\"".concat(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep, "\" data-value=\"").concat(_ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["EXPRESSION_TYPES"].write_sep, "\">").concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("write_seprator_menu_text"), "</div>");
- }
- /***/ }),
- /***/ "./js/visualUI/commands/iftrue.js":
- /*!****************************************!*\
- !*** ./js/visualUI/commands/iftrue.js ***!
- \****************************************/
- /*! exports provided: createFloatingCommand, renderCommand */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
- /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
- /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
- function createFloatingCommand() {
- return $('<div class="ui iftrue created_element"> <i class="ui icon small random"></i> <span> if (x < 1) { } </span></div>');
- }
- function renderCommand(command, function_obj) {
- var ret = '';
- 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>';
- ret += '<span class="span_command_spec"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__["LocalizedStrings"].getUI('text_if') + '</span>';
- ret += ' <span class="span_command_spec"> ( </span> <div class="conditional_expression"></div> <span class="span_command_spec"> ) </span>';
- ret += '<span> </span> ';
- ret += '<div class="ui block_commands commands_if conditional_comands_block" data-if="true">';
- ret += '</div></div>';
- 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>';
- ret += '<div class="ui block_commands commands_else conditional_comands_block" data-else="true">';
- ret += '</div>';
- ret += '<span></span></div>';
- ret += '</div>';
- var el = $(ret);
- el.data('command', command);
- el.find('.block_commands').data('command', command);
- el.find('.data_block_if').data('command', command);
- el.find('.data_block_else').data('command', command);
- el.find('.commands_if').data('command', command);
- addHandlers(command, function_obj, el); //ConditionalExpressionManagement.renderExpression(command, command.expression, function_obj, el.find('.conditional_expression'));
- _generic_expression__WEBPACK_IMPORTED_MODULE_3__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
- if (command.commands_block) {
- for (var j = 0; j < command.commands_block.length; j++) {
- _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.commands_if')[0]), 3, function_obj);
- }
- }
- if (command.commands_else) {
- for (var j = 0; j < command.commands_else.length; j++) {
- _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_else[j], $(el.find('.commands_else')[0]), 3, function_obj);
- }
- }
- return el;
- }
- function addHandlers(command, function_obj, iftrue_dom) {
- iftrue_dom.find('.button_remove_command').on('click', function () {
- if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, iftrue_dom)) {
- iftrue_dom.fadeOut(400, function () {
- iftrue_dom.remove();
- });
- }
- });
- }
- /***/ }),
- /***/ "./js/visualUI/commands/reader.js":
- /*!****************************************!*\
- !*** ./js/visualUI/commands/reader.js ***!
- \****************************************/
- /*! exports provided: createFloatingCommand, renderCommand */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
- /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
- function createFloatingCommand() {
- 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>');
- }
- function renderCommand(command, function_obj) {
- 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>';
- el = $(el);
- el.data('command', command);
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_1__["renderMenu"](command, command.variable_value_menu, el.find('.var_value_menu_div'), function_obj);
- addHandlers(command, function_obj, el);
- return el;
- }
- function addHandlers(command, function_obj, reader_dom) {
- reader_dom.find('.button_remove_command').on('click', function () {
- if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, reader_dom)) {
- reader_dom.fadeOut(400, function () {
- reader_dom.remove();
- });
- }
- });
- }
- /***/ }),
- /***/ "./js/visualUI/commands/repeatNtimes.js":
- /*!**********************************************!*\
- !*** ./js/visualUI/commands/repeatNtimes.js ***!
- \**********************************************/
- /*! exports provided: createFloatingCommand, renderCommand, manageExpressionElements, manageClearExpressionElements */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageExpressionElements", function() { return manageExpressionElements; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "manageClearExpressionElements", function() { return manageClearExpressionElements; });
- /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
- /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
- /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
- /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
- /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
- function createFloatingCommand() {
- 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>');
- }
- function renderCommand(command, function_obj) {
- 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>'");
- ret += '<div class="ui block_commands">';
- ret += '</div>';
- ret += '<span> </span>';
- ret += '</div>';
- var el = $(ret);
- el.data('command', command);
- el.find('.block_commands').data('command', command);
- addHandlers(command, function_obj, el);
- _contextualized_menu__WEBPACK_IMPORTED_MODULE_5__["renderMenu"](command, el.find('.context_menu'), function_obj, el);
- _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'));
- _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);
- //VariableValueMenu.renderMenu(command, command.var_incrementation, el.find('.incrementation_variable'), function_obj);
- //angle double right
- if (!command.expression1) {
- 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);
- }
- el.find('.text_receives').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_for_from"));
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression1, el.find('.var_value_expression'), function_obj);
- if (!command.expression3) {
- 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>');
- el.find('.pass_button').find('button').on('click', function () {
- togglePasso(command);
- });
- /*var exp = new Models.ExpressionElement(Models.EXPRESSION_ELEMENTS.exp_op_exp,
- [command.var_attribution,
- Models.ARITHMETIC_TYPES.plus,
- new Models.VariableValueMenu(VariableValueMenu.VAR_OR_VALUE_TYPES.all, "1", null, null, true)]);
- command.expression3 = exp;
- command.var_incrementation = command.var_attribution;*/
- } else {
- 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>');
- el.find('.pass_button').find('button').on('click', function () {
- togglePasso(command);
- });
- renderOperator(command, function_obj, el.find('.operator'), command.expression3, 1);
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[2], el.find('.second_operand'), function_obj);
- }
- if (command.commands_block) {
- for (var j = 0; j < command.commands_block.length; j++) {
- _commands__WEBPACK_IMPORTED_MODULE_2__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
- }
- }
- return el;
- }
- function togglePasso(command) {
- if (!command.expression3) {
- 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)]);
- command.expression3 = exp;
- command.var_incrementation = command.var_attribution;
- } else {
- command.expression3 = null;
- }
- renderAlgorithm();
- }
- function manageExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element) {
- if (dom_object.hasClass('variable_attribution')) {
- if (!command.expression3) {
- 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)]);
- command.expression3 = exp;
- command.var_incrementation = command.var_attribution;
- 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);
- command.expression2.expression = cond_exp;
- }
- dom_object.parent().find('.text_receives').text('de');
- 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);
- dom_object.parent().find('.var_value_expression').empty();
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression1, dom_object.parent().find('.var_value_expression'), function_obj);
- renderAlgorithm();
- }
- if (dom_object.hasClass('incrementation_variable')) {
- dom_object.parent().find('.text_inc_receives').text('de');
- 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)]);
- command.expression3 = exp;
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[0], dom_object.parent().find('.first_operand'), function_obj);
- renderOperator(command, function_obj, dom_object.parent().find('.operator'), command.expression3, 1);
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_4__["renderMenu"](command, command.expression3.itens[2], dom_object.parent().find('.second_operand'), function_obj);
- }
- }
- function manageClearExpressionElements(command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element) {
- if (dom_object.hasClass('variable_attribution')) {
- $(dom_object).parent().find('.text_receives').text('');
- command.expression1 = null;
- $(dom_object).parent().find('.var_value_expression').empty();
- }
- if (dom_object.hasClass('incrementation_variable')) {
- $(dom_object).parent().find('.text_inc_receives').text('');
- command.expression3 = null;
- $(dom_object).parent().find('.first_operand').empty();
- $(dom_object).parent().find('.operator').empty();
- $(dom_object).parent().find('.second_operand').empty();
- }
- }
- function addHandlers(command, function_obj, repeatNtimes_dom) {
- repeatNtimes_dom.find('.button_remove_command').on('click', function () {
- if (_commands__WEBPACK_IMPORTED_MODULE_2__["removeCommand"](command, function_obj, repeatNtimes_dom)) {
- repeatNtimes_dom.fadeOut(400, function () {
- repeatNtimes_dom.remove();
- });
- }
- });
- }
- function renderOperator(command, function_obj, temp_op, expression_element, index_op) {
- var menu_operator = $('<div class="ui dropdown"><div class="text"></div></div>');
- menu_operator.dropdown({
- values: [{
- name: '+',
- value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus,
- selected: expression_element.itens[index_op] == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].plus
- }, {
- name: '-',
- value: _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus,
- selected: expression_element.itens[index_op] == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["ARITHMETIC_TYPES"].minus
- }],
- onChange: function onChange(value, text, $selectedItem) {
- expression_element.itens[index_op] = value;
- }
- });
- temp_op.append(menu_operator);
- }
- /***/ }),
- /***/ "./js/visualUI/commands/return.js":
- /*!****************************************!*\
- !*** ./js/visualUI/commands/return.js ***!
- \****************************************/
- /*! exports provided: createFloatingCommand, renderCommand */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
- /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types */ "./js/visualUI/types.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
- /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
- /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
- /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
- function createFloatingCommand() {
- 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>');
- }
- function renderCommand(command, function_obj) {
- 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>');
- el.data('command', command);
- addHandlers(command, function_obj, el);
- if (function_obj.return_type != _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID) {
- if (!command.variable_value_menu) {
- command.variable_value_menu = [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_5__["VariableValueMenu"](_variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)];
- }
- _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.expression_elements'), command.variable_value_menu);
- } else {
- el.find('.expression_elements').remove();
- command.variable_value_menu = null;
- }
- return el;
- }
- function addHandlers(command, function_obj, return_dom) {
- return_dom.find('.button_remove_command').on('click', function () {
- if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, return_dom)) {
- return_dom.fadeOut(400, function () {
- return_dom.remove();
- });
- }
- });
- }
- /***/ }),
- /***/ "./js/visualUI/commands/switch.js":
- /*!****************************************!*\
- !*** ./js/visualUI/commands/switch.js ***!
- \****************************************/
- /*! exports provided: createFloatingCommand, renderCommand, renderCase */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCase", function() { return renderCase; });
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
- /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
- /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
- function createFloatingCommand() {
- 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>');
- }
- function renderCommand(command, function_obj) {
- var ret = '';
- 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>';
- ret += '</div>';
- var el = $(ret);
- el.data('command', command);
- addHandlers(command, function_obj, el);
- _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__["renderMenu"](command, el.find('.context_menu'), function_obj, el);
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, command.variable, el.find('.variable_to_switch'), function_obj);
- if (command.cases) {
- for (var i = 0; i < command.cases.length; i++) {
- renderCase(command.cases[i], command, function_obj, el.find('.all_cases_div'));
- }
- }
- return el;
- }
- function renderCase(switchcase, command, function_obj, el) {
- 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>');
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, switchcase.variable_value_menu, casediv.find('.variable_case'), function_obj);
- casediv.data('switchcase', switchcase);
- casediv.find('.case_commands_block').data('switchcase', switchcase);
- el.append(casediv);
- if (switchcase.commands_block) {
- for (var j = 0; j < switchcase.commands_block.length; j++) {
- _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](switchcase.commands_block[j], $(casediv.find('.case_commands_block')[0]), 3, function_obj);
- }
- }
- casediv.find('.button_remove_command').on('click', function () {
- for (var i = 0; i < command.cases.length; i++) {
- if (switchcase == command.cases[i]) {
- delete command.cases[i];
- command.cases.splice(i, 1);
- casediv.remove();
- break;
- }
- }
- });
- }
- function addHandlers(command, function_obj, switch_dom) {
- switch_dom.find('.button_remove_command').on('click', function () {
- if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, switch_dom)) {
- switch_dom.fadeOut(400, function () {
- switch_dom.remove();
- });
- }
- });
- }
- /***/ }),
- /***/ "./js/visualUI/commands/variable_value_menu.js":
- /*!*****************************************************!*\
- !*** ./js/visualUI/commands/variable_value_menu.js ***!
- \*****************************************************/
- /*! exports provided: VAR_OR_VALUE_TYPES, renderMenu */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VAR_OR_VALUE_TYPES", function() { return VAR_OR_VALUE_TYPES; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderMenu", function() { return renderMenu; });
- /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _attribution__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./attribution */ "./js/visualUI/commands/attribution.js");
- /* harmony import */ var _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./repeatNtimes */ "./js/visualUI/commands/repeatNtimes.js");
- var VAR_OR_VALUE_TYPES = Object.freeze({
- only_variable: 1,
- only_value: 2,
- only_function: 3,
- variable_and_function: 4,
- variable_and_value_opt: 5,
- value_and_function: 6,
- all: 7
- });
- function renderMenu(command, ref_object, dom_object, function_obj) {
- var size_field = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 2;
- var expression_element = arguments.length > 5 ? arguments[5] : undefined;
- // Verificar se o objeto atual trata-se de uma chamada de função e conferir se possui a quantidade correta de parâmetros
- // Caso não possua, tem que adicionar as variáveis que servirão de parâmetros:
- if (ref_object.function_called) {
- if (ref_object.function_called.parameters_list) {
- while (ref_object.function_called.parameters_list.length != ref_object.parameters_list.length) {
- if (ref_object.parameters_list.length > ref_object.function_called.parameters_list.length) {
- ref_object.parameters_list.pop();
- } else {
- ref_object.parameters_list.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true));
- }
- }
- }
- }
- 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">';
- if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_variable) {
- 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">';
- menu_var_or_value += "</div>";
- }
- 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) {
- 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");
- menu_var_or_value += '<div class="menu menu_only_vars">';
- menu_var_or_value += "</div></div>";
- }
- if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_value) {
- menu_var_or_value = '<input type="text" class="width-dynamic" size="' + size_field + '" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />';
- }
- 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) {
- 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>";
- }
- if (ref_object.variable_and_value == VAR_OR_VALUE_TYPES.only_function) {
- 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">';
- menu_var_or_value += "</div>";
- }
- 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) {
- 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");
- menu_var_or_value += '<div class="menu menu_only_functions">';
- menu_var_or_value += "</div></div>";
- /* if (command.type == Models.COMMAND_TYPES.attribution) {
- menu_var_or_value += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
- menu_var_or_value += '<div class="menu">';
- menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
- menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
- menu_var_or_value += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
- menu_var_or_value += '</div></div>';
- }*/
- }
- menu_var_or_value += "</div></div>";
- menu_var_or_value = $(menu_var_or_value);
- menu_var_or_value.find('.width-dynamic').on('input', function () {
- var input_field = $(this);
- var inputWidth = input_field.textWidth() + 10;
- inputWidth = inputWidth < 50 ? 50 : inputWidth;
- input_field.css({
- width: inputWidth
- });
- }).trigger('input');
- dom_object.append(menu_var_or_value);
- ref_object.dom_object = menu_var_or_value;
- addHandlers(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
- addVariablesToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
- addFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
- addIVProgFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element);
- if (ref_object.content || ref_object.function_called) {
- if (ref_object.content) {
- // Verificar se a variável ainda existe:
- var variable_fun = isVarInProgram(ref_object.content, function_obj);
- if (variable_fun) {
- ref_object.content = variable_fun;
- renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
- } else {
- if (ref_object.content && ref_object.content.type) {
- ref_object.content = null;
- appendSelectText(ref_object, menu_var_or_value);
- } else {
- renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
- }
- }
- } else if (ref_object.function_called) {
- // Verificar se a função ainda existe:
- var ret_function = isFunctionInProgram(ref_object.function_called);
- if (ret_function) {
- ref_object.function_called = ret_function;
- renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element);
- } else {
- ref_object.content = null;
- ref_object.row = null;
- ref_object.column = null;
- delete ref_object.function_called;
- delete ref_object.parameters_list;
- appendSelectText(ref_object, menu_var_or_value);
- }
- }
- } else {
- appendSelectText(ref_object, menu_var_or_value);
- }
- }
- function appendSelectText(ref_object, menu_var_or_value) {
- switch (ref_object.variable_and_value) {
- case VAR_OR_VALUE_TYPES.only_variable:
- menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_var") + "</i>");
- break;
- case VAR_OR_VALUE_TYPES.all:
- menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_all") + "</i>");
- break;
- case VAR_OR_VALUE_TYPES.variable_and_function:
- menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_all") + "</i>");
- break;
- case VAR_OR_VALUE_TYPES.only_function:
- menu_var_or_value.find(".text").append("<i>" + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("var_menu_select_function") + "</i>");
- break;
- }
- }
- function isFunctionInProgram(function_called_obj) {
- if (function_called_obj.name) {
- if (window.program_obj.functions) {
- for (var i = 0; i < window.program_obj.functions.length; i++) {
- if (window.program_obj.functions[i] == function_called_obj) {
- return window.program_obj.functions[i];
- }
- }
- for (var i = 0; i < window.program_obj.functions.length; i++) {
- if (window.program_obj.functions[i].name == function_called_obj.name) {
- return window.program_obj.functions[i];
- }
- }
- }
- } else if (function_called_obj.identifier) {
- for (var i = 0; i < window.system_functions.length; i++) {
- if (window.system_functions[i].identifier == function_called_obj.identifier) {
- return window.system_functions[i];
- }
- }
- }
- return null;
- }
- function isVarInProgram(var_obj, function_obj) {
- // Verify in locals:
- if (function_obj.variables_list) {
- for (var i = 0; i < function_obj.variables_list.length; i++) {
- if (function_obj.variables_list[i] == var_obj) {
- return function_obj.variables_list[i];
- }
- }
- } // Verify in parameters:
- if (function_obj.parameters_list) {
- for (var i = 0; i < function_obj.parameters_list.length; i++) {
- if (function_obj.parameters_list[i] == var_obj) {
- return function_obj.parameters_list[i];
- }
- }
- } // Verify in globals:
- if (window.program_obj.globals) {
- for (var i = 0; i < window.program_obj.globals.length; i++) {
- if (window.program_obj.globals[i] == var_obj) {
- return window.program_obj.globals[i];
- }
- }
- } // If not found, verify if the reference was lost
- if (var_obj) {
- if (function_obj.variables_list) {
- for (var i = 0; i < function_obj.variables_list.length; i++) {
- if (function_obj.variables_list[i].name == var_obj.name) {
- return function_obj.variables_list[i];
- }
- }
- }
- if (function_obj.parameters_list) {
- for (var i = 0; i < function_obj.parameters_list.length; i++) {
- if (function_obj.parameters_list[i].name == var_obj.name) {
- return function_obj.parameters_list[i];
- }
- }
- }
- if (window.program_obj.globals) {
- for (var i = 0; i < window.program_obj.globals.length; i++) {
- if (window.program_obj.globals[i].name == var_obj.name) {
- return window.program_obj.globals[i];
- }
- }
- }
- }
- return null;
- }
- function renderPreviousContent(function_obj, menu_var_or_value, ref_object, dom_object, command, expression_element) {
- if (ref_object.function_called) {
- menu_var_or_value.remove();
- variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
- } else if (ref_object.content.type) {
- menu_var_or_value.remove();
- variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
- } else {
- menu_var_or_value.remove();
- variableValueMenuCode(command, ref_object, dom_object, function_obj, menu_var_or_value, expression_element);
- }
- }
- function variableValueMenuCode(command, variable_obj, dom_object, function_obj, menu_var_or_value, expression_element) {
- if (variable_obj.content || variable_obj.function_called) {
- // Verificar se a variável ainda existe:
- var var_fun = isVarInProgram(variable_obj.content, function_obj);
- if (var_fun) {
- variable_obj.content = var_fun;
- } else {
- if (variable_obj.content && variable_obj.content.type) {
- variable_obj.content = null;
- appendSelectText(variable_obj, menu_var_or_value);
- }
- }
- } else {
- appendSelectText(variable_obj, menu_var_or_value);
- }
- if (variable_obj.content == null && variable_obj.function_called == null) {
- renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
- return;
- }
- var ret = "";
- if (variable_obj.function_called) {
- if (variable_obj.function_called.parameters_list == null || variable_obj.function_called.length == 0) {
- menu_var_or_value.find(".text").text(" ");
- dom_object.find(".menu_var_or_value_dom").remove();
- var parameters_menu;
- if (variable_obj.function_called.name) {
- parameters_menu = '<div class="parameters_function_called"> ' + variable_obj.function_called.name + " <span> ( </span>";
- } else {
- 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>";
- }
- parameters_menu += "<span> ) </span></div>";
- parameters_menu = $(parameters_menu);
- dom_object.append(parameters_menu);
- var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
- context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
- /*if (command.type == Models.COMMAND_TYPES.attribution) {
- context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
- context_menu += '<div class="menu">';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
- context_menu += '</div></div>';
- }*/
- context_menu += "</div></div>";
- context_menu = $(context_menu);
- context_menu.insertAfter(dom_object.find(".parameters_function_called"));
- context_menu.dropdown({
- onChange: function onChange(value, text, $selectedItem) {
- console.log("S1");
- if ($selectedItem.data("clear")) {
- console.log("PP1");
- dom_object.text("");
- variable_obj.content = null;
- variable_obj.row = null;
- variable_obj.column = null;
- delete variable_obj.function_called;
- delete variable_obj.parameters_list;
- renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
- }
- if ($selectedItem.data("exp")) {
- _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
- }
- },
- selectOnKeydown: false
- });
- } else {
- menu_var_or_value.find(".text").text(" ");
- dom_object.find(".menu_var_or_value_dom").remove();
- var parameters_menu;
- if (variable_obj.function_called.name) {
- parameters_menu = '<div class="parameters_function_called"> ' + variable_obj.function_called.name + " <span> ( </span>";
- } else {
- 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>";
- }
- for (var j = 0; j < variable_obj.function_called.parameters_list.length; j++) {
- parameters_menu += '<div class="render_style_param parameter_' + j + '"></div>';
- if (j + 1 != variable_obj.function_called.parameters_list.length) {
- parameters_menu += " , ";
- }
- }
- parameters_menu += "<span> ) </span></div>";
- parameters_menu = $(parameters_menu);
- dom_object.append(parameters_menu);
- for (var _j = 0; _j < variable_obj.function_called.parameters_list.length; _j++) {
- renderMenu(command, variable_obj.parameters_list[_j], parameters_menu.find(".parameter_" + _j), function_obj, 2, expression_element);
- }
- var _context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
- _context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
- /*if (command.type == Models.COMMAND_TYPES.attribution) {
- context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
- context_menu += '<div class="menu">';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
- context_menu += '</div></div>';
- }*/
- _context_menu += "</div></div>";
- _context_menu = $(_context_menu);
- _context_menu.insertAfter(parameters_menu);
- _context_menu.dropdown({
- onChange: function onChange(value, text, $selectedItem) {
- console.log("S2");
- if ($selectedItem.data("clear")) {
- console.log("PP2");
- dom_object.text("");
- variable_obj.content = null;
- variable_obj.row = null;
- variable_obj.column = null;
- delete variable_obj.function_called;
- delete variable_obj.parameters_list;
- renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
- }
- if ($selectedItem.data("exp")) {
- _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
- }
- },
- selectOnKeydown: false
- });
- }
- } else if (variable_obj.content.type) {
- var variable_render = "";
- if (variable_obj.content.dimensions == 1 && variable_obj.dimensions != 1) {
- variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + "</span>";
- variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
- variable_render += "</div>";
- variable_render = $(variable_render);
- dom_object.append(variable_render);
- var _context_menu2 = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
- _context_menu2 += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
- /*if (command.type == Models.COMMAND_TYPES.attribution) {
- context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
- context_menu += '<div class="menu">';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
- context_menu += '</div></div>';
- }*/
- _context_menu2 += "</div></div>";
- _context_menu2 = $(_context_menu2);
- variable_render.append(_context_menu2);
- _context_menu2.dropdown({
- onChange: function onChange(value, text, $selectedItem) {
- console.log("S3");
- if ($selectedItem.data("clear")) {
- console.log("PP3");
- dom_object.text("");
- variable_obj.content = null;
- variable_obj.row = null;
- variable_obj.column = null;
- delete variable_obj.function_called;
- delete variable_obj.parameters_list;
- renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
- }
- if ($selectedItem.data("exp")) {
- _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
- }
- },
- selectOnKeydown: false
- });
- if (!variable_obj.column) {
- variable_obj.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
- }
- variableValueMenuCode(command, variable_obj.column, $(variable_render.find(".column_container")), function_obj, menu_var_or_value, expression_element);
- } else if (variable_obj.content.dimensions == 2 && variable_obj.dimensions != 2) {
- variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + "</span>";
- variable_render += ' <span>[ </span> <div class="row_container"></div> <span> ]</span>';
- variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ] </span>';
- variable_render += "</div>";
- variable_render = $(variable_render);
- dom_object.append(variable_render);
- var _context_menu3 = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
- _context_menu3 += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
- /*if (command.type == Models.COMMAND_TYPES.attribution) {
- context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
- context_menu += '<div class="menu">';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
- context_menu += '</div></div>';
- }*/
- _context_menu3 += "</div></div>";
- _context_menu3 = $(_context_menu3);
- variable_render.append(_context_menu3);
- _context_menu3.dropdown({
- onChange: function onChange(value, text, $selectedItem) {
- console.log("S4");
- if ($selectedItem.data("clear")) {
- console.log("PP4");
- dom_object.text("");
- variable_obj.content = null;
- variable_obj.row = null;
- variable_obj.column = null;
- delete variable_obj.function_called;
- delete variable_obj.parameters_list;
- renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
- }
- if ($selectedItem.data("exp")) {
- _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
- }
- },
- selectOnKeydown: false
- });
- if (!variable_obj.column) {
- variable_obj.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
- }
- if (!variable_obj.row) {
- variable_obj.row = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
- }
- variableValueMenuCode(command, variable_obj.row, $(variable_render.find(".row_container")), function_obj, menu_var_or_value, expression_element);
- variableValueMenuCode(command, variable_obj.column, $(variable_render.find(".column_container")), function_obj, menu_var_or_value, expression_element);
- } else {
- variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_obj.content.name + "</span>";
- variable_render += "</div>";
- variable_render = $(variable_render);
- dom_object.append(variable_render);
- var _context_menu4 = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
- _context_menu4 += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
- /*if (command.type == Models.COMMAND_TYPES.attribution && !dom_object.hasClass('var_attributed')) {
- console.log('dom_object6');
- console.log(dom_object);
- context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
- context_menu += '<div class="menu">';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
- context_menu += '</div></div>';
- }*/
- _context_menu4 += "</div></div>";
- _context_menu4 = $(_context_menu4);
- variable_render.append(_context_menu4);
- _context_menu4.dropdown({
- onChange: function onChange(value, text, $selectedItem) {
- console.log("S5");
- if ($selectedItem.data("clear")) {
- console.log("PP5");
- dom_object.text("");
- variable_obj.content = null;
- variable_obj.row = null;
- variable_obj.column = null;
- delete variable_obj.function_called;
- delete variable_obj.parameters_list;
- renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
- }
- if ($selectedItem.data("exp")) {
- _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
- }
- },
- selectOnKeydown: false
- });
- }
- } else {
- var _variable_render;
- _variable_render = '<div class="variable_rendered"> <span class="var_name">';
- if (isNaN(variable_obj.content)) {
- _variable_render += variable_obj.content.replaceAll(" ", " ");
- } else {
- _variable_render += variable_obj.content;
- }
- _variable_render += "</span>";
- _variable_render += "</div>";
- _variable_render = $(_variable_render);
- dom_object.append(_variable_render);
- var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
- context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
- /*if (command.type == Models.COMMAND_TYPES.attribution) {
- context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
- context_menu += '<div class="menu">';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
- context_menu += '</div></div>';
- }*/
- context_menu += "</div></div>";
- context_menu = $(context_menu);
- if (variable_obj.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
- context_menu.insertAfter(_variable_render);
- }
- context_menu.dropdown({
- onChange: function onChange(value, text, $selectedItem) {
- console.log("S6");
- if ($selectedItem.data("clear")) {
- console.log("PP6");
- dom_object.text("");
- variable_obj.content = null;
- variable_obj.row = null;
- variable_obj.column = null;
- delete variable_obj.function_called;
- delete variable_obj.parameters_list;
- dom_object.find(".value_rendered").remove();
- dom_object.find(".context_menu_clear").remove();
- dom_object.find(".width-dynamic-minus").remove();
- renderMenu(command, variable_obj, dom_object, function_obj, 2, expression_element);
- }
- if ($selectedItem.data("exp")) {
- _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, variable_obj, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
- }
- },
- selectOnKeydown: false
- });
- _variable_render.on("click", function (e) {
- _variable_render.remove();
- _variable_render.empty();
- _variable_render.remove();
- dom_object.empty();
- dom_object.append('<span class="menu_var_or_value_dom"> </span>');
- openInputToValue(command, variable_obj, dom_object, menu_var_or_value, function_obj, expression_element);
- });
- }
- }
- function addIVProgFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
- var sub_menu = menu_var_or_value.find(".menu_only_functions");
- sub_menu.append('<div class="divider"></div><div class="header">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_header_ivprog_functions") + "</div>");
- 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>');
- 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>');
- 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>');
- 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:
- for (var i = 0; i < window.system_functions.length; i++) {
- var t = $('<div class="item"></div>');
- t.data("function_reference", window.system_functions[i]);
- t.data("option", VAR_OR_VALUE_TYPES.only_function);
- t.text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].translateInternalFunction(window.system_functions[i].identifier));
- switch (window.system_functions[i].category) {
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].math:
- sub_menu.find(".menu_math_functions").append(t);
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].text:
- sub_menu.find(".menu_text_functions").append(t);
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].arrangement:
- sub_menu.find(".menu_arrangement_functions").append(t);
- break;
- case _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["SYSTEM_FUNCTIONS_CATEGORIES"].conversion:
- sub_menu.find(".menu_conversion_functions").append(t);
- break;
- }
- }
- }
- function addFunctionsToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
- var sub_menu = menu_var_or_value.find(".menu_only_functions");
- sub_menu.text("");
- for (var i = 0; i < window.program_obj.functions.length; i++) {
- var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_function + '">' + window.program_obj.functions[i].name + " </div>");
- temp.data("function_reference", window.program_obj.functions[i]);
- sub_menu.append(temp);
- }
- }
- function addVariablesToMenu(function_obj, menu_var_or_value, ref_object, expression_element) {
- var sub_menu = menu_var_or_value.find(".menu_only_vars");
- sub_menu.text("");
- var is_there = false;
- if (window.program_obj.globals) {
- if (ref_object.include_constant) {
- for (var i = 0; i < window.program_obj.globals.length; i++) {
- var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + window.program_obj.globals[i].name + " </div>");
- temp.data("variable_reference", window.program_obj.globals[i]);
- sub_menu.append(temp);
- is_there = true;
- }
- } else {
- for (var i = 0; i < window.program_obj.globals.length; i++) {
- if (!window.program_obj.globals[i].is_constant) {
- var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + window.program_obj.globals[i].name + " </div>");
- temp.data("variable_reference", window.program_obj.globals[i]);
- sub_menu.append(temp);
- is_there = true;
- }
- }
- }
- }
- if (function_obj.parameters_list) {
- for (var i = 0; i < function_obj.parameters_list.length; i++) {
- var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + function_obj.parameters_list[i].name + " </div>");
- temp.data("variable_reference", function_obj.parameters_list[i]);
- sub_menu.append(temp);
- is_there = true;
- }
- }
- if (function_obj.variables_list) {
- for (var i = 0; i < function_obj.variables_list.length; i++) {
- var temp = $('<div class="item" data-option="' + VAR_OR_VALUE_TYPES.only_variable + '">' + function_obj.variables_list[i].name + " </div>");
- temp.data("variable_reference", function_obj.variables_list[i]);
- sub_menu.append(temp);
- is_there = true;
- }
- }
- if (!is_there) {
- sub_menu.append($('<div class="header">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_no_variable") + "</div>"));
- sub_menu.append($('<div class="item disabled">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_no_variable_instruction") + "</div>"));
- }
- }
- function addHandlers(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element) {
- if (ref_object.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
- menu_var_or_value.dropdown({
- onChange: function onChange(value, text, $selectedItem) {
- console.log("S7");
- dom_object.find(".var_name").remove();
- switch ($selectedItem.data("option")) {
- case VAR_OR_VALUE_TYPES.only_function:
- openInputToFunction(command, ref_object, dom_object, menu_var_or_value, function_obj, $($selectedItem).data("function_reference"), expression_element);
- break;
- case VAR_OR_VALUE_TYPES.only_value:
- openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
- break;
- case VAR_OR_VALUE_TYPES.only_variable:
- openInputToVariable(command, ref_object, dom_object, menu_var_or_value, function_obj, $($selectedItem).data("variable_reference"), expression_element);
- break;
- }
- if ($selectedItem.data("exp")) {
- _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
- }
- if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes) {
- _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
- }
- },
- selectOnKeydown: false
- });
- }
- dom_object.find(".width-dynamic").on("input", function () {
- var inputWidth = $(this).textWidth() + 10;
- $(this).focus();
- var tmpStr = $(this).val();
- $(this).val("");
- $(this).val(tmpStr);
- $(this).css({
- width: inputWidth
- });
- }).trigger("input");
- if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment) {
- dom_object.parent().on("click", function (e) {
- dom_object.find(".value_rendered").remove();
- dom_object.find(".value_rendered").empty();
- dom_object.find(".value_rendered").remove();
- dom_object.empty();
- dom_object.append('<span class="menu_var_or_value_dom"> </span>');
- openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
- });
- }
- }
- function openInputToFunction(command, ref_object, dom_object, menu_var_or_value, function_obj, function_selected, expression_element) {
- ref_object.function_called = function_selected;
- ref_object.parameters_list = [];
- if (function_selected.parameters_list != null && function_selected.parameters_list.length > 0) {
- menu_var_or_value.find(".text").text(" ");
- dom_object.find(".menu_var_or_value_dom").remove();
- var parameters_menu;
- if (function_selected.name) {
- parameters_menu = '<div class="parameters_function_called"> ' + function_selected.name + " <span> ( </span>";
- } else {
- 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>";
- }
- for (var j = 0; j < function_selected.parameters_list.length; j++) {
- parameters_menu += '<div class="render_style_param parameter_' + j + '"></div>';
- if (j + 1 != function_selected.parameters_list.length) {
- parameters_menu += " , ";
- }
- }
- parameters_menu += "<span> ) </span></div>";
- parameters_menu = $(parameters_menu);
- dom_object.append(parameters_menu);
- for (var j = 0; j < function_selected.parameters_list.length; j++) {
- var temp;
- if (function_selected.parameters_list[j].dimensions > 0) {
- 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);
- } else {
- temp = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
- }
- ref_object.parameters_list.push(temp);
- renderMenu(command, temp, parameters_menu.find(".parameter_" + j), function_obj, 2, expression_element);
- }
- var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
- context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
- /*if (command.type == Models.COMMAND_TYPES.attribution) {
- context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
- context_menu += '<div class="menu">';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
- context_menu += '</div></div>';
- }*/
- context_menu += "</div></div>";
- context_menu = $(context_menu);
- context_menu.insertAfter(dom_object.find(".parameters_function_called"));
- context_menu.dropdown({
- onChange: function onChange(value, text, $selectedItem) {
- console.log("S8");
- if ($selectedItem.data("clear")) {
- console.log("PP7");
- dom_object.text("");
- ref_object.content = null;
- ref_object.row = null;
- ref_object.column = null;
- delete ref_object.function_called;
- delete ref_object.parameters_list;
- renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
- }
- if ($selectedItem.data("exp")) {
- _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
- }
- },
- selectOnKeydown: false
- });
- } else {
- menu_var_or_value.find(".text").text(" ");
- dom_object.find(".menu_var_or_value_dom").remove();
- var parameters_menu;
- if (function_selected.name) {
- parameters_menu = '<div class="parameters_function_called"> ' + function_selected.name + " <span> ( </span>";
- } else {
- 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>";
- }
- parameters_menu += "<span> ) </span></div>";
- parameters_menu = $(parameters_menu);
- dom_object.append(parameters_menu);
- var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
- context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
- /*if (command.type == Models.COMMAND_TYPES.attribution) {
- context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
- context_menu += '<div class="menu">';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
- context_menu += '</div></div>';
- }*/
- context_menu += "</div></div>";
- context_menu = $(context_menu);
- context_menu.insertAfter(dom_object.find(".parameters_function_called"));
- context_menu.dropdown({
- onChange: function onChange(value, text, $selectedItem) {
- console.log("S9");
- if ($selectedItem.data("clear")) {
- console.log("PP8");
- dom_object.text("");
- ref_object.content = null;
- ref_object.row = null;
- ref_object.column = null;
- delete ref_object.function_called;
- delete ref_object.parameters_list;
- renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
- }
- if ($selectedItem.data("exp")) {
- _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
- }
- },
- selectOnKeydown: false
- });
- }
- /*if (command.type == Models.COMMAND_TYPES.attribution) {
- AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj);
- }*/
- }
- function openInputToVariable(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected, expression_element) {
- ref_object.content = variable_selected;
- menu_var_or_value.find(".text").text(" ");
- dom_object.find(".menu_var_or_value_dom").remove();
- var variable_render = '<div class="variable_rendered"> <span class="var_name">' + variable_selected.name + "</span>";
- if (variable_selected.dimensions == 1 && ref_object.dimensions != 1) {
- variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
- }
- if (variable_selected.dimensions == 2 && ref_object.dimensions != 2) {
- variable_render += ' <span>[ </span> <div class="row_container"></div> <span> ]</span> ';
- variable_render += ' <span>[ </span> <div class="column_container"></div> <span> ]</span>';
- }
- variable_render += "</div>";
- variable_render = $(variable_render);
- dom_object.append(variable_render);
- if (variable_selected.dimensions == 1 && ref_object.dimensions != 1) {
- ref_object.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
- renderMenu(command, ref_object.column, variable_render.find(".column_container"), function_obj, 2, expression_element);
- }
- if (variable_selected.dimensions == 2 && ref_object.dimensions != 2) {
- ref_object.row = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
- renderMenu(command, ref_object.row, variable_render.find(".row_container"), function_obj, 2, expression_element);
- ref_object.column = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["VariableValueMenu"](VAR_OR_VALUE_TYPES.all, null, null, null, true);
- renderMenu(command, ref_object.column, variable_render.find(".column_container"), function_obj, 2, expression_element);
- }
- var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
- context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
- /*if (command.type == Models.COMMAND_TYPES.attribution && !dom_object.hasClass('var_attributed')) {
- console.log("dom_object 10: ");
- console.log(dom_object);
- context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
- context_menu += '<div class="menu">';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
- context_menu += '</div></div>';
- }*/
- context_menu += "</div></div>";
- context_menu = $(context_menu);
- context_menu.insertAfter(dom_object.find(".variable_rendered"));
- context_menu.dropdown({
- onChange: function onChange(value, text, $selectedItem) {
- console.log("S10");
- if ($selectedItem.data("clear")) {
- console.log("PP9");
- dom_object.text("");
- ref_object.content = null;
- ref_object.row = null;
- ref_object.column = null;
- delete ref_object.function_called;
- delete ref_object.parameters_list;
- renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
- }
- if ($selectedItem.data("exp")) {
- _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
- }
- if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].repeatNtimes) {
- _repeatNtimes__WEBPACK_IMPORTED_MODULE_3__["manageClearExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
- }
- },
- selectOnKeydown: false
- });
- /*if (command.type == Models.COMMAND_TYPES.attribution) {
- AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj, variable_selected);
- }*/
- }
- function openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element) {
- if (ref_object.content == null) {
- ref_object.content = "";
- }
- menu_var_or_value.find(".text").text(" ");
- var field = $('<input type="text" size="2" class="width-dynamic-minus" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />');
- field.insertBefore(dom_object.find(".menu_var_or_value_dom"));
- field.on('input', function () {
- var input_field = $(this);
- var inputWidth = input_field.textWidth() + 10;
- inputWidth = inputWidth < 50 ? 50 : inputWidth;
- input_field.css({
- width: inputWidth
- });
- }).trigger('input');
- var rendered = $('<div class="value_rendered"></div>');
- rendered.insertBefore(field);
- field.focus();
- field.val(ref_object.content);
- var context_menu = '<div class="ui dropdown context_menu_clear"><div class="text"></div><i class="dropdown icon"></i><div class="menu">';
- context_menu += '<div class="item" data-clear="true">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("btn_clear") + "</div>";
- /*if (command.type == Models.COMMAND_TYPES.attribution) {
- context_menu += '<div class="item"><i class="dropdown icon"></i>' + LocalizedStrings.getUI('text_change');
- context_menu += '<div class="menu">';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.exp_op_exp+'">EXP OP EXP</div>';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.op_exp+'">OP EXP</div>';
- context_menu += '<div class="item" data-exp="'+Models.EXPRESSION_ELEMENTS.par_exp_par+'">( EXP )</div>';
- context_menu += '</div></div>';
- }*/
- context_menu += "</div></div>";
- context_menu = $(context_menu);
- dom_object.find(".menu_var_or_value_dom").remove();
- if (ref_object.variable_and_value != VAR_OR_VALUE_TYPES.only_value) {
- context_menu.insertAfter(field);
- }
- context_menu.dropdown({
- onChange: function onChange(value, text, $selectedItem) {
- if ($selectedItem.data("clear")) {
- dom_object.text("");
- dom_object.find(".value_rendered").remove();
- dom_object.find(".context_menu_clear").remove();
- dom_object.find(".width-dynamic-minus").remove();
- ref_object.content = null;
- ref_object.row = null;
- ref_object.column = null;
- delete ref_object.function_called;
- delete ref_object.parameters_list;
- renderMenu(command, ref_object, dom_object, function_obj, 2, expression_element);
- }
- if ($selectedItem.data("exp")) {
- _attribution__WEBPACK_IMPORTED_MODULE_2__["manageExpressionElements"](command, ref_object, dom_object, menu_var_or_value, function_obj, $selectedItem, expression_element);
- }
- },
- selectOnKeydown: false
- });
- dom_object.find(".width-dynamic-minus").focusout(function () {
- /*if (
- $(this)
- .val()
- .trim()
- ) {
- ref_object.content = $(this)
- .val()
- .trim();
- }*/
- ref_object.content = $(this).val();
- if (isNaN(ref_object.content)) {
- rendered.html(ref_object.content.replaceAll(" ", " "));
- } else {
- rendered.text(ref_object.content);
- }
- $(this).remove();
- });
- dom_object.find(".width-dynamic-minus").on("keydown", function (e) {
- var code = e.keyCode || e.which;
- if (code == 13) {
- /*if (
- $(this)
- .val()
- .trim()
- ) {
- ref_object.content = $(this)
- .val()
- .trim();
- }*/
- ref_object.content = $(this).val();
- if (isNaN(ref_object.content)) {
- rendered.html(ref_object.content.replaceAll(" ", " "));
- } else {
- rendered.text(ref_object.content);
- }
- $(this).remove();
- }
- if (code == 27) {
- if (isNaN(ref_object.content)) {
- rendered.html(ref_object.content.replaceAll(" ", " "));
- } else {
- rendered.text(ref_object.content);
- }
- $(this).remove();
- }
- });
- if (command.type == _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__["COMMAND_TYPES"].comment) {
- /*rendered.parent().on('click', function(e) {
- rendered.parent().off();
- console.log("TTT14");
- rendered.remove();
- rendered.empty();
- rendered.remove();
- dom_object.empty();
- dom_object.append('<span class="menu_var_or_value_dom"> </span>');
- openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element)
- });*/
- }
- rendered.on("click", function (e) {
- console.log("TTT2");
- rendered.empty();
- rendered.remove();
- dom_object.empty();
- dom_object.append('<span class="menu_var_or_value_dom"> </span>');
- openInputToValue(command, ref_object, dom_object, menu_var_or_value, function_obj, expression_element);
- });
- /*if (command.type == Models.COMMAND_TYPES.attribution) {
- AttribuitionsManagement.renderMenuOperations(command, ref_object, dom_object, menu_var_or_value, function_obj);
- }*/
- }
- $.fn.textWidth = function (text, font) {
- if (!$.fn.textWidth.fakeEl) $.fn.textWidth.fakeEl = $("<span>").hide().appendTo(document.body);
- $.fn.textWidth.fakeEl.text(text || this.val() || this.text() || this.attr("placeholder")).css("font", font || this.css("font"));
- return $.fn.textWidth.fakeEl.width();
- };
- /***/ }),
- /***/ "./js/visualUI/commands/whiletrue.js":
- /*!*******************************************!*\
- !*** ./js/visualUI/commands/whiletrue.js ***!
- \*******************************************/
- /*! exports provided: createFloatingCommand, renderCommand */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
- /* harmony import */ var _conditional_expression__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./conditional_expression */ "./js/visualUI/commands/conditional_expression.js");
- /* harmony import */ var _contextualized_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./contextualized_menu */ "./js/visualUI/commands/contextualized_menu.js");
- /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
- function createFloatingCommand() {
- 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>');
- }
- function renderCommand(command, function_obj) {
- var ret = '';
- 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>';
- ret += '<span class="span_command_spec"> ( </span> <div class="conditional_expression"></div> <span class="span_command_spec"> ) </span>';
- ret += ' </span>';
- ret += '<div class="ui block_commands">';
- ret += '</div>';
- ret += '<span> </span>';
- ret += '</div>';
- var el = $(ret);
- el.data('command', command);
- el.find('.block_commands').data('command', command);
- addHandlers(command, function_obj, el);
- _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'));
- _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find('.conditional_expression'), command.expression);
- if (command.commands_block) {
- for (var j = 0; j < command.commands_block.length; j++) {
- _commands__WEBPACK_IMPORTED_MODULE_1__["renderCommand"](command.commands_block[j], $(el.find('.block_commands')[0]), 3, function_obj);
- }
- }
- return el;
- }
- function addHandlers(command, function_obj, whiletrue_dom) {
- whiletrue_dom.find('.button_remove_command').on('click', function () {
- if (_commands__WEBPACK_IMPORTED_MODULE_1__["removeCommand"](command, function_obj, whiletrue_dom)) {
- whiletrue_dom.fadeOut(400, function () {
- whiletrue_dom.remove();
- });
- }
- });
- }
- /***/ }),
- /***/ "./js/visualUI/commands/writer.js":
- /*!****************************************!*\
- !*** ./js/visualUI/commands/writer.js ***!
- \****************************************/
- /*! exports provided: createFloatingCommand, renderCommand, addContent */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFloatingCommand", function() { return createFloatingCommand; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderCommand", function() { return renderCommand; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addContent", function() { return addContent; });
- /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ivprog_elements */ "./js/visualUI/ivprog_elements.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
- /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../commands */ "./js/visualUI/commands.js");
- /* harmony import */ var _generic_expression__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_expression */ "./js/visualUI/commands/generic_expression.js");
- function createFloatingCommand() {
- 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>");
- }
- function renderCommand(command, function_obj) {
- var ret = "<div class=\"ui writer command_container\">\n <i class=\"ui icon small upload command_drag\"></i>\n <i class=\"ui icon times red button_remove_command\"></i>\n <span class=\"span_command_spec\">".concat(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("text_command_write"), "\n ( </span><div class=\"all_elements_write\"></div>\n <span class=\"close_parentheses span_command_spec\">)</span>\n <img data-state=\"").concat(command.newline ? "on" : "false", "\" src=\"").concat(command.newline ? "img/new_line.svg" : "img/no_new_line.svg", "\" class=\"ivprog_newline_btn\"/>\n </div>");
- var el = $(ret);
- el.data("command", command); //renderExpression (command, function_obj, div_to_render, expression_array)
- _generic_expression__WEBPACK_IMPORTED_MODULE_4__["renderExpression"](command, function_obj, el.find(".all_elements_write"), command.content);
- /*for (var i = 0; i < command.content.length; i ++) {
- var new_div_item = $( '<div class="var_value_menu_div"></div>' );
- var div_parent_with_handler = $( '<div class="div_parent_handler"></div>' );
- div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
- div_parent_with_handler.append(new_div_item);
- div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
- el.find('.all_elements_write').append(div_parent_with_handler);
- VariableValueMenu.renderMenu(command, command.content[i], new_div_item, function_obj);
- addHandlerIconAdd(el.find('.all_elements_write'), command, function_obj);
- addHandlersManager(command, function_obj, el, div_parent_with_handler, command.content[i]);
- }
- if (command.content.length == 0) {
- addHandlerIconAdd(el.find('.all_elements_write'), command, function_obj);
- }*/
- addHandlers(command, function_obj, el);
- return el;
- }
- function addHandlersManager(command, _function_obj, _writer_dom, item_div, content_element) {
- item_div.find(".times").on("click", function () {
- for (var i = 0; i < command.content.length; i++) {
- if (command.content[i] == content_element) {
- delete command.content[i];
- command.content.splice(i, 1);
- item_div.children().off();
- item_div.off();
- item_div.fadeOut();
- if (command.content.length > 0) {
- item_div.next(".icon_add_item_to_writer").fadeOut();
- }
- break;
- }
- }
- });
- }
- function addHandlers(command, function_obj, writer_dom) {
- writer_dom.find(".button_remove_command").on("click", function () {
- if (_commands__WEBPACK_IMPORTED_MODULE_3__["removeCommand"](command, function_obj, writer_dom)) {
- writer_dom.fadeOut(400, function () {
- writer_dom.remove();
- });
- }
- });
- Sortable.create(writer_dom.find(".all_elements_write")[0], {
- handle: ".ellipsis",
- animation: 100,
- ghostClass: "ghost",
- group: "writer_" + Math.floor(Math.random() * 10000000),
- draggable: ".div_parent_handler",
- onEnd: function onEnd(evt) {
- command.content.splice(evt.newIndex, 0, command.content.splice(evt.oldIndex, 1)[0]);
- writer_dom.empty();
- writer_dom.replaceWith(renderCommand(command, function_obj));
- }
- }); // Attach event handles for the newline button
- var newlineBtn = writer_dom.find(".ivprog_newline_btn");
- newlineBtn.on("click", function () {
- var state = this.dataset.state;
- if (state === "on") {
- this.dataset.state = "off";
- command.newline = false;
- this.setAttribute("src", "img/no_new_line.svg");
- } else {
- this.dataset.state = "on";
- command.newline = true;
- this.setAttribute("src", "img/new_line.svg");
- }
- writer_dom.data("command", command);
- setPopup(newlineBtn, command.newline);
- }); // Attach jquery popup
- setPopup(newlineBtn, command.newline);
- }
- function setPopup(element, state) {
- if (element.popup("exists")) {
- element.popup("destroy");
- }
- var content = state ? _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("write_command_newline_on") : _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_1__["LocalizedStrings"].getUI("write_command_newline_off");
- element.popup({
- content: content,
- delay: {
- show: 750,
- hide: 0
- }
- });
- }
- function _addHandlerIconAdd(dom_object, command, function_obj) {
- var insert_after = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
- var after_which = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
- var icon_add_item = $('<i class="ui icon plus square outline icon_add_item_to_writer"></i> ');
- if (!insert_after) {
- dom_object.append(icon_add_item);
- } else {
- icon_add_item.insertAfter(after_which);
- }
- icon_add_item.on("click", function (_event) {
- var div_parent_with_handler = $('<div class="div_parent_handler" style="display:none;"></div>');
- var new_div_item = $('<div class="var_value_menu_div"></div>');
- div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
- div_parent_with_handler.append(new_div_item);
- div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
- div_parent_with_handler.insertAfter(icon_add_item);
- 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);
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, new_related_menu, new_div_item, function_obj);
- addHandlerIconAdd(dom_object, command, function_obj, true, div_parent_with_handler);
- addHandlersManager(command, function_obj, dom_object, div_parent_with_handler, new_related_menu);
- var pos = 1;
- dom_object.find(".icon_add_item_to_writer").each(function () {
- if ($(this).get(0) === icon_add_item.get(0)) {
- command.content.splice(pos, 0, new_related_menu);
- } else {
- pos++;
- }
- });
- if (command.content.length == 1) {
- icon_add_item.remove();
- }
- div_parent_with_handler.fadeIn();
- });
- }
- function addContent(command, _ref_object, dom_object, _menu_var_or_value, function_obj, _ref_object_content) {
- if (dom_object.hasClass("var_value_menu_div")) {
- var icon_add_item = $('<i class="ui icon plus square outline icon_add_item_to_writer"></i> ');
- icon_add_item.insertAfter(dom_object);
- icon_add_item.on("click", function (_event) {
- var div_parent_with_handler = $('<div class="div_parent_handler"></div>');
- div_parent_with_handler.append($('<i class="ui icon ellipsis vertical inverted handler"></i>'));
- div_parent_with_handler.append(new_div_item);
- div_parent_with_handler.append($('<i class="white inverted icon times handler"></i>'));
- div_parent_with_handler.insertAfter(icon_add_item);
- 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);
- _variable_value_menu__WEBPACK_IMPORTED_MODULE_2__["renderMenu"](command, new_related_menu, new_div_item, function_obj);
- addHandlersManager(command, function_obj, dom_object, div_parent_with_handler, new_related_menu);
- command.content.push(new_related_menu);
- if (command.content.length == 1) {
- icon_add_item.remove();
- }
- });
- }
- }
- /***/ }),
- /***/ "./js/visualUI/functions.js":
- /*!**********************************!*\
- !*** ./js/visualUI/functions.js ***!
- \**********************************/
- /*! exports provided: renderFunction, initVisualUI, setTestCases, getTestCases, addFunctionChangeListener, addGlobalChangeListener, removeGlobalListener, removeFunctionListener */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderFunction", function() { return renderFunction; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initVisualUI", function() { return initVisualUI; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTestCases", function() { return setTestCases; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTestCases", function() { return getTestCases; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addFunctionChangeListener", function() { return addFunctionChangeListener; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addGlobalChangeListener", function() { return addGlobalChangeListener; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeGlobalListener", function() { return removeGlobalListener; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFunctionListener", function() { return removeFunctionListener; });
- /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
- /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./globals */ "./js/visualUI/globals.js");
- /* harmony import */ var _variables__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./variables */ "./js/visualUI/variables.js");
- /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./commands */ "./js/visualUI/commands.js");
- /* harmony import */ var _code_generator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./code_generator */ "./js/visualUI/code_generator.js");
- /* harmony import */ var _commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./commands/variable_value_menu */ "./js/visualUI/commands/variable_value_menu.js");
- /* harmony import */ var _io_domConsole__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../io/domConsole */ "./js/io/domConsole.js");
- /* harmony import */ var _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../processor/ivprogProcessor */ "./js/processor/ivprogProcessor.js");
- /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
- /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_10__);
- /* harmony import */ var _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../processor/semantic/semanticAnalyser */ "./js/processor/semantic/semanticAnalyser.js");
- /* harmony import */ var _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../assessment/ivprogAssessment */ "./js/assessment/ivprogAssessment.js");
- /* harmony import */ var _algorithm__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./algorithm */ "./js/visualUI/algorithm.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
- /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
- /* harmony import */ var _ima_version_json__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./../../.ima_version.json */ "./.ima_version.json");
- var _ima_version_json__WEBPACK_IMPORTED_MODULE_16___namespace = /*#__PURE__*/__webpack_require__.t(/*! ./../../.ima_version.json */ "./.ima_version.json", 1);
- /* harmony import */ var _text_editor__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./text_editor */ "./js/visualUI/text_editor.js");
- /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
- /* harmony import */ var _processor_modes__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../processor/modes */ "./js/processor/modes.ts");
- /* harmony import */ var _processor_modes__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_processor_modes__WEBPACK_IMPORTED_MODULE_19__);
- var counter_new_functions = 0;
- var counter_new_parameters = 0;
- var ivprog_version = _ima_version_json__WEBPACK_IMPORTED_MODULE_16__.version;
- var globalChangeListeners = [];
- var functionsChangeListeners = [];
- var proc = null;
- var domConsole = null;
- var _testCases = [];
- var isRunning = false;
- window.studentGrade = null;
- window.LocalizedStrings = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"];
- var program = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Program"]();
- window.system_functions = []; // Adding math functions:
- 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));
- 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));
- 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));
- 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));
- 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));
- 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));
- 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));
- 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));
- 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));
- 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));
- 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));
- 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:
- 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));
- 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));
- 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));
- 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));
- window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$charAt', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true), new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].text)); // Adding arrangement functions:
- 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));
- 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));
- 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:
- 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));
- 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));
- 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));
- 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));
- 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));
- 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));
- 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));
- window.system_functions.push(new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SystemFunction"]('$castChar', _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR, 0, [new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["VariableValueMenu"](_commands_variable_value_menu__WEBPACK_IMPORTED_MODULE_7__["VAR_OR_VALUE_TYPES"].all, null, null, null, true)], null, _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["SYSTEM_FUNCTIONS_CATEGORIES"].conversion));
- 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');
- 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);
- mainFunction.function_comment = new _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__["Comment"](_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_comment_main'));
- program.addFunction(mainFunction);
- window.program_obj = program;
- window.generator = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"];
- window.runCodeAssessment = runCodeAssessment;
- window.renderAlgorithm = _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"];
- window.insertContext = false;
- window.watchW = melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a;
- melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a.watch(window.program_obj.globals, function () {
- if (window.insertContext) {
- setTimeout(function () {
- _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
- globalChangeListeners.forEach(function (x) {
- return x();
- });
- }, 300);
- window.insertContext = false;
- } else {
- _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
- globalChangeListeners.forEach(function (x) {
- return x();
- });
- }
- }, 1);
- melanke_watchjs__WEBPACK_IMPORTED_MODULE_10___default.a.watch(window.program_obj.functions, function () {
- if (window.insertContext) {
- setTimeout(function () {
- _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
- functionsChangeListeners.forEach(function (x) {
- return x();
- });
- }, 300);
- window.insertContext = false;
- } else {
- _algorithm__WEBPACK_IMPORTED_MODULE_13__["renderAlgorithm"]();
- functionsChangeListeners.forEach(function (x) {
- return x();
- });
- }
- }, 1);
- function addFunctionHandler() {
- 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')));
- program.addFunction(new_function);
- counter_new_functions++;
- window.insertContext = true;
- 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);
- renderFunction(new_function);
- /*newe.css('display', 'none');
- newe.fadeIn();*/
- }
- function addParameter(function_obj, function_container
- /*, is_from_click = false*/
- ) {
- if (function_obj.parameters_list == null) {
- function_obj.parameters_list = [];
- }
- 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);
- function_obj.parameters_list.push(new_parameter);
- counter_new_parameters++;
- 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);
- renderParameter(function_obj, new_parameter, function_container); // if (is_from_click) {
- // newe.css('display', 'none');
- // newe.fadeIn();
- // }
- }
- function updateReturnType(function_obj, new_type) {
- var new_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
- 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);
- function_obj.return_type = new_type;
- function_obj.return_dimensions = new_dimensions;
- }
- function removeFunction(function_obj) {
- var index = program.functions.indexOf(function_obj);
- if (index > -1) {
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_FUNCTION);
- program.functions.splice(index, 1);
- }
- }
- function minimizeFunction(function_obj) {
- function_obj.is_hidden = !function_obj.is_hidden;
- }
- function addHandlers(function_obj, function_container) {
- function_container.find('.ui.dropdown.function_return').dropdown({
- onChange: function onChange(value, text, $selectedItem) {
- if ($selectedItem.data('dimensions')) {
- updateReturnType(function_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], $selectedItem.data('dimensions'));
- } else {
- updateReturnType(function_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')]);
- }
- },
- selectOnKeydown: false
- });
- function_container.find(".name_function_updated").on('click', function (e) {
- enableNameFunctionUpdate(function_obj, function_container);
- });
- function_container.find(".add_parameter_button").on('click', function (e) {
- window.insertContext = true;
- addParameter(function_obj, function_container, true);
- });
- function_container.find('.menu_commands').dropdown({
- on: 'hover'
- });
- function_container.find('.menu_commands a').on('click', function (evt) {
- if (function_obj.commands == null || function_obj.commands.length == 0) {
- function_obj.commands = [];
- var new_cmd = _commands__WEBPACK_IMPORTED_MODULE_5__["genericCreateCommand"]($(this).data('command'));
- function_obj.commands.push(new_cmd);
- _commands__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](new_cmd, function_container.find('.commands_list_div'), 3, function_obj);
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].INSERT_COMMAND, $(this).data('command'), '/', 0);
- } else {
- _commands__WEBPACK_IMPORTED_MODULE_5__["createFloatingCommand"](function_obj, function_container, $(this).data('command'), evt);
- }
- });
- function_container.find('.add_var_button_function').on('click', function (e) {
- window.insertContext = true;
- _variables__WEBPACK_IMPORTED_MODULE_4__["addVariable"](function_obj, function_container, true);
- });
- function_container.find('.remove_function_button').on('click', function (e) {
- removeFunction(function_obj);
- function_container.fadeOut();
- });
- function_container.find('.minimize_function_button').on('click', function (e) {
- minimizeFunction(function_obj);
- if (function_obj.is_hidden) {
- function_container.find(".add_var_button_function").toggle();
- function_container.find(".inline_add_command").toggle();
- function_container.find(".function_area").slideToggle();
- } else {
- function_container.find(".function_area").slideToggle(function () {
- function_container.find(".add_var_button_function").toggle();
- function_container.find(".inline_add_command").toggle();
- });
- }
- });
- } // Essa função imprime o tipo de retorno da função e cria o menu do tipo 'select' para alteração
- function renderFunctionReturn(function_obj, function_element) {
- var ret = '<div class="ui dropdown function_return">';
- if (function_obj.return_dimensions == 1) {
- 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()));
- ret += ' [ ] </div>';
- } else if (function_obj.return_dimensions == 2) {
- 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()));
- ret += ' [ ] [ ] </div>';
- } else {
- ret += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(function_obj.return_type.toLowerCase())) + '</div>';
- }
- ret += '<div class="menu">';
- for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
- 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>';
- }
- 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">';
- for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
- if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
- continue;
- }
- 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>';
- }
- ret += '</div></div>';
- 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">';
- for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
- if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
- continue;
- }
- 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>';
- }
- ret += '</div></div>';
- ret += '</div></div>';
- ret = $(ret);
- function_element.find('.function_return').append(ret);
- }
- var cont = 0;
- function renderFunction(function_obj) {
- var appender = '<div class="ui secondary segment function_div list-group-item function_cont_' + cont + '">';
- if (function_obj.function_comment) {//appender += renderComment(function_obj.function_comment, sequence, true, -1);
- }
- appender += '<span class="glyphicon glyphicon-move move_function" aria-hidden="true"><i class="icon sort alternate vertical"></i></span>';
- 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>';
- appender += '<div class="function_signature_div">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("function") + ' ';
- if (function_obj.is_main) {
- appender += '<div class="function_name_div"> ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('type_void') + ' <span class="span_name_function" >' + function_obj.name + '</span> </div> ' + ' <span class="parethesis_function">( </span> <div class="ui large labels parameters_list">';
- } else {
- appender += '<div class="ui function_return"></div>';
- 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">';
- }
- appender += '</div> <span class="parethesis_function"> ) </span> </div>' + (function_obj.is_hidden ? ' <div class="function_area" style="display: none;"> ' : ' <div class="function_area"> ');
- appender += '<div class="ui add_var_context add_var_button_function" style="float: left;"> <div class="ui icon button purple"> ';
- 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>';
- appender += '</div></div>';
- appender += '<div class="ui top attached segment variables_list_div"></div>';
- 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;">';
- 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"> ';
- 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>';
- appender += '</div></div>' + '</div>';
- appender += '</div></div>';
- appender = $(appender);
- $('.all_functions').append(appender);
- appender.data('fun', function_obj);
- appender.find('.commands_list_div').data('fun', function_obj);
- renderFunctionReturn(function_obj, appender);
- addHandlers(function_obj, appender); // Rendering parameters:
- for (var j = 0; j < function_obj.parameters_list.length; j++) {
- renderParameter(function_obj, function_obj.parameters_list[j], appender);
- } // Rendering variables:
- for (var j = 0; j < function_obj.variables_list.length; j++) {
- _variables__WEBPACK_IMPORTED_MODULE_4__["renderVariable"](appender, function_obj.variables_list[j], function_obj);
- } // Rendering commands:
- for (var j = 0; j < function_obj.commands.length; j++) {
- _commands__WEBPACK_IMPORTED_MODULE_5__["renderCommand"](function_obj.commands[j], $(appender.find('.commands_list_div')[0]), 3, function_obj);
- }
- $('.minimize_function_button').popup({
- content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_hide_function"),
- delay: {
- show: 750,
- hide: 0
- }
- });
- var function_index = program.functions.indexOf(function_obj);
- Sortable.create(appender.find(".variables_list_div")[0], {
- handle: '.ellipsis',
- animation: 100,
- ghostClass: 'ghost',
- group: 'local_vars_drag_' + function_index,
- onEnd: function onEnd(evt) {
- updateSequenceLocals(evt.oldIndex, evt.newIndex, function_obj);
- }
- });
- addSortableHandler(appender.find(".commands_list_div")[0], function_index);
- if (!function_obj.is_main) {
- Sortable.create(appender.find(".container_parameters_list")[0], {
- handle: '.ellipsis',
- animation: 100,
- ghostClass: 'ghost',
- group: 'parameters_drag_' + program.functions.indexOf(function_obj),
- onEnd: function onEnd(evt) {
- updateSequenceParameters(evt.oldIndex, evt.newIndex, function_obj);
- }
- });
- }
- if (function_obj.commands.length > 0) {
- var teste = '.ui.sticky.sticky_cont_' + cont;
- $(teste).sticky({
- context: '.ui.bottom.attached.segment.commands_list_div.commands_cont_' + cont,
- scrollContext: '.ivprog_visual_panel',
- observeChanges: true,
- offset: 40,
- onStick: function onStick(evt) {
- $(teste).css('top', '20px', 'important');
- },
- onBottom: function onBottom(evt) {
- $(teste).css('top', '20px', 'important');
- },
- onUnstick: function onUnstick(evt) {
- $(teste).css('top', '20px', 'important');
- },
- onReposition: function onReposition(evt) {
- $(teste).css('top', '20px', 'important');
- },
- onScroll: function onScroll(evt) {
- $(teste).css('top', '20px', 'important');
- if (!isVisible($(teste), $(teste).parent())) {
- $(teste).removeClass('fixed');
- }
- },
- onTop: function onTop(evt) {
- $(teste).css('top', '20px', 'important');
- }
- });
- }
- cont++;
- return appender;
- }
- function isVisible(element, container) {
- var elementTop = $(element).offset().top,
- elementHeight = $(element).height(),
- containerTop = $(container).offset().top,
- containerHeight = $(container).height() - 30;
- return elementTop - containerTop + elementHeight > 0 && elementTop - containerTop < containerHeight;
- }
- window.evento_drag;
- function updateProgramObjDrag() {
- var nodes = Array.prototype.slice.call($('.all_functions').children());
- var function_index;
- var start_index;
- var function_obj;
- $(evento_drag.item).parentsUntil(".all_functions").each(function (index) {
- var ref = $(this);
- if (ref.hasClass('function_div')) {
- function_index = nodes.indexOf(this);
- start_index = index;
- function_obj = ref;
- }
- });
- var path_target = [];
- $(evento_drag.item).parentsUntil(".all_functions").each(function () {
- if ($(this).hasClass('command_container')) {
- path_target.push(this);
- }
- });
- if (path_target.length == 0) {//console.log('soltou na raiz, na posição: ' + evento_drag.newIndex + ' mas ainda não sei de onde saiu ');
- } else {//console.log('soltou dentro de algum bloco, sequência vem logo abaixo (de baixo pra cima): ');
- //console.log(path_target);
- }
- var index_each = [];
- var path_relative = [];
- for (var i = path_target.length - 1; i >= 0; i--) {
- console.log('da vez', $(path_target[i + 1]));
- if (i == path_target.length - 1) {
- // está na raiz
- var indice_na_raiz = function_obj.find('.command_container').index(path_target[i]);
- console.log('índice na raiz: ', indice_na_raiz);
- } else {
- if ($(path_target[i + 1]).hasClass('iftrue')) {
- if ($(path_target[i]).parent().hasClass('commands_if')) {
- path_relative.push('if');
- index_each.push($(path_target[i]).parent().find('.command_container').index(path_target[i]));
- } else {
- path_relative.push('else');
- index_each.push($(path_target[i]).parent().find('.command_container').index(path_target[i]));
- }
- } else if ($(path_target[i + 1]).hasClass('dowhiletrue')) {
- path_relative.push('dowhiletrue');
- index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
- } else if ($(path_target[i + 1]).hasClass('repeatNtimes')) {
- path_relative.push('repeatNtimes');
- index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
- } else if ($(path_target[i + 1]).hasClass('whiletrue')) {
- path_relative.push('whiletrue');
- index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
- } else if ($(path_target[i + 1]).hasClass('switch')) {
- path_relative.push('switch'); //index_each.push($(path_target[i + 1]).find('.command_container').index(path_target[i]));
- }
- }
- } // var index_in_block = -1;
- 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);
- var is_in_case_switch = $(evento_drag.item).parent().hasClass('case_commands_block'); // var index_case_of_switch = -1;
- // if (is_in_case_switch) {
- // index_case_of_switch = $(evento_drag.item).parent().parent().parent().find('.case_div').index($(evento_drag.item).parent().parent());
- // }
- /*console.log('path_relative:');
- console.log(path_relative);
- console.log('index_each:');
- console.log(index_each);
- console.log('index_in_block:');
- console.log(index_in_block);
- console.log('ele está em algum bloco de senão? ');
- console.log(is_in_else);
- console.log('ele está dentro de um case de switch?');
- console.log(is_in_case_switch);
- console.log('qual é o índice do case: ');
- console.log(index_case_of_switch);*/
- // encontrar o elemento na árvore:
- var command_start_point = window.program_obj.functions[function_index].commands[indice_na_raiz];
- var block_to_insert = command_start_point;
- for (var i = 0; i < index_each.length; i++) {
- if (path_relative[i] == "else") {
- block_to_insert = block_to_insert.commands_else[index_each[i]];
- } else if (path_relative[i] == "switch") {} else {
- block_to_insert = block_to_insert.commands_block[index_each[i]];
- }
- } //console.log('command_start_point', command_start_point);
- //console.log('block_to_insert', block_to_insert);
- // agora tem que alocar o comando na árvore, mas considerar as quatro situações:
- // (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.
- if (path_target.length == 0) {
- // soltou na raiz:
- window.program_obj.functions[function_index].commands.splice(evento_drag.newIndex - 1, 0, command_in_drag);
- } else if (is_in_else) {
- if (block_to_insert.commands_else) {
- block_to_insert.commands_else.splice(evento_drag.newIndex, 0, command_in_drag);
- } else {
- block_to_insert.commands_else = [];
- block_to_insert.commands_else.push(command_in_drag);
- }
- } else if (is_in_case_switch) {} else {
- // verificar se tem alguma coisa no bloco:
- if (block_to_insert.commands_block) {
- console.log("existe alguma coisa dentro do bloco, index: ", evento_drag.newIndex);
- block_to_insert.commands_block.splice(evento_drag.newIndex, 0, command_in_drag);
- } else {
- block_to_insert.commands_block = [];
- block_to_insert.commands_block.push(command_in_drag);
- }
- }
- window.draging = false;
- renderAlgorithm();
- }
- function prepareDragHandler(evt) {
- window.draging = true;
- var nodes = Array.prototype.slice.call($('.all_functions').children());
- var function_index;
- var function_obj;
- $(evt.item).parentsUntil(".all_functions").each(function (index) {
- if ($(this).hasClass('function_div')) {
- function_index = nodes.indexOf(this);
- function_obj = window.program_obj.functions[function_index];
- }
- });
- command_in_drag = $(evt.item).data("command"); //console.log('$(evt.item).parent(): ');
- //console.log($(evt.item).parent());
- // descobrir qual das quatro situações:
- if ($(evt.item).parent().hasClass('commands_list_div')) {
- // está na raiz:
- if (function_obj.commands.indexOf(command_in_drag) > -1) {
- function_obj.commands.splice(function_obj.commands.indexOf(command_in_drag), 1);
- }
- } else if ($(evt.item).parent().hasClass('commands_else')) {
- // está no else:
- if ($(evt.item).parent().data('command').commands_else.indexOf(command_in_drag) > -1) {
- $(evt.item).parent().data('command').commands_else.splice($(evt.item).parent().data('command').commands_else.indexOf(command_in_drag), 1);
- }
- } else if ($(evt.item).parent().hasClass('case_commands_block')) {// está em um switch:
- } else {
- // caso padrão:
- if ($(evt.item).parent().data('command').commands_block.indexOf(command_in_drag) > -1) {
- $(evt.item).parent().data('command').commands_block.splice($(evt.item).parent().data('command').commands_block.indexOf(command_in_drag), 1);
- }
- }
- }
- var command_in_drag;
- function addSortableHandler(element, id_function) {
- var n_group = 'commands_drag_' + id_function;
- Sortable.create(element, {
- handle: '.command_drag',
- ghostClass: 'ghost',
- animation: 300,
- group: {
- name: n_group
- },
- onEnd: function onEnd(evt) {
- var nodes = Array.prototype.slice.call($('.all_functions').children());
- var function_index;
- var function_obj;
- $(evt.item).parentsUntil(".all_functions").each(function (index) {
- if ($(this).hasClass('function_div')) {
- function_index = nodes.indexOf(this);
- function_obj = window.program_obj.functions[function_index];
- }
- });
- 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);
- var itemEl = evt.item; // dragged HTMLElement
- evt.to; // target list
- evt.from; // previous list
- evt.oldIndex; // element's old index within old parent
- evt.newIndex; // element's new index within new parent
- //console.log('::EVT::');
- //console.log(evt);
- window.evento_drag = evt;
- try {
- updateProgramObjDrag();
- } catch (e) {
- console.error(e);
- window.draging = false;
- }
- },
- onStart: function onStart(evt) {
- //console.log("START::EVT::");
- //console.log(evt);
- //console.log("\n\ncommand_in_drag");
- try {
- prepareDragHandler(evt);
- } catch (e) {
- window.draging = false;
- }
- }
- });
- element = $(element);
- element.find(".iftrue").each(function (index) {
- addSortableHandler($(this).find(".block_commands")[0], id_function);
- addSortableHandler($(this).find(".block_commands")[1], id_function);
- });
- element.find(".repeatNtimes").each(function (index) {
- addSortableHandler($(this).find(".block_commands")[0], id_function);
- });
- element.find(".dowhiletrue").each(function (index) {
- addSortableHandler($(this).find(".block_commands")[0], id_function);
- });
- element.find(".whiletrue").each(function (index) {
- addSortableHandler($(this).find(".block_commands")[0], id_function);
- });
- element.find(".switch").each(function (index) {
- $(this).find(".case_div").each(function (index) {
- addSortableHandler($(this).find(".case_commands_block")[0], id_function);
- });
- });
- }
- function initVisualUI() {
- // MUST USE CONST, LET, OR VAR !!!!!!
- // const mainDiv = $('#visual-main-div');
- // fill mainDiv with functions and globals...
- // renderAlgorithm()...
- domConsole = new _io_domConsole__WEBPACK_IMPORTED_MODULE_8__["DOMConsole"]("ivprog-term-div");
- domConsole.hide();
- $(document.getElementById("ivprog-term-div")).draggable();
- $('.add_function_button').on('click', function () {
- addFunctionHandler();
- });
- $('.add_global_button').on('click', function () {
- window.insertContext = true;
- _globals__WEBPACK_IMPORTED_MODULE_3__["addGlobal"](program, true);
- });
- $('#run_button').on('click', function () {
- showStopButton();
- runCode();
- });
- $('#stop_button').on('click', function () {
- showRunButton();
- stopExecution();
- });
- $('.visual_coding_button').on('click', function () {
- toggleVisualCoding();
- });
- $('.textual_coding_button').on('click', function () {
- toggleTextualCoding();
- });
- $('.assessment').on('click', function () {
- is_iassign = true;
- runCodeAssessment();
- });
- $('.div_toggle_console').on('click', function () {
- toggleConsole();
- });
- $('.expand_button').on('click', function () {
- full_screen();
- });
- $('.help_button').on('click', function () {
- window.open('https://www.usp.br/line/ivprog/', '_blank');
- });
- $('.main_title h2').prop('title', _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('text_ivprog_description'));
- var time_show = 750;
- $('.visual_coding_button').popup({
- content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_visual"),
- delay: {
- show: time_show,
- hide: 0
- }
- });
- $('.textual_coding_button').popup({
- content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_textual"),
- delay: {
- show: time_show,
- hide: 0
- }
- });
- $('.upload_file_button').popup({
- content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_upload"),
- delay: {
- show: time_show,
- hide: 0
- }
- });
- $('.download_file_button').popup({
- content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_download"),
- delay: {
- show: time_show,
- hide: 0
- }
- });
- $('.undo_button').popup({
- content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_undo"),
- delay: {
- show: time_show,
- hide: 0
- }
- });
- $('.redo_button').popup({
- content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_redo"),
- delay: {
- show: time_show,
- hide: 0
- }
- });
- $('.run_button').popup({
- content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_run"),
- delay: {
- show: time_show,
- hide: 0
- }
- });
- $('.assessment_button').popup({
- content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_evaluate"),
- delay: {
- show: time_show,
- hide: 0
- }
- });
- $('.help_button').popup({
- content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_help") + ' - ' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("text_ivprog_version") + ' ' + ivprog_version,
- delay: {
- show: time_show,
- hide: 0
- }
- });
- $('.add_global_button').popup({
- content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_add_global"),
- delay: {
- show: time_show,
- hide: 0
- }
- });
- $('.div_toggle_console').popup({
- content: _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("tooltip_console"),
- delay: {
- show: time_show,
- hide: 0
- }
- });
- Sortable.create(listWithHandle, {
- handle: '.glyphicon-move',
- animation: 100,
- ghostClass: 'ghost',
- group: 'functions_divs_drag',
- onEnd: function onEnd(evt) {
- updateSequenceFunction(evt.oldIndex, evt.newIndex);
- }
- });
- var listGlobalsHandle = document.getElementById("listGlobalsHandle");
- Sortable.create(listGlobalsHandle, {
- handle: '.ellipsis',
- animation: 100,
- ghostClass: 'ghost',
- group: 'globals_divs_drag',
- onEnd: function onEnd(evt) {
- updateSequenceGlobals(evt.oldIndex, evt.newIndex);
- }
- });
- }
- function setTestCases(testCases) {
- _testCases = testCases;
- }
- function getTestCases() {
- // Deep clone of test cases to avoid unauthorized modification
- // TODO: It may be not possible to use this once custom test are fully implemented
- return JSON.parse(JSON.stringify(_testCases));
- }
- var is_iassign = false;
- function updateSequenceParameters(oldIndex, newIndex, function_obj) {
- function_obj.parameters_list.splice(newIndex, 0, function_obj.parameters_list.splice(oldIndex, 1)[0]);
- }
- function updateSequenceLocals(oldIndex, newIndex, function_obj) {
- function_obj.variables_list.splice(newIndex, 0, function_obj.variables_list.splice(oldIndex, 1)[0]);
- }
- function updateSequenceGlobals(oldIndex, newIndex) {
- program_obj.globals.splice(newIndex, 0, program_obj.globals.splice(oldIndex, 1)[0]);
- }
- function updateSequenceFunction(oldIndex, newIndex) {
- program_obj.functions.splice(newIndex, 0, program_obj.functions.splice(oldIndex, 1)[0]);
- }
- function runCodeAssessment() {
- if (isRunning) {
- // cannot run assessment or it's already running
- return -1;
- }
- var strCode = null;
- is_iassign = false;
- window.studentGrade = null;
- if (settingsProgrammingTypes == "textual") {
- strCode = _text_editor__WEBPACK_IMPORTED_MODULE_17__["getCode"]();
- } else {
- strCode = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
- }
- if (strCode == null) {
- // No code, so no assessment
- return -1;
- }
- toggleConsole(true);
- try {
- var data = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__["SemanticAnalyser"].analyseFromSource(strCode);
- isRunning = true;
- var runner = new _assessment_ivprogAssessment__WEBPACK_IMPORTED_MODULE_12__["IVProgAssessment"](data, _testCases, domConsole);
- runner.runTest().then(function (grade) {
- if (!is_iassign) {
- parent.getEvaluationCallback(grade);
- } else {
- is_iassign = false;
- }
- isRunning = false;
- })["catch"](function (err) {
- console.log(err);
- isRunning = false;
- });
- } catch (error) {
- isRunning = false;
- domConsole.err(error.message);
- console.log(error);
- if (!is_iassign) {
- parent.getEvaluationCallback(0);
- } else {
- is_iassign = false;
- }
- }
- return 0;
- }
- function runCode() {
- if (isRunning) {
- return;
- }
- var strCode = null;
- if (settingsProgrammingTypes == "textual") {
- strCode = _text_editor__WEBPACK_IMPORTED_MODULE_17__["getCode"]();
- } else {
- strCode = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
- }
- if (strCode == null) {
- return;
- }
- toggleConsole(true); // if(domConsole == null)
- // domConsole = new DOMConsole("#ivprog-term");
- //$("#ivprog-term").slideDown(500);
- try {
- var data = _processor_semantic_semanticAnalyser__WEBPACK_IMPORTED_MODULE_11__["SemanticAnalyser"].analyseFromSource(strCode);
- proc = new _processor_ivprogProcessor__WEBPACK_IMPORTED_MODULE_9__["IVProgProcessor"](data);
- proc.registerInput(domConsole);
- proc.registerOutput(domConsole);
- $("#ivprog-term").addClass('ivprog-term-active');
- isRunning = true;
- proc.interpretAST().then(function (_) {
- scheduleCall(function () {
- if (domConsole.pending_writes.length == 0) {
- if (proc.mode === _processor_modes__WEBPACK_IMPORTED_MODULE_19__["Modes"].ABORT) {
- domConsole.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getMessage("aborted_execution"));
- } else {
- domConsole.info(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getMessage("success_execution"));
- }
- $("#ivprog-term").removeClass('ivprog-term-active');
- isRunning = false;
- proc = null;
- showRunButton();
- return true;
- }
- return false;
- }, 100);
- })["catch"](function (err) {
- scheduleCall(function () {
- if (domConsole.pending_writes.length == 0) {
- if (err instanceof Error) {
- domConsole.err(err.message);
- } else {
- domConsole.err(err);
- }
- $("#ivprog-term").removeClass('ivprog-term-active');
- isRunning = false;
- proc = null;
- showRunButton();
- return true;
- }
- return false;
- }, 100);
- });
- } catch (error) {
- scheduleCall(function () {
- if (domConsole.pending_writes.length == 0) {
- isRunning = false;
- proc = null;
- showRunButton();
- domConsole.err(error.message);
- console.log(error);
- return true;
- }
- return false;
- }, 100);
- }
- }
- function toggleConsole(is_running) {
- if (is_running) {
- $('.ivprog-term-div').css('display', 'block');
- $('#ivprog-term').css('min-height', '160px');
- if (domConsole != null) domConsole.focus(); //$('#ivprog-term').css('margin-top', '-170px');
- return;
- } else {
- domConsole.hide();
- return;
- }
- if ($('#ivprog-term').css('min-height') == '160px') {
- // esconder
- $('.ivprog-term-div').css('display', 'none');
- $('#ivprog-term').css('min-height', '0'); //$('#ivprog-term').css('margin-top', '-30px');
- //$('#ivprog-term').css('padding', '5px');
- } else {
- // mostrar
- $('.ivprog-term-div').css('display', 'block');
- $('#ivprog-term').css('min-height', '160px'); //$('#ivprog-term').css('margin-top', '-170px');
- }
- } // function waitToCloseConsole () {
- // domConsole.info("Aperte qualquer tecla para fechar...");
- // const p = new Promise((resolve, _) => {
- // domConsole.requestInput(resolve, true);
- // });
- // p.then( _ => {
- // domConsole.dispose();
- // domConsole = null;
- // $("#ivprog-term").hide();
- // })
- // }
- function toggleTextualCoding() {
- var code = null;
- if (settingsProgrammingTypes != "textual") {
- code = _code_generator__WEBPACK_IMPORTED_MODULE_6__["generate"]();
- if (code == null) {
- return;
- }
- }
- $('.ivprog_visual_panel').css('display', 'none');
- $('.ivprog_textual_panel').css('display', 'block');
- $('.ivprog_textual_panel').removeClass('loading');
- _text_editor__WEBPACK_IMPORTED_MODULE_17__["updateEditor"]();
- if (code != null) _text_editor__WEBPACK_IMPORTED_MODULE_17__["setCode"](code); //$('.ivprog_textual_code').text(code);
- $('.visual_coding_button').removeClass('active');
- $('.textual_coding_button').addClass('active');
- }
- function toggleVisualCoding() {
- $('.ivprog_textual_panel').addClass('loading');
- $('.ivprog_textual_panel').css('display', 'none');
- $('.ivprog_visual_panel').css('display', 'block');
- $('.textual_coding_button').removeClass('active');
- $('.visual_coding_button').addClass('active');
- }
- function removeParameter(function_obj, parameter_obj, parameter_container) {
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(parameter_obj.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].REMOVE_FUNCTION_PARAM, function_obj.name);
- var index = function_obj.parameters_list.indexOf(parameter_obj);
- if (index > -1) {
- window.insertContext = true;
- function_obj.parameters_list.splice(index, 1);
- }
- $(parameter_container).fadeOut();
- }
- function updateParameterType(parameter_obj, new_type, function_name) {
- var new_dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
- 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);
- parameter_obj.type = new_type;
- parameter_obj.dimensions = new_dimensions;
- if (new_dimensions > 0) {
- parameter_obj.rows = new_dimensions;
- parameter_obj.columns = 2;
- }
- }
- function renderParameter(function_obj, parameter_obj, function_container) {
- var ret = "";
- ret += '<div class="ui label function_name_parameter pink"><i class="ui icon ellipsis vertical inverted"></i>';
- ret += '<div class="ui dropdown parameter_type">';
- if (parameter_obj.dimensions > 0) {
- 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()));
- if (parameter_obj.dimensions == 1) {
- ret += ' [ ] ';
- } else {
- ret += ' [ ] [ ] ';
- }
- ret += '</div>';
- } else {
- ret += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(parameter_obj.type.toLowerCase())) + '</div>';
- }
- ret += '<div class="menu">';
- for (var _tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
- if (_tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
- continue;
- }
- 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>';
- }
- 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">';
- for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
- if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
- continue;
- }
- 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>';
- }
- ret += '</div></div>';
- 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">';
- for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
- if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
- continue;
- }
- 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>';
- }
- ret += '</div></div>';
- ret += '</div></div>';
- ret += '<div class="parameter_div_edit"><span class="span_name_parameter label_enable_name_parameter">' + parameter_obj.name + '</span></div> ';
- ret += ' <i class="yellow inverted icon times remove_parameter"></i></div>';
- ret = $(ret);
- function_container.find('.container_parameters_list').append(ret);
- ret.find('.remove_parameter').on('click', function (e) {
- removeParameter(function_obj, parameter_obj, ret);
- });
- ret.find('.ui.dropdown.parameter_type').dropdown({
- onChange: function onChange(_, __, $selectedItem) {
- if ($selectedItem.data('dimensions')) {
- updateParameterType(parameter_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name, $selectedItem.data('dimensions'));
- } else {
- updateParameterType(parameter_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name);
- }
- },
- selectOnKeydown: false
- });
- ret.find('.parameter_div_edit').on('click', function (e) {
- 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);
- enableNameParameterUpdate(parameter_obj, ret, function_obj);
- });
- return ret;
- }
- function updateParameterName(parameter_var, new_name, parameter_obj_dom, function_obj) {
- if (parameter_var.name == new_name) {
- return;
- }
- if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_18__["isValidIdentifier"])(new_name)) {
- if (variableNameAlreadyExists(new_name, function_obj)) {
- _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]));
- } else {
- 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);
- parameter_var.name = new_name;
- }
- } else {
- _utils__WEBPACK_IMPORTED_MODULE_14__["renderErrorMessage"](parameter_obj_dom.find('.parameter_div_edit'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
- }
- }
- function variableNameAlreadyExists(name_var, function_obj) {
- if (function_obj.parameters_list) {
- for (var i = 0; i < function_obj.parameters_list.length; i++) {
- if (function_obj.parameters_list[i].name == name_var) {
- return true;
- }
- }
- }
- if (function_obj.variables_list) {
- for (var i = 0; i < function_obj.variables_list.length; i++) {
- if (function_obj.variables_list[i].name == name_var) {
- return true;
- }
- }
- }
- return false;
- }
- function updateFunctionName(function_var, new_name, function_obj_dom) {
- if (function_var.name == new_name) {
- return;
- }
- if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_18__["isValidIdentifier"])(new_name)) {
- if (functionNameAlreadyExists(new_name)) {
- _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]));
- } else {
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_15__["registerUserEvent"])(function_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_15__["ActionTypes"].RENAME_FUNCTION, new_name);
- function_var.name = new_name;
- }
- } else {
- _utils__WEBPACK_IMPORTED_MODULE_14__["renderErrorMessage"](function_obj_dom.find('.function_name_div'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
- }
- }
- function functionNameAlreadyExists(function_name) {
- for (var i = 0; i < window.program_obj.functions.length; i++) {
- if (window.program_obj.functions[i].name == function_name) {
- return true;
- }
- }
- return false;
- }
- var opened_name_parameter = false;
- var opened_input_parameter = null;
- function enableNameParameterUpdate(parameter_obj, parent_node, function_obj) {
- if (opened_name_parameter) {
- opened_input_parameter.focus();
- return;
- }
- opened_name_parameter = true;
- parent_node = $(parent_node);
- var input_field;
- parent_node.find('.span_name_parameter').text('');
- input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + parameter_obj.name + "' />");
- input_field.insertBefore(parent_node.find('.span_name_parameter'));
- input_field.on('input', function () {
- var inputWidth = input_field.textWidth() + 10;
- opened_input_parameter = input_field;
- input_field.focus();
- var tmpStr = input_field.val();
- input_field.val('');
- input_field.val(tmpStr);
- input_field.css({
- width: inputWidth
- });
- }).trigger('input');
- input_field.focusout(function () {
- /// update array:
- if (input_field.val().trim()) {
- updateParameterName(parameter_obj, input_field.val().trim(), parent_node, function_obj);
- parent_node.find('.span_name_parameter').text(parameter_obj.name);
- }
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_parameter = false;
- opened_input_parameter = false;
- });
- input_field.on('keydown', function (e) {
- var code = e.keyCode || e.which;
- if (code == 13) {
- if (input_field.val().trim()) {
- updateParameterName(parameter_obj, input_field.val().trim(), parent_node, function_obj);
- parent_node.find('.span_name_parameter').text(parameter_obj.name);
- }
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_parameter = false;
- opened_input_parameter = false;
- }
- if (code == 27) {
- parent_node.find('.span_name_parameter').text(parameter_obj.name);
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_parameter = false;
- opened_input_parameter = false;
- }
- });
- input_field.select();
- }
- var opened_name_function = false;
- var opened_input = null;
- var previousPadding = null;
- function enableNameFunctionUpdate(function_obj, parent_node) {
- if (opened_name_function) {
- opened_input.focus();
- return;
- }
- parent_node = $(parent_node);
- parent_node.find('.span_name_function').text('');
- var input_field;
- if (!previousPadding) {
- previousPadding = parent_node.find('.span_name_function').css('padding-left');
- }
- parent_node.find('.span_name_function').css('padding-left', '0');
- parent_node.find('.span_name_function').css('padding-right', '0');
- input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + function_obj.name + "' />");
- input_field.insertBefore(parent_node.find('.span_name_function'));
- input_field.on('input', function () {
- var inputWidth = input_field.textWidth() + 10;
- opened_input = input_field;
- input_field.focus();
- var tmpStr = input_field.val();
- input_field.val('');
- input_field.val(tmpStr);
- input_field.css({
- width: inputWidth
- });
- }).trigger('input');
- input_field.focusout(function () {
- /// update array:
- if (input_field.val().trim()) {
- updateFunctionName(function_obj, input_field.val().trim(), parent_node);
- }
- input_field.off();
- input_field.remove();
- parent_node.find('.span_name_function').css('padding-left', previousPadding);
- parent_node.find('.span_name_function').css('padding-right', previousPadding);
- parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
- opened_name_function = false;
- opened_input = false;
- });
- input_field.on('keydown', function (e) {
- var code = e.keyCode || e.which;
- if (code == 13) {
- if (input_field.val().trim()) {
- updateFunctionName(function_obj, input_field.val().trim(), parent_node);
- }
- input_field.off();
- input_field.remove();
- parent_node.find('.span_name_function').css('padding-left', previousPadding);
- parent_node.find('.span_name_function').css('padding-right', previousPadding);
- parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
- opened_name_function = false;
- opened_input = false;
- }
- if (code == 27) {
- input_field.off();
- input_field.remove();
- parent_node.find('.span_name_function').css('padding-left', previousPadding);
- parent_node.find('.span_name_function').css('padding-right', previousPadding);
- parent_node.find('.span_name_function').text(function_obj.name); /// update elements:
- opened_name_function = false;
- opened_input = false;
- }
- });
- input_field.select();
- }
- function addFunctionChangeListener(callback) {
- functionsChangeListeners.push(callback);
- return functionsChangeListeners.length - 1;
- }
- function addGlobalChangeListener(callback) {
- globalChangeListeners.push(callback);
- return globalChangeListeners.length - 1;
- }
- function removeGlobalListener(index) {
- globalChangeListeners.splice(index, 1);
- }
- function removeFunctionListener(index) {
- functionsChangeListeners.splice(index);
- }
- function scheduleCall(callback, time) {
- var scheduled_call = function scheduled_call() {
- var id = setInterval(function () {
- if (callback()) {
- clearInterval(id);
- }
- }, time);
- };
- scheduled_call();
- }
- function showRunButton() {
- document.getElementById('run_button').style.display = 'inline';
- document.getElementById('stop_button').style.display = 'none';
- }
- function showStopButton() {
- document.getElementById('run_button').style.display = 'none';
- document.getElementById('stop_button').style.display = 'inline';
- }
- function stopExecution() {
- domConsole.clearPendingWrites();
- domConsole.cancelPendingInputRequests();
- if (!isRunning) {
- return;
- }
- proc.mode = _processor_modes__WEBPACK_IMPORTED_MODULE_19__["Modes"].ABORT;
- }
- /***/ }),
- /***/ "./js/visualUI/globals.js":
- /*!********************************!*\
- !*** ./js/visualUI/globals.js ***!
- \********************************/
- /*! exports provided: addGlobal, renderGlobal */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addGlobal", function() { return addGlobal; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderGlobal", function() { return renderGlobal; });
- /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
- /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
- /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
- var counter_new_globals = 0;
- function addGlobal(program) {
- var is_from_click = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- 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);
- counter_new_globals++;
- program.addGlobal(new_global);
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(new_global.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].INSERT_GLOBAL_VAR);
- var newe = renderGlobal(new_global);
- if (is_from_click) {
- newe.css('display', 'none');
- newe.fadeIn();
- }
- }
- function toggleConstant(global_var) {
- global_var.is_constant = !global_var.is_constant;
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].SET_GLOBAL_CONST);
- }
- function updateName(global_var, new_name, global_obj_dom) {
- if (global_var.name == new_name) {
- return;
- }
- if (isValidIdentifier(new_name)) {
- if (globalNameAlreadyExists(new_name)) {
- _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'));
- } else {
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].RENAME_GLOBAL_VAR, new_name);
- global_var.name = new_name;
- }
- } else {
- _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](global_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('inform_valid_name'));
- }
- }
- function globalNameAlreadyExists(global_name) {
- for (var i = 0; i < window.program_obj.globals.length; i++) {
- if (window.program_obj.globals[i].name == global_name) {
- return true;
- }
- }
- return false;
- }
- function isValidIdentifier(identifier_str) {
- return /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier_str);
- }
- function updateType(global_var, new_type) {
- var new_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
- global_var.type = new_type;
- global_var.dimensions = new_dimensions;
- if (new_dimensions > 0) {
- global_var.rows = new_dimensions;
- global_var.columns = 2;
- }
- 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);
- updateInitialValues(global_var);
- }
- function removeGlobal(global_var, global_container) {
- var index = window.program_obj.globals.indexOf(global_var);
- if (index > -1) {
- window.insertContext = true;
- window.program_obj.globals.splice(index, 1);
- }
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].REMOVE_GLOBAL_VAR);
- global_container.children().off();
- global_container.off();
- global_container.fadeOut();
- }
- function updateInitialValues(global_var) {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
- if (global_var.dimensions == 0) {
- global_var.value = 0;
- }
- if (global_var.dimensions == 1) {
- global_var.value = [0, 0];
- }
- if (global_var.dimensions == 2) {
- global_var.value = [[0, 0], [0, 0]];
- }
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- if (global_var.dimensions == 0) {
- global_var.value = 0.0;
- }
- if (global_var.dimensions == 1) {
- global_var.value = [0.0, 0.0];
- }
- if (global_var.dimensions == 2) {
- global_var.value = [[0.0, 0.0], [0.0, 0.0]];
- }
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- if (global_var.dimensions == 0) {
- global_var.value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value');
- }
- if (global_var.dimensions == 1) {
- 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')];
- }
- if (global_var.dimensions == 2) {
- 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')]];
- }
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
- if (global_var.dimensions == 0) {
- global_var.value = true;
- }
- if (global_var.dimensions == 1) {
- global_var.value = [true, true];
- }
- if (global_var.dimensions == 2) {
- global_var.value = [[true, true], [true, true]];
- }
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
- if (global_var.dimensions == 0) {
- global_var.value = 'A';
- }
- if (global_var.dimensions == 1) {
- global_var.value = ['A', 'A'];
- }
- if (global_var.dimensions == 2) {
- global_var.value = [['A', 'A'], ['A', 'A']];
- }
- }
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.name, global_var.value);
- }
- function alternateBooleanGlobalValue(global_var, value_container) {
- global_var.value = !global_var.value;
- $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value)));
- }
- function alternateBooleanGlobalVectorValue(global_var, index, value_container) {
- global_var.value[index] = !global_var.value[index];
- $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value[index])));
- }
- function removeGlobalColumnVector(global_var) {
- if (global_var.columns == 0) {
- return;
- }
- global_var.columns--;
- global_var.value.splice(global_var.value.length - 1, 1);
- }
- function addGlobalColumnVector(global_var) {
- global_var.columns++;
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
- global_var.value.push(0);
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- global_var.value.push(0.0);
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- global_var.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
- global_var.value.push(true);
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
- global_var.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
- }
- }
- function removeColumnGlobalMatrix(global_var) {
- if (global_var.columns == 0) {
- return;
- }
- global_var.columns--;
- for (var i = 0; i < global_var.rows; i++) {
- global_var.value[i].splice(global_var.value[i].length - 1, 1);
- }
- }
- function addColumnGlobalMatrix(global_var) {
- global_var.columns++;
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
- for (var i = 0; i < global_var.rows; i++) {
- global_var.value[i].push(0);
- }
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- for (var i = 0; i < global_var.rows; i++) {
- global_var.value[i].push(0.0);
- }
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- for (var i = 0; i < global_var.rows; i++) {
- global_var.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
- }
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
- for (var i = 0; i < global_var.rows; i++) {
- global_var.value[i].push(true);
- }
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
- for (var i = 0; i < global_var.rows; i++) {
- global_var.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
- }
- }
- }
- function removeLineGlobalMatrix(global_var) {
- if (global_var.rows == 0) {
- return;
- }
- global_var.rows--;
- global_var.value.splice(global_var.value.length - 1, 1);
- }
- function addLineGlobalMatrix(global_var) {
- global_var.rows++;
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
- var n_l = [];
- for (var i = 0; i < global_var.columns; i++) {
- n_l.push(0);
- }
- global_var.value.push(n_l);
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- var n_l = [];
- for (i = 0; i < global_var.columns; i++) {
- n_l.push(0.0);
- }
- global_var.value.push(n_l);
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- var n_l = [];
- for (i = 0; i < global_var.columns; i++) {
- n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
- }
- global_var.value.push(n_l);
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
- var n_l = [];
- for (i = 0; i < global_var.columns; i++) {
- n_l.push(true);
- }
- global_var.value.push(n_l);
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
- var n_l = [];
- for (i = 0; i < global_var.columns; i++) {
- n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
- }
- global_var.value.push(n_l);
- }
- }
- function alternateBooleanGlobalMatrixValue(global_var, row, index, value_container) {
- global_var.value[row][index] = !global_var.value[row][index];
- $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(global_var.value[row][index])));
- }
- function renderValues(global_var, global_container) {
- var ret = "";
- var j = 0;
- if (global_var.dimensions == 0) {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + global_var.value.toFixed(1) + '</span> </div> ';
- } else {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
- 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> ';
- } else {
- ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + global_var.value + '</span> </div> ';
- }
- }
- } else {
- ret += '<table class="tabela_var">';
- if (global_var.dimensions == 1) {
- ret += '<tr>';
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- for (var k = 0; k < global_var.columns; k++) {
- ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + global_var.value[k].toFixed(1) + '</span></td>';
- }
- } else {
- for (var k = 0; k < global_var.columns; k++) {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
- 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>';
- } else {
- ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + global_var.value[k] + '</span>' + '</td>';
- }
- }
- }
- ret += '</tr>';
- ret += '</table>';
- 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>';
- }
- if (global_var.dimensions == 2) {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- for (var l = 0; l < global_var.rows; l++) {
- ret += '<tr>';
- for (var k = 0; k < global_var.columns; k++) {
- ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + global_var.value[l][k].toFixed(1) + '</span>' + '</td>';
- }
- ret += '</tr>';
- }
- } else {
- for (var l = 0; l < global_var.rows; l++) {
- ret += '<tr>';
- for (var k = 0; k < global_var.columns; k++) {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
- 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>';
- } else {
- ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + global_var.value[l][k] + '</span></td>';
- }
- }
- ret += '</tr>';
- }
- }
- if (global_var.rows == 0) {
- ret += '<tr><td></td></tr>';
- }
- 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>';
- ret += '</table>';
- 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>';
- }
- }
- global_container.find(".div_valor_var").html('');
- ret = $(ret);
- ret.find('.span_value_variable').data('associatedOject', global_var);
- ret.find(".boolean_simple_type").on('click', function (e) {
- alternateBooleanGlobalValue(global_var, this.parentNode);
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
- });
- ret.find(".simple_var").on('click', function (e) {
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
- enableGlobalValueUpdate(global_var, this.parentNode);
- });
- ret.find(".boolean_vector_var").on('click', function (e) {
- alternateBooleanGlobalVectorValue(global_var, $(this).data('index'), this.parentNode);
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
- });
- ret.find(".vector_var").on('click', function (e) {
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
- enableGlobalVectorValueUpdate(global_var, $(this).data('index'), this.parentNode);
- });
- ret.find(".remove_global_vector_column").on('click', function (e) {
- removeGlobalColumnVector(global_var);
- global_container.find(".div_valor_var").html('');
- 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);
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
- renderValues(global_var, global_container);
- });
- ret.find(".add_global_vector_column").on('click', function (e) {
- addGlobalColumnVector(global_var);
- 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);
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
- global_container.find(".div_valor_var").html('');
- renderValues(global_var, global_container);
- });
- ret.find(".remove_global_matrix_column").on('click', function (e) {
- removeColumnGlobalMatrix(global_var);
- 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);
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
- global_container.find(".div_valor_var").html('');
- renderValues(global_var, global_container);
- });
- ret.find(".add_global_matrix_column").on('click', function (e) {
- addColumnGlobalMatrix(global_var);
- 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);
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
- global_container.find(".div_valor_var").html('');
- renderValues(global_var, global_container);
- });
- ret.find(".remove_global_matrix_line").on('click', function (e) {
- removeLineGlobalMatrix(global_var);
- 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);
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
- global_container.find(".div_valor_var").html('');
- renderValues(global_var, global_container);
- });
- ret.find(".add_global_matrix_line").on('click', function (e) {
- addLineGlobalMatrix(global_var);
- 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);
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerSystemEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
- global_container.find(".div_valor_var").html('');
- renderValues(global_var, global_container);
- });
- ret.find(".boolean_matrix_var").on('click', function (e) {
- alternateBooleanGlobalMatrixValue(global_var, $(this).data('row'), $(this).data('index'), this.parentNode);
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
- });
- ret.find(".matrix_var").on('click', function (e) {
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_VALUE);
- enableGlobalMatrixValueUpdate(global_var, $(this).data('row'), $(this).data('index'), this.parentNode);
- });
- global_container.find(".div_valor_var").append(ret);
- updateColumnsAndRowsText(global_container, global_var);
- }
- function addHandlers(global_container) {
- var global_var = global_container.data('associatedOject'); // Manage constant option:
- global_container.find(".alternate_constant").on('click', function (e) {
- toggleConstant(global_var);
- $(this).removeClass("on off");
- if (global_var.is_constant) {
- $(this).addClass("on");
- } else {
- $(this).addClass("off");
- }
- }); // Manage global name:
- global_container.find(".editing_name_var").on('click', function (e) {
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_GLOBAL_NAME);
- enableNameUpdate(global_container);
- }); // Menu to change type:
- global_container.find('.ui.dropdown.global_type').dropdown({
- onChange: function onChange(_, __, $selectedItem) {
- if ($selectedItem.data('dimensions')) {
- updateType(global_var, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], $selectedItem.data('dimensions'));
- } else {
- updateType(global_var, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')]);
- }
- renderValues(global_var, global_container);
- },
- selectOnKeydown: false
- }); // Remove global:
- global_container.find(".remove_global").on('click', function (e) {
- removeGlobal(global_var, global_container);
- });
- }
- function updateColumnsAndRowsText(global_container, global_var) {
- var prev = global_container.find('.text').text().split('[');
- if (prev.length == 2) {
- var ff = prev[0] + '[ ' + global_var.columns + ' ] ';
- global_container.find('.text').empty();
- global_container.find('.text').text(ff);
- }
- if (prev.length == 3) {
- var ff = prev[0] + '[ ' + global_var.columns + ' ] [ ' + global_var.rows + ' ] ';
- global_container.find('.text').empty();
- global_container.find('.text').text(ff);
- }
- }
- function renderGlobal(global_var) {
- var element = '<div class="ui label global_container pink"><i class="ui icon ellipsis vertical inverted"></i><div class="global_const">const: ';
- element += '<i class="ui icon toggle ' + (global_var.is_constant ? "on" : "off") + ' alternate_constant"></i></div>';
- element += '<div class="ui dropdown global_type">';
- if (global_var.dimensions == 1) {
- 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));
- element += ' [ <span class="dimensions_0"></span> ] ';
- element += '</div>';
- } else if (global_var.dimensions == 2) {
- 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));
- element += ' [ <span class="dimensions_0"></span> ] [ <span class="dimensions_1"></span> ] ';
- element += '</div>';
- } else {
- element += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(global_var.type.toLowerCase())) + '</div>';
- }
- element += '<div class="menu">';
- for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
- if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
- continue;
- }
- 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>';
- }
- 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">';
- for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
- if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
- continue;
- }
- 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>';
- }
- element += '</div></div>';
- 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">';
- for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
- if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
- continue;
- }
- 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>';
- }
- element += '</div></div>';
- 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"> <— </span> ';
- element += '<div class="ui div_valor_var">' + global_var.value + '</div>';
- element += ' <i class="yellow inverted icon times remove_global"></i></div>';
- var complete_element = $(element);
- complete_element.data('associatedOject', global_var);
- $('.list_globals').append(complete_element);
- addHandlers(complete_element);
- renderValues(global_var, complete_element);
- if (global_var.dimensions == 1) {
- complete_element.find('.dimensions_0').text(global_var.columns);
- }
- if (global_var.dimensions == 2) {
- complete_element.find('.dimensions_0').text(global_var.columns);
- complete_element.find('.dimensions_1').text(global_var.rows);
- }
- return complete_element;
- }
- var opened_name_value_matrix_global_v = false;
- var opened_input_value_matrix_global_v = null;
- function enableGlobalMatrixValueUpdate(global_var, row, index, parent_node) {
- if (opened_name_value_matrix_global_v) {
- opened_input_value_matrix_global_v.focus();
- return;
- }
- parent_node = $(parent_node);
- opened_name_value_matrix_global_v = true;
- parent_node.find('.span_value_variable').text('');
- var input_field;
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- 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) + "' />");
- input_field.insertBefore(parent_node.find('.span_value_variable'));
- } else {
- 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] + "' />");
- input_field.insertBefore(parent_node.find('.span_value_variable'));
- }
- input_field.on('input', function () {
- var inputWidth = input_field.textWidth() + 10;
- opened_input_value_matrix_global_v = input_field;
- input_field.focus();
- var tmpStr = input_field.val();
- input_field.val('');
- input_field.val(tmpStr);
- input_field.css({
- width: inputWidth
- });
- }).trigger('input');
- input_field.focusout(function () {
- /// update array:
- if (input_field.val().trim()) {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- global_var.value[row][index] = parseFloat(input_field.val().trim());
- parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
- } else {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
- global_var.value[row][index] = parseInt(input_field.val().trim());
- } else {
- global_var.value[row][index] = input_field.val().trim();
- }
- parent_node.find('.span_value_variable').text(global_var.value[row][index]);
- }
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
- } else {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
- } else {
- parent_node.find('.span_value_variable').text(global_var.value[row][index]);
- }
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- global_var.value[row][index] = input_field.val();
- parent_node.find('.span_value_variable').text(global_var.value[row][index]);
- }
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_value_matrix_global_v = false;
- opened_input_value_matrix_global_v = false;
- });
- input_field.on('keydown', function (e) {
- var code = e.keyCode || e.which;
- if (code == 13) {
- if (input_field.val().trim()) {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- global_var.value[row][index] = parseFloat(input_field.val().trim());
- parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
- } else {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
- global_var.value[row][index] = parseInt(input_field.val().trim());
- } else {
- global_var.value[row][index] = input_field.val().trim();
- }
- parent_node.find('.span_value_variable').text(global_var.value[row][index]);
- }
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
- } else {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
- } else {
- parent_node.find('.span_value_variable').text(global_var.value[row][index]);
- }
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- global_var.value[row][index] = input_field.val();
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
- parent_node.find('.span_value_variable').text(global_var.value[row][index]);
- }
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_value_matrix_global_v = false;
- opened_input_value_matrix_global_v = false;
- }
- if (code == 27) {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- parent_node.find('.span_value_variable').text(global_var.value[row][index].toFixed(1));
- } else {
- parent_node.find('.span_value_variable').text(global_var.value[row][index]);
- }
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_value_matrix_global_v = false;
- opened_input_value_matrix_global_v = false;
- }
- });
- input_field.select();
- }
- var opened_name_value_global_var = false;
- var opened_input_value_global_ar = null;
- function enableGlobalValueUpdate(global_var, parent_node) {
- if (opened_name_value_global_var) {
- opened_input_value_global_ar.focus();
- return;
- }
- parent_node = $(parent_node);
- opened_name_value_global_var = true;
- parent_node.find('.span_value_variable').text('');
- var input_field;
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- 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) + "' />");
- input_field.insertBefore(parent_node.find('.span_value_variable'));
- } else {
- input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.value + "' />");
- input_field.insertBefore(parent_node.find('.span_value_variable'));
- }
- input_field.on('input', function () {
- var inputWidth = input_field.textWidth() + 10;
- opened_input_value_global_ar = input_field;
- input_field.focus();
- var tmpStr = input_field.val();
- input_field.val('');
- input_field.val(tmpStr);
- input_field.css({
- width: inputWidth
- });
- }).trigger('input');
- input_field.focusout(function () {
- var changed = false; /// update array:
- if (input_field.val().trim()) {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- global_var.value = parseFloat(input_field.val().trim());
- parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
- } else {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
- global_var.value = parseInt(input_field.val().trim());
- } else if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
- global_var.value = input_field.val().charAt(0);
- } else {
- global_var.value = input_field.val().trim();
- }
- parent_node.find('.span_value_variable').text(global_var.value);
- }
- changed = true;
- } else {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
- } else {
- parent_node.find('.span_value_variable').text(global_var.value);
- }
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- global_var.value = input_field.val();
- changed = true;
- parent_node.find('.span_value_variable').text(global_var.value);
- }
- if (changed) {
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
- }
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_value_global_var = false;
- opened_input_value_global_ar = false;
- });
- input_field.on('keydown', function (e) {
- var code = e.keyCode || e.which;
- var changed = true;
- if (code == 13) {
- if (input_field.val().trim()) {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- global_var.value = parseFloat(input_field.val().trim());
- parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
- } else {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
- global_var.value = parseInt(input_field.val().trim());
- } else if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
- global_var.value = input_field.val().charAt(0);
- } else {
- global_var.value = input_field.val().trim();
- }
- parent_node.find('.span_value_variable').text(global_var.value);
- }
- changed = true;
- } else {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
- } else {
- parent_node.find('.span_value_variable').text(global_var.value);
- }
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- global_var.value = input_field.val();
- changed = true;
- parent_node.find('.span_value_variable').text(global_var.value);
- }
- if (changed) {
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
- }
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_value_global_var = false;
- opened_input_value_global_ar = false;
- }
- if (code == 27) {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- parent_node.find('.span_value_variable').text(global_var.value.toFixed(1));
- } else {
- parent_node.find('.span_value_variable').text(global_var.value);
- }
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_value_global_var = false;
- opened_input_value_global_ar = false;
- }
- });
- input_field.select();
- }
- var opened_name_global = false;
- var opened_input_global = null;
- function enableNameUpdate(global_container) {
- var global_var = global_container.data('associatedOject');
- if (opened_name_global) {
- opened_input_global.focus();
- return;
- }
- opened_name_global = true;
- global_container.find('.span_name_variable').text('');
- var input_name = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.name + "' />");
- input_name.insertBefore(global_container.find('.span_name_variable'));
- input_name.on('input', function () {
- var inputWidth = input_name.textWidth() + 10;
- opened_input_global = input_name;
- opened_input_global.focus();
- opened_input_global.css({
- width: inputWidth
- });
- }).trigger('input');
- input_name.focusout(function () {
- /// update array:
- if (input_name.val().trim().length > 0) {
- updateName(global_var, input_name.val().trim(), global_container);
- global_container.find('.span_name_variable').text(global_var.name);
- } else {
- global_container.find('.span_name_variable').text(global_var.name);
- }
- input_name.off();
- input_name.remove(); /// update elements:
- opened_name_global = false;
- opened_input_global = false;
- });
- input_name.on('keydown', function (e) {
- var code = e.keyCode || e.which;
- if (code == 13) {
- if (input_name.val().trim()) {
- updateName(global_var, input_name.val().trim(), global_container);
- global_container.find('.span_name_variable').text(global_var.name);
- } else {
- global_container.find('.span_name_variable').text(global_var.name);
- }
- input_name.off();
- input_name.remove(); /// update elements:
- opened_name_global = false;
- opened_input_global = false;
- }
- if (code == 27) {
- global_container.find('.span_name_variable').text(global_var.name);
- input_name.off();
- input_name.remove(); /// update elements:
- opened_name_global = false;
- opened_input_global = false;
- }
- });
- input_name.select();
- }
- var opened_name_value_vector_global_ = false;
- var opened_input_value_vector_global_ = null;
- function enableGlobalVectorValueUpdate(global_var, index, parent_node) {
- if (opened_name_value_vector_global_) {
- opened_input_value_vector_global_.focus();
- return;
- }
- parent_node = $(parent_node);
- opened_name_value_vector_global_ = true;
- parent_node.find('.span_value_variable').text('');
- var input_field;
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- 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) + "' />");
- input_field.insertBefore(parent_node.find('.span_value_variable'));
- } else {
- input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + global_var.value[index] + "' />");
- input_field.insertBefore(parent_node.find('.span_value_variable'));
- }
- input_field.on('input', function () {
- var inputWidth = input_field.textWidth() + 10;
- opened_input_value_vector_global_ = input_field;
- input_field.focus();
- var tmpStr = input_field.val();
- input_field.val('');
- input_field.val(tmpStr);
- input_field.css({
- width: inputWidth
- });
- }).trigger('input');
- input_field.focusout(function () {
- var changed = false; /// update array:
- if (input_field.val().trim()) {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- global_var.value[index] = parseFloat(input_field.val().trim());
- parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
- } else {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
- global_var.value[index] = parseInt(input_field.val().trim());
- } else {
- global_var.value[index] = input_field.val().trim();
- }
- parent_node.find('.span_value_variable').text(global_var.value[index]);
- }
- changed = true;
- } else {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
- } else {
- parent_node.find('.span_value_variable').text(global_var.value[index]);
- }
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- global_var.value[index] = input_field.val();
- changed = true;
- parent_node.find('.span_value_variable').text(global_var.value[index]);
- }
- if (changed) {
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
- }
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_value_vector_global_ = false;
- opened_input_value_vector_global_ = false;
- });
- input_field.on('keydown', function (e) {
- var code = e.keyCode || e.which;
- var changed = false;
- if (code == 13) {
- if (input_field.val().trim()) {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- global_var.value[index] = parseFloat(input_field.val().trim());
- parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
- } else {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
- global_var.value[index] = parseInt(input_field.val().trim());
- } else {
- global_var.value[index] = input_field.val().trim();
- }
- parent_node.find('.span_value_variable').text(global_var.value[index]);
- }
- changed = true;
- } else {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
- } else {
- parent_node.find('.span_value_variable').text(global_var.value[index]);
- }
- }
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- global_var.value[index] = input_field.val();
- changed = true;
- parent_node.find('.span_value_variable').text(global_var.value[index]);
- }
- if (changed) {
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(global_var.name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].CHANGE_GLOBAL_VALUE, global_var.value);
- }
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_value_vector_global_ = false;
- opened_input_value_vector_global_ = false;
- }
- if (code == 27) {
- if (global_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- parent_node.find('.span_value_variable').text(global_var.value[index].toFixed(1));
- } else {
- parent_node.find('.span_value_variable').text(global_var.value[index]);
- }
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_value_vector_global_ = false;
- opened_input_value_vector_global_ = false;
- }
- });
- input_field.select();
- }
- $.fn.textWidth = function (text, font) {
- if (!$.fn.textWidth.fakeEl) $.fn.textWidth.fakeEl = $('<span>').hide().appendTo(document.body);
- $.fn.textWidth.fakeEl.text(text || this.val() || this.text() || this.attr('placeholder')).css('font', font || this.css('font'));
- return $.fn.textWidth.fakeEl.width();
- };
- /***/ }),
- /***/ "./js/visualUI/ivprog_elements.js":
- /*!****************************************!*\
- !*** ./js/visualUI/ivprog_elements.js ***!
- \****************************************/
- /*! 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 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMMAND_TYPES", function() { return COMMAND_TYPES; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARITHMETIC_TYPES", function() { return ARITHMETIC_TYPES; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXPRESSION_ELEMENTS", function() { return EXPRESSION_ELEMENTS; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXPRESSION_TYPES", function() { return EXPRESSION_TYPES; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARITHMETIC_COMPARISON", function() { return ARITHMETIC_COMPARISON; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LOGIC_COMPARISON", function() { return LOGIC_COMPARISON; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SYSTEM_FUNCTIONS_CATEGORIES", function() { return SYSTEM_FUNCTIONS_CATEGORIES; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Variable", function() { return Variable; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Function", function() { return Function; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SystemFunction", function() { return SystemFunction; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Comment", function() { return Comment; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Break", function() { return Break; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Reader", function() { return Reader; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Writer", function() { return Writer; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Attribution", function() { return Attribution; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpressionOperator", function() { return ExpressionOperator; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpressionElement", function() { return ExpressionElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConditionalExpression", function() { return ConditionalExpression; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogicExpression", function() { return LogicExpression; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArithmeticExpression", function() { return ArithmeticExpression; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IfTrue", function() { return IfTrue; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RepeatNTimes", function() { return RepeatNTimes; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WhileTrue", function() { return WhileTrue; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DoWhileTrue", function() { return DoWhileTrue; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return Switch; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Return", function() { return Return; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SwitchCase", function() { return SwitchCase; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCall", function() { return FunctionCall; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VariableValueMenu", function() { return VariableValueMenu; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionCallMenu", function() { return FunctionCallMenu; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Program", function() { return Program; });
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js");
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js");
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
- /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! melanke-watchjs */ "./node_modules/melanke-watchjs/src/watch.js");
- /* harmony import */ var melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(melanke_watchjs__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _algorithm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./algorithm */ "./js/visualUI/algorithm.js");
- var COMMAND_TYPES = Object.freeze({
- "function": "function",
- comment: "comment",
- reader: "reader",
- writer: "writer",
- attribution: "attribution",
- iftrue: "iftrue",
- repeatNtimes: "repeatNtimes",
- whiletrue: "whiletrue",
- dowhiletrue: "dowhiletrue",
- "switch": "switch",
- switchcase: "switchcase",
- functioncall: "functioncall",
- "break": "break",
- "return": "return"
- });
- var ARITHMETIC_TYPES = Object.freeze({
- plus: "plus",
- minus: "minus",
- multiplication: "multiplication",
- division: "division",
- module: "module",
- none: "none"
- });
- var EXPRESSION_ELEMENTS = Object.freeze({
- exp_op_exp: "exp_op_exp",
- op_exp: "op_exp",
- par_exp_par: "par_exp_par",
- start_point: "start_point"
- });
- var EXPRESSION_TYPES = Object.freeze({
- exp_conditional: "exp_conditional",
- exp_logic: "exp_logic",
- exp_arithmetic: "exp_arithmetic",
- write_sep: "write_separator"
- });
- var ARITHMETIC_COMPARISON = Object.freeze({
- greater_than: "greater_than",
- less_than: "less_than",
- equals_to: "equals_to",
- not_equals_to: "not_equals_to",
- greater_than_or_equals_to: "greater_than_or_equals_to",
- less_than_or_equals_to: "less_than_or_equals_to"
- });
- var LOGIC_COMPARISON = Object.freeze({
- equals_to: "equals_to",
- not_equals_to: "not_equals_to",
- and: "and",
- or: "or",
- not: "not"
- });
- var SYSTEM_FUNCTIONS_CATEGORIES = Object.freeze({
- math: "$mathLib",
- text: "$strLib",
- arrangement: "$arrayLib",
- conversion: "$langLib"
- });
- var Variable = function Variable(type, name, value) {
- var dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
- var is_constant = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
- var rows = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
- var columns = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Variable);
- this.type = type;
- this.name = name;
- this.value = value;
- this.dimensions = dimensions;
- this.is_constant = is_constant;
- this.rows = rows;
- this.columns = columns;
- };
- var Function = function Function(name) {
- var return_type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _types__WEBPACK_IMPORTED_MODULE_2__["Types"].VOID;
- var return_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
- var parameters_list = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
- var is_main = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
- var is_hidden = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
- var variables_list = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [];
- var function_comment = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
- var commands = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : [];
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Function);
- this.type = COMMAND_TYPES["function"];
- this.name = name;
- this.return_type = return_type;
- this.return_dimensions = return_dimensions;
- this.parameters_list = parameters_list;
- this.is_main = is_main;
- this.is_hidden = is_hidden;
- this.variables_list = variables_list;
- this.function_comment = function_comment;
- this.commands = commands;
- };
- var SystemFunction = function SystemFunction(identifier, return_type, return_dimensions, parameters_list) {
- var function_comment = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
- var category = arguments.length > 5 ? arguments[5] : undefined;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, SystemFunction);
- this.type = COMMAND_TYPES["function"];
- this.identifier = identifier;
- this.return_type = return_type;
- this.return_dimensions = return_dimensions;
- this.parameters_list = parameters_list;
- this.function_comment = function_comment;
- this.category = category;
- };
- var Comment = function Comment(comment_text) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Comment);
- this.type = COMMAND_TYPES.comment;
- this.comment_text = comment_text;
- };
- var Break = function Break() {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Break);
- this.type = COMMAND_TYPES["break"];
- };
- var Reader = function Reader() {
- var variable_value_menu = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new VariableValueMenu();
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Reader);
- this.type = COMMAND_TYPES.reader;
- this.variable_value_menu = variable_value_menu;
- };
- var Writer = function Writer(content) {
- var newline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Writer);
- this.type = COMMAND_TYPES.writer;
- this.content = content;
- this.newline = newline;
- };
- var Attribution = function Attribution(variable) {
- var expression = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Attribution);
- this.type = COMMAND_TYPES.attribution;
- this.variable = variable;
- this.expression = expression;
- };
- var ExpressionOperator = function ExpressionOperator(type_op, item) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ExpressionOperator);
- this.type_op = type_op; // Logic, Arithmetic OR Relational
- this.item = item;
- };
- var ExpressionElement = function ExpressionElement(type_exp) {
- var itens = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ExpressionElement);
- this.type_exp = type_exp;
- this.itens = itens;
- };
- var ConditionalExpression = function ConditionalExpression(expression) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ConditionalExpression);
- this.type = EXPRESSION_TYPES.exp_conditional;
- this.expression = expression;
- };
- var LogicExpression = function LogicExpression(has_neg, first_operand, second_operand, operator) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, LogicExpression);
- this.type = EXPRESSION_TYPES.exp_logic;
- this.has_neg = has_neg;
- this.first_operand = first_operand;
- this.second_operand = second_operand;
- this.operator = operator;
- };
- var ArithmeticExpression = function ArithmeticExpression(first_operand, second_operand, operator) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ArithmeticExpression);
- this.type = EXPRESSION_TYPES.exp_arithmetic;
- this.first_operand = first_operand;
- this.second_operand = second_operand;
- this.operator = operator;
- };
- var IfTrue = function IfTrue(expression, commands_block, commands_else) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, IfTrue);
- this.type = COMMAND_TYPES.iftrue;
- this.expression = expression;
- this.commands_block = commands_block;
- this.commands_else = commands_else;
- };
- var RepeatNTimes = function RepeatNTimes(var_attribution, var_incrementation, expression1, expression2, expression3, commands_block) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, RepeatNTimes);
- this.type = COMMAND_TYPES.repeatNtimes;
- this.var_attribution = var_attribution;
- this.var_incrementation = var_incrementation;
- this.expression1 = expression1;
- this.expression2 = expression2;
- this.expression3 = expression3;
- this.commands_block = commands_block;
- };
- var WhileTrue = function WhileTrue(expression, commands_block) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, WhileTrue);
- this.type = COMMAND_TYPES.whiletrue;
- this.expression = expression;
- this.commands_block = commands_block;
- };
- var DoWhileTrue = function DoWhileTrue(expression, commands_block) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, DoWhileTrue);
- this.type = COMMAND_TYPES.dowhiletrue;
- this.expression = expression;
- this.commands_block = commands_block;
- };
- var Switch = function Switch(variable) {
- var cases = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Switch);
- this.type = COMMAND_TYPES["switch"];
- this.variable = variable;
- this.cases = cases;
- };
- var Return = function Return(variable_value_menu) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Return);
- this.type = COMMAND_TYPES["return"];
- this.variable_value_menu = variable_value_menu;
- };
- var SwitchCase = function SwitchCase(variable_value_menu) {
- var commands_block = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, SwitchCase);
- this.type = COMMAND_TYPES.switchcase;
- this.variable_value_menu = variable_value_menu;
- this.commands_block = commands_block;
- };
- var FunctionCall = function FunctionCall(function_called, parameters_list) {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, FunctionCall);
- this.type = COMMAND_TYPES.functioncall;
- this.function_called = function_called;
- this.parameters_list = parameters_list;
- };
- var VariableValueMenu = function VariableValueMenu() {
- var variable_and_value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 7;
- var content = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
- var row = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
- var column = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
- var include_constant = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
- var dimensions = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, VariableValueMenu);
- this.type = "var_value";
- this.variable_and_value = variable_and_value;
- this.content = content;
- this.row = row;
- this.column = column;
- this.include_constant = include_constant;
- this.dimensions = dimensions;
- };
- var FunctionCallMenu = function FunctionCallMenu() {
- var function_called = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
- var parameters_list = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, FunctionCallMenu);
- this.type = "function_call";
- this.function_called = function_called;
- this.parameters_list = parameters_list;
- };
- var Program = /*#__PURE__*/function () {
- function Program() {
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Program);
- this.functions = [];
- this.globals = [];
- }
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_0___default()(Program, [{
- key: "addFunction",
- value: function addFunction(function_to_add) {
- melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default.a.watch(function_to_add.parameters_list, function () {
- if (window.insertContext) {
- setTimeout(function () {
- _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
- }, 300);
- window.insertContext = false;
- } else {
- _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
- }
- }, 1);
- melanke_watchjs__WEBPACK_IMPORTED_MODULE_3___default.a.watch(function_to_add.variables_list, function () {
- if (window.insertContext) {
- setTimeout(function () {
- _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
- }, 300);
- window.insertContext = false;
- } else {
- _algorithm__WEBPACK_IMPORTED_MODULE_4__["renderAlgorithm"]();
- }
- }, 1);
- this.functions.push(function_to_add);
- }
- }, {
- key: "addVariable",
- value: function addVariable(function_to_receive, variable) {
- if (this.functions[function_to_receive].variable === null) {
- this.functions[function_to_receive].variables_list = [];
- }
- this.functions[function_to_receive].variables_list.push(variable);
- }
- }, {
- key: "addGlobal",
- value: function addGlobal(variable) {
- this.globals.push(variable);
- }
- }]);
- return Program;
- }();
- /***/ }),
- /***/ "./js/visualUI/text_editor.js":
- /*!************************************!*\
- !*** ./js/visualUI/text_editor.js ***!
- \************************************/
- /*! exports provided: initTextEditor, disable, updateEditor, setCode, getCode */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initTextEditor", function() { return initTextEditor; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disable", function() { return disable; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateEditor", function() { return updateEditor; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCode", function() { return setCode; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCode", function() { return getCode; });
- /* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! codemirror */ "./node_modules/codemirror/lib/codemirror.js");
- /* harmony import */ var codemirror__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(codemirror__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! codemirror/addon/edit/closebrackets */ "./node_modules/codemirror/addon/edit/closebrackets.js");
- /* harmony import */ var codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_edit_closebrackets__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! codemirror/addon/edit/matchbrackets */ "./node_modules/codemirror/addon/edit/matchbrackets.js");
- /* harmony import */ var codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_2__);
- /* 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");
- /* 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__);
- /* harmony import */ var _util_editorMode2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../util/editorMode2 */ "./js/util/editorMode2.js");
- // import "codemirror/addon/hint/show-hint";
- // import "codemirror/addon/hint/anyword-hint";
- Object(_util_editorMode2__WEBPACK_IMPORTED_MODULE_4__["CodeEditorMode"])(codemirror__WEBPACK_IMPORTED_MODULE_0__);
- var codeEditor = null;
- function initTextEditor(element) {
- var id = element;
- if (element[0] == '#') {
- id = element.substring(1);
- }
- codeEditor = codemirror__WEBPACK_IMPORTED_MODULE_0__["fromTextArea"](document.getElementById(id), {
- theme: "ttcn",
- value: "",
- mode: "text/x-ivprog",
- indentUnit: 4,
- lineNumbers: true,
- matchBrackets: true,
- autoCloseBrackets: true,
- fixedGutter: true,
- styleActiveLine: true,
- readOnly: true
- });
- }
- function disable(flag) {
- codeEditor.setOption("readOnly", flag);
- updateEditor();
- }
- function updateEditor() {
- codeEditor.refresh();
- }
- function setCode(code) {
- codeEditor.setValue(code);
- }
- function getCode() {
- return codeEditor.getValue();
- }
- /***/ }),
- /***/ "./js/visualUI/types.js":
- /*!******************************!*\
- !*** ./js/visualUI/types.js ***!
- \******************************/
- /*! exports provided: Types */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Types", function() { return Types; });
- var Types = Object.freeze({
- INTEGER: "integer",
- REAL: "real",
- TEXT: "text",
- CHAR: 'char',
- BOOLEAN: "boolean",
- VOID: "void"
- });
- /***/ }),
- /***/ "./js/visualUI/utils.js":
- /*!******************************!*\
- !*** ./js/visualUI/utils.js ***!
- \******************************/
- /*! exports provided: renderErrorMessage */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderErrorMessage", function() { return renderErrorMessage; });
- function renderErrorMessage(dom_obj_target, message_text) {
- dom_obj_target.popup({
- html: '<i class="ui icon inverted exclamation triangle yellow"></i>' + message_text,
- transition: "fade up",
- on: 'click',
- closable: true,
- movePopup: true,
- boundary: window,
- preserve: false,
- target: false,
- className: {
- popup: 'ui popup invalid-identifier'
- },
- onHidden: function onHidden($module) {
- dom_obj_target.popup('destroy');
- }
- }).popup('toggle');
- }
- /***/ }),
- /***/ "./js/visualUI/variables.js":
- /*!**********************************!*\
- !*** ./js/visualUI/variables.js ***!
- \**********************************/
- /*! exports provided: addVariable, renderVariable */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addVariable", function() { return addVariable; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderVariable", function() { return renderVariable; });
- /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./js/visualUI/types.js");
- /* harmony import */ var _ivprog_elements__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ivprog_elements */ "./js/visualUI/ivprog_elements.js");
- /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
- /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
- /* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
- var counter_new_variables = 0;
- function addVariable(function_obj, function_container) {
- var is_in_click = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- 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);
- if (function_obj.variables_list == null) {
- function_obj.variables_list = [];
- }
- function_obj.variables_list.push(new_var);
- counter_new_variables++;
- 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);
- var newe = renderVariable(function_container, new_var, function_obj);
- if (is_in_click) {
- newe.css('display', 'none');
- newe.fadeIn();
- }
- }
- function updateName(variable_obj, new_name, variable_obj_dom, function_obj) {
- if (variable_obj.name == new_name) {
- return;
- }
- if (Object(_util_utils__WEBPACK_IMPORTED_MODULE_5__["isValidIdentifier"])(new_name)) {
- if (variableNameAlreadyExists(new_name, function_obj)) {
- _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]));
- } else {
- 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);
- variable_obj.name = new_name;
- }
- } else {
- _utils__WEBPACK_IMPORTED_MODULE_3__["renderErrorMessage"](variable_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getError('inform_valid_identifier'));
- }
- }
- function variableNameAlreadyExists(name_var, function_obj) {
- if (function_obj.parameters_list) {
- for (var i = 0; i < function_obj.parameters_list.length; i++) {
- if (function_obj.parameters_list[i].name == name_var) {
- return true;
- }
- }
- }
- if (function_obj.variables_list) {
- for (var i = 0; i < function_obj.variables_list.length; i++) {
- if (function_obj.variables_list[i].name == name_var) {
- return true;
- }
- }
- }
- return false;
- }
- function removeVariable(variable_obj, variable_container, function_name) {
- var function_associated = variable_container.data('associatedFunction');
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].REMOVE_FUNCTION_VAR, variable_obj.name);
- var index = function_associated.variables_list.indexOf(variable_obj);
- if (index > -1) {
- window.insertContext = true;
- delete function_associated.variables_list[index];
- function_associated.variables_list.splice(index, 1);
- }
- variable_container.children().off();
- variable_container.off();
- variable_container.fadeOut();
- }
- function updateType(variable_obj, new_type, function_name) {
- var new_dimensions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
- variable_obj.type = new_type;
- variable_obj.dimensions = new_dimensions;
- if (new_dimensions > 0) {
- variable_obj.rows = new_dimensions;
- variable_obj.columns = 2;
- }
- 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);
- updateInitialValues(variable_obj, function_name);
- }
- function addHandlers(variable_obj, variable_container, function_obj) {
- // Manage variable name:
- variable_container.find(".editing_name_var").on('click', function (e) {
- 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);
- enableNameUpdate(variable_obj, variable_container, function_obj);
- }); // Menu to change type:
- variable_container.find('.ui.dropdown.variable_type').dropdown({
- onChange: function onChange(_, __, $selectedItem) {
- if ($selectedItem.data('dimensions')) {
- updateType(variable_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name, $selectedItem.data('dimensions'));
- } else {
- updateType(variable_obj, _types__WEBPACK_IMPORTED_MODULE_0__["Types"][$selectedItem.data('type')], function_obj.name);
- }
- renderValues(variable_obj, variable_container, function_obj.name);
- },
- selectOnKeydown: false
- }); // Remove variable:
- variable_container.find(".remove_variable").on('click', function (e) {
- removeVariable(variable_obj, variable_container, function_obj.name);
- });
- }
- function renderVariable(function_container, new_var, function_obj) {
- var element = '<div class="ui label variable_container pink"><i class="ui icon ellipsis vertical inverted"></i>';
- element += '<div class="ui dropdown variable_type">';
- if (new_var.dimensions == 1) {
- 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()));
- element += ' [ ] </div>';
- } else if (new_var.dimensions == 2) {
- 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()));
- element += ' [ ] [ ] </div>';
- } else {
- element += '<div class="text">' + _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("type_".concat(new_var.type.toLowerCase())) + '</div>';
- }
- element += '<div class="menu">';
- for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
- if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
- continue;
- }
- 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>';
- }
- 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">';
- for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
- if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
- continue;
- }
- 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>';
- }
- element += '</div></div>';
- 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">';
- for (var tm in _types__WEBPACK_IMPORTED_MODULE_0__["Types"]) {
- if (tm == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].VOID.toUpperCase()) {
- continue;
- }
- 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>';
- }
- element += '</div></div>';
- element += '</div></div> ';
- element += '<div class="editing_name_var"><span class="span_name_variable enable_edit_name_variable">' + new_var.name + '</span> </div>';
- element += ' <span class="character_equals"> <— </span> <div class="ui div_valor_var">' + new_var.value + '</div>';
- element += ' <i class="yellow inverted icon times remove_variable"></i></div>';
- element = $(element);
- element.data('associatedFunction', function_obj);
- function_container.find('.variables_list_div').append(element);
- addHandlers(new_var, element, function_obj);
- renderValues(new_var, element, function_obj.name);
- return element;
- }
- function updateColumnsAndRowsText(variable_container, variable_var) {
- var prev = variable_container.find('.text').text().split('[');
- if (prev.length == 2) {
- var ff = prev[0] + '[ ' + variable_var.columns + ' ] ';
- variable_container.find('.text').empty();
- variable_container.find('.text').text(ff);
- }
- if (prev.length == 3) {
- var ff = prev[0] + '[ ' + variable_var.columns + ' ] [ ' + variable_var.rows + ' ] ';
- variable_container.find('.text').empty();
- variable_container.find('.text').text(ff);
- }
- }
- function renderValues(new_var, variable_container, function_name) {
- var ret = "";
- var j = 0;
- if (new_var.dimensions == 0) {
- if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + new_var.value.toFixed(1) + '</span> </div> ';
- } else {
- if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
- 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> ';
- } else {
- ret += '<div class="created_div_valor_var"><span class="span_value_variable simple_var">' + new_var.value + '</span> </div> ';
- }
- }
- } else {
- ret += '<table class="tabela_var">';
- if (new_var.dimensions == 1) {
- ret += '<tr>';
- if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- for (var k = 0; k < new_var.columns; k++) {
- ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + new_var.value[k].toFixed(1) + '</span></td>';
- }
- } else {
- for (var k = 0; k < new_var.columns; k++) {
- if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
- 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>';
- } else {
- ret += '<td><span class="span_value_variable vector_var" data-index="' + k + '">' + new_var.value[k] + '</span>' + '</td>';
- }
- }
- }
- ret += '</tr>';
- ret += '</table>';
- 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>';
- }
- if (new_var.dimensions == 2) {
- if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- for (var l = 0; l < new_var.rows; l++) {
- ret += '<tr>';
- for (var k = 0; k < new_var.columns; k++) {
- ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + new_var.value[l][k].toFixed(1) + '</span>' + '</td>';
- }
- ret += '</tr>';
- }
- } else {
- for (var l = 0; l < new_var.rows; l++) {
- ret += '<tr>';
- for (var k = 0; k < new_var.columns; k++) {
- if (new_var.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
- 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>';
- } else {
- ret += '<td><span class="span_value_variable matrix_var" data-index="' + k + '" data-row="' + l + '">' + new_var.value[l][k] + '</span></td>';
- }
- }
- ret += '</tr>';
- }
- }
- if (new_var.rows == 0) {
- ret += '<tr><td></td></tr>';
- }
- 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>';
- ret += '</table>';
- 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>';
- }
- }
- $(variable_container).find(".div_valor_var").html('');
- ret = $(ret);
- $(ret).find('.span_value_variable').data('associatedOject', new_var);
- $(ret).find(".boolean_simple_type").on('click', function (e) {
- 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);
- alternateBooleanValue(new_var, this.parentNode);
- });
- $(ret).find(".simple_var").on('click', function (e) {
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_VAR_VALUE, new_var.name);
- enableValueUpdate(new_var, this.parentNode, function_name);
- });
- $(ret).find(".boolean_vector_var").on('click', function (e) {
- alternateBooleanVectorValue(new_var, $(this).data('index'), this.parentNode);
- 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);
- });
- $(ret).find(".vector_var").on('click', function (e) {
- enableVectorValueUpdate(new_var, $(this).data('index'), this.parentNode, function_name);
- });
- $(ret).find(".remove_global_vector_column").on('click', function (e) {
- removeColumnVector(new_var);
- 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);
- 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);
- $(variable_container).find(".div_valor_var").html('');
- renderValues(new_var, variable_container, function_name);
- });
- $(ret).find(".add_global_vector_column").on('click', function (e) {
- addColumnVector(new_var);
- 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);
- 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);
- $(variable_container).find(".div_valor_var").html('');
- renderValues(new_var, variable_container, function_name);
- });
- $(ret).find(".remove_global_matrix_column").on('click', function (e) {
- removeColumnMatrix(new_var);
- 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);
- 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);
- $(variable_container).find(".div_valor_var").html('');
- renderValues(new_var, variable_container, function_name);
- });
- $(ret).find(".add_global_matrix_column").on('click', function (e) {
- addColumnMatrix(new_var);
- 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);
- 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);
- $(variable_container).find(".div_valor_var").html('');
- renderValues(new_var, variable_container, function_name);
- });
- $(ret).find(".remove_global_matrix_line").on('click', function (e) {
- removeLineMatrix(new_var);
- 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);
- 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);
- $(variable_container).find(".div_valor_var").html('');
- renderValues(new_var, variable_container, function_name);
- });
- $(ret).find(".add_global_matrix_line").on('click', function (e) {
- addLineMatrix(new_var);
- 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);
- 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);
- $(variable_container).find(".div_valor_var").html('');
- renderValues(new_var, variable_container, function_name);
- });
- $(ret).find(".boolean_matrix_var").on('click', function (e) {
- alternateBooleanMatrixValue(new_var, $(this).data('row'), $(this).data('index'), this.parentNode);
- 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);
- });
- $(ret).find(".matrix_var").on('click', function (e) {
- Object(_services_userLog__WEBPACK_IMPORTED_MODULE_4__["registerUserEvent"])(function_name, _services_userLog__WEBPACK_IMPORTED_MODULE_4__["ActionTypes"].ENTER_CHANGE_VAR_VALUE, new_var.name);
- enableMatrixValueUpdate(new_var, $(this).data('row'), $(this).data('index'), this.parentNode, function_name);
- });
- $(variable_container).find(".div_valor_var").append(ret);
- updateColumnsAndRowsText(variable_container, new_var);
- }
- function alternateBooleanMatrixValue(var_obj, row, index, value_container) {
- var_obj.value[row][index] = !var_obj.value[row][index];
- $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value[row][index])));
- }
- function addLineMatrix(var_obj) {
- var_obj.rows++;
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
- var n_l = [];
- for (var i = 0; i < var_obj.columns; i++) {
- n_l.push(0);
- }
- var_obj.value.push(n_l);
- }
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- var n_l = [];
- for (i = 0; i < var_obj.columns; i++) {
- n_l.push(0.0);
- }
- var_obj.value.push(n_l);
- }
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- var n_l = [];
- for (i = 0; i < var_obj.columns; i++) {
- n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
- }
- var_obj.value.push(n_l);
- }
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
- var n_l = [];
- for (i = 0; i < var_obj.columns; i++) {
- n_l.push(true);
- }
- var_obj.value.push(n_l);
- }
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
- var n_l = [];
- for (i = 0; i < var_obj.columns; i++) {
- n_l.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
- }
- var_obj.value.push(n_l);
- }
- }
- function removeLineMatrix(var_obj) {
- if (var_obj.rows == 0) {
- return;
- }
- var_obj.rows--;
- var_obj.value.splice(var_obj.value.length - 1, 1);
- }
- function addColumnMatrix(var_obj) {
- var_obj.columns++;
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
- for (var i = 0; i < var_obj.rows; i++) {
- var_obj.value[i].push(0);
- }
- }
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- for (var i = 0; i < var_obj.rows; i++) {
- var_obj.value[i].push(0.0);
- }
- }
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- for (var i = 0; i < var_obj.rows; i++) {
- var_obj.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
- }
- }
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
- for (var i = 0; i < var_obj.rows; i++) {
- var_obj.value[i].push(true);
- }
- }
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
- for (var i = 0; i < var_obj.rows; i++) {
- var_obj.value[i].push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
- }
- }
- }
- function removeColumnMatrix(var_obj) {
- if (var_obj.columns == 0) {
- return;
- }
- var_obj.columns--;
- for (var i = 0; i < var_obj.rows; i++) {
- var_obj.value[i].splice(var_obj.value[i].length - 1, 1);
- }
- }
- function addColumnVector(var_obj) {
- var_obj.columns++;
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
- var_obj.value.push(0);
- }
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- var_obj.value.push(0.0);
- }
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- var_obj.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value'));
- }
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
- var_obj.value.push(true);
- }
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
- var_obj.value.push(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('charvar_default_value'));
- }
- }
- function removeColumnVector(var_obj) {
- if (var_obj.columns == 0) {
- return;
- }
- var_obj.columns--;
- var_obj.value.splice(var_obj.value.length - 1, 1);
- }
- function alternateBooleanValue(var_obj, value_container) {
- var_obj.value = !var_obj.value;
- $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value)));
- }
- function alternateBooleanVectorValue(var_obj, index, value_container) {
- var_obj.value[index] = !var_obj.value[index];
- $(value_container).find('.span_value_variable').text(_services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI("logic_value_".concat(var_obj.value[index])));
- }
- function updateInitialValues(variable_obj, function_name) {
- if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
- if (variable_obj.dimensions == 0) {
- variable_obj.value = 0;
- }
- if (variable_obj.dimensions == 1) {
- variable_obj.value = [0, 0];
- }
- if (variable_obj.dimensions == 2) {
- variable_obj.value = [[0, 0], [0, 0]];
- }
- }
- if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- if (variable_obj.dimensions == 0) {
- variable_obj.value = 0.0;
- }
- if (variable_obj.dimensions == 1) {
- variable_obj.value = [0.0, 0.0];
- }
- if (variable_obj.dimensions == 2) {
- variable_obj.value = [[0.0, 0.0], [0.0, 0.0]];
- }
- }
- if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- if (variable_obj.dimensions == 0) {
- variable_obj.value = _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__["LocalizedStrings"].getUI('textvar_default_value');
- }
- if (variable_obj.dimensions == 1) {
- 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')];
- }
- if (variable_obj.dimensions == 2) {
- 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')]];
- }
- }
- if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].BOOLEAN) {
- if (variable_obj.dimensions == 0) {
- variable_obj.value = true;
- }
- if (variable_obj.dimensions == 1) {
- variable_obj.value = [true, true];
- }
- if (variable_obj.dimensions == 2) {
- variable_obj.value = [[true, true], [true, true]];
- }
- }
- if (variable_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
- if (variable_obj.dimensions == 0) {
- variable_obj.value = 'A';
- }
- if (variable_obj.dimensions == 1) {
- variable_obj.value = ['A', 'A'];
- }
- if (variable_obj.dimensions == 2) {
- variable_obj.value = [['A', 'A'], ['A', 'A']];
- }
- }
- 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);
- }
- var opened_name_value_vector_global_ = false;
- var opened_input_value_vector_global_ = null;
- function enableVectorValueUpdate(var_obj, index, parent_node, function_name) {
- if (opened_name_value_vector_global_) {
- opened_input_value_vector_global_.focus();
- return;
- }
- parent_node = $(parent_node);
- opened_name_value_vector_global_ = true;
- parent_node.find('.span_value_variable').text('');
- var input_field;
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- 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) + "' />");
- input_field.insertBefore(parent_node.find('.span_value_variable'));
- } else {
- input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + var_obj.value[index] + "' />");
- input_field.insertBefore(parent_node.find('.span_value_variable'));
- }
- input_field.on('input', function () {
- var inputWidth = input_field.textWidth() + 10;
- opened_input_value_vector_global_ = input_field;
- input_field.focus();
- var tmpStr = input_field.val();
- input_field.val('');
- input_field.val(tmpStr);
- input_field.css({
- width: inputWidth
- });
- }).trigger('input');
- input_field.focusout(function () {
- var changed = false; /// update array:
- if (input_field.val().trim()) {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- var_obj.value[index] = parseFloat(input_field.val().trim());
- parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
- } else {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
- var_obj.value[index] = parseInt(input_field.val().trim());
- } else {
- var_obj.value[index] = input_field.val().trim();
- }
- parent_node.find('.span_value_variable').text(var_obj.value[index]);
- }
- changed = true;
- } else {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
- } else {
- parent_node.find('.span_value_variable').text(var_obj.value[index]);
- }
- }
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- var_obj.value[index] = input_field.val();
- changed = true;
- parent_node.find('.span_value_variable').text(var_obj.value[index]);
- }
- if (changed) {
- 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);
- }
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_value_vector_global_ = false;
- opened_input_value_vector_global_ = false;
- });
- input_field.on('keydown', function (e) {
- var code = e.keyCode || e.which;
- var changed = false;
- if (code == 13) {
- if (input_field.val().trim()) {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- var_obj.value[index] = parseFloat(input_field.val().trim());
- parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
- } else {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
- var_obj.value[index] = parseInt(input_field.val().trim());
- } else {
- var_obj.value[index] = input_field.val().trim();
- }
- parent_node.find('.span_value_variable').text(var_obj.value[index]);
- }
- changed = true;
- } else {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
- } else {
- parent_node.find('.span_value_variable').text(var_obj.value[index]);
- }
- }
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- var_obj.value[index] = input_field.val();
- changed = true;
- parent_node.find('.span_value_variable').text(var_obj.value[index]);
- }
- if (changed) {
- 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);
- }
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_value_vector_global_ = false;
- opened_input_value_vector_global_ = false;
- }
- if (code == 27) {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- parent_node.find('.span_value_variable').text(var_obj.value[index].toFixed(1));
- } else {
- parent_node.find('.span_value_variable').text(var_obj.value[index]);
- }
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_value_vector_global_ = false;
- opened_input_value_vector_global_ = false;
- }
- });
- input_field.select();
- }
- var opened_name_value_global_var = false;
- var opened_input_value_global_ar = null;
- function enableValueUpdate(var_obj, parent_node, function_name) {
- if (opened_name_value_global_var) {
- opened_input_value_global_ar.focus();
- return;
- }
- parent_node = $(parent_node);
- opened_name_value_global_var = true;
- var input_field;
- parent_node.find('.span_value_variable').text('');
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- 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) + "' />");
- input_field.insertBefore(parent_node.find('.span_value_variable'));
- } else {
- input_field = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + var_obj.value + "' />");
- input_field.insertBefore(parent_node.find('.span_value_variable'));
- }
- input_field.on('input', function () {
- var inputWidth = input_field.textWidth() + 10;
- opened_input_value_global_ar = input_field;
- input_field.focus();
- var tmpStr = input_field.val();
- input_field.val('');
- input_field.val(tmpStr);
- input_field.css({
- width: inputWidth
- });
- }).trigger('input');
- input_field.focusout(function () {
- /// update array:
- var changed = false;
- if (input_field.val().trim()) {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- var_obj.value = parseFloat(input_field.val().trim());
- parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
- } else {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
- var_obj.value = parseInt(input_field.val().trim());
- } else if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
- var_obj.value = input_field.val().charAt(0);
- } else {
- var_obj.value = input_field.val().trim();
- }
- parent_node.find('.span_value_variable').text(var_obj.value);
- }
- changed = true;
- } else {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
- } else {
- parent_node.find('.span_value_variable').text(var_obj.value);
- }
- }
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- var_obj.value = input_field.val();
- changed = true;
- parent_node.find('.span_value_variable').text(var_obj.value);
- }
- if (changed) {
- 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);
- }
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_value_global_var = false;
- opened_input_value_global_ar = false;
- });
- input_field.on('keydown', function (e) {
- var code = e.keyCode || e.which;
- var changed = false;
- if (code == 13) {
- if (input_field.val().trim()) {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- var_obj.value = parseFloat(input_field.val().trim());
- parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
- } else {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
- var_obj.value = parseInt(input_field.val().trim());
- } else if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].CHAR) {
- var_obj.value = input_field.val().charAt(0);
- } else {
- var_obj.value = input_field.val().trim();
- }
- parent_node.find('.span_value_variable').text(var_obj.value);
- }
- changed = true;
- } else {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
- } else {
- parent_node.find('.span_value_variable').text(var_obj.value);
- }
- }
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- var_obj.value = input_field.val();
- changed = true;
- parent_node.find('.span_value_variable').text(var_obj.value);
- }
- if (changed) {
- 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);
- }
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_value_global_var = false;
- opened_input_value_global_ar = false;
- }
- if (code == 27) {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- parent_node.find('.span_value_variable').text(var_obj.value.toFixed(1));
- } else {
- parent_node.find('.span_value_variable').text(var_obj.value);
- }
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_value_global_var = false;
- opened_input_value_global_ar = false;
- }
- });
- input_field.select();
- }
- var opened_name_global = false;
- var opened_input_global = null;
- function enableNameUpdate(variable_obj, variable_container, function_obj) {
- if (opened_name_global) {
- opened_input_global.focus();
- return;
- }
- opened_name_global = true;
- variable_container.find('.span_name_variable').text('');
- var input_name;
- input_name = $("<input type='text' class='width-dynamic input_name_function' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' value='" + variable_obj.name + "' />");
- input_name.insertBefore(variable_container.find('.span_name_variable'));
- input_name.on('input', function () {
- var inputWidth = input_name.textWidth() + 10;
- opened_input_global = input_name;
- input_name.focus();
- var tmpStr = input_name.val();
- input_name.val('');
- input_name.val(tmpStr);
- input_name.css({
- width: inputWidth
- });
- }).trigger('input');
- input_name.focusout(function () {
- /// update array:
- if (input_name.val().trim().length > 0) {
- updateName(variable_obj, input_name.val().trim(), variable_container, function_obj);
- variable_container.find('.span_name_variable').text(variable_obj.name);
- } else {
- variable_container.find('.span_name_variable').text(variable_obj.name);
- }
- input_name.off();
- input_name.remove(); /// update elements:
- opened_name_global = false;
- opened_input_global = false;
- });
- input_name.on('keydown', function (e) {
- var code = e.keyCode || e.which;
- if (code == 13) {
- if (input_name.val().trim().length > 0) {
- updateName(variable_obj, input_name.val().trim(), variable_container, function_obj);
- variable_container.find('.span_name_variable').text(variable_obj.name);
- } else {
- variable_container.find('.span_name_variable').text(variable_obj.name);
- }
- input_name.off();
- input_name.remove(); /// update elements:
- opened_name_global = false;
- opened_input_global = false;
- }
- if (code == 27) {
- variable_container.find('.span_name_variable').text(variable_obj.name);
- input_name.off();
- input_name.remove(); /// update elements:
- opened_name_global = false;
- opened_input_global = false;
- }
- });
- input_name.select();
- }
- var opened_name_value_matrix_global_v = false;
- var opened_input_value_matrix_global_v = null;
- function enableMatrixValueUpdate(var_obj, row, index, parent_node, function_name) {
- if (opened_name_value_matrix_global_v) {
- opened_input_value_matrix_global_v.focus();
- return;
- }
- parent_node = $(parent_node);
- opened_name_value_matrix_global_v = true;
- parent_node.find('.span_value_variable').text('');
- var input_field;
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- 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) + "' />");
- input_field.insertBefore(parent_node.find('.span_value_variable'));
- } else {
- 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] + "' />");
- input_field.insertBefore(parent_node.find('.span_value_variable'));
- }
- input_field.on('input', function () {
- var inputWidth = input_field.textWidth() + 10;
- opened_input_value_matrix_global_v = input_field;
- input_field.focus();
- var tmpStr = input_field.val();
- input_field.val('');
- input_field.val(tmpStr);
- input_field.css({
- width: inputWidth
- });
- }).trigger('input');
- input_field.focusout(function () {
- var changed = false; /// update array:
- if (input_field.val().trim()) {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- var_obj.value[row][index] = parseFloat(input_field.val().trim());
- parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
- } else {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
- var_obj.value[row][index] = parseInt(input_field.val().trim());
- } else {
- var_obj.value[row][index] = input_field.val().trim();
- }
- parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
- }
- changed = true;
- } else {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
- } else {
- parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
- }
- }
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- var_obj.value[row][index] = input_field.val();
- changed = true;
- parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
- }
- if (changed) {
- 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);
- }
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_value_matrix_global_v = false;
- opened_input_value_matrix_global_v = false;
- });
- input_field.on('keydown', function (e) {
- var code = e.keyCode || e.which;
- var changed = false;
- if (code == 13) {
- if (input_field.val().trim()) {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- var_obj.value[row][index] = parseFloat(input_field.val().trim());
- parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
- } else {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].INTEGER) {
- var_obj.value[row][index] = parseInt(input_field.val().trim());
- } else {
- var_obj.value[row][index] = input_field.val().trim();
- }
- parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
- }
- changed = true;
- } else {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
- } else {
- parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
- }
- }
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].TEXT) {
- var_obj.value[row][index] = input_field.val();
- changed = true;
- parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
- }
- if (changed) {
- 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);
- }
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_value_matrix_global_v = false;
- opened_input_value_matrix_global_v = false;
- }
- if (code == 27) {
- if (var_obj.type == _types__WEBPACK_IMPORTED_MODULE_0__["Types"].REAL) {
- parent_node.find('.span_value_variable').text(var_obj.value[row][index].toFixed(1));
- } else {
- parent_node.find('.span_value_variable').text(var_obj.value[row][index]);
- }
- input_field.off();
- input_field.remove(); /// update elements:
- opened_name_value_matrix_global_v = false;
- opened_input_value_matrix_global_v = false;
- }
- });
- input_field.select();
- }
- /***/ })
- /******/ });
- });
- //# sourceMappingURL=main.d645005987e041044c6f.js.map
|