2
0

amber.js 695 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738
  1. /* ====================================================================
  2. |
  3. | Amber Smalltalk
  4. | http://amber-lang.net
  5. |
  6. ======================================================================
  7. ======================================================================
  8. |
  9. | Copyright (c) 2010-2011
  10. | Nicolas Petton <petton.nicolas@gmail.com>
  11. |
  12. | Amber is released under the MIT license
  13. |
  14. | Permission is hereby granted, free of charge, to any person obtaining
  15. | a copy of this software and associated documentation files (the
  16. | 'Software'), to deal in the Software without restriction, including
  17. | without limitation the rights to use, copy, modify, merge, publish,
  18. | distribute, sublicense, and/or sell copies of the Software, and to
  19. | permit persons to whom the Software is furnished to do so, subject to
  20. | the following conditions:
  21. |
  22. | The above copyright notice and this permission notice shall be
  23. | included in all copies or substantial portions of the Software.
  24. |
  25. | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
  26. | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  27. | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  28. | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  29. | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  30. | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  31. | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  32. |
  33. ==================================================================== */
  34. /* Make that console is defined */
  35. if (typeof console === "undefined") {
  36. this.console = {
  37. log: function() {},
  38. warn: function() {},
  39. info: function() {},
  40. debug: function() {},
  41. error: function() {}
  42. };
  43. }
  44. /* Smalltalk constructors definition */
  45. function SmalltalkObject(){}
  46. function SmalltalkBehavior(){};
  47. function SmalltalkClass(){}
  48. function SmalltalkPackage(){};
  49. function SmalltalkMetaclass(){
  50. this.meta = true;
  51. };
  52. function SmalltalkMethod(){};
  53. function SmalltalkNil(){};
  54. function SmalltalkSymbol(string){
  55. this.value = string;
  56. };
  57. function Smalltalk(){
  58. var st = this;
  59. /* This is the current call context object. While it is publicly available,
  60. Use smalltalk.getThisContext() instead which will answer a safe copy of
  61. the current context */
  62. st.thisContext = undefined;
  63. /* List of all reserved words in JavaScript. They may not be used as variables
  64. in Smalltalk. */
  65. st.reservedWords = ['break', 'case', 'catch', 'char', 'class', 'continue', 'debugger',
  66. 'default', 'delete', 'do', 'else', 'finally', 'for', 'function',
  67. 'if', 'in', 'instanceof', 'new', 'private', 'protected',
  68. 'public', 'return', 'static', 'switch', 'this', 'throw',
  69. 'try', 'typeof', 'var', 'void', 'while', 'with', 'yield'];
  70. /* The symbol table ensures symbol unicity */
  71. symbolTable = {};
  72. st.symbolFor = function(string) {
  73. if(symbolTable[string] === undefined) {
  74. symbolTable[string] = new SmalltalkSymbol(string);
  75. };
  76. return symbolTable[string];
  77. };
  78. /* Unique ID number generator */
  79. oid = 0;
  80. st.nextId = function() {
  81. oid += 1;
  82. return oid;
  83. };
  84. /* We hold all Packages in a separate Object */
  85. st.packages = {};
  86. /* Smalltalk package creation. To add a Package, use smalltalk.addPackage() */
  87. function pkg(spec) {
  88. var that = new SmalltalkPackage();
  89. that.pkgName = spec.pkgName;
  90. that.properties = spec.properties || {};
  91. return that;
  92. };
  93. /* Smalltalk class creation. A class is an instance of an automatically
  94. created metaclass object. Newly created classes (not their metaclass)
  95. should be added to the smalltalk object, see smalltalk.addClass().
  96. Superclass linking is *not* handled here, see smalltalk.init() */
  97. function klass(spec) {
  98. var spec = spec || {};
  99. var that;
  100. if(spec.meta) {
  101. that = new SmalltalkMetaclass();
  102. } else {
  103. that = new (klass({meta: true})).fn;
  104. that.klass.instanceClass = that;
  105. that.className = spec.className;
  106. that.klass.className = that.className + ' class';
  107. }
  108. that.fn = spec.fn || function(){};
  109. that.superclass = spec.superclass;
  110. that.iVarNames = spec.iVarNames || [];
  111. that.toString = function() {return 'Smalltalk ' + that.className};
  112. if(that.superclass) {
  113. that.klass.superclass = that.superclass.klass;
  114. }
  115. that.pkg = spec.pkg;
  116. that.fn.prototype.methods = {};
  117. that.fn.prototype.inheritedMethods = {};
  118. that.fn.prototype.klass = that;
  119. return that;
  120. };
  121. /* Smalltalk method object. To add a method to a class,
  122. use smalltalk.addMethod() */
  123. st.method = function(spec) {
  124. var that = new SmalltalkMethod();
  125. that.selector = spec.selector;
  126. that.jsSelector = spec.jsSelector;
  127. that.args = spec.args || {};
  128. that.category = spec.category;
  129. that.source = spec.source;
  130. that.messageSends = spec.messageSends || [];
  131. that.referencedClasses = spec.referencedClasses || [];
  132. that.fn = spec.fn;
  133. return that
  134. };
  135. /* Initialize a class in its class hierarchy. Handle both class and
  136. metaclasses. */
  137. st.init = function(klass) {
  138. st.initSubTree(klass);
  139. if(klass.klass && !klass.meta) {
  140. st.initSubTree(klass.klass);
  141. }
  142. };
  143. if ('function' === typeof Object.keys) {
  144. st.initSubTree = function(klass) {
  145. var subclasses = st.subclasses(klass);
  146. var methods, proto = klass.fn.prototype;
  147. if(klass.superclass && klass.superclass !== nil) {
  148. methods = st.methods(klass.superclass);
  149. //Methods linking
  150. for(var keys=Object.keys(methods),i=0,l=keys.length; i<l; ++i) {
  151. var k = keys[i]
  152. if(!proto.methods[k]) {
  153. proto.inheritedMethods[k] = methods[k];
  154. proto[methods[k].jsSelector] = methods[k].fn;
  155. }
  156. }
  157. }
  158. for(var i=0;i<subclasses.length;i++) {
  159. st.initSubTree(subclasses[i]);
  160. }
  161. };
  162. } else {
  163. st.initSubTree = function(klass) {
  164. var subclasses = st.subclasses(klass);
  165. var methods, proto = klass.fn.prototype;
  166. if(klass.superclass && klass.superclass !== nil) {
  167. methods = st.methods(klass.superclass);
  168. //Methods linking
  169. for(var i in methods) {
  170. if(!proto.methods[i]) {
  171. proto.inheritedMethods[i] = methods[i];
  172. proto[methods[i].jsSelector] = methods[i].fn;
  173. }
  174. }
  175. }
  176. for(var i=0;i<subclasses.length;i++) {
  177. st.initSubTree(subclasses[i]);
  178. }
  179. };
  180. }
  181. /* Answer all registered Packages as Array */
  182. st.packages.all = function() {
  183. var packages = [];
  184. for(var i in st.packages) {
  185. if (!st.packages.hasOwnProperty(i) || typeof(st.packages[i]) === "function") continue;
  186. packages.push(st.packages[i]);
  187. }
  188. return packages
  189. };
  190. /* Answer all registered Smalltalk classes */
  191. if ('function' === typeof Object.keys) {
  192. st.classes = function() {
  193. var classes = [], names = Object.keys(st), l = names.length;
  194. for (var i=0; i<l; ++i) {
  195. var name = names[i];
  196. if (name.search(/^[A-Z]/) !== -1) {
  197. classes.push(st[name]);
  198. }
  199. }
  200. return classes;
  201. };
  202. } else {
  203. st.classes = function() {
  204. var classes = [];
  205. for(var i in st) {
  206. if(i.search(/^[A-Z]/g) != -1) {
  207. classes.push(st[i]);
  208. }
  209. }
  210. return classes
  211. };
  212. }
  213. /* Answer all methods (included inherited ones) of klass. */
  214. if ('function' === typeof Object.keys) {
  215. st.methods = function(klass) {
  216. var methods = {};
  217. var copyFrom = klass.fn.prototype.methods;
  218. for(var i=0, k=Object.keys(copyFrom), l=k.length; i<l; ++i) {
  219. methods[k[i]] = copyFrom[k[i]];
  220. }
  221. copyFrom = klass.fn.prototype.inheritedMethods;
  222. for(var i=0, k=Object.keys(copyFrom), l=k.length; i<l; ++i) {
  223. methods[k[i]] = copyFrom[k[i]];
  224. }
  225. return methods;
  226. };
  227. } else {
  228. st.methods = function(klass) {
  229. var methods = {};
  230. for(var i in klass.fn.prototype.methods) {
  231. methods[i] = klass.fn.prototype.methods[i]
  232. }
  233. for(var i in klass.fn.prototype.inheritedMethods) {
  234. methods[i] = klass.fn.prototype.inheritedMethods[i]
  235. }
  236. return methods;
  237. };
  238. }
  239. /* Answer the direct subclasses of klass. */
  240. st.subclasses = function(klass) {
  241. var subclasses = [];
  242. var classes = st.classes();
  243. for(var i=0, l=classes.length; i<l; ++i) {
  244. var c = classes[i]
  245. if(c.fn) {
  246. //Classes
  247. if(c.superclass === klass) {
  248. subclasses.push(c);
  249. }
  250. c = c.klass;
  251. //Metaclasses
  252. if(c && c.superclass === klass) {
  253. subclasses.push(c);
  254. }
  255. }
  256. }
  257. return subclasses;
  258. };
  259. /* Create a new class wrapping a JavaScript constructor, and add it to the
  260. global smalltalk object. Package is lazily created if it does not exist with given name. */
  261. st.wrapClassName = function(className, pkgName, fn, superclass) {
  262. var pkg = st.addPackage(pkgName);
  263. st[className] = klass({
  264. className: className,
  265. superclass: superclass,
  266. pkg: pkg,
  267. fn: fn
  268. });
  269. };
  270. /* Create an alias for an existing class */
  271. st.alias = function(klass, alias) {
  272. st[alias] = klass;
  273. }
  274. /* Add a package to the smalltalk.packages object, creating a new one if needed.
  275. If pkgName is null or empty we return nil, which is an allowed package for a class.
  276. If package already exists we still update the properties of it. */
  277. st.addPackage = function(pkgName, properties) {
  278. if(!pkgName) {return nil;}
  279. if(!(st.packages[pkgName])) {
  280. st.packages[pkgName] = pkg({
  281. pkgName: pkgName,
  282. properties: properties
  283. });
  284. } else {
  285. if(properties) {
  286. st.packages[pkgName].properties = properties;
  287. }
  288. }
  289. return st.packages[pkgName];
  290. };
  291. /* Add a class to the smalltalk object, creating a new one if needed.
  292. Package is lazily created if it does not exist with given name.*/
  293. st.addClass = function(className, superclass, iVarNames, pkgName) {
  294. var pkg = st.addPackage(pkgName);
  295. if(st[className]) {
  296. st[className].superclass = superclass;
  297. st[className].iVarNames = iVarNames;
  298. st[className].pkg = pkg || st[className].pkg;
  299. } else {
  300. st[className] = klass({
  301. className: className,
  302. superclass: superclass,
  303. pkg: pkg,
  304. iVarNames: iVarNames
  305. });
  306. }
  307. };
  308. /* Add a method to a class */
  309. st.addMethod = function(jsSelector, method, klass) {
  310. klass.fn.prototype[jsSelector] = method.fn;
  311. klass.fn.prototype.methods[method.selector] = method;
  312. method.methodClass = klass;
  313. method.jsSelector = jsSelector;
  314. };
  315. /* Handles unhandled errors during message sends */
  316. st.send = function(receiver, selector, args, klass) {
  317. if(st.thisContext) {
  318. return withContextSend(receiver, selector, args, klass);
  319. } else {
  320. try {return withContextSend(receiver, selector, args, klass)}
  321. catch(error) {
  322. // Reset the context stack in any case
  323. st.thisContext = undefined;
  324. if(error.smalltalkError) {
  325. handleError(error);
  326. } else {
  327. throw(error);
  328. }
  329. }
  330. }
  331. };
  332. function withContextSend(receiver, selector, args, klass) {
  333. var call, imp;
  334. if(receiver == null) {
  335. receiver = nil;
  336. }
  337. imp = klass ? klass.fn.prototype[selector] : receiver.klass && receiver[selector];
  338. if(imp) {
  339. var context = pushContext(receiver, selector, args);
  340. call = imp.apply(receiver, args);
  341. popContext(context);
  342. return call;
  343. } else {
  344. return messageNotUnderstood(receiver, selector, args);
  345. }
  346. };
  347. /* Handles Smalltalk errors. Triggers the registered ErrorHandler
  348. (See the Smalltalk class ErrorHandler and its subclasses */
  349. function handleError(error) {
  350. st.thisContext = undefined;
  351. smalltalk.ErrorHandler._current()._handleError_(error);
  352. };
  353. /* Handles #dnu: *and* JavaScript method calls.
  354. if the receiver has no klass, we consider it a JS object (outside of the
  355. Amber system). Else assume that the receiver understands #doesNotUnderstand: */
  356. function messageNotUnderstood(receiver, selector, args) {
  357. /* Handles JS method calls. */
  358. if(receiver.klass === undefined || receiver.allowJavaScriptCalls) {
  359. return callJavaScriptMethod(receiver, selector, args);
  360. }
  361. /* Handles not understood messages. Also see the Amber counter-part
  362. Object>>doesNotUnderstand: */
  363. return receiver._doesNotUnderstand_(
  364. st.Message._new()
  365. ._selector_(st.convertSelector(selector))
  366. ._arguments_(args)
  367. );
  368. };
  369. /* Call a method of a JS object, or answer a property if it exists.
  370. Else try wrapping a JSObjectProxy around the receiver.
  371. If the object property is a function, then call it, except if it starts with
  372. an uppercase character (we probably want to answer the function itself in this
  373. case and send it #new from Amber).
  374. Converts keyword-based selectors by using the first
  375. keyword only, but keeping all message arguments.
  376. Example:
  377. "self do: aBlock with: anObject" -> "self.do(aBlock, anObject)" */
  378. function callJavaScriptMethod(receiver, selector, args) {
  379. var jsSelector = selector._asJavaScriptSelector();
  380. var jsProperty = receiver[jsSelector];
  381. if(typeof jsProperty === "function" && !/^[A-Z]/.test(jsSelector)) {
  382. return jsProperty.apply(receiver, args);
  383. } else if(jsProperty !== undefined) {
  384. if(args[0]) {
  385. receiver[jsSelector] = args[0];
  386. return nil;
  387. } else {
  388. return jsProperty;
  389. }
  390. }
  391. return st.send(st.JSObjectProxy._on_(receiver), selector, args);
  392. };
  393. /* Reuse one old context stored in oldContext */
  394. st.oldContext = null;
  395. /* Handle thisContext pseudo variable */
  396. st.getThisContext = function() {
  397. if(st.thisContext) {
  398. return st.thisContext.copy();
  399. }/* else { // this is the default
  400. return undefined;
  401. }*/
  402. };
  403. function pushContext(receiver, selector, temps) {
  404. var c = st.oldContext, tc = st.thisContext;
  405. if (!c) {
  406. return st.thisContext = new SmalltalkMethodContext(receiver, selector, temps, tc);
  407. }
  408. st.oldContext = null;
  409. c.homeContext = tc;
  410. c.receiver = receiver;
  411. c.selector = selector;
  412. c.temps = temps || {};
  413. return st.thisContext = c;
  414. };
  415. function popContext(context) {
  416. st.thisContext = context.homeContext;
  417. context.homeContext = undefined;
  418. st.oldContext = context;
  419. };
  420. /* Convert a string to a valid smalltalk selector.
  421. if you modify the following functions, also change String>>asSelector
  422. accordingly */
  423. st.convertSelector = function(selector) {
  424. if(selector.match(/__/)) {
  425. return convertBinarySelector(selector);
  426. } else {
  427. return convertKeywordSelector(selector);
  428. }
  429. };
  430. function convertKeywordSelector(selector) {
  431. return selector.replace(/^_/, '').replace(/_/g, ':');
  432. };
  433. function convertBinarySelector(selector) {
  434. return selector
  435. .replace(/^_/, '')
  436. .replace(/_plus/, '+')
  437. .replace(/_minus/, '-')
  438. .replace(/_star/, '*')
  439. .replace(/_slash/, '/')
  440. .replace(/_gt/, '>')
  441. .replace(/_lt/, '<')
  442. .replace(/_eq/, '=')
  443. .replace(/_comma/, ',')
  444. .replace(/_at/, '@')
  445. };
  446. /* Converts a JavaScript object to valid Smalltalk Object */
  447. st.readJSObject = function(js) {
  448. var object = js;
  449. var readObject = (js.constructor === Object);
  450. var readArray = (js.constructor === Array);
  451. if(readObject) {
  452. object = smalltalk.Dictionary._new();
  453. }
  454. for(var i in js) {
  455. if(readObject) {
  456. object._at_put_(i, st.readJSObject(js[i]));
  457. }
  458. if(readArray) {
  459. object[i] = st.readJSObject(js[i]);
  460. }
  461. }
  462. return object;
  463. };
  464. /* Kept for backward compatibility */
  465. st.setDeploymentMode = function() {};
  466. st.setDevelopmentMode = function() {};
  467. };
  468. function SmalltalkMethodContext(receiver, selector, temps, home) {
  469. this.receiver = receiver;
  470. this.selector = selector;
  471. this.temps = temps || {};
  472. this.homeContext = home;
  473. };
  474. SmalltalkMethodContext.prototype.copy = function() {
  475. var home = this.homeContext;
  476. if(home) {home = home.copy()}
  477. return new SmalltalkMethodContext(
  478. this.receiver,
  479. this.selector,
  480. this.temps,
  481. home
  482. );
  483. };
  484. /* Global Smalltalk objects. */
  485. var nil = new SmalltalkNil();
  486. var smalltalk = new Smalltalk();
  487. if(this.jQuery) {
  488. this.jQuery.allowJavaScriptCalls = true;
  489. }
  490. /****************************************************************************************/
  491. /* Base classes wrapping. If you edit this part, do not forget to set the superclass of the
  492. object metaclass to Class after the definition of Object */
  493. smalltalk.wrapClassName("Object", "Kernel", SmalltalkObject);
  494. smalltalk.wrapClassName("Smalltalk", "Kernel", Smalltalk, smalltalk.Object);
  495. smalltalk.wrapClassName("Package", "Kernel", SmalltalkPackage, smalltalk.Object);
  496. smalltalk.wrapClassName("Behavior", "Kernel", SmalltalkBehavior, smalltalk.Object);
  497. smalltalk.wrapClassName("Class", "Kernel", SmalltalkClass, smalltalk.Behavior);
  498. smalltalk.wrapClassName("Metaclass", "Kernel", SmalltalkMetaclass, smalltalk.Behavior);
  499. smalltalk.wrapClassName("CompiledMethod", "Kernel", SmalltalkMethod, smalltalk.Object);
  500. smalltalk.Object.klass.superclass = smalltalk.Class;
  501. smalltalk.wrapClassName("Number", "Kernel", Number, smalltalk.Object);
  502. smalltalk.wrapClassName("BlockClosure", "Kernel", Function, smalltalk.Object);
  503. smalltalk.wrapClassName("Boolean", "Kernel", Boolean, smalltalk.Object);
  504. smalltalk.wrapClassName("Date", "Kernel", Date, smalltalk.Object);
  505. smalltalk.wrapClassName("UndefinedObject", "Kernel", SmalltalkNil, smalltalk.Object);
  506. smalltalk.wrapClassName("Collection", "Kernel", null, smalltalk.Object);
  507. smalltalk.wrapClassName("SequenceableCollection", "Kernel", null, smalltalk.Collection);
  508. smalltalk.wrapClassName("CharacterArray", "Kernel", null, smalltalk.SequenceableCollection);
  509. smalltalk.wrapClassName("String", "Kernel", String, smalltalk.CharacterArray);
  510. smalltalk.wrapClassName("Symbol", "Kernel", SmalltalkSymbol, smalltalk.CharacterArray);
  511. smalltalk.wrapClassName("Array", "Kernel", Array, smalltalk.SequenceableCollection);
  512. smalltalk.wrapClassName("RegularExpression", "Kernel", RegExp, smalltalk.String);
  513. smalltalk.wrapClassName("Error", "Kernel", Error, smalltalk.Object);
  514. smalltalk.wrapClassName("MethodContext", "Kernel", SmalltalkMethodContext, smalltalk.Object);
  515. /* Alias definitions */
  516. smalltalk.alias(smalltalk.Array, "OrderedCollection");
  517. smalltalk.alias(smalltalk.Date, "Time");
  518. smalltalk.addPackage('Kernel-Objects', {});
  519. smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel-Objects');
  520. smalltalk.Object.comment="*Object is the root of the Smalltalk class system*. All classes in the system are subclasses of Object.\x0a\x0aObject provides default behavior common to all normal objects, such as: \x0a\x0a- access\x0a- copying\x0a- comparison\x0a- error handling\x0a- message sending\x0a- reflection\x0a\x0aAlso utility messages that all objects should respond to are defined here.\x0a\x0aObject has no instance variable.\x0a\x0a##Access\x0a\x0aInstance variables can be accessed with `#instVarAt:` and `#instVarAt:put:`. `Object >> instanceVariableNames` answers a collection of all instance variable names.\x0aAccessing JavaScript properties of an object is done through `#basicAt:`, `#basicAt:put:` and `basicDelete:`.\x0a\x0a##Copying\x0a\x0aCopying an object is handled by `#copy` and `#deepCopy`. The first one performs a shallow copy of the receiver, while the second one performs a deep copy.\x0aThe hook method `#postCopy` can be overriden in subclasses to copy fields as necessary to complete the full copy. It will be sent by the copy of the receiver.\x0a\x0a##Comparison\x0a\x0aObjects understand equality `#=` and identity `#==` comparison.\x0a\x0a##Error handling\x0a\x0a- `#halt` is the typical message to use for inserting breakpoints during debugging.\x0a- `#error:` throws a generic error exception\x0a- `#doesNotUnderstand:` handles the fact that there was an attempt to send the given message to the receiver but the receiver does not understand this message.\x0a Overriding this message can be useful to implement proxies for example."
  521. smalltalk.addMethod(
  522. "__minus_gt",
  523. smalltalk.method({
  524. selector: "->",
  525. category: 'converting',
  526. fn: function (anObject) {
  527. var self = this;
  528. return smalltalk.send(smalltalk.Association || Association, "_key_value_", [self, anObject]);
  529. return self;
  530. },
  531. args: ["anObject"],
  532. source: "-> anObject\x0a\x09^Association key: self value: anObject",
  533. messageSends: ["key:value:"],
  534. referencedClasses: ["Association"]
  535. }),
  536. smalltalk.Object);
  537. smalltalk.addMethod(
  538. "__eq",
  539. smalltalk.method({
  540. selector: "=",
  541. category: 'comparing',
  542. fn: function (anObject) {
  543. var self = this;
  544. return smalltalk.send(self, "__eq_eq", [anObject]);
  545. return self;
  546. },
  547. args: ["anObject"],
  548. source: "= anObject\x0a\x09^self == anObject",
  549. messageSends: ["=="],
  550. referencedClasses: []
  551. }),
  552. smalltalk.Object);
  553. smalltalk.addMethod(
  554. "__eq_eq",
  555. smalltalk.method({
  556. selector: "==",
  557. category: 'comparing',
  558. fn: function (anObject) {
  559. var self = this;
  560. return smalltalk.send(smalltalk.send(self, "_identityHash", []), "__eq", [smalltalk.send(anObject, "_identityHash", [])]);
  561. return self;
  562. },
  563. args: ["anObject"],
  564. source: "== anObject\x0a\x09^self identityHash = anObject identityHash",
  565. messageSends: ["=", "identityHash"],
  566. referencedClasses: []
  567. }),
  568. smalltalk.Object);
  569. smalltalk.addMethod(
  570. "_asJSON",
  571. smalltalk.method({
  572. selector: "asJSON",
  573. category: 'converting',
  574. fn: function () {
  575. var self=this;
  576. var variables=nil;
  577. (variables=smalltalk.send((smalltalk.HashedCollection || HashedCollection), "_new", []));
  578. smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_allInstanceVariableNames", []), "_do_", [(function(each){return smalltalk.send(variables, "_at_put_", [each, smalltalk.send(smalltalk.send(self, "_instVarAt_", [each]), "_asJSON", [])]);})]);
  579. return variables;
  580. return self;},
  581. args: [],
  582. source: "asJSON\x0a\x09| variables |\x0a\x09variables := HashedCollection new.\x0a\x09self class allInstanceVariableNames do: [:each |\x0a\x09\x09variables at: each put: (self instVarAt: each) asJSON].\x0a\x09^variables",
  583. messageSends: ["new", "do:", "allInstanceVariableNames", "class", "at:put:", "asJSON", "instVarAt:"],
  584. referencedClasses: ["HashedCollection"]
  585. }),
  586. smalltalk.Object);
  587. smalltalk.addMethod(
  588. "_asJSONString",
  589. smalltalk.method({
  590. selector: "asJSONString",
  591. category: 'converting',
  592. fn: function () {
  593. var self=this;
  594. return smalltalk.send((smalltalk.JSON || JSON), "_stringify_", [smalltalk.send(self, "_asJSON", [])]);
  595. return self;},
  596. args: [],
  597. source: "asJSONString\x0a\x09^JSON stringify: self asJSON",
  598. messageSends: ["stringify:", "asJSON"],
  599. referencedClasses: ["JSON"]
  600. }),
  601. smalltalk.Object);
  602. smalltalk.addMethod(
  603. "_asJavascript",
  604. smalltalk.method({
  605. selector: "asJavascript",
  606. category: 'converting',
  607. fn: function () {
  608. var self = this;
  609. return smalltalk.send(self, "_asString", []);
  610. return self;
  611. },
  612. args: [],
  613. source: "asJavascript\x0a\x09^self asString",
  614. messageSends: ["asString"],
  615. referencedClasses: []
  616. }),
  617. smalltalk.Object);
  618. smalltalk.addMethod(
  619. "_asString",
  620. smalltalk.method({
  621. selector: "asString",
  622. category: 'converting',
  623. fn: function () {
  624. var self = this;
  625. return smalltalk.send(self, "_printString", []);
  626. return self;
  627. },
  628. args: [],
  629. source: "asString\x0a\x09^self printString",
  630. messageSends: ["printString"],
  631. referencedClasses: []
  632. }),
  633. smalltalk.Object);
  634. smalltalk.addMethod(
  635. "_basicAt_",
  636. smalltalk.method({
  637. selector: "basicAt:",
  638. category: 'accessing',
  639. fn: function (aString) {
  640. var self = this;
  641. return self[aString];
  642. return self;
  643. },
  644. args: ["aString"],
  645. source: "basicAt: aString\x0a\x09<return self[aString]>",
  646. messageSends: [],
  647. referencedClasses: []
  648. }),
  649. smalltalk.Object);
  650. smalltalk.addMethod(
  651. "_basicAt_put_",
  652. smalltalk.method({
  653. selector: "basicAt:put:",
  654. category: 'accessing',
  655. fn: function (aString, anObject) {
  656. var self = this;
  657. return self[aString] = anObject;
  658. return self;
  659. },
  660. args: ["aString", "anObject"],
  661. source: "basicAt: aString put: anObject\x0a\x09<return self[aString] = anObject>",
  662. messageSends: [],
  663. referencedClasses: []
  664. }),
  665. smalltalk.Object);
  666. smalltalk.addMethod(
  667. "_basicDelete_",
  668. smalltalk.method({
  669. selector: "basicDelete:",
  670. category: 'accessing',
  671. fn: function (aString) {
  672. var self = this;
  673. delete self[aString];
  674. return aString;
  675. return self;
  676. },
  677. args: ["aString"],
  678. source: "basicDelete: aString\x0a <delete self[aString]; return aString>",
  679. messageSends: [],
  680. referencedClasses: []
  681. }),
  682. smalltalk.Object);
  683. smalltalk.addMethod(
  684. "_basicPerform_",
  685. smalltalk.method({
  686. selector: "basicPerform:",
  687. category: 'message handling',
  688. fn: function (aSymbol) {
  689. var self = this;
  690. return smalltalk.send(self, "_basicPerform_withArguments_", [aSymbol, []]);
  691. return self;
  692. },
  693. args: ["aSymbol"],
  694. source: "basicPerform: aSymbol \x0a\x09^self basicPerform: aSymbol withArguments: #()",
  695. messageSends: ["basicPerform:withArguments:"],
  696. referencedClasses: []
  697. }),
  698. smalltalk.Object);
  699. smalltalk.addMethod(
  700. "_basicPerform_withArguments_",
  701. smalltalk.method({
  702. selector: "basicPerform:withArguments:",
  703. category: 'message handling',
  704. fn: function (aSymbol, aCollection) {
  705. var self = this;
  706. return self[aSymbol].apply(self, aCollection);
  707. return self;
  708. },
  709. args: ["aSymbol", "aCollection"],
  710. source: "basicPerform: aSymbol withArguments: aCollection\x0a\x09<return self[aSymbol].apply(self, aCollection);>",
  711. messageSends: [],
  712. referencedClasses: []
  713. }),
  714. smalltalk.Object);
  715. smalltalk.addMethod(
  716. "_class",
  717. smalltalk.method({
  718. selector: "class",
  719. category: 'accessing',
  720. fn: function () {
  721. var self = this;
  722. return self.klass;
  723. return self;
  724. },
  725. args: [],
  726. source: "class\x0a\x09<return self.klass>",
  727. messageSends: [],
  728. referencedClasses: []
  729. }),
  730. smalltalk.Object);
  731. smalltalk.addMethod(
  732. "_copy",
  733. smalltalk.method({
  734. selector: "copy",
  735. category: 'copying',
  736. fn: function () {
  737. var self = this;
  738. return smalltalk.send(smalltalk.send(self, "_shallowCopy", []), "_postCopy", []);
  739. return self;
  740. },
  741. args: [],
  742. source: "copy\x0a\x09^self shallowCopy postCopy",
  743. messageSends: ["postCopy", "shallowCopy"],
  744. referencedClasses: []
  745. }),
  746. smalltalk.Object);
  747. smalltalk.addMethod(
  748. "_deepCopy",
  749. smalltalk.method({
  750. selector: "deepCopy",
  751. category: 'copying',
  752. fn: function () {
  753. var self = this;
  754. var copy = self.klass._new();
  755. for (var i in self) {
  756. if (/^@.+/.test(i)) {
  757. copy[i] = self[i]._deepCopy();
  758. }
  759. }
  760. return copy;
  761. return self;
  762. },
  763. args: [],
  764. source: "deepCopy\x0a\x09< \x0a\x09 var copy = self.klass._new();\x0a\x09 for(var i in self) {\x0a\x09\x09if(/^@.+/.test(i)) {\x0a\x09\x09 copy[i] = self[i]._deepCopy();\x0a\x09\x09}\x0a\x09 }\x0a\x09 return copy;\x0a\x09>",
  765. messageSends: [],
  766. referencedClasses: []
  767. }),
  768. smalltalk.Object);
  769. smalltalk.addMethod(
  770. "_deprecatedAPI",
  771. smalltalk.method({
  772. selector: "deprecatedAPI",
  773. category: 'error handling',
  774. fn: function () {
  775. var self = this;
  776. smalltalk.send(typeof console == "undefined" ? nil : console, "_warn_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.getThisContext(), "_home", []), "_asString", []), "__comma", [unescape("%20is%20deprecated%21%20%28in%20")]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.getThisContext(), "_home", []), "_home", []), "_asString", [])]), "__comma", [unescape("%29")])]);
  777. return self;
  778. },
  779. args: [],
  780. source: "deprecatedAPI\x0a\x09\x22Just a simple way to deprecate methods.\x0a\x09#deprecatedAPI is in the 'error handling' protocol even if it doesn't throw an error,\x0a\x09but it could in the future.\x22\x0a\x09console warn: thisContext home asString, ' is deprecated! (in ', thisContext home home asString, ')'",
  781. messageSends: ["warn:", ",", "asString", "home"],
  782. referencedClasses: []
  783. }),
  784. smalltalk.Object);
  785. smalltalk.addMethod(
  786. "_doesNotUnderstand_",
  787. smalltalk.method({
  788. selector: "doesNotUnderstand:",
  789. category: 'error handling',
  790. fn: function (aMessage) {
  791. var self = this;
  792. (function ($rec) {smalltalk.send($rec, "_receiver_", [self]);smalltalk.send($rec, "_message_", [aMessage]);return smalltalk.send($rec, "_signal", []);}(smalltalk.send(smalltalk.MessageNotUnderstood || MessageNotUnderstood, "_new", [])));
  793. return self;
  794. },
  795. args: ["aMessage"],
  796. source: "doesNotUnderstand: aMessage\x0a\x09MessageNotUnderstood new\x0a\x09\x09receiver: self;\x0a\x09\x09message: aMessage;\x0a\x09\x09signal",
  797. messageSends: ["receiver:", "message:", "signal", "new"],
  798. referencedClasses: ["MessageNotUnderstood"]
  799. }),
  800. smalltalk.Object);
  801. smalltalk.addMethod(
  802. "_error_",
  803. smalltalk.method({
  804. selector: "error:",
  805. category: 'error handling',
  806. fn: function (aString) {
  807. var self = this;
  808. smalltalk.send(smalltalk.Error || Error, "_signal_", [aString]);
  809. return self;
  810. },
  811. args: ["aString"],
  812. source: "error: aString\x0a\x09Error signal: aString",
  813. messageSends: ["signal:"],
  814. referencedClasses: ["Error"]
  815. }),
  816. smalltalk.Object);
  817. smalltalk.addMethod(
  818. "_halt",
  819. smalltalk.method({
  820. selector: "halt",
  821. category: 'error handling',
  822. fn: function () {
  823. var self = this;
  824. smalltalk.send(self, "_error_", ["Halt encountered"]);
  825. return self;
  826. },
  827. args: [],
  828. source: "halt\x0a\x09self error: 'Halt encountered'",
  829. messageSends: ["error:"],
  830. referencedClasses: []
  831. }),
  832. smalltalk.Object);
  833. smalltalk.addMethod(
  834. "_identityHash",
  835. smalltalk.method({
  836. selector: "identityHash",
  837. category: 'accessing',
  838. fn: function () {
  839. var self = this;
  840. return self.identityHash || (self.identityHash = smalltalk.nextId());
  841. return self;
  842. },
  843. args: [],
  844. source: "identityHash\x0a\x09<return self.identityHash || (self.identityHash = smalltalk.nextId());>",
  845. messageSends: [],
  846. referencedClasses: []
  847. }),
  848. smalltalk.Object);
  849. smalltalk.addMethod(
  850. "_ifNil_",
  851. smalltalk.method({
  852. selector: "ifNil:",
  853. category: 'testing',
  854. fn: function (aBlock) {
  855. var self = this;
  856. return self;
  857. return self;
  858. },
  859. args: ["aBlock"],
  860. source: "ifNil: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^self",
  861. messageSends: [],
  862. referencedClasses: []
  863. }),
  864. smalltalk.Object);
  865. smalltalk.addMethod(
  866. "_ifNil_ifNotNil_",
  867. smalltalk.method({
  868. selector: "ifNil:ifNotNil:",
  869. category: 'testing',
  870. fn: function (aBlock, anotherBlock) {
  871. var self = this;
  872. return smalltalk.send(anotherBlock, "_value", []);
  873. return self;
  874. },
  875. args: ["aBlock", "anotherBlock"],
  876. source: "ifNil: aBlock ifNotNil: anotherBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^anotherBlock value",
  877. messageSends: ["value"],
  878. referencedClasses: []
  879. }),
  880. smalltalk.Object);
  881. smalltalk.addMethod(
  882. "_ifNotNil_",
  883. smalltalk.method({
  884. selector: "ifNotNil:",
  885. category: 'testing',
  886. fn: function (aBlock) {
  887. var self = this;
  888. return smalltalk.send(aBlock, "_value", []);
  889. return self;
  890. },
  891. args: ["aBlock"],
  892. source: "ifNotNil: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^aBlock value",
  893. messageSends: ["value"],
  894. referencedClasses: []
  895. }),
  896. smalltalk.Object);
  897. smalltalk.addMethod(
  898. "_ifNotNil_ifNil_",
  899. smalltalk.method({
  900. selector: "ifNotNil:ifNil:",
  901. category: 'testing',
  902. fn: function (aBlock, anotherBlock) {
  903. var self = this;
  904. return smalltalk.send(aBlock, "_value", []);
  905. return self;
  906. },
  907. args: ["aBlock", "anotherBlock"],
  908. source: "ifNotNil: aBlock ifNil: anotherBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^aBlock value",
  909. messageSends: ["value"],
  910. referencedClasses: []
  911. }),
  912. smalltalk.Object);
  913. smalltalk.addMethod(
  914. "_initialize",
  915. smalltalk.method({
  916. selector: "initialize",
  917. category: 'initialization',
  918. fn: function () {
  919. var self = this;
  920. return self;
  921. },
  922. args: [],
  923. source: "initialize",
  924. messageSends: [],
  925. referencedClasses: []
  926. }),
  927. smalltalk.Object);
  928. smalltalk.addMethod(
  929. "_instVarAt_",
  930. smalltalk.method({
  931. selector: "instVarAt:",
  932. category: 'accessing',
  933. fn: function (aSymbol) {
  934. var self = this;
  935. var varname = nil;
  936. varname = smalltalk.send(aSymbol, "_asString", []);
  937. return self["@" + varname];
  938. return self;
  939. },
  940. args: ["aSymbol"],
  941. source: "instVarAt: aSymbol\x0a\x09| varname |\x0a\x09varname := aSymbol asString.\x0a\x09<return self['@'+varname]>",
  942. messageSends: ["asString"],
  943. referencedClasses: []
  944. }),
  945. smalltalk.Object);
  946. smalltalk.addMethod(
  947. "_instVarAt_put_",
  948. smalltalk.method({
  949. selector: "instVarAt:put:",
  950. category: 'accessing',
  951. fn: function (aSymbol, anObject) {
  952. var self = this;
  953. var varname = nil;
  954. varname = smalltalk.send(aSymbol, "_asString", []);
  955. self["@" + varname] = anObject;
  956. return self;
  957. },
  958. args: ["aSymbol", "anObject"],
  959. source: "instVarAt: aSymbol put: anObject\x0a\x09| varname |\x0a\x09varname := aSymbol asString.\x0a\x09<self['@' + varname] = anObject>",
  960. messageSends: ["asString"],
  961. referencedClasses: []
  962. }),
  963. smalltalk.Object);
  964. smalltalk.addMethod(
  965. "_isClass",
  966. smalltalk.method({
  967. selector: "isClass",
  968. category: 'testing',
  969. fn: function () {
  970. var self = this;
  971. return false;
  972. return self;
  973. },
  974. args: [],
  975. source: "isClass\x0a\x09^false",
  976. messageSends: [],
  977. referencedClasses: []
  978. }),
  979. smalltalk.Object);
  980. smalltalk.addMethod(
  981. "_isKindOf_",
  982. smalltalk.method({
  983. selector: "isKindOf:",
  984. category: 'testing',
  985. fn: function (aClass) {
  986. var self = this;
  987. return ($receiver = smalltalk.send(self, "_isMemberOf_", [aClass])).klass === smalltalk.Boolean ? $receiver ? function () {return true;}() : function () {return smalltalk.send(smalltalk.send(self, "_class", []), "_inheritsFrom_", [aClass]);}() : smalltalk.send($receiver, "_ifTrue_ifFalse_", [function () {return true;}, function () {return smalltalk.send(smalltalk.send(self, "_class", []), "_inheritsFrom_", [aClass]);}]);
  988. return self;
  989. },
  990. args: ["aClass"],
  991. source: "isKindOf: aClass\x0a\x09^(self isMemberOf: aClass)\x0a\x09 ifTrue: [true]\x0a\x09 ifFalse: [self class inheritsFrom: aClass]",
  992. messageSends: ["ifTrue:ifFalse:", "isMemberOf:", "inheritsFrom:", "class"],
  993. referencedClasses: []
  994. }),
  995. smalltalk.Object);
  996. smalltalk.addMethod(
  997. "_isMemberOf_",
  998. smalltalk.method({
  999. selector: "isMemberOf:",
  1000. category: 'testing',
  1001. fn: function (aClass) {
  1002. var self = this;
  1003. return smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [aClass]);
  1004. return self;
  1005. },
  1006. args: ["aClass"],
  1007. source: "isMemberOf: aClass\x0a\x09^self class = aClass",
  1008. messageSends: ["=", "class"],
  1009. referencedClasses: []
  1010. }),
  1011. smalltalk.Object);
  1012. smalltalk.addMethod(
  1013. "_isMetaclass",
  1014. smalltalk.method({
  1015. selector: "isMetaclass",
  1016. category: 'testing',
  1017. fn: function () {
  1018. var self = this;
  1019. return false;
  1020. return self;
  1021. },
  1022. args: [],
  1023. source: "isMetaclass\x0a\x09^false",
  1024. messageSends: [],
  1025. referencedClasses: []
  1026. }),
  1027. smalltalk.Object);
  1028. smalltalk.addMethod(
  1029. "_isNil",
  1030. smalltalk.method({
  1031. selector: "isNil",
  1032. category: 'testing',
  1033. fn: function () {
  1034. var self = this;
  1035. return false;
  1036. return self;
  1037. },
  1038. args: [],
  1039. source: "isNil\x0a\x09^false",
  1040. messageSends: [],
  1041. referencedClasses: []
  1042. }),
  1043. smalltalk.Object);
  1044. smalltalk.addMethod(
  1045. "_isNumber",
  1046. smalltalk.method({
  1047. selector: "isNumber",
  1048. category: 'testing',
  1049. fn: function () {
  1050. var self = this;
  1051. return false;
  1052. return self;
  1053. },
  1054. args: [],
  1055. source: "isNumber\x0a\x09^false",
  1056. messageSends: [],
  1057. referencedClasses: []
  1058. }),
  1059. smalltalk.Object);
  1060. smalltalk.addMethod(
  1061. "_isParseFailure",
  1062. smalltalk.method({
  1063. selector: "isParseFailure",
  1064. category: 'testing',
  1065. fn: function () {
  1066. var self = this;
  1067. return false;
  1068. return self;
  1069. },
  1070. args: [],
  1071. source: "isParseFailure\x0a\x09^false",
  1072. messageSends: [],
  1073. referencedClasses: []
  1074. }),
  1075. smalltalk.Object);
  1076. smalltalk.addMethod(
  1077. "_isString",
  1078. smalltalk.method({
  1079. selector: "isString",
  1080. category: 'testing',
  1081. fn: function () {
  1082. var self = this;
  1083. return false;
  1084. return self;
  1085. },
  1086. args: [],
  1087. source: "isString\x0a\x09^false",
  1088. messageSends: [],
  1089. referencedClasses: []
  1090. }),
  1091. smalltalk.Object);
  1092. smalltalk.addMethod(
  1093. "_isSymbol",
  1094. smalltalk.method({
  1095. selector: "isSymbol",
  1096. category: 'testing',
  1097. fn: function () {
  1098. var self = this;
  1099. return false;
  1100. return self;
  1101. },
  1102. args: [],
  1103. source: "isSymbol\x0a\x09^false",
  1104. messageSends: [],
  1105. referencedClasses: []
  1106. }),
  1107. smalltalk.Object);
  1108. smalltalk.addMethod(
  1109. "_log_block_",
  1110. smalltalk.method({
  1111. selector: "log:block:",
  1112. category: 'printing',
  1113. fn: function (aString, aBlock) {
  1114. var self = this;
  1115. var result = nil;
  1116. smalltalk.send(typeof console == "undefined" ? nil : console, "_log_", [smalltalk.send(smalltalk.send(aString, "__comma", [" time: "]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.Date || Date, "_millisecondsToRun_", [function () {return result = smalltalk.send(aBlock, "_value", []);}]), "_printString", [])])]);
  1117. return result;
  1118. return self;
  1119. },
  1120. args: ["aString", "aBlock"],
  1121. source: "log: aString block: aBlock\x0a\x0a\x09| result |\x0a\x09console log: aString, ' time: ', (Date millisecondsToRun: [result := aBlock value]) printString.\x0a\x09^result",
  1122. messageSends: ["log:", ",", "printString", "millisecondsToRun:", "value"],
  1123. referencedClasses: ["Date"]
  1124. }),
  1125. smalltalk.Object);
  1126. smalltalk.addMethod(
  1127. "_notNil",
  1128. smalltalk.method({
  1129. selector: "notNil",
  1130. category: 'testing',
  1131. fn: function () {
  1132. var self = this;
  1133. return smalltalk.send(smalltalk.send(self, "_isNil", []), "_not", []);
  1134. return self;
  1135. },
  1136. args: [],
  1137. source: "notNil\x0a\x09^self isNil not",
  1138. messageSends: ["not", "isNil"],
  1139. referencedClasses: []
  1140. }),
  1141. smalltalk.Object);
  1142. smalltalk.addMethod(
  1143. "_perform_",
  1144. smalltalk.method({
  1145. selector: "perform:",
  1146. category: 'message handling',
  1147. fn: function (aSymbol) {
  1148. var self = this;
  1149. return smalltalk.send(self, "_perform_withArguments_", [aSymbol, []]);
  1150. return self;
  1151. },
  1152. args: ["aSymbol"],
  1153. source: "perform: aSymbol\x0a\x09^self perform: aSymbol withArguments: #()",
  1154. messageSends: ["perform:withArguments:"],
  1155. referencedClasses: []
  1156. }),
  1157. smalltalk.Object);
  1158. smalltalk.addMethod(
  1159. "_perform_withArguments_",
  1160. smalltalk.method({
  1161. selector: "perform:withArguments:",
  1162. category: 'message handling',
  1163. fn: function (aSymbol, aCollection) {
  1164. var self=this;
  1165. var selector=nil;
  1166. (selector=smalltalk.send(aSymbol, "_asSelector", []));
  1167. return smalltalk.send(self, selector, aCollection);
  1168. return self;},
  1169. args: ["aSymbol", "aCollection"],
  1170. source: "perform: aSymbol withArguments: aCollection\x0a\x09| selector |\x0a\x09selector := aSymbol asSelector.\x0a\x09<return smalltalk.send(self, selector, aCollection)>",
  1171. messageSends: ["asSelector"],
  1172. referencedClasses: []
  1173. }),
  1174. smalltalk.Object);
  1175. smalltalk.addMethod(
  1176. "_postCopy",
  1177. smalltalk.method({
  1178. selector: "postCopy",
  1179. category: 'copying',
  1180. fn: function () {
  1181. var self = this;
  1182. return self;
  1183. },
  1184. args: [],
  1185. source: "postCopy",
  1186. messageSends: [],
  1187. referencedClasses: []
  1188. }),
  1189. smalltalk.Object);
  1190. smalltalk.addMethod(
  1191. "_printNl",
  1192. smalltalk.method({
  1193. selector: "printNl",
  1194. category: 'printing',
  1195. fn: function () {
  1196. var self = this;
  1197. console.log(self);
  1198. return self;
  1199. },
  1200. args: [],
  1201. source: "printNl\x0a\x09<console.log(self)>",
  1202. messageSends: [],
  1203. referencedClasses: []
  1204. }),
  1205. smalltalk.Object);
  1206. smalltalk.addMethod(
  1207. "_printString",
  1208. smalltalk.method({
  1209. selector: "printString",
  1210. category: 'printing',
  1211. fn: function () {
  1212. var self = this;
  1213. return smalltalk.send("a ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])]);
  1214. return self;
  1215. },
  1216. args: [],
  1217. source: "printString\x0a\x09^'a ', self class name",
  1218. messageSends: [",", "name", "class"],
  1219. referencedClasses: []
  1220. }),
  1221. smalltalk.Object);
  1222. smalltalk.addMethod(
  1223. "_respondsTo_",
  1224. smalltalk.method({
  1225. selector: "respondsTo:",
  1226. category: 'testing',
  1227. fn: function (aSelector) {
  1228. var self=this;
  1229. return smalltalk.send(smalltalk.send(self, "_class", []), "_canUnderstand_", [aSelector]);
  1230. return self;},
  1231. args: ["aSelector"],
  1232. source: "respondsTo: aSelector\x0a\x09^self class canUnderstand: aSelector",
  1233. messageSends: ["canUnderstand:", "class"],
  1234. referencedClasses: []
  1235. }),
  1236. smalltalk.Object);
  1237. smalltalk.addMethod(
  1238. "_shallowCopy",
  1239. smalltalk.method({
  1240. selector: "shallowCopy",
  1241. category: 'copying',
  1242. fn: function () {
  1243. var self = this;
  1244. var copy = self.klass._new();
  1245. for (var i in self) {
  1246. if (/^@.+/.test(i)) {
  1247. copy[i] = self[i];
  1248. }
  1249. }
  1250. return copy;
  1251. return self;
  1252. },
  1253. args: [],
  1254. source: "shallowCopy\x0a\x09<\x0a\x09 var copy = self.klass._new();\x0a\x09 for(var i in self) {\x0a\x09\x09if(/^@.+/.test(i)) {\x0a\x09\x09 copy[i] = self[i];\x0a\x09\x09}\x0a\x09 }\x0a\x09 return copy;\x0a\x09>",
  1255. messageSends: [],
  1256. referencedClasses: []
  1257. }),
  1258. smalltalk.Object);
  1259. smalltalk.addMethod(
  1260. "_shouldNotImplement",
  1261. smalltalk.method({
  1262. selector: "shouldNotImplement",
  1263. category: 'error handling',
  1264. fn: function () {
  1265. var self = this;
  1266. smalltalk.send(self, "_error_", [smalltalk.send("This method should not be implemented in ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])])]);
  1267. return self;
  1268. },
  1269. args: [],
  1270. source: "shouldNotImplement\x0a\x09self error: 'This method should not be implemented in ', self class name",
  1271. messageSends: ["error:", ",", "name", "class"],
  1272. referencedClasses: []
  1273. }),
  1274. smalltalk.Object);
  1275. smalltalk.addMethod(
  1276. "_size",
  1277. smalltalk.method({
  1278. selector: "size",
  1279. category: 'accessing',
  1280. fn: function () {
  1281. var self = this;
  1282. smalltalk.send(self, "_error_", ["Object not indexable"]);
  1283. return self;
  1284. },
  1285. args: [],
  1286. source: "size\x0a\x09self error: 'Object not indexable'",
  1287. messageSends: ["error:"],
  1288. referencedClasses: []
  1289. }),
  1290. smalltalk.Object);
  1291. smalltalk.addMethod(
  1292. "_storeOn_",
  1293. smalltalk.method({
  1294. selector: "storeOn:",
  1295. category: 'printing',
  1296. fn: function (aStream) {
  1297. var self = this;
  1298. smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(self, "_printString", [])]);
  1299. return self;
  1300. },
  1301. args: ["aStream"],
  1302. source: "storeOn: aStream\x0a\x09aStream nextPutAll: self printString",
  1303. messageSends: ["nextPutAll:", "printString"],
  1304. referencedClasses: []
  1305. }),
  1306. smalltalk.Object);
  1307. smalltalk.addMethod(
  1308. "_storeString",
  1309. smalltalk.method({
  1310. selector: "storeString",
  1311. category: 'printing',
  1312. fn: function () {
  1313. var self = this;
  1314. return smalltalk.send(smalltalk.String || String, "_streamContents_", [function (s) {return smalltalk.send(self, "_storeOn_", [s]);}]);
  1315. return self;
  1316. },
  1317. args: [],
  1318. source: "storeString\x0a\x09\x22Answer a String representation of the receiver from which the receiver \x0a\x09can be reconstructed.\x22\x0a\x0a\x09^ String streamContents: [:s | self storeOn: s]",
  1319. messageSends: ["streamContents:", "storeOn:"],
  1320. referencedClasses: ["String"]
  1321. }),
  1322. smalltalk.Object);
  1323. smalltalk.addMethod(
  1324. "_subclassResponsibility",
  1325. smalltalk.method({
  1326. selector: "subclassResponsibility",
  1327. category: 'error handling',
  1328. fn: function () {
  1329. var self = this;
  1330. smalltalk.send(self, "_error_", ["This method is a responsibility of a subclass"]);
  1331. return self;
  1332. },
  1333. args: [],
  1334. source: "subclassResponsibility\x0a\x09self error: 'This method is a responsibility of a subclass'",
  1335. messageSends: ["error:"],
  1336. referencedClasses: []
  1337. }),
  1338. smalltalk.Object);
  1339. smalltalk.addMethod(
  1340. "_try_catch_",
  1341. smalltalk.method({
  1342. selector: "try:catch:",
  1343. category: 'error handling',
  1344. fn: function (aBlock, anotherBlock) {
  1345. var self = this;
  1346. try {
  1347. result = aBlock();
  1348. } catch (e) {
  1349. result = anotherBlock(e);
  1350. }
  1351. return result;
  1352. return self;
  1353. },
  1354. args: ["aBlock", "anotherBlock"],
  1355. source: "try: aBlock catch: anotherBlock\x0a\x09<try{result = aBlock()} catch(e) {result = anotherBlock(e)};\x0a\x09return result;>",
  1356. messageSends: [],
  1357. referencedClasses: []
  1358. }),
  1359. smalltalk.Object);
  1360. smalltalk.addMethod(
  1361. "_yourself",
  1362. smalltalk.method({
  1363. selector: "yourself",
  1364. category: 'accessing',
  1365. fn: function () {
  1366. var self = this;
  1367. return self;
  1368. return self;
  1369. },
  1370. args: [],
  1371. source: "yourself\x0a\x09^self",
  1372. messageSends: [],
  1373. referencedClasses: []
  1374. }),
  1375. smalltalk.Object);
  1376. smalltalk.addMethod(
  1377. "_~_eq",
  1378. smalltalk.method({
  1379. selector: "~=",
  1380. category: 'comparing',
  1381. fn: function (anObject) {
  1382. var self = this;
  1383. return smalltalk.send(smalltalk.send(self, "__eq", [anObject]), "__eq", [false]);
  1384. return self;
  1385. },
  1386. args: ["anObject"],
  1387. source: "~= anObject\x0a\x09^(self = anObject) = false",
  1388. messageSends: ["="],
  1389. referencedClasses: []
  1390. }),
  1391. smalltalk.Object);
  1392. smalltalk.addMethod(
  1393. "_~~",
  1394. smalltalk.method({
  1395. selector: "~~",
  1396. category: 'comparing',
  1397. fn: function (anObject) {
  1398. var self = this;
  1399. return smalltalk.send(smalltalk.send(self, "__eq_eq", [anObject]), "__eq", [false]);
  1400. return self;
  1401. },
  1402. args: ["anObject"],
  1403. source: "~~ anObject\x0a\x09^(self == anObject) = false",
  1404. messageSends: ["=", "=="],
  1405. referencedClasses: []
  1406. }),
  1407. smalltalk.Object);
  1408. smalltalk.addMethod(
  1409. "_initialize",
  1410. smalltalk.method({
  1411. selector: "initialize",
  1412. category: 'initialization',
  1413. fn: function () {
  1414. var self = this;
  1415. return self;
  1416. },
  1417. args: [],
  1418. source: "initialize\x0a\x09\x22no op\x22",
  1419. messageSends: [],
  1420. referencedClasses: []
  1421. }),
  1422. smalltalk.Object.klass);
  1423. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel-Objects');
  1424. smalltalk.Boolean.comment="Boolean wraps the JavaScript `Boolean()` constructor. The `true` and `false` objects are the JavaScript boolean objects.\x0a\x0aBoolean defines the protocol for logic testing operations and conditional control structures for the logical values.\x0aBoolean instances are weither `true` or `false`."
  1425. smalltalk.addMethod(
  1426. "_&",
  1427. smalltalk.method({
  1428. selector: "&",
  1429. category: 'controlling',
  1430. fn: function (aBoolean) {
  1431. var self = this;
  1432. if (self == true) {
  1433. return aBoolean;
  1434. } else {
  1435. return false;
  1436. }
  1437. return self;
  1438. },
  1439. args: ["aBoolean"],
  1440. source: "& aBoolean\x0a\x09<\x0a\x09 if(self == true) {\x0a\x09\x09return aBoolean;\x0a\x09 } else {\x0a\x09\x09return false;\x0a\x09 }\x0a\x09>",
  1441. messageSends: [],
  1442. referencedClasses: []
  1443. }),
  1444. smalltalk.Boolean);
  1445. smalltalk.addMethod(
  1446. "__eq",
  1447. smalltalk.method({
  1448. selector: "=",
  1449. category: 'comparing',
  1450. fn: function (aBoolean) {
  1451. var self = this;
  1452. try {
  1453. ($receiver = smalltalk.send(smalltalk.send(aBoolean, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean ? !$receiver ? function () {return function () {throw {name: "stReturn", selector: "__eq", fn: function () {return false;}};}();}() : nil : smalltalk.send($receiver, "_ifFalse_", [function () {return function () {throw {name: "stReturn", selector: "__eq", fn: function () {return false;}};}();}]);
  1454. return Boolean(self == true) == aBoolean;
  1455. return self;
  1456. } catch (e) {
  1457. if (e.name === "stReturn" && e.selector === "__eq") {
  1458. return e.fn();
  1459. }
  1460. throw e;
  1461. }
  1462. },
  1463. args: ["aBoolean"],
  1464. source: "= aBoolean\x0a\x09aBoolean class = self class ifFalse: [^false].\x0a\x09<return Boolean(self == true) == aBoolean>",
  1465. messageSends: ["ifFalse:", "=", "class"],
  1466. referencedClasses: []
  1467. }),
  1468. smalltalk.Boolean);
  1469. smalltalk.addMethod(
  1470. "_and_",
  1471. smalltalk.method({
  1472. selector: "and:",
  1473. category: 'controlling',
  1474. fn: function (aBlock) {
  1475. var self = this;
  1476. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [aBlock, function () {return false;}]);
  1477. return self;
  1478. },
  1479. args: ["aBlock"],
  1480. source: "and: aBlock\x0a\x09^self = true\x0a\x09 ifTrue: aBlock\x0a\x09 ifFalse: [false]",
  1481. messageSends: ["ifTrue:ifFalse:", "="],
  1482. referencedClasses: []
  1483. }),
  1484. smalltalk.Boolean);
  1485. smalltalk.addMethod(
  1486. "_asJSON",
  1487. smalltalk.method({
  1488. selector: "asJSON",
  1489. category: 'converting',
  1490. fn: function () {
  1491. var self=this;
  1492. return self;
  1493. return self;},
  1494. args: [],
  1495. source: "asJSON\x0a\x09^self",
  1496. messageSends: [],
  1497. referencedClasses: []
  1498. }),
  1499. smalltalk.Boolean);
  1500. smalltalk.addMethod(
  1501. "_deepCopy",
  1502. smalltalk.method({
  1503. selector: "deepCopy",
  1504. category: 'copying',
  1505. fn: function () {
  1506. var self = this;
  1507. return self;
  1508. return self;
  1509. },
  1510. args: [],
  1511. source: "deepCopy\x0a\x09^self",
  1512. messageSends: [],
  1513. referencedClasses: []
  1514. }),
  1515. smalltalk.Boolean);
  1516. smalltalk.addMethod(
  1517. "_ifFalse_",
  1518. smalltalk.method({
  1519. selector: "ifFalse:",
  1520. category: 'controlling',
  1521. fn: function (aBlock) {
  1522. var self = this;
  1523. return smalltalk.send(self, "_ifTrue_ifFalse_", [function () {return nil;}, aBlock]);
  1524. return self;
  1525. },
  1526. args: ["aBlock"],
  1527. source: "ifFalse: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^self ifTrue: [] ifFalse: aBlock",
  1528. messageSends: ["ifTrue:ifFalse:"],
  1529. referencedClasses: []
  1530. }),
  1531. smalltalk.Boolean);
  1532. smalltalk.addMethod(
  1533. "_ifFalse_ifTrue_",
  1534. smalltalk.method({
  1535. selector: "ifFalse:ifTrue:",
  1536. category: 'controlling',
  1537. fn: function (aBlock, anotherBlock) {
  1538. var self = this;
  1539. return smalltalk.send(self, "_ifTrue_ifFalse_", [anotherBlock, aBlock]);
  1540. return self;
  1541. },
  1542. args: ["aBlock", "anotherBlock"],
  1543. source: "ifFalse: aBlock ifTrue: anotherBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^self ifTrue: anotherBlock ifFalse: aBlock",
  1544. messageSends: ["ifTrue:ifFalse:"],
  1545. referencedClasses: []
  1546. }),
  1547. smalltalk.Boolean);
  1548. smalltalk.addMethod(
  1549. "_ifTrue_",
  1550. smalltalk.method({
  1551. selector: "ifTrue:",
  1552. category: 'controlling',
  1553. fn: function (aBlock) {
  1554. var self = this;
  1555. return smalltalk.send(self, "_ifTrue_ifFalse_", [aBlock, function () {return nil;}]);
  1556. return self;
  1557. },
  1558. args: ["aBlock"],
  1559. source: "ifTrue: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^self ifTrue: aBlock ifFalse: []",
  1560. messageSends: ["ifTrue:ifFalse:"],
  1561. referencedClasses: []
  1562. }),
  1563. smalltalk.Boolean);
  1564. smalltalk.addMethod(
  1565. "_ifTrue_ifFalse_",
  1566. smalltalk.method({
  1567. selector: "ifTrue:ifFalse:",
  1568. category: 'controlling',
  1569. fn: function (aBlock, anotherBlock) {
  1570. var self = this;
  1571. if (self == true) {
  1572. return aBlock();
  1573. } else {
  1574. return anotherBlock();
  1575. }
  1576. return self;
  1577. },
  1578. args: ["aBlock", "anotherBlock"],
  1579. source: "ifTrue: aBlock ifFalse: anotherBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09<\x0a\x09 if(self == true) {\x0a\x09\x09return aBlock();\x0a\x09 } else {\x0a\x09\x09return anotherBlock();\x0a\x09 }\x0a\x09>",
  1580. messageSends: [],
  1581. referencedClasses: []
  1582. }),
  1583. smalltalk.Boolean);
  1584. smalltalk.addMethod(
  1585. "_not",
  1586. smalltalk.method({
  1587. selector: "not",
  1588. category: 'controlling',
  1589. fn: function () {
  1590. var self = this;
  1591. return smalltalk.send(self, "__eq", [false]);
  1592. return self;
  1593. },
  1594. args: [],
  1595. source: "not\x0a\x09^self = false",
  1596. messageSends: ["="],
  1597. referencedClasses: []
  1598. }),
  1599. smalltalk.Boolean);
  1600. smalltalk.addMethod(
  1601. "_or_",
  1602. smalltalk.method({
  1603. selector: "or:",
  1604. category: 'controlling',
  1605. fn: function (aBlock) {
  1606. var self = this;
  1607. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [function () {return true;}, aBlock]);
  1608. return self;
  1609. },
  1610. args: ["aBlock"],
  1611. source: "or: aBlock\x0a\x09^self = true\x0a\x09 ifTrue: [true]\x0a\x09 ifFalse: aBlock",
  1612. messageSends: ["ifTrue:ifFalse:", "="],
  1613. referencedClasses: []
  1614. }),
  1615. smalltalk.Boolean);
  1616. smalltalk.addMethod(
  1617. "_printString",
  1618. smalltalk.method({
  1619. selector: "printString",
  1620. category: 'printing',
  1621. fn: function () {
  1622. var self = this;
  1623. return self.toString();
  1624. return self;
  1625. },
  1626. args: [],
  1627. source: "printString\x0a\x09<return self.toString()>",
  1628. messageSends: [],
  1629. referencedClasses: []
  1630. }),
  1631. smalltalk.Boolean);
  1632. smalltalk.addMethod(
  1633. "_shallowCopy",
  1634. smalltalk.method({
  1635. selector: "shallowCopy",
  1636. category: 'copying',
  1637. fn: function () {
  1638. var self = this;
  1639. return self;
  1640. return self;
  1641. },
  1642. args: [],
  1643. source: "shallowCopy\x0a\x09^self",
  1644. messageSends: [],
  1645. referencedClasses: []
  1646. }),
  1647. smalltalk.Boolean);
  1648. smalltalk.addMethod(
  1649. "_|",
  1650. smalltalk.method({
  1651. selector: "|",
  1652. category: 'controlling',
  1653. fn: function (aBoolean) {
  1654. var self = this;
  1655. if (self == true) {
  1656. return true;
  1657. } else {
  1658. return aBoolean;
  1659. }
  1660. return self;
  1661. },
  1662. args: ["aBoolean"],
  1663. source: "| aBoolean\x0a\x09<\x0a\x09 if(self == true) {\x0a\x09\x09return true;\x0a\x09 } else {\x0a\x09\x09return aBoolean;\x0a\x09 }\x0a\x09>",
  1664. messageSends: [],
  1665. referencedClasses: []
  1666. }),
  1667. smalltalk.Boolean);
  1668. smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel-Objects');
  1669. smalltalk.Date.comment="The Date class is used to work with dates and times. Therefore `Date today` and `Date now` are both valid in\x0aAmber and answer the same date object.\x0a\x0aDate wraps the `Date()` JavaScript constructor, and Smalltalk date objects are JavaScript date objects."
  1670. smalltalk.addMethod(
  1671. "__plus",
  1672. smalltalk.method({
  1673. selector: "+",
  1674. category: 'arithmetic',
  1675. fn: function (aDate) {
  1676. var self = this;
  1677. return self + aDate;
  1678. return self;
  1679. },
  1680. args: ["aDate"],
  1681. source: "+ aDate\x0a\x09<return self + aDate>",
  1682. messageSends: [],
  1683. referencedClasses: []
  1684. }),
  1685. smalltalk.Date);
  1686. smalltalk.addMethod(
  1687. "__minus",
  1688. smalltalk.method({
  1689. selector: "-",
  1690. category: 'arithmetic',
  1691. fn: function (aDate) {
  1692. var self = this;
  1693. return self - aDate;
  1694. return self;
  1695. },
  1696. args: ["aDate"],
  1697. source: "- aDate\x0a\x09<return self - aDate>",
  1698. messageSends: [],
  1699. referencedClasses: []
  1700. }),
  1701. smalltalk.Date);
  1702. smalltalk.addMethod(
  1703. "__lt",
  1704. smalltalk.method({
  1705. selector: "<",
  1706. category: 'comparing',
  1707. fn: function (aDate) {
  1708. var self = this;
  1709. return self < aDate;
  1710. return self;
  1711. },
  1712. args: ["aDate"],
  1713. source: "< aDate\x0a\x09<return self < aDate>",
  1714. messageSends: [],
  1715. referencedClasses: []
  1716. }),
  1717. smalltalk.Date);
  1718. smalltalk.addMethod(
  1719. "__lt_eq",
  1720. smalltalk.method({
  1721. selector: "<=",
  1722. category: 'comparing',
  1723. fn: function (aDate) {
  1724. var self = this;
  1725. return self <= aDate;
  1726. return self;
  1727. },
  1728. args: ["aDate"],
  1729. source: "<= aDate\x0a\x09<return self <= aDate>",
  1730. messageSends: [],
  1731. referencedClasses: []
  1732. }),
  1733. smalltalk.Date);
  1734. smalltalk.addMethod(
  1735. "__gt",
  1736. smalltalk.method({
  1737. selector: ">",
  1738. category: 'comparing',
  1739. fn: function (aDate) {
  1740. var self = this;
  1741. return self > aDate;
  1742. return self;
  1743. },
  1744. args: ["aDate"],
  1745. source: "> aDate\x0a\x09<return self >> aDate>",
  1746. messageSends: [],
  1747. referencedClasses: []
  1748. }),
  1749. smalltalk.Date);
  1750. smalltalk.addMethod(
  1751. "__gt_eq",
  1752. smalltalk.method({
  1753. selector: ">=",
  1754. category: 'comparing',
  1755. fn: function (aDate) {
  1756. var self = this;
  1757. return self >= aDate;
  1758. return self;
  1759. },
  1760. args: ["aDate"],
  1761. source: ">= aDate\x0a\x09<return self >>= aDate>",
  1762. messageSends: [],
  1763. referencedClasses: []
  1764. }),
  1765. smalltalk.Date);
  1766. smalltalk.addMethod(
  1767. "_asDateString",
  1768. smalltalk.method({
  1769. selector: "asDateString",
  1770. category: 'converting',
  1771. fn: function () {
  1772. var self = this;
  1773. return self.toDateString();
  1774. return self;
  1775. },
  1776. args: [],
  1777. source: "asDateString\x0a\x09<return self.toDateString()>",
  1778. messageSends: [],
  1779. referencedClasses: []
  1780. }),
  1781. smalltalk.Date);
  1782. smalltalk.addMethod(
  1783. "_asLocaleString",
  1784. smalltalk.method({
  1785. selector: "asLocaleString",
  1786. category: 'converting',
  1787. fn: function () {
  1788. var self = this;
  1789. return self.toLocaleString();
  1790. return self;
  1791. },
  1792. args: [],
  1793. source: "asLocaleString\x0a\x09<return self.toLocaleString()>",
  1794. messageSends: [],
  1795. referencedClasses: []
  1796. }),
  1797. smalltalk.Date);
  1798. smalltalk.addMethod(
  1799. "_asMilliseconds",
  1800. smalltalk.method({
  1801. selector: "asMilliseconds",
  1802. category: 'converting',
  1803. fn: function () {
  1804. var self = this;
  1805. return smalltalk.send(self, "_time", []);
  1806. return self;
  1807. },
  1808. args: [],
  1809. source: "asMilliseconds\x0a\x09^self time",
  1810. messageSends: ["time"],
  1811. referencedClasses: []
  1812. }),
  1813. smalltalk.Date);
  1814. smalltalk.addMethod(
  1815. "_asNumber",
  1816. smalltalk.method({
  1817. selector: "asNumber",
  1818. category: 'converting',
  1819. fn: function () {
  1820. var self = this;
  1821. return smalltalk.send(self, "_asMilliseconds", []);
  1822. return self;
  1823. },
  1824. args: [],
  1825. source: "asNumber\x0a\x09^self asMilliseconds",
  1826. messageSends: ["asMilliseconds"],
  1827. referencedClasses: []
  1828. }),
  1829. smalltalk.Date);
  1830. smalltalk.addMethod(
  1831. "_asString",
  1832. smalltalk.method({
  1833. selector: "asString",
  1834. category: 'converting',
  1835. fn: function () {
  1836. var self = this;
  1837. return self.toString();
  1838. return self;
  1839. },
  1840. args: [],
  1841. source: "asString\x0a\x09<return self.toString()>",
  1842. messageSends: [],
  1843. referencedClasses: []
  1844. }),
  1845. smalltalk.Date);
  1846. smalltalk.addMethod(
  1847. "_asTimeString",
  1848. smalltalk.method({
  1849. selector: "asTimeString",
  1850. category: 'converting',
  1851. fn: function () {
  1852. var self = this;
  1853. return self.toTimeString();
  1854. return self;
  1855. },
  1856. args: [],
  1857. source: "asTimeString\x0a\x09<return self.toTimeString()>",
  1858. messageSends: [],
  1859. referencedClasses: []
  1860. }),
  1861. smalltalk.Date);
  1862. smalltalk.addMethod(
  1863. "_day",
  1864. smalltalk.method({
  1865. selector: "day",
  1866. category: 'accessing',
  1867. fn: function () {
  1868. var self = this;
  1869. return smalltalk.send(self, "_dayOfWeek", []);
  1870. return self;
  1871. },
  1872. args: [],
  1873. source: "day\x0a\x09^self dayOfWeek",
  1874. messageSends: ["dayOfWeek"],
  1875. referencedClasses: []
  1876. }),
  1877. smalltalk.Date);
  1878. smalltalk.addMethod(
  1879. "_day_",
  1880. smalltalk.method({
  1881. selector: "day:",
  1882. category: 'accessing',
  1883. fn: function (aNumber) {
  1884. var self=this;
  1885. smalltalk.send(self, "_dayOfWeek_", [aNumber]);
  1886. return self;},
  1887. args: ["aNumber"],
  1888. source: "day: aNumber\x0a\x09self dayOfWeek: aNumber",
  1889. messageSends: ["dayOfWeek:"],
  1890. referencedClasses: []
  1891. }),
  1892. smalltalk.Date);
  1893. smalltalk.addMethod(
  1894. "_dayOfMonth",
  1895. smalltalk.method({
  1896. selector: "dayOfMonth",
  1897. category: 'accessing',
  1898. fn: function () {
  1899. var self = this;
  1900. return self.getDate();
  1901. return self;
  1902. },
  1903. args: [],
  1904. source: "dayOfMonth\x0a\x09<return self.getDate()>",
  1905. messageSends: [],
  1906. referencedClasses: []
  1907. }),
  1908. smalltalk.Date);
  1909. smalltalk.addMethod(
  1910. "_dayOfMonth_",
  1911. smalltalk.method({
  1912. selector: "dayOfMonth:",
  1913. category: 'accessing',
  1914. fn: function (aNumber) {
  1915. var self = this;
  1916. self.setDate(aNumber);
  1917. return self;
  1918. },
  1919. args: ["aNumber"],
  1920. source: "dayOfMonth: aNumber\x0a\x09<self.setDate(aNumber)>",
  1921. messageSends: [],
  1922. referencedClasses: []
  1923. }),
  1924. smalltalk.Date);
  1925. smalltalk.addMethod(
  1926. "_dayOfWeek",
  1927. smalltalk.method({
  1928. selector: "dayOfWeek",
  1929. category: 'accessing',
  1930. fn: function () {
  1931. var self = this;
  1932. return self.getDay() + 1;
  1933. return self;
  1934. },
  1935. args: [],
  1936. source: "dayOfWeek\x0a\x09<return self.getDay() + 1>",
  1937. messageSends: [],
  1938. referencedClasses: []
  1939. }),
  1940. smalltalk.Date);
  1941. smalltalk.addMethod(
  1942. "_dayOfWeek_",
  1943. smalltalk.method({
  1944. selector: "dayOfWeek:",
  1945. category: 'accessing',
  1946. fn: function (aNumber) {
  1947. var self = this;
  1948. return self.setDay(aNumber - 1);
  1949. return self;
  1950. },
  1951. args: ["aNumber"],
  1952. source: "dayOfWeek: aNumber\x0a\x09<return self.setDay(aNumber - 1)>",
  1953. messageSends: [],
  1954. referencedClasses: []
  1955. }),
  1956. smalltalk.Date);
  1957. smalltalk.addMethod(
  1958. "_hours",
  1959. smalltalk.method({
  1960. selector: "hours",
  1961. category: 'accessing',
  1962. fn: function () {
  1963. var self = this;
  1964. return self.getHours();
  1965. return self;
  1966. },
  1967. args: [],
  1968. source: "hours\x0a\x09<return self.getHours()>",
  1969. messageSends: [],
  1970. referencedClasses: []
  1971. }),
  1972. smalltalk.Date);
  1973. smalltalk.addMethod(
  1974. "_hours_",
  1975. smalltalk.method({
  1976. selector: "hours:",
  1977. category: 'accessing',
  1978. fn: function (aNumber) {
  1979. var self = this;
  1980. self.setHours(aNumber);
  1981. return self;
  1982. },
  1983. args: ["aNumber"],
  1984. source: "hours: aNumber\x0a\x09<self.setHours(aNumber)>",
  1985. messageSends: [],
  1986. referencedClasses: []
  1987. }),
  1988. smalltalk.Date);
  1989. smalltalk.addMethod(
  1990. "_milliseconds",
  1991. smalltalk.method({
  1992. selector: "milliseconds",
  1993. category: 'accessing',
  1994. fn: function () {
  1995. var self = this;
  1996. return self.getMilliseconds();
  1997. return self;
  1998. },
  1999. args: [],
  2000. source: "milliseconds\x0a\x09<return self.getMilliseconds()>",
  2001. messageSends: [],
  2002. referencedClasses: []
  2003. }),
  2004. smalltalk.Date);
  2005. smalltalk.addMethod(
  2006. "_milliseconds_",
  2007. smalltalk.method({
  2008. selector: "milliseconds:",
  2009. category: 'accessing',
  2010. fn: function (aNumber) {
  2011. var self = this;
  2012. self.setMilliseconds(aNumber);
  2013. return self;
  2014. },
  2015. args: ["aNumber"],
  2016. source: "milliseconds: aNumber\x0a\x09<self.setMilliseconds(aNumber)>",
  2017. messageSends: [],
  2018. referencedClasses: []
  2019. }),
  2020. smalltalk.Date);
  2021. smalltalk.addMethod(
  2022. "_minutes",
  2023. smalltalk.method({
  2024. selector: "minutes",
  2025. category: 'accessing',
  2026. fn: function () {
  2027. var self = this;
  2028. return self.getMinutes();
  2029. return self;
  2030. },
  2031. args: [],
  2032. source: "minutes\x0a\x09<return self.getMinutes()>",
  2033. messageSends: [],
  2034. referencedClasses: []
  2035. }),
  2036. smalltalk.Date);
  2037. smalltalk.addMethod(
  2038. "_minutes_",
  2039. smalltalk.method({
  2040. selector: "minutes:",
  2041. category: 'accessing',
  2042. fn: function (aNumber) {
  2043. var self = this;
  2044. self.setMinutes(aNumber);
  2045. return self;
  2046. },
  2047. args: ["aNumber"],
  2048. source: "minutes: aNumber\x0a\x09<self.setMinutes(aNumber)>",
  2049. messageSends: [],
  2050. referencedClasses: []
  2051. }),
  2052. smalltalk.Date);
  2053. smalltalk.addMethod(
  2054. "_month",
  2055. smalltalk.method({
  2056. selector: "month",
  2057. category: 'accessing',
  2058. fn: function () {
  2059. var self = this;
  2060. return self.getMonth() + 1;
  2061. return self;
  2062. },
  2063. args: [],
  2064. source: "month\x0a\x09<return self.getMonth() + 1>",
  2065. messageSends: [],
  2066. referencedClasses: []
  2067. }),
  2068. smalltalk.Date);
  2069. smalltalk.addMethod(
  2070. "_month_",
  2071. smalltalk.method({
  2072. selector: "month:",
  2073. category: 'accessing',
  2074. fn: function (aNumber) {
  2075. var self = this;
  2076. self.setMonth(aNumber - 1);
  2077. return self;
  2078. },
  2079. args: ["aNumber"],
  2080. source: "month: aNumber\x0a\x09<self.setMonth(aNumber - 1)>",
  2081. messageSends: [],
  2082. referencedClasses: []
  2083. }),
  2084. smalltalk.Date);
  2085. smalltalk.addMethod(
  2086. "_printString",
  2087. smalltalk.method({
  2088. selector: "printString",
  2089. category: 'printing',
  2090. fn: function () {
  2091. var self = this;
  2092. return smalltalk.send(self, "_asString", []);
  2093. return self;
  2094. },
  2095. args: [],
  2096. source: "printString\x0a\x09^self asString",
  2097. messageSends: ["asString"],
  2098. referencedClasses: []
  2099. }),
  2100. smalltalk.Date);
  2101. smalltalk.addMethod(
  2102. "_seconds",
  2103. smalltalk.method({
  2104. selector: "seconds",
  2105. category: 'accessing',
  2106. fn: function () {
  2107. var self = this;
  2108. return self.getSeconds();
  2109. return self;
  2110. },
  2111. args: [],
  2112. source: "seconds\x0a\x09<return self.getSeconds()>",
  2113. messageSends: [],
  2114. referencedClasses: []
  2115. }),
  2116. smalltalk.Date);
  2117. smalltalk.addMethod(
  2118. "_seconds_",
  2119. smalltalk.method({
  2120. selector: "seconds:",
  2121. category: 'accessing',
  2122. fn: function (aNumber) {
  2123. var self = this;
  2124. self.setSeconds(aNumber);
  2125. return self;
  2126. },
  2127. args: ["aNumber"],
  2128. source: "seconds: aNumber\x0a\x09<self.setSeconds(aNumber)>",
  2129. messageSends: [],
  2130. referencedClasses: []
  2131. }),
  2132. smalltalk.Date);
  2133. smalltalk.addMethod(
  2134. "_time",
  2135. smalltalk.method({
  2136. selector: "time",
  2137. category: 'accessing',
  2138. fn: function () {
  2139. var self = this;
  2140. return self.getTime();
  2141. return self;
  2142. },
  2143. args: [],
  2144. source: "time\x0a\x09<return self.getTime()>",
  2145. messageSends: [],
  2146. referencedClasses: []
  2147. }),
  2148. smalltalk.Date);
  2149. smalltalk.addMethod(
  2150. "_time_",
  2151. smalltalk.method({
  2152. selector: "time:",
  2153. category: 'accessing',
  2154. fn: function (aNumber) {
  2155. var self = this;
  2156. self.setTime(aNumber);
  2157. return self;
  2158. },
  2159. args: ["aNumber"],
  2160. source: "time: aNumber\x0a\x09<self.setTime(aNumber)>",
  2161. messageSends: [],
  2162. referencedClasses: []
  2163. }),
  2164. smalltalk.Date);
  2165. smalltalk.addMethod(
  2166. "_year",
  2167. smalltalk.method({
  2168. selector: "year",
  2169. category: 'accessing',
  2170. fn: function () {
  2171. var self = this;
  2172. return self.getFullYear();
  2173. return self;
  2174. },
  2175. args: [],
  2176. source: "year\x0a\x09<return self.getFullYear()>",
  2177. messageSends: [],
  2178. referencedClasses: []
  2179. }),
  2180. smalltalk.Date);
  2181. smalltalk.addMethod(
  2182. "_year_",
  2183. smalltalk.method({
  2184. selector: "year:",
  2185. category: 'accessing',
  2186. fn: function (aNumber) {
  2187. var self = this;
  2188. self.setFullYear(aNumber);
  2189. return self;
  2190. },
  2191. args: ["aNumber"],
  2192. source: "year: aNumber\x0a\x09<self.setFullYear(aNumber)>",
  2193. messageSends: [],
  2194. referencedClasses: []
  2195. }),
  2196. smalltalk.Date);
  2197. smalltalk.addMethod(
  2198. "_fromMilliseconds_",
  2199. smalltalk.method({
  2200. selector: "fromMilliseconds:",
  2201. category: 'instance creation',
  2202. fn: function (aNumber) {
  2203. var self = this;
  2204. return smalltalk.send(self, "_new_", [aNumber]);
  2205. return self;
  2206. },
  2207. args: ["aNumber"],
  2208. source: "fromMilliseconds: aNumber\x0a\x09^self new: aNumber",
  2209. messageSends: ["new:"],
  2210. referencedClasses: []
  2211. }),
  2212. smalltalk.Date.klass);
  2213. smalltalk.addMethod(
  2214. "_fromSeconds_",
  2215. smalltalk.method({
  2216. selector: "fromSeconds:",
  2217. category: 'instance creation',
  2218. fn: function (aNumber) {
  2219. var self = this;
  2220. return smalltalk.send(self, "_fromMilliseconds_", [($receiver = aNumber).klass === smalltalk.Number ? $receiver * 1000 : smalltalk.send($receiver, "__star", [1000])]);
  2221. return self;
  2222. },
  2223. args: ["aNumber"],
  2224. source: "fromSeconds: aNumber\x0a\x09^self fromMilliseconds: aNumber * 1000",
  2225. messageSends: ["fromMilliseconds:", "*"],
  2226. referencedClasses: []
  2227. }),
  2228. smalltalk.Date.klass);
  2229. smalltalk.addMethod(
  2230. "_fromString_",
  2231. smalltalk.method({
  2232. selector: "fromString:",
  2233. category: 'instance creation',
  2234. fn: function (aString) {
  2235. var self = this;
  2236. return smalltalk.send(self, "_new_", [aString]);
  2237. return self;
  2238. },
  2239. args: ["aString"],
  2240. source: "fromString: aString\x0a\x09\x22Example: Date fromString('2011/04/15 00:00:00')\x22\x0a\x09^self new: aString",
  2241. messageSends: ["new:"],
  2242. referencedClasses: []
  2243. }),
  2244. smalltalk.Date.klass);
  2245. smalltalk.addMethod(
  2246. "_millisecondsToRun_",
  2247. smalltalk.method({
  2248. selector: "millisecondsToRun:",
  2249. category: 'instance creation',
  2250. fn: function (aBlock) {
  2251. var self = this;
  2252. var t = nil;
  2253. t = smalltalk.send(smalltalk.Date || Date, "_now", []);
  2254. smalltalk.send(aBlock, "_value", []);
  2255. return ($receiver = smalltalk.send(smalltalk.Date || Date, "_now", [])).klass === smalltalk.Number ? $receiver - t : smalltalk.send($receiver, "__minus", [t]);
  2256. return self;
  2257. },
  2258. args: ["aBlock"],
  2259. source: "millisecondsToRun: aBlock\x0a\x09| t |\x0a\x09t := Date now.\x0a\x09aBlock value.\x0a\x09^Date now - t",
  2260. messageSends: ["now", "value", "-"],
  2261. referencedClasses: ["Date"]
  2262. }),
  2263. smalltalk.Date.klass);
  2264. smalltalk.addMethod(
  2265. "_new_",
  2266. smalltalk.method({
  2267. selector: "new:",
  2268. category: 'instance creation',
  2269. fn: function (anObject) {
  2270. var self = this;
  2271. return new Date(anObject);
  2272. return self;
  2273. },
  2274. args: ["anObject"],
  2275. source: "new: anObject\x0a\x09<return new Date(anObject)>",
  2276. messageSends: [],
  2277. referencedClasses: []
  2278. }),
  2279. smalltalk.Date.klass);
  2280. smalltalk.addMethod(
  2281. "_now",
  2282. smalltalk.method({
  2283. selector: "now",
  2284. category: 'instance creation',
  2285. fn: function () {
  2286. var self = this;
  2287. return smalltalk.send(self, "_today", []);
  2288. return self;
  2289. },
  2290. args: [],
  2291. source: "now\x0a\x09^self today",
  2292. messageSends: ["today"],
  2293. referencedClasses: []
  2294. }),
  2295. smalltalk.Date.klass);
  2296. smalltalk.addMethod(
  2297. "_today",
  2298. smalltalk.method({
  2299. selector: "today",
  2300. category: 'instance creation',
  2301. fn: function () {
  2302. var self = this;
  2303. return smalltalk.send(self, "_new", []);
  2304. return self;
  2305. },
  2306. args: [],
  2307. source: "today\x0a\x09^self new",
  2308. messageSends: ["new"],
  2309. referencedClasses: []
  2310. }),
  2311. smalltalk.Date.klass);
  2312. smalltalk.addClass('JSObjectProxy', smalltalk.Object, ['jsObject'], 'Kernel-Objects');
  2313. smalltalk.JSObjectProxy.comment="JSObjectProxy handles sending messages to JavaScript object, therefore accessing JavaScript objects from Amber is transparent.\x0aJSOjbectProxy makes intensive use of `#doesNotUnderstand:`.\x0a\x0a## Examples\x0a\x0aJSObjectProxy objects are instanciated by Amber when a Smalltalk message is sent to a JavaScript object.\x0a\x0a window alert: 'hello world'.\x0a window inspect.\x0a (window jQuery: 'body') append: 'hello world'\x0a\x0aSmalltalk messages sends are converted to JavaScript function calls or object property access _(in this order)_. If n one of them match, a `MessageNotUnderstood` error will be thrown. \x0a\x0a## Message conversion rules\x0a\x0a- `someUser name` becomes `someUser.name`\x0a- `someUser name: 'John'` becomes `someUser name = \x22John\x22`\x0a- `console log: 'hello world'` becomes `console.log('hello world')`\x0a- `(window jQuery: 'foo') css: 'background' color: 'red'` becomes `window.jQuery('foo').css('background', 'red')`\x0a\x0a__Note:__ For keyword-based messages, only the first keyword is kept: `window foo: 1 bar: 2` is equivalent to `window foo: 1 baz: 2`."
  2314. smalltalk.addMethod(
  2315. "_at_",
  2316. smalltalk.method({
  2317. selector: "at:",
  2318. category: 'accessing',
  2319. fn: function (aSymbol) {
  2320. var self = this;
  2321. var attr = nil;
  2322. attr = smalltalk.send(aSymbol, "_asString", []);
  2323. return self['@jsObject'][attr];
  2324. return self;
  2325. },
  2326. args: ["aSymbol"],
  2327. source: "at: aSymbol\x0a\x09| attr |\x0a\x09attr := aSymbol asString.\x0a\x09<return self['@jsObject'][attr]>",
  2328. messageSends: ["asString"],
  2329. referencedClasses: []
  2330. }),
  2331. smalltalk.JSObjectProxy);
  2332. smalltalk.addMethod(
  2333. "_at_put_",
  2334. smalltalk.method({
  2335. selector: "at:put:",
  2336. category: 'accessing',
  2337. fn: function (aSymbol, anObject) {
  2338. var self = this;
  2339. var attr = nil;
  2340. attr = smalltalk.send(aSymbol, "_asString", []);
  2341. self['@jsObject'][attr] = anObject;
  2342. return self;
  2343. },
  2344. args: ["aSymbol", "anObject"],
  2345. source: "at: aSymbol put: anObject\x0a\x09| attr |\x0a\x09attr := aSymbol asString.\x0a\x09<self['@jsObject'][attr] = anObject>",
  2346. messageSends: ["asString"],
  2347. referencedClasses: []
  2348. }),
  2349. smalltalk.JSObjectProxy);
  2350. smalltalk.addMethod(
  2351. "_doesNotUnderstand_",
  2352. smalltalk.method({
  2353. selector: "doesNotUnderstand:",
  2354. category: 'proxy',
  2355. fn: function (aMessage) {
  2356. var self = this;
  2357. var obj = nil;
  2358. var selector = nil;
  2359. var jsSelector = nil;
  2360. var arguments = nil;
  2361. obj = smalltalk.send(self, "_jsObject", []);
  2362. selector = smalltalk.send(aMessage, "_selector", []);
  2363. jsSelector = smalltalk.send(selector, "_asJavaScriptSelector", []);
  2364. arguments = smalltalk.send(aMessage, "_arguments", []);
  2365. if (obj[jsSelector] != undefined) {
  2366. return smalltalk.send(obj, jsSelector, arguments);
  2367. }
  2368. smalltalk.send(self, "_doesNotUnderstand_", [aMessage], smalltalk.Object);
  2369. return self;
  2370. },
  2371. args: ["aMessage"],
  2372. source: "doesNotUnderstand: aMessage\x0a\x09| obj selector jsSelector arguments |\x0a\x09obj := self jsObject.\x0a\x09selector := aMessage selector.\x0a\x09jsSelector := selector asJavaScriptSelector.\x0a\x09arguments := aMessage arguments.\x0a\x09<if(obj[jsSelector] != undefined) {return smalltalk.send(obj, jsSelector, arguments)}>.\x0a\x09super doesNotUnderstand: aMessage",
  2373. messageSends: ["jsObject", "selector", "asJavaScriptSelector", "arguments", "doesNotUnderstand:"],
  2374. referencedClasses: []
  2375. }),
  2376. smalltalk.JSObjectProxy);
  2377. smalltalk.addMethod(
  2378. "_inspectOn_",
  2379. smalltalk.method({
  2380. selector: "inspectOn:",
  2381. category: 'proxy',
  2382. fn: function (anInspector) {
  2383. var self = this;
  2384. var variables = nil;
  2385. variables = smalltalk.send(smalltalk.Dictionary || Dictionary, "_new", []);
  2386. smalltalk.send(variables, "_at_put_", [unescape("%23self"), smalltalk.send(self, "_jsObject", [])]);
  2387. smalltalk.send(anInspector, "_setLabel_", [smalltalk.send(self, "_printString", [])]);
  2388. for (var i in self['@jsObject']) {
  2389. variables._at_put_(i, self['@jsObject'][i]);
  2390. }
  2391. smalltalk.send(anInspector, "_setVariables_", [variables]);
  2392. return self;
  2393. },
  2394. args: ["anInspector"],
  2395. source: "inspectOn: anInspector\x0a\x09| variables |\x0a\x09variables := Dictionary new.\x0a\x09variables at: '#self' put: self jsObject.\x0a\x09anInspector setLabel: self printString.\x0a\x09<for(var i in self['@jsObject']) {\x0a\x09\x09variables._at_put_(i, self['@jsObject'][i]);\x0a\x09}>.\x0a\x09anInspector setVariables: variables",
  2396. messageSends: ["new", "at:put:", "jsObject", "setLabel:", "printString", "setVariables:"],
  2397. referencedClasses: ["Dictionary"]
  2398. }),
  2399. smalltalk.JSObjectProxy);
  2400. smalltalk.addMethod(
  2401. "_jsObject",
  2402. smalltalk.method({
  2403. selector: "jsObject",
  2404. category: 'accessing',
  2405. fn: function () {
  2406. var self = this;
  2407. return self['@jsObject'];
  2408. return self;
  2409. },
  2410. args: [],
  2411. source: "jsObject\x0a\x09^jsObject",
  2412. messageSends: [],
  2413. referencedClasses: []
  2414. }),
  2415. smalltalk.JSObjectProxy);
  2416. smalltalk.addMethod(
  2417. "_jsObject_",
  2418. smalltalk.method({
  2419. selector: "jsObject:",
  2420. category: 'accessing',
  2421. fn: function (aJSObject) {
  2422. var self = this;
  2423. self['@jsObject'] = aJSObject;
  2424. return self;
  2425. },
  2426. args: ["aJSObject"],
  2427. source: "jsObject: aJSObject\x0a\x09jsObject := aJSObject",
  2428. messageSends: [],
  2429. referencedClasses: []
  2430. }),
  2431. smalltalk.JSObjectProxy);
  2432. smalltalk.addMethod(
  2433. "_printString",
  2434. smalltalk.method({
  2435. selector: "printString",
  2436. category: 'proxy',
  2437. fn: function () {
  2438. var self = this;
  2439. return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_toString", []);
  2440. return self;
  2441. },
  2442. args: [],
  2443. source: "printString\x0a\x09^self jsObject toString",
  2444. messageSends: ["toString", "jsObject"],
  2445. referencedClasses: []
  2446. }),
  2447. smalltalk.JSObjectProxy);
  2448. smalltalk.addMethod(
  2449. "_on_",
  2450. smalltalk.method({
  2451. selector: "on:",
  2452. category: 'instance creation',
  2453. fn: function (aJSObject) {
  2454. var self = this;
  2455. return function ($rec) {smalltalk.send($rec, "_jsObject_", [aJSObject]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_new", []));
  2456. return self;
  2457. },
  2458. args: ["aJSObject"],
  2459. source: "on: aJSObject\x0a\x09^self new\x0a\x09\x09jsObject: aJSObject;\x0a\x09\x09yourself",
  2460. messageSends: ["jsObject:", "yourself", "new"],
  2461. referencedClasses: []
  2462. }),
  2463. smalltalk.JSObjectProxy.klass);
  2464. smalltalk.addClass('Number', smalltalk.Object, [], 'Kernel-Objects');
  2465. smalltalk.Number.comment="Number holds the most general methods for dealing with numbers. \x0aNumber is directly mapped to JavaScript Number.\x0a\x0aMost arithmetic methods like `#+` `#/` `#-` `#max:` are directly inlined into javascript. \x0a\x0a##Enumerating\x0aA Number can be used to evaluate a Block a fixed number of times:\x0a\x0a\x095 timesRepeat: [Transcript show: 'This will be printed 5 times'; cr].\x0a\x09\x0a\x091 to: 5 do: [:aNumber| Transcript show: aNumber asString; cr].\x0a\x09\x0a\x091 to: 10 by: 2 do: [:aNumber| Transcript show: aNumber asString; cr]."
  2466. smalltalk.addMethod(
  2467. "_&",
  2468. smalltalk.method({
  2469. selector: "&",
  2470. category: 'converting',
  2471. fn: function (aNumber) {
  2472. var self=this;
  2473. return self & aNumber;
  2474. return self;},
  2475. args: ["aNumber"],
  2476. source: "& aNumber\x0a\x09<return self & aNumber>",
  2477. messageSends: [],
  2478. referencedClasses: []
  2479. }),
  2480. smalltalk.Number);
  2481. smalltalk.addMethod(
  2482. "__star",
  2483. smalltalk.method({
  2484. selector: "*",
  2485. category: 'arithmetic',
  2486. fn: function (aNumber) {
  2487. var self = this;
  2488. return self * aNumber;
  2489. return self;
  2490. },
  2491. args: ["aNumber"],
  2492. source: "* aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self * aNumber>",
  2493. messageSends: [],
  2494. referencedClasses: []
  2495. }),
  2496. smalltalk.Number);
  2497. smalltalk.addMethod(
  2498. "__plus",
  2499. smalltalk.method({
  2500. selector: "+",
  2501. category: 'arithmetic',
  2502. fn: function (aNumber) {
  2503. var self = this;
  2504. return self + aNumber;
  2505. return self;
  2506. },
  2507. args: ["aNumber"],
  2508. source: "+ aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self + aNumber>",
  2509. messageSends: [],
  2510. referencedClasses: []
  2511. }),
  2512. smalltalk.Number);
  2513. smalltalk.addMethod(
  2514. "__minus",
  2515. smalltalk.method({
  2516. selector: "-",
  2517. category: 'arithmetic',
  2518. fn: function (aNumber) {
  2519. var self = this;
  2520. return self - aNumber;
  2521. return self;
  2522. },
  2523. args: ["aNumber"],
  2524. source: "- aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self - aNumber>",
  2525. messageSends: [],
  2526. referencedClasses: []
  2527. }),
  2528. smalltalk.Number);
  2529. smalltalk.addMethod(
  2530. "__slash",
  2531. smalltalk.method({
  2532. selector: "/",
  2533. category: 'arithmetic',
  2534. fn: function (aNumber) {
  2535. var self = this;
  2536. return self / aNumber;
  2537. return self;
  2538. },
  2539. args: ["aNumber"],
  2540. source: "/ aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self / aNumber>",
  2541. messageSends: [],
  2542. referencedClasses: []
  2543. }),
  2544. smalltalk.Number);
  2545. smalltalk.addMethod(
  2546. "__lt",
  2547. smalltalk.method({
  2548. selector: "<",
  2549. category: 'comparing',
  2550. fn: function (aNumber) {
  2551. var self = this;
  2552. return self < aNumber;
  2553. return self;
  2554. },
  2555. args: ["aNumber"],
  2556. source: "< aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self < aNumber>",
  2557. messageSends: [],
  2558. referencedClasses: []
  2559. }),
  2560. smalltalk.Number);
  2561. smalltalk.addMethod(
  2562. "__lt_eq",
  2563. smalltalk.method({
  2564. selector: "<=",
  2565. category: 'comparing',
  2566. fn: function (aNumber) {
  2567. var self = this;
  2568. return self <= aNumber;
  2569. return self;
  2570. },
  2571. args: ["aNumber"],
  2572. source: "<= aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self <= aNumber>",
  2573. messageSends: [],
  2574. referencedClasses: []
  2575. }),
  2576. smalltalk.Number);
  2577. smalltalk.addMethod(
  2578. "__eq",
  2579. smalltalk.method({
  2580. selector: "=",
  2581. category: 'comparing',
  2582. fn: function (aNumber) {
  2583. var self = this;
  2584. try {
  2585. ($receiver = smalltalk.send(aNumber, "_isNumber", [])).klass === smalltalk.Boolean ? !$receiver ? function () {return function () {throw {name: "stReturn", selector: "__eq", fn: function () {return false;}};}();}() : nil : smalltalk.send($receiver, "_ifFalse_", [function () {return function () {throw {name: "stReturn", selector: "__eq", fn: function () {return false;}};}();}]);
  2586. return Number(self) == aNumber;
  2587. return self;
  2588. } catch (e) {
  2589. if (e.name === "stReturn" && e.selector === "__eq") {
  2590. return e.fn();
  2591. }
  2592. throw e;
  2593. }
  2594. },
  2595. args: ["aNumber"],
  2596. source: "= aNumber\x0a\x09aNumber isNumber ifFalse: [^false]. \x0a\x09<return Number(self) == aNumber>",
  2597. messageSends: ["ifFalse:", "isNumber"],
  2598. referencedClasses: []
  2599. }),
  2600. smalltalk.Number);
  2601. smalltalk.addMethod(
  2602. "__gt",
  2603. smalltalk.method({
  2604. selector: ">",
  2605. category: 'comparing',
  2606. fn: function (aNumber) {
  2607. var self = this;
  2608. return self > aNumber;
  2609. return self;
  2610. },
  2611. args: ["aNumber"],
  2612. source: "> aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self >> aNumber>",
  2613. messageSends: [],
  2614. referencedClasses: []
  2615. }),
  2616. smalltalk.Number);
  2617. smalltalk.addMethod(
  2618. "__gt_eq",
  2619. smalltalk.method({
  2620. selector: ">=",
  2621. category: 'comparing',
  2622. fn: function (aNumber) {
  2623. var self = this;
  2624. return self >= aNumber;
  2625. return self;
  2626. },
  2627. args: ["aNumber"],
  2628. source: ">= aNumber\x0a\x09\x22Inlined in the Compiler\x22\x0a\x09<return self >>= aNumber>",
  2629. messageSends: [],
  2630. referencedClasses: []
  2631. }),
  2632. smalltalk.Number);
  2633. smalltalk.addMethod(
  2634. "__at",
  2635. smalltalk.method({
  2636. selector: "@",
  2637. category: 'converting',
  2638. fn: function (aNumber) {
  2639. var self = this;
  2640. return smalltalk.send(smalltalk.Point || Point, "_x_y_", [self, aNumber]);
  2641. return self;
  2642. },
  2643. args: ["aNumber"],
  2644. source: "@ aNumber\x0a\x09^Point x: self y: aNumber",
  2645. messageSends: ["x:y:"],
  2646. referencedClasses: ["Point"]
  2647. }),
  2648. smalltalk.Number);
  2649. smalltalk.addMethod(
  2650. "_\x5c\x5c",
  2651. smalltalk.method({
  2652. selector: "\x5c\x5c",
  2653. category: 'arithmetic',
  2654. fn: function (aNumber) {
  2655. var self = this;
  2656. return self % aNumber;
  2657. return self;
  2658. },
  2659. args: ["aNumber"],
  2660. source: "\x5c\x5c aNumber\x0a\x09<return self % aNumber>",
  2661. messageSends: [],
  2662. referencedClasses: []
  2663. }),
  2664. smalltalk.Number);
  2665. smalltalk.addMethod(
  2666. "_asJSON",
  2667. smalltalk.method({
  2668. selector: "asJSON",
  2669. category: 'converting',
  2670. fn: function () {
  2671. var self=this;
  2672. return self;
  2673. return self;},
  2674. args: [],
  2675. source: "asJSON\x0a\x09^self",
  2676. messageSends: [],
  2677. referencedClasses: []
  2678. }),
  2679. smalltalk.Number);
  2680. smalltalk.addMethod(
  2681. "_asJavascript",
  2682. smalltalk.method({
  2683. selector: "asJavascript",
  2684. category: 'converting',
  2685. fn: function () {
  2686. var self = this;
  2687. return smalltalk.send(smalltalk.send(unescape("%28"), "__comma", [smalltalk.send(self, "_printString", [])]), "__comma", [unescape("%29")]);
  2688. return self;
  2689. },
  2690. args: [],
  2691. source: "asJavascript\x0a\x09^'(', self printString, ')'",
  2692. messageSends: [",", "printString"],
  2693. referencedClasses: []
  2694. }),
  2695. smalltalk.Number);
  2696. smalltalk.addMethod(
  2697. "_asPoint",
  2698. smalltalk.method({
  2699. selector: "asPoint",
  2700. category: 'converting',
  2701. fn: function () {
  2702. var self = this;
  2703. return smalltalk.send(smalltalk.Point || Point, "_x_y_", [self, self]);
  2704. return self;
  2705. },
  2706. args: [],
  2707. source: "asPoint\x0a\x09^Point x: self y: self",
  2708. messageSends: ["x:y:"],
  2709. referencedClasses: ["Point"]
  2710. }),
  2711. smalltalk.Number);
  2712. smalltalk.addMethod(
  2713. "_asString",
  2714. smalltalk.method({
  2715. selector: "asString",
  2716. category: 'converting',
  2717. fn: function () {
  2718. var self = this;
  2719. return smalltalk.send(self, "_printString", []);
  2720. return self;
  2721. },
  2722. args: [],
  2723. source: "asString\x0a\x09^self printString",
  2724. messageSends: ["printString"],
  2725. referencedClasses: []
  2726. }),
  2727. smalltalk.Number);
  2728. smalltalk.addMethod(
  2729. "_atRandom",
  2730. smalltalk.method({
  2731. selector: "atRandom",
  2732. category: 'converting',
  2733. fn: function () {
  2734. var self = this;
  2735. return ($receiver = smalltalk.send(($receiver = smalltalk.send(smalltalk.send(smalltalk.Random || Random, "_new", []), "_next", [])).klass === smalltalk.Number ? $receiver * self : smalltalk.send($receiver, "__star", [self]), "_truncated", [])).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1]);
  2736. return self;
  2737. },
  2738. args: [],
  2739. source: "atRandom\x0a ^(Random new next * self) truncated + 1",
  2740. messageSends: ["+", "truncated", "*", "next", "new"],
  2741. referencedClasses: ["Random"]
  2742. }),
  2743. smalltalk.Number);
  2744. smalltalk.addMethod(
  2745. "_clearInterval",
  2746. smalltalk.method({
  2747. selector: "clearInterval",
  2748. category: 'timeouts/intervals',
  2749. fn: function () {
  2750. var self = this;
  2751. clearInterval(Number(self));
  2752. return self;
  2753. },
  2754. args: [],
  2755. source: "clearInterval\x0a\x09<clearInterval(Number(self))>",
  2756. messageSends: [],
  2757. referencedClasses: []
  2758. }),
  2759. smalltalk.Number);
  2760. smalltalk.addMethod(
  2761. "_clearTimeout",
  2762. smalltalk.method({
  2763. selector: "clearTimeout",
  2764. category: 'timeouts/intervals',
  2765. fn: function () {
  2766. var self = this;
  2767. clearTimeout(Number(self));
  2768. return self;
  2769. },
  2770. args: [],
  2771. source: "clearTimeout\x0a\x09<clearTimeout(Number(self))>",
  2772. messageSends: [],
  2773. referencedClasses: []
  2774. }),
  2775. smalltalk.Number);
  2776. smalltalk.addMethod(
  2777. "_copy",
  2778. smalltalk.method({
  2779. selector: "copy",
  2780. category: 'copying',
  2781. fn: function () {
  2782. var self = this;
  2783. return self;
  2784. return self;
  2785. },
  2786. args: [],
  2787. source: "copy\x0a\x09^self",
  2788. messageSends: [],
  2789. referencedClasses: []
  2790. }),
  2791. smalltalk.Number);
  2792. smalltalk.addMethod(
  2793. "_deepCopy",
  2794. smalltalk.method({
  2795. selector: "deepCopy",
  2796. category: 'copying',
  2797. fn: function () {
  2798. var self = this;
  2799. return smalltalk.send(self, "_copy", []);
  2800. return self;
  2801. },
  2802. args: [],
  2803. source: "deepCopy\x0a\x09^self copy",
  2804. messageSends: ["copy"],
  2805. referencedClasses: []
  2806. }),
  2807. smalltalk.Number);
  2808. smalltalk.addMethod(
  2809. "_even",
  2810. smalltalk.method({
  2811. selector: "even",
  2812. category: 'testing',
  2813. fn: function () {
  2814. var self = this;
  2815. return smalltalk.send(0, "__eq", [smalltalk.send(self, "_\\\\", [2])]);
  2816. return self;
  2817. },
  2818. args: [],
  2819. source: "even\x0a\x09^ 0 = (self \x5c\x5c 2)",
  2820. messageSends: ["=", "\x5c\x5c\x5c\x5c"],
  2821. referencedClasses: []
  2822. }),
  2823. smalltalk.Number);
  2824. smalltalk.addMethod(
  2825. "_identityHash",
  2826. smalltalk.method({
  2827. selector: "identityHash",
  2828. category: 'accessing',
  2829. fn: function () {
  2830. var self = this;
  2831. return smalltalk.send(smalltalk.send(self, "_asString", []), "__comma", ["n"]);
  2832. return self;
  2833. },
  2834. args: [],
  2835. source: "identityHash\x0a\x09^self asString, 'n'",
  2836. messageSends: [",", "asString"],
  2837. referencedClasses: []
  2838. }),
  2839. smalltalk.Number);
  2840. smalltalk.addMethod(
  2841. "_isNumber",
  2842. smalltalk.method({
  2843. selector: "isNumber",
  2844. category: 'testing',
  2845. fn: function () {
  2846. var self = this;
  2847. return true;
  2848. return self;
  2849. },
  2850. args: [],
  2851. source: "isNumber\x0a\x09^true",
  2852. messageSends: [],
  2853. referencedClasses: []
  2854. }),
  2855. smalltalk.Number);
  2856. smalltalk.addMethod(
  2857. "_isZero",
  2858. smalltalk.method({
  2859. selector: "isZero",
  2860. category: 'testing',
  2861. fn: function () {
  2862. var self = this;
  2863. return smalltalk.send(self, "__eq", [0]);
  2864. return self;
  2865. },
  2866. args: [],
  2867. source: "isZero\x0a\x09^self = 0",
  2868. messageSends: ["="],
  2869. referencedClasses: []
  2870. }),
  2871. smalltalk.Number);
  2872. smalltalk.addMethod(
  2873. "_max_",
  2874. smalltalk.method({
  2875. selector: "max:",
  2876. category: 'arithmetic',
  2877. fn: function (aNumber) {
  2878. var self = this;
  2879. return Math.max(self, aNumber);
  2880. return self;
  2881. },
  2882. args: ["aNumber"],
  2883. source: "max: aNumber\x0a\x09<return Math.max(self, aNumber);>",
  2884. messageSends: [],
  2885. referencedClasses: []
  2886. }),
  2887. smalltalk.Number);
  2888. smalltalk.addMethod(
  2889. "_min_",
  2890. smalltalk.method({
  2891. selector: "min:",
  2892. category: 'arithmetic',
  2893. fn: function (aNumber) {
  2894. var self = this;
  2895. return Math.min(self, aNumber);
  2896. return self;
  2897. },
  2898. args: ["aNumber"],
  2899. source: "min: aNumber\x0a\x09<return Math.min(self, aNumber);>",
  2900. messageSends: [],
  2901. referencedClasses: []
  2902. }),
  2903. smalltalk.Number);
  2904. smalltalk.addMethod(
  2905. "_negated",
  2906. smalltalk.method({
  2907. selector: "negated",
  2908. category: 'arithmetic',
  2909. fn: function () {
  2910. var self = this;
  2911. return 0 - self;
  2912. return self;
  2913. },
  2914. args: [],
  2915. source: "negated\x0a\x09^0 - self",
  2916. messageSends: ["-"],
  2917. referencedClasses: []
  2918. }),
  2919. smalltalk.Number);
  2920. smalltalk.addMethod(
  2921. "_negative",
  2922. smalltalk.method({
  2923. selector: "negative",
  2924. category: 'testing',
  2925. fn: function () {
  2926. var self = this;
  2927. return self < 0;
  2928. return self;
  2929. },
  2930. args: [],
  2931. source: "negative\x0a\x09\x22Answer whether the receiver is mathematically negative.\x22\x0a\x0a\x09^ self < 0",
  2932. messageSends: ["<"],
  2933. referencedClasses: []
  2934. }),
  2935. smalltalk.Number);
  2936. smalltalk.addMethod(
  2937. "_odd",
  2938. smalltalk.method({
  2939. selector: "odd",
  2940. category: 'testing',
  2941. fn: function () {
  2942. var self = this;
  2943. return smalltalk.send(smalltalk.send(self, "_even", []), "_not", []);
  2944. return self;
  2945. },
  2946. args: [],
  2947. source: "odd\x0a\x09^ self even not",
  2948. messageSends: ["not", "even"],
  2949. referencedClasses: []
  2950. }),
  2951. smalltalk.Number);
  2952. smalltalk.addMethod(
  2953. "_positive",
  2954. smalltalk.method({
  2955. selector: "positive",
  2956. category: 'testing',
  2957. fn: function () {
  2958. var self = this;
  2959. return self >= 0;
  2960. return self;
  2961. },
  2962. args: [],
  2963. source: "positive\x0a\x09\x22Answer whether the receiver is positive or equal to 0. (ST-80 protocol).\x22\x0a\x0a\x09^ self >= 0",
  2964. messageSends: [">="],
  2965. referencedClasses: []
  2966. }),
  2967. smalltalk.Number);
  2968. smalltalk.addMethod(
  2969. "_printShowingDecimalPlaces_",
  2970. smalltalk.method({
  2971. selector: "printShowingDecimalPlaces:",
  2972. category: 'printing',
  2973. fn: function (placesDesired) {
  2974. var self = this;
  2975. return self.toFixed(placesDesired);
  2976. return self;
  2977. },
  2978. args: ["placesDesired"],
  2979. source: "printShowingDecimalPlaces: placesDesired\x0a\x09<return self.toFixed(placesDesired)>",
  2980. messageSends: [],
  2981. referencedClasses: []
  2982. }),
  2983. smalltalk.Number);
  2984. smalltalk.addMethod(
  2985. "_printString",
  2986. smalltalk.method({
  2987. selector: "printString",
  2988. category: 'printing',
  2989. fn: function () {
  2990. var self = this;
  2991. return String(self);
  2992. return self;
  2993. },
  2994. args: [],
  2995. source: "printString\x0a\x09<return String(self)>",
  2996. messageSends: [],
  2997. referencedClasses: []
  2998. }),
  2999. smalltalk.Number);
  3000. smalltalk.addMethod(
  3001. "_rounded",
  3002. smalltalk.method({
  3003. selector: "rounded",
  3004. category: 'converting',
  3005. fn: function () {
  3006. var self = this;
  3007. return Math.round(self);
  3008. return self;
  3009. },
  3010. args: [],
  3011. source: "rounded\x0a\x09<return Math.round(self);>",
  3012. messageSends: [],
  3013. referencedClasses: []
  3014. }),
  3015. smalltalk.Number);
  3016. smalltalk.addMethod(
  3017. "_sqrt",
  3018. smalltalk.method({
  3019. selector: "sqrt",
  3020. category: 'arithmetic',
  3021. fn: function () {
  3022. var self = this;
  3023. return Math.sqrt(self);
  3024. return self;
  3025. },
  3026. args: [],
  3027. source: "sqrt\x0a\x09<return Math.sqrt(self)>",
  3028. messageSends: [],
  3029. referencedClasses: []
  3030. }),
  3031. smalltalk.Number);
  3032. smalltalk.addMethod(
  3033. "_squared",
  3034. smalltalk.method({
  3035. selector: "squared",
  3036. category: 'arithmetic',
  3037. fn: function () {
  3038. var self = this;
  3039. return self * self;
  3040. return self;
  3041. },
  3042. args: [],
  3043. source: "squared\x0a\x09^self * self",
  3044. messageSends: ["*"],
  3045. referencedClasses: []
  3046. }),
  3047. smalltalk.Number);
  3048. smalltalk.addMethod(
  3049. "_timesRepeat_",
  3050. smalltalk.method({
  3051. selector: "timesRepeat:",
  3052. category: 'enumerating',
  3053. fn: function (aBlock) {
  3054. var self = this;
  3055. var integer = nil;
  3056. var count = nil;
  3057. integer = smalltalk.send(self, "_truncated", []);
  3058. count = 1;
  3059. (function () {while (!function () {return ($receiver = count).klass === smalltalk.Number ? $receiver > self : smalltalk.send($receiver, "__gt", [self]);}()) {(function () {smalltalk.send(aBlock, "_value", []);return count = ($receiver = count).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1]);}());}}());
  3060. return self;
  3061. },
  3062. args: ["aBlock"],
  3063. source: "timesRepeat: aBlock\x0a\x09| integer count |\x0a\x09integer := self truncated.\x0a\x09count := 1.\x0a\x09[count > self] whileFalse: [\x0a\x09 aBlock value.\x0a\x09 count := count + 1]",
  3064. messageSends: ["truncated", "whileFalse:", ">", "value", "+"],
  3065. referencedClasses: []
  3066. }),
  3067. smalltalk.Number);
  3068. smalltalk.addMethod(
  3069. "_to_",
  3070. smalltalk.method({
  3071. selector: "to:",
  3072. category: 'converting',
  3073. fn: function (aNumber) {
  3074. var self = this;
  3075. var array = nil;
  3076. var first = nil;
  3077. var last = nil;
  3078. var count = nil;
  3079. first = smalltalk.send(self, "_truncated", []);
  3080. last = ($receiver = smalltalk.send(aNumber, "_truncated", [])).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1]);
  3081. count = 1;
  3082. array = smalltalk.send(smalltalk.Array || Array, "_new", []);
  3083. smalltalk.send(($receiver = last).klass === smalltalk.Number ? $receiver - first : smalltalk.send($receiver, "__minus", [first]), "_timesRepeat_", [function () {smalltalk.send(array, "_at_put_", [count, first]);count = ($receiver = count).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1]);return first = ($receiver = first).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1]);}]);
  3084. return array;
  3085. return self;
  3086. },
  3087. args: ["aNumber"],
  3088. source: "to: aNumber\x0a\x09| array first last count |\x0a\x09first := self truncated.\x0a\x09last := aNumber truncated + 1.\x0a\x09count := 1.\x0a\x09array := Array new.\x0a\x09(last - first) timesRepeat: [\x0a\x09 array at: count put: first.\x0a\x09 count := count + 1.\x0a\x09 first := first + 1].\x0a\x09^array",
  3089. messageSends: ["truncated", "+", "new", "timesRepeat:", "-", "at:put:"],
  3090. referencedClasses: ["Array"]
  3091. }),
  3092. smalltalk.Number);
  3093. smalltalk.addMethod(
  3094. "_to_by_",
  3095. smalltalk.method({
  3096. selector: "to:by:",
  3097. category: 'converting',
  3098. fn: function (stop, step) {
  3099. var self = this;
  3100. var array = nil;
  3101. var value = nil;
  3102. var pos = nil;
  3103. value = self;
  3104. array = smalltalk.send(smalltalk.Array || Array, "_new", []);
  3105. pos = 1;
  3106. ($receiver = smalltalk.send(step, "__eq", [0])).klass === smalltalk.Boolean ? $receiver ? function () {return smalltalk.send(self, "_error_", [unescape("step%20must%20be%20non-zero")]);}() : nil : smalltalk.send($receiver, "_ifTrue_", [function () {return smalltalk.send(self, "_error_", [unescape("step%20must%20be%20non-zero")]);}]);
  3107. ($receiver = ($receiver = step).klass === smalltalk.Number ? $receiver < 0 : smalltalk.send($receiver, "__lt", [0])).klass === smalltalk.Boolean ? $receiver ? function () {return function () {while (function () {return ($receiver = value).klass === smalltalk.Number ? $receiver >= stop : smalltalk.send($receiver, "__gt_eq", [stop]);}()) {(function () {smalltalk.send(array, "_at_put_", [pos, value]);pos = ($receiver = pos).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1]);return value = ($receiver = value).klass === smalltalk.Number ? $receiver + step : smalltalk.send($receiver, "__plus", [step]);}());}}();}() : function () {return function () {while (function () {return ($receiver = value).klass === smalltalk.Number ? $receiver <= stop : smalltalk.send($receiver, "__lt_eq", [stop]);}()) {(function () {smalltalk.send(array, "_at_put_", [pos, value]);pos = ($receiver = pos).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1]);return value = ($receiver = value).klass === smalltalk.Number ? $receiver + step : smalltalk.send($receiver, "__plus", [step]);}());}}();}() : smalltalk.send($receiver, "_ifTrue_ifFalse_", [function () {return function () {while (function () {return ($receiver = value).klass === smalltalk.Number ? $receiver >= stop : smalltalk.send($receiver, "__gt_eq", [stop]);}()) {(function () {smalltalk.send(array, "_at_put_", [pos, value]);pos = ($receiver = pos).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1]);return value = ($receiver = value).klass === smalltalk.Number ? $receiver + step : smalltalk.send($receiver, "__plus", [step]);}());}}();}, function () {return function () {while (function () {return ($receiver = value).klass === smalltalk.Number ? $receiver <= stop : smalltalk.send($receiver, "__lt_eq", [stop]);}()) {(function () {smalltalk.send(array, "_at_put_", [pos, value]);pos = ($receiver = pos).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1]);return value = ($receiver = value).klass === smalltalk.Number ? $receiver + step : smalltalk.send($receiver, "__plus", [step]);}());}}();}]);
  3108. return array;
  3109. return self;
  3110. },
  3111. args: ["stop", "step"],
  3112. source: "to: stop by: step\x0a\x09| array value pos |\x0a\x09value := self.\x0a\x09array := Array new.\x0a\x09pos := 1.\x0a\x09step = 0 ifTrue: [self error: 'step must be non-zero'].\x0a\x09step < 0\x0a\x09\x09ifTrue: [[ value >= stop ] whileTrue: [\x0a\x09 \x09\x09\x09array at: pos put: value.\x0a\x09 \x09\x09\x09pos := pos + 1.\x0a\x09 \x09\x09\x09value := value + step]]\x0a\x09\x09ifFalse: [[ value <= stop ] whileTrue: [\x0a\x09 \x09\x09\x09array at: pos put: value.\x0a\x09 \x09\x09\x09pos := pos + 1.\x0a\x09 \x09\x09\x09value := value + step]].\x0a\x09^array",
  3113. messageSends: ["new", "ifTrue:", "=", "error:", "ifTrue:ifFalse:", "<", "whileTrue:", ">=", "at:put:", "+", "<="],
  3114. referencedClasses: ["Array"]
  3115. }),
  3116. smalltalk.Number);
  3117. smalltalk.addMethod(
  3118. "_to_by_do_",
  3119. smalltalk.method({
  3120. selector: "to:by:do:",
  3121. category: 'enumerating',
  3122. fn: function (stop, step, aBlock) {
  3123. var self = this;
  3124. var value = nil;
  3125. value = self;
  3126. ($receiver = smalltalk.send(step, "__eq", [0])).klass === smalltalk.Boolean ? $receiver ? function () {return smalltalk.send(self, "_error_", [unescape("step%20must%20be%20non-zero")]);}() : nil : smalltalk.send($receiver, "_ifTrue_", [function () {return smalltalk.send(self, "_error_", [unescape("step%20must%20be%20non-zero")]);}]);
  3127. ($receiver = ($receiver = step).klass === smalltalk.Number ? $receiver < 0 : smalltalk.send($receiver, "__lt", [0])).klass === smalltalk.Boolean ? $receiver ? function () {return function () {while (function () {return ($receiver = value).klass === smalltalk.Number ? $receiver >= stop : smalltalk.send($receiver, "__gt_eq", [stop]);}()) {(function () {smalltalk.send(aBlock, "_value_", [value]);return value = ($receiver = value).klass === smalltalk.Number ? $receiver + step : smalltalk.send($receiver, "__plus", [step]);}());}}();}() : function () {return function () {while (function () {return ($receiver = value).klass === smalltalk.Number ? $receiver <= stop : smalltalk.send($receiver, "__lt_eq", [stop]);}()) {(function () {smalltalk.send(aBlock, "_value_", [value]);return value = ($receiver = value).klass === smalltalk.Number ? $receiver + step : smalltalk.send($receiver, "__plus", [step]);}());}}();}() : smalltalk.send($receiver, "_ifTrue_ifFalse_", [function () {return function () {while (function () {return ($receiver = value).klass === smalltalk.Number ? $receiver >= stop : smalltalk.send($receiver, "__gt_eq", [stop]);}()) {(function () {smalltalk.send(aBlock, "_value_", [value]);return value = ($receiver = value).klass === smalltalk.Number ? $receiver + step : smalltalk.send($receiver, "__plus", [step]);}());}}();}, function () {return function () {while (function () {return ($receiver = value).klass === smalltalk.Number ? $receiver <= stop : smalltalk.send($receiver, "__lt_eq", [stop]);}()) {(function () {smalltalk.send(aBlock, "_value_", [value]);return value = ($receiver = value).klass === smalltalk.Number ? $receiver + step : smalltalk.send($receiver, "__plus", [step]);}());}}();}]);
  3128. return self;
  3129. },
  3130. args: ["stop", "step", "aBlock"],
  3131. source: "to: stop by: step do: aBlock\x0a\x09| value |\x0a\x09value := self.\x0a\x09step = 0 ifTrue: [self error: 'step must be non-zero'].\x0a\x09step < 0\x0a\x09\x09ifTrue: [[ value >= stop ] whileTrue: [\x0a\x09 \x09\x09\x09aBlock value: value.\x0a\x09 \x09\x09\x09value := value + step]]\x0a\x09\x09ifFalse: [[ value <= stop ] whileTrue: [\x0a\x09 \x09\x09\x09aBlock value: value.\x0a\x09 \x09\x09\x09value := value + step]]",
  3132. messageSends: ["ifTrue:", "=", "error:", "ifTrue:ifFalse:", "<", "whileTrue:", ">=", "value:", "+", "<="],
  3133. referencedClasses: []
  3134. }),
  3135. smalltalk.Number);
  3136. smalltalk.addMethod(
  3137. "_to_do_",
  3138. smalltalk.method({
  3139. selector: "to:do:",
  3140. category: 'enumerating',
  3141. fn: function (stop, aBlock) {
  3142. var self = this;
  3143. var nextValue = nil;
  3144. nextValue = self;
  3145. (function () {while (function () {return ($receiver = nextValue).klass === smalltalk.Number ? $receiver <= stop : smalltalk.send($receiver, "__lt_eq", [stop]);}()) {(function () {smalltalk.send(aBlock, "_value_", [nextValue]);return nextValue = ($receiver = nextValue).klass === smalltalk.Number ? $receiver + 1 : smalltalk.send($receiver, "__plus", [1]);}());}}());
  3146. return self;
  3147. },
  3148. args: ["stop", "aBlock"],
  3149. source: "to: stop do: aBlock\x0a\x09\x22Evaluate aBlock for each number from self to aNumber.\x22\x0a\x09| nextValue |\x0a\x09nextValue := self.\x0a\x09[nextValue <= stop]\x0a\x09\x09whileTrue: \x0a\x09\x09\x09[aBlock value: nextValue.\x0a\x09\x09\x09nextValue := nextValue + 1]",
  3150. messageSends: ["whileTrue:", "<=", "value:", "+"],
  3151. referencedClasses: []
  3152. }),
  3153. smalltalk.Number);
  3154. smalltalk.addMethod(
  3155. "_truncated",
  3156. smalltalk.method({
  3157. selector: "truncated",
  3158. category: 'converting',
  3159. fn: function () {
  3160. var self = this;
  3161. var result = nil;
  3162. ($receiver = self >= 0).klass === smalltalk.Boolean ? $receiver ? function () {return result = Math.floor(self);}() : function () {return result = Math.floor(self * -1) * -1;}() : smalltalk.send($receiver, "_ifTrue_ifFalse_", [function () {return result = Math.floor(self);}, function () {return result = Math.floor(self * -1) * -1;}]);
  3163. return result;
  3164. return self;
  3165. },
  3166. args: [],
  3167. source: "truncated\x0a|result|\x0a\x0a self >= 0 \x0a ifTrue: [<result = Math.floor(self);>]\x0a ifFalse: [<result = (Math.floor(self * (-1)) * (-1));>].\x0a\x0a ^ result",
  3168. messageSends: ["ifTrue:ifFalse:", ">="],
  3169. referencedClasses: []
  3170. }),
  3171. smalltalk.Number);
  3172. smalltalk.addMethod(
  3173. "_|",
  3174. smalltalk.method({
  3175. selector: "|",
  3176. category: 'converting',
  3177. fn: function (aNumber) {
  3178. var self=this;
  3179. return self | aNumber;
  3180. return self;},
  3181. args: ["aNumber"],
  3182. source: "| aNumber\x0a\x09<return self | aNumber>",
  3183. messageSends: [],
  3184. referencedClasses: []
  3185. }),
  3186. smalltalk.Number);
  3187. smalltalk.addMethod(
  3188. "_pi",
  3189. smalltalk.method({
  3190. selector: "pi",
  3191. category: 'instance creation',
  3192. fn: function () {
  3193. var self = this;
  3194. return Math.PI;
  3195. return self;
  3196. },
  3197. args: [],
  3198. source: "pi\x0a\x09<return Math.PI>",
  3199. messageSends: [],
  3200. referencedClasses: []
  3201. }),
  3202. smalltalk.Number.klass);
  3203. smalltalk.addClass('Package', smalltalk.Object, ['commitPathJs', 'commitPathSt'], 'Kernel-Objects');
  3204. smalltalk.Package.comment="A Package is similar to a \x22class category\x22 typically found in other Smalltalks like Pharo or Squeak. Amber does not have class categories anymore, it had in the beginning but now each class in the system knows which package it belongs to.\x0a\x0aA Package has a name, an Array of \x22requires\x22, a comment and a Dictionary with other optional key value attributes. A Package can also be queried for its classes, but it will then resort to a reverse scan of all classes to find them.\x0aPackages are manipulated through \x22Smalltalk current\x22, like for example finding one based on a name:\x0a\x0a\x09Smalltalk current packageAt: 'Kernel'\x0a\x0a...but you can also use:\x0a\x0a\x09Package named: 'Kernel'\x0a\x0aA Package differs slightly from a Monticello package which can span multiple class categories using a naming convention based on hyphenation. But just as in Monticello a Package supports \x22class extensions\x22 so a Package\x0acan define behaviors in foreign classes using a naming convention for method categories where the category starts with an asterisk and then the name of the owning package follows. This can easily be seen in for example class\x0aString where the method category \x22*IDE\x22 defines #inspectOn: which thus is a method belonging to the IDE package.\x0a\x0aYou can fetch a package from the server:\x0a\x0a\x09Package fetch: 'Additional-Examples'"
  3205. smalltalk.addMethod(
  3206. "_classes",
  3207. smalltalk.method({
  3208. selector: "classes",
  3209. category: 'classes',
  3210. fn: function () {
  3211. var self = this;
  3212. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_classes", []), "_select_", [function (c) {return smalltalk.send(smalltalk.send(c, "_package", []), "__eq_eq", [self]);}]);
  3213. return self;
  3214. },
  3215. args: [],
  3216. source: "classes\x0a\x09\x22We need to do a reverse scan.\x22\x0a\x09^Smalltalk current classes select: [:c | c package == self]",
  3217. messageSends: ["select:", "classes", "current", "==", "package"],
  3218. referencedClasses: ["Smalltalk"]
  3219. }),
  3220. smalltalk.Package);
  3221. smalltalk.addMethod(
  3222. "_commitPathJs",
  3223. smalltalk.method({
  3224. selector: "commitPathJs",
  3225. category: 'accessing',
  3226. fn: function () {
  3227. var self = this;
  3228. return ($receiver = self['@commitPathJs']) == nil ||
  3229. $receiver == undefined ? function () {return smalltalk.send(smalltalk.send(self, "_class", []), "_defaultCommitPathJs", []);}() : $receiver;
  3230. return self;
  3231. },
  3232. args: [],
  3233. source: "commitPathJs\x0a\x09^ commitPathJs ifNil: [self class defaultCommitPathJs]",
  3234. messageSends: ["ifNil:", "defaultCommitPathJs", "class"],
  3235. referencedClasses: []
  3236. }),
  3237. smalltalk.Package);
  3238. smalltalk.addMethod(
  3239. "_commitPathJs_",
  3240. smalltalk.method({
  3241. selector: "commitPathJs:",
  3242. category: 'accessing',
  3243. fn: function (aString) {
  3244. var self = this;
  3245. self['@commitPathJs'] = aString;
  3246. return self;
  3247. },
  3248. args: ["aString"],
  3249. source: "commitPathJs: aString\x0a\x09commitPathJs := aString",
  3250. messageSends: [],
  3251. referencedClasses: []
  3252. }),
  3253. smalltalk.Package);
  3254. smalltalk.addMethod(
  3255. "_commitPathSt",
  3256. smalltalk.method({
  3257. selector: "commitPathSt",
  3258. category: 'accessing',
  3259. fn: function () {
  3260. var self = this;
  3261. return ($receiver = self['@commitPathSt']) == nil ||
  3262. $receiver == undefined ? function () {return smalltalk.send(smalltalk.send(self, "_class", []), "_defaultCommitPathSt", []);}() : $receiver;
  3263. return self;
  3264. },
  3265. args: [],
  3266. source: "commitPathSt\x0a\x09^ commitPathSt ifNil: [self class defaultCommitPathSt]",
  3267. messageSends: ["ifNil:", "defaultCommitPathSt", "class"],
  3268. referencedClasses: []
  3269. }),
  3270. smalltalk.Package);
  3271. smalltalk.addMethod(
  3272. "_commitPathSt_",
  3273. smalltalk.method({
  3274. selector: "commitPathSt:",
  3275. category: 'accessing',
  3276. fn: function (aString) {
  3277. var self = this;
  3278. self['@commitPathSt'] = aString;
  3279. return self;
  3280. },
  3281. args: ["aString"],
  3282. source: "commitPathSt: aString\x0a\x09commitPathSt := aString",
  3283. messageSends: [],
  3284. referencedClasses: []
  3285. }),
  3286. smalltalk.Package);
  3287. smalltalk.addMethod(
  3288. "_dependencies",
  3289. smalltalk.method({
  3290. selector: "dependencies",
  3291. category: 'accessing',
  3292. fn: function () {
  3293. var self = this;
  3294. return smalltalk.send(self, "_propertyAt_ifAbsent_", ["dependencies", function () {return [];}]);
  3295. return self;
  3296. },
  3297. args: [],
  3298. source: "dependencies\x0a\x09^self propertyAt: 'dependencies' ifAbsent: [#()]",
  3299. messageSends: ["propertyAt:ifAbsent:"],
  3300. referencedClasses: []
  3301. }),
  3302. smalltalk.Package);
  3303. smalltalk.addMethod(
  3304. "_dependencies_",
  3305. smalltalk.method({
  3306. selector: "dependencies:",
  3307. category: 'accessing',
  3308. fn: function (anArray) {
  3309. var self = this;
  3310. return smalltalk.send(self, "_propertyAt_put_", ["dependencies", anArray]);
  3311. return self;
  3312. },
  3313. args: ["anArray"],
  3314. source: "dependencies: anArray\x0a\x09^self propertyAt: 'dependencies' put: anArray",
  3315. messageSends: ["propertyAt:put:"],
  3316. referencedClasses: []
  3317. }),
  3318. smalltalk.Package);
  3319. smalltalk.addMethod(
  3320. "_jsProperties",
  3321. smalltalk.method({
  3322. selector: "jsProperties",
  3323. category: 'private',
  3324. fn: function () {
  3325. var self = this;
  3326. return self.properties;
  3327. return self;
  3328. },
  3329. args: [],
  3330. source: "jsProperties\x0a\x09<return self.properties>",
  3331. messageSends: [],
  3332. referencedClasses: []
  3333. }),
  3334. smalltalk.Package);
  3335. smalltalk.addMethod(
  3336. "_jsProperties_",
  3337. smalltalk.method({
  3338. selector: "jsProperties:",
  3339. category: 'private',
  3340. fn: function (aJSObject) {
  3341. var self = this;
  3342. return self.properties = aJSObject;
  3343. return self;
  3344. },
  3345. args: ["aJSObject"],
  3346. source: "jsProperties: aJSObject\x0a\x09<return self.properties = aJSObject>",
  3347. messageSends: [],
  3348. referencedClasses: []
  3349. }),
  3350. smalltalk.Package);
  3351. smalltalk.addMethod(
  3352. "_name",
  3353. smalltalk.method({
  3354. selector: "name",
  3355. category: 'accessing',
  3356. fn: function () {
  3357. var self = this;
  3358. return self.pkgName;
  3359. return self;
  3360. },
  3361. args: [],
  3362. source: "name\x0a\x09<return self.pkgName>",
  3363. messageSends: [],
  3364. referencedClasses: []
  3365. }),
  3366. smalltalk.Package);
  3367. smalltalk.addMethod(
  3368. "_name_",
  3369. smalltalk.method({
  3370. selector: "name:",
  3371. category: 'accessing',
  3372. fn: function (aString) {
  3373. var self = this;
  3374. self.pkgName = aString;
  3375. return self;
  3376. },
  3377. args: ["aString"],
  3378. source: "name: aString\x0a\x09<self.pkgName = aString>",
  3379. messageSends: [],
  3380. referencedClasses: []
  3381. }),
  3382. smalltalk.Package);
  3383. smalltalk.addMethod(
  3384. "_printString",
  3385. smalltalk.method({
  3386. selector: "printString",
  3387. category: 'printing',
  3388. fn: function () {
  3389. var self = this;
  3390. return smalltalk.send(self, "_name", []);
  3391. return self;
  3392. },
  3393. args: [],
  3394. source: "printString\x0a\x09^self name",
  3395. messageSends: ["name"],
  3396. referencedClasses: []
  3397. }),
  3398. smalltalk.Package);
  3399. smalltalk.addMethod(
  3400. "_properties",
  3401. smalltalk.method({
  3402. selector: "properties",
  3403. category: 'accessing',
  3404. fn: function () {
  3405. var self = this;
  3406. return smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_readJSObject_", [smalltalk.send(self, "_basicAt_", ["properties"])]);
  3407. return self;
  3408. },
  3409. args: [],
  3410. source: "properties\x0a\x09^Smalltalk current readJSObject: (self basicAt: 'properties')",
  3411. messageSends: ["readJSObject:", "current", "basicAt:"],
  3412. referencedClasses: ["Smalltalk"]
  3413. }),
  3414. smalltalk.Package);
  3415. smalltalk.addMethod(
  3416. "_properties_",
  3417. smalltalk.method({
  3418. selector: "properties:",
  3419. category: 'accessing',
  3420. fn: function (aDict) {
  3421. var self = this;
  3422. var object = nil;
  3423. object = {};
  3424. smalltalk.send(aDict, "_keysAndValuesDo_", [function (key, value) {return object[key] = value;}]);
  3425. return self.properties = object;
  3426. return self;
  3427. },
  3428. args: ["aDict"],
  3429. source: "properties: aDict\x0a\x09\x22We store it as a javascript object.\x22\x0a\x09\x0a\x09| object |\x0a\x09<object = {};>.\x0a\x09aDict keysAndValuesDo: [:key :value |\x0a\x09\x09<object[key] = value>.\x0a\x09].\x0a\x09<return self.properties = object>",
  3430. messageSends: ["keysAndValuesDo:"],
  3431. referencedClasses: []
  3432. }),
  3433. smalltalk.Package);
  3434. smalltalk.addMethod(
  3435. "_propertiesAsJSON",
  3436. smalltalk.method({
  3437. selector: "propertiesAsJSON",
  3438. category: 'private',
  3439. fn: function () {
  3440. var self = this;
  3441. return JSON.stringify(self.properties);
  3442. return self;
  3443. },
  3444. args: [],
  3445. source: "propertiesAsJSON\x0a\x09<return JSON.stringify(self.properties)>",
  3446. messageSends: [],
  3447. referencedClasses: []
  3448. }),
  3449. smalltalk.Package);
  3450. smalltalk.addMethod(
  3451. "_propertyAt_",
  3452. smalltalk.method({
  3453. selector: "propertyAt:",
  3454. category: 'properties',
  3455. fn: function (key) {
  3456. var self = this;
  3457. return self.properties[key];
  3458. return self;
  3459. },
  3460. args: ["key"],
  3461. source: "propertyAt: key\x0a\x0a\x09<return self.properties[key]>",
  3462. messageSends: [],
  3463. referencedClasses: []
  3464. }),
  3465. smalltalk.Package);
  3466. smalltalk.addMethod(
  3467. "_propertyAt_ifAbsent_",
  3468. smalltalk.method({
  3469. selector: "propertyAt:ifAbsent:",
  3470. category: 'properties',
  3471. fn: function (key, block) {
  3472. var self = this;
  3473. return ($receiver = smalltalk.send(self, "_propertyAt_", [key])) == nil ||
  3474. $receiver == undefined ? function () {return smalltalk.send(block, "_value", []);}() : $receiver;
  3475. return self;
  3476. },
  3477. args: ["key", "block"],
  3478. source: "propertyAt: key ifAbsent: block\x0a\x0a\x09^(self propertyAt: key) ifNil: [block value]",
  3479. messageSends: ["ifNil:", "propertyAt:", "value"],
  3480. referencedClasses: []
  3481. }),
  3482. smalltalk.Package);
  3483. smalltalk.addMethod(
  3484. "_propertyAt_put_",
  3485. smalltalk.method({
  3486. selector: "propertyAt:put:",
  3487. category: 'properties',
  3488. fn: function (key, value) {
  3489. var self = this;
  3490. return self.properties[key] = value;
  3491. return self;
  3492. },
  3493. args: ["key", "value"],
  3494. source: "propertyAt: key put: value\x0a\x0a\x09<return self.properties[key] = value>",
  3495. messageSends: [],
  3496. referencedClasses: []
  3497. }),
  3498. smalltalk.Package);
  3499. smalltalk.addMethod(
  3500. "_sortedClasses",
  3501. smalltalk.method({
  3502. selector: "sortedClasses",
  3503. category: 'classes',
  3504. fn: function () {
  3505. var self=this;
  3506. return smalltalk.send(smalltalk.send(self, "_class", []), "_sortedClasses_", [smalltalk.send(self, "_classes", [])]);
  3507. return self;},
  3508. args: [],
  3509. source: "sortedClasses\x0a\x09\x22Answer all classes in the receiver, sorted by superclass/subclasses and by class name for common subclasses (Issue #143).\x22\x0a\x0a\x09^self class sortedClasses: self classes",
  3510. messageSends: ["sortedClasses:", "class", "classes"],
  3511. referencedClasses: []
  3512. }),
  3513. smalltalk.Package);
  3514. smalltalk.Package.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
  3515. smalltalk.addMethod(
  3516. "_commitToLocalStorage_",
  3517. smalltalk.method({
  3518. selector: "commitToLocalStorage:",
  3519. category: 'loading-storing',
  3520. fn: function (aPackageName) {
  3521. var self = this;
  3522. var key = nil;
  3523. var sourceCode = nil;
  3524. key = smalltalk.send("smalltalk.packages.", "__comma", [aPackageName]);
  3525. sourceCode = smalltalk.send(smalltalk.send(smalltalk.Exporter || Exporter, "_new", []), "_exportPackage_", [aPackageName]);
  3526. localStorage[key] = escape(sourceCode);
  3527. return self;
  3528. },
  3529. args: ["aPackageName"],
  3530. source: "commitToLocalStorage: aPackageName\x0a\x09| key sourceCode |\x0a\x09key := 'smalltalk.packages.' , aPackageName.\x0a\x09sourceCode := Exporter new exportPackage: aPackageName.\x0a\x09<localStorage[key] = escape(sourceCode)>",
  3531. messageSends: [",", "exportPackage:", "new"],
  3532. referencedClasses: ["Exporter"]
  3533. }),
  3534. smalltalk.Package.klass);
  3535. smalltalk.addMethod(
  3536. "_defaultCommitPathJs",
  3537. smalltalk.method({
  3538. selector: "defaultCommitPathJs",
  3539. category: 'commit paths',
  3540. fn: function () {
  3541. var self = this;
  3542. return ($receiver = self['@defaultCommitPathJs']) == nil ||
  3543. $receiver == undefined ? function () {return self['@defaultCommitPathJs'] = "js";}() : $receiver;
  3544. return self;
  3545. },
  3546. args: [],
  3547. source: "defaultCommitPathJs\x0a\x09^ defaultCommitPathJs ifNil: [ defaultCommitPathJs := 'js']",
  3548. messageSends: ["ifNil:"],
  3549. referencedClasses: []
  3550. }),
  3551. smalltalk.Package.klass);
  3552. smalltalk.addMethod(
  3553. "_defaultCommitPathJs_",
  3554. smalltalk.method({
  3555. selector: "defaultCommitPathJs:",
  3556. category: 'commit paths',
  3557. fn: function (aString) {
  3558. var self = this;
  3559. self['@defaultCommitPathJs'] = aString;
  3560. return self;
  3561. },
  3562. args: ["aString"],
  3563. source: "defaultCommitPathJs: aString\x0a\x09defaultCommitPathJs := aString",
  3564. messageSends: [],
  3565. referencedClasses: []
  3566. }),
  3567. smalltalk.Package.klass);
  3568. smalltalk.addMethod(
  3569. "_defaultCommitPathSt",
  3570. smalltalk.method({
  3571. selector: "defaultCommitPathSt",
  3572. category: 'commit paths',
  3573. fn: function () {
  3574. var self = this;
  3575. return ($receiver = self['@defaultCommitPathSt']) == nil ||
  3576. $receiver == undefined ? function () {return self['@defaultCommitPathSt'] = "st";}() : $receiver;
  3577. return self;
  3578. },
  3579. args: [],
  3580. source: "defaultCommitPathSt\x0a\x09^ defaultCommitPathSt ifNil: [ defaultCommitPathSt := 'st']",
  3581. messageSends: ["ifNil:"],
  3582. referencedClasses: []
  3583. }),
  3584. smalltalk.Package.klass);
  3585. smalltalk.addMethod(
  3586. "_defaultCommitPathSt_",
  3587. smalltalk.method({
  3588. selector: "defaultCommitPathSt:",
  3589. category: 'commit paths',
  3590. fn: function (aString) {
  3591. var self = this;
  3592. self['@defaultCommitPathSt'] = aString;
  3593. return self;
  3594. },
  3595. args: ["aString"],
  3596. source: "defaultCommitPathSt: aString\x0a\x09defaultCommitPathSt := aString",
  3597. messageSends: [],
  3598. referencedClasses: []
  3599. }),
  3600. smalltalk.Package.klass);
  3601. smalltalk.addMethod(
  3602. "_fetch_",
  3603. smalltalk.method({
  3604. selector: "fetch:",
  3605. category: 'loading-storing',
  3606. fn: function (aPackageName) {
  3607. var self = this;
  3608. smalltalk.send(self, "_fetch_prefix_", [aPackageName, smalltalk.send(smalltalk.send(self, "_defaultCommitPathJs", []), "__comma", [unescape("/")])]);
  3609. return self;
  3610. },
  3611. args: ["aPackageName"],
  3612. source: "fetch: aPackageName\x0a\x09self fetch: aPackageName prefix: self defaultCommitPathJs, '/'",
  3613. messageSends: ["fetch:prefix:", ",", "defaultCommitPathJs"],
  3614. referencedClasses: []
  3615. }),
  3616. smalltalk.Package.klass);
  3617. smalltalk.addMethod(
  3618. "_fetch_prefix_",
  3619. smalltalk.method({
  3620. selector: "fetch:prefix:",
  3621. category: 'loading-storing',
  3622. fn: function (aPackageName, aPrefix) {
  3623. var self = this;
  3624. smalltalk.send(typeof jQuery == "undefined" ? nil : jQuery, "_getScript_onSuccess_", [smalltalk.send(smalltalk.send(aPrefix, "__comma", [aPackageName]), "__comma", [".js"]), function () {return smalltalk.send(smalltalk.Package || Package, "_init_", [aPackageName]);}]);
  3625. return self;
  3626. },
  3627. args: ["aPackageName", "aPrefix"],
  3628. source: "fetch: aPackageName prefix: aPrefix\x0a\x09jQuery getScript: (aPrefix , aPackageName , '.js') onSuccess: [ Package init: aPackageName ]",
  3629. messageSends: ["getScript:onSuccess:", ",", "init:"],
  3630. referencedClasses: ["Package"]
  3631. }),
  3632. smalltalk.Package.klass);
  3633. smalltalk.addMethod(
  3634. "_init_",
  3635. smalltalk.method({
  3636. selector: "init:",
  3637. category: 'loading-storing',
  3638. fn: function (aPackageName) {
  3639. var self = this;
  3640. (function ($rec) {smalltalk.send($rec, "_do_", [function (each) {return smalltalk.init(each);}]);return smalltalk.send($rec, "_do_", [function (each) {return smalltalk.send(each, "_initialize", []);}]);}(smalltalk.send(smalltalk.send(typeof smalltalk == "undefined" ? nil : smalltalk, "_classes", []), "_select_", [function (each) {return each.pkg.pkgName == aPackageName;}])));
  3641. return self;
  3642. },
  3643. args: ["aPackageName"],
  3644. source: "init: aPackageName\x0a\x09(smalltalk classes select: [ :each | <each.pkg.pkgName == aPackageName> ])\x0a\x09\x09do: [ :each | <smalltalk.init(each)> ];\x0a\x09\x09do: [ :each | each initialize ]",
  3645. messageSends: ["do:", "initialize", "select:", "classes"],
  3646. referencedClasses: []
  3647. }),
  3648. smalltalk.Package.klass);
  3649. smalltalk.addMethod(
  3650. "_named_",
  3651. smalltalk.method({
  3652. selector: "named:",
  3653. category: 'not yet classified',
  3654. fn: function (aPackageName) {
  3655. var self = this;
  3656. return smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_packageAt_", [aPackageName]);
  3657. return self;
  3658. },
  3659. args: ["aPackageName"],
  3660. source: "named: aPackageName\x0a\x0a\x09^Smalltalk current packageAt: aPackageName",
  3661. messageSends: ["packageAt:", "current"],
  3662. referencedClasses: ["Smalltalk"]
  3663. }),
  3664. smalltalk.Package.klass);
  3665. smalltalk.addMethod(
  3666. "_named_ifAbsent_",
  3667. smalltalk.method({
  3668. selector: "named:ifAbsent:",
  3669. category: 'not yet classified',
  3670. fn: function (aPackageName, aBlock) {
  3671. var self = this;
  3672. return smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_packageAt_ifAbsent_", [aPackageName, aBlock]);
  3673. return self;
  3674. },
  3675. args: ["aPackageName", "aBlock"],
  3676. source: "named: aPackageName ifAbsent: aBlock\x0a\x0a\x09^Smalltalk current packageAt: aPackageName ifAbsent: aBlock",
  3677. messageSends: ["packageAt:ifAbsent:", "current"],
  3678. referencedClasses: ["Smalltalk"]
  3679. }),
  3680. smalltalk.Package.klass);
  3681. smalltalk.addMethod(
  3682. "_resetCommitPaths",
  3683. smalltalk.method({
  3684. selector: "resetCommitPaths",
  3685. category: 'commit paths',
  3686. fn: function () {
  3687. var self = this;
  3688. self['@defaultCommitPathJs'] = nil;
  3689. self['@defaultCommitPathSt'] = nil;
  3690. return self;
  3691. },
  3692. args: [],
  3693. source: "resetCommitPaths\x0a defaultCommitPathJs := nil.\x0a defaultCommitPathSt := nil.",
  3694. messageSends: [],
  3695. referencedClasses: []
  3696. }),
  3697. smalltalk.Package.klass);
  3698. smalltalk.addMethod(
  3699. "_sortedClasses_",
  3700. smalltalk.method({
  3701. selector: "sortedClasses:",
  3702. category: 'sorting',
  3703. fn: function (classes) {
  3704. var self=this;
  3705. var children=nil;
  3706. var others=nil;
  3707. var nodes=nil;
  3708. var expandedClasses=nil;
  3709. (children=[]);
  3710. (others=[]);
  3711. smalltalk.send(classes, "_do_", [(function(each){return ((($receiver = smalltalk.send(classes, "_includes_", [smalltalk.send(each, "_superclass", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(children, "_add_", [each]);})() : (function(){return smalltalk.send(others, "_add_", [each]);})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return smalltalk.send(children, "_add_", [each]);}), (function(){return smalltalk.send(others, "_add_", [each]);})]));})]);
  3712. (nodes=smalltalk.send(children, "_collect_", [(function(each){return smalltalk.send((smalltalk.ClassSorterNode || ClassSorterNode), "_on_classes_level_", [each, others, (0)]);})]));
  3713. (nodes=smalltalk.send(nodes, "_sorted_", [(function(a, b){return ((($receiver = smalltalk.send(smalltalk.send(a, "_theClass", []), "_name", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(smalltalk.send(b, "_theClass", []), "_name", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(smalltalk.send(b, "_theClass", []), "_name", [])]));})]));
  3714. (expandedClasses=smalltalk.send((smalltalk.Array || Array), "_new", []));
  3715. smalltalk.send(nodes, "_do_", [(function(aNode){return smalltalk.send(aNode, "_traverseClassesWith_", [expandedClasses]);})]);
  3716. return expandedClasses;
  3717. return self;},
  3718. args: ["classes"],
  3719. source: "sortedClasses: classes\x0a\x09\x22Answer classes, sorted by superclass/subclasses and by class name for common subclasses (Issue #143)\x22\x0a\x0a\x09| children others nodes expandedClasses |\x0a\x09children := #().\x0a\x09others := #().\x0a\x09classes do: [:each |\x0a\x09\x09(classes includes: each superclass)\x0a\x09\x09\x09ifFalse: [children add: each]\x0a\x09\x09\x09ifTrue: [others add: each]].\x0a\x09nodes := children collect: [:each |\x0a\x09\x09ClassSorterNode on: each classes: others level: 0].\x0a\x09nodes := nodes sorted: [:a :b | a theClass name <= b theClass name ].\x0a\x09expandedClasses := Array new.\x0a\x09nodes do: [:aNode |\x0a\x09\x09aNode traverseClassesWith: expandedClasses].\x0a\x09^expandedClasses",
  3720. messageSends: ["do:", "ifFalse:ifTrue:", "includes:", "superclass", "add:", "collect:", "on:classes:level:", "sorted:", "<=", "name", "theClass", "new", "traverseClassesWith:"],
  3721. referencedClasses: ["ClassSorterNode", "Array"]
  3722. }),
  3723. smalltalk.Package.klass);
  3724. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel-Objects');
  3725. smalltalk.Point.comment="A `Point` represents an x-y pair of numbers usually designating a geometric coordinate.\x0aPoints are traditionally created using the binary `#@` message to a number:\x0a\x0a\x09100@120\x0a\x0aPoints can then be arithmetically manipulated:\x0a\x0a\x09100@100 + (10@10)\x0a\x0a...or for example:\x0a\x0a\x09(100@100) * 2\x0a\x0a**NOTE:** Creating a Point with a negative y-value will need a space after `@` in order to avoid a parsing error:\x0a\x0a\x09100@ -100 \x22but 100@-100 would not parse\x22\x0a\x0aAmber does not have much behavior in this class out-of-the-box."
  3726. smalltalk.addMethod(
  3727. "__star",
  3728. smalltalk.method({
  3729. selector: "*",
  3730. category: 'arithmetic',
  3731. fn: function (aPoint) {
  3732. var self = this;
  3733. return smalltalk.send(smalltalk.Point || Point, "_x_y_", [($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number ? $receiver * smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), ($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number ? $receiver * smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  3734. return self;
  3735. },
  3736. args: ["aPoint"],
  3737. source: "* aPoint\x0a\x09^Point x: self x * aPoint asPoint x y: self y * aPoint asPoint y",
  3738. messageSends: ["x:y:", "*", "x", "asPoint", "y"],
  3739. referencedClasses: ["Point"]
  3740. }),
  3741. smalltalk.Point);
  3742. smalltalk.addMethod(
  3743. "__plus",
  3744. smalltalk.method({
  3745. selector: "+",
  3746. category: 'arithmetic',
  3747. fn: function (aPoint) {
  3748. var self = this;
  3749. return smalltalk.send(smalltalk.Point || Point, "_x_y_", [($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number ? $receiver + smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), ($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number ? $receiver + smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  3750. return self;
  3751. },
  3752. args: ["aPoint"],
  3753. source: "+ aPoint\x0a\x09^Point x: self x + aPoint asPoint x y: self y + aPoint asPoint y",
  3754. messageSends: ["x:y:", "+", "x", "asPoint", "y"],
  3755. referencedClasses: ["Point"]
  3756. }),
  3757. smalltalk.Point);
  3758. smalltalk.addMethod(
  3759. "__minus",
  3760. smalltalk.method({
  3761. selector: "-",
  3762. category: 'arithmetic',
  3763. fn: function (aPoint) {
  3764. var self = this;
  3765. return smalltalk.send(smalltalk.Point || Point, "_x_y_", [($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number ? $receiver - smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), ($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number ? $receiver - smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  3766. return self;
  3767. },
  3768. args: ["aPoint"],
  3769. source: "- aPoint\x0a\x09^Point x: self x - aPoint asPoint x y: self y - aPoint asPoint y",
  3770. messageSends: ["x:y:", "-", "x", "asPoint", "y"],
  3771. referencedClasses: ["Point"]
  3772. }),
  3773. smalltalk.Point);
  3774. smalltalk.addMethod(
  3775. "__slash",
  3776. smalltalk.method({
  3777. selector: "/",
  3778. category: 'arithmetic',
  3779. fn: function (aPoint) {
  3780. var self = this;
  3781. return smalltalk.send(smalltalk.Point || Point, "_x_y_", [($receiver = smalltalk.send(self, "_x", [])).klass === smalltalk.Number ? $receiver / smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", []) : smalltalk.send($receiver, "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), ($receiver = smalltalk.send(self, "_y", [])).klass === smalltalk.Number ? $receiver / smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", []) : smalltalk.send($receiver, "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  3782. return self;
  3783. },
  3784. args: ["aPoint"],
  3785. source: "/ aPoint\x0a\x09^Point x: self x / aPoint asPoint x y: self y / aPoint asPoint y",
  3786. messageSends: ["x:y:", "/", "x", "asPoint", "y"],
  3787. referencedClasses: ["Point"]
  3788. }),
  3789. smalltalk.Point);
  3790. smalltalk.addMethod(
  3791. "__eq",
  3792. smalltalk.method({
  3793. selector: "=",
  3794. category: 'arithmetic',
  3795. fn: function (aPoint) {
  3796. var self = this;
  3797. return smalltalk.send(smalltalk.send(smalltalk.send(aPoint, "_class", []), "__eq", [smalltalk.send(self, "_class", [])]), "_and_", [function () {return smalltalk.send(smalltalk.send(smalltalk.send(aPoint, "_x", []), "__eq", [smalltalk.send(self, "_x", [])]), "_&", [smalltalk.send(smalltalk.send(aPoint, "_y", []), "__eq", [smalltalk.send(self, "_y", [])])]);}]);
  3798. return self;
  3799. },
  3800. args: ["aPoint"],
  3801. source: "= aPoint\x0a\x09^aPoint class = self class and: [\x0a\x09\x09(aPoint x = self x) & (aPoint y = self y)]",
  3802. messageSends: ["and:", "=", "class", "&", "x", "y"],
  3803. referencedClasses: []
  3804. }),
  3805. smalltalk.Point);
  3806. smalltalk.addMethod(
  3807. "_asPoint",
  3808. smalltalk.method({
  3809. selector: "asPoint",
  3810. category: 'converting',
  3811. fn: function () {
  3812. var self = this;
  3813. return self;
  3814. return self;
  3815. },
  3816. args: [],
  3817. source: "asPoint\x0a\x09^self",
  3818. messageSends: [],
  3819. referencedClasses: []
  3820. }),
  3821. smalltalk.Point);
  3822. smalltalk.addMethod(
  3823. "_printString",
  3824. smalltalk.method({
  3825. selector: "printString",
  3826. category: 'printing',
  3827. fn: function () {
  3828. var self = this;
  3829. return smalltalk.send(smalltalk.String || String, "_streamContents_", [function (stream) {smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(smalltalk.send(self['@x'], "_printString", []), "__comma", [unescape("@")])]);($receiver = smalltalk.send(smalltalk.send(self['@y'], "_notNil", []), "_and_", [function () {return smalltalk.send(self['@y'], "_negative", []);}])).klass === smalltalk.Boolean ? $receiver ? function () {return smalltalk.send(stream, "_space", []);}() : nil : smalltalk.send($receiver, "_ifTrue_", [function () {return smalltalk.send(stream, "_space", []);}]);return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(self['@y'], "_printString", [])]);}]);
  3830. return self;
  3831. },
  3832. args: [],
  3833. source: "printString\x0a\x09\x22Print receiver in classic x@y notation.\x22\x0a\x0a\x09^String streamContents: [:stream |\x0a\x09\x09stream nextPutAll: x printString, '@'.\x0a\x09\x09(y notNil and: [y negative])\x0a\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x22Avoid ambiguous @- construct\x22\x0a\x09\x09\x09\x09stream space].\x0a\x09\x09stream nextPutAll: y printString]",
  3834. messageSends: ["streamContents:", "nextPutAll:", ",", "printString", "ifTrue:", "and:", "notNil", "negative", "space"],
  3835. referencedClasses: ["String"]
  3836. }),
  3837. smalltalk.Point);
  3838. smalltalk.addMethod(
  3839. "_translateBy_",
  3840. smalltalk.method({
  3841. selector: "translateBy:",
  3842. category: 'transforming',
  3843. fn: function (delta) {
  3844. var self=this;
  3845. return smalltalk.send(((($receiver = smalltalk.send(delta, "_x", [])).klass === smalltalk.Number) ? $receiver +self['@x'] : smalltalk.send($receiver, "__plus", [self['@x']])), "__at", [((($receiver = smalltalk.send(delta, "_y", [])).klass === smalltalk.Number) ? $receiver +self['@y'] : smalltalk.send($receiver, "__plus", [self['@y']]))]);
  3846. return self;},
  3847. args: ["delta"],
  3848. source: "translateBy: delta \x0a\x09\x22Answer a Point translated by delta (an instance of Point).\x22\x0a\x09^(delta x + x) @ (delta y + y)",
  3849. messageSends: ["@", "+", "x", "y"],
  3850. referencedClasses: []
  3851. }),
  3852. smalltalk.Point);
  3853. smalltalk.addMethod(
  3854. "_x",
  3855. smalltalk.method({
  3856. selector: "x",
  3857. category: 'accessing',
  3858. fn: function () {
  3859. var self = this;
  3860. return self['@x'];
  3861. return self;
  3862. },
  3863. args: [],
  3864. source: "x\x0a\x09^x",
  3865. messageSends: [],
  3866. referencedClasses: []
  3867. }),
  3868. smalltalk.Point);
  3869. smalltalk.addMethod(
  3870. "_x_",
  3871. smalltalk.method({
  3872. selector: "x:",
  3873. category: 'accessing',
  3874. fn: function (aNumber) {
  3875. var self = this;
  3876. self['@x'] = aNumber;
  3877. return self;
  3878. },
  3879. args: ["aNumber"],
  3880. source: "x: aNumber\x0a\x09x := aNumber",
  3881. messageSends: [],
  3882. referencedClasses: []
  3883. }),
  3884. smalltalk.Point);
  3885. smalltalk.addMethod(
  3886. "_y",
  3887. smalltalk.method({
  3888. selector: "y",
  3889. category: 'accessing',
  3890. fn: function () {
  3891. var self = this;
  3892. return self['@y'];
  3893. return self;
  3894. },
  3895. args: [],
  3896. source: "y\x0a\x09^y",
  3897. messageSends: [],
  3898. referencedClasses: []
  3899. }),
  3900. smalltalk.Point);
  3901. smalltalk.addMethod(
  3902. "_y_",
  3903. smalltalk.method({
  3904. selector: "y:",
  3905. category: 'accessing',
  3906. fn: function (aNumber) {
  3907. var self = this;
  3908. self['@y'] = aNumber;
  3909. return self;
  3910. },
  3911. args: ["aNumber"],
  3912. source: "y: aNumber\x0a\x09y := aNumber",
  3913. messageSends: [],
  3914. referencedClasses: []
  3915. }),
  3916. smalltalk.Point);
  3917. smalltalk.addMethod(
  3918. "_x_y_",
  3919. smalltalk.method({
  3920. selector: "x:y:",
  3921. category: 'instance creation',
  3922. fn: function (aNumber, anotherNumber) {
  3923. var self = this;
  3924. return function ($rec) {smalltalk.send($rec, "_x_", [aNumber]);smalltalk.send($rec, "_y_", [anotherNumber]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_new", []));
  3925. return self;
  3926. },
  3927. args: ["aNumber", "anotherNumber"],
  3928. source: "x: aNumber y: anotherNumber\x0a\x09^self new\x0a\x09\x09x: aNumber;\x0a\x09\x09y: anotherNumber;\x0a\x09\x09yourself",
  3929. messageSends: ["x:", "y:", "yourself", "new"],
  3930. referencedClasses: []
  3931. }),
  3932. smalltalk.Point.klass);
  3933. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel-Objects');
  3934. smalltalk.Random.comment="`Random` is a random number generator and is implemented as a trivial wrapper around javascript `Math.random()` and is used like this:\x0a\x0a\x09Random new next\x0a\x0aThis will return a float x where x < 1 and x > 0. If you want a random integer from 1 to 10 you can use `#atRandom`\x0a\x0a\x0910 atRandom\x0a\x0a...and if you want a random number in a specific interval this also works:\x0a\x0a\x09(3 to: 7) atRandom\x0a\x0a...but be aware that `#to:` does not create an Interval as in other Smalltalk implementations but in fact an `Array` of numbers, so it's better to use:\x0a\x0a\x095 atRandom + 2\x0a\x0aSince `#atRandom` is implemented in `SequencableCollection` you can easy pick an element at random:\x0a\x0a\x09#('a' 'b' 'c') atRandom\x0a\x0a...or perhaps a letter from a `String`:\x0a\x0a\x09'abc' atRandom\x0a\x0aSince Amber does not have Characters this will return a `String` of length 1 like for example `'b'`."
  3935. smalltalk.addMethod(
  3936. "_next",
  3937. smalltalk.method({
  3938. selector: "next",
  3939. category: 'accessing',
  3940. fn: function () {
  3941. var self = this;
  3942. return Math.random();
  3943. return self;
  3944. },
  3945. args: [],
  3946. source: "next\x0a\x09<return Math.random()>",
  3947. messageSends: [],
  3948. referencedClasses: []
  3949. }),
  3950. smalltalk.Random);
  3951. smalltalk.addMethod(
  3952. "_next_",
  3953. smalltalk.method({
  3954. selector: "next:",
  3955. category: 'accessing',
  3956. fn: function (anInteger) {
  3957. var self = this;
  3958. return smalltalk.send(smalltalk.send(1, "_to_", [anInteger]), "_collect_", [function (each) {return smalltalk.send(self, "_next", []);}]);
  3959. return self;
  3960. },
  3961. args: ["anInteger"],
  3962. source: "next: anInteger\x0a ^(1 to: anInteger) collect: [:each | self next]",
  3963. messageSends: ["collect:", "to:", "next"],
  3964. referencedClasses: []
  3965. }),
  3966. smalltalk.Random);
  3967. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel-Objects');
  3968. smalltalk.Smalltalk.comment="Smalltalk has only one instance, accessed with `Smalltalk current`. \x0aIt represents the global JavaScript variable `smalltalk` declared in `js/boot.js`.\x0a\x0aThe `smalltalk` object holds all class and packages defined in the system.\x0a\x0a## Classes\x0a\x0aClasses can be accessed using the following methods:\x0a\x0a- `#classes` answers the full list of Smalltalk classes in the system\x0a- `#at:` answers a specific class of `nil`\x0a\x0a## Packages\x0a\x0aPackages can be accessed using the following methods:\x0a\x0a- `#packages` answers the full list of packages\x0a- `#packageAt:` answers a specific class of `nil`\x0a\x0a__note:__ classes and packages are accessed using strings, not symbols\x0a\x0a## Parsing\x0a\x0aThe `#parse:` method is used to parse Smalltalk source code. \x0aIt requires the `Compiler` package and the `js/parser.js` parser file in order to work"
  3969. smalltalk.addMethod(
  3970. "_at_",
  3971. smalltalk.method({
  3972. selector: "at:",
  3973. category: 'accessing',
  3974. fn: function (aString) {
  3975. var self = this;
  3976. return self[aString];
  3977. return self;
  3978. },
  3979. args: ["aString"],
  3980. source: "at: aString\x0a\x09<return self[aString]>",
  3981. messageSends: [],
  3982. referencedClasses: []
  3983. }),
  3984. smalltalk.Smalltalk);
  3985. smalltalk.addMethod(
  3986. "_basicParse_",
  3987. smalltalk.method({
  3988. selector: "basicParse:",
  3989. category: 'accessing',
  3990. fn: function (aString) {
  3991. var self = this;
  3992. return smalltalk.parser.parse(aString);
  3993. return self;
  3994. },
  3995. args: ["aString"],
  3996. source: "basicParse: aString\x0a\x09<return smalltalk.parser.parse(aString)>",
  3997. messageSends: [],
  3998. referencedClasses: []
  3999. }),
  4000. smalltalk.Smalltalk);
  4001. smalltalk.addMethod(
  4002. "_classes",
  4003. smalltalk.method({
  4004. selector: "classes",
  4005. category: 'accessing',
  4006. fn: function () {
  4007. var self = this;
  4008. return self.classes();
  4009. return self;
  4010. },
  4011. args: [],
  4012. source: "classes\x0a\x09<return self.classes()>",
  4013. messageSends: [],
  4014. referencedClasses: []
  4015. }),
  4016. smalltalk.Smalltalk);
  4017. smalltalk.addMethod(
  4018. "_createPackage_",
  4019. smalltalk.method({
  4020. selector: "createPackage:",
  4021. category: 'private',
  4022. fn: function (packageName) {
  4023. var self = this;
  4024. return smalltalk.addPackage(packageName, nil);
  4025. return self;
  4026. },
  4027. args: ["packageName"],
  4028. source: "createPackage: packageName\x0a\x09\x22Create and bind a new package with given name and return it.\x22\x0a\x0a <return smalltalk.addPackage(packageName, nil)>",
  4029. messageSends: [],
  4030. referencedClasses: []
  4031. }),
  4032. smalltalk.Smalltalk);
  4033. smalltalk.addMethod(
  4034. "_createPackage_properties_",
  4035. smalltalk.method({
  4036. selector: "createPackage:properties:",
  4037. category: 'private',
  4038. fn: function (packageName, aDict) {
  4039. var self = this;
  4040. var object = nil;
  4041. object = {};
  4042. smalltalk.send(aDict, "_keysAndValuesDo_", [function (key, value) {return object[key] = value;}]);
  4043. return smalltalk.addPackage(packageName, object);
  4044. return self;
  4045. },
  4046. args: ["packageName", "aDict"],
  4047. source: "createPackage: packageName properties: aDict\x0a\x09\x22Create and bind a new package with given name and return it.\x22\x0a\x0a\x09| object |\x0a\x09<object = {};>.\x0a\x09aDict keysAndValuesDo: [:key :value |\x0a\x09\x09<object[key] = value>.\x0a\x09].\x0a <return smalltalk.addPackage(packageName, object)>",
  4048. messageSends: ["keysAndValuesDo:"],
  4049. referencedClasses: []
  4050. }),
  4051. smalltalk.Smalltalk);
  4052. smalltalk.addMethod(
  4053. "_deletePackage_",
  4054. smalltalk.method({
  4055. selector: "deletePackage:",
  4056. category: 'private',
  4057. fn: function (packageName) {
  4058. var self = this;
  4059. delete smalltalk.packages[packageName];
  4060. return self;
  4061. },
  4062. args: ["packageName"],
  4063. source: "deletePackage: packageName\x0a\x09\x22Deletes a package by deleting its binding, but does not check if it contains classes etc.\x0a\x09To remove a package, use #removePackage instead.\x22\x0a\x0a <delete smalltalk.packages[packageName]>",
  4064. messageSends: [],
  4065. referencedClasses: []
  4066. }),
  4067. smalltalk.Smalltalk);
  4068. smalltalk.addMethod(
  4069. "_packageAt_",
  4070. smalltalk.method({
  4071. selector: "packageAt:",
  4072. category: 'packages',
  4073. fn: function (packageName) {
  4074. var self = this;
  4075. return self.packages[packageName];
  4076. return self;
  4077. },
  4078. args: ["packageName"],
  4079. source: "packageAt: packageName\x0a <return self.packages[packageName]>",
  4080. messageSends: [],
  4081. referencedClasses: []
  4082. }),
  4083. smalltalk.Smalltalk);
  4084. smalltalk.addMethod(
  4085. "_packageAt_ifAbsent_",
  4086. smalltalk.method({
  4087. selector: "packageAt:ifAbsent:",
  4088. category: 'packages',
  4089. fn: function (packageName, aBlock) {
  4090. var self = this;
  4091. return smalltalk.send(smalltalk.send(self, "_packageAt_", [packageName]), "_ifNil_", [aBlock]);
  4092. return self;
  4093. },
  4094. args: ["packageName", "aBlock"],
  4095. source: "packageAt: packageName ifAbsent: aBlock\x0a ^(self packageAt: packageName) ifNil: aBlock",
  4096. messageSends: ["ifNil:", "packageAt:"],
  4097. referencedClasses: []
  4098. }),
  4099. smalltalk.Smalltalk);
  4100. smalltalk.addMethod(
  4101. "_packages",
  4102. smalltalk.method({
  4103. selector: "packages",
  4104. category: 'packages',
  4105. fn: function () {
  4106. var self = this;
  4107. return self.packages.all();
  4108. return self;
  4109. },
  4110. args: [],
  4111. source: "packages\x0a\x09\x22Return all Package instances in the system.\x22\x0a\x0a\x09<return self.packages.all()>",
  4112. messageSends: [],
  4113. referencedClasses: []
  4114. }),
  4115. smalltalk.Smalltalk);
  4116. smalltalk.addMethod(
  4117. "_parse_",
  4118. smalltalk.method({
  4119. selector: "parse:",
  4120. category: 'accessing',
  4121. fn: function (aString) {
  4122. var self = this;
  4123. var result = nil;
  4124. smalltalk.send(self, "_try_catch_", [function () {return result = smalltalk.send(self, "_basicParse_", [aString]);}, function (ex) {return smalltalk.send(smalltalk.send(self, "_parseError_parsing_", [ex, aString]), "_signal", []);}]);
  4125. return result;
  4126. return self;
  4127. },
  4128. args: ["aString"],
  4129. source: "parse: aString\x0a\x09| result | \x0a\x09self try: [result := self basicParse: aString] catch: [:ex | (self parseError: ex parsing: aString) signal].\x0a\x09^result",
  4130. messageSends: ["try:catch:", "basicParse:", "signal", "parseError:parsing:"],
  4131. referencedClasses: []
  4132. }),
  4133. smalltalk.Smalltalk);
  4134. smalltalk.addMethod(
  4135. "_parseError_parsing_",
  4136. smalltalk.method({
  4137. selector: "parseError:parsing:",
  4138. category: 'accessing',
  4139. fn: function (anException, aString) {
  4140. var self = this;
  4141. var row = nil;
  4142. var col = nil;
  4143. var message = nil;
  4144. var lines = nil;
  4145. var badLine = nil;
  4146. var code = nil;
  4147. row = anException.line;
  4148. col = anException.column;
  4149. message = anException.message;
  4150. lines = smalltalk.send(aString, "_lines", []);
  4151. badLine = smalltalk.send(lines, "_at_", [row]);
  4152. badLine = smalltalk.send(smalltalk.send(smalltalk.send(badLine, "_copyFrom_to_", [1, ($receiver = col).klass === smalltalk.Number ? $receiver - 1 : smalltalk.send($receiver, "__minus", [1])]), "__comma", [unescape("%20%3D%3D%3D%3E")]), "__comma", [smalltalk.send(badLine, "_copyFrom_to_", [col, smalltalk.send(badLine, "_size", [])])]);
  4153. smalltalk.send(lines, "_at_put_", [row, badLine]);
  4154. code = smalltalk.send(smalltalk.String || String, "_streamContents_", [function (s) {return smalltalk.send(lines, "_withIndexDo_", [function (l, i) {return smalltalk.send(s, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(i, "_asString", []), "__comma", [": "]), "__comma", [l]), "__comma", [smalltalk.send(smalltalk.String || String, "_lf", [])])]);}]);}]);
  4155. return smalltalk.send(smalltalk.send(smalltalk.Error || Error, "_new", []), "_messageText_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("Parse error on line ", "__comma", [row]), "__comma", [" column "]), "__comma", [col]), "__comma", [" : "]), "__comma", [message]), "__comma", [unescape("%20Below%20is%20code%20with%20line%20numbers%20and%20%3D%3D%3D%3E%20marker%20inserted%3A")]), "__comma", [smalltalk.send(smalltalk.String || String, "_lf", [])]), "__comma", [code])]);
  4156. return self;
  4157. },
  4158. args: ["anException", "aString"],
  4159. source: "parseError: anException parsing: aString\x0a\x09| row col message lines badLine code |\x0a\x09<row = anException.line;\x0a\x09col = anException.column;\x0a\x09message = anException.message;>.\x0a\x09lines := aString lines.\x0a\x09badLine := lines at: row.\x0a\x09badLine := (badLine copyFrom: 1 to: col - 1), ' ===>', (badLine copyFrom: col to: badLine size).\x0a\x09lines at: row put: badLine.\x0a\x09code := String streamContents: [:s |\x0a lines withIndexDo: [:l :i |\x0a s nextPutAll: i asString, ': ', l, String lf]].\x0a\x09^ Error new messageText: ('Parse error on line ' , row , ' column ' , col , ' : ' , message , ' Below is code with line numbers and ===> marker inserted:' , String lf, code)",
  4160. messageSends: ["lines", "at:", ",", "copyFrom:to:", "-", "size", "at:put:", "streamContents:", "withIndexDo:", "nextPutAll:", "asString", "lf", "messageText:", "new"],
  4161. referencedClasses: ["String", "Error"]
  4162. }),
  4163. smalltalk.Smalltalk);
  4164. smalltalk.addMethod(
  4165. "_readJSObject_",
  4166. smalltalk.method({
  4167. selector: "readJSObject:",
  4168. category: 'accessing',
  4169. fn: function (anObject) {
  4170. var self = this;
  4171. return self.readJSObject(anObject);
  4172. return self;
  4173. },
  4174. args: ["anObject"],
  4175. source: "readJSObject: anObject\x0a\x09<return self.readJSObject(anObject)>",
  4176. messageSends: [],
  4177. referencedClasses: []
  4178. }),
  4179. smalltalk.Smalltalk);
  4180. smalltalk.addMethod(
  4181. "_removeClass_",
  4182. smalltalk.method({
  4183. selector: "removeClass:",
  4184. category: 'classes',
  4185. fn: function (aClass) {
  4186. var self = this;
  4187. ($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean ? $receiver ? function () {return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_asString", []), "__comma", [unescape("%20is%20a%20Metaclass%20and%20cannot%20be%20removed%21")])]);}() : nil : smalltalk.send($receiver, "_ifTrue_", [function () {return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_asString", []), "__comma", [unescape("%20is%20a%20Metaclass%20and%20cannot%20be%20removed%21")])]);}]);
  4188. smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_do_", [function (each) {return smalltalk.send(aClass, "_removeCompiledMethod_", [each]);}]);
  4189. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_methodDictionary", []), "_values", []), "_do_", [function (each) {return smalltalk.send(smalltalk.send(aClass, "_class", []), "_removeCompiledMethod_", [each]);}]);
  4190. smalltalk.send(self, "_basicDelete_", [smalltalk.send(aClass, "_name", [])]);
  4191. return self;
  4192. },
  4193. args: ["aClass"],
  4194. source: "removeClass: aClass\x0a\x09aClass isMetaclass ifTrue: [self error: aClass asString, ' is a Metaclass and cannot be removed!'].\x0a\x09aClass methodDictionary values do: [:each |\x0a\x09\x09aClass removeCompiledMethod: each].\x0a\x09aClass class methodDictionary values do: [:each |\x0a\x09\x09aClass class removeCompiledMethod: each].\x0a\x09self basicDelete: aClass name",
  4195. messageSends: ["ifTrue:", "isMetaclass", "error:", ",", "asString", "do:", "values", "methodDictionary", "removeCompiledMethod:", "class", "basicDelete:", "name"],
  4196. referencedClasses: []
  4197. }),
  4198. smalltalk.Smalltalk);
  4199. smalltalk.addMethod(
  4200. "_removePackage_",
  4201. smalltalk.method({
  4202. selector: "removePackage:",
  4203. category: 'packages',
  4204. fn: function (packageName) {
  4205. var self = this;
  4206. var pkg = nil;
  4207. pkg = smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, function () {return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);}]);
  4208. smalltalk.send(smalltalk.send(pkg, "_classes", []), "_do_", [function (each) {return smalltalk.send(self, "_removeClass_", [each]);}]);
  4209. smalltalk.send(self, "_deletePackage_", [packageName]);
  4210. return self;
  4211. },
  4212. args: ["packageName"],
  4213. source: "removePackage: packageName\x0a\x09\x22Removes a package and all its classes.\x22\x0a\x0a\x09| pkg |\x0a\x09pkg := self packageAt: packageName ifAbsent: [self error: 'Missing package: ', packageName].\x0a\x09pkg classes do: [:each |\x0a \x09self removeClass: each].\x0a\x09self deletePackage: packageName",
  4214. messageSends: ["packageAt:ifAbsent:", "error:", ",", "do:", "classes", "removeClass:", "deletePackage:"],
  4215. referencedClasses: []
  4216. }),
  4217. smalltalk.Smalltalk);
  4218. smalltalk.addMethod(
  4219. "_renamePackage_to_",
  4220. smalltalk.method({
  4221. selector: "renamePackage:to:",
  4222. category: 'packages',
  4223. fn: function (packageName, newName) {
  4224. var self = this;
  4225. var pkg = nil;
  4226. pkg = smalltalk.send(self, "_packageAt_ifAbsent_", [packageName, function () {return smalltalk.send(self, "_error_", [smalltalk.send("Missing package: ", "__comma", [packageName])]);}]);
  4227. ($receiver = smalltalk.send(self, "_packageAt_", [newName])) != nil &&
  4228. $receiver != undefined ? function () {return smalltalk.send(self, "_error_", [smalltalk.send("Already exists a package called: ", "__comma", [newName])]);}() : nil;
  4229. smalltalk.packages[newName] = smalltalk.packages[packageName];
  4230. smalltalk.send(pkg, "_name_", [newName]);
  4231. smalltalk.send(self, "_deletePackage_", [packageName]);
  4232. return self;
  4233. },
  4234. args: ["packageName", "newName"],
  4235. source: "renamePackage: packageName to: newName\x0a\x09\x22Rename a package.\x22\x0a\x0a\x09| pkg |\x0a\x09pkg := self packageAt: packageName ifAbsent: [self error: 'Missing package: ', packageName].\x0a\x09(self packageAt: newName) ifNotNil: [self error: 'Already exists a package called: ', newName].\x0a\x09<smalltalk.packages[newName] = smalltalk.packages[packageName]>.\x0a\x09pkg name: newName.\x0a\x09self deletePackage: packageName.",
  4236. messageSends: ["packageAt:ifAbsent:", "error:", ",", "ifNotNil:", "packageAt:", "name:", "deletePackage:"],
  4237. referencedClasses: []
  4238. }),
  4239. smalltalk.Smalltalk);
  4240. smalltalk.addMethod(
  4241. "_reservedWords",
  4242. smalltalk.method({
  4243. selector: "reservedWords",
  4244. category: 'accessing',
  4245. fn: function () {
  4246. var self = this;
  4247. return self.reservedWords;
  4248. return self;
  4249. },
  4250. args: [],
  4251. source: "reservedWords\x0a\x09\x22JavaScript reserved words\x22\x0a\x09<return self.reservedWords>",
  4252. messageSends: [],
  4253. referencedClasses: []
  4254. }),
  4255. smalltalk.Smalltalk);
  4256. smalltalk.addMethod(
  4257. "_send_to_arguments_",
  4258. smalltalk.method({
  4259. selector: "send:to:arguments:",
  4260. category: 'accessing',
  4261. fn: function (aSelector, anObject, aCollection) {
  4262. var self = this;
  4263. var selector = nil;
  4264. selector = smalltalk.send(smalltalk.send(aSelector, "_asString", []), "_asSelector", []);
  4265. self.send(anObject, selector, aCollection);
  4266. return self;
  4267. },
  4268. args: ["aSelector", "anObject", "aCollection"],
  4269. source: "send: aSelector to: anObject arguments: aCollection\x0a\x09| selector |\x0a\x09selector := aSelector asString asSelector.\x0a\x09<self.send(anObject, selector, aCollection)>",
  4270. messageSends: ["asSelector", "asString"],
  4271. referencedClasses: []
  4272. }),
  4273. smalltalk.Smalltalk);
  4274. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  4275. smalltalk.addMethod(
  4276. "_current",
  4277. smalltalk.method({
  4278. selector: "current",
  4279. category: 'accessing',
  4280. fn: function () {
  4281. var self = this;
  4282. return smalltalk;
  4283. return self;
  4284. },
  4285. args: [],
  4286. source: "current\x0a\x09<return smalltalk>",
  4287. messageSends: [],
  4288. referencedClasses: []
  4289. }),
  4290. smalltalk.Smalltalk.klass);
  4291. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel-Objects');
  4292. smalltalk.UndefinedObject.comment="UndefinedObject describes the behavior of its sole instance, `nil`. `nil` represents a prior value for variables that have not been initialized, or for results which are meaningless.\x0a\x0a`nil` is the Smalltalk representation of the `undefined` JavaScript object."
  4293. smalltalk.addMethod(
  4294. "_asJSON",
  4295. smalltalk.method({
  4296. selector: "asJSON",
  4297. category: 'converting',
  4298. fn: function () {
  4299. var self=this;
  4300. return (typeof null == 'undefined' ? nil : null);
  4301. return self;},
  4302. args: [],
  4303. source: "asJSON\x0a\x09^null",
  4304. messageSends: [],
  4305. referencedClasses: []
  4306. }),
  4307. smalltalk.UndefinedObject);
  4308. smalltalk.addMethod(
  4309. "_deepCopy",
  4310. smalltalk.method({
  4311. selector: "deepCopy",
  4312. category: 'copying',
  4313. fn: function () {
  4314. var self = this;
  4315. return self;
  4316. return self;
  4317. },
  4318. args: [],
  4319. source: "deepCopy\x0a\x09^self",
  4320. messageSends: [],
  4321. referencedClasses: []
  4322. }),
  4323. smalltalk.UndefinedObject);
  4324. smalltalk.addMethod(
  4325. "_ifNil_",
  4326. smalltalk.method({
  4327. selector: "ifNil:",
  4328. category: 'testing',
  4329. fn: function (aBlock) {
  4330. var self = this;
  4331. return smalltalk.send(self, "_ifNil_ifNotNil_", [aBlock, function () {return nil;}]);
  4332. return self;
  4333. },
  4334. args: ["aBlock"],
  4335. source: "ifNil: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^self ifNil: aBlock ifNotNil: []",
  4336. messageSends: ["ifNil:ifNotNil:"],
  4337. referencedClasses: []
  4338. }),
  4339. smalltalk.UndefinedObject);
  4340. smalltalk.addMethod(
  4341. "_ifNil_ifNotNil_",
  4342. smalltalk.method({
  4343. selector: "ifNil:ifNotNil:",
  4344. category: 'testing',
  4345. fn: function (aBlock, anotherBlock) {
  4346. var self = this;
  4347. return smalltalk.send(aBlock, "_value", []);
  4348. return self;
  4349. },
  4350. args: ["aBlock", "anotherBlock"],
  4351. source: "ifNil: aBlock ifNotNil: anotherBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^aBlock value",
  4352. messageSends: ["value"],
  4353. referencedClasses: []
  4354. }),
  4355. smalltalk.UndefinedObject);
  4356. smalltalk.addMethod(
  4357. "_ifNotNil_",
  4358. smalltalk.method({
  4359. selector: "ifNotNil:",
  4360. category: 'testing',
  4361. fn: function (aBlock) {
  4362. var self = this;
  4363. return self;
  4364. return self;
  4365. },
  4366. args: ["aBlock"],
  4367. source: "ifNotNil: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^self",
  4368. messageSends: [],
  4369. referencedClasses: []
  4370. }),
  4371. smalltalk.UndefinedObject);
  4372. smalltalk.addMethod(
  4373. "_ifNotNil_ifNil_",
  4374. smalltalk.method({
  4375. selector: "ifNotNil:ifNil:",
  4376. category: 'testing',
  4377. fn: function (aBlock, anotherBlock) {
  4378. var self = this;
  4379. return smalltalk.send(anotherBlock, "_value", []);
  4380. return self;
  4381. },
  4382. args: ["aBlock", "anotherBlock"],
  4383. source: "ifNotNil: aBlock ifNil: anotherBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09^anotherBlock value",
  4384. messageSends: ["value"],
  4385. referencedClasses: []
  4386. }),
  4387. smalltalk.UndefinedObject);
  4388. smalltalk.addMethod(
  4389. "_isNil",
  4390. smalltalk.method({
  4391. selector: "isNil",
  4392. category: 'testing',
  4393. fn: function () {
  4394. var self = this;
  4395. return true;
  4396. return self;
  4397. },
  4398. args: [],
  4399. source: "isNil\x0a\x09^true",
  4400. messageSends: [],
  4401. referencedClasses: []
  4402. }),
  4403. smalltalk.UndefinedObject);
  4404. smalltalk.addMethod(
  4405. "_notNil",
  4406. smalltalk.method({
  4407. selector: "notNil",
  4408. category: 'testing',
  4409. fn: function () {
  4410. var self = this;
  4411. return false;
  4412. return self;
  4413. },
  4414. args: [],
  4415. source: "notNil\x0a\x09^false",
  4416. messageSends: [],
  4417. referencedClasses: []
  4418. }),
  4419. smalltalk.UndefinedObject);
  4420. smalltalk.addMethod(
  4421. "_printString",
  4422. smalltalk.method({
  4423. selector: "printString",
  4424. category: 'printing',
  4425. fn: function () {
  4426. var self = this;
  4427. return "nil";
  4428. return self;
  4429. },
  4430. args: [],
  4431. source: "printString\x0a ^'nil'",
  4432. messageSends: [],
  4433. referencedClasses: []
  4434. }),
  4435. smalltalk.UndefinedObject);
  4436. smalltalk.addMethod(
  4437. "_shallowCopy",
  4438. smalltalk.method({
  4439. selector: "shallowCopy",
  4440. category: 'copying',
  4441. fn: function () {
  4442. var self = this;
  4443. return self;
  4444. return self;
  4445. },
  4446. args: [],
  4447. source: "shallowCopy\x0a\x09^self",
  4448. messageSends: [],
  4449. referencedClasses: []
  4450. }),
  4451. smalltalk.UndefinedObject);
  4452. smalltalk.addMethod(
  4453. "_subclass_instanceVariableNames_",
  4454. smalltalk.method({
  4455. selector: "subclass:instanceVariableNames:",
  4456. category: 'class creation',
  4457. fn: function (aString, anotherString) {
  4458. var self = this;
  4459. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
  4460. return self;
  4461. },
  4462. args: ["aString", "anotherString"],
  4463. source: "subclass: aString instanceVariableNames: anotherString\x0a\x09^self subclass: aString instanceVariableNames: anotherString package: nil",
  4464. messageSends: ["subclass:instanceVariableNames:package:"],
  4465. referencedClasses: []
  4466. }),
  4467. smalltalk.UndefinedObject);
  4468. smalltalk.addMethod(
  4469. "_subclass_instanceVariableNames_category_",
  4470. smalltalk.method({
  4471. selector: "subclass:instanceVariableNames:category:",
  4472. category: 'class creation',
  4473. fn: function (aString, aString2, aString3) {
  4474. var self = this;
  4475. smalltalk.send(self, "_deprecatedAPI", []);
  4476. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  4477. return self;
  4478. },
  4479. args: ["aString", "aString2", "aString3"],
  4480. source: "subclass: aString instanceVariableNames: aString2 category: aString3\x0a\x09\x22Kept for compatibility.\x22\x0a\x09self deprecatedAPI.\x0a\x09^self subclass: aString instanceVariableNames: aString2 package: aString3",
  4481. messageSends: ["deprecatedAPI", "subclass:instanceVariableNames:package:"],
  4482. referencedClasses: []
  4483. }),
  4484. smalltalk.UndefinedObject);
  4485. smalltalk.addMethod(
  4486. "_subclass_instanceVariableNames_package_",
  4487. smalltalk.method({
  4488. selector: "subclass:instanceVariableNames:package:",
  4489. category: 'class creation',
  4490. fn: function (aString, aString2, aString3) {
  4491. var self = this;
  4492. return smalltalk.send(smalltalk.send(smalltalk.ClassBuilder || ClassBuilder, "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, aString, aString2, aString3]);
  4493. return self;
  4494. },
  4495. args: ["aString", "aString2", "aString3"],
  4496. source: "subclass: aString instanceVariableNames: aString2 package: aString3\x0a\x09^ClassBuilder new\x0a\x09 superclass: self subclass: aString instanceVariableNames: aString2 package: aString3",
  4497. messageSends: ["superclass:subclass:instanceVariableNames:package:", "new"],
  4498. referencedClasses: ["ClassBuilder"]
  4499. }),
  4500. smalltalk.UndefinedObject);
  4501. smalltalk.addMethod(
  4502. "_new",
  4503. smalltalk.method({
  4504. selector: "new",
  4505. category: 'instance creation',
  4506. fn: function () {
  4507. var self = this;
  4508. smalltalk.send(self, "_error_", ["You cannot create new instances of UndefinedObject. Use nil"]);
  4509. return self;
  4510. },
  4511. args: [],
  4512. source: "new\x0a\x09 self error: 'You cannot create new instances of UndefinedObject. Use nil'",
  4513. messageSends: ["error:"],
  4514. referencedClasses: []
  4515. }),
  4516. smalltalk.UndefinedObject.klass);
  4517. smalltalk.addPackage('Kernel-Classes', {});
  4518. smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel-Classes');
  4519. smalltalk.Behavior.comment=unescape('Behavior%20is%20the%20superclass%20of%20all%20class%20objects.%20%0A%0AIt%20defines%20the%20protocol%20for%20creating%20instances%20of%20a%20class%20with%20%60%23basicNew%60%20and%20%60%23new%60%20%28see%20%60boot.js%60%20for%20class%20constructors%20details%29.%0AInstances%20know%20about%20the%20subclass/superclass%20relationships%20between%20classes%2C%20contain%20the%20description%20that%20instances%20are%20created%20from%2C%20%0Aand%20hold%20the%20method%20dictionary%20that%27s%20associated%20with%20each%20class.%0A%0ABehavior%20also%20%20provides%20methods%20for%20compiling%20methods%2C%20examining%20the%20method%20dictionary%2C%20and%20iterating%20over%20the%20class%20hierarchy.')
  4520. smalltalk.addMethod(
  4521. unescape('_addCompiledMethod_'),
  4522. smalltalk.method({
  4523. selector: unescape('addCompiledMethod%3A'),
  4524. category: 'compiling',
  4525. fn: function (aMethod) {
  4526. var self=this;
  4527. smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self);
  4528. return self;},
  4529. args: ["aMethod"],
  4530. source: unescape('addCompiledMethod%3A%20aMethod%0A%09%3Csmalltalk.addMethod%28aMethod.selector._asSelector%28%29%2C%20aMethod%2C%20self%29%3E'),
  4531. messageSends: [],
  4532. referencedClasses: []
  4533. }),
  4534. smalltalk.Behavior);
  4535. smalltalk.addMethod(
  4536. unescape('_allInstanceVariableNames'),
  4537. smalltalk.method({
  4538. selector: unescape('allInstanceVariableNames'),
  4539. category: 'accessing',
  4540. fn: function () {
  4541. var self=this;
  4542. var result=nil;
  4543. (result=smalltalk.send(smalltalk.send(self, "_instanceVariableNames", []), "_copy", []));
  4544. (($receiver = smalltalk.send(self, "_superclass", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(result, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allInstanceVariableNames", [])]);})() : nil;
  4545. return result;
  4546. return self;},
  4547. args: [],
  4548. source: unescape('allInstanceVariableNames%0A%09%7C%20result%20%7C%0A%09result%20%3A%3D%20self%20instanceVariableNames%20copy.%0A%09self%20superclass%20ifNotNil%3A%20%5B%0A%09%20%20%20%20result%20addAll%3A%20self%20superclass%20allInstanceVariableNames%5D.%0A%09%5Eresult'),
  4549. messageSends: ["copy", "instanceVariableNames", "ifNotNil:", "superclass", "addAll:", "allInstanceVariableNames"],
  4550. referencedClasses: []
  4551. }),
  4552. smalltalk.Behavior);
  4553. smalltalk.addMethod(
  4554. unescape('_allSubclasses'),
  4555. smalltalk.method({
  4556. selector: unescape('allSubclasses'),
  4557. category: 'accessing',
  4558. fn: function () {
  4559. var self=this;
  4560. var result=nil;
  4561. (result=smalltalk.send(self, "_subclasses", []));
  4562. smalltalk.send(smalltalk.send(self, "_subclasses", []), "_do_", [(function(each){return smalltalk.send(result, "_addAll_", [smalltalk.send(each, "_allSubclasses", [])]);})]);
  4563. return result;
  4564. return self;},
  4565. args: [],
  4566. source: unescape('allSubclasses%0A%09%7C%20result%20%7C%0A%09result%20%3A%3D%20self%20subclasses.%0A%09self%20subclasses%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20result%20addAll%3A%20each%20allSubclasses%5D.%0A%09%5Eresult'),
  4567. messageSends: ["subclasses", "do:", "addAll:", "allSubclasses"],
  4568. referencedClasses: []
  4569. }),
  4570. smalltalk.Behavior);
  4571. smalltalk.addMethod(
  4572. unescape('_basicNew'),
  4573. smalltalk.method({
  4574. selector: unescape('basicNew'),
  4575. category: 'instance creation',
  4576. fn: function () {
  4577. var self=this;
  4578. return new self.fn();
  4579. return self;},
  4580. args: [],
  4581. source: unescape('basicNew%0A%09%3Creturn%20new%20self.fn%28%29%3E'),
  4582. messageSends: [],
  4583. referencedClasses: []
  4584. }),
  4585. smalltalk.Behavior);
  4586. smalltalk.addMethod(
  4587. unescape('_canUnderstand_'),
  4588. smalltalk.method({
  4589. selector: unescape('canUnderstand%3A'),
  4590. category: 'testing',
  4591. fn: function (aSelector) {
  4592. var self=this;
  4593. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_keys", []), "_includes_", [smalltalk.send(aSelector, "_asString", [])]), "_or_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_superclass", []), "_notNil", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_superclass", []), "_canUnderstand_", [aSelector]);})]);})]);
  4594. return self;},
  4595. args: ["aSelector"],
  4596. source: unescape('canUnderstand%3A%20aSelector%0A%09%5E%28self%20methodDictionary%20keys%20includes%3A%20aSelector%20asString%29%20or%3A%20%5B%0A%09%09self%20superclass%20notNil%20and%3A%20%5Bself%20superclass%20canUnderstand%3A%20aSelector%5D%5D'),
  4597. messageSends: ["or:", "includes:", "keys", "methodDictionary", "asString", "and:", "notNil", "superclass", "canUnderstand:"],
  4598. referencedClasses: []
  4599. }),
  4600. smalltalk.Behavior);
  4601. smalltalk.addMethod(
  4602. unescape('_comment'),
  4603. smalltalk.method({
  4604. selector: unescape('comment'),
  4605. category: 'accessing',
  4606. fn: function () {
  4607. var self=this;
  4608. return (($receiver = smalltalk.send(self, "_basicAt_", ["comment"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  4609. return self;},
  4610. args: [],
  4611. source: unescape('comment%0A%20%20%20%20%5E%28self%20basicAt%3A%20%27comment%27%29%20ifNil%3A%20%5B%27%27%5D'),
  4612. messageSends: ["ifNil:", "basicAt:"],
  4613. referencedClasses: []
  4614. }),
  4615. smalltalk.Behavior);
  4616. smalltalk.addMethod(
  4617. unescape('_comment_'),
  4618. smalltalk.method({
  4619. selector: unescape('comment%3A'),
  4620. category: 'accessing',
  4621. fn: function (aString) {
  4622. var self=this;
  4623. smalltalk.send(self, "_basicAt_put_", ["comment", aString]);
  4624. return self;},
  4625. args: ["aString"],
  4626. source: unescape('comment%3A%20aString%0A%20%20%20%20self%20basicAt%3A%20%27comment%27%20put%3A%20aString'),
  4627. messageSends: ["basicAt:put:"],
  4628. referencedClasses: []
  4629. }),
  4630. smalltalk.Behavior);
  4631. smalltalk.addMethod(
  4632. unescape('_commentStamp'),
  4633. smalltalk.method({
  4634. selector: unescape('commentStamp'),
  4635. category: 'accessing',
  4636. fn: function () {
  4637. var self=this;
  4638. return (function($rec){smalltalk.send($rec, "_class_", [self]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ClassCommentReader || ClassCommentReader), "_new", []));
  4639. return self;},
  4640. args: [],
  4641. source: unescape('commentStamp%0A%20%20%20%20%5EClassCommentReader%20new%0A%09class%3A%20self%3B%0A%09yourself'),
  4642. messageSends: ["class:", "yourself", "new"],
  4643. referencedClasses: ["ClassCommentReader"]
  4644. }),
  4645. smalltalk.Behavior);
  4646. smalltalk.addMethod(
  4647. unescape('_commentStamp_prior_'),
  4648. smalltalk.method({
  4649. selector: unescape('commentStamp%3Aprior%3A'),
  4650. category: 'accessing',
  4651. fn: function (aStamp, prior) {
  4652. var self=this;
  4653. return smalltalk.send(self, "_commentStamp", []);
  4654. return self;},
  4655. args: ["aStamp", "prior"],
  4656. source: unescape('commentStamp%3A%20aStamp%20prior%3A%20prior%0A%20%20%20%20%20%20%20%20%5Eself%20commentStamp'),
  4657. messageSends: ["commentStamp"],
  4658. referencedClasses: []
  4659. }),
  4660. smalltalk.Behavior);
  4661. smalltalk.addMethod(
  4662. unescape('_compile_'),
  4663. smalltalk.method({
  4664. selector: unescape('compile%3A'),
  4665. category: 'compiling',
  4666. fn: function (aString) {
  4667. var self=this;
  4668. smalltalk.send(self, "_compile_category_", [aString, ""]);
  4669. return self;},
  4670. args: ["aString"],
  4671. source: unescape('compile%3A%20aString%0A%09self%20compile%3A%20aString%20category%3A%20%27%27'),
  4672. messageSends: ["compile:category:"],
  4673. referencedClasses: []
  4674. }),
  4675. smalltalk.Behavior);
  4676. smalltalk.addMethod(
  4677. unescape('_compile_category_'),
  4678. smalltalk.method({
  4679. selector: unescape('compile%3Acategory%3A'),
  4680. category: 'compiling',
  4681. fn: function (aString, anotherString) {
  4682. var self=this;
  4683. var method=nil;
  4684. (method=smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_load_forClass_", [aString, self]));
  4685. smalltalk.send(method, "_category_", [anotherString]);
  4686. smalltalk.send(self, "_addCompiledMethod_", [method]);
  4687. return self;},
  4688. args: ["aString", "anotherString"],
  4689. source: unescape('compile%3A%20aString%20category%3A%20anotherString%0A%09%7C%20method%20%7C%0A%09method%20%3A%3D%20Compiler%20new%20load%3A%20aString%20forClass%3A%20self.%0A%09method%20category%3A%20anotherString.%0A%09self%20addCompiledMethod%3A%20method'),
  4690. messageSends: ["load:forClass:", "new", "category:", "addCompiledMethod:"],
  4691. referencedClasses: ["Compiler"]
  4692. }),
  4693. smalltalk.Behavior);
  4694. smalltalk.addMethod(
  4695. unescape('_inheritsFrom_'),
  4696. smalltalk.method({
  4697. selector: unescape('inheritsFrom%3A'),
  4698. category: 'testing',
  4699. fn: function (aClass) {
  4700. var self=this;
  4701. return smalltalk.send(smalltalk.send(aClass, "_allSubclasses", []), "_includes_", [self]);
  4702. return self;},
  4703. args: ["aClass"],
  4704. source: unescape('inheritsFrom%3A%20aClass%0A%09%5EaClass%20allSubclasses%20includes%3A%20self'),
  4705. messageSends: ["includes:", "allSubclasses"],
  4706. referencedClasses: []
  4707. }),
  4708. smalltalk.Behavior);
  4709. smalltalk.addMethod(
  4710. unescape('_instanceVariableNames'),
  4711. smalltalk.method({
  4712. selector: unescape('instanceVariableNames'),
  4713. category: 'accessing',
  4714. fn: function () {
  4715. var self=this;
  4716. return self.iVarNames;
  4717. return self;},
  4718. args: [],
  4719. source: unescape('instanceVariableNames%0A%09%3Creturn%20self.iVarNames%3E'),
  4720. messageSends: [],
  4721. referencedClasses: []
  4722. }),
  4723. smalltalk.Behavior);
  4724. smalltalk.addMethod(
  4725. unescape('_methodAt_'),
  4726. smalltalk.method({
  4727. selector: unescape('methodAt%3A'),
  4728. category: 'accessing',
  4729. fn: function (aString) {
  4730. var self=this;
  4731. return smalltalk.methods(self)[aString];
  4732. return self;},
  4733. args: ["aString"],
  4734. source: unescape('methodAt%3A%20aString%0A%09%3Creturn%20smalltalk.methods%28self%29%5BaString%5D%3E'),
  4735. messageSends: [],
  4736. referencedClasses: []
  4737. }),
  4738. smalltalk.Behavior);
  4739. smalltalk.addMethod(
  4740. unescape('_methodDictionary'),
  4741. smalltalk.method({
  4742. selector: unescape('methodDictionary'),
  4743. category: 'accessing',
  4744. fn: function () {
  4745. var self=this;
  4746. var dict = smalltalk.HashedCollection._new();
  4747. var methods = self.fn.prototype.methods;
  4748. for(var i in methods) {
  4749. if(methods[i].selector) {
  4750. dict._at_put_(methods[i].selector, methods[i]);
  4751. }
  4752. };
  4753. return dict;
  4754. return self;},
  4755. args: [],
  4756. source: unescape('methodDictionary%0A%09%3Cvar%20dict%20%3D%20smalltalk.HashedCollection._new%28%29%3B%0A%09var%20methods%20%3D%20self.fn.prototype.methods%3B%0A%09for%28var%20i%20in%20methods%29%20%7B%0A%09%09if%28methods%5Bi%5D.selector%29%20%7B%0A%09%09%09dict._at_put_%28methods%5Bi%5D.selector%2C%20methods%5Bi%5D%29%3B%0A%09%09%7D%0A%09%7D%3B%0A%09return%20dict%3E'),
  4757. messageSends: [],
  4758. referencedClasses: []
  4759. }),
  4760. smalltalk.Behavior);
  4761. smalltalk.addMethod(
  4762. unescape('_methodsFor_'),
  4763. smalltalk.method({
  4764. selector: unescape('methodsFor%3A'),
  4765. category: 'accessing',
  4766. fn: function (aString) {
  4767. var self=this;
  4768. return (function($rec){smalltalk.send($rec, "_class_category_", [self, aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ClassCategoryReader || ClassCategoryReader), "_new", []));
  4769. return self;},
  4770. args: ["aString"],
  4771. source: unescape('methodsFor%3A%20aString%0A%09%5EClassCategoryReader%20new%0A%09%20%20%20%20class%3A%20self%20category%3A%20aString%3B%0A%09%20%20%20%20yourself'),
  4772. messageSends: ["class:category:", "yourself", "new"],
  4773. referencedClasses: ["ClassCategoryReader"]
  4774. }),
  4775. smalltalk.Behavior);
  4776. smalltalk.addMethod(
  4777. unescape('_methodsFor_stamp_'),
  4778. smalltalk.method({
  4779. selector: unescape('methodsFor%3Astamp%3A'),
  4780. category: 'accessing',
  4781. fn: function (aString, aStamp) {
  4782. var self=this;
  4783. return smalltalk.send(self, "_methodsFor_", [aString]);
  4784. return self;},
  4785. args: ["aString", "aStamp"],
  4786. source: unescape('methodsFor%3A%20aString%20stamp%3A%20aStamp%0A%09%22Added%20for%20compatibility%2C%20right%20now%20ignores%20stamp.%22%0A%09%5Eself%20methodsFor%3A%20aString'),
  4787. messageSends: ["methodsFor:"],
  4788. referencedClasses: []
  4789. }),
  4790. smalltalk.Behavior);
  4791. smalltalk.addMethod(
  4792. unescape('_name'),
  4793. smalltalk.method({
  4794. selector: unescape('name'),
  4795. category: 'accessing',
  4796. fn: function () {
  4797. var self=this;
  4798. return self.className || nil;
  4799. return self;},
  4800. args: [],
  4801. source: unescape('name%0A%09%3Creturn%20self.className%20%7C%7C%20nil%3E'),
  4802. messageSends: [],
  4803. referencedClasses: []
  4804. }),
  4805. smalltalk.Behavior);
  4806. smalltalk.addMethod(
  4807. unescape('_new'),
  4808. smalltalk.method({
  4809. selector: unescape('new'),
  4810. category: 'instance creation',
  4811. fn: function () {
  4812. var self=this;
  4813. return smalltalk.send(smalltalk.send(self, "_basicNew", []), "_initialize", []);
  4814. return self;},
  4815. args: [],
  4816. source: unescape('new%0A%09%5Eself%20basicNew%20initialize'),
  4817. messageSends: ["initialize", "basicNew"],
  4818. referencedClasses: []
  4819. }),
  4820. smalltalk.Behavior);
  4821. smalltalk.addMethod(
  4822. unescape('_protocols'),
  4823. smalltalk.method({
  4824. selector: unescape('protocols'),
  4825. category: 'accessing',
  4826. fn: function () {
  4827. var self=this;
  4828. var protocols=nil;
  4829. (protocols=smalltalk.send((smalltalk.Array || Array), "_new", []));
  4830. smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_do_", [(function(each){return ((($receiver = smalltalk.send(protocols, "_includes_", [smalltalk.send(each, "_category", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(protocols, "_add_", [smalltalk.send(each, "_category", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(protocols, "_add_", [smalltalk.send(each, "_category", [])]);})]));})]);
  4831. return smalltalk.send(protocols, "_sort", []);
  4832. return self;},
  4833. args: [],
  4834. source: unescape('protocols%0A%20%20%20%20%7C%20protocols%20%7C%0A%20%20%20%20protocols%20%3A%3D%20Array%20new.%0A%20%20%20%20self%20methodDictionary%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20%28protocols%20includes%3A%20each%20category%29%20ifFalse%3A%20%5B%0A%09%09protocols%20add%3A%20each%20category%5D%5D.%0A%20%20%20%20%5Eprotocols%20sort'),
  4835. messageSends: ["new", "do:", "methodDictionary", "ifFalse:", "includes:", "category", "add:", "sort"],
  4836. referencedClasses: ["Array"]
  4837. }),
  4838. smalltalk.Behavior);
  4839. smalltalk.addMethod(
  4840. unescape('_protocolsDo_'),
  4841. smalltalk.method({
  4842. selector: unescape('protocolsDo%3A'),
  4843. category: 'accessing',
  4844. fn: function (aBlock) {
  4845. var self=this;
  4846. var methodsByCategory=nil;
  4847. (methodsByCategory=smalltalk.send((smalltalk.HashedCollection || HashedCollection), "_new", []));
  4848. smalltalk.send(smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_values", []), "_do_", [(function(m){return smalltalk.send(smalltalk.send(methodsByCategory, "_at_ifAbsentPut_", [smalltalk.send(m, "_category", []), (function(){return smalltalk.send((smalltalk.Array || Array), "_new", []);})]), "_add_", [m]);})]);
  4849. smalltalk.send(smalltalk.send(self, "_protocols", []), "_do_", [(function(category){return smalltalk.send(aBlock, "_value_value_", [category, smalltalk.send(methodsByCategory, "_at_", [category])]);})]);
  4850. return self;},
  4851. args: ["aBlock"],
  4852. source: unescape('protocolsDo%3A%20aBlock%0A%09%22Execute%20aBlock%20for%20each%20method%20category%20with%0A%09its%20collection%20of%20methods%20in%20the%20sort%20order%20of%20category%20name.%22%0A%0A%09%7C%20methodsByCategory%20%7C%0A%09methodsByCategory%20%3A%3D%20HashedCollection%20new.%0A%09self%20methodDictionary%20values%20do%3A%20%5B%3Am%20%7C%0A%09%09%28methodsByCategory%20at%3A%20m%20category%20ifAbsentPut%3A%20%5BArray%20new%5D%29%0A%20%09%09%09add%3A%20m%5D.%20%0A%09self%20protocols%20do%3A%20%5B%3Acategory%20%7C%0A%09%09aBlock%20value%3A%20category%20value%3A%20%28methodsByCategory%20at%3A%20category%29%5D'),
  4853. messageSends: ["new", "do:", "values", "methodDictionary", "add:", "at:ifAbsentPut:", "category", "protocols", "value:value:", "at:"],
  4854. referencedClasses: ["HashedCollection", "Array"]
  4855. }),
  4856. smalltalk.Behavior);
  4857. smalltalk.addMethod(
  4858. unescape('_prototype'),
  4859. smalltalk.method({
  4860. selector: unescape('prototype'),
  4861. category: 'accessing',
  4862. fn: function () {
  4863. var self=this;
  4864. return self.fn.prototype;
  4865. return self;},
  4866. args: [],
  4867. source: unescape('prototype%0A%09%3Creturn%20self.fn.prototype%3E'),
  4868. messageSends: [],
  4869. referencedClasses: []
  4870. }),
  4871. smalltalk.Behavior);
  4872. smalltalk.addMethod(
  4873. unescape('_removeCompiledMethod_'),
  4874. smalltalk.method({
  4875. selector: unescape('removeCompiledMethod%3A'),
  4876. category: 'compiling',
  4877. fn: function (aMethod) {
  4878. var self=this;
  4879. delete self.fn.prototype[aMethod.selector._asSelector()];
  4880. delete self.fn.prototype.methods[aMethod.selector];
  4881. smalltalk.init(self);;
  4882. return self;},
  4883. args: ["aMethod"],
  4884. source: unescape('removeCompiledMethod%3A%20aMethod%0A%09%3Cdelete%20self.fn.prototype%5BaMethod.selector._asSelector%28%29%5D%3B%0A%09delete%20self.fn.prototype.methods%5BaMethod.selector%5D%3B%0A%09smalltalk.init%28self%29%3B%3E'),
  4885. messageSends: [],
  4886. referencedClasses: []
  4887. }),
  4888. smalltalk.Behavior);
  4889. smalltalk.addMethod(
  4890. unescape('_subclasses'),
  4891. smalltalk.method({
  4892. selector: unescape('subclasses'),
  4893. category: 'accessing',
  4894. fn: function () {
  4895. var self=this;
  4896. return smalltalk.subclasses(self);
  4897. return self;},
  4898. args: [],
  4899. source: unescape('subclasses%0A%09%3Creturn%20smalltalk.subclasses%28self%29%3E'),
  4900. messageSends: [],
  4901. referencedClasses: []
  4902. }),
  4903. smalltalk.Behavior);
  4904. smalltalk.addMethod(
  4905. unescape('_superclass'),
  4906. smalltalk.method({
  4907. selector: unescape('superclass'),
  4908. category: 'accessing',
  4909. fn: function () {
  4910. var self=this;
  4911. return self.superclass || nil;
  4912. return self;},
  4913. args: [],
  4914. source: unescape('superclass%0A%09%3Creturn%20self.superclass%20%7C%7C%20nil%3E'),
  4915. messageSends: [],
  4916. referencedClasses: []
  4917. }),
  4918. smalltalk.Behavior);
  4919. smalltalk.addMethod(
  4920. unescape('_withAllSubclasses'),
  4921. smalltalk.method({
  4922. selector: unescape('withAllSubclasses'),
  4923. category: 'accessing',
  4924. fn: function () {
  4925. var self=this;
  4926. return (function($rec){smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_allSubclasses", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Array || Array), "_with_", [self]));
  4927. return self;},
  4928. args: [],
  4929. source: unescape('withAllSubclasses%0A%09%5E%28Array%20with%3A%20self%29%20addAll%3A%20self%20allSubclasses%3B%20yourself'),
  4930. messageSends: ["addAll:", "allSubclasses", "yourself", "with:"],
  4931. referencedClasses: ["Array"]
  4932. }),
  4933. smalltalk.Behavior);
  4934. smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel-Classes');
  4935. smalltalk.Class.comment=unescape('Class%20is%20__the__%20class%20object.%20%0A%0AInstances%20are%20the%20classes%20of%20the%20system.%0AClass%20creation%20is%20done%20throught%20a%20%60ClassBuilder%60')
  4936. smalltalk.addMethod(
  4937. unescape('_category'),
  4938. smalltalk.method({
  4939. selector: unescape('category'),
  4940. category: 'accessing',
  4941. fn: function () {
  4942. var self=this;
  4943. return (($receiver = smalltalk.send(self, "_package", [])) == nil || $receiver == undefined) ? (function(){return "Unclassified";})() : (function(){return smalltalk.send(smalltalk.send(self, "_package", []), "_name", []);})();
  4944. return self;},
  4945. args: [],
  4946. source: unescape('category%0A%09%5Eself%20package%20ifNil%3A%20%5B%27Unclassified%27%5D%20ifNotNil%3A%20%5Bself%20package%20name%5D'),
  4947. messageSends: ["ifNil:ifNotNil:", "package", "name"],
  4948. referencedClasses: []
  4949. }),
  4950. smalltalk.Class);
  4951. smalltalk.addMethod(
  4952. unescape('_isClass'),
  4953. smalltalk.method({
  4954. selector: unescape('isClass'),
  4955. category: 'testing',
  4956. fn: function () {
  4957. var self=this;
  4958. return true;
  4959. return self;},
  4960. args: [],
  4961. source: unescape('isClass%0A%09%5Etrue'),
  4962. messageSends: [],
  4963. referencedClasses: []
  4964. }),
  4965. smalltalk.Class);
  4966. smalltalk.addMethod(
  4967. unescape('_package'),
  4968. smalltalk.method({
  4969. selector: unescape('package'),
  4970. category: 'accessing',
  4971. fn: function () {
  4972. var self=this;
  4973. return self.pkg;
  4974. return self;},
  4975. args: [],
  4976. source: unescape('package%0A%09%3Creturn%20self.pkg%3E'),
  4977. messageSends: [],
  4978. referencedClasses: []
  4979. }),
  4980. smalltalk.Class);
  4981. smalltalk.addMethod(
  4982. unescape('_package_'),
  4983. smalltalk.method({
  4984. selector: unescape('package%3A'),
  4985. category: 'accessing',
  4986. fn: function (aPackage) {
  4987. var self=this;
  4988. self.pkg = aPackage;
  4989. return self;},
  4990. args: ["aPackage"],
  4991. source: unescape('package%3A%20aPackage%0A%09%3Cself.pkg%20%3D%20aPackage%3E'),
  4992. messageSends: [],
  4993. referencedClasses: []
  4994. }),
  4995. smalltalk.Class);
  4996. smalltalk.addMethod(
  4997. unescape('_printString'),
  4998. smalltalk.method({
  4999. selector: unescape('printString'),
  5000. category: 'printing',
  5001. fn: function () {
  5002. var self=this;
  5003. return smalltalk.send(self, "_name", []);
  5004. return self;},
  5005. args: [],
  5006. source: unescape('printString%0A%09%5Eself%20name'),
  5007. messageSends: ["name"],
  5008. referencedClasses: []
  5009. }),
  5010. smalltalk.Class);
  5011. smalltalk.addMethod(
  5012. unescape('_rename_'),
  5013. smalltalk.method({
  5014. selector: unescape('rename%3A'),
  5015. category: 'accessing',
  5016. fn: function (aString) {
  5017. var self=this;
  5018. smalltalk[aString] = self;
  5019. delete smalltalk[self.className];
  5020. self.className = aString;
  5021. ;
  5022. return self;},
  5023. args: ["aString"],
  5024. source: unescape('rename%3A%20aString%0A%09%3C%0A%09%09smalltalk%5BaString%5D%20%3D%20self%3B%0A%09%09delete%20smalltalk%5Bself.className%5D%3B%0A%09%09self.className%20%3D%20aString%3B%0A%09%3E'),
  5025. messageSends: [],
  5026. referencedClasses: []
  5027. }),
  5028. smalltalk.Class);
  5029. smalltalk.addMethod(
  5030. unescape('_subclass_instanceVariableNames_'),
  5031. smalltalk.method({
  5032. selector: unescape('subclass%3AinstanceVariableNames%3A'),
  5033. category: 'class creation',
  5034. fn: function (aString, anotherString) {
  5035. var self=this;
  5036. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
  5037. return self;},
  5038. args: ["aString", "anotherString"],
  5039. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%0A%09%22Kept%20for%20compatibility.%22%0A%09%5Eself%20subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%20package%3A%20nil'),
  5040. messageSends: ["subclass:instanceVariableNames:package:"],
  5041. referencedClasses: []
  5042. }),
  5043. smalltalk.Class);
  5044. smalltalk.addMethod(
  5045. unescape('_subclass_instanceVariableNames_category_'),
  5046. smalltalk.method({
  5047. selector: unescape('subclass%3AinstanceVariableNames%3Acategory%3A'),
  5048. category: 'class creation',
  5049. fn: function (aString, aString2, aString3) {
  5050. var self=this;
  5051. smalltalk.send(self, "_deprecatedAPI", []);
  5052. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  5053. return self;},
  5054. args: ["aString", "aString2", "aString3"],
  5055. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A%09%22Kept%20for%20compatibility.%22%0A%09self%20deprecatedAPI.%0A%09%5Eself%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20package%3A%20aString3'),
  5056. messageSends: ["deprecatedAPI", "subclass:instanceVariableNames:package:"],
  5057. referencedClasses: []
  5058. }),
  5059. smalltalk.Class);
  5060. smalltalk.addMethod(
  5061. unescape('_subclass_instanceVariableNames_classVariableNames_poolDictionaries_category_'),
  5062. smalltalk.method({
  5063. selector: unescape('subclass%3AinstanceVariableNames%3AclassVariableNames%3ApoolDictionaries%3Acategory%3A'),
  5064. category: 'class creation',
  5065. fn: function (aString, aString2, classVars, pools, aString3) {
  5066. var self=this;
  5067. return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
  5068. return self;},
  5069. args: ["aString", "aString2", "classVars", "pools", "aString3"],
  5070. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20classVariableNames%3A%20classVars%20poolDictionaries%3A%20pools%20category%3A%20aString3%0A%09%22Just%20ignore%20class%20variables%20and%20pools.%20Added%20for%20compatibility.%22%0A%09%5Eself%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20package%3A%20aString3'),
  5071. messageSends: ["subclass:instanceVariableNames:package:"],
  5072. referencedClasses: []
  5073. }),
  5074. smalltalk.Class);
  5075. smalltalk.addMethod(
  5076. unescape('_subclass_instanceVariableNames_package_'),
  5077. smalltalk.method({
  5078. selector: unescape('subclass%3AinstanceVariableNames%3Apackage%3A'),
  5079. category: 'class creation',
  5080. fn: function (aString, aString2, aString3) {
  5081. var self=this;
  5082. return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, smalltalk.send(aString, "_asString", []), aString2, aString3]);
  5083. return self;},
  5084. args: ["aString", "aString2", "aString3"],
  5085. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20package%3A%20aString3%0A%09%5EClassBuilder%20new%0A%09%20%20%20%20superclass%3A%20self%20subclass%3A%20aString%20asString%20instanceVariableNames%3A%20aString2%20package%3A%20aString3'),
  5086. messageSends: ["superclass:subclass:instanceVariableNames:package:", "new", "asString"],
  5087. referencedClasses: ["ClassBuilder"]
  5088. }),
  5089. smalltalk.Class);
  5090. smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel-Classes');
  5091. smalltalk.Metaclass.comment=unescape('Metaclass%20is%20the%20root%20of%20the%20class%20hierarchy.%0A%0AMetaclass%20instances%20are%20metaclasses%2C%20one%20for%20each%20real%20class.%20%0AMetaclass%20instances%20have%20a%20single%20instance%2C%20which%20they%20hold%20onto%2C%20which%20is%20the%20class%20that%20they%20are%20the%20metaclass%20of.')
  5092. smalltalk.addMethod(
  5093. unescape('_instanceClass'),
  5094. smalltalk.method({
  5095. selector: unescape('instanceClass'),
  5096. category: 'accessing',
  5097. fn: function () {
  5098. var self=this;
  5099. return self.instanceClass;
  5100. return self;},
  5101. args: [],
  5102. source: unescape('instanceClass%0A%09%3Creturn%20self.instanceClass%3E'),
  5103. messageSends: [],
  5104. referencedClasses: []
  5105. }),
  5106. smalltalk.Metaclass);
  5107. smalltalk.addMethod(
  5108. unescape('_instanceVariableNames_'),
  5109. smalltalk.method({
  5110. selector: unescape('instanceVariableNames%3A'),
  5111. category: 'accessing',
  5112. fn: function (aCollection) {
  5113. var self=this;
  5114. smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_class_instanceVariableNames_", [self, aCollection]);
  5115. return self;},
  5116. args: ["aCollection"],
  5117. source: unescape('instanceVariableNames%3A%20aCollection%0A%09ClassBuilder%20new%0A%09%20%20%20%20class%3A%20self%20instanceVariableNames%3A%20aCollection'),
  5118. messageSends: ["class:instanceVariableNames:", "new"],
  5119. referencedClasses: ["ClassBuilder"]
  5120. }),
  5121. smalltalk.Metaclass);
  5122. smalltalk.addMethod(
  5123. unescape('_isMetaclass'),
  5124. smalltalk.method({
  5125. selector: unescape('isMetaclass'),
  5126. category: 'testing',
  5127. fn: function () {
  5128. var self=this;
  5129. return true;
  5130. return self;},
  5131. args: [],
  5132. source: unescape('isMetaclass%0A%09%5Etrue'),
  5133. messageSends: [],
  5134. referencedClasses: []
  5135. }),
  5136. smalltalk.Metaclass);
  5137. smalltalk.addMethod(
  5138. unescape('_printString'),
  5139. smalltalk.method({
  5140. selector: unescape('printString'),
  5141. category: 'printing',
  5142. fn: function () {
  5143. var self=this;
  5144. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_instanceClass", []), "_name", []), "__comma", [" class"]);
  5145. return self;},
  5146. args: [],
  5147. source: unescape('printString%0A%09%5Eself%20instanceClass%20name%2C%20%27%20class%27'),
  5148. messageSends: [unescape("%2C"), "name", "instanceClass"],
  5149. referencedClasses: []
  5150. }),
  5151. smalltalk.Metaclass);
  5152. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel-Classes');
  5153. smalltalk.ClassBuilder.comment=unescape('ClassBuilder%20is%20responsible%20for%20compiling%20new%20classes%20or%20modifying%20existing%20classes%20in%20the%20system.%0A%0ARather%20than%20using%20ClassBuilder%20directly%20to%20compile%20a%20class%2C%20use%20%60Class%20%3E%3E%20subclass%3AinstanceVariableNames%3Apackage%3A%60.')
  5154. smalltalk.addMethod(
  5155. unescape('_addSubclassOf_named_instanceVariableNames_'),
  5156. smalltalk.method({
  5157. selector: unescape('addSubclassOf%3Anamed%3AinstanceVariableNames%3A'),
  5158. category: 'private',
  5159. fn: function (aClass, aString, aCollection) {
  5160. var self=this;
  5161. smalltalk.addClass(aString, aClass, aCollection);
  5162. return smalltalk[aString];
  5163. return self;},
  5164. args: ["aClass", "aString", "aCollection"],
  5165. source: unescape('addSubclassOf%3A%20aClass%20named%3A%20aString%20instanceVariableNames%3A%20aCollection%0A%09%3Csmalltalk.addClass%28aString%2C%20aClass%2C%20aCollection%29%3B%0A%09%20%20%20%20return%20smalltalk%5BaString%5D%3E'),
  5166. messageSends: [],
  5167. referencedClasses: []
  5168. }),
  5169. smalltalk.ClassBuilder);
  5170. smalltalk.addMethod(
  5171. unescape('_addSubclassOf_named_instanceVariableNames_package_'),
  5172. smalltalk.method({
  5173. selector: unescape('addSubclassOf%3Anamed%3AinstanceVariableNames%3Apackage%3A'),
  5174. category: 'private',
  5175. fn: function (aClass, aString, aCollection, packageName) {
  5176. var self=this;
  5177. smalltalk.addClass(aString, aClass, aCollection, packageName);
  5178. return smalltalk[aString];
  5179. return self;},
  5180. args: ["aClass", "aString", "aCollection", "packageName"],
  5181. source: unescape('addSubclassOf%3A%20aClass%20named%3A%20aString%20instanceVariableNames%3A%20aCollection%20package%3A%20packageName%0A%09%3Csmalltalk.addClass%28aString%2C%20aClass%2C%20aCollection%2C%20packageName%29%3B%0A%09%20%20%20%20return%20smalltalk%5BaString%5D%3E'),
  5182. messageSends: [],
  5183. referencedClasses: []
  5184. }),
  5185. smalltalk.ClassBuilder);
  5186. smalltalk.addMethod(
  5187. unescape('_class_instanceVariableNames_'),
  5188. smalltalk.method({
  5189. selector: unescape('class%3AinstanceVariableNames%3A'),
  5190. category: 'class creation',
  5191. fn: function (aClass, aString) {
  5192. var self=this;
  5193. ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_name", []), "__comma", [" is not a metaclass"])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_name", []), "__comma", [" is not a metaclass"])]);})]));
  5194. smalltalk.send(aClass, "_basicAt_put_", ["iVarNames", smalltalk.send(self, "_instanceVariableNamesFor_", [aString])]);
  5195. smalltalk.send(self, "_setupClass_", [aClass]);
  5196. return self;},
  5197. args: ["aClass", "aString"],
  5198. source: unescape('class%3A%20aClass%20instanceVariableNames%3A%20aString%0A%09aClass%20isMetaclass%20ifFalse%3A%20%5Bself%20error%3A%20aClass%20name%2C%20%27%20is%20not%20a%20metaclass%27%5D.%0A%09aClass%20basicAt%3A%20%27iVarNames%27%20put%3A%20%28self%20instanceVariableNamesFor%3A%20aString%29.%0A%09self%20setupClass%3A%20aClass'),
  5199. messageSends: ["ifFalse:", "isMetaclass", "error:", unescape("%2C"), "name", "basicAt:put:", "instanceVariableNamesFor:", "setupClass:"],
  5200. referencedClasses: []
  5201. }),
  5202. smalltalk.ClassBuilder);
  5203. smalltalk.addMethod(
  5204. unescape('_copyClass_named_'),
  5205. smalltalk.method({
  5206. selector: unescape('copyClass%3Anamed%3A'),
  5207. category: 'private',
  5208. fn: function (aClass, aString) {
  5209. var self=this;
  5210. var newClass=nil;
  5211. (newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [smalltalk.send(aClass, "_superclass", []), aString, smalltalk.send(aClass, "_instanceVariableNames", []), smalltalk.send(smalltalk.send(aClass, "_package", []), "_name", [])]));
  5212. smalltalk.send(self, "_setupClass_", [newClass]);
  5213. smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_do_", [(function(each){smalltalk.send(newClass, "_addCompiledMethod_", [smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_load_forClass_", [smalltalk.send(each, "_source", []), newClass])]);return smalltalk.send(smalltalk.send(smalltalk.send(newClass, "_methodDictionary", []), "_at_", [smalltalk.send(each, "_selector", [])]), "_category_", [smalltalk.send(each, "_category", [])]);})]);
  5214. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_methodDictionary", []), "_values", []), "_do_", [(function(each){smalltalk.send(smalltalk.send(newClass, "_class", []), "_addCompiledMethod_", [smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_load_forClass_", [smalltalk.send(each, "_source", []), smalltalk.send(newClass, "_class", [])])]);return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(newClass, "_class", []), "_methodDictionary", []), "_at_", [smalltalk.send(each, "_selector", [])]), "_category_", [smalltalk.send(each, "_category", [])]);})]);
  5215. smalltalk.send(self, "_setupClass_", [newClass]);
  5216. return newClass;
  5217. return self;},
  5218. args: ["aClass", "aString"],
  5219. source: unescape('copyClass%3A%20aClass%20named%3A%20aString%0A%09%7C%20newClass%20%7C%0A%0A%09newClass%20%3A%3D%20self%20%0A%09%09addSubclassOf%3A%20aClass%20superclass%0A%09%09named%3A%20aString%20%0A%09%09instanceVariableNames%3A%20aClass%20instanceVariableNames%20%0A%09%09package%3A%20aClass%20package%20name.%0A%0A%09self%20setupClass%3A%20newClass.%0A%0A%09aClass%20methodDictionary%20values%20do%3A%20%5B%3Aeach%20%7C%0A%09%09newClass%20addCompiledMethod%3A%20%28Compiler%20new%20load%3A%20each%20source%20forClass%3A%20newClass%29.%0A%09%09%28newClass%20methodDictionary%20at%3A%20each%20selector%29%20category%3A%20each%20category%5D.%0A%0A%09aClass%20class%20methodDictionary%20values%20do%3A%20%5B%3Aeach%20%7C%0A%09%09newClass%20class%20addCompiledMethod%3A%20%28Compiler%20new%20load%3A%20each%20source%20forClass%3A%20newClass%20class%29.%0A%09%09%28newClass%20class%20methodDictionary%20at%3A%20each%20selector%29%20category%3A%20each%20category%5D.%0A%0A%09self%20setupClass%3A%20newClass.%0A%09%5EnewClass'),
  5220. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "superclass", "instanceVariableNames", "name", "package", "setupClass:", "do:", "values", "methodDictionary", "addCompiledMethod:", "load:forClass:", "new", "source", "category:", "at:", "selector", "category", "class"],
  5221. referencedClasses: ["Compiler"]
  5222. }),
  5223. smalltalk.ClassBuilder);
  5224. smalltalk.addMethod(
  5225. unescape('_instanceVariableNamesFor_'),
  5226. smalltalk.method({
  5227. selector: unescape('instanceVariableNamesFor%3A'),
  5228. category: 'private',
  5229. fn: function (aString) {
  5230. var self=this;
  5231. return smalltalk.send(smalltalk.send(aString, "_tokenize_", [" "]), "_reject_", [(function(each){return smalltalk.send(each, "_isEmpty", []);})]);
  5232. return self;},
  5233. args: ["aString"],
  5234. source: unescape('instanceVariableNamesFor%3A%20aString%0A%09%5E%28aString%20tokenize%3A%20%27%20%27%29%20reject%3A%20%5B%3Aeach%20%7C%20each%20isEmpty%5D'),
  5235. messageSends: ["reject:", "tokenize:", "isEmpty"],
  5236. referencedClasses: []
  5237. }),
  5238. smalltalk.ClassBuilder);
  5239. smalltalk.addMethod(
  5240. unescape('_setupClass_'),
  5241. smalltalk.method({
  5242. selector: unescape('setupClass%3A'),
  5243. category: 'private',
  5244. fn: function (aClass) {
  5245. var self=this;
  5246. smalltalk.init(aClass);;
  5247. return self;},
  5248. args: ["aClass"],
  5249. source: unescape('setupClass%3A%20aClass%0A%09%3Csmalltalk.init%28aClass%29%3B%3E'),
  5250. messageSends: [],
  5251. referencedClasses: []
  5252. }),
  5253. smalltalk.ClassBuilder);
  5254. smalltalk.addMethod(
  5255. unescape('_superclass_subclass_'),
  5256. smalltalk.method({
  5257. selector: unescape('superclass%3Asubclass%3A'),
  5258. category: 'class creation',
  5259. fn: function (aClass, aString) {
  5260. var self=this;
  5261. return smalltalk.send(self, "_superclass_subclass_instanceVariableNames_package_", [aClass, aString, "", nil]);
  5262. return self;},
  5263. args: ["aClass", "aString"],
  5264. source: unescape('superclass%3A%20aClass%20subclass%3A%20aString%0A%09%5Eself%20superclass%3A%20aClass%20subclass%3A%20aString%20instanceVariableNames%3A%20%27%27%20package%3A%20nil'),
  5265. messageSends: ["superclass:subclass:instanceVariableNames:package:"],
  5266. referencedClasses: []
  5267. }),
  5268. smalltalk.ClassBuilder);
  5269. smalltalk.addMethod(
  5270. unescape('_superclass_subclass_instanceVariableNames_package_'),
  5271. smalltalk.method({
  5272. selector: unescape('superclass%3Asubclass%3AinstanceVariableNames%3Apackage%3A'),
  5273. category: 'class creation',
  5274. fn: function (aClass, aString, aString2, aString3) {
  5275. var self=this;
  5276. var newClass=nil;
  5277. (newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [aClass, aString, smalltalk.send(self, "_instanceVariableNamesFor_", [aString2]), (($receiver = aString3) == nil || $receiver == undefined) ? (function(){return "unclassified";})() : $receiver]));
  5278. smalltalk.send(self, "_setupClass_", [newClass]);
  5279. return newClass;
  5280. return self;},
  5281. args: ["aClass", "aString", "aString2", "aString3"],
  5282. source: unescape('superclass%3A%20aClass%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20package%3A%20aString3%0A%09%7C%20newClass%20%7C%0A%09newClass%20%3A%3D%20self%20addSubclassOf%3A%20aClass%0A%09%09%09%09named%3A%20aString%20instanceVariableNames%3A%20%28self%20instanceVariableNamesFor%3A%20aString2%29%0A%09%09%09%09package%3A%20%28aString3%20ifNil%3A%20%5B%27unclassified%27%5D%29.%0A%09self%20setupClass%3A%20newClass.%0A%09%5EnewClass'),
  5283. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "instanceVariableNamesFor:", "ifNil:", "setupClass:"],
  5284. referencedClasses: []
  5285. }),
  5286. smalltalk.ClassBuilder);
  5287. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category', 'chunkParser'], 'Kernel-Classes');
  5288. smalltalk.ClassCategoryReader.comment=unescape('ClassCategoryReader%20represents%20a%20mechanism%20for%20retrieving%20class%20descriptions%20stored%20on%20a%20file.')
  5289. smalltalk.addMethod(
  5290. unescape('_class_category_'),
  5291. smalltalk.method({
  5292. selector: unescape('class%3Acategory%3A'),
  5293. category: 'accessing',
  5294. fn: function (aClass, aString) {
  5295. var self=this;
  5296. (self['@class']=aClass);
  5297. (self['@category']=aString);
  5298. return self;},
  5299. args: ["aClass", "aString"],
  5300. source: unescape('class%3A%20aClass%20category%3A%20aString%0A%09class%20%3A%3D%20aClass.%0A%09category%20%3A%3D%20aString'),
  5301. messageSends: [],
  5302. referencedClasses: []
  5303. }),
  5304. smalltalk.ClassCategoryReader);
  5305. smalltalk.addMethod(
  5306. unescape('_compileMethod_'),
  5307. smalltalk.method({
  5308. selector: unescape('compileMethod%3A'),
  5309. category: 'private',
  5310. fn: function (aString) {
  5311. var self=this;
  5312. var method=nil;
  5313. var compiler=nil;
  5314. (method=smalltalk.send((compiler=smalltalk.send((smalltalk.Compiler || Compiler), "_new", [])), "_load_forClass_", [aString, self['@class']]));
  5315. smalltalk.send(method, "_category_", [self['@category']]);
  5316. smalltalk.send(self['@class'], "_addCompiledMethod_", [method]);
  5317. smalltalk.send(compiler, "_setupClass_", [self['@class']]);
  5318. return self;},
  5319. args: ["aString"],
  5320. source: unescape('compileMethod%3A%20aString%0A%09%7C%20method%20compiler%20%7C%0A%09method%20%3A%3D%20%28compiler%20%3A%3D%20Compiler%20new%29%20load%3A%20aString%20forClass%3A%20class.%0A%09method%20category%3A%20category.%0A%09class%20addCompiledMethod%3A%20method.%0A%09compiler%20setupClass%3A%20class.'),
  5321. messageSends: ["load:forClass:", "new", "category:", "addCompiledMethod:", "setupClass:"],
  5322. referencedClasses: ["Compiler"]
  5323. }),
  5324. smalltalk.ClassCategoryReader);
  5325. smalltalk.addMethod(
  5326. unescape('_initialize'),
  5327. smalltalk.method({
  5328. selector: unescape('initialize'),
  5329. category: 'initialization',
  5330. fn: function () {
  5331. var self=this;
  5332. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  5333. (self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []));
  5334. return self;},
  5335. args: [],
  5336. source: unescape('initialize%0A%09super%20initialize.%0A%09chunkParser%20%3A%3D%20ChunkParser%20new.'),
  5337. messageSends: ["initialize", "new"],
  5338. referencedClasses: ["ChunkParser"]
  5339. }),
  5340. smalltalk.ClassCategoryReader);
  5341. smalltalk.addMethod(
  5342. unescape('_scanFrom_'),
  5343. smalltalk.method({
  5344. selector: unescape('scanFrom%3A'),
  5345. category: 'fileIn',
  5346. fn: function (aChunkParser) {
  5347. var self=this;
  5348. var chunk=nil;
  5349. (function(){while(!(function(){(chunk=smalltalk.send(aChunkParser, "_nextChunk", []));return smalltalk.send(chunk, "_isEmpty", []);})()) {(function(){return smalltalk.send(self, "_compileMethod_", [chunk]);})()}})();
  5350. return self;},
  5351. args: ["aChunkParser"],
  5352. source: unescape('scanFrom%3A%20aChunkParser%0A%09%7C%20chunk%20%7C%0A%09%5Bchunk%20%3A%3D%20aChunkParser%20nextChunk.%0A%09chunk%20isEmpty%5D%20whileFalse%3A%20%5B%0A%09%20%20%20%20self%20compileMethod%3A%20chunk%5D'),
  5353. messageSends: ["whileFalse:", "nextChunk", "isEmpty", "compileMethod:"],
  5354. referencedClasses: []
  5355. }),
  5356. smalltalk.ClassCategoryReader);
  5357. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class', 'chunkParser'], 'Kernel-Classes');
  5358. smalltalk.ClassCommentReader.comment=unescape('ClassCommentReader%20represents%20a%20mechanism%20for%20retrieving%20class%20descriptions%20stored%20on%20a%20file.%0ASee%20%60ClassCategoryReader%60%20too.')
  5359. smalltalk.addMethod(
  5360. unescape('_class_'),
  5361. smalltalk.method({
  5362. selector: unescape('class%3A'),
  5363. category: 'accessing',
  5364. fn: function (aClass) {
  5365. var self=this;
  5366. (self['@class']=aClass);
  5367. return self;},
  5368. args: ["aClass"],
  5369. source: unescape('class%3A%20aClass%0A%09class%20%3A%3D%20aClass'),
  5370. messageSends: [],
  5371. referencedClasses: []
  5372. }),
  5373. smalltalk.ClassCommentReader);
  5374. smalltalk.addMethod(
  5375. unescape('_initialize'),
  5376. smalltalk.method({
  5377. selector: unescape('initialize'),
  5378. category: 'initialization',
  5379. fn: function () {
  5380. var self=this;
  5381. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  5382. (self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []));
  5383. return self;},
  5384. args: [],
  5385. source: unescape('initialize%0A%09super%20initialize.%0A%09chunkParser%20%3A%3D%20ChunkParser%20new.'),
  5386. messageSends: ["initialize", "new"],
  5387. referencedClasses: ["ChunkParser"]
  5388. }),
  5389. smalltalk.ClassCommentReader);
  5390. smalltalk.addMethod(
  5391. unescape('_scanFrom_'),
  5392. smalltalk.method({
  5393. selector: unescape('scanFrom%3A'),
  5394. category: 'fileIn',
  5395. fn: function (aChunkParser) {
  5396. var self=this;
  5397. var chunk=nil;
  5398. (chunk=smalltalk.send(aChunkParser, "_nextChunk", []));
  5399. ((($receiver = smalltalk.send(chunk, "_isEmpty", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_setComment_", [chunk]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_setComment_", [chunk]);})]));
  5400. return self;},
  5401. args: ["aChunkParser"],
  5402. source: unescape('scanFrom%3A%20aChunkParser%0A%09%7C%20chunk%20%7C%0A%09chunk%20%3A%3D%20aChunkParser%20nextChunk.%0A%09chunk%20isEmpty%20ifFalse%3A%20%5B%0A%09%20%20%20%20self%20setComment%3A%20chunk%5D.'),
  5403. messageSends: ["nextChunk", "ifFalse:", "isEmpty", "setComment:"],
  5404. referencedClasses: []
  5405. }),
  5406. smalltalk.ClassCommentReader);
  5407. smalltalk.addMethod(
  5408. unescape('_setComment_'),
  5409. smalltalk.method({
  5410. selector: unescape('setComment%3A'),
  5411. category: 'private',
  5412. fn: function (aString) {
  5413. var self=this;
  5414. smalltalk.send(self['@class'], "_comment_", [aString]);
  5415. return self;},
  5416. args: ["aString"],
  5417. source: unescape('setComment%3A%20aString%0A%20%20%20%20class%20comment%3A%20aString'),
  5418. messageSends: ["comment:"],
  5419. referencedClasses: []
  5420. }),
  5421. smalltalk.ClassCommentReader);
  5422. smalltalk.addClass('ClassSorterNode', smalltalk.Object, ['theClass', 'level', 'nodes'], 'Kernel-Classes');
  5423. smalltalk.addMethod(
  5424. unescape('_getNodesFrom_'),
  5425. smalltalk.method({
  5426. selector: unescape('getNodesFrom%3A'),
  5427. category: 'accessing',
  5428. fn: function (aCollection) {
  5429. var self=this;
  5430. var children=nil;
  5431. var others=nil;
  5432. (children=[]);
  5433. (others=[]);
  5434. smalltalk.send(aCollection, "_do_", [(function(each){return ((($receiver = smalltalk.send(smalltalk.send(each, "_superclass", []), "__eq", [smalltalk.send(self, "_theClass", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(children, "_add_", [each]);})() : (function(){return smalltalk.send(others, "_add_", [each]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(children, "_add_", [each]);}), (function(){return smalltalk.send(others, "_add_", [each]);})]));})]);
  5435. (self['@nodes']=smalltalk.send(children, "_collect_", [(function(each){return smalltalk.send((smalltalk.ClassSorterNode || ClassSorterNode), "_on_classes_level_", [each, others, ((($receiver = smalltalk.send(self, "_level", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);})]));
  5436. return self;},
  5437. args: ["aCollection"],
  5438. source: unescape('getNodesFrom%3A%20aCollection%0A%09%7C%20children%20others%20%7C%0A%09children%20%3A%3D%20%23%28%29.%0A%09others%20%3A%3D%20%23%28%29.%0A%09aCollection%20do%3A%20%5B%3Aeach%20%7C%0A%09%09%28each%20superclass%20%3D%20self%20theClass%29%0A%09%09%09ifTrue%3A%20%5Bchildren%20add%3A%20each%5D%0A%09%09%09ifFalse%3A%20%5Bothers%20add%3A%20each%5D%5D.%0A%09nodes%3A%3D%20children%20collect%3A%20%5B%3Aeach%20%7C%0A%09%09ClassSorterNode%20on%3A%20each%20classes%3A%20others%20level%3A%20self%20level%20+%201%5D'),
  5439. messageSends: ["do:", "ifTrue:ifFalse:", unescape("%3D"), "superclass", "theClass", "add:", "collect:", "on:classes:level:", unescape("+"), "level"],
  5440. referencedClasses: ["ClassSorterNode"]
  5441. }),
  5442. smalltalk.ClassSorterNode);
  5443. smalltalk.addMethod(
  5444. unescape('_level'),
  5445. smalltalk.method({
  5446. selector: unescape('level'),
  5447. category: 'accessing',
  5448. fn: function () {
  5449. var self=this;
  5450. return self['@level'];
  5451. return self;},
  5452. args: [],
  5453. source: unescape('level%0A%09%5Elevel'),
  5454. messageSends: [],
  5455. referencedClasses: []
  5456. }),
  5457. smalltalk.ClassSorterNode);
  5458. smalltalk.addMethod(
  5459. unescape('_level_'),
  5460. smalltalk.method({
  5461. selector: unescape('level%3A'),
  5462. category: 'accessing',
  5463. fn: function (anInteger) {
  5464. var self=this;
  5465. (self['@level']=anInteger);
  5466. return self;},
  5467. args: ["anInteger"],
  5468. source: unescape('level%3A%20anInteger%0A%09level%20%3A%3D%20anInteger'),
  5469. messageSends: [],
  5470. referencedClasses: []
  5471. }),
  5472. smalltalk.ClassSorterNode);
  5473. smalltalk.addMethod(
  5474. unescape('_nodes'),
  5475. smalltalk.method({
  5476. selector: unescape('nodes'),
  5477. category: 'accessing',
  5478. fn: function () {
  5479. var self=this;
  5480. return self['@nodes'];
  5481. return self;},
  5482. args: [],
  5483. source: unescape('nodes%0A%09%5Enodes'),
  5484. messageSends: [],
  5485. referencedClasses: []
  5486. }),
  5487. smalltalk.ClassSorterNode);
  5488. smalltalk.addMethod(
  5489. unescape('_theClass'),
  5490. smalltalk.method({
  5491. selector: unescape('theClass'),
  5492. category: 'accessing',
  5493. fn: function () {
  5494. var self=this;
  5495. return self['@theClass'];
  5496. return self;},
  5497. args: [],
  5498. source: unescape('theClass%0A%09%5EtheClass'),
  5499. messageSends: [],
  5500. referencedClasses: []
  5501. }),
  5502. smalltalk.ClassSorterNode);
  5503. smalltalk.addMethod(
  5504. unescape('_theClass_'),
  5505. smalltalk.method({
  5506. selector: unescape('theClass%3A'),
  5507. category: 'accessing',
  5508. fn: function (aClass) {
  5509. var self=this;
  5510. (self['@theClass']=aClass);
  5511. return self;},
  5512. args: ["aClass"],
  5513. source: unescape('theClass%3A%20aClass%0A%09theClass%20%3A%3D%20aClass'),
  5514. messageSends: [],
  5515. referencedClasses: []
  5516. }),
  5517. smalltalk.ClassSorterNode);
  5518. smalltalk.addMethod(
  5519. unescape('_traverseClassesWith_'),
  5520. smalltalk.method({
  5521. selector: unescape('traverseClassesWith%3A'),
  5522. category: 'visiting',
  5523. fn: function (aCollection) {
  5524. var self=this;
  5525. smalltalk.send(aCollection, "_add_", [smalltalk.send(self, "_theClass", [])]);
  5526. smalltalk.send(smalltalk.send(smalltalk.send(self, "_nodes", []), "_sorted_", [(function(a, b){return ((($receiver = smalltalk.send(smalltalk.send(a, "_theClass", []), "_name", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(smalltalk.send(b, "_theClass", []), "_name", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(smalltalk.send(b, "_theClass", []), "_name", [])]));})]), "_do_", [(function(aNode){return smalltalk.send(aNode, "_traverseClassesWith_", [aCollection]);})]);
  5527. return self;},
  5528. args: ["aCollection"],
  5529. source: unescape('traverseClassesWith%3A%20aCollection%0A%09%22sort%20classes%20alphabetically%20Issue%20%23143%22%0A%0A%09aCollection%20add%3A%20self%20theClass.%0A%09%28self%20nodes%20sorted%3A%20%5B%3Aa%20%3Ab%20%7C%20a%20theClass%20name%20%3C%3D%20b%20theClass%20name%20%5D%29%20do%3A%20%5B%3AaNode%20%7C%0A%09%09aNode%20traverseClassesWith%3A%20aCollection%20%5D.'),
  5530. messageSends: ["add:", "theClass", "do:", "sorted:", "nodes", unescape("%3C%3D"), "name", "traverseClassesWith:"],
  5531. referencedClasses: []
  5532. }),
  5533. smalltalk.ClassSorterNode);
  5534. smalltalk.addMethod(
  5535. unescape('_on_classes_level_'),
  5536. smalltalk.method({
  5537. selector: unescape('on%3Aclasses%3Alevel%3A'),
  5538. category: 'instance creation',
  5539. fn: function (aClass, aCollection, anInteger) {
  5540. var self=this;
  5541. return (function($rec){smalltalk.send($rec, "_theClass_", [aClass]);smalltalk.send($rec, "_level_", [anInteger]);smalltalk.send($rec, "_getNodesFrom_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5542. return self;},
  5543. args: ["aClass", "aCollection", "anInteger"],
  5544. source: unescape('on%3A%20aClass%20classes%3A%20aCollection%20level%3A%20anInteger%0A%09%5Eself%20new%0A%09%09theClass%3A%20aClass%3B%0A%09%09level%3A%20anInteger%3B%0A%09%09getNodesFrom%3A%20aCollection%3B%0A%09%09yourself'),
  5545. messageSends: ["theClass:", "level:", "getNodesFrom:", "yourself", "new"],
  5546. referencedClasses: []
  5547. }),
  5548. smalltalk.ClassSorterNode.klass);
  5549. smalltalk.addPackage('Kernel-Methods', {});
  5550. smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel-Methods');
  5551. smalltalk.BlockClosure.comment=unescape('A%20BlockClosure%20is%20a%20lexical%20closure.%0AThe%20JavaScript%20representation%20is%20a%20function.%0A%0AA%20BlockClosure%20is%20evaluated%20with%20the%20%60%23value*%60%20methods%20in%20the%20%27evaluating%27%20protocol.')
  5552. smalltalk.addMethod(
  5553. unescape('_applyTo_arguments_'),
  5554. smalltalk.method({
  5555. selector: unescape('applyTo%3Aarguments%3A'),
  5556. category: 'evaluating',
  5557. fn: function (anObject, aCollection) {
  5558. var self = this;
  5559. return self.apply(anObject, aCollection);
  5560. return self;
  5561. },
  5562. args: ["anObject", "aCollection"],
  5563. source: unescape('applyTo%3A%20anObject%20arguments%3A%20aCollection%0A%09%3Creturn%20self.apply%28anObject%2C%20aCollection%29%3E'),
  5564. messageSends: [],
  5565. referencedClasses: []
  5566. }),
  5567. smalltalk.BlockClosure);
  5568. smalltalk.addMethod(
  5569. unescape('_compiledSource'),
  5570. smalltalk.method({
  5571. selector: unescape('compiledSource'),
  5572. category: 'accessing',
  5573. fn: function () {
  5574. var self = this;
  5575. return self.toString();
  5576. return self;
  5577. },
  5578. args: [],
  5579. source: unescape('compiledSource%0A%09%3Creturn%20self.toString%28%29%3E'),
  5580. messageSends: [],
  5581. referencedClasses: []
  5582. }),
  5583. smalltalk.BlockClosure);
  5584. smalltalk.addMethod(
  5585. unescape('_ensure_'),
  5586. smalltalk.method({
  5587. selector: unescape('ensure%3A'),
  5588. category: 'evaluating',
  5589. fn: function (aBlock) {
  5590. var self = this;
  5591. var success = nil;
  5592. success = false;
  5593. return smalltalk.send(function () {smalltalk.send(self, "_value", []);success = true;return smalltalk.send(aBlock, "_value", []);}, "_on_do_", [smalltalk.Error || Error, function (ex) {($receiver = success).klass === smalltalk.Boolean ? !$receiver ? function () {return smalltalk.send(aBlock, "_value", []);}() : nil : smalltalk.send($receiver, "_ifFalse_", [function () {return smalltalk.send(aBlock, "_value", []);}]);return smalltalk.send(ex, "_signal", []);}]);
  5594. return self;
  5595. },
  5596. args: ["aBlock"],
  5597. source: unescape('ensure%3A%20aBlock%0A%09%7C%20success%20%7C%0A%09success%20%3A%3D%20false.%0A%09%5E%5Bself%20value.%20success%20%3A%3D%20true.%20aBlock%20value%5D%0A%09%09on%3A%20Error%0A%09%09do%3A%20%5B%3Aex%20%7C%0A%09%09%09success%20ifFalse%3A%20%5BaBlock%20value%5D.%0A%09%09%09ex%20signal%5D'),
  5598. messageSends: ["on:do:", "value", "ifFalse:", "signal"],
  5599. referencedClasses: ["Error"]
  5600. }),
  5601. smalltalk.BlockClosure);
  5602. smalltalk.addMethod(
  5603. unescape('_new'),
  5604. smalltalk.method({
  5605. selector: unescape('new'),
  5606. category: 'evaluating',
  5607. fn: function () {
  5608. var self = this;
  5609. return new self;
  5610. return self;
  5611. },
  5612. args: [],
  5613. source: unescape('new%0A%09%22Use%20the%20receiver%20as%20a%20JS%20constructor.%20%0A%09*Do%20not*%20use%20this%20method%20to%20instanciate%20Smalltalk%20objects%21%22%0A%09%3Creturn%20new%20self%28%29%3E'),
  5614. messageSends: [],
  5615. referencedClasses: []
  5616. }),
  5617. smalltalk.BlockClosure);
  5618. smalltalk.addMethod(
  5619. unescape('_newValue_'),
  5620. smalltalk.method({
  5621. selector: unescape('newValue%3A'),
  5622. category: 'evaluating',
  5623. fn: function (anObject) {
  5624. var self = this;
  5625. return new self(anObject);
  5626. return self;
  5627. },
  5628. args: ["anObject"],
  5629. source: unescape('newValue%3A%20anObject%0A%09%22Use%20the%20receiver%20as%20a%20JS%20constructor.%20%0A%09*Do%20not*%20use%20this%20method%20to%20instanciate%20Smalltalk%20objects%21%22%0A%09%3Creturn%20new%20self%28anObject%29%3E'),
  5630. messageSends: [],
  5631. referencedClasses: []
  5632. }),
  5633. smalltalk.BlockClosure);
  5634. smalltalk.addMethod(
  5635. unescape('_newValue_value_'),
  5636. smalltalk.method({
  5637. selector: unescape('newValue%3Avalue%3A'),
  5638. category: 'evaluating',
  5639. fn: function (anObject, anObject2) {
  5640. var self = this;
  5641. return new self(anObject, anObject2);
  5642. return self;
  5643. },
  5644. args: ["anObject", "anObject2"],
  5645. source: unescape('newValue%3A%20%20anObject%20value%3A%20anObject2%0A%09%22Use%20the%20receiver%20as%20a%20JS%20constructor.%20%0A%09*Do%20not*%20use%20this%20method%20to%20instanciate%20Smalltalk%20objects%21%22%0A%09%3Creturn%20new%20self%28anObject%2C%20anObject2%29%3E'),
  5646. messageSends: [],
  5647. referencedClasses: []
  5648. }),
  5649. smalltalk.BlockClosure);
  5650. smalltalk.addMethod(
  5651. unescape('_newValue_value_value_'),
  5652. smalltalk.method({
  5653. selector: unescape('newValue%3Avalue%3Avalue%3A'),
  5654. category: 'evaluating',
  5655. fn: function (anObject, anObject2, anObject3) {
  5656. var self = this;
  5657. return new self(anObject, anObject2);
  5658. return self;
  5659. },
  5660. args: ["anObject", "anObject2", "anObject3"],
  5661. source: unescape('newValue%3A%20%20anObject%20value%3A%20anObject2%20value%3A%20anObject3%0A%09%22Use%20the%20receiver%20as%20a%20JS%20constructor.%20%0A%09*Do%20not*%20use%20this%20method%20to%20instanciate%20Smalltalk%20objects%21%22%0A%09%3Creturn%20new%20self%28anObject%2C%20anObject2%29%3E'),
  5662. messageSends: [],
  5663. referencedClasses: []
  5664. }),
  5665. smalltalk.BlockClosure);
  5666. smalltalk.addMethod(
  5667. unescape('_numArgs'),
  5668. smalltalk.method({
  5669. selector: unescape('numArgs'),
  5670. category: 'accessing',
  5671. fn: function () {
  5672. var self = this;
  5673. return self.length;
  5674. return self;
  5675. },
  5676. args: [],
  5677. source: unescape('numArgs%0A%09%3Creturn%20self.length%3E'),
  5678. messageSends: [],
  5679. referencedClasses: []
  5680. }),
  5681. smalltalk.BlockClosure);
  5682. smalltalk.addMethod(
  5683. unescape('_on_do_'),
  5684. smalltalk.method({
  5685. selector: unescape('on%3Ado%3A'),
  5686. category: 'error handling',
  5687. fn: function (anErrorClass, aBlock) {
  5688. var self = this;
  5689. return smalltalk.send(self, "_try_catch_", [self, function (error) {return ($receiver = smalltalk.send(error, "_isKindOf_", [anErrorClass])).klass === smalltalk.Boolean ? $receiver ? function () {return smalltalk.send(aBlock, "_value_", [error]);}() : function () {return smalltalk.send(error, "_signal", []);}() : smalltalk.send($receiver, "_ifTrue_ifFalse_", [function () {return smalltalk.send(aBlock, "_value_", [error]);}, function () {return smalltalk.send(error, "_signal", []);}]);}]);
  5690. return self;
  5691. },
  5692. args: ["anErrorClass", "aBlock"],
  5693. source: unescape('on%3A%20anErrorClass%20do%3A%20aBlock%0A%09%5Eself%20try%3A%20self%20catch%3A%20%5B%3Aerror%20%7C%0A%09%20%20%20%20%28error%20isKindOf%3A%20anErrorClass%29%20%0A%09%20%20%20%20%20ifTrue%3A%20%5BaBlock%20value%3A%20error%5D%0A%09%20%20%20%20%20ifFalse%3A%20%5Berror%20signal%5D%5D'),
  5694. messageSends: ["try:catch:", "ifTrue:ifFalse:", "isKindOf:", "value:", "signal"],
  5695. referencedClasses: []
  5696. }),
  5697. smalltalk.BlockClosure);
  5698. smalltalk.addMethod(
  5699. unescape('_timeToRun'),
  5700. smalltalk.method({
  5701. selector: unescape('timeToRun'),
  5702. category: 'evaluating',
  5703. fn: function () {
  5704. var self = this;
  5705. return smalltalk.send(smalltalk.Date || Date, "_millisecondsToRun_", [self]);
  5706. return self;
  5707. },
  5708. args: [],
  5709. source: unescape('timeToRun%0A%09%22Answer%20the%20number%20of%20milliseconds%20taken%20to%20execute%20this%20block.%22%0A%0A%09%5E%20Date%20millisecondsToRun%3A%20self'),
  5710. messageSends: ["millisecondsToRun:"],
  5711. referencedClasses: ["Date"]
  5712. }),
  5713. smalltalk.BlockClosure);
  5714. smalltalk.addMethod(
  5715. unescape('_value'),
  5716. smalltalk.method({
  5717. selector: unescape('value'),
  5718. category: 'evaluating',
  5719. fn: function () {
  5720. var self = this;
  5721. return self();
  5722. return self;
  5723. },
  5724. args: [],
  5725. source: unescape('value%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%28%29%3B%3E'),
  5726. messageSends: [],
  5727. referencedClasses: []
  5728. }),
  5729. smalltalk.BlockClosure);
  5730. smalltalk.addMethod(
  5731. unescape('_value_'),
  5732. smalltalk.method({
  5733. selector: unescape('value%3A'),
  5734. category: 'evaluating',
  5735. fn: function (anArg) {
  5736. var self = this;
  5737. return self(anArg);
  5738. return self;
  5739. },
  5740. args: ["anArg"],
  5741. source: unescape('value%3A%20anArg%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%28anArg%29%3B%3E'),
  5742. messageSends: [],
  5743. referencedClasses: []
  5744. }),
  5745. smalltalk.BlockClosure);
  5746. smalltalk.addMethod(
  5747. unescape('_value_value_'),
  5748. smalltalk.method({
  5749. selector: unescape('value%3Avalue%3A'),
  5750. category: 'evaluating',
  5751. fn: function (firstArg, secondArg) {
  5752. var self = this;
  5753. return self(firstArg, secondArg);
  5754. return self;
  5755. },
  5756. args: ["firstArg", "secondArg"],
  5757. source: unescape('value%3A%20firstArg%20value%3A%20secondArg%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%28firstArg%2C%20secondArg%29%3B%3E'),
  5758. messageSends: [],
  5759. referencedClasses: []
  5760. }),
  5761. smalltalk.BlockClosure);
  5762. smalltalk.addMethod(
  5763. unescape('_value_value_value_'),
  5764. smalltalk.method({
  5765. selector: unescape('value%3Avalue%3Avalue%3A'),
  5766. category: 'evaluating',
  5767. fn: function (firstArg, secondArg, thirdArg) {
  5768. var self = this;
  5769. return self(firstArg, secondArg, thirdArg);
  5770. return self;
  5771. },
  5772. args: ["firstArg", "secondArg", "thirdArg"],
  5773. source: unescape('value%3A%20firstArg%20value%3A%20secondArg%20value%3A%20thirdArg%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%28firstArg%2C%20secondArg%2C%20thirdArg%29%3B%3E'),
  5774. messageSends: [],
  5775. referencedClasses: []
  5776. }),
  5777. smalltalk.BlockClosure);
  5778. smalltalk.addMethod(
  5779. unescape('_valueWithInterval_'),
  5780. smalltalk.method({
  5781. selector: unescape('valueWithInterval%3A'),
  5782. category: 'timeout/interval',
  5783. fn: function (aNumber) {
  5784. var self = this;
  5785. return setInterval(self, aNumber);
  5786. return self;
  5787. },
  5788. args: ["aNumber"],
  5789. source: unescape('valueWithInterval%3A%20aNumber%0A%09%3Creturn%20setInterval%28self%2C%20aNumber%29%3E'),
  5790. messageSends: [],
  5791. referencedClasses: []
  5792. }),
  5793. smalltalk.BlockClosure);
  5794. smalltalk.addMethod(
  5795. unescape('_valueWithPossibleArguments_'),
  5796. smalltalk.method({
  5797. selector: unescape('valueWithPossibleArguments%3A'),
  5798. category: 'evaluating',
  5799. fn: function (aCollection) {
  5800. var self = this;
  5801. return self.apply(null, aCollection);
  5802. return self;
  5803. },
  5804. args: ["aCollection"],
  5805. source: unescape('valueWithPossibleArguments%3A%20aCollection%0A%09%3Creturn%20self.apply%28null%2C%20aCollection%29%3B%3E'),
  5806. messageSends: [],
  5807. referencedClasses: []
  5808. }),
  5809. smalltalk.BlockClosure);
  5810. smalltalk.addMethod(
  5811. unescape('_valueWithTimeout_'),
  5812. smalltalk.method({
  5813. selector: unescape('valueWithTimeout%3A'),
  5814. category: 'timeout/interval',
  5815. fn: function (aNumber) {
  5816. var self = this;
  5817. return setTimeout(self, aNumber);
  5818. return self;
  5819. },
  5820. args: ["aNumber"],
  5821. source: unescape('valueWithTimeout%3A%20aNumber%0A%09%3Creturn%20setTimeout%28self%2C%20aNumber%29%3E'),
  5822. messageSends: [],
  5823. referencedClasses: []
  5824. }),
  5825. smalltalk.BlockClosure);
  5826. smalltalk.addMethod(
  5827. unescape('_whileFalse'),
  5828. smalltalk.method({
  5829. selector: unescape('whileFalse'),
  5830. category: 'controlling',
  5831. fn: function () {
  5832. var self = this;
  5833. smalltalk.send(self, "_whileFalse_", [function () {return nil;}]);
  5834. return self;
  5835. },
  5836. args: [],
  5837. source: unescape('whileFalse%0A%09%22inlined%20in%20the%20Compiler%22%0A%09self%20whileFalse%3A%20%5B%5D'),
  5838. messageSends: ["whileFalse:"],
  5839. referencedClasses: []
  5840. }),
  5841. smalltalk.BlockClosure);
  5842. smalltalk.addMethod(
  5843. unescape('_whileFalse_'),
  5844. smalltalk.method({
  5845. selector: unescape('whileFalse%3A'),
  5846. category: 'controlling',
  5847. fn: function (aBlock) {
  5848. var self = this;
  5849. while (!self()) {
  5850. aBlock();
  5851. }
  5852. return self;
  5853. },
  5854. args: ["aBlock"],
  5855. source: unescape('whileFalse%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Cwhile%28%21self%28%29%29%20%7BaBlock%28%29%7D%3E'),
  5856. messageSends: [],
  5857. referencedClasses: []
  5858. }),
  5859. smalltalk.BlockClosure);
  5860. smalltalk.addMethod(
  5861. unescape('_whileTrue'),
  5862. smalltalk.method({
  5863. selector: unescape('whileTrue'),
  5864. category: 'controlling',
  5865. fn: function () {
  5866. var self = this;
  5867. smalltalk.send(self, "_whileTrue_", [function () {return nil;}]);
  5868. return self;
  5869. },
  5870. args: [],
  5871. source: unescape('whileTrue%0A%09%22inlined%20in%20the%20Compiler%22%0A%09self%20whileTrue%3A%20%5B%5D'),
  5872. messageSends: ["whileTrue:"],
  5873. referencedClasses: []
  5874. }),
  5875. smalltalk.BlockClosure);
  5876. smalltalk.addMethod(
  5877. unescape('_whileTrue_'),
  5878. smalltalk.method({
  5879. selector: unescape('whileTrue%3A'),
  5880. category: 'controlling',
  5881. fn: function (aBlock) {
  5882. var self = this;
  5883. while (self()) {
  5884. aBlock();
  5885. }
  5886. return self;
  5887. },
  5888. args: ["aBlock"],
  5889. source: unescape('whileTrue%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Cwhile%28self%28%29%29%20%7BaBlock%28%29%7D%3E'),
  5890. messageSends: [],
  5891. referencedClasses: []
  5892. }),
  5893. smalltalk.BlockClosure);
  5894. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel-Methods');
  5895. smalltalk.CompiledMethod.comment=unescape('CompiledMethod%20hold%20the%20source%20and%20compiled%20code%20of%20a%20class%20method.%0A%0AYou%20can%20get%20a%20CompiledMethod%20using%20%60Behavior%3E%3EmethodAt%3A%60%0A%0A%09String%20methodAt%3A%20%27lines%27%0A%0Aand%20read%20the%20source%20code%0A%0A%09%28String%20methodAt%3A%20%27lines%27%29%20source%0A%0ASee%20referenced%20classes%3A%0A%0A%09%28String%20methodAt%3A%20%27lines%27%29%20referencedClasses%0A%0Aor%20messages%20sent%20from%20this%20method%3A%0A%09%0A%09%28String%20methodAt%3A%20%27lines%27%29%20%20messageSends')
  5896. smalltalk.addMethod(
  5897. unescape('_arguments'),
  5898. smalltalk.method({
  5899. selector: unescape('arguments'),
  5900. category: 'accessing',
  5901. fn: function () {
  5902. var self = this;
  5903. return self.args || [];
  5904. return self;
  5905. },
  5906. args: [],
  5907. source: unescape('arguments%0A%09%3Creturn%20self.args%20%7C%7C%20%5B%5D%3E'),
  5908. messageSends: [],
  5909. referencedClasses: []
  5910. }),
  5911. smalltalk.CompiledMethod);
  5912. smalltalk.addMethod(
  5913. unescape('_category'),
  5914. smalltalk.method({
  5915. selector: unescape('category'),
  5916. category: 'accessing',
  5917. fn: function () {
  5918. var self = this;
  5919. return ($receiver = smalltalk.send(self, "_basicAt_", ["category"])) == nil ||
  5920. $receiver == undefined ? function () {return "";}() : $receiver;
  5921. return self;
  5922. },
  5923. args: [],
  5924. source: unescape('category%0A%09%5E%28self%20basicAt%3A%20%27category%27%29%20ifNil%3A%20%5B%27%27%5D'),
  5925. messageSends: ["ifNil:", "basicAt:"],
  5926. referencedClasses: []
  5927. }),
  5928. smalltalk.CompiledMethod);
  5929. smalltalk.addMethod(
  5930. unescape('_category_'),
  5931. smalltalk.method({
  5932. selector: unescape('category%3A'),
  5933. category: 'accessing',
  5934. fn: function (aString) {
  5935. var self = this;
  5936. smalltalk.send(self, "_basicAt_put_", ["category", aString]);
  5937. return self;
  5938. },
  5939. args: ["aString"],
  5940. source: unescape('category%3A%20aString%0A%09self%20basicAt%3A%20%27category%27%20put%3A%20aString'),
  5941. messageSends: ["basicAt:put:"],
  5942. referencedClasses: []
  5943. }),
  5944. smalltalk.CompiledMethod);
  5945. smalltalk.addMethod(
  5946. unescape('_fn'),
  5947. smalltalk.method({
  5948. selector: unescape('fn'),
  5949. category: 'accessing',
  5950. fn: function () {
  5951. var self = this;
  5952. return smalltalk.send(self, "_basicAt_", ["fn"]);
  5953. return self;
  5954. },
  5955. args: [],
  5956. source: unescape('fn%0A%09%5Eself%20basicAt%3A%20%27fn%27'),
  5957. messageSends: ["basicAt:"],
  5958. referencedClasses: []
  5959. }),
  5960. smalltalk.CompiledMethod);
  5961. smalltalk.addMethod(
  5962. unescape('_fn_'),
  5963. smalltalk.method({
  5964. selector: unescape('fn%3A'),
  5965. category: 'accessing',
  5966. fn: function (aBlock) {
  5967. var self = this;
  5968. smalltalk.send(self, "_basicAt_put_", ["fn", aBlock]);
  5969. return self;
  5970. },
  5971. args: ["aBlock"],
  5972. source: unescape('fn%3A%20aBlock%0A%09self%20basicAt%3A%20%27fn%27%20put%3A%20aBlock'),
  5973. messageSends: ["basicAt:put:"],
  5974. referencedClasses: []
  5975. }),
  5976. smalltalk.CompiledMethod);
  5977. smalltalk.addMethod(
  5978. unescape('_messageSends'),
  5979. smalltalk.method({
  5980. selector: unescape('messageSends'),
  5981. category: 'accessing',
  5982. fn: function () {
  5983. var self = this;
  5984. return smalltalk.send(self, "_basicAt_", ["messageSends"]);
  5985. return self;
  5986. },
  5987. args: [],
  5988. source: unescape('messageSends%0A%09%5Eself%20basicAt%3A%20%27messageSends%27'),
  5989. messageSends: ["basicAt:"],
  5990. referencedClasses: []
  5991. }),
  5992. smalltalk.CompiledMethod);
  5993. smalltalk.addMethod(
  5994. unescape('_methodClass'),
  5995. smalltalk.method({
  5996. selector: unescape('methodClass'),
  5997. category: 'accessing',
  5998. fn: function () {
  5999. var self = this;
  6000. return smalltalk.send(self, "_basicAt_", ["methodClass"]);
  6001. return self;
  6002. },
  6003. args: [],
  6004. source: unescape('methodClass%0A%09%5Eself%20basicAt%3A%20%27methodClass%27'),
  6005. messageSends: ["basicAt:"],
  6006. referencedClasses: []
  6007. }),
  6008. smalltalk.CompiledMethod);
  6009. smalltalk.addMethod(
  6010. unescape('_referencedClasses'),
  6011. smalltalk.method({
  6012. selector: unescape('referencedClasses'),
  6013. category: 'accessing',
  6014. fn: function () {
  6015. var self = this;
  6016. return smalltalk.send(self, "_basicAt_", ["referencedClasses"]);
  6017. return self;
  6018. },
  6019. args: [],
  6020. source: unescape('referencedClasses%0A%09%5Eself%20basicAt%3A%20%27referencedClasses%27'),
  6021. messageSends: ["basicAt:"],
  6022. referencedClasses: []
  6023. }),
  6024. smalltalk.CompiledMethod);
  6025. smalltalk.addMethod(
  6026. unescape('_selector'),
  6027. smalltalk.method({
  6028. selector: unescape('selector'),
  6029. category: 'accessing',
  6030. fn: function () {
  6031. var self = this;
  6032. return smalltalk.send(self, "_basicAt_", ["selector"]);
  6033. return self;
  6034. },
  6035. args: [],
  6036. source: unescape('selector%0A%09%5Eself%20basicAt%3A%20%27selector%27'),
  6037. messageSends: ["basicAt:"],
  6038. referencedClasses: []
  6039. }),
  6040. smalltalk.CompiledMethod);
  6041. smalltalk.addMethod(
  6042. unescape('_selector_'),
  6043. smalltalk.method({
  6044. selector: unescape('selector%3A'),
  6045. category: 'accessing',
  6046. fn: function (aString) {
  6047. var self = this;
  6048. smalltalk.send(self, "_basicAt_put_", ["selector", aString]);
  6049. return self;
  6050. },
  6051. args: ["aString"],
  6052. source: unescape('selector%3A%20aString%0A%09self%20basicAt%3A%20%27selector%27%20put%3A%20aString'),
  6053. messageSends: ["basicAt:put:"],
  6054. referencedClasses: []
  6055. }),
  6056. smalltalk.CompiledMethod);
  6057. smalltalk.addMethod(
  6058. unescape('_source'),
  6059. smalltalk.method({
  6060. selector: unescape('source'),
  6061. category: 'accessing',
  6062. fn: function () {
  6063. var self = this;
  6064. return ($receiver = smalltalk.send(self, "_basicAt_", ["source"])) == nil ||
  6065. $receiver == undefined ? function () {return "";}() : $receiver;
  6066. return self;
  6067. },
  6068. args: [],
  6069. source: unescape('source%0A%09%5E%28self%20basicAt%3A%20%27source%27%29%20ifNil%3A%20%5B%27%27%5D'),
  6070. messageSends: ["ifNil:", "basicAt:"],
  6071. referencedClasses: []
  6072. }),
  6073. smalltalk.CompiledMethod);
  6074. smalltalk.addMethod(
  6075. unescape('_source_'),
  6076. smalltalk.method({
  6077. selector: unescape('source%3A'),
  6078. category: 'accessing',
  6079. fn: function (aString) {
  6080. var self = this;
  6081. smalltalk.send(self, "_basicAt_put_", ["source", aString]);
  6082. return self;
  6083. },
  6084. args: ["aString"],
  6085. source: unescape('source%3A%20aString%0A%09self%20basicAt%3A%20%27source%27%20put%3A%20aString'),
  6086. messageSends: ["basicAt:put:"],
  6087. referencedClasses: []
  6088. }),
  6089. smalltalk.CompiledMethod);
  6090. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel-Methods');
  6091. smalltalk.Message.comment=unescape('Generally%2C%20the%20system%20does%20not%20use%20instances%20of%20Message%20for%20efficiency%20reasons.%0AHowever%2C%20when%20a%20message%20is%20not%20understood%20by%20its%20receiver%2C%20the%20interpreter%20will%20make%20up%20an%20instance%20of%20it%20in%20order%20to%20capture%20the%20information%20involved%20in%20an%20actual%20message%20transmission.%20%0AThis%20instance%20is%20sent%20it%20as%20an%20argument%20with%20the%20message%20%60doesNotUnderstand%3A%60%20to%20the%20receiver.%0A%0ASee%20boot.js%2C%20%60messageNotUnderstood%60%20%20and%20its%20counterpart%20%60Object%3E%3EdoesNotUnderstand%3A%60')
  6092. smalltalk.addMethod(
  6093. unescape('_arguments'),
  6094. smalltalk.method({
  6095. selector: unescape('arguments'),
  6096. category: 'accessing',
  6097. fn: function () {
  6098. var self = this;
  6099. return self['@arguments'];
  6100. return self;
  6101. },
  6102. args: [],
  6103. source: unescape('arguments%0A%09%5Earguments'),
  6104. messageSends: [],
  6105. referencedClasses: []
  6106. }),
  6107. smalltalk.Message);
  6108. smalltalk.addMethod(
  6109. unescape('_arguments_'),
  6110. smalltalk.method({
  6111. selector: unescape('arguments%3A'),
  6112. category: 'accessing',
  6113. fn: function (anArray) {
  6114. var self = this;
  6115. self['@arguments'] = anArray;
  6116. return self;
  6117. },
  6118. args: ["anArray"],
  6119. source: unescape('arguments%3A%20anArray%0A%09arguments%20%3A%3D%20anArray'),
  6120. messageSends: [],
  6121. referencedClasses: []
  6122. }),
  6123. smalltalk.Message);
  6124. smalltalk.addMethod(
  6125. unescape('_printString'),
  6126. smalltalk.method({
  6127. selector: unescape('printString'),
  6128. category: 'printing',
  6129. fn: function () {
  6130. var self = this;
  6131. return smalltalk.send(smalltalk.String || String, "_streamContents_", [function (aStream) {return function ($rec) {smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_printString", [], smalltalk.Object)]);smalltalk.send($rec, "_nextPutAll_", [unescape("%28")]);smalltalk.send($rec, "_nextPutAll_", [self['@selector']]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%29")]);}(aStream);}]);
  6132. return self;
  6133. },
  6134. args: [],
  6135. source: unescape('printString%0A%09%5E%20String%20streamContents%3A%20%5B%3AaStream%7C%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09aStream%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20super%20printString%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20%27%28%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20selector%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20%27%29%27%20%09%09%09%09%5D'),
  6136. messageSends: ["streamContents:", "nextPutAll:", "printString"],
  6137. referencedClasses: ["String"]
  6138. }),
  6139. smalltalk.Message);
  6140. smalltalk.addMethod(
  6141. unescape('_selector'),
  6142. smalltalk.method({
  6143. selector: unescape('selector'),
  6144. category: 'accessing',
  6145. fn: function () {
  6146. var self = this;
  6147. return self['@selector'];
  6148. return self;
  6149. },
  6150. args: [],
  6151. source: unescape('selector%0A%09%5Eselector'),
  6152. messageSends: [],
  6153. referencedClasses: []
  6154. }),
  6155. smalltalk.Message);
  6156. smalltalk.addMethod(
  6157. unescape('_selector_'),
  6158. smalltalk.method({
  6159. selector: unescape('selector%3A'),
  6160. category: 'accessing',
  6161. fn: function (aString) {
  6162. var self = this;
  6163. self['@selector'] = aString;
  6164. return self;
  6165. },
  6166. args: ["aString"],
  6167. source: unescape('selector%3A%20aString%0A%09selector%20%3A%3D%20aString'),
  6168. messageSends: [],
  6169. referencedClasses: []
  6170. }),
  6171. smalltalk.Message);
  6172. smalltalk.addMethod(
  6173. unescape('_sendTo_'),
  6174. smalltalk.method({
  6175. selector: unescape('sendTo%3A'),
  6176. category: 'printing',
  6177. fn: function (anObject) {
  6178. var self = this;
  6179. smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_send_to_arguments_", [smalltalk.send(self, "_selector", []), anObject, smalltalk.send(self, "_arguments", [])]);
  6180. return self;
  6181. },
  6182. args: ["anObject"],
  6183. source: unescape('sendTo%3A%20anObject%0A%09Smalltalk%20current%20send%3A%20self%20selector%20to%3A%20anObject%20arguments%3A%20self%20arguments'),
  6184. messageSends: ["send:to:arguments:", "current", "selector", "arguments"],
  6185. referencedClasses: ["Smalltalk"]
  6186. }),
  6187. smalltalk.Message);
  6188. smalltalk.addMethod(
  6189. unescape('_selector_arguments_'),
  6190. smalltalk.method({
  6191. selector: unescape('selector%3Aarguments%3A'),
  6192. category: 'instance creation',
  6193. fn: function (aString, anArray) {
  6194. var self = this;
  6195. return function ($rec) {smalltalk.send($rec, "_selector_", [aString]);smalltalk.send($rec, "_arguments_", [anArray]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_new", []));
  6196. return self;
  6197. },
  6198. args: ["aString", "anArray"],
  6199. source: unescape('selector%3A%20aString%20arguments%3A%20anArray%0A%09%5Eself%20new%0A%09%09selector%3A%20aString%3B%0A%09%09arguments%3A%20anArray%3B%0A%09%09yourself'),
  6200. messageSends: ["selector:", "arguments:", "yourself", "new"],
  6201. referencedClasses: []
  6202. }),
  6203. smalltalk.Message.klass);
  6204. smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel-Methods');
  6205. smalltalk.MethodContext.comment=unescape('MethodContext%20holds%20all%20the%20dynamic%20state%20associated%20with%20the%20execution%20of%20either%20a%20method%20activation%20resulting%20from%20a%20message%20send.%20That%20is%20used%20to%20build%20the%20call%20stack%20while%20debugging.%0A%20%20%0AMethodContext%20instances%20are%20JavaScript%20%60SmalltalkMethodContext%60%20objects%20defined%20in%20boot.js%20%0A%0ACurrent%20limitation%3A%20MethodContext%20instances%20are%20not%20created%20on%20Block%20evaluation.%20That%20means%20it%27s%20actually%20impossible%20to%20debug%20inside%20a%20Block.')
  6206. smalltalk.addMethod(
  6207. unescape('_asString'),
  6208. smalltalk.method({
  6209. selector: unescape('asString'),
  6210. category: 'accessing',
  6211. fn: function () {
  6212. var self = this;
  6213. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_receiver", []), "_class", []), "_printString", []), "__comma", [unescape("%20%3E%3E%20")]), "__comma", [smalltalk.send(self, "_selector", [])]);
  6214. return self;
  6215. },
  6216. args: [],
  6217. source: unescape('asString%0A%09%5Eself%20receiver%20class%20printString%2C%20%27%20%3E%3E%20%27%2C%20self%20selector'),
  6218. messageSends: [unescape("%2C"), "printString", "class", "receiver", "selector"],
  6219. referencedClasses: []
  6220. }),
  6221. smalltalk.MethodContext);
  6222. smalltalk.addMethod(
  6223. unescape('_home'),
  6224. smalltalk.method({
  6225. selector: unescape('home'),
  6226. category: 'accessing',
  6227. fn: function () {
  6228. var self = this;
  6229. return self.homeContext;
  6230. return self;
  6231. },
  6232. args: [],
  6233. source: unescape('home%0A%09%3Creturn%20self.homeContext%3E'),
  6234. messageSends: [],
  6235. referencedClasses: []
  6236. }),
  6237. smalltalk.MethodContext);
  6238. smalltalk.addMethod(
  6239. unescape('_printString'),
  6240. smalltalk.method({
  6241. selector: unescape('printString'),
  6242. category: 'accessing',
  6243. fn: function () {
  6244. var self = this;
  6245. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.Object), "__comma", [unescape("%28")]), "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", [unescape("%29")]);
  6246. return self;
  6247. },
  6248. args: [],
  6249. source: unescape('printString%0A%09%5Esuper%20printString%2C%20%27%28%27%2C%20self%20asString%2C%20%27%29%27'),
  6250. messageSends: [unescape("%2C"), "printString", "asString"],
  6251. referencedClasses: []
  6252. }),
  6253. smalltalk.MethodContext);
  6254. smalltalk.addMethod(
  6255. unescape('_receiver'),
  6256. smalltalk.method({
  6257. selector: unescape('receiver'),
  6258. category: 'accessing',
  6259. fn: function () {
  6260. var self = this;
  6261. return self.receiver;
  6262. return self;
  6263. },
  6264. args: [],
  6265. source: unescape('receiver%0A%09%3Creturn%20self.receiver%3E'),
  6266. messageSends: [],
  6267. referencedClasses: []
  6268. }),
  6269. smalltalk.MethodContext);
  6270. smalltalk.addMethod(
  6271. unescape('_selector'),
  6272. smalltalk.method({
  6273. selector: unescape('selector'),
  6274. category: 'accessing',
  6275. fn: function () {
  6276. var self = this;
  6277. return smalltalk.convertSelector(self.selector);
  6278. return self;
  6279. },
  6280. args: [],
  6281. source: unescape('selector%0A%09%3Creturn%20smalltalk.convertSelector%28self.selector%29%3E'),
  6282. messageSends: [],
  6283. referencedClasses: []
  6284. }),
  6285. smalltalk.MethodContext);
  6286. smalltalk.addMethod(
  6287. unescape('_temps'),
  6288. smalltalk.method({
  6289. selector: unescape('temps'),
  6290. category: 'accessing',
  6291. fn: function () {
  6292. var self = this;
  6293. return self.temps;
  6294. return self;
  6295. },
  6296. args: [],
  6297. source: unescape('temps%0A%09%3Creturn%20self.temps%3E'),
  6298. messageSends: [],
  6299. referencedClasses: []
  6300. }),
  6301. smalltalk.MethodContext);
  6302. smalltalk.addPackage('Kernel-Collections', {});
  6303. smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel-Collections');
  6304. smalltalk.addMethod(
  6305. "__eq",
  6306. smalltalk.method({
  6307. selector: "=",
  6308. category: 'comparing',
  6309. fn: function (anAssociation) {
  6310. var self=this;
  6311. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(anAssociation, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_key", []), "__eq", [smalltalk.send(anAssociation, "_key", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_value", []), "__eq", [smalltalk.send(anAssociation, "_value", [])]);})]);})]);
  6312. return self;},
  6313. args: ["anAssociation"],
  6314. source: "= anAssociation\x0a\x09^self class = anAssociation class and: [\x0a\x09 self key = anAssociation key and: [\x0a\x09\x09self value = anAssociation value]]",
  6315. messageSends: ["and:", "=", "class", "key", "value"],
  6316. referencedClasses: []
  6317. }),
  6318. smalltalk.Association);
  6319. smalltalk.addMethod(
  6320. "_key",
  6321. smalltalk.method({
  6322. selector: "key",
  6323. category: 'accessing',
  6324. fn: function () {
  6325. var self=this;
  6326. return self['@key'];
  6327. return self;},
  6328. args: [],
  6329. source: "key\x0a\x09^key",
  6330. messageSends: [],
  6331. referencedClasses: []
  6332. }),
  6333. smalltalk.Association);
  6334. smalltalk.addMethod(
  6335. "_key_",
  6336. smalltalk.method({
  6337. selector: "key:",
  6338. category: 'accessing',
  6339. fn: function (aKey) {
  6340. var self=this;
  6341. (self['@key']=aKey);
  6342. return self;},
  6343. args: ["aKey"],
  6344. source: "key: aKey\x0a\x09key := aKey",
  6345. messageSends: [],
  6346. referencedClasses: []
  6347. }),
  6348. smalltalk.Association);
  6349. smalltalk.addMethod(
  6350. "_storeOn_",
  6351. smalltalk.method({
  6352. selector: "storeOn:",
  6353. category: 'comparing',
  6354. fn: function (aStream) {
  6355. var self=this;
  6356. smalltalk.send(self['@key'], "_storeOn_", [aStream]);
  6357. smalltalk.send(aStream, "_nextPutAll_", ["->"]);
  6358. smalltalk.send(self['@value'], "_storeOn_", [aStream]);
  6359. return self;},
  6360. args: ["aStream"],
  6361. source: "storeOn: aStream\x0a\x09\x22Store in the format (key->value)\x22\x0a\x0a\x09\x22aStream nextPutAll: '('.\x22\x0a\x09key storeOn: aStream.\x0a\x09aStream nextPutAll: '->'.\x0a\x09value storeOn: aStream.\x0a\x09\x22aStream nextPutAll: ')'\x22",
  6362. messageSends: ["storeOn:", "nextPutAll:"],
  6363. referencedClasses: []
  6364. }),
  6365. smalltalk.Association);
  6366. smalltalk.addMethod(
  6367. "_value",
  6368. smalltalk.method({
  6369. selector: "value",
  6370. category: 'accessing',
  6371. fn: function () {
  6372. var self=this;
  6373. return self['@value'];
  6374. return self;},
  6375. args: [],
  6376. source: "value\x0a\x09^value",
  6377. messageSends: [],
  6378. referencedClasses: []
  6379. }),
  6380. smalltalk.Association);
  6381. smalltalk.addMethod(
  6382. "_value_",
  6383. smalltalk.method({
  6384. selector: "value:",
  6385. category: 'accessing',
  6386. fn: function (aValue) {
  6387. var self=this;
  6388. (self['@value']=aValue);
  6389. return self;},
  6390. args: ["aValue"],
  6391. source: "value: aValue\x0a\x09value := aValue",
  6392. messageSends: [],
  6393. referencedClasses: []
  6394. }),
  6395. smalltalk.Association);
  6396. smalltalk.addMethod(
  6397. "_key_value_",
  6398. smalltalk.method({
  6399. selector: "key:value:",
  6400. category: 'instance creation',
  6401. fn: function (aKey, aValue) {
  6402. var self=this;
  6403. return (function($rec){smalltalk.send($rec, "_key_", [aKey]);smalltalk.send($rec, "_value_", [aValue]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  6404. return self;},
  6405. args: ["aKey", "aValue"],
  6406. source: "key: aKey value: aValue\x0a\x09 ^self new\x0a\x09\x09key: aKey;\x0a\x09\x09value: aValue;\x0a\x09\x09yourself",
  6407. messageSends: ["key:", "value:", "yourself", "new"],
  6408. referencedClasses: []
  6409. }),
  6410. smalltalk.Association.klass);
  6411. smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel-Collections');
  6412. smalltalk.addMethod(
  6413. "__comma",
  6414. smalltalk.method({
  6415. selector: ",",
  6416. category: 'copying',
  6417. fn: function (aCollection) {
  6418. var self=this;
  6419. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  6420. return self;},
  6421. args: ["aCollection"],
  6422. source: ", aCollection\x0a\x09^self copy \x0a\x09 addAll: aCollection; \x0a\x09 yourself",
  6423. messageSends: ["addAll:", "yourself", "copy"],
  6424. referencedClasses: []
  6425. }),
  6426. smalltalk.Collection);
  6427. smalltalk.addMethod(
  6428. "_add_",
  6429. smalltalk.method({
  6430. selector: "add:",
  6431. category: 'adding/removing',
  6432. fn: function (anObject) {
  6433. var self=this;
  6434. smalltalk.send(self, "_subclassResponsibility", []);
  6435. return self;},
  6436. args: ["anObject"],
  6437. source: "add: anObject\x0a\x09self subclassResponsibility",
  6438. messageSends: ["subclassResponsibility"],
  6439. referencedClasses: []
  6440. }),
  6441. smalltalk.Collection);
  6442. smalltalk.addMethod(
  6443. "_addAll_",
  6444. smalltalk.method({
  6445. selector: "addAll:",
  6446. category: 'adding/removing',
  6447. fn: function (aCollection) {
  6448. var self=this;
  6449. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_add_", [each]);})]);
  6450. return aCollection;
  6451. return self;},
  6452. args: ["aCollection"],
  6453. source: "addAll: aCollection\x0a\x09aCollection do: [:each |\x0a\x09 self add: each].\x0a\x09^aCollection",
  6454. messageSends: ["do:", "add:"],
  6455. referencedClasses: []
  6456. }),
  6457. smalltalk.Collection);
  6458. smalltalk.addMethod(
  6459. "_asArray",
  6460. smalltalk.method({
  6461. selector: "asArray",
  6462. category: 'converting',
  6463. fn: function () {
  6464. var self=this;
  6465. return smalltalk.send((smalltalk.Array || Array), "_withAll_", [self]);
  6466. return self;},
  6467. args: [],
  6468. source: "asArray\x0a\x09^Array withAll: self",
  6469. messageSends: ["withAll:"],
  6470. referencedClasses: ["Array"]
  6471. }),
  6472. smalltalk.Collection);
  6473. smalltalk.addMethod(
  6474. "_asJSON",
  6475. smalltalk.method({
  6476. selector: "asJSON",
  6477. category: 'converting',
  6478. fn: function () {
  6479. var self=this;
  6480. return smalltalk.send(smalltalk.send(self, "_asArray", []), "_collect_", [(function(each){return smalltalk.send(each, "_asJSON", []);})]);
  6481. return self;},
  6482. args: [],
  6483. source: "asJSON\x0a\x09^self asArray collect: [:each | each asJSON]",
  6484. messageSends: ["collect:", "asArray", "asJSON"],
  6485. referencedClasses: []
  6486. }),
  6487. smalltalk.Collection);
  6488. smalltalk.addMethod(
  6489. "_asOrderedCollection",
  6490. smalltalk.method({
  6491. selector: "asOrderedCollection",
  6492. category: 'converting',
  6493. fn: function () {
  6494. var self=this;
  6495. return smalltalk.send(self, "_asArray", []);
  6496. return self;},
  6497. args: [],
  6498. source: "asOrderedCollection\x0a\x09^self asArray",
  6499. messageSends: ["asArray"],
  6500. referencedClasses: []
  6501. }),
  6502. smalltalk.Collection);
  6503. smalltalk.addMethod(
  6504. "_asSet",
  6505. smalltalk.method({
  6506. selector: "asSet",
  6507. category: 'converting',
  6508. fn: function () {
  6509. var self=this;
  6510. return smalltalk.send((smalltalk.Set || Set), "_withAll_", [self]);
  6511. return self;},
  6512. args: [],
  6513. source: "asSet\x0a\x09^Set withAll: self",
  6514. messageSends: ["withAll:"],
  6515. referencedClasses: ["Set"]
  6516. }),
  6517. smalltalk.Collection);
  6518. smalltalk.addMethod(
  6519. "_collect_",
  6520. smalltalk.method({
  6521. selector: "collect:",
  6522. category: 'enumerating',
  6523. fn: function (aBlock) {
  6524. var self=this;
  6525. var newCollection=nil;
  6526. (newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  6527. smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(aBlock, "_value_", [each])]);})]);
  6528. return newCollection;
  6529. return self;},
  6530. args: ["aBlock"],
  6531. source: "collect: aBlock\x0a\x09| newCollection |\x0a\x09newCollection := self class new.\x0a\x09self do: [:each |\x0a\x09 newCollection add: (aBlock value: each)].\x0a\x09^newCollection",
  6532. messageSends: ["new", "class", "do:", "add:", "value:"],
  6533. referencedClasses: []
  6534. }),
  6535. smalltalk.Collection);
  6536. smalltalk.addMethod(
  6537. "_copyWith_",
  6538. smalltalk.method({
  6539. selector: "copyWith:",
  6540. category: 'copying',
  6541. fn: function (anObject) {
  6542. var self=this;
  6543. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  6544. return self;},
  6545. args: ["anObject"],
  6546. source: "copyWith: anObject\x0a\x09^self copy add: anObject; yourself",
  6547. messageSends: ["add:", "yourself", "copy"],
  6548. referencedClasses: []
  6549. }),
  6550. smalltalk.Collection);
  6551. smalltalk.addMethod(
  6552. "_copyWithAll_",
  6553. smalltalk.method({
  6554. selector: "copyWithAll:",
  6555. category: 'copying',
  6556. fn: function (aCollection) {
  6557. var self=this;
  6558. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
  6559. return self;},
  6560. args: ["aCollection"],
  6561. source: "copyWithAll: aCollection\x0a\x09^self copy addAll: aCollection; yourself",
  6562. messageSends: ["addAll:", "yourself", "copy"],
  6563. referencedClasses: []
  6564. }),
  6565. smalltalk.Collection);
  6566. smalltalk.addMethod(
  6567. "_copyWithoutAll_",
  6568. smalltalk.method({
  6569. selector: "copyWithoutAll:",
  6570. category: 'copying',
  6571. fn: function (aCollection) {
  6572. var self=this;
  6573. return smalltalk.send(self, "_reject_", [(function(each){return smalltalk.send(aCollection, "_includes_", [each]);})]);
  6574. return self;},
  6575. args: ["aCollection"],
  6576. source: "copyWithoutAll: aCollection\x0a\x09\x22Answer a copy of the receiver that does not contain any elements \x0a\x09equal to those in aCollection.\x22\x0a\x0a\x09^ self reject: [:each | aCollection includes: each]",
  6577. messageSends: ["reject:", "includes:"],
  6578. referencedClasses: []
  6579. }),
  6580. smalltalk.Collection);
  6581. smalltalk.addMethod(
  6582. "_detect_",
  6583. smalltalk.method({
  6584. selector: "detect:",
  6585. category: 'enumerating',
  6586. fn: function (aBlock) {
  6587. var self=this;
  6588. return smalltalk.send(self, "_detect_ifNone_", [aBlock, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  6589. return self;},
  6590. args: ["aBlock"],
  6591. source: "detect: aBlock\x0a\x09^self detect: aBlock ifNone: [self errorNotFound]",
  6592. messageSends: ["detect:ifNone:", "errorNotFound"],
  6593. referencedClasses: []
  6594. }),
  6595. smalltalk.Collection);
  6596. smalltalk.addMethod(
  6597. "_detect_ifNone_",
  6598. smalltalk.method({
  6599. selector: "detect:ifNone:",
  6600. category: 'enumerating',
  6601. fn: function (aBlock, anotherBlock) {
  6602. var self=this;
  6603. for(var i = 0; i < self.length; i++)
  6604. if(aBlock(self[i]))
  6605. return self[i];
  6606. return anotherBlock();
  6607. ;
  6608. return self;},
  6609. args: ["aBlock", "anotherBlock"],
  6610. source: "detect: aBlock ifNone: anotherBlock\x0a\x09<\x0a\x09\x09for(var i = 0; i < self.length; i++)\x0a\x09\x09\x09if(aBlock(self[i]))\x0a\x09\x09\x09\x09return self[i];\x0a\x09\x09return anotherBlock();\x0a\x09>",
  6611. messageSends: [],
  6612. referencedClasses: []
  6613. }),
  6614. smalltalk.Collection);
  6615. smalltalk.addMethod(
  6616. "_do_",
  6617. smalltalk.method({
  6618. selector: "do:",
  6619. category: 'enumerating',
  6620. fn: function (aBlock) {
  6621. var self=this;
  6622. for(var i=0;i<self.length;i++){aBlock(self[i]);};
  6623. return self;},
  6624. args: ["aBlock"],
  6625. source: "do: aBlock\x0a\x09<for(var i=0;i<self.length;i++){aBlock(self[i]);}>",
  6626. messageSends: [],
  6627. referencedClasses: []
  6628. }),
  6629. smalltalk.Collection);
  6630. smalltalk.addMethod(
  6631. "_do_separatedBy_",
  6632. smalltalk.method({
  6633. selector: "do:separatedBy:",
  6634. category: 'enumerating',
  6635. fn: function (aBlock, anotherBlock) {
  6636. var self=this;
  6637. var first=nil;
  6638. (first=true);
  6639. smalltalk.send(self, "_do_", [(function(each){((($receiver = first).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (first=false);})() : (function(){return smalltalk.send(anotherBlock, "_value", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (first=false);}), (function(){return smalltalk.send(anotherBlock, "_value", []);})]));return smalltalk.send(aBlock, "_value_", [each]);})]);
  6640. return self;},
  6641. args: ["aBlock", "anotherBlock"],
  6642. source: "do: aBlock separatedBy: anotherBlock\x0a\x09| first |\x0a\x09first := true.\x0a\x09self do: [:each |\x0a\x09 first\x0a\x09\x09ifTrue: [first := false]\x0a\x09\x09ifFalse: [anotherBlock value].\x0a\x09 aBlock value: each]",
  6643. messageSends: ["do:", "ifTrue:ifFalse:", "value", "value:"],
  6644. referencedClasses: []
  6645. }),
  6646. smalltalk.Collection);
  6647. smalltalk.addMethod(
  6648. "_errorNotFound",
  6649. smalltalk.method({
  6650. selector: "errorNotFound",
  6651. category: 'error handling',
  6652. fn: function () {
  6653. var self=this;
  6654. smalltalk.send(self, "_error_", ["Object is not in the collection"]);
  6655. return self;},
  6656. args: [],
  6657. source: "errorNotFound\x0a\x09self error: 'Object is not in the collection'",
  6658. messageSends: ["error:"],
  6659. referencedClasses: []
  6660. }),
  6661. smalltalk.Collection);
  6662. smalltalk.addMethod(
  6663. "_ifEmpty_",
  6664. smalltalk.method({
  6665. selector: "ifEmpty:",
  6666. category: 'testing',
  6667. fn: function (aBlock) {
  6668. var self=this;
  6669. return ((($receiver = smalltalk.send(self, "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(aBlock, "_value", []);})() : (function(){return self;})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aBlock, "_value", []);}), (function(){return self;})]));
  6670. return self;},
  6671. args: ["aBlock"],
  6672. source: "ifEmpty: aBlock\x0a\x09\x22Evaluate the given block with the receiver as argument, answering its value if the receiver is empty, otherwise answer the receiver. Note that the fact that this method returns its argument in case the receiver is not empty allows one to write expressions like the following ones: self classifyMethodAs: \x0a\x09\x09(myProtocol ifEmpty: ['As yet unclassified'])\x22\x0a\x09^ self isEmpty \x0a\x09\x09ifTrue: [ aBlock value ]\x0a\x09\x09ifFalse: [ self ]",
  6673. messageSends: ["ifTrue:ifFalse:", "isEmpty", "value"],
  6674. referencedClasses: []
  6675. }),
  6676. smalltalk.Collection);
  6677. smalltalk.addMethod(
  6678. "_ifNotEmpty_",
  6679. smalltalk.method({
  6680. selector: "ifNotEmpty:",
  6681. category: 'testing',
  6682. fn: function (aBlock) {
  6683. var self=this;
  6684. smalltalk.send(smalltalk.send(self, "_notEmpty", []), "_ifTrue_", [aBlock]);
  6685. return self;},
  6686. args: ["aBlock"],
  6687. source: "ifNotEmpty: aBlock\x0a\x09self notEmpty ifTrue: aBlock.",
  6688. messageSends: ["ifTrue:", "notEmpty"],
  6689. referencedClasses: []
  6690. }),
  6691. smalltalk.Collection);
  6692. smalltalk.addMethod(
  6693. "_includes_",
  6694. smalltalk.method({
  6695. selector: "includes:",
  6696. category: 'testing',
  6697. fn: function (anObject) {
  6698. var self=this;
  6699. var i = self.length;
  6700. while (i--) {
  6701. if (smalltalk.send(self[i], "__eq", [anObject])) {return true;}
  6702. }
  6703. return false
  6704. ;
  6705. return self;},
  6706. args: ["anObject"],
  6707. source: "includes: anObject\x0a\x09<\x0a\x09\x09var i = self.length;\x0a\x09\x09while (i--) {\x0a\x09\x09\x09if (smalltalk.send(self[i], \x22__eq\x22, [anObject])) {return true;}\x09\x0a\x09\x09}\x0a\x09\x09return false\x0a\x09>",
  6708. messageSends: [],
  6709. referencedClasses: []
  6710. }),
  6711. smalltalk.Collection);
  6712. smalltalk.addMethod(
  6713. "_inject_into_",
  6714. smalltalk.method({
  6715. selector: "inject:into:",
  6716. category: 'enumerating',
  6717. fn: function (anObject, aBlock) {
  6718. var self=this;
  6719. var result=nil;
  6720. (result=anObject);
  6721. smalltalk.send(self, "_do_", [(function(each){return (result=smalltalk.send(aBlock, "_value_value_", [result, each]));})]);
  6722. return result;
  6723. return self;},
  6724. args: ["anObject", "aBlock"],
  6725. source: "inject: anObject into: aBlock\x0a\x09| result |\x0a\x09result := anObject.\x0a\x09self do: [:each | \x0a\x09 result := aBlock value: result value: each].\x0a\x09^result",
  6726. messageSends: ["do:", "value:value:"],
  6727. referencedClasses: []
  6728. }),
  6729. smalltalk.Collection);
  6730. smalltalk.addMethod(
  6731. "_isEmpty",
  6732. smalltalk.method({
  6733. selector: "isEmpty",
  6734. category: 'testing',
  6735. fn: function () {
  6736. var self=this;
  6737. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  6738. return self;},
  6739. args: [],
  6740. source: "isEmpty\x0a\x09^self size = 0",
  6741. messageSends: ["=", "size"],
  6742. referencedClasses: []
  6743. }),
  6744. smalltalk.Collection);
  6745. smalltalk.addMethod(
  6746. "_notEmpty",
  6747. smalltalk.method({
  6748. selector: "notEmpty",
  6749. category: 'testing',
  6750. fn: function () {
  6751. var self=this;
  6752. return smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_not", []);
  6753. return self;},
  6754. args: [],
  6755. source: "notEmpty\x0a\x09^self isEmpty not",
  6756. messageSends: ["not", "isEmpty"],
  6757. referencedClasses: []
  6758. }),
  6759. smalltalk.Collection);
  6760. smalltalk.addMethod(
  6761. "_readStream",
  6762. smalltalk.method({
  6763. selector: "readStream",
  6764. category: 'accessing',
  6765. fn: function () {
  6766. var self=this;
  6767. return smalltalk.send(self, "_stream", []);
  6768. return self;},
  6769. args: [],
  6770. source: "readStream\x0a\x09^self stream",
  6771. messageSends: ["stream"],
  6772. referencedClasses: []
  6773. }),
  6774. smalltalk.Collection);
  6775. smalltalk.addMethod(
  6776. "_reject_",
  6777. smalltalk.method({
  6778. selector: "reject:",
  6779. category: 'enumerating',
  6780. fn: function (aBlock) {
  6781. var self=this;
  6782. return smalltalk.send(self, "_select_", [(function(each){return smalltalk.send(smalltalk.send(aBlock, "_value_", [each]), "__eq", [false]);})]);
  6783. return self;},
  6784. args: ["aBlock"],
  6785. source: "reject: aBlock\x0a\x09^self select: [:each | (aBlock value: each) = false]",
  6786. messageSends: ["select:", "=", "value:"],
  6787. referencedClasses: []
  6788. }),
  6789. smalltalk.Collection);
  6790. smalltalk.addMethod(
  6791. "_remove_",
  6792. smalltalk.method({
  6793. selector: "remove:",
  6794. category: 'adding/removing',
  6795. fn: function (anObject) {
  6796. var self=this;
  6797. return smalltalk.send(self, "_remove_ifAbsent_", [anObject, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  6798. return self;},
  6799. args: ["anObject"],
  6800. source: "remove: anObject\x0a ^self remove: anObject ifAbsent: [self errorNotFound]",
  6801. messageSends: ["remove:ifAbsent:", "errorNotFound"],
  6802. referencedClasses: []
  6803. }),
  6804. smalltalk.Collection);
  6805. smalltalk.addMethod(
  6806. "_remove_ifAbsent_",
  6807. smalltalk.method({
  6808. selector: "remove:ifAbsent:",
  6809. category: 'adding/removing',
  6810. fn: function (anObject, aBlock) {
  6811. var self=this;
  6812. smalltalk.send(self, "_subclassResponsibility", []);
  6813. return self;},
  6814. args: ["anObject", "aBlock"],
  6815. source: "remove: anObject ifAbsent: aBlock\x0a self subclassResponsibility",
  6816. messageSends: ["subclassResponsibility"],
  6817. referencedClasses: []
  6818. }),
  6819. smalltalk.Collection);
  6820. smalltalk.addMethod(
  6821. "_select_",
  6822. smalltalk.method({
  6823. selector: "select:",
  6824. category: 'enumerating',
  6825. fn: function (aBlock) {
  6826. var self=this;
  6827. var stream=nil;
  6828. (stream=smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_new", []), "_writeStream", []));
  6829. smalltalk.send(self, "_do_", [(function(each){return ((($receiver = smalltalk.send(aBlock, "_value_", [each])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(stream, "_nextPut_", [each]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(stream, "_nextPut_", [each]);})]));})]);
  6830. return smalltalk.send(stream, "_contents", []);
  6831. return self;},
  6832. args: ["aBlock"],
  6833. source: "select: aBlock\x0a\x09| stream |\x0a\x09stream := self class new writeStream.\x0a\x09self do: [:each |\x0a\x09 (aBlock value: each) ifTrue: [\x0a\x09\x09stream nextPut: each]].\x0a\x09^stream contents",
  6834. messageSends: ["writeStream", "new", "class", "do:", "ifTrue:", "value:", "nextPut:", "contents"],
  6835. referencedClasses: []
  6836. }),
  6837. smalltalk.Collection);
  6838. smalltalk.addMethod(
  6839. "_size",
  6840. smalltalk.method({
  6841. selector: "size",
  6842. category: 'accessing',
  6843. fn: function () {
  6844. var self=this;
  6845. smalltalk.send(self, "_subclassResponsibility", []);
  6846. return self;},
  6847. args: [],
  6848. source: "size\x0a\x09self subclassResponsibility",
  6849. messageSends: ["subclassResponsibility"],
  6850. referencedClasses: []
  6851. }),
  6852. smalltalk.Collection);
  6853. smalltalk.addMethod(
  6854. "_stream",
  6855. smalltalk.method({
  6856. selector: "stream",
  6857. category: 'accessing',
  6858. fn: function () {
  6859. var self=this;
  6860. return smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [self]);
  6861. return self;},
  6862. args: [],
  6863. source: "stream\x0a\x09^self streamClass on: self",
  6864. messageSends: ["on:", "streamClass"],
  6865. referencedClasses: []
  6866. }),
  6867. smalltalk.Collection);
  6868. smalltalk.addMethod(
  6869. "_streamClass",
  6870. smalltalk.method({
  6871. selector: "streamClass",
  6872. category: 'accessing',
  6873. fn: function () {
  6874. var self=this;
  6875. return smalltalk.send(smalltalk.send(self, "_class", []), "_streamClass", []);
  6876. return self;},
  6877. args: [],
  6878. source: "streamClass\x0a\x09^self class streamClass",
  6879. messageSends: ["streamClass", "class"],
  6880. referencedClasses: []
  6881. }),
  6882. smalltalk.Collection);
  6883. smalltalk.addMethod(
  6884. "_writeStream",
  6885. smalltalk.method({
  6886. selector: "writeStream",
  6887. category: 'accessing',
  6888. fn: function () {
  6889. var self=this;
  6890. return smalltalk.send(self, "_stream", []);
  6891. return self;},
  6892. args: [],
  6893. source: "writeStream\x0a\x09^self stream",
  6894. messageSends: ["stream"],
  6895. referencedClasses: []
  6896. }),
  6897. smalltalk.Collection);
  6898. smalltalk.addMethod(
  6899. "_new_",
  6900. smalltalk.method({
  6901. selector: "new:",
  6902. category: 'instance creation',
  6903. fn: function (anInteger) {
  6904. var self=this;
  6905. return smalltalk.send(self, "_new", []);
  6906. return self;},
  6907. args: ["anInteger"],
  6908. source: "new: anInteger\x0a\x09^self new",
  6909. messageSends: ["new"],
  6910. referencedClasses: []
  6911. }),
  6912. smalltalk.Collection.klass);
  6913. smalltalk.addMethod(
  6914. "_streamClass",
  6915. smalltalk.method({
  6916. selector: "streamClass",
  6917. category: 'accessing',
  6918. fn: function () {
  6919. var self=this;
  6920. return (smalltalk.Stream || Stream);
  6921. return self;},
  6922. args: [],
  6923. source: "streamClass\x0a\x09 ^Stream",
  6924. messageSends: [],
  6925. referencedClasses: ["Stream"]
  6926. }),
  6927. smalltalk.Collection.klass);
  6928. smalltalk.addMethod(
  6929. "_with_",
  6930. smalltalk.method({
  6931. selector: "with:",
  6932. category: 'instance creation',
  6933. fn: function (anObject) {
  6934. var self=this;
  6935. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  6936. return self;},
  6937. args: ["anObject"],
  6938. source: "with: anObject\x0a\x09 ^self new\x0a\x09\x09add: anObject;\x0a\x09\x09yourself",
  6939. messageSends: ["add:", "yourself", "new"],
  6940. referencedClasses: []
  6941. }),
  6942. smalltalk.Collection.klass);
  6943. smalltalk.addMethod(
  6944. "_with_with_",
  6945. smalltalk.method({
  6946. selector: "with:with:",
  6947. category: 'instance creation',
  6948. fn: function (anObject, anotherObject) {
  6949. var self=this;
  6950. return (function($rec){smalltalk.send($rec, "_add_", [anObject]);smalltalk.send($rec, "_add_", [anotherObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  6951. return self;},
  6952. args: ["anObject", "anotherObject"],
  6953. source: "with: anObject with: anotherObject\x0a\x09 ^self new\x0a\x09\x09add: anObject;\x0a\x09\x09add: anotherObject;\x0a\x09\x09yourself",
  6954. messageSends: ["add:", "yourself", "new"],
  6955. referencedClasses: []
  6956. }),
  6957. smalltalk.Collection.klass);
  6958. smalltalk.addMethod(
  6959. "_with_with_with_",
  6960. smalltalk.method({
  6961. selector: "with:with:with:",
  6962. category: 'instance creation',
  6963. fn: function (firstObject, secondObject, thirdObject) {
  6964. var self=this;
  6965. return (function($rec){smalltalk.send($rec, "_add_", [firstObject]);smalltalk.send($rec, "_add_", [secondObject]);smalltalk.send($rec, "_add_", [thirdObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  6966. return self;},
  6967. args: ["firstObject", "secondObject", "thirdObject"],
  6968. source: "with: firstObject with: secondObject with: thirdObject\x0a\x09 ^self new\x0a\x09\x09add: firstObject;\x0a\x09\x09add: secondObject;\x0a\x09\x09add: thirdObject;\x0a\x09\x09yourself",
  6969. messageSends: ["add:", "yourself", "new"],
  6970. referencedClasses: []
  6971. }),
  6972. smalltalk.Collection.klass);
  6973. smalltalk.addMethod(
  6974. "_withAll_",
  6975. smalltalk.method({
  6976. selector: "withAll:",
  6977. category: 'instance creation',
  6978. fn: function (aCollection) {
  6979. var self=this;
  6980. return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  6981. return self;},
  6982. args: ["aCollection"],
  6983. source: "withAll: aCollection\x0a\x09 ^self new\x0a\x09\x09addAll: aCollection;\x0a\x09\x09yourself",
  6984. messageSends: ["addAll:", "yourself", "new"],
  6985. referencedClasses: []
  6986. }),
  6987. smalltalk.Collection.klass);
  6988. smalltalk.addClass('HashedCollection', smalltalk.Collection, [], 'Kernel-Collections');
  6989. smalltalk.HashedCollection.comment="A HashedCollection is a traditional JavaScript object, or a Smalltalk Dictionary.\x0a\x0aUnlike a Dictionary, it can only have strings as keys."
  6990. smalltalk.addMethod(
  6991. "__comma",
  6992. smalltalk.method({
  6993. selector: ",",
  6994. category: 'copying',
  6995. fn: function (aCollection) {
  6996. var self=this;
  6997. smalltalk.send(self, "_shouldNotImplement", []);
  6998. return self;},
  6999. args: ["aCollection"],
  7000. source: ", aCollection\x0a\x09self shouldNotImplement",
  7001. messageSends: ["shouldNotImplement"],
  7002. referencedClasses: []
  7003. }),
  7004. smalltalk.HashedCollection);
  7005. smalltalk.addMethod(
  7006. "__eq",
  7007. smalltalk.method({
  7008. selector: "=",
  7009. category: 'comparing',
  7010. fn: function (aHashedCollection) {
  7011. var self=this;
  7012. var $early={};
  7013. try{((($receiver = smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aHashedCollection, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw $early=function(){return false}})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw $early=function(){return false}})();})]));
  7014. ((($receiver = smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [smalltalk.send(aHashedCollection, "_size", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw $early=function(){return false}})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw $early=function(){return false}})();})]));
  7015. return smalltalk.send(smalltalk.send(self, "_associations", []), "__eq", [smalltalk.send(aHashedCollection, "_associations", [])]);
  7016. return self;
  7017. } catch(e) {if(e===$early)return e(); throw e}},
  7018. args: ["aHashedCollection"],
  7019. source: "= aHashedCollection\x0a\x09self class = aHashedCollection class ifFalse: [^false].\x0a\x09self size = aHashedCollection size ifFalse: [^false].\x0a\x09^self associations = aHashedCollection associations",
  7020. messageSends: ["ifFalse:", "=", "class", "size", "associations"],
  7021. referencedClasses: []
  7022. }),
  7023. smalltalk.HashedCollection);
  7024. smalltalk.addMethod(
  7025. "_add_",
  7026. smalltalk.method({
  7027. selector: "add:",
  7028. category: 'adding/removing',
  7029. fn: function (anAssociation) {
  7030. var self=this;
  7031. smalltalk.send(self, "_at_put_", [smalltalk.send(anAssociation, "_key", []), smalltalk.send(anAssociation, "_value", [])]);
  7032. return self;},
  7033. args: ["anAssociation"],
  7034. source: "add: anAssociation\x0a\x09self at: anAssociation key put: anAssociation value",
  7035. messageSends: ["at:put:", "key", "value"],
  7036. referencedClasses: []
  7037. }),
  7038. smalltalk.HashedCollection);
  7039. smalltalk.addMethod(
  7040. "_addAll_",
  7041. smalltalk.method({
  7042. selector: "addAll:",
  7043. category: 'adding/removing',
  7044. fn: function (aHashedCollection) {
  7045. var self=this;
  7046. smalltalk.send(self, "_addAll_", [smalltalk.send(aHashedCollection, "_associations", [])], smalltalk.Collection);
  7047. return aHashedCollection;
  7048. return self;},
  7049. args: ["aHashedCollection"],
  7050. source: "addAll: aHashedCollection\x0a\x09super addAll: aHashedCollection associations.\x0a\x09^aHashedCollection",
  7051. messageSends: ["addAll:", "associations"],
  7052. referencedClasses: []
  7053. }),
  7054. smalltalk.HashedCollection);
  7055. smalltalk.addMethod(
  7056. "_asDictionary",
  7057. smalltalk.method({
  7058. selector: "asDictionary",
  7059. category: 'converting',
  7060. fn: function () {
  7061. var self=this;
  7062. return smalltalk.send((smalltalk.Dictionary || Dictionary), "_fromPairs_", [smalltalk.send(self, "_associations", [])]);
  7063. return self;},
  7064. args: [],
  7065. source: "asDictionary\x0a\x09^Dictionary fromPairs: self associations",
  7066. messageSends: ["fromPairs:", "associations"],
  7067. referencedClasses: ["Dictionary"]
  7068. }),
  7069. smalltalk.HashedCollection);
  7070. smalltalk.addMethod(
  7071. "_asJSON",
  7072. smalltalk.method({
  7073. selector: "asJSON",
  7074. category: 'converting',
  7075. fn: function () {
  7076. var self=this;
  7077. var c=nil;
  7078. (c=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  7079. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(c, "_at_put_", [key, smalltalk.send(value, "_asJSON", [])]);})]);
  7080. return c;
  7081. return self;},
  7082. args: [],
  7083. source: "asJSON\x0a\x09| c |\x0a\x09c := self class new.\x0a\x09self keysAndValuesDo: [:key :value |\x0a\x09\x09c at: key put: value asJSON].\x0a\x09^c",
  7084. messageSends: ["new", "class", "keysAndValuesDo:", "at:put:", "asJSON"],
  7085. referencedClasses: []
  7086. }),
  7087. smalltalk.HashedCollection);
  7088. smalltalk.addMethod(
  7089. "_associations",
  7090. smalltalk.method({
  7091. selector: "associations",
  7092. category: 'accessing',
  7093. fn: function () {
  7094. var self=this;
  7095. var associations=nil;
  7096. (associations=[]);
  7097. smalltalk.send(smalltalk.send(self, "_keys", []), "_do_", [(function(each){return smalltalk.send(associations, "_add_", [smalltalk.send((smalltalk.Association || Association), "_key_value_", [each, smalltalk.send(self, "_at_", [each])])]);})]);
  7098. return associations;
  7099. return self;},
  7100. args: [],
  7101. source: "associations\x0a\x09| associations |\x0a\x09associations := #().\x0a\x09self keys do: [:each |\x0a\x09 associations add: (Association key: each value: (self at: each))].\x0a\x09^associations",
  7102. messageSends: ["do:", "keys", "add:", "key:value:", "at:"],
  7103. referencedClasses: ["Association"]
  7104. }),
  7105. smalltalk.HashedCollection);
  7106. smalltalk.addMethod(
  7107. "_associationsDo_",
  7108. smalltalk.method({
  7109. selector: "associationsDo:",
  7110. category: 'enumerating',
  7111. fn: function (aBlock) {
  7112. var self=this;
  7113. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_", [aBlock]);
  7114. return self;},
  7115. args: ["aBlock"],
  7116. source: "associationsDo: aBlock\x0a\x09self associations do: aBlock",
  7117. messageSends: ["do:", "associations"],
  7118. referencedClasses: []
  7119. }),
  7120. smalltalk.HashedCollection);
  7121. smalltalk.addMethod(
  7122. "_at_",
  7123. smalltalk.method({
  7124. selector: "at:",
  7125. category: 'accessing',
  7126. fn: function (aKey) {
  7127. var self=this;
  7128. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  7129. return self;},
  7130. args: ["aKey"],
  7131. source: "at: aKey\x0a\x09^self at: aKey ifAbsent: [self errorNotFound]",
  7132. messageSends: ["at:ifAbsent:", "errorNotFound"],
  7133. referencedClasses: []
  7134. }),
  7135. smalltalk.HashedCollection);
  7136. smalltalk.addMethod(
  7137. "_at_ifAbsent_",
  7138. smalltalk.method({
  7139. selector: "at:ifAbsent:",
  7140. category: 'accessing',
  7141. fn: function (aKey, aBlock) {
  7142. var self=this;
  7143. return smalltalk.send(smalltalk.send(self, "_includesKey_", [aKey]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_basicAt_", [aKey]);}), aBlock]);
  7144. return self;},
  7145. args: ["aKey", "aBlock"],
  7146. source: "at: aKey ifAbsent: aBlock\x0a\x09^(self includesKey: aKey)\x0a\x09\x09ifTrue: [self basicAt: aKey]\x0a\x09\x09ifFalse: aBlock",
  7147. messageSends: ["ifTrue:ifFalse:", "includesKey:", "basicAt:"],
  7148. referencedClasses: []
  7149. }),
  7150. smalltalk.HashedCollection);
  7151. smalltalk.addMethod(
  7152. "_at_ifAbsentPut_",
  7153. smalltalk.method({
  7154. selector: "at:ifAbsentPut:",
  7155. category: 'accessing',
  7156. fn: function (aKey, aBlock) {
  7157. var self=this;
  7158. return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_at_put_", [aKey, smalltalk.send(aBlock, "_value", [])]);})]);
  7159. return self;},
  7160. args: ["aKey", "aBlock"],
  7161. source: "at: aKey ifAbsentPut: aBlock\x0a\x09^self at: aKey ifAbsent: [\x0a\x09 self at: aKey put: aBlock value]",
  7162. messageSends: ["at:ifAbsent:", "at:put:", "value"],
  7163. referencedClasses: []
  7164. }),
  7165. smalltalk.HashedCollection);
  7166. smalltalk.addMethod(
  7167. "_at_ifPresent_",
  7168. smalltalk.method({
  7169. selector: "at:ifPresent:",
  7170. category: 'accessing',
  7171. fn: function (aKey, aBlock) {
  7172. var self=this;
  7173. return (($receiver = smalltalk.send(self, "_basicAt_", [aKey])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})() : nil;
  7174. return self;},
  7175. args: ["aKey", "aBlock"],
  7176. source: "at: aKey ifPresent: aBlock\x0a\x09^(self basicAt: aKey) ifNotNil: [aBlock value: (self at: aKey)]",
  7177. messageSends: ["ifNotNil:", "basicAt:", "value:", "at:"],
  7178. referencedClasses: []
  7179. }),
  7180. smalltalk.HashedCollection);
  7181. smalltalk.addMethod(
  7182. "_at_ifPresent_ifAbsent_",
  7183. smalltalk.method({
  7184. selector: "at:ifPresent:ifAbsent:",
  7185. category: 'accessing',
  7186. fn: function (aKey, aBlock, anotherBlock) {
  7187. var self=this;
  7188. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNil_ifNotNil_", [anotherBlock, (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
  7189. return self;},
  7190. args: ["aKey", "aBlock", "anotherBlock"],
  7191. source: "at: aKey ifPresent: aBlock ifAbsent: anotherBlock\x0a\x09^(self basicAt: aKey)\x0a\x09 ifNil: anotherBlock\x0a\x09 ifNotNil: [aBlock value: (self at: aKey)]",
  7192. messageSends: ["ifNil:ifNotNil:", "basicAt:", "value:", "at:"],
  7193. referencedClasses: []
  7194. }),
  7195. smalltalk.HashedCollection);
  7196. smalltalk.addMethod(
  7197. "_at_put_",
  7198. smalltalk.method({
  7199. selector: "at:put:",
  7200. category: 'accessing',
  7201. fn: function (aKey, aValue) {
  7202. var self=this;
  7203. return smalltalk.send(self, "_basicAt_put_", [aKey, aValue]);
  7204. return self;},
  7205. args: ["aKey", "aValue"],
  7206. source: "at: aKey put: aValue\x0a\x09^self basicAt: aKey put: aValue",
  7207. messageSends: ["basicAt:put:"],
  7208. referencedClasses: []
  7209. }),
  7210. smalltalk.HashedCollection);
  7211. smalltalk.addMethod(
  7212. "_collect_",
  7213. smalltalk.method({
  7214. selector: "collect:",
  7215. category: 'enumerating',
  7216. fn: function (aBlock) {
  7217. var self=this;
  7218. var newDict=nil;
  7219. (newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  7220. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(newDict, "_at_put_", [key, smalltalk.send(aBlock, "_value_", [value])]);})]);
  7221. return newDict;
  7222. return self;},
  7223. args: ["aBlock"],
  7224. source: "collect: aBlock\x0a\x09| newDict |\x0a\x09newDict := self class new.\x0a\x09self keysAndValuesDo: [:key :value |\x0a\x09 newDict at: key put: (aBlock value: value)].\x0a\x09^newDict",
  7225. messageSends: ["new", "class", "keysAndValuesDo:", "at:put:", "value:"],
  7226. referencedClasses: []
  7227. }),
  7228. smalltalk.HashedCollection);
  7229. smalltalk.addMethod(
  7230. "_copyFrom_to_",
  7231. smalltalk.method({
  7232. selector: "copyFrom:to:",
  7233. category: 'copying',
  7234. fn: function (anIndex, anotherIndex) {
  7235. var self=this;
  7236. smalltalk.send(self, "_shouldNotImplement", []);
  7237. return self;},
  7238. args: ["anIndex", "anotherIndex"],
  7239. source: "copyFrom: anIndex to: anotherIndex\x0a\x09self shouldNotImplement",
  7240. messageSends: ["shouldNotImplement"],
  7241. referencedClasses: []
  7242. }),
  7243. smalltalk.HashedCollection);
  7244. smalltalk.addMethod(
  7245. "_deepCopy",
  7246. smalltalk.method({
  7247. selector: "deepCopy",
  7248. category: 'copying',
  7249. fn: function () {
  7250. var self=this;
  7251. var copy=nil;
  7252. (copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  7253. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(smalltalk.send(each, "_value", []), "_deepCopy", [])]);})]);
  7254. return copy;
  7255. return self;},
  7256. args: [],
  7257. source: "deepCopy\x0a\x09| copy |\x0a\x09copy := self class new.\x0a\x09self associationsDo: [:each |\x0a\x09 copy at: each key put: each value deepCopy].\x0a\x09^copy",
  7258. messageSends: ["new", "class", "associationsDo:", "at:put:", "key", "deepCopy", "value"],
  7259. referencedClasses: []
  7260. }),
  7261. smalltalk.HashedCollection);
  7262. smalltalk.addMethod(
  7263. "_detect_ifNone_",
  7264. smalltalk.method({
  7265. selector: "detect:ifNone:",
  7266. category: 'enumerating',
  7267. fn: function (aBlock, anotherBlock) {
  7268. var self=this;
  7269. return smalltalk.send(smalltalk.send(self, "_values", []), "_detect_ifNone_", [aBlock, anotherBlock]);
  7270. return self;},
  7271. args: ["aBlock", "anotherBlock"],
  7272. source: "detect: aBlock ifNone: anotherBlock\x0a\x09^self values detect: aBlock ifNone: anotherBlock",
  7273. messageSends: ["detect:ifNone:", "values"],
  7274. referencedClasses: []
  7275. }),
  7276. smalltalk.HashedCollection);
  7277. smalltalk.addMethod(
  7278. "_do_",
  7279. smalltalk.method({
  7280. selector: "do:",
  7281. category: 'enumerating',
  7282. fn: function (aBlock) {
  7283. var self=this;
  7284. smalltalk.send(smalltalk.send(self, "_values", []), "_do_", [aBlock]);
  7285. return self;},
  7286. args: ["aBlock"],
  7287. source: "do: aBlock\x0a\x09self values do: aBlock",
  7288. messageSends: ["do:", "values"],
  7289. referencedClasses: []
  7290. }),
  7291. smalltalk.HashedCollection);
  7292. smalltalk.addMethod(
  7293. "_includes_",
  7294. smalltalk.method({
  7295. selector: "includes:",
  7296. category: 'enumerating',
  7297. fn: function (anObject) {
  7298. var self=this;
  7299. return smalltalk.send(smalltalk.send(self, "_values", []), "_includes_", [anObject]);
  7300. return self;},
  7301. args: ["anObject"],
  7302. source: "includes: anObject\x0a\x09^self values includes: anObject",
  7303. messageSends: ["includes:", "values"],
  7304. referencedClasses: []
  7305. }),
  7306. smalltalk.HashedCollection);
  7307. smalltalk.addMethod(
  7308. "_includesKey_",
  7309. smalltalk.method({
  7310. selector: "includesKey:",
  7311. category: 'testing',
  7312. fn: function (aKey) {
  7313. var self=this;
  7314. return self.hasOwnProperty(aKey);
  7315. return self;},
  7316. args: ["aKey"],
  7317. source: "includesKey: aKey\x0a\x09<return self.hasOwnProperty(aKey)>",
  7318. messageSends: [],
  7319. referencedClasses: []
  7320. }),
  7321. smalltalk.HashedCollection);
  7322. smalltalk.addMethod(
  7323. "_keys",
  7324. smalltalk.method({
  7325. selector: "keys",
  7326. category: 'accessing',
  7327. fn: function () {
  7328. var self=this;
  7329. if ('function'===typeof Object.keys) return Object.keys(self);
  7330. var keys = [];
  7331. for(var i in self) {
  7332. if(self.hasOwnProperty(i)) {
  7333. keys.push(i);
  7334. }
  7335. };
  7336. return keys;
  7337. ;
  7338. return self;},
  7339. args: [],
  7340. source: "keys\x0a\x09<\x0a\x09\x09if ('function'===typeof Object.keys) return Object.keys(self);\x0a\x09\x09var keys = [];\x0a\x09\x09for(var i in self) {\x0a\x09\x09\x09if(self.hasOwnProperty(i)) {\x0a\x09\x09\x09\x09keys.push(i);\x0a\x09\x09\x09}\x0a\x09\x09};\x0a\x09\x09return keys;\x0a\x09>",
  7341. messageSends: [],
  7342. referencedClasses: []
  7343. }),
  7344. smalltalk.HashedCollection);
  7345. smalltalk.addMethod(
  7346. "_keysAndValuesDo_",
  7347. smalltalk.method({
  7348. selector: "keysAndValuesDo:",
  7349. category: 'enumerating',
  7350. fn: function (aBlock) {
  7351. var self=this;
  7352. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(aBlock, "_value_value_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  7353. return self;},
  7354. args: ["aBlock"],
  7355. source: "keysAndValuesDo: aBlock\x0a\x09self associationsDo: [:each |\x0a\x09 aBlock value: each key value: each value]",
  7356. messageSends: ["associationsDo:", "value:value:", "key", "value"],
  7357. referencedClasses: []
  7358. }),
  7359. smalltalk.HashedCollection);
  7360. smalltalk.addMethod(
  7361. "_printString",
  7362. smalltalk.method({
  7363. selector: "printString",
  7364. category: 'printing',
  7365. fn: function () {
  7366. var self=this;
  7367. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(aStream){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_printString", [], smalltalk.Collection)]);return smalltalk.send($rec, "_nextPutAll_", ["("]);})(aStream);smalltalk.send(smalltalk.send(self, "_associations", []), "_do_separatedBy_", [(function(anAssociation){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(anAssociation, "_key", []), "_printString", [])]);smalltalk.send($rec, "_nextPutAll_", [" -> "]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(anAssociation, "_value", []), "_printString", [])]);})(aStream);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [" , "]);})]);return smalltalk.send(aStream, "_nextPutAll_", [")"]);})]);
  7368. return self;},
  7369. args: [],
  7370. source: "printString\x0a\x09^String streamContents: [:aStream| \x0a\x09\x09aStream \x0a\x09\x09\x09nextPutAll: super printString;\x0a\x09\x09\x09nextPutAll: '('.\x0a\x09\x09\x09\x09self associations \x0a\x09\x09\x09\x09\x09do: [:anAssociation| \x0a\x09\x09\x09\x09\x09\x09aStream \x0a\x09\x09\x09\x09\x09\x09\x09nextPutAll: anAssociation key printString;\x0a\x09\x09\x09\x09\x09\x09\x09\x09nextPutAll: ' -> ';\x0a\x09\x09\x09\x09\x09\x09\x09\x09nextPutAll: anAssociation value printString]\x0a\x09\x09\x09\x09\x09\x09\x09separatedBy: [aStream nextPutAll: ' , '].\x0a\x09\x09\x09\x09\x09\x09aStream nextPutAll: ')']",
  7371. messageSends: ["streamContents:", "nextPutAll:", "printString", "do:separatedBy:", "associations", "key", "value"],
  7372. referencedClasses: ["String"]
  7373. }),
  7374. smalltalk.HashedCollection);
  7375. smalltalk.addMethod(
  7376. "_remove_ifAbsent_",
  7377. smalltalk.method({
  7378. selector: "remove:ifAbsent:",
  7379. category: 'adding/removing',
  7380. fn: function (aKey, aBlock) {
  7381. var self=this;
  7382. return smalltalk.send(self, "_removeKey_ifAbsent_", [aKey, aBlock]);
  7383. return self;},
  7384. args: ["aKey", "aBlock"],
  7385. source: "remove: aKey ifAbsent: aBlock\x0a ^self removeKey: aKey ifAbsent: aBlock",
  7386. messageSends: ["removeKey:ifAbsent:"],
  7387. referencedClasses: []
  7388. }),
  7389. smalltalk.HashedCollection);
  7390. smalltalk.addMethod(
  7391. "_removeKey_",
  7392. smalltalk.method({
  7393. selector: "removeKey:",
  7394. category: 'adding/removing',
  7395. fn: function (aKey) {
  7396. var self=this;
  7397. return smalltalk.send(self, "_remove_", [aKey]);
  7398. return self;},
  7399. args: ["aKey"],
  7400. source: "removeKey: aKey\x0a ^self remove: aKey",
  7401. messageSends: ["remove:"],
  7402. referencedClasses: []
  7403. }),
  7404. smalltalk.HashedCollection);
  7405. smalltalk.addMethod(
  7406. "_removeKey_ifAbsent_",
  7407. smalltalk.method({
  7408. selector: "removeKey:ifAbsent:",
  7409. category: 'adding/removing',
  7410. fn: function (aKey, aBlock) {
  7411. var self=this;
  7412. return ((($receiver = smalltalk.send(self, "_includesKey_", [aKey])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(aBlock, "_value", []);})() : (function(){return smalltalk.send(self, "_basicDelete_", [aKey]);})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return smalltalk.send(aBlock, "_value", []);}), (function(){return smalltalk.send(self, "_basicDelete_", [aKey]);})]));
  7413. return self;},
  7414. args: ["aKey", "aBlock"],
  7415. source: "removeKey: aKey ifAbsent: aBlock\x0a\x09^(self includesKey: aKey) \x0a\x09\x09ifFalse: [aBlock value]\x0a\x09\x09ifTrue: [self basicDelete: aKey]",
  7416. messageSends: ["ifFalse:ifTrue:", "includesKey:", "value", "basicDelete:"],
  7417. referencedClasses: []
  7418. }),
  7419. smalltalk.HashedCollection);
  7420. smalltalk.addMethod(
  7421. "_select_",
  7422. smalltalk.method({
  7423. selector: "select:",
  7424. category: 'enumerating',
  7425. fn: function (aBlock) {
  7426. var self=this;
  7427. var newDict=nil;
  7428. (newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  7429. smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return ((($receiver = smalltalk.send(aBlock, "_value_", [value])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(newDict, "_at_put_", [key, value]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(newDict, "_at_put_", [key, value]);})]));})]);
  7430. return newDict;
  7431. return self;},
  7432. args: ["aBlock"],
  7433. source: "select: aBlock\x0a\x09| newDict |\x0a\x09newDict := self class new.\x0a\x09self keysAndValuesDo: [:key :value |\x0a\x09 (aBlock value: value) ifTrue: [newDict at: key put: value]].\x0a\x09^newDict",
  7434. messageSends: ["new", "class", "keysAndValuesDo:", "ifTrue:", "value:", "at:put:"],
  7435. referencedClasses: []
  7436. }),
  7437. smalltalk.HashedCollection);
  7438. smalltalk.addMethod(
  7439. "_shallowCopy",
  7440. smalltalk.method({
  7441. selector: "shallowCopy",
  7442. category: 'copying',
  7443. fn: function () {
  7444. var self=this;
  7445. var copy=nil;
  7446. (copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  7447. smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
  7448. return copy;
  7449. return self;},
  7450. args: [],
  7451. source: "shallowCopy\x0a\x09| copy |\x0a\x09copy := self class new.\x0a\x09self associationsDo: [:each |\x0a\x09 copy at: each key put: each value].\x0a\x09^copy",
  7452. messageSends: ["new", "class", "associationsDo:", "at:put:", "key", "value"],
  7453. referencedClasses: []
  7454. }),
  7455. smalltalk.HashedCollection);
  7456. smalltalk.addMethod(
  7457. "_size",
  7458. smalltalk.method({
  7459. selector: "size",
  7460. category: 'accessing',
  7461. fn: function () {
  7462. var self=this;
  7463. return smalltalk.send(smalltalk.send(self, "_keys", []), "_size", []);
  7464. return self;},
  7465. args: [],
  7466. source: "size\x0a\x09^self keys size",
  7467. messageSends: ["size", "keys"],
  7468. referencedClasses: []
  7469. }),
  7470. smalltalk.HashedCollection);
  7471. smalltalk.addMethod(
  7472. "_storeOn_",
  7473. smalltalk.method({
  7474. selector: "storeOn:",
  7475. category: 'printing',
  7476. fn: function (aStream) {
  7477. var self=this;
  7478. smalltalk.send(aStream, "_nextPutAll_", ["#{"]);
  7479. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_separatedBy_", [(function(each){return smalltalk.send(each, "_storeOn_", [aStream]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [". "]);})]);
  7480. smalltalk.send(aStream, "_nextPutAll_", ["}"]);
  7481. return self;},
  7482. args: ["aStream"],
  7483. source: "storeOn: aStream\x0a\x09aStream nextPutAll: '#{'.\x0a\x09self associations\x0a\x09\x09do: [:each | each storeOn: aStream]\x0a\x09\x09separatedBy: [ aStream nextPutAll: '. '].\x0a\x09aStream nextPutAll: '}'",
  7484. messageSends: ["nextPutAll:", "do:separatedBy:", "associations", "storeOn:"],
  7485. referencedClasses: []
  7486. }),
  7487. smalltalk.HashedCollection);
  7488. smalltalk.addMethod(
  7489. "_values",
  7490. smalltalk.method({
  7491. selector: "values",
  7492. category: 'accessing',
  7493. fn: function () {
  7494. var self=this;
  7495. return smalltalk.send(smalltalk.send(self, "_keys", []), "_collect_", [(function(each){return smalltalk.send(self, "_at_", [each]);})]);
  7496. return self;},
  7497. args: [],
  7498. source: "values\x0a\x09^self keys collect: [:each | self at: each]",
  7499. messageSends: ["collect:", "keys", "at:"],
  7500. referencedClasses: []
  7501. }),
  7502. smalltalk.HashedCollection);
  7503. smalltalk.addMethod(
  7504. "_fromPairs_",
  7505. smalltalk.method({
  7506. selector: "fromPairs:",
  7507. category: 'instance creation',
  7508. fn: function (aCollection) {
  7509. var self=this;
  7510. var dict=nil;
  7511. (dict=smalltalk.send(self, "_new", []));
  7512. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(dict, "_add_", [each]);})]);
  7513. return dict;
  7514. return self;},
  7515. args: ["aCollection"],
  7516. source: "fromPairs: aCollection\x0a\x09| dict |\x0a\x09dict := self new.\x0a\x09aCollection do: [:each | dict add: each].\x0a\x09^dict",
  7517. messageSends: ["new", "do:", "add:"],
  7518. referencedClasses: []
  7519. }),
  7520. smalltalk.HashedCollection.klass);
  7521. smalltalk.addClass('Dictionary', smalltalk.HashedCollection, ['keys', 'values'], 'Kernel-Collections');
  7522. smalltalk.addMethod(
  7523. "_asHashedCollection",
  7524. smalltalk.method({
  7525. selector: "asHashedCollection",
  7526. category: 'converting',
  7527. fn: function () {
  7528. var self=this;
  7529. return smalltalk.send((smalltalk.HashedCollection || HashedCollection), "_fromPairs_", [smalltalk.send(self, "_associations", [])]);
  7530. return self;},
  7531. args: [],
  7532. source: "asHashedCollection\x0a\x09^HashedCollection fromPairs: self associations",
  7533. messageSends: ["fromPairs:", "associations"],
  7534. referencedClasses: ["HashedCollection"]
  7535. }),
  7536. smalltalk.Dictionary);
  7537. smalltalk.addMethod(
  7538. "_asJSON",
  7539. smalltalk.method({
  7540. selector: "asJSON",
  7541. category: 'converting',
  7542. fn: function () {
  7543. var self=this;
  7544. return smalltalk.send(smalltalk.send(self, "_asHashedCollection", []), "_asJSON", []);
  7545. return self;},
  7546. args: [],
  7547. source: "asJSON\x0a\x09^self asHashedCollection asJSON",
  7548. messageSends: ["asJSON", "asHashedCollection"],
  7549. referencedClasses: []
  7550. }),
  7551. smalltalk.Dictionary);
  7552. smalltalk.addMethod(
  7553. "_at_ifAbsent_",
  7554. smalltalk.method({
  7555. selector: "at:ifAbsent:",
  7556. category: 'accessing',
  7557. fn: function (aKey, aBlock) {
  7558. var self=this;
  7559. var index;
  7560. for(var i=0;i<self['@keys'].length;i++){
  7561. if(self['@keys'][i].__eq(aKey)) {index = i;}
  7562. };
  7563. if(typeof index === 'undefined') {
  7564. return aBlock();
  7565. } else {
  7566. return self['@values'][index];
  7567. }
  7568. ;
  7569. return self;},
  7570. args: ["aKey", "aBlock"],
  7571. source: "at: aKey ifAbsent: aBlock\x0a\x09<\x0a\x09\x09var index;\x0a\x09\x09for(var i=0;i<self['@keys'].length;i++){\x0a\x09\x09\x09if(self['@keys'][i].__eq(aKey)) {index = i;}\x0a\x09\x09};\x0a\x09\x09if(typeof index === 'undefined') {\x0a\x09\x09\x09return aBlock();\x0a\x09\x09} else {\x0a\x09\x09\x09return self['@values'][index];\x0a\x09\x09}\x0a\x09>",
  7572. messageSends: [],
  7573. referencedClasses: []
  7574. }),
  7575. smalltalk.Dictionary);
  7576. smalltalk.addMethod(
  7577. "_at_put_",
  7578. smalltalk.method({
  7579. selector: "at:put:",
  7580. category: 'accessing',
  7581. fn: function (aKey, aValue) {
  7582. var self=this;
  7583. var index = self['@keys'].indexOf(aKey);
  7584. if(index === -1) {
  7585. self['@values'].push(aValue);
  7586. self['@keys'].push(aKey);
  7587. } else {
  7588. self['@values'][index] = aValue;
  7589. };
  7590. return aValue;
  7591. ;
  7592. return self;},
  7593. args: ["aKey", "aValue"],
  7594. source: "at: aKey put: aValue\x0a\x09<\x0a\x09\x09var index = self['@keys'].indexOf(aKey);\x0a\x09\x09if(index === -1) {\x0a\x09\x09\x09self['@values'].push(aValue);\x0a\x09\x09\x09self['@keys'].push(aKey);\x0a\x09\x09} else {\x0a\x09\x09\x09self['@values'][index] = aValue;\x0a\x09\x09};\x0a\x0a\x09\x09return aValue;\x0a\x09>",
  7595. messageSends: [],
  7596. referencedClasses: []
  7597. }),
  7598. smalltalk.Dictionary);
  7599. smalltalk.addMethod(
  7600. "_includesKey_",
  7601. smalltalk.method({
  7602. selector: "includesKey:",
  7603. category: 'testing',
  7604. fn: function (aKey) {
  7605. var self=this;
  7606. return smalltalk.send(self['@keys'], "_includes_", [aKey]);
  7607. return self;},
  7608. args: ["aKey"],
  7609. source: "includesKey: aKey\x0a\x09^keys includes: aKey",
  7610. messageSends: ["includes:"],
  7611. referencedClasses: []
  7612. }),
  7613. smalltalk.Dictionary);
  7614. smalltalk.addMethod(
  7615. "_initialize",
  7616. smalltalk.method({
  7617. selector: "initialize",
  7618. category: 'initialization',
  7619. fn: function () {
  7620. var self=this;
  7621. smalltalk.send(self, "_initialize", [], smalltalk.HashedCollection);
  7622. (self['@keys']=[]);
  7623. (self['@values']=[]);
  7624. return self;},
  7625. args: [],
  7626. source: "initialize\x0a\x09super initialize.\x0a\x09keys := #().\x0a\x09values := #()",
  7627. messageSends: ["initialize"],
  7628. referencedClasses: []
  7629. }),
  7630. smalltalk.Dictionary);
  7631. smalltalk.addMethod(
  7632. "_keys",
  7633. smalltalk.method({
  7634. selector: "keys",
  7635. category: 'accessing',
  7636. fn: function () {
  7637. var self=this;
  7638. return smalltalk.send(self['@keys'], "_copy", []);
  7639. return self;},
  7640. args: [],
  7641. source: "keys\x0a\x09^keys copy",
  7642. messageSends: ["copy"],
  7643. referencedClasses: []
  7644. }),
  7645. smalltalk.Dictionary);
  7646. smalltalk.addMethod(
  7647. "_removeKey_ifAbsent_",
  7648. smalltalk.method({
  7649. selector: "removeKey:ifAbsent:",
  7650. category: 'adding/removing',
  7651. fn: function (aKey, aBlock) {
  7652. var self=this;
  7653. var index = self['@keys'].indexOf(aKey);
  7654. if(index === -1) {
  7655. return aBlock()
  7656. } else {
  7657. var value;
  7658. self['@keys'].splice(index, 1);
  7659. value = self['@values'].splice(index, 1);
  7660. return value[0];
  7661. };
  7662. ;
  7663. return self;},
  7664. args: ["aKey", "aBlock"],
  7665. source: "removeKey: aKey ifAbsent: aBlock\x0a <\x0a var index = self['@keys'].indexOf(aKey);\x0a if(index === -1) {\x0a return aBlock()\x0a } else {\x0a var value;\x0a self['@keys'].splice(index, 1);\x0a value = self['@values'].splice(index, 1);\x0a return value[0];\x0a };\x0a >",
  7666. messageSends: [],
  7667. referencedClasses: []
  7668. }),
  7669. smalltalk.Dictionary);
  7670. smalltalk.addMethod(
  7671. "_values",
  7672. smalltalk.method({
  7673. selector: "values",
  7674. category: 'accessing',
  7675. fn: function () {
  7676. var self=this;
  7677. return smalltalk.send(self['@values'], "_copy", []);
  7678. return self;},
  7679. args: [],
  7680. source: "values\x0a\x09^values copy",
  7681. messageSends: ["copy"],
  7682. referencedClasses: []
  7683. }),
  7684. smalltalk.Dictionary);
  7685. smalltalk.addClass('SequenceableCollection', smalltalk.Collection, [], 'Kernel-Collections');
  7686. smalltalk.addMethod(
  7687. "__eq",
  7688. smalltalk.method({
  7689. selector: "=",
  7690. category: 'comparing',
  7691. fn: function (aCollection) {
  7692. var self=this;
  7693. var $early={};
  7694. try{((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aCollection, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [smalltalk.send(aCollection, "_size", [])]);})])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw $early=function(){return false}})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw $early=function(){return false}})();})]));
  7695. smalltalk.send(self, "_withIndexDo_", [(function(each, i){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_at_", [i]), "__eq", [each])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw $early=function(){return false}})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw $early=function(){return false}})();})]));})]);
  7696. return true;
  7697. return self;
  7698. } catch(e) {if(e===$early)return e(); throw e}},
  7699. args: ["aCollection"],
  7700. source: "= aCollection\x0a\x09(self class = aCollection class and: [\x0a\x09\x09self size = aCollection size]) ifFalse: [^false].\x0a\x09self withIndexDo: [:each :i |\x0a (aCollection at: i) = each ifFalse: [^false]].\x0a\x09^true",
  7701. messageSends: ["ifFalse:", "and:", "=", "class", "size", "withIndexDo:", "at:"],
  7702. referencedClasses: []
  7703. }),
  7704. smalltalk.SequenceableCollection);
  7705. smalltalk.addMethod(
  7706. "_addLast_",
  7707. smalltalk.method({
  7708. selector: "addLast:",
  7709. category: 'adding',
  7710. fn: function (anObject) {
  7711. var self=this;
  7712. smalltalk.send(self, "_add_", [anObject]);
  7713. return self;},
  7714. args: ["anObject"],
  7715. source: "addLast: anObject\x0a\x09self add: anObject",
  7716. messageSends: ["add:"],
  7717. referencedClasses: []
  7718. }),
  7719. smalltalk.SequenceableCollection);
  7720. smalltalk.addMethod(
  7721. "_allButFirst",
  7722. smalltalk.method({
  7723. selector: "allButFirst",
  7724. category: 'accessing',
  7725. fn: function () {
  7726. var self=this;
  7727. return smalltalk.send(self, "_copyFrom_to_", [(2), smalltalk.send(self, "_size", [])]);
  7728. return self;},
  7729. args: [],
  7730. source: "allButFirst\x0a\x09^self copyFrom: 2 to: self size",
  7731. messageSends: ["copyFrom:to:", "size"],
  7732. referencedClasses: []
  7733. }),
  7734. smalltalk.SequenceableCollection);
  7735. smalltalk.addMethod(
  7736. "_allButLast",
  7737. smalltalk.method({
  7738. selector: "allButLast",
  7739. category: 'accessing',
  7740. fn: function () {
  7741. var self=this;
  7742. return smalltalk.send(self, "_copyFrom_to_", [(1), ((($receiver = smalltalk.send(self, "_size", [])).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]))]);
  7743. return self;},
  7744. args: [],
  7745. source: "allButLast\x0a\x09^self copyFrom: 1 to: self size - 1",
  7746. messageSends: ["copyFrom:to:", "-", "size"],
  7747. referencedClasses: []
  7748. }),
  7749. smalltalk.SequenceableCollection);
  7750. smalltalk.addMethod(
  7751. "_at_",
  7752. smalltalk.method({
  7753. selector: "at:",
  7754. category: 'accessing',
  7755. fn: function (anIndex) {
  7756. var self=this;
  7757. return smalltalk.send(self, "_at_ifAbsent_", [anIndex, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  7758. return self;},
  7759. args: ["anIndex"],
  7760. source: "at: anIndex\x0a\x09^self at: anIndex ifAbsent: [\x0a\x09 self errorNotFound]",
  7761. messageSends: ["at:ifAbsent:", "errorNotFound"],
  7762. referencedClasses: []
  7763. }),
  7764. smalltalk.SequenceableCollection);
  7765. smalltalk.addMethod(
  7766. "_at_ifAbsent_",
  7767. smalltalk.method({
  7768. selector: "at:ifAbsent:",
  7769. category: 'accessing',
  7770. fn: function (anIndex, aBlock) {
  7771. var self=this;
  7772. smalltalk.send(self, "_subclassResponsibility", []);
  7773. return self;},
  7774. args: ["anIndex", "aBlock"],
  7775. source: "at: anIndex ifAbsent: aBlock\x0a\x09self subclassResponsibility",
  7776. messageSends: ["subclassResponsibility"],
  7777. referencedClasses: []
  7778. }),
  7779. smalltalk.SequenceableCollection);
  7780. smalltalk.addMethod(
  7781. "_at_put_",
  7782. smalltalk.method({
  7783. selector: "at:put:",
  7784. category: 'accessing',
  7785. fn: function (anIndex, anObject) {
  7786. var self=this;
  7787. smalltalk.send(self, "_subclassResponsibility", []);
  7788. return self;},
  7789. args: ["anIndex", "anObject"],
  7790. source: "at: anIndex put: anObject\x0a\x09self subclassResponsibility",
  7791. messageSends: ["subclassResponsibility"],
  7792. referencedClasses: []
  7793. }),
  7794. smalltalk.SequenceableCollection);
  7795. smalltalk.addMethod(
  7796. "_atRandom",
  7797. smalltalk.method({
  7798. selector: "atRandom",
  7799. category: 'accessing',
  7800. fn: function () {
  7801. var self=this;
  7802. return smalltalk.send(self, "_at_", [smalltalk.send(smalltalk.send(self, "_size", []), "_atRandom", [])]);
  7803. return self;},
  7804. args: [],
  7805. source: "atRandom\x0a\x09^ self at: self size atRandom",
  7806. messageSends: ["at:", "atRandom", "size"],
  7807. referencedClasses: []
  7808. }),
  7809. smalltalk.SequenceableCollection);
  7810. smalltalk.addMethod(
  7811. "_copyFrom_to_",
  7812. smalltalk.method({
  7813. selector: "copyFrom:to:",
  7814. category: 'copying',
  7815. fn: function (anIndex, anotherIndex) {
  7816. var self=this;
  7817. var range=nil;
  7818. var newCollection=nil;
  7819. (range=smalltalk.send(anIndex, "_to_", [anotherIndex]));
  7820. (newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new_", [smalltalk.send(range, "_size", [])]));
  7821. smalltalk.send(range, "_withIndexDo_", [(function(each, i){return smalltalk.send(newCollection, "_at_put_", [i, smalltalk.send(self, "_at_", [each])]);})]);
  7822. return newCollection;
  7823. return self;},
  7824. args: ["anIndex", "anotherIndex"],
  7825. source: "copyFrom: anIndex to: anotherIndex\x0a\x09| range newCollection |\x0a\x09range := anIndex to: anotherIndex.\x0a\x09newCollection := self class new: range size.\x0a\x09range withIndexDo: [:each :i |\x0a\x09 newCollection at: i put: (self at: each)].\x0a\x09^newCollection",
  7826. messageSends: ["to:", "new:", "class", "size", "withIndexDo:", "at:put:", "at:"],
  7827. referencedClasses: []
  7828. }),
  7829. smalltalk.SequenceableCollection);
  7830. smalltalk.addMethod(
  7831. "_deepCopy",
  7832. smalltalk.method({
  7833. selector: "deepCopy",
  7834. category: 'copying',
  7835. fn: function () {
  7836. var self=this;
  7837. var newCollection=nil;
  7838. (newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new_", [smalltalk.send(self, "_size", [])]));
  7839. smalltalk.send(self, "_withIndexDo_", [(function(each, index){return smalltalk.send(newCollection, "_at_put_", [index, smalltalk.send(each, "_deepCopy", [])]);})]);
  7840. return newCollection;
  7841. return self;},
  7842. args: [],
  7843. source: "deepCopy\x0a\x09| newCollection |\x0a\x09newCollection := self class new: self size.\x0a\x09self withIndexDo: [:each :index | \x0a\x09\x09newCollection at: index put: each deepCopy].\x0a\x09^newCollection",
  7844. messageSends: ["new:", "class", "size", "withIndexDo:", "at:put:", "deepCopy"],
  7845. referencedClasses: []
  7846. }),
  7847. smalltalk.SequenceableCollection);
  7848. smalltalk.addMethod(
  7849. "_first",
  7850. smalltalk.method({
  7851. selector: "first",
  7852. category: 'accessing',
  7853. fn: function () {
  7854. var self=this;
  7855. return smalltalk.send(self, "_at_", [(1)]);
  7856. return self;},
  7857. args: [],
  7858. source: "first\x0a\x09^self at: 1",
  7859. messageSends: ["at:"],
  7860. referencedClasses: []
  7861. }),
  7862. smalltalk.SequenceableCollection);
  7863. smalltalk.addMethod(
  7864. "_first_",
  7865. smalltalk.method({
  7866. selector: "first:",
  7867. category: 'accessing',
  7868. fn: function (n) {
  7869. var self=this;
  7870. return smalltalk.send(self, "_copyFrom_to_", [(1), n]);
  7871. return self;},
  7872. args: ["n"],
  7873. source: "first: n\x0a\x09\x22Answer the first n elements of the receiver.\x0a\x09Raise an error if there are not enough elements.\x22\x0a\x0a\x09^ self copyFrom: 1 to: n",
  7874. messageSends: ["copyFrom:to:"],
  7875. referencedClasses: []
  7876. }),
  7877. smalltalk.SequenceableCollection);
  7878. smalltalk.addMethod(
  7879. "_fourth",
  7880. smalltalk.method({
  7881. selector: "fourth",
  7882. category: 'accessing',
  7883. fn: function () {
  7884. var self=this;
  7885. return smalltalk.send(self, "_at_", [(4)]);
  7886. return self;},
  7887. args: [],
  7888. source: "fourth\x0a\x09^self at: 4",
  7889. messageSends: ["at:"],
  7890. referencedClasses: []
  7891. }),
  7892. smalltalk.SequenceableCollection);
  7893. smalltalk.addMethod(
  7894. "_indexOf_",
  7895. smalltalk.method({
  7896. selector: "indexOf:",
  7897. category: 'accessing',
  7898. fn: function (anObject) {
  7899. var self=this;
  7900. return smalltalk.send(self, "_indexOf_ifAbsent_", [anObject, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
  7901. return self;},
  7902. args: ["anObject"],
  7903. source: "indexOf: anObject\x0a\x09^self indexOf: anObject ifAbsent: [self errorNotFound]",
  7904. messageSends: ["indexOf:ifAbsent:", "errorNotFound"],
  7905. referencedClasses: []
  7906. }),
  7907. smalltalk.SequenceableCollection);
  7908. smalltalk.addMethod(
  7909. "_indexOf_ifAbsent_",
  7910. smalltalk.method({
  7911. selector: "indexOf:ifAbsent:",
  7912. category: 'accessing',
  7913. fn: function (anObject, aBlock) {
  7914. var self=this;
  7915. for(var i=0;i<self.length;i++){
  7916. if(self[i].__eq(anObject)) {return i+1}
  7917. }
  7918. return aBlock();
  7919. ;
  7920. return self;},
  7921. args: ["anObject", "aBlock"],
  7922. source: "indexOf: anObject ifAbsent: aBlock\x0a\x09<\x0a\x09\x09for(var i=0;i<self.length;i++){\x0a\x09\x09\x09if(self[i].__eq(anObject)) {return i+1}\x0a\x09\x09}\x0a\x09\x09return aBlock();\x0a\x09>",
  7923. messageSends: [],
  7924. referencedClasses: []
  7925. }),
  7926. smalltalk.SequenceableCollection);
  7927. smalltalk.addMethod(
  7928. "_indexOf_startingAt_",
  7929. smalltalk.method({
  7930. selector: "indexOf:startingAt:",
  7931. category: 'accessing',
  7932. fn: function (anObject, start) {
  7933. var self=this;
  7934. return smalltalk.send(self, "_indexOf_startingAt_ifAbsent_", [anObject, start, (function(){return (0);})]);
  7935. return self;},
  7936. args: ["anObject", "start"],
  7937. source: "indexOf: anObject startingAt: start\x0a\x09\x22Answer the index of the first occurence of anElement after start\x0a\x09within the receiver. If the receiver does not contain anElement, \x0a\x09answer 0.\x22\x0a\x09^self indexOf: anObject startingAt: start ifAbsent: [0]",
  7938. messageSends: ["indexOf:startingAt:ifAbsent:"],
  7939. referencedClasses: []
  7940. }),
  7941. smalltalk.SequenceableCollection);
  7942. smalltalk.addMethod(
  7943. "_indexOf_startingAt_ifAbsent_",
  7944. smalltalk.method({
  7945. selector: "indexOf:startingAt:ifAbsent:",
  7946. category: 'accessing',
  7947. fn: function (anObject, start, aBlock) {
  7948. var self=this;
  7949. for(var i=start-1;i<self.length;i++){
  7950. if(self[i].__eq(anObject)) {return i+1}
  7951. }
  7952. return aBlock();
  7953. ;
  7954. return self;},
  7955. args: ["anObject", "start", "aBlock"],
  7956. source: "indexOf: anObject startingAt: start ifAbsent: aBlock\x0a\x09<\x0a\x09\x09for(var i=start-1;i<self.length;i++){\x0a\x09\x09\x09if(self[i].__eq(anObject)) {return i+1}\x0a\x09\x09}\x0a\x09\x09return aBlock();\x0a\x09>",
  7957. messageSends: [],
  7958. referencedClasses: []
  7959. }),
  7960. smalltalk.SequenceableCollection);
  7961. smalltalk.addMethod(
  7962. "_last",
  7963. smalltalk.method({
  7964. selector: "last",
  7965. category: 'accessing',
  7966. fn: function () {
  7967. var self=this;
  7968. return smalltalk.send(self, "_at_", [smalltalk.send(self, "_size", [])]);
  7969. return self;},
  7970. args: [],
  7971. source: "last\x0a\x09^self at: self size",
  7972. messageSends: ["at:", "size"],
  7973. referencedClasses: []
  7974. }),
  7975. smalltalk.SequenceableCollection);
  7976. smalltalk.addMethod(
  7977. "_printString",
  7978. smalltalk.method({
  7979. selector: "printString",
  7980. category: 'printing',
  7981. fn: function () {
  7982. var self=this;
  7983. var str=nil;
  7984. (str=smalltalk.send("", "_writeStream", []));
  7985. smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.Collection), "__comma", [" ("])]);
  7986. smalltalk.send(self, "_do_separatedBy_", [(function(each){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(each, "_printString", [])]);}), (function(){return smalltalk.send(str, "_nextPutAll_", [" "]);})]);
  7987. smalltalk.send(str, "_nextPutAll_", [")"]);
  7988. return smalltalk.send(str, "_contents", []);
  7989. return self;},
  7990. args: [],
  7991. source: "printString\x0a\x09| str |\x0a\x09str := '' writeStream.\x0a\x09str nextPutAll: super printString, ' ('.\x0a\x09self \x0a\x09\x09do: [:each | str nextPutAll: each printString]\x0a\x09\x09separatedBy: [str nextPutAll: ' '].\x0a\x09str nextPutAll: ')'.\x0a\x09^str contents",
  7992. messageSends: ["writeStream", "nextPutAll:", ",", "printString", "do:separatedBy:", "contents"],
  7993. referencedClasses: []
  7994. }),
  7995. smalltalk.SequenceableCollection);
  7996. smalltalk.addMethod(
  7997. "_removeLast",
  7998. smalltalk.method({
  7999. selector: "removeLast",
  8000. category: 'adding',
  8001. fn: function () {
  8002. var self=this;
  8003. smalltalk.send(self, "_remove_", [smalltalk.send(self, "_last", [])]);
  8004. return self;},
  8005. args: [],
  8006. source: "removeLast\x0a\x09self remove: self last",
  8007. messageSends: ["remove:", "last"],
  8008. referencedClasses: []
  8009. }),
  8010. smalltalk.SequenceableCollection);
  8011. smalltalk.addMethod(
  8012. "_reversed",
  8013. smalltalk.method({
  8014. selector: "reversed",
  8015. category: 'converting',
  8016. fn: function () {
  8017. var self=this;
  8018. smalltalk.send(self, "_subclassResponsibility", []);
  8019. return self;},
  8020. args: [],
  8021. source: "reversed\x0a\x09self subclassResponsibility",
  8022. messageSends: ["subclassResponsibility"],
  8023. referencedClasses: []
  8024. }),
  8025. smalltalk.SequenceableCollection);
  8026. smalltalk.addMethod(
  8027. "_second",
  8028. smalltalk.method({
  8029. selector: "second",
  8030. category: 'accessing',
  8031. fn: function () {
  8032. var self=this;
  8033. return smalltalk.send(self, "_at_", [(2)]);
  8034. return self;},
  8035. args: [],
  8036. source: "second\x0a\x09^self at: 2",
  8037. messageSends: ["at:"],
  8038. referencedClasses: []
  8039. }),
  8040. smalltalk.SequenceableCollection);
  8041. smalltalk.addMethod(
  8042. "_shallowCopy",
  8043. smalltalk.method({
  8044. selector: "shallowCopy",
  8045. category: 'copying',
  8046. fn: function () {
  8047. var self=this;
  8048. var newCollection=nil;
  8049. (newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new_", [smalltalk.send(self, "_size", [])]));
  8050. smalltalk.send(self, "_withIndexDo_", [(function(each, index){return smalltalk.send(newCollection, "_at_put_", [index, each]);})]);
  8051. return newCollection;
  8052. return self;},
  8053. args: [],
  8054. source: "shallowCopy\x0a\x09| newCollection |\x0a\x09newCollection := self class new: self size.\x0a\x09self withIndexDo: [ :each :index | \x0a\x09\x09newCollection at: index put: each].\x0a\x09^newCollection",
  8055. messageSends: ["new:", "class", "size", "withIndexDo:", "at:put:"],
  8056. referencedClasses: []
  8057. }),
  8058. smalltalk.SequenceableCollection);
  8059. smalltalk.addMethod(
  8060. "_third",
  8061. smalltalk.method({
  8062. selector: "third",
  8063. category: 'accessing',
  8064. fn: function () {
  8065. var self=this;
  8066. return smalltalk.send(self, "_at_", [(3)]);
  8067. return self;},
  8068. args: [],
  8069. source: "third\x0a\x09^self at: 3",
  8070. messageSends: ["at:"],
  8071. referencedClasses: []
  8072. }),
  8073. smalltalk.SequenceableCollection);
  8074. smalltalk.addMethod(
  8075. "_withIndexDo_",
  8076. smalltalk.method({
  8077. selector: "withIndexDo:",
  8078. category: 'enumerating',
  8079. fn: function (aBlock) {
  8080. var self=this;
  8081. for(var i=0;i<self.length;i++){aBlock(self[i], i+1);};
  8082. return self;},
  8083. args: ["aBlock"],
  8084. source: "withIndexDo: aBlock\x0a\x09<for(var i=0;i<self.length;i++){aBlock(self[i], i+1);}>",
  8085. messageSends: [],
  8086. referencedClasses: []
  8087. }),
  8088. smalltalk.SequenceableCollection);
  8089. smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  8090. smalltalk.addMethod(
  8091. "_add_",
  8092. smalltalk.method({
  8093. selector: "add:",
  8094. category: 'adding/removing',
  8095. fn: function (anObject) {
  8096. var self=this;
  8097. self.push(anObject); return anObject;;
  8098. return self;},
  8099. args: ["anObject"],
  8100. source: "add: anObject\x0a\x09<self.push(anObject); return anObject;>",
  8101. messageSends: [],
  8102. referencedClasses: []
  8103. }),
  8104. smalltalk.Array);
  8105. smalltalk.addMethod(
  8106. "_asJavascript",
  8107. smalltalk.method({
  8108. selector: "asJavascript",
  8109. category: 'converting',
  8110. fn: function () {
  8111. var self=this;
  8112. return smalltalk.send(smalltalk.send("[", "__comma", [smalltalk.send(smalltalk.send(self, "_collect_", [(function(each){return smalltalk.send(each, "_asJavascript", []);})]), "_join_", [", "])]), "__comma", ["]"]);
  8113. return self;},
  8114. args: [],
  8115. source: "asJavascript\x0a\x09^'[', ((self collect: [:each | each asJavascript]) join: ', '), ']'",
  8116. messageSends: [",", "join:", "collect:", "asJavascript"],
  8117. referencedClasses: []
  8118. }),
  8119. smalltalk.Array);
  8120. smalltalk.addMethod(
  8121. "_at_ifAbsent_",
  8122. smalltalk.method({
  8123. selector: "at:ifAbsent:",
  8124. category: 'accessing',
  8125. fn: function (anIndex, aBlock) {
  8126. var self=this;
  8127. if((anIndex < 1) || (self.length < anIndex)) {return aBlock()};
  8128. return self[anIndex - 1];
  8129. ;
  8130. return self;},
  8131. args: ["anIndex", "aBlock"],
  8132. source: "at: anIndex ifAbsent: aBlock\x0a\x09<\x0a\x09\x09if((anIndex < 1) || (self.length < anIndex)) {return aBlock()};\x0a\x09\x09return self[anIndex - 1];\x0a\x09>",
  8133. messageSends: [],
  8134. referencedClasses: []
  8135. }),
  8136. smalltalk.Array);
  8137. smalltalk.addMethod(
  8138. "_at_put_",
  8139. smalltalk.method({
  8140. selector: "at:put:",
  8141. category: 'accessing',
  8142. fn: function (anIndex, anObject) {
  8143. var self=this;
  8144. return self[anIndex - 1] = anObject;
  8145. return self;},
  8146. args: ["anIndex", "anObject"],
  8147. source: "at: anIndex put: anObject\x0a\x09<return self[anIndex - 1] = anObject>",
  8148. messageSends: [],
  8149. referencedClasses: []
  8150. }),
  8151. smalltalk.Array);
  8152. smalltalk.addMethod(
  8153. "_join_",
  8154. smalltalk.method({
  8155. selector: "join:",
  8156. category: 'enumerating',
  8157. fn: function (aString) {
  8158. var self=this;
  8159. return self.join(aString);
  8160. return self;},
  8161. args: ["aString"],
  8162. source: "join: aString\x0a\x09<return self.join(aString)>",
  8163. messageSends: [],
  8164. referencedClasses: []
  8165. }),
  8166. smalltalk.Array);
  8167. smalltalk.addMethod(
  8168. "_remove_",
  8169. smalltalk.method({
  8170. selector: "remove:",
  8171. category: 'adding/removing',
  8172. fn: function (anObject) {
  8173. var self=this;
  8174. for(var i=0;i<self.length;i++) {
  8175. if(self[i] == anObject) {
  8176. self.splice(i,1);
  8177. break;
  8178. }
  8179. }
  8180. ;
  8181. return self;},
  8182. args: ["anObject"],
  8183. source: "remove: anObject\x0a\x09<\x0a\x09\x09for(var i=0;i<self.length;i++) {\x0a\x09\x09\x09if(self[i] == anObject) {\x0a\x09\x09\x09\x09self.splice(i,1);\x0a\x09\x09\x09\x09break;\x0a\x09\x09\x09}\x0a\x09\x09}\x0a\x09>",
  8184. messageSends: [],
  8185. referencedClasses: []
  8186. }),
  8187. smalltalk.Array);
  8188. smalltalk.addMethod(
  8189. "_removeFrom_to_",
  8190. smalltalk.method({
  8191. selector: "removeFrom:to:",
  8192. category: 'adding/removing',
  8193. fn: function (aNumber, anotherNumber) {
  8194. var self=this;
  8195. self.splice(aNumber - 1,anotherNumber - 1);
  8196. return self;},
  8197. args: ["aNumber", "anotherNumber"],
  8198. source: "removeFrom: aNumber to: anotherNumber\x0a\x09<self.splice(aNumber - 1,anotherNumber - 1)>",
  8199. messageSends: [],
  8200. referencedClasses: []
  8201. }),
  8202. smalltalk.Array);
  8203. smalltalk.addMethod(
  8204. "_reversed",
  8205. smalltalk.method({
  8206. selector: "reversed",
  8207. category: 'converting',
  8208. fn: function () {
  8209. var self=this;
  8210. return self._copy().reverse();
  8211. return self;},
  8212. args: [],
  8213. source: "reversed\x0a\x09<return self._copy().reverse()>",
  8214. messageSends: [],
  8215. referencedClasses: []
  8216. }),
  8217. smalltalk.Array);
  8218. smalltalk.addMethod(
  8219. "_size",
  8220. smalltalk.method({
  8221. selector: "size",
  8222. category: 'accessing',
  8223. fn: function () {
  8224. var self=this;
  8225. return self.length;
  8226. return self;},
  8227. args: [],
  8228. source: "size\x0a\x09<return self.length>",
  8229. messageSends: [],
  8230. referencedClasses: []
  8231. }),
  8232. smalltalk.Array);
  8233. smalltalk.addMethod(
  8234. "_sort",
  8235. smalltalk.method({
  8236. selector: "sort",
  8237. category: 'enumerating',
  8238. fn: function () {
  8239. var self=this;
  8240. return smalltalk.send(self, "_basicPerform_", ["sort"]);
  8241. return self;},
  8242. args: [],
  8243. source: "sort\x0a ^self basicPerform: 'sort'",
  8244. messageSends: ["basicPerform:"],
  8245. referencedClasses: []
  8246. }),
  8247. smalltalk.Array);
  8248. smalltalk.addMethod(
  8249. "_sort_",
  8250. smalltalk.method({
  8251. selector: "sort:",
  8252. category: 'enumerating',
  8253. fn: function (aBlock) {
  8254. var self=this;
  8255. return self.sort(function(a, b) {
  8256. if(aBlock(a,b)) {return -1} else {return 1}
  8257. })
  8258. ;
  8259. return self;},
  8260. args: ["aBlock"],
  8261. source: "sort: aBlock\x0a\x09<\x0a\x09\x09return self.sort(function(a, b) {\x0a\x09\x09\x09if(aBlock(a,b)) {return -1} else {return 1}\x0a\x09\x09})\x0a\x09>",
  8262. messageSends: [],
  8263. referencedClasses: []
  8264. }),
  8265. smalltalk.Array);
  8266. smalltalk.addMethod(
  8267. "_sorted",
  8268. smalltalk.method({
  8269. selector: "sorted",
  8270. category: 'enumerating',
  8271. fn: function () {
  8272. var self=this;
  8273. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort", []);
  8274. return self;},
  8275. args: [],
  8276. source: "sorted\x0a\x09^self copy sort",
  8277. messageSends: ["sort", "copy"],
  8278. referencedClasses: []
  8279. }),
  8280. smalltalk.Array);
  8281. smalltalk.addMethod(
  8282. "_sorted_",
  8283. smalltalk.method({
  8284. selector: "sorted:",
  8285. category: 'enumerating',
  8286. fn: function (aBlock) {
  8287. var self=this;
  8288. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort_", [aBlock]);
  8289. return self;},
  8290. args: ["aBlock"],
  8291. source: "sorted: aBlock\x0a\x09^self copy sort: aBlock",
  8292. messageSends: ["sort:", "copy"],
  8293. referencedClasses: []
  8294. }),
  8295. smalltalk.Array);
  8296. smalltalk.addMethod(
  8297. "_new_",
  8298. smalltalk.method({
  8299. selector: "new:",
  8300. category: 'instance creation',
  8301. fn: function (anInteger) {
  8302. var self=this;
  8303. return new Array(anInteger);
  8304. return self;},
  8305. args: ["anInteger"],
  8306. source: "new: anInteger\x0a\x09<return new Array(anInteger)>",
  8307. messageSends: [],
  8308. referencedClasses: []
  8309. }),
  8310. smalltalk.Array.klass);
  8311. smalltalk.addMethod(
  8312. "_with_",
  8313. smalltalk.method({
  8314. selector: "with:",
  8315. category: 'instance creation',
  8316. fn: function (anObject) {
  8317. var self=this;
  8318. return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(1)]));
  8319. return self;},
  8320. args: ["anObject"],
  8321. source: "with: anObject\x0a\x09 ^(self new: 1)\x0a\x09\x09at: 1 put: anObject;\x0a\x09\x09yourself",
  8322. messageSends: ["at:put:", "yourself", "new:"],
  8323. referencedClasses: []
  8324. }),
  8325. smalltalk.Array.klass);
  8326. smalltalk.addMethod(
  8327. "_with_with_",
  8328. smalltalk.method({
  8329. selector: "with:with:",
  8330. category: 'instance creation',
  8331. fn: function (anObject, anObject2) {
  8332. var self=this;
  8333. return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);smalltalk.send($rec, "_at_put_", [(2), anObject2]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(2)]));
  8334. return self;},
  8335. args: ["anObject", "anObject2"],
  8336. source: "with: anObject with: anObject2\x0a\x09 ^(self new: 2)\x0a\x09\x09at: 1 put: anObject;\x0a\x09\x09at: 2 put: anObject2;\x0a\x09\x09yourself",
  8337. messageSends: ["at:put:", "yourself", "new:"],
  8338. referencedClasses: []
  8339. }),
  8340. smalltalk.Array.klass);
  8341. smalltalk.addMethod(
  8342. "_with_with_with_",
  8343. smalltalk.method({
  8344. selector: "with:with:with:",
  8345. category: 'instance creation',
  8346. fn: function (anObject, anObject2, anObject3) {
  8347. var self=this;
  8348. return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);smalltalk.send($rec, "_at_put_", [(2), anObject2]);smalltalk.send($rec, "_at_put_", [(3), anObject3]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(3)]));
  8349. return self;},
  8350. args: ["anObject", "anObject2", "anObject3"],
  8351. source: "with: anObject with: anObject2 with: anObject3\x0a\x09 ^(self new: 3)\x0a\x09\x09at: 1 put: anObject;\x0a\x09\x09at: 2 put: anObject2;\x0a\x09\x09at: 3 put: anObject3;\x0a\x09\x09yourself",
  8352. messageSends: ["at:put:", "yourself", "new:"],
  8353. referencedClasses: []
  8354. }),
  8355. smalltalk.Array.klass);
  8356. smalltalk.addMethod(
  8357. "_withAll_",
  8358. smalltalk.method({
  8359. selector: "withAll:",
  8360. category: 'instance creation',
  8361. fn: function (aCollection) {
  8362. var self=this;
  8363. var instance=nil;
  8364. (instance=smalltalk.send(self, "_new_", [smalltalk.send(aCollection, "_size", [])]));
  8365. smalltalk.send(aCollection, "_withIndexDo_", [(function(each, index){return smalltalk.send(instance, "_at_put_", [index, each]);})]);
  8366. return instance;
  8367. return self;},
  8368. args: ["aCollection"],
  8369. source: "withAll: aCollection\x0a\x09| instance |\x0a\x09instance := self new: aCollection size.\x0a\x09aCollection withIndexDo: [:each :index |\x0a\x09\x09instance at: index put: each].\x0a\x09^instance",
  8370. messageSends: ["new:", "size", "withIndexDo:", "at:put:"],
  8371. referencedClasses: []
  8372. }),
  8373. smalltalk.Array.klass);
  8374. smalltalk.addClass('CharacterArray', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
  8375. smalltalk.addMethod(
  8376. "__comma",
  8377. smalltalk.method({
  8378. selector: ",",
  8379. category: 'copying',
  8380. fn: function (aString) {
  8381. var self=this;
  8382. return smalltalk.send(smalltalk.send(self, "_asString", []), "__comma", [smalltalk.send(aString, "_asString", [])]);
  8383. return self;},
  8384. args: ["aString"],
  8385. source: ", aString\x0a\x09^self asString, aString asString",
  8386. messageSends: [",", "asString"],
  8387. referencedClasses: []
  8388. }),
  8389. smalltalk.CharacterArray);
  8390. smalltalk.addMethod(
  8391. "_add_",
  8392. smalltalk.method({
  8393. selector: "add:",
  8394. category: 'adding',
  8395. fn: function (anObject) {
  8396. var self=this;
  8397. smalltalk.send(self, "_errorReadOnly", []);
  8398. return self;},
  8399. args: ["anObject"],
  8400. source: "add: anObject\x0a\x09self errorReadOnly",
  8401. messageSends: ["errorReadOnly"],
  8402. referencedClasses: []
  8403. }),
  8404. smalltalk.CharacterArray);
  8405. smalltalk.addMethod(
  8406. "_asLowercase",
  8407. smalltalk.method({
  8408. selector: "asLowercase",
  8409. category: 'converting',
  8410. fn: function () {
  8411. var self=this;
  8412. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [smalltalk.send(smalltalk.send(self, "_asString", []), "_asLowercase", [])]);
  8413. return self;},
  8414. args: [],
  8415. source: "asLowercase\x0a\x09^self class fromString: self asString asLowercase",
  8416. messageSends: ["fromString:", "class", "asLowercase", "asString"],
  8417. referencedClasses: []
  8418. }),
  8419. smalltalk.CharacterArray);
  8420. smalltalk.addMethod(
  8421. "_asNumber",
  8422. smalltalk.method({
  8423. selector: "asNumber",
  8424. category: 'converting',
  8425. fn: function () {
  8426. var self=this;
  8427. return smalltalk.send(smalltalk.send(self, "_asString", []), "_asNumber", []);
  8428. return self;},
  8429. args: [],
  8430. source: "asNumber\x0a\x09^self asString asNumber",
  8431. messageSends: ["asNumber", "asString"],
  8432. referencedClasses: []
  8433. }),
  8434. smalltalk.CharacterArray);
  8435. smalltalk.addMethod(
  8436. "_asString",
  8437. smalltalk.method({
  8438. selector: "asString",
  8439. category: 'converting',
  8440. fn: function () {
  8441. var self=this;
  8442. return smalltalk.send(self, "_subclassResponsibility", []);
  8443. return self;},
  8444. args: [],
  8445. source: "asString\x0a\x09^self subclassResponsibility",
  8446. messageSends: ["subclassResponsibility"],
  8447. referencedClasses: []
  8448. }),
  8449. smalltalk.CharacterArray);
  8450. smalltalk.addMethod(
  8451. "_asSymbol",
  8452. smalltalk.method({
  8453. selector: "asSymbol",
  8454. category: 'converting',
  8455. fn: function () {
  8456. var self=this;
  8457. return smalltalk.send(self, "_subclassResponsibility", []);
  8458. return self;},
  8459. args: [],
  8460. source: "asSymbol\x0a\x09^self subclassResponsibility",
  8461. messageSends: ["subclassResponsibility"],
  8462. referencedClasses: []
  8463. }),
  8464. smalltalk.CharacterArray);
  8465. smalltalk.addMethod(
  8466. "_asUppercase",
  8467. smalltalk.method({
  8468. selector: "asUppercase",
  8469. category: 'converting',
  8470. fn: function () {
  8471. var self=this;
  8472. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [smalltalk.send(smalltalk.send(self, "_asString", []), "_asUppercase", [])]);
  8473. return self;},
  8474. args: [],
  8475. source: "asUppercase\x0a\x09^self class fromString: self asString asUppercase",
  8476. messageSends: ["fromString:", "class", "asUppercase", "asString"],
  8477. referencedClasses: []
  8478. }),
  8479. smalltalk.CharacterArray);
  8480. smalltalk.addMethod(
  8481. "_at_put_",
  8482. smalltalk.method({
  8483. selector: "at:put:",
  8484. category: 'accessing',
  8485. fn: function (anIndex, anObject) {
  8486. var self=this;
  8487. smalltalk.send(self, "_errorReadOnly", []);
  8488. return self;},
  8489. args: ["anIndex", "anObject"],
  8490. source: "at: anIndex put: anObject\x0a\x09self errorReadOnly",
  8491. messageSends: ["errorReadOnly"],
  8492. referencedClasses: []
  8493. }),
  8494. smalltalk.CharacterArray);
  8495. smalltalk.addMethod(
  8496. "_errorReadOnly",
  8497. smalltalk.method({
  8498. selector: "errorReadOnly",
  8499. category: 'error handling',
  8500. fn: function () {
  8501. var self=this;
  8502. smalltalk.send(self, "_error_", ["Object is read-only"]);
  8503. return self;},
  8504. args: [],
  8505. source: "errorReadOnly\x0a\x09self error: 'Object is read-only'",
  8506. messageSends: ["error:"],
  8507. referencedClasses: []
  8508. }),
  8509. smalltalk.CharacterArray);
  8510. smalltalk.addMethod(
  8511. "_printString",
  8512. smalltalk.method({
  8513. selector: "printString",
  8514. category: 'printing',
  8515. fn: function () {
  8516. var self=this;
  8517. return smalltalk.send(smalltalk.send(self, "_asString", []), "_printString", []);
  8518. return self;},
  8519. args: [],
  8520. source: "printString\x0a\x09^self asString printString",
  8521. messageSends: ["printString", "asString"],
  8522. referencedClasses: []
  8523. }),
  8524. smalltalk.CharacterArray);
  8525. smalltalk.addMethod(
  8526. "_remove_",
  8527. smalltalk.method({
  8528. selector: "remove:",
  8529. category: 'adding',
  8530. fn: function (anObject) {
  8531. var self=this;
  8532. smalltalk.send(self, "_errorReadOnly", []);
  8533. return self;},
  8534. args: ["anObject"],
  8535. source: "remove: anObject\x0a\x09self errorReadOnly",
  8536. messageSends: ["errorReadOnly"],
  8537. referencedClasses: []
  8538. }),
  8539. smalltalk.CharacterArray);
  8540. smalltalk.addMethod(
  8541. "_fromString_",
  8542. smalltalk.method({
  8543. selector: "fromString:",
  8544. category: 'instance creation',
  8545. fn: function (aString) {
  8546. var self=this;
  8547. smalltalk.send(self, "_subclassResponsibility", []);
  8548. return self;},
  8549. args: ["aString"],
  8550. source: "fromString: aString\x0a\x09self subclassResponsibility",
  8551. messageSends: ["subclassResponsibility"],
  8552. referencedClasses: []
  8553. }),
  8554. smalltalk.CharacterArray.klass);
  8555. smalltalk.addClass('String', smalltalk.CharacterArray, [], 'Kernel-Collections');
  8556. smalltalk.addMethod(
  8557. "__comma",
  8558. smalltalk.method({
  8559. selector: ",",
  8560. category: 'copying',
  8561. fn: function (aString) {
  8562. var self=this;
  8563. return self + aString;
  8564. return self;},
  8565. args: ["aString"],
  8566. source: ", aString\x0a\x09<return self + aString>",
  8567. messageSends: [],
  8568. referencedClasses: []
  8569. }),
  8570. smalltalk.String);
  8571. smalltalk.addMethod(
  8572. "__lt",
  8573. smalltalk.method({
  8574. selector: "<",
  8575. category: 'comparing',
  8576. fn: function (aString) {
  8577. var self=this;
  8578. return String(self) < aString._asString();
  8579. return self;},
  8580. args: ["aString"],
  8581. source: "< aString\x0a\x09<return String(self) < aString._asString()>",
  8582. messageSends: [],
  8583. referencedClasses: []
  8584. }),
  8585. smalltalk.String);
  8586. smalltalk.addMethod(
  8587. "__lt_eq",
  8588. smalltalk.method({
  8589. selector: "<=",
  8590. category: 'comparing',
  8591. fn: function (aString) {
  8592. var self=this;
  8593. return String(self) <= aString._asString();
  8594. return self;},
  8595. args: ["aString"],
  8596. source: "<= aString\x0a\x09<return String(self) <= aString._asString()>",
  8597. messageSends: [],
  8598. referencedClasses: []
  8599. }),
  8600. smalltalk.String);
  8601. smalltalk.addMethod(
  8602. "__eq",
  8603. smalltalk.method({
  8604. selector: "=",
  8605. category: 'comparing',
  8606. fn: function (aString) {
  8607. var self=this;
  8608. var $early={};
  8609. try{((($receiver = smalltalk.send(smalltalk.send(aString, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw $early=function(){return false}})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw $early=function(){return false}})();})]));
  8610. return String(self) === String(aString);
  8611. return self;
  8612. } catch(e) {if(e===$early)return e(); throw e}},
  8613. args: ["aString"],
  8614. source: "= aString\x0a\x09aString class = self class ifFalse: [^false].\x0a\x09<return String(self) === String(aString)>",
  8615. messageSends: ["ifFalse:", "=", "class"],
  8616. referencedClasses: []
  8617. }),
  8618. smalltalk.String);
  8619. smalltalk.addMethod(
  8620. "__gt",
  8621. smalltalk.method({
  8622. selector: ">",
  8623. category: 'comparing',
  8624. fn: function (aString) {
  8625. var self=this;
  8626. return String(self) > aString._asString();
  8627. return self;},
  8628. args: ["aString"],
  8629. source: "> aString\x0a\x09<return String(self) >> aString._asString()>",
  8630. messageSends: [],
  8631. referencedClasses: []
  8632. }),
  8633. smalltalk.String);
  8634. smalltalk.addMethod(
  8635. "__gt_eq",
  8636. smalltalk.method({
  8637. selector: ">=",
  8638. category: 'comparing',
  8639. fn: function (aString) {
  8640. var self=this;
  8641. return String(self) >= aString._asString();
  8642. return self;},
  8643. args: ["aString"],
  8644. source: ">= aString\x0a\x09<return String(self) >>= aString._asString()>",
  8645. messageSends: [],
  8646. referencedClasses: []
  8647. }),
  8648. smalltalk.String);
  8649. smalltalk.addMethod(
  8650. "_asJSON",
  8651. smalltalk.method({
  8652. selector: "asJSON",
  8653. category: 'converting',
  8654. fn: function () {
  8655. var self=this;
  8656. return self;
  8657. return self;},
  8658. args: [],
  8659. source: "asJSON\x0a\x09^self",
  8660. messageSends: [],
  8661. referencedClasses: []
  8662. }),
  8663. smalltalk.String);
  8664. smalltalk.addMethod(
  8665. "_asJavaScriptSelector",
  8666. smalltalk.method({
  8667. selector: "asJavaScriptSelector",
  8668. category: 'converting',
  8669. fn: function () {
  8670. var self=this;
  8671. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_asSelector", []), "_replace_with_", ["^_", ""]), "_replace_with_", ["_.*", ""]);
  8672. return self;},
  8673. args: [],
  8674. source: "asJavaScriptSelector\x0a\x09^(self asSelector replace: '^_' with: '') replace: '_.*' with: ''.",
  8675. messageSends: ["replace:with:", "asSelector"],
  8676. referencedClasses: []
  8677. }),
  8678. smalltalk.String);
  8679. smalltalk.addMethod(
  8680. "_asJavascript",
  8681. smalltalk.method({
  8682. selector: "asJavascript",
  8683. category: 'converting',
  8684. fn: function () {
  8685. var self=this;
  8686. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  8687. return "\"" + self.replace(/[\x00-\x1f"\\\x7f-\x9f]/g, function(ch){var c=ch.charCodeAt(0);return "\\x"+("0"+c.toString(16)).slice(-2)}) + "\"";
  8688. else
  8689. return "\"" + self + "\"";
  8690. ;
  8691. return self;},
  8692. args: [],
  8693. source: "asJavascript\x0a\x09<\x0a\x09\x09if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)\x0a\x09\x09\x09return \x22\x5c\x22\x22 + self.replace(/[\x5cx00-\x5cx1f\x22\x5c\x5c\x5cx7f-\x5cx9f]/g, function(ch){var c=ch.charCodeAt(0);return \x22\x5c\x5cx\x22+(\x220\x22+c.toString(16)).slice(-2)}) + \x22\x5c\x22\x22;\x0a\x09\x09else\x0a\x09\x09\x09return \x22\x5c\x22\x22 + self + \x22\x5c\x22\x22;\x0a\x09>",
  8694. messageSends: [],
  8695. referencedClasses: []
  8696. }),
  8697. smalltalk.String);
  8698. smalltalk.addMethod(
  8699. "_asLowercase",
  8700. smalltalk.method({
  8701. selector: "asLowercase",
  8702. category: 'converting',
  8703. fn: function () {
  8704. var self=this;
  8705. return self.toLowerCase();
  8706. return self;},
  8707. args: [],
  8708. source: "asLowercase\x0a\x09<return self.toLowerCase()>",
  8709. messageSends: [],
  8710. referencedClasses: []
  8711. }),
  8712. smalltalk.String);
  8713. smalltalk.addMethod(
  8714. "_asNumber",
  8715. smalltalk.method({
  8716. selector: "asNumber",
  8717. category: 'converting',
  8718. fn: function () {
  8719. var self=this;
  8720. return Number(self);
  8721. return self;},
  8722. args: [],
  8723. source: "asNumber\x0a\x09<return Number(self)>",
  8724. messageSends: [],
  8725. referencedClasses: []
  8726. }),
  8727. smalltalk.String);
  8728. smalltalk.addMethod(
  8729. "_asSelector",
  8730. smalltalk.method({
  8731. selector: "asSelector",
  8732. category: 'converting',
  8733. fn: function () {
  8734. var self=this;
  8735. var selector=nil;
  8736. (selector=smalltalk.send("_", "__comma", [self]));
  8737. (selector=smalltalk.send(selector, "_replace_with_", [":", "_"]));
  8738. (selector=smalltalk.send(selector, "_replace_with_", ["[+]", "_plus"]));
  8739. (selector=smalltalk.send(selector, "_replace_with_", ["-", "_minus"]));
  8740. (selector=smalltalk.send(selector, "_replace_with_", ["[*]", "_star"]));
  8741. (selector=smalltalk.send(selector, "_replace_with_", ["[/]", "_slash"]));
  8742. (selector=smalltalk.send(selector, "_replace_with_", [">", "_gt"]));
  8743. (selector=smalltalk.send(selector, "_replace_with_", ["<", "_lt"]));
  8744. (selector=smalltalk.send(selector, "_replace_with_", ["=", "_eq"]));
  8745. (selector=smalltalk.send(selector, "_replace_with_", [",", "_comma"]));
  8746. (selector=smalltalk.send(selector, "_replace_with_", ["[@]", "_at"]));
  8747. return selector;
  8748. return self;},
  8749. args: [],
  8750. source: "asSelector\x0a\x09\x22If you change this method, change smalltalk.convertSelector too (see js/boot.js file)\x22\x0a\x0a\x09| selector |\x0a\x09selector := '_', self.\x0a\x09selector := selector replace: ':' with: '_'.\x0a\x09selector := selector replace: '[+]' with: '_plus'.\x0a\x09selector := selector replace: '-' with: '_minus'.\x0a\x09selector := selector replace: '[*]' with: '_star'.\x0a\x09selector := selector replace: '[/]' with: '_slash'.\x0a\x09selector := selector replace: '>' with: '_gt'.\x0a\x09selector := selector replace: '<' with: '_lt'.\x0a\x09selector := selector replace: '=' with: '_eq'.\x0a\x09selector := selector replace: ',' with: '_comma'.\x0a\x09selector := selector replace: '[@]' with: '_at'.\x0a\x09^selector",
  8751. messageSends: [",", "replace:with:"],
  8752. referencedClasses: []
  8753. }),
  8754. smalltalk.String);
  8755. smalltalk.addMethod(
  8756. "_asString",
  8757. smalltalk.method({
  8758. selector: "asString",
  8759. category: 'converting',
  8760. fn: function () {
  8761. var self=this;
  8762. return self;
  8763. return self;},
  8764. args: [],
  8765. source: "asString\x0a\x09^self",
  8766. messageSends: [],
  8767. referencedClasses: []
  8768. }),
  8769. smalltalk.String);
  8770. smalltalk.addMethod(
  8771. "_asSymbol",
  8772. smalltalk.method({
  8773. selector: "asSymbol",
  8774. category: 'converting',
  8775. fn: function () {
  8776. var self=this;
  8777. return smalltalk.send((smalltalk.Symbol || Symbol), "_lookup_", [self]);
  8778. return self;},
  8779. args: [],
  8780. source: "asSymbol\x0a\x09^Symbol lookup: self",
  8781. messageSends: ["lookup:"],
  8782. referencedClasses: ["Symbol"]
  8783. }),
  8784. smalltalk.String);
  8785. smalltalk.addMethod(
  8786. "_asUppercase",
  8787. smalltalk.method({
  8788. selector: "asUppercase",
  8789. category: 'converting',
  8790. fn: function () {
  8791. var self=this;
  8792. return self.toUpperCase();
  8793. return self;},
  8794. args: [],
  8795. source: "asUppercase\x0a\x09<return self.toUpperCase()>",
  8796. messageSends: [],
  8797. referencedClasses: []
  8798. }),
  8799. smalltalk.String);
  8800. smalltalk.addMethod(
  8801. "_asciiValue",
  8802. smalltalk.method({
  8803. selector: "asciiValue",
  8804. category: 'accessing',
  8805. fn: function () {
  8806. var self=this;
  8807. return self.charCodeAt(0);;
  8808. return self;},
  8809. args: [],
  8810. source: "asciiValue\x0a\x09<return self.charCodeAt(0);>",
  8811. messageSends: [],
  8812. referencedClasses: []
  8813. }),
  8814. smalltalk.String);
  8815. smalltalk.addMethod(
  8816. "_at_ifAbsent_",
  8817. smalltalk.method({
  8818. selector: "at:ifAbsent:",
  8819. category: 'accessing',
  8820. fn: function (anIndex, aBlock) {
  8821. var self=this;
  8822. return self[anIndex - 1] || aBlock();
  8823. return self;},
  8824. args: ["anIndex", "aBlock"],
  8825. source: "at: anIndex ifAbsent: aBlock\x0a\x09<return self[anIndex - 1] || aBlock()>",
  8826. messageSends: [],
  8827. referencedClasses: []
  8828. }),
  8829. smalltalk.String);
  8830. smalltalk.addMethod(
  8831. "_copyFrom_to_",
  8832. smalltalk.method({
  8833. selector: "copyFrom:to:",
  8834. category: 'copying',
  8835. fn: function (anIndex, anotherIndex) {
  8836. var self=this;
  8837. return self.substring(anIndex - 1, anotherIndex);
  8838. return self;},
  8839. args: ["anIndex", "anotherIndex"],
  8840. source: "copyFrom: anIndex to: anotherIndex\x0a\x09<return self.substring(anIndex - 1, anotherIndex)>",
  8841. messageSends: [],
  8842. referencedClasses: []
  8843. }),
  8844. smalltalk.String);
  8845. smalltalk.addMethod(
  8846. "_deepCopy",
  8847. smalltalk.method({
  8848. selector: "deepCopy",
  8849. category: 'copying',
  8850. fn: function () {
  8851. var self=this;
  8852. return smalltalk.send(self, "_shallowCopy", []);
  8853. return self;},
  8854. args: [],
  8855. source: "deepCopy\x0a\x09^self shallowCopy",
  8856. messageSends: ["shallowCopy"],
  8857. referencedClasses: []
  8858. }),
  8859. smalltalk.String);
  8860. smalltalk.addMethod(
  8861. "_escaped",
  8862. smalltalk.method({
  8863. selector: "escaped",
  8864. category: 'accessing',
  8865. fn: function () {
  8866. var self=this;
  8867. return escape(self);
  8868. return self;},
  8869. args: [],
  8870. source: "escaped\x0a\x09<return escape(self)>",
  8871. messageSends: [],
  8872. referencedClasses: []
  8873. }),
  8874. smalltalk.String);
  8875. smalltalk.addMethod(
  8876. "_includesSubString_",
  8877. smalltalk.method({
  8878. selector: "includesSubString:",
  8879. category: 'testing',
  8880. fn: function (subString) {
  8881. var self=this;
  8882. return self.indexOf(subString) != -1 ;
  8883. return self;},
  8884. args: ["subString"],
  8885. source: "includesSubString: subString\x0a\x09< return self.indexOf(subString) != -1 >",
  8886. messageSends: [],
  8887. referencedClasses: []
  8888. }),
  8889. smalltalk.String);
  8890. smalltalk.addMethod(
  8891. "_isString",
  8892. smalltalk.method({
  8893. selector: "isString",
  8894. category: 'testing',
  8895. fn: function () {
  8896. var self=this;
  8897. return true;
  8898. return self;},
  8899. args: [],
  8900. source: "isString\x0a\x09^true",
  8901. messageSends: [],
  8902. referencedClasses: []
  8903. }),
  8904. smalltalk.String);
  8905. smalltalk.addMethod(
  8906. "_join_",
  8907. smalltalk.method({
  8908. selector: "join:",
  8909. category: 'split join',
  8910. fn: function (aCollection) {
  8911. var self=this;
  8912. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(stream){return smalltalk.send(aCollection, "_do_separatedBy_", [(function(each){return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(each, "_asString", [])]);}), (function(){return smalltalk.send(stream, "_nextPutAll_", [self]);})]);})]);
  8913. return self;},
  8914. args: ["aCollection"],
  8915. source: "join: aCollection \x0a\x09^ String\x0a\x09\x09streamContents: [:stream | aCollection\x0a\x09\x09\x09\x09do: [:each | stream nextPutAll: each asString] \x0a\x09\x09\x09\x09separatedBy: [stream nextPutAll: self]]",
  8916. messageSends: ["streamContents:", "do:separatedBy:", "nextPutAll:", "asString"],
  8917. referencedClasses: ["String"]
  8918. }),
  8919. smalltalk.String);
  8920. smalltalk.addMethod(
  8921. "_lineIndicesDo_",
  8922. smalltalk.method({
  8923. selector: "lineIndicesDo:",
  8924. category: 'split join',
  8925. fn: function (aBlock) {
  8926. var self=this;
  8927. var $early={};
  8928. try{var cr=nil;
  8929. var lf=nil;
  8930. var start=nil;
  8931. var sz=nil;
  8932. var nextLF=nil;
  8933. var nextCR=nil;
  8934. (start=(1));
  8935. (sz=smalltalk.send(self, "_size", []));
  8936. (cr=smalltalk.send((smalltalk.String || String), "_cr", []));
  8937. (nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, (1)]));
  8938. (lf=smalltalk.send((smalltalk.String || String), "_lf", []));
  8939. (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, (1)]));
  8940. (function(){while((function(){return ((($receiver = start).klass === smalltalk.Number) ? $receiver <=sz : smalltalk.send($receiver, "__lt_eq", [sz]));})()) {(function(){((($receiver = smalltalk.send(smalltalk.send(nextLF, "__eq", [(0)]), "_and_", [(function(){return smalltalk.send(nextCR, "__eq", [(0)]);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, sz, sz]);return (function(){throw $early=function(){return self}})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, sz, sz]);return (function(){throw $early=function(){return self}})();})]));return ((($receiver = smalltalk.send(smalltalk.send(nextCR, "__eq", [(0)]), "_or_", [(function(){return smalltalk.send((0) < nextLF, "_and_", [(function(){return ((($receiver = nextLF).klass === smalltalk.Number) ? $receiver <nextCR : smalltalk.send($receiver, "__lt", [nextCR]));})]);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextLF).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));})() : (function(){return ((($receiver = smalltalk.send((1) + nextCR, "__eq", [nextLF])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);(nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));})() : (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextCR]);(start=(1) + nextCR);return (nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);(nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));}), (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextCR]);(start=(1) + nextCR);return (nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextLF).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));}), (function(){return ((($receiver = smalltalk.send((1) + nextCR, "__eq", [nextLF])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);(nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));})() : (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextCR]);(start=(1) + nextCR);return (nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);(nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));}), (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextCR]);(start=(1) + nextCR);return (nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));})]));})]));})()}})();
  8941. return self;
  8942. } catch(e) {if(e===$early)return e(); throw e}},
  8943. args: ["aBlock"],
  8944. source: "lineIndicesDo: aBlock\x0a\x09\x22execute aBlock with 3 arguments for each line:\x0a\x09- start index of line\x0a\x09- end index of line without line delimiter\x0a\x09- end index of line including line delimiter(s) CR, LF or CRLF\x22\x0a\x09\x0a\x09| cr lf start sz nextLF nextCR |\x0a\x09start := 1.\x0a\x09sz := self size.\x0a\x09cr := String cr.\x0a\x09nextCR := self indexOf: cr startingAt: 1.\x0a\x09lf := String lf.\x0a\x09nextLF := self indexOf: lf startingAt: 1.\x0a\x09[ start <= sz ] whileTrue: [\x0a\x09\x09(nextLF = 0 and: [ nextCR = 0 ])\x0a\x09\x09\x09ifTrue: [ \x22No more CR, nor LF, the string is over\x22\x0a\x09\x09\x09\x09\x09aBlock value: start value: sz value: sz.\x0a\x09\x09\x09\x09\x09^self ].\x0a\x09\x09(nextCR = 0 or: [ 0 < nextLF and: [ nextLF < nextCR ] ])\x0a\x09\x09\x09ifTrue: [ \x22Found a LF\x22\x0a\x09\x09\x09\x09\x09aBlock value: start value: nextLF - 1 value: nextLF.\x0a\x09\x09\x09\x09\x09start := 1 + nextLF.\x0a\x09\x09\x09\x09\x09nextLF := self indexOf: lf startingAt: start ]\x0a\x09\x09\x09ifFalse: [ 1 + nextCR = nextLF\x0a\x09\x09\x09\x09ifTrue: [ \x22Found a CR-LF pair\x22\x0a\x09\x09\x09\x09\x09aBlock value: start value: nextCR - 1 value: nextLF.\x0a\x09\x09\x09\x09\x09start := 1 + nextLF.\x0a\x09\x09\x09\x09\x09nextCR := self indexOf: cr startingAt: start.\x0a\x09\x09\x09\x09\x09nextLF := self indexOf: lf startingAt: start ]\x0a\x09\x09\x09\x09ifFalse: [ \x22Found a CR\x22\x0a\x09\x09\x09\x09\x09aBlock value: start value: nextCR - 1 value: nextCR.\x0a\x09\x09\x09\x09\x09start := 1 + nextCR.\x0a\x09\x09\x09\x09\x09nextCR := self indexOf: cr startingAt: start ]]]",
  8945. messageSends: ["size", "cr", "indexOf:startingAt:", "lf", "whileTrue:", "<=", "ifTrue:", "and:", "=", "value:value:value:", "ifTrue:ifFalse:", "or:", "<", "-", "+"],
  8946. referencedClasses: ["String"]
  8947. }),
  8948. smalltalk.String);
  8949. smalltalk.addMethod(
  8950. "_lineNumber_",
  8951. smalltalk.method({
  8952. selector: "lineNumber:",
  8953. category: 'split join',
  8954. fn: function (anIndex) {
  8955. var self=this;
  8956. var $early={};
  8957. try{var lineCount=nil;
  8958. (lineCount=(0));
  8959. smalltalk.send(self, "_lineIndicesDo_", [(function(start, endWithoutDelimiters, end){return ((($receiver = smalltalk.send((lineCount=((($receiver = lineCount).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))), "__eq", [anIndex])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function(){throw $early=function(){return smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])}})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function(){throw $early=function(){return smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])}})();})]));})]);
  8960. return nil;
  8961. return self;
  8962. } catch(e) {if(e===$early)return e(); throw e}},
  8963. args: ["anIndex"],
  8964. source: "lineNumber: anIndex\x0a\x09\x22Answer a string containing the characters in the given line number.\x22\x0a\x0a\x09| lineCount |\x0a\x09lineCount := 0.\x0a\x09self lineIndicesDo: [:start :endWithoutDelimiters :end |\x0a\x09\x09(lineCount := lineCount + 1) = anIndex ifTrue: [^self copyFrom: start to: endWithoutDelimiters]].\x0a\x09^nil",
  8965. messageSends: ["lineIndicesDo:", "ifTrue:", "=", "+", "copyFrom:to:"],
  8966. referencedClasses: []
  8967. }),
  8968. smalltalk.String);
  8969. smalltalk.addMethod(
  8970. "_lines",
  8971. smalltalk.method({
  8972. selector: "lines",
  8973. category: 'split join',
  8974. fn: function () {
  8975. var self=this;
  8976. var lines=nil;
  8977. (lines=smalltalk.send((smalltalk.Array || Array), "_new", []));
  8978. smalltalk.send(self, "_linesDo_", [(function(aLine){return smalltalk.send(lines, "_add_", [aLine]);})]);
  8979. return lines;
  8980. return self;},
  8981. args: [],
  8982. source: "lines\x0a\x09\x22Answer an array of lines composing this receiver without the line ending delimiters.\x22\x0a\x0a\x09| lines |\x0a\x09lines := Array new.\x0a\x09self linesDo: [:aLine | lines add: aLine].\x0a\x09^lines",
  8983. messageSends: ["new", "linesDo:", "add:"],
  8984. referencedClasses: ["Array"]
  8985. }),
  8986. smalltalk.String);
  8987. smalltalk.addMethod(
  8988. "_linesDo_",
  8989. smalltalk.method({
  8990. selector: "linesDo:",
  8991. category: 'split join',
  8992. fn: function (aBlock) {
  8993. var self=this;
  8994. smalltalk.send(self, "_lineIndicesDo_", [(function(start, endWithoutDelimiters, end){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])]);})]);
  8995. return self;},
  8996. args: ["aBlock"],
  8997. source: "linesDo: aBlock\x0a\x09\x22Execute aBlock with each line in this string. The terminating line\x0a\x09delimiters CR, LF or CRLF pairs are not included in what is passed to aBlock\x22\x0a\x0a\x09self lineIndicesDo: [:start :endWithoutDelimiters :end |\x0a\x09\x09aBlock value: (self copyFrom: start to: endWithoutDelimiters)]",
  8998. messageSends: ["lineIndicesDo:", "value:", "copyFrom:to:"],
  8999. referencedClasses: []
  9000. }),
  9001. smalltalk.String);
  9002. smalltalk.addMethod(
  9003. "_match_",
  9004. smalltalk.method({
  9005. selector: "match:",
  9006. category: 'regular expressions',
  9007. fn: function (aRegexp) {
  9008. var self=this;
  9009. return self.search(aRegexp) != -1;
  9010. return self;},
  9011. args: ["aRegexp"],
  9012. source: "match: aRegexp\x0a\x09<return self.search(aRegexp) != -1>",
  9013. messageSends: [],
  9014. referencedClasses: []
  9015. }),
  9016. smalltalk.String);
  9017. smalltalk.addMethod(
  9018. "_matchesOf_",
  9019. smalltalk.method({
  9020. selector: "matchesOf:",
  9021. category: 'regular expressions',
  9022. fn: function (aRegularExpression) {
  9023. var self=this;
  9024. return self.match(aRegularExpression);
  9025. return self;},
  9026. args: ["aRegularExpression"],
  9027. source: "matchesOf: aRegularExpression\x0a <return self.match(aRegularExpression)>",
  9028. messageSends: [],
  9029. referencedClasses: []
  9030. }),
  9031. smalltalk.String);
  9032. smalltalk.addMethod(
  9033. "_printNl",
  9034. smalltalk.method({
  9035. selector: "printNl",
  9036. category: 'printing',
  9037. fn: function () {
  9038. var self=this;
  9039. console.log(self);
  9040. return self;},
  9041. args: [],
  9042. source: "printNl\x0a\x09<console.log(self)>",
  9043. messageSends: [],
  9044. referencedClasses: []
  9045. }),
  9046. smalltalk.String);
  9047. smalltalk.addMethod(
  9048. "_printString",
  9049. smalltalk.method({
  9050. selector: "printString",
  9051. category: 'printing',
  9052. fn: function () {
  9053. var self=this;
  9054. return smalltalk.send(smalltalk.send("'", "__comma", [self]), "__comma", ["'"]);
  9055. return self;},
  9056. args: [],
  9057. source: "printString\x0a\x09^'''', self, ''''",
  9058. messageSends: [","],
  9059. referencedClasses: []
  9060. }),
  9061. smalltalk.String);
  9062. smalltalk.addMethod(
  9063. "_replace_with_",
  9064. smalltalk.method({
  9065. selector: "replace:with:",
  9066. category: 'regular expressions',
  9067. fn: function (aString, anotherString) {
  9068. var self=this;
  9069. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [aString, "g"]), anotherString]);
  9070. return self;},
  9071. args: ["aString", "anotherString"],
  9072. source: "replace: aString with: anotherString\x0a\x09^self replaceRegexp: (RegularExpression fromString: aString flag: 'g') with: anotherString",
  9073. messageSends: ["replaceRegexp:with:", "fromString:flag:"],
  9074. referencedClasses: ["RegularExpression"]
  9075. }),
  9076. smalltalk.String);
  9077. smalltalk.addMethod(
  9078. "_replaceRegexp_with_",
  9079. smalltalk.method({
  9080. selector: "replaceRegexp:with:",
  9081. category: 'regular expressions',
  9082. fn: function (aRegexp, aString) {
  9083. var self=this;
  9084. return self.replace(aRegexp, aString);
  9085. return self;},
  9086. args: ["aRegexp", "aString"],
  9087. source: "replaceRegexp: aRegexp with: aString\x0a\x09<return self.replace(aRegexp, aString)>",
  9088. messageSends: [],
  9089. referencedClasses: []
  9090. }),
  9091. smalltalk.String);
  9092. smalltalk.addMethod(
  9093. "_reversed",
  9094. smalltalk.method({
  9095. selector: "reversed",
  9096. category: 'converting',
  9097. fn: function () {
  9098. var self=this;
  9099. return self.split("").reverse().join("");
  9100. return self;},
  9101. args: [],
  9102. source: "reversed\x0a\x09<return self.split(\x22\x22).reverse().join(\x22\x22)>",
  9103. messageSends: [],
  9104. referencedClasses: []
  9105. }),
  9106. smalltalk.String);
  9107. smalltalk.addMethod(
  9108. "_shallowCopy",
  9109. smalltalk.method({
  9110. selector: "shallowCopy",
  9111. category: 'copying',
  9112. fn: function () {
  9113. var self=this;
  9114. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [self]);
  9115. return self;},
  9116. args: [],
  9117. source: "shallowCopy\x0a\x09^self class fromString: self",
  9118. messageSends: ["fromString:", "class"],
  9119. referencedClasses: []
  9120. }),
  9121. smalltalk.String);
  9122. smalltalk.addMethod(
  9123. "_size",
  9124. smalltalk.method({
  9125. selector: "size",
  9126. category: 'accessing',
  9127. fn: function () {
  9128. var self=this;
  9129. return self.length;
  9130. return self;},
  9131. args: [],
  9132. source: "size\x0a\x09<return self.length>",
  9133. messageSends: [],
  9134. referencedClasses: []
  9135. }),
  9136. smalltalk.String);
  9137. smalltalk.addMethod(
  9138. "_tokenize_",
  9139. smalltalk.method({
  9140. selector: "tokenize:",
  9141. category: 'converting',
  9142. fn: function (aString) {
  9143. var self=this;
  9144. return self.split(aString);
  9145. return self;},
  9146. args: ["aString"],
  9147. source: "tokenize: aString\x0a\x09<return self.split(aString)>",
  9148. messageSends: [],
  9149. referencedClasses: []
  9150. }),
  9151. smalltalk.String);
  9152. smalltalk.addMethod(
  9153. "_trimBoth",
  9154. smalltalk.method({
  9155. selector: "trimBoth",
  9156. category: 'regular expressions',
  9157. fn: function () {
  9158. var self=this;
  9159. return smalltalk.send(self, "_trimBoth_", ["\x5cs"]);
  9160. return self;},
  9161. args: [],
  9162. source: "trimBoth\x0a\x09^self trimBoth: '\x5cs'",
  9163. messageSends: ["trimBoth:"],
  9164. referencedClasses: []
  9165. }),
  9166. smalltalk.String);
  9167. smalltalk.addMethod(
  9168. "_trimBoth_",
  9169. smalltalk.method({
  9170. selector: "trimBoth:",
  9171. category: 'regular expressions',
  9172. fn: function (separators) {
  9173. var self=this;
  9174. return smalltalk.send(smalltalk.send(self, "_trimLeft_", [separators]), "_trimRight_", [separators]);
  9175. return self;},
  9176. args: ["separators"],
  9177. source: "trimBoth: separators\x0a\x0a\x09^(self trimLeft: separators) trimRight: separators",
  9178. messageSends: ["trimRight:", "trimLeft:"],
  9179. referencedClasses: []
  9180. }),
  9181. smalltalk.String);
  9182. smalltalk.addMethod(
  9183. "_trimLeft",
  9184. smalltalk.method({
  9185. selector: "trimLeft",
  9186. category: 'regular expressions',
  9187. fn: function () {
  9188. var self=this;
  9189. return smalltalk.send(self, "_trimLeft_", ["\x5cs"]);
  9190. return self;},
  9191. args: [],
  9192. source: "trimLeft\x0a\x09^self trimLeft: '\x5cs'",
  9193. messageSends: ["trimLeft:"],
  9194. referencedClasses: []
  9195. }),
  9196. smalltalk.String);
  9197. smalltalk.addMethod(
  9198. "_trimLeft_",
  9199. smalltalk.method({
  9200. selector: "trimLeft:",
  9201. category: 'regular expressions',
  9202. fn: function (separators) {
  9203. var self=this;
  9204. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [smalltalk.send(smalltalk.send("^[", "__comma", [separators]), "__comma", ["]+"]), "g"]), ""]);
  9205. return self;},
  9206. args: ["separators"],
  9207. source: "trimLeft: separators\x0a\x0a\x09^self replaceRegexp: (RegularExpression fromString: '^[', separators, ']+' flag: 'g') with: ''",
  9208. messageSends: ["replaceRegexp:with:", "fromString:flag:", ","],
  9209. referencedClasses: ["RegularExpression"]
  9210. }),
  9211. smalltalk.String);
  9212. smalltalk.addMethod(
  9213. "_trimRight",
  9214. smalltalk.method({
  9215. selector: "trimRight",
  9216. category: 'regular expressions',
  9217. fn: function () {
  9218. var self=this;
  9219. return smalltalk.send(self, "_trimRight_", ["\x5cs"]);
  9220. return self;},
  9221. args: [],
  9222. source: "trimRight\x0a\x09^self trimRight: '\x5cs'",
  9223. messageSends: ["trimRight:"],
  9224. referencedClasses: []
  9225. }),
  9226. smalltalk.String);
  9227. smalltalk.addMethod(
  9228. "_trimRight_",
  9229. smalltalk.method({
  9230. selector: "trimRight:",
  9231. category: 'regular expressions',
  9232. fn: function (separators) {
  9233. var self=this;
  9234. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [smalltalk.send(smalltalk.send("[", "__comma", [separators]), "__comma", ["]+$"]), "g"]), ""]);
  9235. return self;},
  9236. args: ["separators"],
  9237. source: "trimRight: separators\x0a\x0a\x09^self replaceRegexp: (RegularExpression fromString: '[', separators, ']+$' flag: 'g') with: ''",
  9238. messageSends: ["replaceRegexp:with:", "fromString:flag:", ","],
  9239. referencedClasses: ["RegularExpression"]
  9240. }),
  9241. smalltalk.String);
  9242. smalltalk.addMethod(
  9243. "_unescaped",
  9244. smalltalk.method({
  9245. selector: "unescaped",
  9246. category: 'accessing',
  9247. fn: function () {
  9248. var self=this;
  9249. return unescape(self);
  9250. return self;},
  9251. args: [],
  9252. source: "unescaped\x0a\x09<return unescape(self)>",
  9253. messageSends: [],
  9254. referencedClasses: []
  9255. }),
  9256. smalltalk.String);
  9257. smalltalk.addMethod(
  9258. "_cr",
  9259. smalltalk.method({
  9260. selector: "cr",
  9261. category: 'accessing',
  9262. fn: function () {
  9263. var self=this;
  9264. return '\r';
  9265. return self;},
  9266. args: [],
  9267. source: "cr\x0a\x09<return '\x5cr'>",
  9268. messageSends: [],
  9269. referencedClasses: []
  9270. }),
  9271. smalltalk.String.klass);
  9272. smalltalk.addMethod(
  9273. "_crlf",
  9274. smalltalk.method({
  9275. selector: "crlf",
  9276. category: 'accessing',
  9277. fn: function () {
  9278. var self=this;
  9279. return '\r\n';
  9280. return self;},
  9281. args: [],
  9282. source: "crlf\x0a\x09<return '\x5cr\x5cn'>",
  9283. messageSends: [],
  9284. referencedClasses: []
  9285. }),
  9286. smalltalk.String.klass);
  9287. smalltalk.addMethod(
  9288. "_fromString_",
  9289. smalltalk.method({
  9290. selector: "fromString:",
  9291. category: 'instance creation',
  9292. fn: function (aString) {
  9293. var self=this;
  9294. return new self.fn(aString);
  9295. return self;},
  9296. args: ["aString"],
  9297. source: "fromString: aString\x0a\x09 <return new self.fn(aString)>",
  9298. messageSends: [],
  9299. referencedClasses: []
  9300. }),
  9301. smalltalk.String.klass);
  9302. smalltalk.addMethod(
  9303. "_lf",
  9304. smalltalk.method({
  9305. selector: "lf",
  9306. category: 'accessing',
  9307. fn: function () {
  9308. var self=this;
  9309. return '\n';
  9310. return self;},
  9311. args: [],
  9312. source: "lf\x0a\x09<return '\x5cn'>",
  9313. messageSends: [],
  9314. referencedClasses: []
  9315. }),
  9316. smalltalk.String.klass);
  9317. smalltalk.addMethod(
  9318. "_space",
  9319. smalltalk.method({
  9320. selector: "space",
  9321. category: 'accessing',
  9322. fn: function () {
  9323. var self=this;
  9324. return ' ';
  9325. return self;},
  9326. args: [],
  9327. source: "space\x0a\x09<return ' '>",
  9328. messageSends: [],
  9329. referencedClasses: []
  9330. }),
  9331. smalltalk.String.klass);
  9332. smalltalk.addMethod(
  9333. "_streamClass",
  9334. smalltalk.method({
  9335. selector: "streamClass",
  9336. category: 'accessing',
  9337. fn: function () {
  9338. var self=this;
  9339. return (smalltalk.StringStream || StringStream);
  9340. return self;},
  9341. args: [],
  9342. source: "streamClass\x0a\x09 ^StringStream",
  9343. messageSends: [],
  9344. referencedClasses: ["StringStream"]
  9345. }),
  9346. smalltalk.String.klass);
  9347. smalltalk.addMethod(
  9348. "_streamContents_",
  9349. smalltalk.method({
  9350. selector: "streamContents:",
  9351. category: 'instance creation',
  9352. fn: function (blockWithArg) {
  9353. var self=this;
  9354. var stream=nil;
  9355. (stream=smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [smalltalk.send((smalltalk.String || String), "_new", [])]));
  9356. smalltalk.send(blockWithArg, "_value_", [stream]);
  9357. return smalltalk.send(stream, "_contents", []);
  9358. return self;},
  9359. args: ["blockWithArg"],
  9360. source: "streamContents: blockWithArg\x0a\x09|stream|\x0a\x09stream := (self streamClass on: String new).\x0a\x09blockWithArg value: stream.\x0a\x09^ stream contents",
  9361. messageSends: ["on:", "streamClass", "new", "value:", "contents"],
  9362. referencedClasses: ["String"]
  9363. }),
  9364. smalltalk.String.klass);
  9365. smalltalk.addMethod(
  9366. "_tab",
  9367. smalltalk.method({
  9368. selector: "tab",
  9369. category: 'accessing',
  9370. fn: function () {
  9371. var self=this;
  9372. return '\t';
  9373. return self;},
  9374. args: [],
  9375. source: "tab\x0a\x09<return '\x5ct'>",
  9376. messageSends: [],
  9377. referencedClasses: []
  9378. }),
  9379. smalltalk.String.klass);
  9380. smalltalk.addMethod(
  9381. "_value_",
  9382. smalltalk.method({
  9383. selector: "value:",
  9384. category: 'instance creation',
  9385. fn: function (aUTFCharCode) {
  9386. var self=this;
  9387. return String.fromCharCode(aUTFCharCode);;
  9388. return self;},
  9389. args: ["aUTFCharCode"],
  9390. source: "value: aUTFCharCode\x0a\x0a\x09<return String.fromCharCode(aUTFCharCode);>",
  9391. messageSends: [],
  9392. referencedClasses: []
  9393. }),
  9394. smalltalk.String.klass);
  9395. smalltalk.addClass('Symbol', smalltalk.CharacterArray, [], 'Kernel-Collections');
  9396. smalltalk.addMethod(
  9397. "__lt",
  9398. smalltalk.method({
  9399. selector: "<",
  9400. category: 'comparing',
  9401. fn: function (aSymbol) {
  9402. var self=this;
  9403. return ((($receiver = smalltalk.send(self, "_asString", [])).klass === smalltalk.Number) ? $receiver <smalltalk.send(aSymbol, "_asString", []) : smalltalk.send($receiver, "__lt", [smalltalk.send(aSymbol, "_asString", [])]));
  9404. return self;},
  9405. args: ["aSymbol"],
  9406. source: "< aSymbol\x0a\x09^self asString < aSymbol asString",
  9407. messageSends: ["<", "asString"],
  9408. referencedClasses: []
  9409. }),
  9410. smalltalk.Symbol);
  9411. smalltalk.addMethod(
  9412. "__lt_eq",
  9413. smalltalk.method({
  9414. selector: "<=",
  9415. category: 'comparing',
  9416. fn: function (aSymbol) {
  9417. var self=this;
  9418. return ((($receiver = smalltalk.send(self, "_asString", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(aSymbol, "_asString", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(aSymbol, "_asString", [])]));
  9419. return self;},
  9420. args: ["aSymbol"],
  9421. source: "<= aSymbol\x0a\x09^self asString <= aSymbol asString",
  9422. messageSends: ["<=", "asString"],
  9423. referencedClasses: []
  9424. }),
  9425. smalltalk.Symbol);
  9426. smalltalk.addMethod(
  9427. "__eq",
  9428. smalltalk.method({
  9429. selector: "=",
  9430. category: 'comparing',
  9431. fn: function (aSymbol) {
  9432. var self=this;
  9433. var $early={};
  9434. try{((($receiver = smalltalk.send(smalltalk.send(aSymbol, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw $early=function(){return false}})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw $early=function(){return false}})();})]));
  9435. return smalltalk.send(smalltalk.send(self, "_asString", []), "__eq", [smalltalk.send(aSymbol, "_asString", [])]);
  9436. return self;
  9437. } catch(e) {if(e===$early)return e(); throw e}},
  9438. args: ["aSymbol"],
  9439. source: "= aSymbol\x0a\x09aSymbol class = self class ifFalse: [^false].\x0a\x09^self asString = aSymbol asString",
  9440. messageSends: ["ifFalse:", "=", "class", "asString"],
  9441. referencedClasses: []
  9442. }),
  9443. smalltalk.Symbol);
  9444. smalltalk.addMethod(
  9445. "__gt",
  9446. smalltalk.method({
  9447. selector: ">",
  9448. category: 'comparing',
  9449. fn: function (aSymbol) {
  9450. var self=this;
  9451. return ((($receiver = smalltalk.send(self, "_asString", [])).klass === smalltalk.Number) ? $receiver >smalltalk.send(aSymbol, "_asString", []) : smalltalk.send($receiver, "__gt", [smalltalk.send(aSymbol, "_asString", [])]));
  9452. return self;},
  9453. args: ["aSymbol"],
  9454. source: "> aSymbol\x0a\x09^self asString > aSymbol asString",
  9455. messageSends: [">", "asString"],
  9456. referencedClasses: []
  9457. }),
  9458. smalltalk.Symbol);
  9459. smalltalk.addMethod(
  9460. "__gt_eq",
  9461. smalltalk.method({
  9462. selector: ">=",
  9463. category: 'comparing',
  9464. fn: function (aSymbol) {
  9465. var self=this;
  9466. return ((($receiver = smalltalk.send(self, "_asString", [])).klass === smalltalk.Number) ? $receiver >=smalltalk.send(aSymbol, "_asString", []) : smalltalk.send($receiver, "__gt_eq", [smalltalk.send(aSymbol, "_asString", [])]));
  9467. return self;},
  9468. args: ["aSymbol"],
  9469. source: ">= aSymbol\x0a\x09^self asString >= aSymbol asString",
  9470. messageSends: [">=", "asString"],
  9471. referencedClasses: []
  9472. }),
  9473. smalltalk.Symbol);
  9474. smalltalk.addMethod(
  9475. "_asJSON",
  9476. smalltalk.method({
  9477. selector: "asJSON",
  9478. category: 'converting',
  9479. fn: function () {
  9480. var self=this;
  9481. return smalltalk.send(smalltalk.send(self, "_asString", []), "_asJSON", []);
  9482. return self;},
  9483. args: [],
  9484. source: "asJSON\x0a\x09^self asString asJSON",
  9485. messageSends: ["asJSON", "asString"],
  9486. referencedClasses: []
  9487. }),
  9488. smalltalk.Symbol);
  9489. smalltalk.addMethod(
  9490. "_asJavascript",
  9491. smalltalk.method({
  9492. selector: "asJavascript",
  9493. category: 'converting',
  9494. fn: function () {
  9495. var self=this;
  9496. return smalltalk.send(smalltalk.send("smalltalk.symbolFor(\x22", "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", ["\x22)"]);
  9497. return self;},
  9498. args: [],
  9499. source: "asJavascript\x0a\x09^'smalltalk.symbolFor(\x22', self asString, '\x22)'",
  9500. messageSends: [",", "asString"],
  9501. referencedClasses: []
  9502. }),
  9503. smalltalk.Symbol);
  9504. smalltalk.addMethod(
  9505. "_asSelector",
  9506. smalltalk.method({
  9507. selector: "asSelector",
  9508. category: 'converting',
  9509. fn: function () {
  9510. var self=this;
  9511. return smalltalk.send(smalltalk.send(self, "_asString", []), "_asSelector", []);
  9512. return self;},
  9513. args: [],
  9514. source: "asSelector\x0a\x09^self asString asSelector",
  9515. messageSends: ["asSelector", "asString"],
  9516. referencedClasses: []
  9517. }),
  9518. smalltalk.Symbol);
  9519. smalltalk.addMethod(
  9520. "_asString",
  9521. smalltalk.method({
  9522. selector: "asString",
  9523. category: 'converting',
  9524. fn: function () {
  9525. var self=this;
  9526. return self.value;
  9527. return self;},
  9528. args: [],
  9529. source: "asString\x0a\x09<return self.value>",
  9530. messageSends: [],
  9531. referencedClasses: []
  9532. }),
  9533. smalltalk.Symbol);
  9534. smalltalk.addMethod(
  9535. "_asSymbol",
  9536. smalltalk.method({
  9537. selector: "asSymbol",
  9538. category: 'converting',
  9539. fn: function () {
  9540. var self=this;
  9541. return self;
  9542. return self;},
  9543. args: [],
  9544. source: "asSymbol\x0a\x09^self",
  9545. messageSends: [],
  9546. referencedClasses: []
  9547. }),
  9548. smalltalk.Symbol);
  9549. smalltalk.addMethod(
  9550. "_at_ifAbsent_",
  9551. smalltalk.method({
  9552. selector: "at:ifAbsent:",
  9553. category: 'accessing',
  9554. fn: function (anIndex, aBlock) {
  9555. var self=this;
  9556. return smalltalk.send(smalltalk.send(self, "_asString", []), "_at_ifAbsent_", [anIndex, aBlock]);
  9557. return self;},
  9558. args: ["anIndex", "aBlock"],
  9559. source: "at: anIndex ifAbsent: aBlock\x0a\x09^self asString at: anIndex ifAbsent: aBlock",
  9560. messageSends: ["at:ifAbsent:", "asString"],
  9561. referencedClasses: []
  9562. }),
  9563. smalltalk.Symbol);
  9564. smalltalk.addMethod(
  9565. "_copyFrom_to_",
  9566. smalltalk.method({
  9567. selector: "copyFrom:to:",
  9568. category: 'copying',
  9569. fn: function (anIndex, anotherIndex) {
  9570. var self=this;
  9571. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [smalltalk.send(smalltalk.send(self, "_asString", []), "_copyFrom_to_", [anIndex, anotherIndex])]);
  9572. return self;},
  9573. args: ["anIndex", "anotherIndex"],
  9574. source: "copyFrom: anIndex to: anotherIndex\x0a\x09^self class fromString: (self asString copyFrom: anIndex to: anotherIndex)",
  9575. messageSends: ["fromString:", "class", "copyFrom:to:", "asString"],
  9576. referencedClasses: []
  9577. }),
  9578. smalltalk.Symbol);
  9579. smalltalk.addMethod(
  9580. "_deepCopy",
  9581. smalltalk.method({
  9582. selector: "deepCopy",
  9583. category: 'copying',
  9584. fn: function () {
  9585. var self=this;
  9586. return self;
  9587. return self;},
  9588. args: [],
  9589. source: "deepCopy\x0a\x09^self",
  9590. messageSends: [],
  9591. referencedClasses: []
  9592. }),
  9593. smalltalk.Symbol);
  9594. smalltalk.addMethod(
  9595. "_isSymbol",
  9596. smalltalk.method({
  9597. selector: "isSymbol",
  9598. category: 'printing',
  9599. fn: function () {
  9600. var self=this;
  9601. return true;
  9602. return self;},
  9603. args: [],
  9604. source: "isSymbol\x0a\x09^true",
  9605. messageSends: [],
  9606. referencedClasses: []
  9607. }),
  9608. smalltalk.Symbol);
  9609. smalltalk.addMethod(
  9610. "_printString",
  9611. smalltalk.method({
  9612. selector: "printString",
  9613. category: 'printing',
  9614. fn: function () {
  9615. var self=this;
  9616. return smalltalk.send("#", "__comma", [smalltalk.send(self, "_asString", [])]);
  9617. return self;},
  9618. args: [],
  9619. source: "printString\x0a\x09^'#', self asString",
  9620. messageSends: [",", "asString"],
  9621. referencedClasses: []
  9622. }),
  9623. smalltalk.Symbol);
  9624. smalltalk.addMethod(
  9625. "_shallowCopy",
  9626. smalltalk.method({
  9627. selector: "shallowCopy",
  9628. category: 'copying',
  9629. fn: function () {
  9630. var self=this;
  9631. return self;
  9632. return self;},
  9633. args: [],
  9634. source: "shallowCopy\x0a\x09^self",
  9635. messageSends: [],
  9636. referencedClasses: []
  9637. }),
  9638. smalltalk.Symbol);
  9639. smalltalk.addMethod(
  9640. "_size",
  9641. smalltalk.method({
  9642. selector: "size",
  9643. category: 'accessing',
  9644. fn: function () {
  9645. var self=this;
  9646. return smalltalk.send(smalltalk.send(self, "_asString", []), "_size", []);
  9647. return self;},
  9648. args: [],
  9649. source: "size\x0a\x09^self asString size",
  9650. messageSends: ["size", "asString"],
  9651. referencedClasses: []
  9652. }),
  9653. smalltalk.Symbol);
  9654. smalltalk.addMethod(
  9655. "_basicNew",
  9656. smalltalk.method({
  9657. selector: "basicNew",
  9658. category: 'instance creation',
  9659. fn: function () {
  9660. var self=this;
  9661. smalltalk.send(self, "_shouldNotImplement", []);
  9662. return self;},
  9663. args: [],
  9664. source: "basicNew\x0a\x09self shouldNotImplement",
  9665. messageSends: ["shouldNotImplement"],
  9666. referencedClasses: []
  9667. }),
  9668. smalltalk.Symbol.klass);
  9669. smalltalk.addMethod(
  9670. "_fromString_",
  9671. smalltalk.method({
  9672. selector: "fromString:",
  9673. category: 'instance creation',
  9674. fn: function (aString) {
  9675. var self=this;
  9676. return smalltalk.send(self, "_lookup_", [aString]);
  9677. return self;},
  9678. args: ["aString"],
  9679. source: "fromString: aString\x0a\x09^self lookup: aString",
  9680. messageSends: ["lookup:"],
  9681. referencedClasses: []
  9682. }),
  9683. smalltalk.Symbol.klass);
  9684. smalltalk.addMethod(
  9685. "_lookup_",
  9686. smalltalk.method({
  9687. selector: "lookup:",
  9688. category: 'instance creation',
  9689. fn: function (aString) {
  9690. var self=this;
  9691. return smalltalk.symbolFor(aString);;
  9692. return self;},
  9693. args: ["aString"],
  9694. source: "lookup: aString\x0a\x09<return smalltalk.symbolFor(aString);>",
  9695. messageSends: [],
  9696. referencedClasses: []
  9697. }),
  9698. smalltalk.Symbol.klass);
  9699. smalltalk.addClass('Set', smalltalk.Collection, ['elements'], 'Kernel-Collections');
  9700. smalltalk.addMethod(
  9701. "__eq",
  9702. smalltalk.method({
  9703. selector: "=",
  9704. category: 'comparing',
  9705. fn: function (aCollection) {
  9706. var self=this;
  9707. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aCollection, "_class", [])]), "_and_", [(function(){return smalltalk.send(self['@elements'], "__eq", [smalltalk.send(aCollection, "_asArray", [])]);})]);
  9708. return self;},
  9709. args: ["aCollection"],
  9710. source: "= aCollection\x0a\x09^self class = aCollection class and: [\x0a\x09\x09elements = aCollection asArray]",
  9711. messageSends: ["and:", "=", "class", "asArray"],
  9712. referencedClasses: []
  9713. }),
  9714. smalltalk.Set);
  9715. smalltalk.addMethod(
  9716. "_add_",
  9717. smalltalk.method({
  9718. selector: "add:",
  9719. category: 'adding/removing',
  9720. fn: function (anObject) {
  9721. var self=this;
  9722. var found;
  9723. for(var i=0; i < self['@elements'].length; i++) {
  9724. if(anObject == self['@elements'][i]) {
  9725. found = true;
  9726. break;
  9727. }
  9728. }
  9729. if(!found) {self['@elements'].push(anObject)}
  9730. ;
  9731. return self;},
  9732. args: ["anObject"],
  9733. source: "add: anObject\x0a\x09<\x0a\x09\x09var found;\x0a\x09\x09for(var i=0; i < self['@elements'].length; i++) {\x0a\x09\x09\x09if(anObject == self['@elements'][i]) {\x0a\x09\x09\x09\x09found = true;\x0a\x09\x09\x09\x09break;\x0a\x09\x09\x09}\x0a\x09\x09}\x0a\x09\x09if(!found) {self['@elements'].push(anObject)}\x0a\x09>",
  9734. messageSends: [],
  9735. referencedClasses: []
  9736. }),
  9737. smalltalk.Set);
  9738. smalltalk.addMethod(
  9739. "_asArray",
  9740. smalltalk.method({
  9741. selector: "asArray",
  9742. category: 'converting',
  9743. fn: function () {
  9744. var self=this;
  9745. return smalltalk.send(self['@elements'], "_copy", []);
  9746. return self;},
  9747. args: [],
  9748. source: "asArray\x0a\x09^elements copy",
  9749. messageSends: ["copy"],
  9750. referencedClasses: []
  9751. }),
  9752. smalltalk.Set);
  9753. smalltalk.addMethod(
  9754. "_detect_ifNone_",
  9755. smalltalk.method({
  9756. selector: "detect:ifNone:",
  9757. category: 'enumerating',
  9758. fn: function (aBlock, anotherBlock) {
  9759. var self=this;
  9760. return smalltalk.send(self['@elements'], "_detect_ifNone_", [aBlock, anotherBlock]);
  9761. return self;},
  9762. args: ["aBlock", "anotherBlock"],
  9763. source: "detect: aBlock ifNone: anotherBlock\x0a\x09^elements detect: aBlock ifNone: anotherBlock",
  9764. messageSends: ["detect:ifNone:"],
  9765. referencedClasses: []
  9766. }),
  9767. smalltalk.Set);
  9768. smalltalk.addMethod(
  9769. "_do_",
  9770. smalltalk.method({
  9771. selector: "do:",
  9772. category: 'enumerating',
  9773. fn: function (aBlock) {
  9774. var self=this;
  9775. smalltalk.send(self['@elements'], "_do_", [aBlock]);
  9776. return self;},
  9777. args: ["aBlock"],
  9778. source: "do: aBlock\x0a\x09elements do: aBlock",
  9779. messageSends: ["do:"],
  9780. referencedClasses: []
  9781. }),
  9782. smalltalk.Set);
  9783. smalltalk.addMethod(
  9784. "_includes_",
  9785. smalltalk.method({
  9786. selector: "includes:",
  9787. category: 'testing',
  9788. fn: function (anObject) {
  9789. var self=this;
  9790. return smalltalk.send(self['@elements'], "_includes_", [anObject]);
  9791. return self;},
  9792. args: ["anObject"],
  9793. source: "includes: anObject\x0a\x09^elements includes: anObject",
  9794. messageSends: ["includes:"],
  9795. referencedClasses: []
  9796. }),
  9797. smalltalk.Set);
  9798. smalltalk.addMethod(
  9799. "_initialize",
  9800. smalltalk.method({
  9801. selector: "initialize",
  9802. category: 'initialization',
  9803. fn: function () {
  9804. var self=this;
  9805. smalltalk.send(self, "_initialize", [], smalltalk.Collection);
  9806. (self['@elements']=[]);
  9807. return self;},
  9808. args: [],
  9809. source: "initialize\x0a\x09super initialize.\x0a\x09elements := #()",
  9810. messageSends: ["initialize"],
  9811. referencedClasses: []
  9812. }),
  9813. smalltalk.Set);
  9814. smalltalk.addMethod(
  9815. "_remove_",
  9816. smalltalk.method({
  9817. selector: "remove:",
  9818. category: 'adding/removing',
  9819. fn: function (anObject) {
  9820. var self=this;
  9821. smalltalk.send(self['@elements'], "_remove_", [anObject]);
  9822. return self;},
  9823. args: ["anObject"],
  9824. source: "remove: anObject\x0a\x09elements remove: anObject",
  9825. messageSends: ["remove:"],
  9826. referencedClasses: []
  9827. }),
  9828. smalltalk.Set);
  9829. smalltalk.addMethod(
  9830. "_select_",
  9831. smalltalk.method({
  9832. selector: "select:",
  9833. category: 'enumerating',
  9834. fn: function (aBlock) {
  9835. var self=this;
  9836. var collection=nil;
  9837. (collection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
  9838. smalltalk.send(self, "_do_", [(function(each){return ((($receiver = smalltalk.send(aBlock, "_value_", [each])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(collection, "_add_", [each]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(collection, "_add_", [each]);})]));})]);
  9839. return collection;
  9840. return self;},
  9841. args: ["aBlock"],
  9842. source: "select: aBlock\x0a\x09| collection |\x0a\x09collection := self class new. \x0a\x09self do: [:each |\x0a\x09\x09(aBlock value: each) ifTrue: [\x0a\x09\x09\x09collection add: each]].\x0a\x09^collection",
  9843. messageSends: ["new", "class", "do:", "ifTrue:", "value:", "add:"],
  9844. referencedClasses: []
  9845. }),
  9846. smalltalk.Set);
  9847. smalltalk.addMethod(
  9848. "_size",
  9849. smalltalk.method({
  9850. selector: "size",
  9851. category: 'accessing',
  9852. fn: function () {
  9853. var self=this;
  9854. return smalltalk.send(self['@elements'], "_size", []);
  9855. return self;},
  9856. args: [],
  9857. source: "size\x0a\x09^elements size",
  9858. messageSends: ["size"],
  9859. referencedClasses: []
  9860. }),
  9861. smalltalk.Set);
  9862. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel-Collections');
  9863. smalltalk.addMethod(
  9864. "_compile_",
  9865. smalltalk.method({
  9866. selector: "compile:",
  9867. category: 'evaluating',
  9868. fn: function (aString) {
  9869. var self=this;
  9870. return self.compile(aString);
  9871. return self;},
  9872. args: ["aString"],
  9873. source: "compile: aString\x0a\x09<return self.compile(aString)>",
  9874. messageSends: [],
  9875. referencedClasses: []
  9876. }),
  9877. smalltalk.RegularExpression);
  9878. smalltalk.addMethod(
  9879. "_exec_",
  9880. smalltalk.method({
  9881. selector: "exec:",
  9882. category: 'evaluating',
  9883. fn: function (aString) {
  9884. var self=this;
  9885. return self.exec(aString) || nil;
  9886. return self;},
  9887. args: ["aString"],
  9888. source: "exec: aString\x0a\x09<return self.exec(aString) || nil>",
  9889. messageSends: [],
  9890. referencedClasses: []
  9891. }),
  9892. smalltalk.RegularExpression);
  9893. smalltalk.addMethod(
  9894. "_test_",
  9895. smalltalk.method({
  9896. selector: "test:",
  9897. category: 'evaluating',
  9898. fn: function (aString) {
  9899. var self=this;
  9900. return self.test(aString);
  9901. return self;},
  9902. args: ["aString"],
  9903. source: "test: aString\x0a\x09<return self.test(aString)>",
  9904. messageSends: [],
  9905. referencedClasses: []
  9906. }),
  9907. smalltalk.RegularExpression);
  9908. smalltalk.addMethod(
  9909. "_fromString_",
  9910. smalltalk.method({
  9911. selector: "fromString:",
  9912. category: 'instance creation',
  9913. fn: function (aString) {
  9914. var self=this;
  9915. return smalltalk.send(self, "_fromString_flag_", [aString, ""]);
  9916. return self;},
  9917. args: ["aString"],
  9918. source: "fromString: aString\x0a\x09 ^self fromString: aString flag: ''",
  9919. messageSends: ["fromString:flag:"],
  9920. referencedClasses: []
  9921. }),
  9922. smalltalk.RegularExpression.klass);
  9923. smalltalk.addMethod(
  9924. "_fromString_flag_",
  9925. smalltalk.method({
  9926. selector: "fromString:flag:",
  9927. category: 'instance creation',
  9928. fn: function (aString, anotherString) {
  9929. var self=this;
  9930. return new RegExp(aString, anotherString);
  9931. return self;},
  9932. args: ["aString", "anotherString"],
  9933. source: "fromString: aString flag: anotherString\x0a\x09<return new RegExp(aString, anotherString)>",
  9934. messageSends: [],
  9935. referencedClasses: []
  9936. }),
  9937. smalltalk.RegularExpression.klass);
  9938. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel-Collections');
  9939. smalltalk.addMethod(
  9940. "_atEnd",
  9941. smalltalk.method({
  9942. selector: "atEnd",
  9943. category: 'testing',
  9944. fn: function () {
  9945. var self=this;
  9946. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [smalltalk.send(self, "_size", [])]);
  9947. return self;},
  9948. args: [],
  9949. source: "atEnd\x0a\x09^self position = self size",
  9950. messageSends: ["=", "position", "size"],
  9951. referencedClasses: []
  9952. }),
  9953. smalltalk.Stream);
  9954. smalltalk.addMethod(
  9955. "_atStart",
  9956. smalltalk.method({
  9957. selector: "atStart",
  9958. category: 'testing',
  9959. fn: function () {
  9960. var self=this;
  9961. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [(0)]);
  9962. return self;},
  9963. args: [],
  9964. source: "atStart\x0a\x09^self position = 0",
  9965. messageSends: ["=", "position"],
  9966. referencedClasses: []
  9967. }),
  9968. smalltalk.Stream);
  9969. smalltalk.addMethod(
  9970. "_close",
  9971. smalltalk.method({
  9972. selector: "close",
  9973. category: 'actions',
  9974. fn: function () {
  9975. var self=this;
  9976. return self;},
  9977. args: [],
  9978. source: "close",
  9979. messageSends: [],
  9980. referencedClasses: []
  9981. }),
  9982. smalltalk.Stream);
  9983. smalltalk.addMethod(
  9984. "_collection",
  9985. smalltalk.method({
  9986. selector: "collection",
  9987. category: 'accessing',
  9988. fn: function () {
  9989. var self=this;
  9990. return self['@collection'];
  9991. return self;},
  9992. args: [],
  9993. source: "collection\x0a\x09^collection",
  9994. messageSends: [],
  9995. referencedClasses: []
  9996. }),
  9997. smalltalk.Stream);
  9998. smalltalk.addMethod(
  9999. "_contents",
  10000. smalltalk.method({
  10001. selector: "contents",
  10002. category: 'accessing',
  10003. fn: function () {
  10004. var self=this;
  10005. return smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [(1), smalltalk.send(self, "_streamSize", [])]);
  10006. return self;},
  10007. args: [],
  10008. source: "contents\x0a\x09^self collection\x0a\x09 copyFrom: 1 \x0a\x09 to: self streamSize",
  10009. messageSends: ["copyFrom:to:", "collection", "streamSize"],
  10010. referencedClasses: []
  10011. }),
  10012. smalltalk.Stream);
  10013. smalltalk.addMethod(
  10014. "_do_",
  10015. smalltalk.method({
  10016. selector: "do:",
  10017. category: 'enumerating',
  10018. fn: function (aBlock) {
  10019. var self=this;
  10020. (function(){while(!(function(){return smalltalk.send(self, "_atEnd", []);})()) {(function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_next", [])]);})()}})();
  10021. return self;},
  10022. args: ["aBlock"],
  10023. source: "do: aBlock\x0a\x09[self atEnd] whileFalse: [aBlock value: self next]",
  10024. messageSends: ["whileFalse:", "atEnd", "value:", "next"],
  10025. referencedClasses: []
  10026. }),
  10027. smalltalk.Stream);
  10028. smalltalk.addMethod(
  10029. "_flush",
  10030. smalltalk.method({
  10031. selector: "flush",
  10032. category: 'actions',
  10033. fn: function () {
  10034. var self=this;
  10035. return self;},
  10036. args: [],
  10037. source: "flush",
  10038. messageSends: [],
  10039. referencedClasses: []
  10040. }),
  10041. smalltalk.Stream);
  10042. smalltalk.addMethod(
  10043. "_isEmpty",
  10044. smalltalk.method({
  10045. selector: "isEmpty",
  10046. category: 'testing',
  10047. fn: function () {
  10048. var self=this;
  10049. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
  10050. return self;},
  10051. args: [],
  10052. source: "isEmpty\x0a\x09^self size = 0",
  10053. messageSends: ["=", "size"],
  10054. referencedClasses: []
  10055. }),
  10056. smalltalk.Stream);
  10057. smalltalk.addMethod(
  10058. "_next",
  10059. smalltalk.method({
  10060. selector: "next",
  10061. category: 'reading',
  10062. fn: function () {
  10063. var self=this;
  10064. return ((($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return nil;})() : (function(){smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);return smalltalk.send(self['@collection'], "_at_", [smalltalk.send(self, "_position", [])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return nil;}), (function(){smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);return smalltalk.send(self['@collection'], "_at_", [smalltalk.send(self, "_position", [])]);})]));
  10065. return self;},
  10066. args: [],
  10067. source: "next\x0a\x09^self atEnd \x0a\x09\x09ifTrue: [nil]\x0a\x09\x09ifFalse: [\x0a\x09\x09\x09self position: self position + 1. \x0a\x09\x09\x09collection at: self position]",
  10068. messageSends: ["ifTrue:ifFalse:", "atEnd", "position:", "+", "position", "at:"],
  10069. referencedClasses: []
  10070. }),
  10071. smalltalk.Stream);
  10072. smalltalk.addMethod(
  10073. "_next_",
  10074. smalltalk.method({
  10075. selector: "next:",
  10076. category: 'reading',
  10077. fn: function (anInteger) {
  10078. var self=this;
  10079. var tempCollection=nil;
  10080. (tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []));
  10081. smalltalk.send(anInteger, "_timesRepeat_", [(function(){return ((($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(tempCollection, "_add_", [smalltalk.send(self, "_next", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(tempCollection, "_add_", [smalltalk.send(self, "_next", [])]);})]));})]);
  10082. return tempCollection;
  10083. return self;},
  10084. args: ["anInteger"],
  10085. source: "next: anInteger\x0a\x09| tempCollection |\x0a\x09tempCollection := self collection class new.\x0a\x09anInteger timesRepeat: [\x0a\x09 self atEnd ifFalse: [\x0a\x09\x09tempCollection add: self next]].\x0a\x09^tempCollection",
  10086. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "atEnd", "add:", "next"],
  10087. referencedClasses: []
  10088. }),
  10089. smalltalk.Stream);
  10090. smalltalk.addMethod(
  10091. "_nextPut_",
  10092. smalltalk.method({
  10093. selector: "nextPut:",
  10094. category: 'writing',
  10095. fn: function (anObject) {
  10096. var self=this;
  10097. smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);
  10098. smalltalk.send(smalltalk.send(self, "_collection", []), "_at_put_", [smalltalk.send(self, "_position", []), anObject]);
  10099. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  10100. return self;},
  10101. args: ["anObject"],
  10102. source: "nextPut: anObject\x0a\x09self position: self position + 1.\x0a\x09self collection at: self position put: anObject.\x0a\x09self setStreamSize: (self streamSize max: self position)",
  10103. messageSends: ["position:", "+", "position", "at:put:", "collection", "setStreamSize:", "max:", "streamSize"],
  10104. referencedClasses: []
  10105. }),
  10106. smalltalk.Stream);
  10107. smalltalk.addMethod(
  10108. "_nextPutAll_",
  10109. smalltalk.method({
  10110. selector: "nextPutAll:",
  10111. category: 'writing',
  10112. fn: function (aCollection) {
  10113. var self=this;
  10114. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_nextPut_", [each]);})]);
  10115. return self;},
  10116. args: ["aCollection"],
  10117. source: "nextPutAll: aCollection\x0a\x09aCollection do: [:each |\x0a\x09 self nextPut: each]",
  10118. messageSends: ["do:", "nextPut:"],
  10119. referencedClasses: []
  10120. }),
  10121. smalltalk.Stream);
  10122. smalltalk.addMethod(
  10123. "_peek",
  10124. smalltalk.method({
  10125. selector: "peek",
  10126. category: 'reading',
  10127. fn: function () {
  10128. var self=this;
  10129. return ((($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(smalltalk.send(self, "_collection", []), "_at_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(self, "_collection", []), "_at_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);})]));
  10130. return self;},
  10131. args: [],
  10132. source: "peek\x0a\x09^self atEnd ifFalse: [\x0a\x09 self collection at: self position + 1]",
  10133. messageSends: ["ifFalse:", "atEnd", "at:", "collection", "+", "position"],
  10134. referencedClasses: []
  10135. }),
  10136. smalltalk.Stream);
  10137. smalltalk.addMethod(
  10138. "_position",
  10139. smalltalk.method({
  10140. selector: "position",
  10141. category: 'accessing',
  10142. fn: function () {
  10143. var self=this;
  10144. return (($receiver = self['@position']) == nil || $receiver == undefined) ? (function(){return (self['@position']=(0));})() : $receiver;
  10145. return self;},
  10146. args: [],
  10147. source: "position\x0a\x09^position ifNil: [position := 0]",
  10148. messageSends: ["ifNil:"],
  10149. referencedClasses: []
  10150. }),
  10151. smalltalk.Stream);
  10152. smalltalk.addMethod(
  10153. "_position_",
  10154. smalltalk.method({
  10155. selector: "position:",
  10156. category: 'accessing',
  10157. fn: function (anInteger) {
  10158. var self=this;
  10159. (self['@position']=anInteger);
  10160. return self;},
  10161. args: ["anInteger"],
  10162. source: "position: anInteger\x0a\x09position := anInteger",
  10163. messageSends: [],
  10164. referencedClasses: []
  10165. }),
  10166. smalltalk.Stream);
  10167. smalltalk.addMethod(
  10168. "_reset",
  10169. smalltalk.method({
  10170. selector: "reset",
  10171. category: 'actions',
  10172. fn: function () {
  10173. var self=this;
  10174. smalltalk.send(self, "_position_", [(0)]);
  10175. return self;},
  10176. args: [],
  10177. source: "reset\x0a\x09self position: 0",
  10178. messageSends: ["position:"],
  10179. referencedClasses: []
  10180. }),
  10181. smalltalk.Stream);
  10182. smalltalk.addMethod(
  10183. "_resetContents",
  10184. smalltalk.method({
  10185. selector: "resetContents",
  10186. category: 'actions',
  10187. fn: function () {
  10188. var self=this;
  10189. smalltalk.send(self, "_reset", []);
  10190. smalltalk.send(self, "_setStreamSize_", [(0)]);
  10191. return self;},
  10192. args: [],
  10193. source: "resetContents\x0a\x09self reset.\x0a\x09self setStreamSize: 0",
  10194. messageSends: ["reset", "setStreamSize:"],
  10195. referencedClasses: []
  10196. }),
  10197. smalltalk.Stream);
  10198. smalltalk.addMethod(
  10199. "_setCollection_",
  10200. smalltalk.method({
  10201. selector: "setCollection:",
  10202. category: 'accessing',
  10203. fn: function (aCollection) {
  10204. var self=this;
  10205. (self['@collection']=aCollection);
  10206. return self;},
  10207. args: ["aCollection"],
  10208. source: "setCollection: aCollection\x0a\x09collection := aCollection",
  10209. messageSends: [],
  10210. referencedClasses: []
  10211. }),
  10212. smalltalk.Stream);
  10213. smalltalk.addMethod(
  10214. "_setStreamSize_",
  10215. smalltalk.method({
  10216. selector: "setStreamSize:",
  10217. category: 'accessing',
  10218. fn: function (anInteger) {
  10219. var self=this;
  10220. (self['@streamSize']=anInteger);
  10221. return self;},
  10222. args: ["anInteger"],
  10223. source: "setStreamSize: anInteger\x0a\x09streamSize := anInteger",
  10224. messageSends: [],
  10225. referencedClasses: []
  10226. }),
  10227. smalltalk.Stream);
  10228. smalltalk.addMethod(
  10229. "_setToEnd",
  10230. smalltalk.method({
  10231. selector: "setToEnd",
  10232. category: 'positioning',
  10233. fn: function () {
  10234. var self=this;
  10235. smalltalk.send(self, "_position_", [smalltalk.send(self, "_size", [])]);
  10236. return self;},
  10237. args: [],
  10238. source: "setToEnd\x0a\x09self position: self size",
  10239. messageSends: ["position:", "size"],
  10240. referencedClasses: []
  10241. }),
  10242. smalltalk.Stream);
  10243. smalltalk.addMethod(
  10244. "_size",
  10245. smalltalk.method({
  10246. selector: "size",
  10247. category: 'accessing',
  10248. fn: function () {
  10249. var self=this;
  10250. return smalltalk.send(self, "_streamSize", []);
  10251. return self;},
  10252. args: [],
  10253. source: "size\x0a\x09^self streamSize",
  10254. messageSends: ["streamSize"],
  10255. referencedClasses: []
  10256. }),
  10257. smalltalk.Stream);
  10258. smalltalk.addMethod(
  10259. "_skip_",
  10260. smalltalk.method({
  10261. selector: "skip:",
  10262. category: 'positioning',
  10263. fn: function (anInteger) {
  10264. var self=this;
  10265. smalltalk.send(self, "_position_", [smalltalk.send(((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +anInteger : smalltalk.send($receiver, "__plus", [anInteger])), "_min_max_", [smalltalk.send(self, "_size", []), (0)])]);
  10266. return self;},
  10267. args: ["anInteger"],
  10268. source: "skip: anInteger\x0a\x09self position: ((self position + anInteger) min: self size max: 0)",
  10269. messageSends: ["position:", "min:max:", "+", "position", "size"],
  10270. referencedClasses: []
  10271. }),
  10272. smalltalk.Stream);
  10273. smalltalk.addMethod(
  10274. "_streamSize",
  10275. smalltalk.method({
  10276. selector: "streamSize",
  10277. category: 'accessing',
  10278. fn: function () {
  10279. var self=this;
  10280. return self['@streamSize'];
  10281. return self;},
  10282. args: [],
  10283. source: "streamSize\x0a\x09^streamSize",
  10284. messageSends: [],
  10285. referencedClasses: []
  10286. }),
  10287. smalltalk.Stream);
  10288. smalltalk.addMethod(
  10289. "_on_",
  10290. smalltalk.method({
  10291. selector: "on:",
  10292. category: 'instance creation',
  10293. fn: function (aCollection) {
  10294. var self=this;
  10295. return (function($rec){smalltalk.send($rec, "_setCollection_", [aCollection]);smalltalk.send($rec, "_setStreamSize_", [smalltalk.send(aCollection, "_size", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  10296. return self;},
  10297. args: ["aCollection"],
  10298. source: "on: aCollection\x0a\x09 ^self new \x0a\x09\x09setCollection: aCollection;\x0a\x09\x09setStreamSize: aCollection size;\x0a\x09\x09yourself",
  10299. messageSends: ["setCollection:", "setStreamSize:", "size", "yourself", "new"],
  10300. referencedClasses: []
  10301. }),
  10302. smalltalk.Stream.klass);
  10303. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel-Collections');
  10304. smalltalk.addMethod(
  10305. "_cr",
  10306. smalltalk.method({
  10307. selector: "cr",
  10308. category: 'writing',
  10309. fn: function () {
  10310. var self=this;
  10311. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_cr", [])]);
  10312. return self;},
  10313. args: [],
  10314. source: "cr\x0a\x09^self nextPutAll: String cr",
  10315. messageSends: ["nextPutAll:", "cr"],
  10316. referencedClasses: ["String"]
  10317. }),
  10318. smalltalk.StringStream);
  10319. smalltalk.addMethod(
  10320. "_crlf",
  10321. smalltalk.method({
  10322. selector: "crlf",
  10323. category: 'writing',
  10324. fn: function () {
  10325. var self=this;
  10326. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_crlf", [])]);
  10327. return self;},
  10328. args: [],
  10329. source: "crlf\x0a\x09^self nextPutAll: String crlf",
  10330. messageSends: ["nextPutAll:", "crlf"],
  10331. referencedClasses: ["String"]
  10332. }),
  10333. smalltalk.StringStream);
  10334. smalltalk.addMethod(
  10335. "_lf",
  10336. smalltalk.method({
  10337. selector: "lf",
  10338. category: 'writing',
  10339. fn: function () {
  10340. var self=this;
  10341. return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_lf", [])]);
  10342. return self;},
  10343. args: [],
  10344. source: "lf\x0a\x09^self nextPutAll: String lf",
  10345. messageSends: ["nextPutAll:", "lf"],
  10346. referencedClasses: ["String"]
  10347. }),
  10348. smalltalk.StringStream);
  10349. smalltalk.addMethod(
  10350. "_next_",
  10351. smalltalk.method({
  10352. selector: "next:",
  10353. category: 'reading',
  10354. fn: function (anInteger) {
  10355. var self=this;
  10356. var tempCollection=nil;
  10357. (tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []));
  10358. smalltalk.send(anInteger, "_timesRepeat_", [(function(){return ((($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (tempCollection=smalltalk.send(tempCollection, "__comma", [smalltalk.send(self, "_next", [])]));})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (tempCollection=smalltalk.send(tempCollection, "__comma", [smalltalk.send(self, "_next", [])]));})]));})]);
  10359. return tempCollection;
  10360. return self;},
  10361. args: ["anInteger"],
  10362. source: "next: anInteger\x0a\x09| tempCollection |\x0a\x09tempCollection := self collection class new.\x0a\x09anInteger timesRepeat: [\x0a\x09 self atEnd ifFalse: [\x0a\x09\x09tempCollection := tempCollection, self next]].\x0a\x09^tempCollection",
  10363. messageSends: ["new", "class", "collection", "timesRepeat:", "ifFalse:", "atEnd", ",", "next"],
  10364. referencedClasses: []
  10365. }),
  10366. smalltalk.StringStream);
  10367. smalltalk.addMethod(
  10368. "_nextPut_",
  10369. smalltalk.method({
  10370. selector: "nextPut:",
  10371. category: 'writing',
  10372. fn: function (aString) {
  10373. var self=this;
  10374. smalltalk.send(self, "_nextPutAll_", [aString]);
  10375. return self;},
  10376. args: ["aString"],
  10377. source: "nextPut: aString\x0a\x09self nextPutAll: aString",
  10378. messageSends: ["nextPutAll:"],
  10379. referencedClasses: []
  10380. }),
  10381. smalltalk.StringStream);
  10382. smalltalk.addMethod(
  10383. "_nextPutAll_",
  10384. smalltalk.method({
  10385. selector: "nextPutAll:",
  10386. category: 'writing',
  10387. fn: function (aString) {
  10388. var self=this;
  10389. smalltalk.send(self, "_setCollection_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [(1), smalltalk.send(self, "_position", [])]), "__comma", [aString]), "__comma", [smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [((($receiver = ((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))).klass === smalltalk.Number) ? $receiver +smalltalk.send(aString, "_size", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(aString, "_size", [])])), smalltalk.send(smalltalk.send(self, "_collection", []), "_size", [])])])]);
  10390. smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(aString, "_size", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(aString, "_size", [])]))]);
  10391. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  10392. return self;},
  10393. args: ["aString"],
  10394. source: "nextPutAll: aString\x0a\x09self setCollection: \x0a\x09 (self collection copyFrom: 1 to: self position),\x0a\x09 aString,\x0a\x09 (self collection copyFrom: (self position + 1 + aString size) to: self collection size).\x0a\x09self position: self position + aString size.\x0a\x09self setStreamSize: (self streamSize max: self position)",
  10395. messageSends: ["setCollection:", ",", "copyFrom:to:", "collection", "position", "+", "size", "position:", "setStreamSize:", "max:", "streamSize"],
  10396. referencedClasses: []
  10397. }),
  10398. smalltalk.StringStream);
  10399. smalltalk.addMethod(
  10400. "_space",
  10401. smalltalk.method({
  10402. selector: "space",
  10403. category: 'writing',
  10404. fn: function () {
  10405. var self=this;
  10406. smalltalk.send(self, "_nextPut_", [" "]);
  10407. return self;},
  10408. args: [],
  10409. source: "space\x0a\x09self nextPut: ' '",
  10410. messageSends: ["nextPut:"],
  10411. referencedClasses: []
  10412. }),
  10413. smalltalk.StringStream);
  10414. smalltalk.addPackage('Kernel-Exceptions', {});
  10415. smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel-Exceptions');
  10416. smalltalk.addMethod(
  10417. unescape('_context'),
  10418. smalltalk.method({
  10419. selector: unescape('context'),
  10420. category: 'accessing',
  10421. fn: function (){
  10422. var self=this;
  10423. return self.context;
  10424. return self;},
  10425. args: [],
  10426. source: unescape('context%0A%09%3Creturn%20self.context%3E'),
  10427. messageSends: [],
  10428. referencedClasses: []
  10429. }),
  10430. smalltalk.Error);
  10431. smalltalk.addMethod(
  10432. unescape('_isSmalltalkError'),
  10433. smalltalk.method({
  10434. selector: unescape('isSmalltalkError'),
  10435. category: 'testing',
  10436. fn: function (){
  10437. var self=this;
  10438. return self.smalltalkError === true;
  10439. return self;},
  10440. args: [],
  10441. source: unescape('isSmalltalkError%0A%09%3Creturn%20self.smalltalkError%20%3D%3D%3D%20true%3E'),
  10442. messageSends: [],
  10443. referencedClasses: []
  10444. }),
  10445. smalltalk.Error);
  10446. smalltalk.addMethod(
  10447. unescape('_jsStack'),
  10448. smalltalk.method({
  10449. selector: unescape('jsStack'),
  10450. category: 'accessing',
  10451. fn: function (){
  10452. var self=this;
  10453. return self.stack;
  10454. return self;},
  10455. args: [],
  10456. source: unescape('jsStack%0A%09%3Creturn%20self.stack%3E'),
  10457. messageSends: [],
  10458. referencedClasses: []
  10459. }),
  10460. smalltalk.Error);
  10461. smalltalk.addMethod(
  10462. unescape('_messageText'),
  10463. smalltalk.method({
  10464. selector: unescape('messageText'),
  10465. category: 'accessing',
  10466. fn: function (){
  10467. var self=this;
  10468. return self['@messageText'];
  10469. return self;},
  10470. args: [],
  10471. source: unescape('messageText%0A%09%5EmessageText'),
  10472. messageSends: [],
  10473. referencedClasses: []
  10474. }),
  10475. smalltalk.Error);
  10476. smalltalk.addMethod(
  10477. unescape('_messageText_'),
  10478. smalltalk.method({
  10479. selector: unescape('messageText%3A'),
  10480. category: 'accessing',
  10481. fn: function (aString){
  10482. var self=this;
  10483. (self['@messageText']=aString);
  10484. return self;},
  10485. args: ["aString"],
  10486. source: unescape('messageText%3A%20aString%0A%09messageText%20%3A%3D%20aString'),
  10487. messageSends: [],
  10488. referencedClasses: []
  10489. }),
  10490. smalltalk.Error);
  10491. smalltalk.addMethod(
  10492. unescape('_signal'),
  10493. smalltalk.method({
  10494. selector: unescape('signal'),
  10495. category: 'signaling',
  10496. fn: function (){
  10497. var self=this;
  10498. self.context = smalltalk.getThisContext(); self.smalltalkError = true; throw(self);
  10499. return self;},
  10500. args: [],
  10501. source: unescape('signal%0A%09%3Cself.context%20%3D%20smalltalk.getThisContext%28%29%3B%20self.smalltalkError%20%3D%20true%3B%20throw%28self%29%3E'),
  10502. messageSends: [],
  10503. referencedClasses: []
  10504. }),
  10505. smalltalk.Error);
  10506. smalltalk.addMethod(
  10507. unescape('_signal_'),
  10508. smalltalk.method({
  10509. selector: unescape('signal%3A'),
  10510. category: 'instance creation',
  10511. fn: function (aString){
  10512. var self=this;
  10513. return (function($rec){smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send(self, "_new", []));
  10514. return self;},
  10515. args: ["aString"],
  10516. source: unescape('signal%3A%20aString%0A%09%20%20%20%20%5Eself%20new%0A%09%09messageText%3A%20aString%3B%0A%09%09signal'),
  10517. messageSends: ["messageText:", "signal", "new"],
  10518. referencedClasses: []
  10519. }),
  10520. smalltalk.Error.klass);
  10521. smalltalk.addClass('MessageNotUnderstood', smalltalk.Error, ['message', 'receiver'], 'Kernel-Exceptions');
  10522. smalltalk.addMethod(
  10523. unescape('_message'),
  10524. smalltalk.method({
  10525. selector: unescape('message'),
  10526. category: 'accessing',
  10527. fn: function (){
  10528. var self=this;
  10529. return self['@message'];
  10530. return self;},
  10531. args: [],
  10532. source: unescape('message%0A%09%5Emessage'),
  10533. messageSends: [],
  10534. referencedClasses: []
  10535. }),
  10536. smalltalk.MessageNotUnderstood);
  10537. smalltalk.addMethod(
  10538. unescape('_message_'),
  10539. smalltalk.method({
  10540. selector: unescape('message%3A'),
  10541. category: 'accessing',
  10542. fn: function (aMessage){
  10543. var self=this;
  10544. (self['@message']=aMessage);
  10545. return self;},
  10546. args: ["aMessage"],
  10547. source: unescape('message%3A%20aMessage%0A%09message%20%3A%3D%20aMessage'),
  10548. messageSends: [],
  10549. referencedClasses: []
  10550. }),
  10551. smalltalk.MessageNotUnderstood);
  10552. smalltalk.addMethod(
  10553. unescape('_messageText'),
  10554. smalltalk.method({
  10555. selector: unescape('messageText'),
  10556. category: 'accessing',
  10557. fn: function (){
  10558. var self=this;
  10559. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_receiver", []), "_asString", []), "__comma", [unescape("%20does%20not%20understand%20%23")]), "__comma", [smalltalk.send(smalltalk.send(self, "_message", []), "_selector", [])]);
  10560. return self;},
  10561. args: [],
  10562. source: unescape('messageText%0A%09%5Eself%20receiver%20asString%2C%20%27%20does%20not%20understand%20%23%27%2C%20self%20message%20selector'),
  10563. messageSends: [unescape("%2C"), "asString", "receiver", "selector", "message"],
  10564. referencedClasses: []
  10565. }),
  10566. smalltalk.MessageNotUnderstood);
  10567. smalltalk.addMethod(
  10568. unescape('_receiver'),
  10569. smalltalk.method({
  10570. selector: unescape('receiver'),
  10571. category: 'accessing',
  10572. fn: function (){
  10573. var self=this;
  10574. return self['@receiver'];
  10575. return self;},
  10576. args: [],
  10577. source: unescape('receiver%0A%09%5Ereceiver'),
  10578. messageSends: [],
  10579. referencedClasses: []
  10580. }),
  10581. smalltalk.MessageNotUnderstood);
  10582. smalltalk.addMethod(
  10583. unescape('_receiver_'),
  10584. smalltalk.method({
  10585. selector: unescape('receiver%3A'),
  10586. category: 'accessing',
  10587. fn: function (anObject){
  10588. var self=this;
  10589. (self['@receiver']=anObject);
  10590. return self;},
  10591. args: ["anObject"],
  10592. source: unescape('receiver%3A%20anObject%0A%09receiver%20%3A%3D%20anObject'),
  10593. messageSends: [],
  10594. referencedClasses: []
  10595. }),
  10596. smalltalk.MessageNotUnderstood);
  10597. smalltalk.addClass('ErrorHandler', smalltalk.Object, [], 'Kernel-Exceptions');
  10598. smalltalk.addMethod(
  10599. unescape('_handleError_'),
  10600. smalltalk.method({
  10601. selector: unescape('handleError%3A'),
  10602. category: 'error handling',
  10603. fn: function (anError){
  10604. var self=this;
  10605. (($receiver = smalltalk.send(anError, "_context", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_logErrorContext_", [smalltalk.send(anError, "_context", [])]);})() : nil;
  10606. smalltalk.send(self, "_logError_", [anError]);
  10607. return self;},
  10608. args: ["anError"],
  10609. source: unescape('handleError%3A%20anError%0A%09anError%20context%20ifNotNil%3A%20%5Bself%20logErrorContext%3A%20anError%20context%5D.%0A%09self%20logError%3A%20anError'),
  10610. messageSends: ["ifNotNil:", "context", "logErrorContext:", "logError:"],
  10611. referencedClasses: []
  10612. }),
  10613. smalltalk.ErrorHandler);
  10614. smalltalk.addMethod(
  10615. unescape('_log_'),
  10616. smalltalk.method({
  10617. selector: unescape('log%3A'),
  10618. category: 'private',
  10619. fn: function (aString){
  10620. var self=this;
  10621. smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [aString]);
  10622. return self;},
  10623. args: ["aString"],
  10624. source: unescape('log%3A%20aString%0A%09console%20log%3A%20aString'),
  10625. messageSends: ["log:"],
  10626. referencedClasses: []
  10627. }),
  10628. smalltalk.ErrorHandler);
  10629. smalltalk.addMethod(
  10630. unescape('_logContext_'),
  10631. smalltalk.method({
  10632. selector: unescape('logContext%3A'),
  10633. category: 'private',
  10634. fn: function (aContext){
  10635. var self=this;
  10636. (($receiver = smalltalk.send(aContext, "_home", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_logContext_", [smalltalk.send(aContext, "_home", [])]);})() : nil;
  10637. smalltalk.send(self, "_log_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aContext, "_receiver", []), "_asString", []), "__comma", [unescape("%3E%3E")]), "__comma", [smalltalk.send(aContext, "_selector", [])])]);
  10638. return self;},
  10639. args: ["aContext"],
  10640. source: unescape('logContext%3A%20aContext%0A%09aContext%20home%20ifNotNil%3A%20%5B%0A%09%09self%20logContext%3A%20aContext%20home%5D.%0A%09self%20log%3A%20aContext%20receiver%20asString%2C%20%27%3E%3E%27%2C%20aContext%20selector'),
  10641. messageSends: ["ifNotNil:", "home", "logContext:", "log:", unescape("%2C"), "asString", "receiver", "selector"],
  10642. referencedClasses: []
  10643. }),
  10644. smalltalk.ErrorHandler);
  10645. smalltalk.addMethod(
  10646. unescape('_logError_'),
  10647. smalltalk.method({
  10648. selector: unescape('logError%3A'),
  10649. category: 'private',
  10650. fn: function (anError){
  10651. var self=this;
  10652. smalltalk.send(self, "_log_", [smalltalk.send(anError, "_messageText", [])]);
  10653. return self;},
  10654. args: ["anError"],
  10655. source: unescape('logError%3A%20anError%0A%09self%20log%3A%20anError%20messageText'),
  10656. messageSends: ["log:", "messageText"],
  10657. referencedClasses: []
  10658. }),
  10659. smalltalk.ErrorHandler);
  10660. smalltalk.addMethod(
  10661. unescape('_logErrorContext_'),
  10662. smalltalk.method({
  10663. selector: unescape('logErrorContext%3A'),
  10664. category: 'private',
  10665. fn: function (aContext){
  10666. var self=this;
  10667. (($receiver = aContext) != nil && $receiver != undefined) ? (function(){return (($receiver = smalltalk.send(aContext, "_home", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_logContext_", [smalltalk.send(aContext, "_home", [])]);})() : nil;})() : nil;
  10668. return self;},
  10669. args: ["aContext"],
  10670. source: unescape('logErrorContext%3A%20aContext%0A%09aContext%20ifNotNil%3A%20%5B%0A%09%09aContext%20home%20ifNotNil%3A%20%5B%0A%09%09%09self%20logContext%3A%20aContext%20home%5D%5D'),
  10671. messageSends: ["ifNotNil:", "home", "logContext:"],
  10672. referencedClasses: []
  10673. }),
  10674. smalltalk.ErrorHandler);
  10675. smalltalk.ErrorHandler.klass.iVarNames = ['current'];
  10676. smalltalk.addMethod(
  10677. unescape('_current'),
  10678. smalltalk.method({
  10679. selector: unescape('current'),
  10680. category: 'accessing',
  10681. fn: function (){
  10682. var self=this;
  10683. return (($receiver = self['@current']) == nil || $receiver == undefined) ? (function(){return (self['@current']=smalltalk.send(self, "_new", []));})() : $receiver;
  10684. return self;},
  10685. args: [],
  10686. source: unescape('current%0A%09%5Ecurrent%20ifNil%3A%20%5Bcurrent%20%3A%3D%20self%20new%5D'),
  10687. messageSends: ["ifNil:", "new"],
  10688. referencedClasses: []
  10689. }),
  10690. smalltalk.ErrorHandler.klass);
  10691. smalltalk.addMethod(
  10692. unescape('_initialize'),
  10693. smalltalk.method({
  10694. selector: unescape('initialize'),
  10695. category: 'initialization',
  10696. fn: function (){
  10697. var self=this;
  10698. smalltalk.send(self, "_register", []);
  10699. return self;},
  10700. args: [],
  10701. source: unescape('initialize%0A%09self%20register'),
  10702. messageSends: ["register"],
  10703. referencedClasses: []
  10704. }),
  10705. smalltalk.ErrorHandler.klass);
  10706. smalltalk.addMethod(
  10707. unescape('_register'),
  10708. smalltalk.method({
  10709. selector: unescape('register'),
  10710. category: 'initialization',
  10711. fn: function (){
  10712. var self=this;
  10713. smalltalk.send((smalltalk.ErrorHandler || ErrorHandler), "_setCurrent_", [smalltalk.send(self, "_new", [])]);
  10714. return self;},
  10715. args: [],
  10716. source: unescape('register%0A%09ErrorHandler%20setCurrent%3A%20self%20new'),
  10717. messageSends: ["setCurrent:", "new"],
  10718. referencedClasses: ["ErrorHandler"]
  10719. }),
  10720. smalltalk.ErrorHandler.klass);
  10721. smalltalk.addMethod(
  10722. unescape('_setCurrent_'),
  10723. smalltalk.method({
  10724. selector: unescape('setCurrent%3A'),
  10725. category: 'accessing',
  10726. fn: function (anHandler){
  10727. var self=this;
  10728. (self['@current']=anHandler);
  10729. return self;},
  10730. args: ["anHandler"],
  10731. source: unescape('setCurrent%3A%20anHandler%0A%09current%20%3A%3D%20anHandler'),
  10732. messageSends: [],
  10733. referencedClasses: []
  10734. }),
  10735. smalltalk.ErrorHandler.klass);
  10736. smalltalk.addPackage('Kernel-Transcript', {});
  10737. smalltalk.addClass('ConsoleTranscript', smalltalk.Object, ['textarea'], 'Kernel-Transcript');
  10738. smalltalk.addMethod(
  10739. unescape('_clear'),
  10740. smalltalk.method({
  10741. selector: unescape('clear'),
  10742. category: 'printing',
  10743. fn: function (){
  10744. var self=this;
  10745. return self;},
  10746. args: [],
  10747. source: unescape('clear%0A%09%22no%20op%22'),
  10748. messageSends: [],
  10749. referencedClasses: []
  10750. }),
  10751. smalltalk.ConsoleTranscript);
  10752. smalltalk.addMethod(
  10753. unescape('_cr'),
  10754. smalltalk.method({
  10755. selector: unescape('cr'),
  10756. category: 'printing',
  10757. fn: function (){
  10758. var self=this;
  10759. return self;},
  10760. args: [],
  10761. source: unescape('cr%0A%09%22no%20op%22'),
  10762. messageSends: [],
  10763. referencedClasses: []
  10764. }),
  10765. smalltalk.ConsoleTranscript);
  10766. smalltalk.addMethod(
  10767. unescape('_open'),
  10768. smalltalk.method({
  10769. selector: unescape('open'),
  10770. category: 'actions',
  10771. fn: function (){
  10772. var self=this;
  10773. return self;},
  10774. args: [],
  10775. source: unescape('open'),
  10776. messageSends: [],
  10777. referencedClasses: []
  10778. }),
  10779. smalltalk.ConsoleTranscript);
  10780. smalltalk.addMethod(
  10781. unescape('_show_'),
  10782. smalltalk.method({
  10783. selector: unescape('show%3A'),
  10784. category: 'printing',
  10785. fn: function (anObject){
  10786. var self=this;
  10787. var string=nil;
  10788. (string=smalltalk.send(anObject, "_asString", []));
  10789. console.log(String(string));
  10790. return self;},
  10791. args: ["anObject"],
  10792. source: unescape('show%3A%20anObject%0A%09%7C%20string%20%7C%0A%09string%20%3A%3D%20anObject%20asString.%0A%09%3Cconsole.log%28String%28string%29%29%3E'),
  10793. messageSends: ["asString"],
  10794. referencedClasses: []
  10795. }),
  10796. smalltalk.ConsoleTranscript);
  10797. smalltalk.addMethod(
  10798. unescape('_initialize'),
  10799. smalltalk.method({
  10800. selector: unescape('initialize'),
  10801. category: 'initialization',
  10802. fn: function (){
  10803. var self=this;
  10804. smalltalk.send((smalltalk.Transcript || Transcript), "_register_", [smalltalk.send(self, "_new", [])]);
  10805. return self;},
  10806. args: [],
  10807. source: unescape('initialize%0A%09Transcript%20register%3A%20self%20new'),
  10808. messageSends: ["register:", "new"],
  10809. referencedClasses: ["Transcript"]
  10810. }),
  10811. smalltalk.ConsoleTranscript.klass);
  10812. smalltalk.addClass('Transcript', smalltalk.Object, ['textarea'], 'Kernel-Transcript');
  10813. smalltalk.Transcript.klass.iVarNames = ['current'];
  10814. smalltalk.addMethod(
  10815. unescape('_clear'),
  10816. smalltalk.method({
  10817. selector: unescape('clear'),
  10818. category: 'printing',
  10819. fn: function (){
  10820. var self=this;
  10821. smalltalk.send(smalltalk.send(self, "_current", []), "_clear", []);
  10822. return self;},
  10823. args: [],
  10824. source: unescape('clear%0A%20%20%20%20self%20current%20clear'),
  10825. messageSends: ["clear", "current"],
  10826. referencedClasses: []
  10827. }),
  10828. smalltalk.Transcript.klass);
  10829. smalltalk.addMethod(
  10830. unescape('_cr'),
  10831. smalltalk.method({
  10832. selector: unescape('cr'),
  10833. category: 'printing',
  10834. fn: function (){
  10835. var self=this;
  10836. smalltalk.send(smalltalk.send(self, "_current", []), "_show_", [smalltalk.send((smalltalk.String || String), "_cr", [])]);
  10837. return self;},
  10838. args: [],
  10839. source: unescape('cr%0A%20%20%20%20self%20current%20show%3A%20String%20cr'),
  10840. messageSends: ["show:", "current", "cr"],
  10841. referencedClasses: ["String"]
  10842. }),
  10843. smalltalk.Transcript.klass);
  10844. smalltalk.addMethod(
  10845. unescape('_current'),
  10846. smalltalk.method({
  10847. selector: unescape('current'),
  10848. category: 'instance creation',
  10849. fn: function (){
  10850. var self=this;
  10851. return self['@current'];
  10852. return self;},
  10853. args: [],
  10854. source: unescape('current%0A%20%20%20%20%5Ecurrent'),
  10855. messageSends: [],
  10856. referencedClasses: []
  10857. }),
  10858. smalltalk.Transcript.klass);
  10859. smalltalk.addMethod(
  10860. unescape('_new'),
  10861. smalltalk.method({
  10862. selector: unescape('new'),
  10863. category: 'instance creation',
  10864. fn: function (){
  10865. var self=this;
  10866. smalltalk.send(self, "_shouldNotImplement", []);
  10867. return self;},
  10868. args: [],
  10869. source: unescape('new%0A%20%20%20%20self%20shouldNotImplement'),
  10870. messageSends: ["shouldNotImplement"],
  10871. referencedClasses: []
  10872. }),
  10873. smalltalk.Transcript.klass);
  10874. smalltalk.addMethod(
  10875. unescape('_open'),
  10876. smalltalk.method({
  10877. selector: unescape('open'),
  10878. category: 'instance creation',
  10879. fn: function (){
  10880. var self=this;
  10881. smalltalk.send(smalltalk.send(self, "_current", []), "_open", []);
  10882. return self;},
  10883. args: [],
  10884. source: unescape('open%0A%20%20%20%20self%20current%20open'),
  10885. messageSends: ["open", "current"],
  10886. referencedClasses: []
  10887. }),
  10888. smalltalk.Transcript.klass);
  10889. smalltalk.addMethod(
  10890. unescape('_register_'),
  10891. smalltalk.method({
  10892. selector: unescape('register%3A'),
  10893. category: 'instance creation',
  10894. fn: function (aTranscript){
  10895. var self=this;
  10896. (self['@current']=aTranscript);
  10897. return self;},
  10898. args: ["aTranscript"],
  10899. source: unescape('register%3A%20aTranscript%0A%09current%20%3A%3D%20aTranscript'),
  10900. messageSends: [],
  10901. referencedClasses: []
  10902. }),
  10903. smalltalk.Transcript.klass);
  10904. smalltalk.addMethod(
  10905. unescape('_show_'),
  10906. smalltalk.method({
  10907. selector: unescape('show%3A'),
  10908. category: 'printing',
  10909. fn: function (anObject){
  10910. var self=this;
  10911. smalltalk.send(smalltalk.send(self, "_current", []), "_show_", [anObject]);
  10912. return self;},
  10913. args: ["anObject"],
  10914. source: unescape('show%3A%20anObject%0A%20%20%20%20self%20current%20show%3A%20anObject'),
  10915. messageSends: ["show:", "current"],
  10916. referencedClasses: []
  10917. }),
  10918. smalltalk.Transcript.klass);
  10919. smalltalk.addPackage('Compiler', {});
  10920. smalltalk.addClass('ChunkParser', smalltalk.Object, ['stream'], 'Compiler');
  10921. smalltalk.addMethod(
  10922. "_nextChunk",
  10923. smalltalk.method({
  10924. selector: "nextChunk",
  10925. category: 'reading',
  10926. fn: function () {
  10927. var self=this;
  10928. try{var char_=nil;
  10929. var result=nil;
  10930. var chunk=nil;
  10931. (result=smalltalk.send("", "_writeStream", []));
  10932. (function(){while((function(){(char_=smalltalk.send(self['@stream'], "_next", []));return smalltalk.send(char_, "_notNil", []);})()) {(function(){((($receiver = smalltalk.send(char_, "__eq", [unescape("%21")])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(self['@stream'], "_peek", []), "__eq", [unescape("%21")])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_next", []);})() : (function(){return (function(){throw({name: 'stReturn', selector: '_nextChunk', fn: function(){return smalltalk.send(smalltalk.send(result, "_contents", []), "_trimBoth", [])}})})();})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_next", []);}), (function(){return (function(){throw({name: 'stReturn', selector: '_nextChunk', fn: function(){return smalltalk.send(smalltalk.send(result, "_contents", []), "_trimBoth", [])}})})();})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(self['@stream'], "_peek", []), "__eq", [unescape("%21")])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_next", []);})() : (function(){return (function(){throw({name: 'stReturn', selector: '_nextChunk', fn: function(){return smalltalk.send(smalltalk.send(result, "_contents", []), "_trimBoth", [])}})})();})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_next", []);}), (function(){return (function(){throw({name: 'stReturn', selector: '_nextChunk', fn: function(){return smalltalk.send(smalltalk.send(result, "_contents", []), "_trimBoth", [])}})})();})]));})]));return smalltalk.send(result, "_nextPut_", [char_]);})()}})();
  10933. (function(){throw({name: 'stReturn', selector: '_nextChunk', fn: function(){return nil}})})();
  10934. return self;
  10935. } catch(e) {if(e.name === 'stReturn' && e.selector === '_nextChunk'){return e.fn()} throw(e)}},
  10936. args: [],
  10937. source: "nextChunk\x0a\x09\x22The chunk format (Smalltalk Interchange Format or Fileout format)\x0a\x09is a trivial format but can be a bit tricky to understand:\x0a\x09\x09- Uses the exclamation mark as delimiter of chunks.\x0a\x09\x09- Inside a chunk a normal exclamation mark must be doubled.\x0a\x09\x09- A non empty chunk must be a valid Smalltalk expression.\x0a\x09\x09- A chunk on top level with a preceding empty chunk is an instruction chunk:\x0a\x09\x09\x09- The object created by the expression then takes over reading chunks.\x0a\x0a\x09This metod returns next chunk as a String (trimmed), empty String (all whitespace) or nil.\x22\x0a\x0a\x09| char result chunk |\x0a\x09result := '' writeStream.\x0a [char := stream next.\x0a char notNil] whileTrue: [\x0a char = '!' ifTrue: [\x0a stream peek = '!'\x0a ifTrue: [stream next \x22skipping the escape double\x22]\x0a ifFalse: [^result contents trimBoth \x22chunk end marker found\x22]].\x0a result nextPut: char].\x0a\x09^nil \x22a chunk needs to end with !\x22",
  10938. messageSends: ["writeStream", "whileTrue:", "next", "notNil", "ifTrue:", "=", "ifTrue:ifFalse:", "peek", "trimBoth", "contents", "nextPut:"],
  10939. referencedClasses: []
  10940. }),
  10941. smalltalk.ChunkParser);
  10942. smalltalk.addMethod(
  10943. "_stream_",
  10944. smalltalk.method({
  10945. selector: "stream:",
  10946. category: 'accessing',
  10947. fn: function (aStream) {
  10948. var self=this;
  10949. (self['@stream']=aStream);
  10950. return self;},
  10951. args: ["aStream"],
  10952. source: "stream: aStream\x0a\x09stream := aStream",
  10953. messageSends: [],
  10954. referencedClasses: []
  10955. }),
  10956. smalltalk.ChunkParser);
  10957. smalltalk.addMethod(
  10958. "_on_",
  10959. smalltalk.method({
  10960. selector: "on:",
  10961. category: 'not yet classified',
  10962. fn: function (aStream) {
  10963. var self=this;
  10964. return smalltalk.send(smalltalk.send(self, "_new", []), "_stream_", [aStream]);
  10965. return self;},
  10966. args: ["aStream"],
  10967. source: "on: aStream\x0a\x09^self new stream: aStream",
  10968. messageSends: ["stream:", "new"],
  10969. referencedClasses: []
  10970. }),
  10971. smalltalk.ChunkParser.klass);
  10972. smalltalk.addClass('DoIt', smalltalk.Object, [], 'Compiler');
  10973. smalltalk.addClass('Exporter', smalltalk.Object, [], 'Compiler');
  10974. smalltalk.addMethod(
  10975. "_classNameFor_",
  10976. smalltalk.method({
  10977. selector: "classNameFor:",
  10978. category: 'private',
  10979. fn: function (aClass) {
  10980. var self=this;
  10981. return ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [".klass"]);})() : (function(){return ((($receiver = smalltalk.send(aClass, "_isNil", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "nil";})() : (function(){return smalltalk.send(aClass, "_name", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [".klass"]);}), (function(){return ((($receiver = smalltalk.send(aClass, "_isNil", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "nil";})() : (function(){return smalltalk.send(aClass, "_name", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]));})]));
  10982. return self;},
  10983. args: ["aClass"],
  10984. source: "classNameFor: aClass\x0a\x09^aClass isMetaclass\x0a\x09 ifTrue: [aClass instanceClass name, '.klass']\x0a\x09 ifFalse: [\x0a\x09\x09aClass isNil\x0a\x09\x09 ifTrue: ['nil']\x0a\x09\x09 ifFalse: [aClass name]]",
  10985. messageSends: ["ifTrue:ifFalse:", "isMetaclass", ",", "name", "instanceClass", "isNil"],
  10986. referencedClasses: []
  10987. }),
  10988. smalltalk.Exporter);
  10989. smalltalk.addMethod(
  10990. "_exportAll",
  10991. smalltalk.method({
  10992. selector: "exportAll",
  10993. category: 'fileOut',
  10994. fn: function () {
  10995. var self=this;
  10996. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(stream){return smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packages", []), "_do_", [(function(pkg){return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(self, "_exportPackage_", [smalltalk.send(pkg, "_name", [])])]);})]);})]);
  10997. return self;},
  10998. args: [],
  10999. source: "exportAll\x0a \x22Export all packages in the system.\x22\x0a\x0a ^String streamContents: [:stream |\x0a \x09Smalltalk current packages do: [:pkg |\x0a\x09\x09stream nextPutAll: (self exportPackage: pkg name)]]",
  11000. messageSends: ["streamContents:", "do:", "packages", "current", "nextPutAll:", "exportPackage:", "name"],
  11001. referencedClasses: ["String", "Smalltalk"]
  11002. }),
  11003. smalltalk.Exporter);
  11004. smalltalk.addMethod(
  11005. "_exportClass_",
  11006. smalltalk.method({
  11007. selector: "exportClass:",
  11008. category: 'fileOut',
  11009. fn: function (aClass) {
  11010. var self=this;
  11011. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(stream){smalltalk.send(self, "_exportDefinitionOf_on_", [aClass, stream]);smalltalk.send(self, "_exportMethodsOf_on_", [aClass, stream]);smalltalk.send(self, "_exportMetaDefinitionOf_on_", [aClass, stream]);return smalltalk.send(self, "_exportMethodsOf_on_", [smalltalk.send(aClass, "_class", []), stream]);})]);
  11012. return self;},
  11013. args: ["aClass"],
  11014. source: "exportClass: aClass\x0a\x09\x22Export a single class. Subclasses override these methods.\x22\x0a\x0a\x09^String streamContents: [:stream |\x0a\x09\x09self exportDefinitionOf: aClass on: stream.\x0a\x09\x09self exportMethodsOf: aClass on: stream.\x0a\x09\x09self exportMetaDefinitionOf: aClass on: stream.\x0a\x09\x09self exportMethodsOf: aClass class on: stream]",
  11015. messageSends: ["streamContents:", "exportDefinitionOf:on:", "exportMethodsOf:on:", "exportMetaDefinitionOf:on:", "class"],
  11016. referencedClasses: ["String"]
  11017. }),
  11018. smalltalk.Exporter);
  11019. smalltalk.addMethod(
  11020. "_exportDefinitionOf_on_",
  11021. smalltalk.method({
  11022. selector: "exportDefinitionOf:on:",
  11023. category: 'private',
  11024. fn: function (aClass, aStream) {
  11025. var self=this;
  11026. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("smalltalk.addClass%28")]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])]), "__comma", [unescape("%27%2C%20")])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_superclass", [])])])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%2C%20%5B")]);})(aStream);
  11027. smalltalk.send(smalltalk.send(aClass, "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [each]), "__comma", [unescape("%27")])]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [unescape("%2C%20")]);})]);
  11028. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("%5D%2C%20%27")]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(aClass, "_category", []), "__comma", [unescape("%27")])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%29%3B")]);})(aStream);
  11029. ((($receiver = smalltalk.send(smalltalk.send(aClass, "_comment", []), "_notEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function($rec){smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["smalltalk."]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_classNameFor_", [aClass])]);smalltalk.send($rec, "_nextPutAll_", [unescape(".comment%3D")]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(aClass, "_comment", []), "_asJavascript", [])]);})(aStream);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function($rec){smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["smalltalk."]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_classNameFor_", [aClass])]);smalltalk.send($rec, "_nextPutAll_", [unescape(".comment%3D")]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(aClass, "_comment", []), "_asJavascript", [])]);})(aStream);})]));
  11030. smalltalk.send(aStream, "_lf", []);
  11031. return self;},
  11032. args: ["aClass", "aStream"],
  11033. source: "exportDefinitionOf: aClass on: aStream\x0a\x09aStream \x0a\x09 nextPutAll: 'smalltalk.addClass(';\x0a\x09 nextPutAll: '''', (self classNameFor: aClass), ''', ';\x0a\x09 nextPutAll: 'smalltalk.', (self classNameFor: aClass superclass);\x0a\x09 nextPutAll: ', ['.\x0a\x09aClass instanceVariableNames \x0a\x09 do: [:each | aStream nextPutAll: '''', each, '''']\x0a\x09 separatedBy: [aStream nextPutAll: ', '].\x0a\x09aStream\x09\x0a\x09 nextPutAll: '], ''';\x0a\x09 nextPutAll: aClass category, '''';\x0a\x09 nextPutAll: ');'.\x0a\x09aClass comment notEmpty ifTrue: [\x0a\x09 aStream \x0a\x09 \x09lf;\x0a\x09\x09nextPutAll: 'smalltalk.';\x0a\x09\x09nextPutAll: (self classNameFor: aClass);\x0a\x09\x09nextPutAll: '.comment=';\x0a\x09\x09nextPutAll: aClass comment asJavascript].\x0a\x09aStream lf",
  11034. messageSends: ["nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "notEmpty", "comment", "lf", "asJavascript"],
  11035. referencedClasses: []
  11036. }),
  11037. smalltalk.Exporter);
  11038. smalltalk.addMethod(
  11039. "_exportMetaDefinitionOf_on_",
  11040. smalltalk.method({
  11041. selector: "exportMetaDefinitionOf:on:",
  11042. category: 'private',
  11043. fn: function (aClass, aStream) {
  11044. var self=this;
  11045. ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_class", [])])])]);return smalltalk.send($rec, "_nextPutAll_", [unescape(".iVarNames%20%3D%20%5B")]);})(aStream);smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [each]), "__comma", [unescape("%27")])]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [unescape("%2C")]);})]);return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(unescape("%5D%3B"), "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_class", [])])])]);return smalltalk.send($rec, "_nextPutAll_", [unescape(".iVarNames%20%3D%20%5B")]);})(aStream);smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [each]), "__comma", [unescape("%27")])]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [unescape("%2C")]);})]);return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(unescape("%5D%3B"), "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])])]);})]));
  11046. return self;},
  11047. args: ["aClass", "aStream"],
  11048. source: "exportMetaDefinitionOf: aClass on: aStream\x0a\x09aClass class instanceVariableNames isEmpty ifFalse: [\x0a\x09 aStream \x0a\x09\x09nextPutAll: 'smalltalk.', (self classNameFor: aClass class);\x0a\x09\x09nextPutAll: '.iVarNames = ['.\x0a\x09 aClass class instanceVariableNames\x0a\x09\x09do: [:each | aStream nextPutAll: '''', each, '''']\x0a\x09\x09separatedBy: [aStream nextPutAll: ','].\x0a\x09 aStream nextPutAll: '];', String lf]",
  11049. messageSends: ["ifFalse:", "isEmpty", "instanceVariableNames", "class", "nextPutAll:", ",", "classNameFor:", "do:separatedBy:", "lf"],
  11050. referencedClasses: ["String"]
  11051. }),
  11052. smalltalk.Exporter);
  11053. smalltalk.addMethod(
  11054. "_exportMethod_of_on_",
  11055. smalltalk.method({
  11056. selector: "exportMethod:of:on:",
  11057. category: 'private',
  11058. fn: function (aMethod, aClass, aStream) {
  11059. var self=this;
  11060. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("smalltalk.addMethod%28")]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aMethod, "_selector", []), "_asSelector", []), "_asJavascript", []), "__comma", [unescape("%2C")])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [unescape("smalltalk.method%28%7B")]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("selector: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_selector", []), "_asJavascript", [])]), "__comma", [unescape("%2C")])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("category%3A%20%27"), "__comma", [smalltalk.send(aMethod, "_category", [])]), "__comma", [unescape("%27%2C")])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("fn: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_fn", []), "_compiledSource", [])]), "__comma", [unescape("%2C")])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("args: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_arguments", []), "_asJavascript", [])]), "__comma", [unescape("%2C")])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("source: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_source", []), "_asJavascript", [])]), "__comma", [unescape("%2C")])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("messageSends: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_messageSends", []), "_asJavascript", [])]), "__comma", [unescape("%2C")])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("referencedClasses: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_referencedClasses", []), "_asJavascript", [])])]);})(aStream);
  11061. (function($rec){smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [unescape("%7D%29%2C")]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])])]);smalltalk.send($rec, "_nextPutAll_", [unescape("%29%3B")]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_lf", []);})(aStream);
  11062. return self;},
  11063. args: ["aMethod", "aClass", "aStream"],
  11064. source: "exportMethod: aMethod of: aClass on: aStream\x0a\x09aStream \x0a\x09\x09nextPutAll: 'smalltalk.addMethod(';lf;\x0a\x09\x09nextPutAll: aMethod selector asSelector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'smalltalk.method({';lf;\x0a\x09\x09nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'category: ''', aMethod category, ''',';lf;\x0a\x09\x09nextPutAll: 'fn: ', aMethod fn compiledSource, ',';lf;\x0a\x09\x09nextPutAll: 'args: ', aMethod arguments asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'source: ', aMethod source asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'messageSends: ', aMethod messageSends asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ', aMethod referencedClasses asJavascript.\x0a\x09aStream\x0a\x09\x09lf;\x0a\x09\x09nextPutAll: '}),';lf;\x0a\x09\x09nextPutAll: 'smalltalk.', (self classNameFor: aClass);\x0a\x09\x09nextPutAll: ');';lf;lf",
  11065. messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "asSelector", "selector", "category", "compiledSource", "fn", "arguments", "source", "messageSends", "referencedClasses", "classNameFor:"],
  11066. referencedClasses: []
  11067. }),
  11068. smalltalk.Exporter);
  11069. smalltalk.addMethod(
  11070. "_exportMethodsOf_on_",
  11071. smalltalk.method({
  11072. selector: "exportMethodsOf:on:",
  11073. category: 'private',
  11074. fn: function (aClass, aStream) {
  11075. var self=this;
  11076. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_sorted_", [(function(a, b){return ((($receiver = smalltalk.send(a, "_selector", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(b, "_selector", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(b, "_selector", [])]));})]), "_do_", [(function(each){return ((($receiver = smalltalk.send(smalltalk.send(each, "_category", []), "_match_", [unescape("%5E%5C*")])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_exportMethod_of_on_", [each, aClass, aStream]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_exportMethod_of_on_", [each, aClass, aStream]);})]));})]);
  11077. smalltalk.send(aStream, "_lf", []);
  11078. return self;},
  11079. args: ["aClass", "aStream"],
  11080. source: "exportMethodsOf: aClass on: aStream\x0a\x09\x22Issue #143: sort methods alphabetically\x22\x0a\x0a\x09((aClass methodDictionary values) sorted: [:a :b | a selector <= b selector]) do: [:each |\x0a\x09\x09(each category match: '^\x5c*') ifFalse: [\x0a\x09\x09\x09self exportMethod: each of: aClass on: aStream]].\x0a\x09aStream lf",
  11081. messageSends: ["do:", "sorted:", "values", "methodDictionary", "<=", "selector", "ifFalse:", "match:", "category", "exportMethod:of:on:", "lf"],
  11082. referencedClasses: []
  11083. }),
  11084. smalltalk.Exporter);
  11085. smalltalk.addMethod(
  11086. "_exportPackage_",
  11087. smalltalk.method({
  11088. selector: "exportPackage:",
  11089. category: 'fileOut',
  11090. fn: function (packageName) {
  11091. var self=this;
  11092. var package=nil;
  11093. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(stream){(package=smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packageAt_", [packageName]));smalltalk.send(self, "_exportPackageDefinitionOf_on_", [package, stream]);smalltalk.send(smalltalk.send(smalltalk.send(package, "_sortedClasses", []), "_asSet", []), "_do_", [(function(each){return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(self, "_exportClass_", [each])]);})]);return smalltalk.send(self, "_exportPackageExtensionsOf_on_", [package, stream]);})]);
  11094. return self;},
  11095. args: ["packageName"],
  11096. source: "exportPackage: packageName\x0a\x09\x22Export a given package by name.\x22\x0a\x0a\x09| package |\x0a\x09^String streamContents: [:stream |\x0a package := Smalltalk current packageAt: packageName.\x0a self exportPackageDefinitionOf: package on: stream.\x0a\x0a\x09\x09\x22Export classes in dependency order.\x0a\x09\x09Update (issue #171): Remove duplicates for export\x22\x0a\x09 \x09package sortedClasses asSet do: [:each |\x0a stream nextPutAll: (self exportClass: each)].\x0a\x09\x09self exportPackageExtensionsOf: package on: stream]",
  11097. messageSends: ["streamContents:", "packageAt:", "current", "exportPackageDefinitionOf:on:", "do:", "asSet", "sortedClasses", "nextPutAll:", "exportClass:", "exportPackageExtensionsOf:on:"],
  11098. referencedClasses: ["String", "Smalltalk"]
  11099. }),
  11100. smalltalk.Exporter);
  11101. smalltalk.addMethod(
  11102. "_exportPackageDefinitionOf_on_",
  11103. smalltalk.method({
  11104. selector: "exportPackageDefinitionOf:on:",
  11105. category: 'private',
  11106. fn: function (package, aStream) {
  11107. var self=this;
  11108. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("smalltalk.addPackage%28")]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [smalltalk.send(package, "_name", [])]), "__comma", [unescape("%27%2C%20")]), "__comma", [smalltalk.send(package, "_propertiesAsJSON", [])]), "__comma", [unescape("%29%3B")])]);})(aStream);
  11109. smalltalk.send(aStream, "_lf", []);
  11110. return self;},
  11111. args: ["package", "aStream"],
  11112. source: "exportPackageDefinitionOf: package on: aStream\x0a\x09aStream \x0a\x09 nextPutAll: 'smalltalk.addPackage(';\x0a\x09 nextPutAll: '''', package name, ''', ', package propertiesAsJSON , ');'.\x0a\x09aStream lf",
  11113. messageSends: ["nextPutAll:", ",", "name", "propertiesAsJSON", "lf"],
  11114. referencedClasses: []
  11115. }),
  11116. smalltalk.Exporter);
  11117. smalltalk.addMethod(
  11118. "_exportPackageExtensionsOf_on_",
  11119. smalltalk.method({
  11120. selector: "exportPackageExtensionsOf:on:",
  11121. category: 'private',
  11122. fn: function (package, aStream) {
  11123. var self=this;
  11124. var name=nil;
  11125. (name=smalltalk.send(package, "_name", []));
  11126. smalltalk.send(smalltalk.send((smalltalk.Package || Package), "_sortedClasses_", [smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_classes", [])]), "_do_", [(function(each){return smalltalk.send([each,smalltalk.send(each, "_class", [])], "_do_", [(function(aClass){return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_sorted_", [(function(a, b){return ((($receiver = smalltalk.send(a, "_selector", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(b, "_selector", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(b, "_selector", [])]));})]), "_do_", [(function(method){return ((($receiver = smalltalk.send(smalltalk.send(method, "_category", []), "_match_", [smalltalk.send(unescape("%5E%5C*"), "__comma", [name])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_exportMethod_of_on_", [method, aClass, aStream]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_exportMethod_of_on_", [method, aClass, aStream]);})]));})]);})]);})]);
  11127. return self;},
  11128. args: ["package", "aStream"],
  11129. source: "exportPackageExtensionsOf: package on: aStream\x0a\x09\x22Issue #143: sort classes and methods alphabetically\x22\x0a\x0a\x09| name |\x0a\x09name := package name.\x0a\x09(Package sortedClasses: Smalltalk current classes) do: [:each |\x0a\x09\x09{each. each class} do: [:aClass | \x0a\x09\x09\x09((aClass methodDictionary values) sorted: [:a :b | a selector <= b selector]) do: [:method |\x0a\x09\x09\x09\x09(method category match: '^\x5c*', name) ifTrue: [\x0a\x09\x09\x09\x09\x09self exportMethod: method of: aClass on: aStream ]]]]\x0a",
  11130. messageSends: ["name", "do:", "sortedClasses:", "classes", "current", "class", "sorted:", "values", "methodDictionary", "<=", "selector", "ifTrue:", "match:", "category", ",", "exportMethod:of:on:"],
  11131. referencedClasses: ["Package", "Smalltalk"]
  11132. }),
  11133. smalltalk.Exporter);
  11134. smalltalk.addClass('ChunkExporter', smalltalk.Exporter, [], 'Compiler');
  11135. smalltalk.addMethod(
  11136. "_chunkEscape_",
  11137. smalltalk.method({
  11138. selector: "chunkEscape:",
  11139. category: 'not yet classified',
  11140. fn: function (aString) {
  11141. var self=this;
  11142. return smalltalk.send(smalltalk.send(aString, "_replace_with_", [unescape("%21"), unescape("%21%21")]), "_trimBoth", []);
  11143. return self;},
  11144. args: ["aString"],
  11145. source: "chunkEscape: aString\x0a\x09\x22Replace all occurrences of ! with !! and trim at both ends.\x22\x0a\x0a\x09^(aString replace: '!' with: '!!') trimBoth",
  11146. messageSends: ["trimBoth", "replace:with:"],
  11147. referencedClasses: []
  11148. }),
  11149. smalltalk.ChunkExporter);
  11150. smalltalk.addMethod(
  11151. "_classNameFor_",
  11152. smalltalk.method({
  11153. selector: "classNameFor:",
  11154. category: 'not yet classified',
  11155. fn: function (aClass) {
  11156. var self=this;
  11157. return ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [" class"]);})() : (function(){return ((($receiver = smalltalk.send(aClass, "_isNil", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "nil";})() : (function(){return smalltalk.send(aClass, "_name", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [" class"]);}), (function(){return ((($receiver = smalltalk.send(aClass, "_isNil", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "nil";})() : (function(){return smalltalk.send(aClass, "_name", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]));})]));
  11158. return self;},
  11159. args: ["aClass"],
  11160. source: "classNameFor: aClass\x0a\x09^aClass isMetaclass\x0a\x09 ifTrue: [aClass instanceClass name, ' class']\x0a\x09 ifFalse: [\x0a\x09\x09aClass isNil\x0a\x09\x09 ifTrue: ['nil']\x0a\x09\x09 ifFalse: [aClass name]]",
  11161. messageSends: ["ifTrue:ifFalse:", "isMetaclass", ",", "name", "instanceClass", "isNil"],
  11162. referencedClasses: []
  11163. }),
  11164. smalltalk.ChunkExporter);
  11165. smalltalk.addMethod(
  11166. "_exportDefinitionOf_on_",
  11167. smalltalk.method({
  11168. selector: "exportDefinitionOf:on:",
  11169. category: 'not yet classified',
  11170. fn: function (aClass, aStream) {
  11171. var self=this;
  11172. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_superclass", [])])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(unescape("%20subclass%3A%20%23"), "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", [unescape("%09instanceVariableNames%3A%20%27")]);})(aStream);
  11173. smalltalk.send(smalltalk.send(aClass, "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [each]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [" "]);})]);
  11174. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("%27")]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%09package%3A%20%27"), "__comma", [smalltalk.send(aClass, "_category", [])]), "__comma", [unescape("%27%21")])]);return smalltalk.send($rec, "_lf", []);})(aStream);
  11175. ((($receiver = smalltalk.send(smalltalk.send(aClass, "_comment", []), "_notEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%21"), "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])]), "__comma", [unescape("%20commentStamp%21")])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_chunkEscape_", [smalltalk.send(aClass, "_comment", [])]), "__comma", [unescape("%21")])]);return smalltalk.send($rec, "_lf", []);})(aStream);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%21"), "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])]), "__comma", [unescape("%20commentStamp%21")])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_chunkEscape_", [smalltalk.send(aClass, "_comment", [])]), "__comma", [unescape("%21")])]);return smalltalk.send($rec, "_lf", []);})(aStream);})]));
  11176. smalltalk.send(aStream, "_lf", []);
  11177. return self;},
  11178. args: ["aClass", "aStream"],
  11179. source: "exportDefinitionOf: aClass on: aStream\x0a \x22Chunk format.\x22\x0a\x0a aStream \x0a nextPutAll: (self classNameFor: aClass superclass);\x0a nextPutAll: ' subclass: #', (self classNameFor: aClass); lf;\x0a nextPutAll: '\x09instanceVariableNames: '''.\x0a aClass instanceVariableNames \x0a do: [:each | aStream nextPutAll: each]\x0a separatedBy: [aStream nextPutAll: ' '].\x0a aStream \x0a nextPutAll: ''''; lf;\x0a nextPutAll: '\x09package: ''', aClass category, '''!'; lf.\x0a aClass comment notEmpty ifTrue: [\x0a aStream \x0a nextPutAll: '!', (self classNameFor: aClass), ' commentStamp!';lf;\x0a nextPutAll: (self chunkEscape: aClass comment), '!';lf].\x0a aStream lf",
  11180. messageSends: ["nextPutAll:", "classNameFor:", "superclass", ",", "lf", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "notEmpty", "comment", "chunkEscape:"],
  11181. referencedClasses: []
  11182. }),
  11183. smalltalk.ChunkExporter);
  11184. smalltalk.addMethod(
  11185. "_exportMetaDefinitionOf_on_",
  11186. smalltalk.method({
  11187. selector: "exportMetaDefinitionOf:on:",
  11188. category: 'not yet classified',
  11189. fn: function (aClass, aStream) {
  11190. var self=this;
  11191. ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_class", [])])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%20instanceVariableNames%3A%20%27")]);})(aStream);smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [each]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [" "]);})]);return (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("%27%21")]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_lf", []);})(aStream);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_class", [])])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%20instanceVariableNames%3A%20%27")]);})(aStream);smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [each]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [" "]);})]);return (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("%27%21")]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_lf", []);})(aStream);})]));
  11192. return self;},
  11193. args: ["aClass", "aStream"],
  11194. source: "exportMetaDefinitionOf: aClass on: aStream\x0a\x0a\x09aClass class instanceVariableNames isEmpty ifFalse: [\x0a\x09\x09aStream \x0a\x09\x09 nextPutAll: (self classNameFor: aClass class);\x0a\x09\x09 nextPutAll: ' instanceVariableNames: '''.\x0a\x09\x09aClass class instanceVariableNames \x0a\x09\x09 do: [:each | aStream nextPutAll: each]\x0a\x09\x09 separatedBy: [aStream nextPutAll: ' '].\x0a\x09\x09aStream\x09\x0a\x09\x09 nextPutAll: '''!'; lf; lf]",
  11195. messageSends: ["ifFalse:", "isEmpty", "instanceVariableNames", "class", "nextPutAll:", "classNameFor:", "do:separatedBy:", "lf"],
  11196. referencedClasses: []
  11197. }),
  11198. smalltalk.ChunkExporter);
  11199. smalltalk.addMethod(
  11200. "_exportMethod_of_on_",
  11201. smalltalk.method({
  11202. selector: "exportMethod:of:on:",
  11203. category: 'not yet classified',
  11204. fn: function (aMethod, aClass, aStream) {
  11205. var self=this;
  11206. (function($rec){smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_chunkEscape_", [smalltalk.send(aMethod, "_source", [])])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", [unescape("%21")]);})(aStream);
  11207. return self;},
  11208. args: ["aMethod", "aClass", "aStream"],
  11209. source: "exportMethod: aMethod of: aClass on: aStream\x0a\x09aStream \x0a\x09\x09lf; lf; nextPutAll: (self chunkEscape: aMethod source); lf;\x0a\x09\x09nextPutAll: '!'",
  11210. messageSends: ["lf", "nextPutAll:", "chunkEscape:", "source"],
  11211. referencedClasses: []
  11212. }),
  11213. smalltalk.ChunkExporter);
  11214. smalltalk.addMethod(
  11215. "_exportMethods_category_of_on_",
  11216. smalltalk.method({
  11217. selector: "exportMethods:category:of:on:",
  11218. category: 'not yet classified',
  11219. fn: function (methods, category, aClass, aStream) {
  11220. var self=this;
  11221. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(unescape("%21"), "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])])]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%20methodsFor%3A%20%27"), "__comma", [category]), "__comma", [unescape("%27%21")])]);})(aStream);
  11222. smalltalk.send(smalltalk.send(methods, "_sorted_", [(function(a, b){return ((($receiver = smalltalk.send(a, "_selector", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(b, "_selector", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(b, "_selector", [])]));})]), "_do_", [(function(each){return smalltalk.send(self, "_exportMethod_of_on_", [each, aClass, aStream]);})]);
  11223. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("%20%21")]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_lf", []);})(aStream);
  11224. return self;},
  11225. args: ["methods", "category", "aClass", "aStream"],
  11226. source: "exportMethods: methods category: category of: aClass on: aStream\x0a\x09\x22Issue #143: sort methods alphabetically\x22\x0a\x0a\x09aStream\x0a\x09\x09nextPutAll: '!', (self classNameFor: aClass);\x0a\x09\x09nextPutAll: ' methodsFor: ''', category, '''!'.\x0a\x09\x09(methods sorted: [:a :b | a selector <= b selector]) do: [:each |\x0a\x09\x09\x09\x09self exportMethod: each of: aClass on: aStream].\x0a\x09aStream nextPutAll: ' !'; lf; lf",
  11227. messageSends: ["nextPutAll:", ",", "classNameFor:", "do:", "sorted:", "<=", "selector", "exportMethod:of:on:", "lf"],
  11228. referencedClasses: []
  11229. }),
  11230. smalltalk.ChunkExporter);
  11231. smalltalk.addMethod(
  11232. "_exportMethodsOf_on_",
  11233. smalltalk.method({
  11234. selector: "exportMethodsOf:on:",
  11235. category: 'not yet classified',
  11236. fn: function (aClass, aStream) {
  11237. var self=this;
  11238. var map=nil;
  11239. (map=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
  11240. smalltalk.send(aClass, "_protocolsDo_", [(function(category, methods){return ((($receiver = smalltalk.send(category, "_match_", [unescape("%5E%5C*")])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(map, "_at_put_", [category, methods]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(map, "_at_put_", [category, methods]);})]));})]);
  11241. smalltalk.send(smalltalk.send(smalltalk.send(map, "_keys", []), "_sorted_", [(function(a, b){return ((($receiver = a).klass === smalltalk.Number) ? $receiver <=b : smalltalk.send($receiver, "__lt_eq", [b]));})]), "_do_", [(function(category){var methods=nil;
  11242. (methods=smalltalk.send(map, "_at_", [category]));return smalltalk.send(self, "_exportMethods_category_of_on_", [methods, category, aClass, aStream]);})]);
  11243. return self;},
  11244. args: ["aClass", "aStream"],
  11245. source: "exportMethodsOf: aClass on: aStream\x0a\x09\x22Issue #143: sort protocol alphabetically\x22\x0a\x0a\x09| map |\x0a\x09map := Dictionary new.\x0a\x09aClass protocolsDo: [:category :methods | \x0a\x09\x09(category match: '^\x5c*') ifFalse: [ map at: category put: methods ]].\x0a\x09(map keys sorted: [:a :b | a <= b ]) do: [:category | | methods |\x0a\x09\x09methods := map at: category.\x0a\x09\x09self\x0a\x09\x09\x09exportMethods: methods\x0a\x09\x09\x09category: category\x0a\x09\x09\x09of: aClass\x0a\x09\x09\x09on: aStream ]",
  11246. messageSends: ["new", "protocolsDo:", "ifFalse:", "match:", "at:put:", "do:", "sorted:", "keys", "<=", "at:", "exportMethods:category:of:on:"],
  11247. referencedClasses: ["Dictionary"]
  11248. }),
  11249. smalltalk.ChunkExporter);
  11250. smalltalk.addMethod(
  11251. "_exportPackageDefinitionOf_on_",
  11252. smalltalk.method({
  11253. selector: "exportPackageDefinitionOf:on:",
  11254. category: 'not yet classified',
  11255. fn: function (package, aStream) {
  11256. var self=this;
  11257. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("Smalltalk%20current%20createPackage%3A%20%27"), "__comma", [smalltalk.send(package, "_name", [])]), "__comma", [unescape("%27%20properties%3A%20")]), "__comma", [smalltalk.send(smalltalk.send(package, "_properties", []), "_storeString", [])]), "__comma", [unescape("%21")])]);return smalltalk.send($rec, "_lf", []);})(aStream);
  11258. return self;},
  11259. args: ["package", "aStream"],
  11260. source: "exportPackageDefinitionOf: package on: aStream\x0a\x09\x22Chunk format.\x22\x0a\x0a\x09aStream \x0a\x09 nextPutAll: 'Smalltalk current createPackage: ''', package name,\x0a\x09\x09''' properties: ', package properties storeString, '!'; lf.",
  11261. messageSends: ["nextPutAll:", ",", "name", "storeString", "properties", "lf"],
  11262. referencedClasses: []
  11263. }),
  11264. smalltalk.ChunkExporter);
  11265. smalltalk.addMethod(
  11266. "_exportPackageExtensionsOf_on_",
  11267. smalltalk.method({
  11268. selector: "exportPackageExtensionsOf:on:",
  11269. category: 'not yet classified',
  11270. fn: function (package, aStream) {
  11271. var self=this;
  11272. var name=nil;
  11273. var map=nil;
  11274. (name=smalltalk.send(package, "_name", []));
  11275. smalltalk.send(smalltalk.send((smalltalk.Package || Package), "_sortedClasses_", [smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_classes", [])]), "_do_", [(function(each){return smalltalk.send([each,smalltalk.send(each, "_class", [])], "_do_", [(function(aClass){(map=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));smalltalk.send(aClass, "_protocolsDo_", [(function(category, methods){return ((($receiver = smalltalk.send(category, "_match_", [smalltalk.send(unescape("%5E%5C*"), "__comma", [name])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(map, "_at_put_", [category, methods]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(map, "_at_put_", [category, methods]);})]));})]);return smalltalk.send(smalltalk.send(smalltalk.send(map, "_keys", []), "_sorted_", [(function(a, b){return ((($receiver = a).klass === smalltalk.Number) ? $receiver <=b : smalltalk.send($receiver, "__lt_eq", [b]));})]), "_do_", [(function(category){var methods=nil;
  11276. (methods=smalltalk.send(map, "_at_", [category]));return smalltalk.send(self, "_exportMethods_category_of_on_", [methods, category, aClass, aStream]);})]);})]);})]);
  11277. return self;},
  11278. args: ["package", "aStream"],
  11279. source: "exportPackageExtensionsOf: package on: aStream\x0a\x09\x22We need to override this one too since we need to group\x0a\x09all methods in a given protocol under a leading methodsFor: chunk\x0a\x09for that class.\x22\x0a\x0a\x09\x22Issue #143: sort protocol alphabetically\x22\x0a\x0a\x09| name map |\x0a\x09name := package name.\x0a\x09(Package sortedClasses: Smalltalk current classes) do: [:each |\x0a\x09\x09{each. each class} do: [:aClass |\x0a\x09\x09\x09map := Dictionary new.\x0a\x09\x09\x09aClass protocolsDo: [:category :methods | \x0a\x09\x09\x09\x09(category match: '^\x5c*', name) ifTrue: [ map at: category put: methods ]].\x0a\x09\x09\x09(map keys sorted: [:a :b | a <= b ]) do: [:category | | methods |\x0a\x09\x09\x09\x09methods := map at: category.\x09\x0a\x09\x09\x09\x09self exportMethods: methods category: category of: aClass on: aStream ]]]",
  11280. messageSends: ["name", "do:", "sortedClasses:", "classes", "current", "class", "new", "protocolsDo:", "ifTrue:", "match:", ",", "at:put:", "sorted:", "keys", "<=", "at:", "exportMethods:category:of:on:"],
  11281. referencedClasses: ["Package", "Smalltalk", "Dictionary"]
  11282. }),
  11283. smalltalk.ChunkExporter);
  11284. smalltalk.addClass('StrippedExporter', smalltalk.Exporter, [], 'Compiler');
  11285. smalltalk.addMethod(
  11286. "_exportDefinitionOf_on_",
  11287. smalltalk.method({
  11288. selector: "exportDefinitionOf:on:",
  11289. category: 'private',
  11290. fn: function (aClass, aStream) {
  11291. var self=this;
  11292. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("smalltalk.addClass%28")]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])]), "__comma", [unescape("%27%2C%20")])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_superclass", [])])])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%2C%20%5B")]);})(aStream);
  11293. smalltalk.send(smalltalk.send(aClass, "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [each]), "__comma", [unescape("%27")])]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [unescape("%2C%20")]);})]);
  11294. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("%5D%2C%20%27")]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(aClass, "_category", []), "__comma", [unescape("%27")])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%29%3B")]);})(aStream);
  11295. smalltalk.send(aStream, "_lf", []);
  11296. return self;},
  11297. args: ["aClass", "aStream"],
  11298. source: "exportDefinitionOf: aClass on: aStream\x0a\x09aStream \x0a\x09 nextPutAll: 'smalltalk.addClass(';\x0a\x09 nextPutAll: '''', (self classNameFor: aClass), ''', ';\x0a\x09 nextPutAll: 'smalltalk.', (self classNameFor: aClass superclass);\x0a\x09 nextPutAll: ', ['.\x0a\x09aClass instanceVariableNames \x0a\x09 do: [:each | aStream nextPutAll: '''', each, '''']\x0a\x09 separatedBy: [aStream nextPutAll: ', '].\x0a\x09aStream\x09\x0a\x09 nextPutAll: '], ''';\x0a\x09 nextPutAll: aClass category, '''';\x0a\x09 nextPutAll: ');'.\x0a\x09aStream lf",
  11299. messageSends: ["nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category", "lf"],
  11300. referencedClasses: []
  11301. }),
  11302. smalltalk.StrippedExporter);
  11303. smalltalk.addMethod(
  11304. "_exportMethod_of_on_",
  11305. smalltalk.method({
  11306. selector: "exportMethod:of:on:",
  11307. category: 'private',
  11308. fn: function (aMethod, aClass, aStream) {
  11309. var self=this;
  11310. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("smalltalk.addMethod%28")]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aMethod, "_selector", []), "_asSelector", []), "_asJavascript", []), "__comma", [unescape("%2C")])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [unescape("smalltalk.method%28%7B")]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("selector: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_selector", []), "_asJavascript", [])]), "__comma", [unescape("%2C")])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("fn: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_fn", []), "_compiledSource", [])])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [unescape("%7D%29%2C")]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])])]);smalltalk.send($rec, "_nextPutAll_", [unescape("%29%3B")]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_lf", []);})(aStream);
  11311. return self;},
  11312. args: ["aMethod", "aClass", "aStream"],
  11313. source: "exportMethod: aMethod of: aClass on: aStream\x0a\x09aStream \x0a\x09\x09nextPutAll: 'smalltalk.addMethod(';lf;\x0a\x09\x09nextPutAll: aMethod selector asSelector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'smalltalk.method({';lf;\x0a\x09\x09nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'fn: ', aMethod fn compiledSource;lf;\x0a\x09\x09nextPutAll: '}),';lf;\x0a\x09\x09nextPutAll: 'smalltalk.', (self classNameFor: aClass);\x0a\x09\x09nextPutAll: ');';lf;lf",
  11314. messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "asSelector", "selector", "compiledSource", "fn", "classNameFor:"],
  11315. referencedClasses: []
  11316. }),
  11317. smalltalk.StrippedExporter);
  11318. smalltalk.addClass('Importer', smalltalk.Object, [], 'Compiler');
  11319. smalltalk.addMethod(
  11320. "_import_",
  11321. smalltalk.method({
  11322. selector: "import:",
  11323. category: 'fileIn',
  11324. fn: function (aStream) {
  11325. var self=this;
  11326. var chunk=nil;
  11327. var result=nil;
  11328. var parser=nil;
  11329. var lastEmpty=nil;
  11330. (parser=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_on_", [aStream]));
  11331. (lastEmpty=false);
  11332. (function(){while(!(function(){(chunk=smalltalk.send(parser, "_nextChunk", []));return smalltalk.send(chunk, "_isNil", []);})()) {(function(){return ((($receiver = smalltalk.send(chunk, "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (lastEmpty=true);})() : (function(){(result=smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_loadExpression_", [chunk]));return ((($receiver = lastEmpty).klass === smalltalk.Boolean) ? ($receiver ? (function(){(lastEmpty=false);return smalltalk.send(result, "_scanFrom_", [parser]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){(lastEmpty=false);return smalltalk.send(result, "_scanFrom_", [parser]);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (lastEmpty=true);}), (function(){(result=smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_loadExpression_", [chunk]));return ((($receiver = lastEmpty).klass === smalltalk.Boolean) ? ($receiver ? (function(){(lastEmpty=false);return smalltalk.send(result, "_scanFrom_", [parser]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){(lastEmpty=false);return smalltalk.send(result, "_scanFrom_", [parser]);})]));})]));})()}})();
  11333. return self;},
  11334. args: ["aStream"],
  11335. source: "import: aStream\x0a | chunk result parser lastEmpty |\x0a parser := ChunkParser on: aStream.\x0a lastEmpty := false.\x0a [chunk := parser nextChunk.\x0a chunk isNil] whileFalse: [\x0a chunk isEmpty\x0a \x09\x09ifTrue: [lastEmpty := true]\x0a \x09\x09ifFalse: [\x0a \x09\x09result := Compiler new loadExpression: chunk.\x0a \x09\x09lastEmpty \x0a \x09\x09\x09ifTrue: [\x0a \x09lastEmpty := false.\x0a \x09result scanFrom: parser]]]",
  11336. messageSends: ["on:", "whileFalse:", "nextChunk", "isNil", "ifTrue:ifFalse:", "isEmpty", "loadExpression:", "new", "ifTrue:", "scanFrom:"],
  11337. referencedClasses: ["ChunkParser", "Compiler"]
  11338. }),
  11339. smalltalk.Importer);
  11340. smalltalk.addClass('Node', smalltalk.Object, ['nodes'], 'Compiler');
  11341. smalltalk.addMethod(
  11342. "_accept_",
  11343. smalltalk.method({
  11344. selector: "accept:",
  11345. category: 'visiting',
  11346. fn: function (aVisitor) {
  11347. var self=this;
  11348. smalltalk.send(aVisitor, "_visitNode_", [self]);
  11349. return self;},
  11350. args: ["aVisitor"],
  11351. source: "accept: aVisitor\x0a\x09aVisitor visitNode: self",
  11352. messageSends: ["visitNode:"],
  11353. referencedClasses: []
  11354. }),
  11355. smalltalk.Node);
  11356. smalltalk.addMethod(
  11357. "_addNode_",
  11358. smalltalk.method({
  11359. selector: "addNode:",
  11360. category: 'accessing',
  11361. fn: function (aNode) {
  11362. var self=this;
  11363. smalltalk.send(smalltalk.send(self, "_nodes", []), "_add_", [aNode]);
  11364. return self;},
  11365. args: ["aNode"],
  11366. source: "addNode: aNode\x0a\x09self nodes add: aNode",
  11367. messageSends: ["add:", "nodes"],
  11368. referencedClasses: []
  11369. }),
  11370. smalltalk.Node);
  11371. smalltalk.addMethod(
  11372. "_isBlockNode",
  11373. smalltalk.method({
  11374. selector: "isBlockNode",
  11375. category: 'testing',
  11376. fn: function () {
  11377. var self=this;
  11378. return false;
  11379. return self;},
  11380. args: [],
  11381. source: "isBlockNode\x0a\x09^false",
  11382. messageSends: [],
  11383. referencedClasses: []
  11384. }),
  11385. smalltalk.Node);
  11386. smalltalk.addMethod(
  11387. "_isBlockSequenceNode",
  11388. smalltalk.method({
  11389. selector: "isBlockSequenceNode",
  11390. category: 'testing',
  11391. fn: function () {
  11392. var self=this;
  11393. return false;
  11394. return self;},
  11395. args: [],
  11396. source: "isBlockSequenceNode\x0a\x09^false",
  11397. messageSends: [],
  11398. referencedClasses: []
  11399. }),
  11400. smalltalk.Node);
  11401. smalltalk.addMethod(
  11402. "_isValueNode",
  11403. smalltalk.method({
  11404. selector: "isValueNode",
  11405. category: 'testing',
  11406. fn: function () {
  11407. var self=this;
  11408. return false;
  11409. return self;},
  11410. args: [],
  11411. source: "isValueNode\x0a\x09^false",
  11412. messageSends: [],
  11413. referencedClasses: []
  11414. }),
  11415. smalltalk.Node);
  11416. smalltalk.addMethod(
  11417. "_nodes",
  11418. smalltalk.method({
  11419. selector: "nodes",
  11420. category: 'accessing',
  11421. fn: function () {
  11422. var self=this;
  11423. return (($receiver = self['@nodes']) == nil || $receiver == undefined) ? (function(){return (self['@nodes']=smalltalk.send((smalltalk.Array || Array), "_new", []));})() : $receiver;
  11424. return self;},
  11425. args: [],
  11426. source: "nodes\x0a\x09^nodes ifNil: [nodes := Array new]",
  11427. messageSends: ["ifNil:", "new"],
  11428. referencedClasses: ["Array"]
  11429. }),
  11430. smalltalk.Node);
  11431. smalltalk.addMethod(
  11432. "_nodes_",
  11433. smalltalk.method({
  11434. selector: "nodes:",
  11435. category: 'building',
  11436. fn: function (aCollection) {
  11437. var self=this;
  11438. (self['@nodes']=aCollection);
  11439. return self;},
  11440. args: ["aCollection"],
  11441. source: "nodes: aCollection\x0a\x09nodes := aCollection",
  11442. messageSends: [],
  11443. referencedClasses: []
  11444. }),
  11445. smalltalk.Node);
  11446. smalltalk.addClass('AssignmentNode', smalltalk.Node, ['left', 'right'], 'Compiler');
  11447. smalltalk.addMethod(
  11448. "_accept_",
  11449. smalltalk.method({
  11450. selector: "accept:",
  11451. category: 'visiting',
  11452. fn: function (aVisitor) {
  11453. var self=this;
  11454. smalltalk.send(aVisitor, "_visitAssignmentNode_", [self]);
  11455. return self;},
  11456. args: ["aVisitor"],
  11457. source: "accept: aVisitor\x0a\x09aVisitor visitAssignmentNode: self",
  11458. messageSends: ["visitAssignmentNode:"],
  11459. referencedClasses: []
  11460. }),
  11461. smalltalk.AssignmentNode);
  11462. smalltalk.addMethod(
  11463. "_left",
  11464. smalltalk.method({
  11465. selector: "left",
  11466. category: 'accessing',
  11467. fn: function () {
  11468. var self=this;
  11469. return self['@left'];
  11470. return self;},
  11471. args: [],
  11472. source: "left\x0a\x09^left",
  11473. messageSends: [],
  11474. referencedClasses: []
  11475. }),
  11476. smalltalk.AssignmentNode);
  11477. smalltalk.addMethod(
  11478. "_left_",
  11479. smalltalk.method({
  11480. selector: "left:",
  11481. category: 'accessing',
  11482. fn: function (aNode) {
  11483. var self=this;
  11484. (self['@left']=aNode);
  11485. smalltalk.send(self['@left'], "_assigned_", [true]);
  11486. return self;},
  11487. args: ["aNode"],
  11488. source: "left: aNode\x0a\x09left := aNode.\x0a\x09left assigned: true",
  11489. messageSends: ["assigned:"],
  11490. referencedClasses: []
  11491. }),
  11492. smalltalk.AssignmentNode);
  11493. smalltalk.addMethod(
  11494. "_right",
  11495. smalltalk.method({
  11496. selector: "right",
  11497. category: 'accessing',
  11498. fn: function () {
  11499. var self=this;
  11500. return self['@right'];
  11501. return self;},
  11502. args: [],
  11503. source: "right\x0a\x09^right",
  11504. messageSends: [],
  11505. referencedClasses: []
  11506. }),
  11507. smalltalk.AssignmentNode);
  11508. smalltalk.addMethod(
  11509. "_right_",
  11510. smalltalk.method({
  11511. selector: "right:",
  11512. category: 'accessing',
  11513. fn: function (aNode) {
  11514. var self=this;
  11515. (self['@right']=aNode);
  11516. return self;},
  11517. args: ["aNode"],
  11518. source: "right: aNode\x0a\x09right := aNode",
  11519. messageSends: [],
  11520. referencedClasses: []
  11521. }),
  11522. smalltalk.AssignmentNode);
  11523. smalltalk.addClass('BlockNode', smalltalk.Node, ['parameters', 'inlined'], 'Compiler');
  11524. smalltalk.addMethod(
  11525. "_accept_",
  11526. smalltalk.method({
  11527. selector: "accept:",
  11528. category: 'visiting',
  11529. fn: function (aVisitor) {
  11530. var self=this;
  11531. smalltalk.send(aVisitor, "_visitBlockNode_", [self]);
  11532. return self;},
  11533. args: ["aVisitor"],
  11534. source: "accept: aVisitor\x0a\x09aVisitor visitBlockNode: self",
  11535. messageSends: ["visitBlockNode:"],
  11536. referencedClasses: []
  11537. }),
  11538. smalltalk.BlockNode);
  11539. smalltalk.addMethod(
  11540. "_inlined",
  11541. smalltalk.method({
  11542. selector: "inlined",
  11543. category: 'accessing',
  11544. fn: function () {
  11545. var self=this;
  11546. return (($receiver = self['@inlined']) == nil || $receiver == undefined) ? (function(){return false;})() : $receiver;
  11547. return self;},
  11548. args: [],
  11549. source: "inlined\x0a\x09^inlined ifNil: [false]",
  11550. messageSends: ["ifNil:"],
  11551. referencedClasses: []
  11552. }),
  11553. smalltalk.BlockNode);
  11554. smalltalk.addMethod(
  11555. "_inlined_",
  11556. smalltalk.method({
  11557. selector: "inlined:",
  11558. category: 'accessing',
  11559. fn: function (aBoolean) {
  11560. var self=this;
  11561. (self['@inlined']=aBoolean);
  11562. return self;},
  11563. args: ["aBoolean"],
  11564. source: "inlined: aBoolean\x0a\x09inlined := aBoolean",
  11565. messageSends: [],
  11566. referencedClasses: []
  11567. }),
  11568. smalltalk.BlockNode);
  11569. smalltalk.addMethod(
  11570. "_isBlockNode",
  11571. smalltalk.method({
  11572. selector: "isBlockNode",
  11573. category: 'testing',
  11574. fn: function () {
  11575. var self=this;
  11576. return true;
  11577. return self;},
  11578. args: [],
  11579. source: "isBlockNode\x0a\x09^true",
  11580. messageSends: [],
  11581. referencedClasses: []
  11582. }),
  11583. smalltalk.BlockNode);
  11584. smalltalk.addMethod(
  11585. "_parameters",
  11586. smalltalk.method({
  11587. selector: "parameters",
  11588. category: 'accessing',
  11589. fn: function () {
  11590. var self=this;
  11591. return (($receiver = self['@parameters']) == nil || $receiver == undefined) ? (function(){return (self['@parameters']=smalltalk.send((smalltalk.Array || Array), "_new", []));})() : $receiver;
  11592. return self;},
  11593. args: [],
  11594. source: "parameters\x0a\x09^parameters ifNil: [parameters := Array new]",
  11595. messageSends: ["ifNil:", "new"],
  11596. referencedClasses: ["Array"]
  11597. }),
  11598. smalltalk.BlockNode);
  11599. smalltalk.addMethod(
  11600. "_parameters_",
  11601. smalltalk.method({
  11602. selector: "parameters:",
  11603. category: 'accessing',
  11604. fn: function (aCollection) {
  11605. var self=this;
  11606. (self['@parameters']=aCollection);
  11607. return self;},
  11608. args: ["aCollection"],
  11609. source: "parameters: aCollection\x0a\x09parameters := aCollection",
  11610. messageSends: [],
  11611. referencedClasses: []
  11612. }),
  11613. smalltalk.BlockNode);
  11614. smalltalk.addClass('CascadeNode', smalltalk.Node, ['receiver'], 'Compiler');
  11615. smalltalk.addMethod(
  11616. "_accept_",
  11617. smalltalk.method({
  11618. selector: "accept:",
  11619. category: 'visiting',
  11620. fn: function (aVisitor) {
  11621. var self=this;
  11622. smalltalk.send(aVisitor, "_visitCascadeNode_", [self]);
  11623. return self;},
  11624. args: ["aVisitor"],
  11625. source: "accept: aVisitor\x0a\x09aVisitor visitCascadeNode: self",
  11626. messageSends: ["visitCascadeNode:"],
  11627. referencedClasses: []
  11628. }),
  11629. smalltalk.CascadeNode);
  11630. smalltalk.addMethod(
  11631. "_receiver",
  11632. smalltalk.method({
  11633. selector: "receiver",
  11634. category: 'accessing',
  11635. fn: function () {
  11636. var self=this;
  11637. return self['@receiver'];
  11638. return self;},
  11639. args: [],
  11640. source: "receiver\x0a\x09^receiver",
  11641. messageSends: [],
  11642. referencedClasses: []
  11643. }),
  11644. smalltalk.CascadeNode);
  11645. smalltalk.addMethod(
  11646. "_receiver_",
  11647. smalltalk.method({
  11648. selector: "receiver:",
  11649. category: 'accessing',
  11650. fn: function (aNode) {
  11651. var self=this;
  11652. (self['@receiver']=aNode);
  11653. return self;},
  11654. args: ["aNode"],
  11655. source: "receiver: aNode\x0a\x09receiver := aNode",
  11656. messageSends: [],
  11657. referencedClasses: []
  11658. }),
  11659. smalltalk.CascadeNode);
  11660. smalltalk.addClass('DynamicArrayNode', smalltalk.Node, [], 'Compiler');
  11661. smalltalk.addMethod(
  11662. "_accept_",
  11663. smalltalk.method({
  11664. selector: "accept:",
  11665. category: 'visiting',
  11666. fn: function (aVisitor) {
  11667. var self=this;
  11668. smalltalk.send(aVisitor, "_visitDynamicArrayNode_", [self]);
  11669. return self;},
  11670. args: ["aVisitor"],
  11671. source: "accept: aVisitor\x0a\x09aVisitor visitDynamicArrayNode: self",
  11672. messageSends: ["visitDynamicArrayNode:"],
  11673. referencedClasses: []
  11674. }),
  11675. smalltalk.DynamicArrayNode);
  11676. smalltalk.addClass('DynamicDictionaryNode', smalltalk.Node, [], 'Compiler');
  11677. smalltalk.addMethod(
  11678. "_accept_",
  11679. smalltalk.method({
  11680. selector: "accept:",
  11681. category: 'visiting',
  11682. fn: function (aVisitor) {
  11683. var self=this;
  11684. smalltalk.send(aVisitor, "_visitDynamicDictionaryNode_", [self]);
  11685. return self;},
  11686. args: ["aVisitor"],
  11687. source: "accept: aVisitor\x0a\x09aVisitor visitDynamicDictionaryNode: self",
  11688. messageSends: ["visitDynamicDictionaryNode:"],
  11689. referencedClasses: []
  11690. }),
  11691. smalltalk.DynamicDictionaryNode);
  11692. smalltalk.addClass('JSStatementNode', smalltalk.Node, ['source'], 'Compiler');
  11693. smalltalk.addMethod(
  11694. "_accept_",
  11695. smalltalk.method({
  11696. selector: "accept:",
  11697. category: 'visiting',
  11698. fn: function (aVisitor) {
  11699. var self=this;
  11700. smalltalk.send(aVisitor, "_visitJSStatementNode_", [self]);
  11701. return self;},
  11702. args: ["aVisitor"],
  11703. source: "accept: aVisitor\x0a\x09aVisitor visitJSStatementNode: self",
  11704. messageSends: ["visitJSStatementNode:"],
  11705. referencedClasses: []
  11706. }),
  11707. smalltalk.JSStatementNode);
  11708. smalltalk.addMethod(
  11709. "_source",
  11710. smalltalk.method({
  11711. selector: "source",
  11712. category: 'accessing',
  11713. fn: function () {
  11714. var self=this;
  11715. return (($receiver = self['@source']) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  11716. return self;},
  11717. args: [],
  11718. source: "source\x0a\x09^source ifNil: ['']",
  11719. messageSends: ["ifNil:"],
  11720. referencedClasses: []
  11721. }),
  11722. smalltalk.JSStatementNode);
  11723. smalltalk.addMethod(
  11724. "_source_",
  11725. smalltalk.method({
  11726. selector: "source:",
  11727. category: 'accessing',
  11728. fn: function (aString) {
  11729. var self=this;
  11730. (self['@source']=aString);
  11731. return self;},
  11732. args: ["aString"],
  11733. source: "source: aString\x0a\x09source := aString",
  11734. messageSends: [],
  11735. referencedClasses: []
  11736. }),
  11737. smalltalk.JSStatementNode);
  11738. smalltalk.addClass('MethodNode', smalltalk.Node, ['selector', 'arguments', 'source'], 'Compiler');
  11739. smalltalk.addMethod(
  11740. "_accept_",
  11741. smalltalk.method({
  11742. selector: "accept:",
  11743. category: 'visiting',
  11744. fn: function (aVisitor) {
  11745. var self=this;
  11746. smalltalk.send(aVisitor, "_visitMethodNode_", [self]);
  11747. return self;},
  11748. args: ["aVisitor"],
  11749. source: "accept: aVisitor\x0a\x09aVisitor visitMethodNode: self",
  11750. messageSends: ["visitMethodNode:"],
  11751. referencedClasses: []
  11752. }),
  11753. smalltalk.MethodNode);
  11754. smalltalk.addMethod(
  11755. "_arguments",
  11756. smalltalk.method({
  11757. selector: "arguments",
  11758. category: 'accessing',
  11759. fn: function () {
  11760. var self=this;
  11761. return (($receiver = self['@arguments']) == nil || $receiver == undefined) ? (function(){return [];})() : $receiver;
  11762. return self;},
  11763. args: [],
  11764. source: "arguments\x0a\x09^arguments ifNil: [#()]",
  11765. messageSends: ["ifNil:"],
  11766. referencedClasses: []
  11767. }),
  11768. smalltalk.MethodNode);
  11769. smalltalk.addMethod(
  11770. "_arguments_",
  11771. smalltalk.method({
  11772. selector: "arguments:",
  11773. category: 'accessing',
  11774. fn: function (aCollection) {
  11775. var self=this;
  11776. (self['@arguments']=aCollection);
  11777. return self;},
  11778. args: ["aCollection"],
  11779. source: "arguments: aCollection\x0a\x09arguments := aCollection",
  11780. messageSends: [],
  11781. referencedClasses: []
  11782. }),
  11783. smalltalk.MethodNode);
  11784. smalltalk.addMethod(
  11785. "_selector",
  11786. smalltalk.method({
  11787. selector: "selector",
  11788. category: 'accessing',
  11789. fn: function () {
  11790. var self=this;
  11791. return self['@selector'];
  11792. return self;},
  11793. args: [],
  11794. source: "selector\x0a\x09^selector",
  11795. messageSends: [],
  11796. referencedClasses: []
  11797. }),
  11798. smalltalk.MethodNode);
  11799. smalltalk.addMethod(
  11800. "_selector_",
  11801. smalltalk.method({
  11802. selector: "selector:",
  11803. category: 'accessing',
  11804. fn: function (aString) {
  11805. var self=this;
  11806. (self['@selector']=aString);
  11807. return self;},
  11808. args: ["aString"],
  11809. source: "selector: aString\x0a\x09selector := aString",
  11810. messageSends: [],
  11811. referencedClasses: []
  11812. }),
  11813. smalltalk.MethodNode);
  11814. smalltalk.addMethod(
  11815. "_source",
  11816. smalltalk.method({
  11817. selector: "source",
  11818. category: 'accessing',
  11819. fn: function () {
  11820. var self=this;
  11821. return self['@source'];
  11822. return self;},
  11823. args: [],
  11824. source: "source\x0a\x09^source",
  11825. messageSends: [],
  11826. referencedClasses: []
  11827. }),
  11828. smalltalk.MethodNode);
  11829. smalltalk.addMethod(
  11830. "_source_",
  11831. smalltalk.method({
  11832. selector: "source:",
  11833. category: 'accessing',
  11834. fn: function (aString) {
  11835. var self=this;
  11836. (self['@source']=aString);
  11837. return self;},
  11838. args: ["aString"],
  11839. source: "source: aString\x0a\x09source := aString",
  11840. messageSends: [],
  11841. referencedClasses: []
  11842. }),
  11843. smalltalk.MethodNode);
  11844. smalltalk.addClass('ReturnNode', smalltalk.Node, [], 'Compiler');
  11845. smalltalk.addMethod(
  11846. "_accept_",
  11847. smalltalk.method({
  11848. selector: "accept:",
  11849. category: 'visiting',
  11850. fn: function (aVisitor) {
  11851. var self=this;
  11852. smalltalk.send(aVisitor, "_visitReturnNode_", [self]);
  11853. return self;},
  11854. args: ["aVisitor"],
  11855. source: "accept: aVisitor\x0a\x09aVisitor visitReturnNode: self",
  11856. messageSends: ["visitReturnNode:"],
  11857. referencedClasses: []
  11858. }),
  11859. smalltalk.ReturnNode);
  11860. smalltalk.addClass('SendNode', smalltalk.Node, ['selector', 'arguments', 'receiver'], 'Compiler');
  11861. smalltalk.addMethod(
  11862. "_accept_",
  11863. smalltalk.method({
  11864. selector: "accept:",
  11865. category: 'visiting',
  11866. fn: function (aVisitor) {
  11867. var self=this;
  11868. smalltalk.send(aVisitor, "_visitSendNode_", [self]);
  11869. return self;},
  11870. args: ["aVisitor"],
  11871. source: "accept: aVisitor\x0a\x09aVisitor visitSendNode: self",
  11872. messageSends: ["visitSendNode:"],
  11873. referencedClasses: []
  11874. }),
  11875. smalltalk.SendNode);
  11876. smalltalk.addMethod(
  11877. "_arguments",
  11878. smalltalk.method({
  11879. selector: "arguments",
  11880. category: 'accessing',
  11881. fn: function () {
  11882. var self=this;
  11883. return (($receiver = self['@arguments']) == nil || $receiver == undefined) ? (function(){return (self['@arguments']=[]);})() : $receiver;
  11884. return self;},
  11885. args: [],
  11886. source: "arguments\x0a\x09^arguments ifNil: [arguments := #()]",
  11887. messageSends: ["ifNil:"],
  11888. referencedClasses: []
  11889. }),
  11890. smalltalk.SendNode);
  11891. smalltalk.addMethod(
  11892. "_arguments_",
  11893. smalltalk.method({
  11894. selector: "arguments:",
  11895. category: 'accessing',
  11896. fn: function (aCollection) {
  11897. var self=this;
  11898. (self['@arguments']=aCollection);
  11899. return self;},
  11900. args: ["aCollection"],
  11901. source: "arguments: aCollection\x0a\x09arguments := aCollection",
  11902. messageSends: [],
  11903. referencedClasses: []
  11904. }),
  11905. smalltalk.SendNode);
  11906. smalltalk.addMethod(
  11907. "_cascadeNodeWithMessages_",
  11908. smalltalk.method({
  11909. selector: "cascadeNodeWithMessages:",
  11910. category: 'accessing',
  11911. fn: function (aCollection) {
  11912. var self=this;
  11913. var first=nil;
  11914. (first=(function($rec){smalltalk.send($rec, "_selector_", [smalltalk.send(self, "_selector", [])]);smalltalk.send($rec, "_arguments_", [smalltalk.send(self, "_arguments", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.SendNode || SendNode), "_new", [])));
  11915. return (function($rec){smalltalk.send($rec, "_receiver_", [smalltalk.send(self, "_receiver", [])]);smalltalk.send($rec, "_nodes_", [smalltalk.send(smalltalk.send((smalltalk.Array || Array), "_with_", [first]), "__comma", [aCollection])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.CascadeNode || CascadeNode), "_new", []));
  11916. return self;},
  11917. args: ["aCollection"],
  11918. source: "cascadeNodeWithMessages: aCollection\x0a\x09| first |\x0a\x09first := SendNode new\x0a\x09 selector: self selector;\x0a\x09 arguments: self arguments;\x0a\x09 yourself.\x0a\x09^CascadeNode new\x0a\x09 receiver: self receiver;\x0a\x09 nodes: (Array with: first), aCollection;\x0a\x09 yourself",
  11919. messageSends: ["selector:", "selector", "arguments:", "arguments", "yourself", "new", "receiver:", "receiver", "nodes:", ",", "with:"],
  11920. referencedClasses: ["SendNode", "Array", "CascadeNode"]
  11921. }),
  11922. smalltalk.SendNode);
  11923. smalltalk.addMethod(
  11924. "_receiver",
  11925. smalltalk.method({
  11926. selector: "receiver",
  11927. category: 'accessing',
  11928. fn: function () {
  11929. var self=this;
  11930. return self['@receiver'];
  11931. return self;},
  11932. args: [],
  11933. source: "receiver\x0a\x09^receiver",
  11934. messageSends: [],
  11935. referencedClasses: []
  11936. }),
  11937. smalltalk.SendNode);
  11938. smalltalk.addMethod(
  11939. "_receiver_",
  11940. smalltalk.method({
  11941. selector: "receiver:",
  11942. category: 'accessing',
  11943. fn: function (aNode) {
  11944. var self=this;
  11945. (self['@receiver']=aNode);
  11946. return self;},
  11947. args: ["aNode"],
  11948. source: "receiver: aNode\x0a\x09receiver := aNode",
  11949. messageSends: [],
  11950. referencedClasses: []
  11951. }),
  11952. smalltalk.SendNode);
  11953. smalltalk.addMethod(
  11954. "_selector",
  11955. smalltalk.method({
  11956. selector: "selector",
  11957. category: 'accessing',
  11958. fn: function () {
  11959. var self=this;
  11960. return self['@selector'];
  11961. return self;},
  11962. args: [],
  11963. source: "selector\x0a\x09^selector",
  11964. messageSends: [],
  11965. referencedClasses: []
  11966. }),
  11967. smalltalk.SendNode);
  11968. smalltalk.addMethod(
  11969. "_selector_",
  11970. smalltalk.method({
  11971. selector: "selector:",
  11972. category: 'accessing',
  11973. fn: function (aString) {
  11974. var self=this;
  11975. (self['@selector']=aString);
  11976. return self;},
  11977. args: ["aString"],
  11978. source: "selector: aString\x0a\x09selector := aString",
  11979. messageSends: [],
  11980. referencedClasses: []
  11981. }),
  11982. smalltalk.SendNode);
  11983. smalltalk.addMethod(
  11984. "_valueForReceiver_",
  11985. smalltalk.method({
  11986. selector: "valueForReceiver:",
  11987. category: 'accessing',
  11988. fn: function (anObject) {
  11989. var self=this;
  11990. return (function($rec){smalltalk.send($rec, "_receiver_", [(($receiver = smalltalk.send(self, "_receiver", [])) == nil || $receiver == undefined) ? (function(){return anObject;})() : (function(){return smalltalk.send(smalltalk.send(self, "_receiver", []), "_valueForReceiver_", [anObject]);})()]);smalltalk.send($rec, "_selector_", [smalltalk.send(self, "_selector", [])]);smalltalk.send($rec, "_arguments_", [smalltalk.send(self, "_arguments", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.SendNode || SendNode), "_new", []));
  11991. return self;},
  11992. args: ["anObject"],
  11993. source: "valueForReceiver: anObject\x0a\x09^SendNode new\x0a\x09 receiver: (self receiver \x0a\x09\x09ifNil: [anObject]\x0a\x09\x09ifNotNil: [self receiver valueForReceiver: anObject]);\x0a\x09 selector: self selector;\x0a\x09 arguments: self arguments;\x0a\x09 yourself",
  11994. messageSends: ["receiver:", "ifNil:ifNotNil:", "receiver", "valueForReceiver:", "selector:", "selector", "arguments:", "arguments", "yourself", "new"],
  11995. referencedClasses: ["SendNode"]
  11996. }),
  11997. smalltalk.SendNode);
  11998. smalltalk.addClass('SequenceNode', smalltalk.Node, ['temps'], 'Compiler');
  11999. smalltalk.addMethod(
  12000. "_accept_",
  12001. smalltalk.method({
  12002. selector: "accept:",
  12003. category: 'visiting',
  12004. fn: function (aVisitor) {
  12005. var self=this;
  12006. smalltalk.send(aVisitor, "_visitSequenceNode_", [self]);
  12007. return self;},
  12008. args: ["aVisitor"],
  12009. source: "accept: aVisitor\x0a\x09aVisitor visitSequenceNode: self",
  12010. messageSends: ["visitSequenceNode:"],
  12011. referencedClasses: []
  12012. }),
  12013. smalltalk.SequenceNode);
  12014. smalltalk.addMethod(
  12015. "_asBlockSequenceNode",
  12016. smalltalk.method({
  12017. selector: "asBlockSequenceNode",
  12018. category: 'testing',
  12019. fn: function () {
  12020. var self=this;
  12021. return (function($rec){smalltalk.send($rec, "_nodes_", [smalltalk.send(self, "_nodes", [])]);smalltalk.send($rec, "_temps_", [smalltalk.send(self, "_temps", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.BlockSequenceNode || BlockSequenceNode), "_new", []));
  12022. return self;},
  12023. args: [],
  12024. source: "asBlockSequenceNode\x0a\x09^BlockSequenceNode new\x0a\x09 nodes: self nodes;\x0a\x09 temps: self temps;\x0a\x09 yourself",
  12025. messageSends: ["nodes:", "nodes", "temps:", "temps", "yourself", "new"],
  12026. referencedClasses: ["BlockSequenceNode"]
  12027. }),
  12028. smalltalk.SequenceNode);
  12029. smalltalk.addMethod(
  12030. "_temps",
  12031. smalltalk.method({
  12032. selector: "temps",
  12033. category: 'accessing',
  12034. fn: function () {
  12035. var self=this;
  12036. return (($receiver = self['@temps']) == nil || $receiver == undefined) ? (function(){return [];})() : $receiver;
  12037. return self;},
  12038. args: [],
  12039. source: "temps\x0a\x09^temps ifNil: [#()]",
  12040. messageSends: ["ifNil:"],
  12041. referencedClasses: []
  12042. }),
  12043. smalltalk.SequenceNode);
  12044. smalltalk.addMethod(
  12045. "_temps_",
  12046. smalltalk.method({
  12047. selector: "temps:",
  12048. category: 'accessing',
  12049. fn: function (aCollection) {
  12050. var self=this;
  12051. (self['@temps']=aCollection);
  12052. return self;},
  12053. args: ["aCollection"],
  12054. source: "temps: aCollection\x0a\x09temps := aCollection",
  12055. messageSends: [],
  12056. referencedClasses: []
  12057. }),
  12058. smalltalk.SequenceNode);
  12059. smalltalk.addClass('BlockSequenceNode', smalltalk.SequenceNode, [], 'Compiler');
  12060. smalltalk.addMethod(
  12061. "_accept_",
  12062. smalltalk.method({
  12063. selector: "accept:",
  12064. category: 'visiting',
  12065. fn: function (aVisitor) {
  12066. var self=this;
  12067. smalltalk.send(aVisitor, "_visitBlockSequenceNode_", [self]);
  12068. return self;},
  12069. args: ["aVisitor"],
  12070. source: "accept: aVisitor\x0a\x09aVisitor visitBlockSequenceNode: self",
  12071. messageSends: ["visitBlockSequenceNode:"],
  12072. referencedClasses: []
  12073. }),
  12074. smalltalk.BlockSequenceNode);
  12075. smalltalk.addMethod(
  12076. "_isBlockSequenceNode",
  12077. smalltalk.method({
  12078. selector: "isBlockSequenceNode",
  12079. category: 'testing',
  12080. fn: function () {
  12081. var self=this;
  12082. return true;
  12083. return self;},
  12084. args: [],
  12085. source: "isBlockSequenceNode\x0a\x09^true",
  12086. messageSends: [],
  12087. referencedClasses: []
  12088. }),
  12089. smalltalk.BlockSequenceNode);
  12090. smalltalk.addClass('ValueNode', smalltalk.Node, ['value'], 'Compiler');
  12091. smalltalk.addMethod(
  12092. "_accept_",
  12093. smalltalk.method({
  12094. selector: "accept:",
  12095. category: 'visiting',
  12096. fn: function (aVisitor) {
  12097. var self=this;
  12098. smalltalk.send(aVisitor, "_visitValueNode_", [self]);
  12099. return self;},
  12100. args: ["aVisitor"],
  12101. source: "accept: aVisitor\x0a\x09aVisitor visitValueNode: self",
  12102. messageSends: ["visitValueNode:"],
  12103. referencedClasses: []
  12104. }),
  12105. smalltalk.ValueNode);
  12106. smalltalk.addMethod(
  12107. "_isValueNode",
  12108. smalltalk.method({
  12109. selector: "isValueNode",
  12110. category: 'testing',
  12111. fn: function () {
  12112. var self=this;
  12113. return true;
  12114. return self;},
  12115. args: [],
  12116. source: "isValueNode\x0a\x09^true",
  12117. messageSends: [],
  12118. referencedClasses: []
  12119. }),
  12120. smalltalk.ValueNode);
  12121. smalltalk.addMethod(
  12122. "_value",
  12123. smalltalk.method({
  12124. selector: "value",
  12125. category: 'accessing',
  12126. fn: function () {
  12127. var self=this;
  12128. return self['@value'];
  12129. return self;},
  12130. args: [],
  12131. source: "value\x0a\x09^value",
  12132. messageSends: [],
  12133. referencedClasses: []
  12134. }),
  12135. smalltalk.ValueNode);
  12136. smalltalk.addMethod(
  12137. "_value_",
  12138. smalltalk.method({
  12139. selector: "value:",
  12140. category: 'accessing',
  12141. fn: function (anObject) {
  12142. var self=this;
  12143. (self['@value']=anObject);
  12144. return self;},
  12145. args: ["anObject"],
  12146. source: "value: anObject\x0a\x09value := anObject",
  12147. messageSends: [],
  12148. referencedClasses: []
  12149. }),
  12150. smalltalk.ValueNode);
  12151. smalltalk.addClass('VariableNode', smalltalk.ValueNode, ['assigned'], 'Compiler');
  12152. smalltalk.addMethod(
  12153. "_accept_",
  12154. smalltalk.method({
  12155. selector: "accept:",
  12156. category: 'visiting',
  12157. fn: function (aVisitor) {
  12158. var self=this;
  12159. smalltalk.send(aVisitor, "_visitVariableNode_", [self]);
  12160. return self;},
  12161. args: ["aVisitor"],
  12162. source: "accept: aVisitor\x0a\x09aVisitor visitVariableNode: self",
  12163. messageSends: ["visitVariableNode:"],
  12164. referencedClasses: []
  12165. }),
  12166. smalltalk.VariableNode);
  12167. smalltalk.addMethod(
  12168. "_assigned",
  12169. smalltalk.method({
  12170. selector: "assigned",
  12171. category: 'accessing',
  12172. fn: function () {
  12173. var self=this;
  12174. return (($receiver = self['@assigned']) == nil || $receiver == undefined) ? (function(){return false;})() : $receiver;
  12175. return self;},
  12176. args: [],
  12177. source: "assigned\x0a\x09^assigned ifNil: [false]",
  12178. messageSends: ["ifNil:"],
  12179. referencedClasses: []
  12180. }),
  12181. smalltalk.VariableNode);
  12182. smalltalk.addMethod(
  12183. "_assigned_",
  12184. smalltalk.method({
  12185. selector: "assigned:",
  12186. category: 'accessing',
  12187. fn: function (aBoolean) {
  12188. var self=this;
  12189. (self['@assigned']=aBoolean);
  12190. return self;},
  12191. args: ["aBoolean"],
  12192. source: "assigned: aBoolean\x0a\x09assigned := aBoolean",
  12193. messageSends: [],
  12194. referencedClasses: []
  12195. }),
  12196. smalltalk.VariableNode);
  12197. smalltalk.addClass('ClassReferenceNode', smalltalk.VariableNode, [], 'Compiler');
  12198. smalltalk.addMethod(
  12199. "_accept_",
  12200. smalltalk.method({
  12201. selector: "accept:",
  12202. category: 'visiting',
  12203. fn: function (aVisitor) {
  12204. var self=this;
  12205. smalltalk.send(aVisitor, "_visitClassReferenceNode_", [self]);
  12206. return self;},
  12207. args: ["aVisitor"],
  12208. source: "accept: aVisitor\x0a\x09aVisitor visitClassReferenceNode: self",
  12209. messageSends: ["visitClassReferenceNode:"],
  12210. referencedClasses: []
  12211. }),
  12212. smalltalk.ClassReferenceNode);
  12213. smalltalk.addClass('NodeVisitor', smalltalk.Object, [], 'Compiler');
  12214. smalltalk.addMethod(
  12215. "_visit_",
  12216. smalltalk.method({
  12217. selector: "visit:",
  12218. category: 'visiting',
  12219. fn: function (aNode) {
  12220. var self=this;
  12221. smalltalk.send(aNode, "_accept_", [self]);
  12222. return self;},
  12223. args: ["aNode"],
  12224. source: "visit: aNode\x0a\x09aNode accept: self",
  12225. messageSends: ["accept:"],
  12226. referencedClasses: []
  12227. }),
  12228. smalltalk.NodeVisitor);
  12229. smalltalk.addMethod(
  12230. "_visitAssignmentNode_",
  12231. smalltalk.method({
  12232. selector: "visitAssignmentNode:",
  12233. category: 'visiting',
  12234. fn: function (aNode) {
  12235. var self=this;
  12236. smalltalk.send(self, "_visitNode_", [aNode]);
  12237. return self;},
  12238. args: ["aNode"],
  12239. source: "visitAssignmentNode: aNode\x0a\x09self visitNode: aNode",
  12240. messageSends: ["visitNode:"],
  12241. referencedClasses: []
  12242. }),
  12243. smalltalk.NodeVisitor);
  12244. smalltalk.addMethod(
  12245. "_visitBlockNode_",
  12246. smalltalk.method({
  12247. selector: "visitBlockNode:",
  12248. category: 'visiting',
  12249. fn: function (aNode) {
  12250. var self=this;
  12251. smalltalk.send(self, "_visitNode_", [aNode]);
  12252. return self;},
  12253. args: ["aNode"],
  12254. source: "visitBlockNode: aNode\x0a\x09self visitNode: aNode",
  12255. messageSends: ["visitNode:"],
  12256. referencedClasses: []
  12257. }),
  12258. smalltalk.NodeVisitor);
  12259. smalltalk.addMethod(
  12260. "_visitBlockSequenceNode_",
  12261. smalltalk.method({
  12262. selector: "visitBlockSequenceNode:",
  12263. category: 'visiting',
  12264. fn: function (aNode) {
  12265. var self=this;
  12266. smalltalk.send(self, "_visitNode_", [aNode]);
  12267. return self;},
  12268. args: ["aNode"],
  12269. source: "visitBlockSequenceNode: aNode\x0a\x09self visitNode: aNode",
  12270. messageSends: ["visitNode:"],
  12271. referencedClasses: []
  12272. }),
  12273. smalltalk.NodeVisitor);
  12274. smalltalk.addMethod(
  12275. "_visitCascadeNode_",
  12276. smalltalk.method({
  12277. selector: "visitCascadeNode:",
  12278. category: 'visiting',
  12279. fn: function (aNode) {
  12280. var self=this;
  12281. smalltalk.send(self, "_visitNode_", [aNode]);
  12282. return self;},
  12283. args: ["aNode"],
  12284. source: "visitCascadeNode: aNode\x0a\x09self visitNode: aNode",
  12285. messageSends: ["visitNode:"],
  12286. referencedClasses: []
  12287. }),
  12288. smalltalk.NodeVisitor);
  12289. smalltalk.addMethod(
  12290. "_visitClassReferenceNode_",
  12291. smalltalk.method({
  12292. selector: "visitClassReferenceNode:",
  12293. category: 'visiting',
  12294. fn: function (aNode) {
  12295. var self=this;
  12296. smalltalk.send(self, "_visitNode_", [aNode]);
  12297. return self;},
  12298. args: ["aNode"],
  12299. source: "visitClassReferenceNode: aNode\x0a\x09self visitNode: aNode",
  12300. messageSends: ["visitNode:"],
  12301. referencedClasses: []
  12302. }),
  12303. smalltalk.NodeVisitor);
  12304. smalltalk.addMethod(
  12305. "_visitDynamicArrayNode_",
  12306. smalltalk.method({
  12307. selector: "visitDynamicArrayNode:",
  12308. category: 'visiting',
  12309. fn: function (aNode) {
  12310. var self=this;
  12311. smalltalk.send(self, "_visitNode_", [aNode]);
  12312. return self;},
  12313. args: ["aNode"],
  12314. source: "visitDynamicArrayNode: aNode\x0a\x09self visitNode: aNode",
  12315. messageSends: ["visitNode:"],
  12316. referencedClasses: []
  12317. }),
  12318. smalltalk.NodeVisitor);
  12319. smalltalk.addMethod(
  12320. "_visitDynamicDictionaryNode_",
  12321. smalltalk.method({
  12322. selector: "visitDynamicDictionaryNode:",
  12323. category: 'visiting',
  12324. fn: function (aNode) {
  12325. var self=this;
  12326. smalltalk.send(self, "_visitNode_", [aNode]);
  12327. return self;},
  12328. args: ["aNode"],
  12329. source: "visitDynamicDictionaryNode: aNode\x0a\x09self visitNode: aNode",
  12330. messageSends: ["visitNode:"],
  12331. referencedClasses: []
  12332. }),
  12333. smalltalk.NodeVisitor);
  12334. smalltalk.addMethod(
  12335. "_visitJSStatementNode_",
  12336. smalltalk.method({
  12337. selector: "visitJSStatementNode:",
  12338. category: 'visiting',
  12339. fn: function (aNode) {
  12340. var self=this;
  12341. smalltalk.send(self, "_visitNode_", [aNode]);
  12342. return self;},
  12343. args: ["aNode"],
  12344. source: "visitJSStatementNode: aNode\x0a\x09self visitNode: aNode",
  12345. messageSends: ["visitNode:"],
  12346. referencedClasses: []
  12347. }),
  12348. smalltalk.NodeVisitor);
  12349. smalltalk.addMethod(
  12350. "_visitMethodNode_",
  12351. smalltalk.method({
  12352. selector: "visitMethodNode:",
  12353. category: 'visiting',
  12354. fn: function (aNode) {
  12355. var self=this;
  12356. smalltalk.send(self, "_visitNode_", [aNode]);
  12357. return self;},
  12358. args: ["aNode"],
  12359. source: "visitMethodNode: aNode\x0a\x09self visitNode: aNode",
  12360. messageSends: ["visitNode:"],
  12361. referencedClasses: []
  12362. }),
  12363. smalltalk.NodeVisitor);
  12364. smalltalk.addMethod(
  12365. "_visitNode_",
  12366. smalltalk.method({
  12367. selector: "visitNode:",
  12368. category: 'visiting',
  12369. fn: function (aNode) {
  12370. var self=this;
  12371. return self;},
  12372. args: ["aNode"],
  12373. source: "visitNode: aNode",
  12374. messageSends: [],
  12375. referencedClasses: []
  12376. }),
  12377. smalltalk.NodeVisitor);
  12378. smalltalk.addMethod(
  12379. "_visitReturnNode_",
  12380. smalltalk.method({
  12381. selector: "visitReturnNode:",
  12382. category: 'visiting',
  12383. fn: function (aNode) {
  12384. var self=this;
  12385. smalltalk.send(self, "_visitNode_", [aNode]);
  12386. return self;},
  12387. args: ["aNode"],
  12388. source: "visitReturnNode: aNode\x0a\x09self visitNode: aNode",
  12389. messageSends: ["visitNode:"],
  12390. referencedClasses: []
  12391. }),
  12392. smalltalk.NodeVisitor);
  12393. smalltalk.addMethod(
  12394. "_visitSendNode_",
  12395. smalltalk.method({
  12396. selector: "visitSendNode:",
  12397. category: 'visiting',
  12398. fn: function (aNode) {
  12399. var self=this;
  12400. smalltalk.send(self, "_visitNode_", [aNode]);
  12401. return self;},
  12402. args: ["aNode"],
  12403. source: "visitSendNode: aNode\x0a\x09self visitNode: aNode",
  12404. messageSends: ["visitNode:"],
  12405. referencedClasses: []
  12406. }),
  12407. smalltalk.NodeVisitor);
  12408. smalltalk.addMethod(
  12409. "_visitSequenceNode_",
  12410. smalltalk.method({
  12411. selector: "visitSequenceNode:",
  12412. category: 'visiting',
  12413. fn: function (aNode) {
  12414. var self=this;
  12415. smalltalk.send(self, "_visitNode_", [aNode]);
  12416. return self;},
  12417. args: ["aNode"],
  12418. source: "visitSequenceNode: aNode\x0a\x09self visitNode: aNode",
  12419. messageSends: ["visitNode:"],
  12420. referencedClasses: []
  12421. }),
  12422. smalltalk.NodeVisitor);
  12423. smalltalk.addMethod(
  12424. "_visitValueNode_",
  12425. smalltalk.method({
  12426. selector: "visitValueNode:",
  12427. category: 'visiting',
  12428. fn: function (aNode) {
  12429. var self=this;
  12430. smalltalk.send(self, "_visitNode_", [aNode]);
  12431. return self;},
  12432. args: ["aNode"],
  12433. source: "visitValueNode: aNode\x0a\x09self visitNode: aNode",
  12434. messageSends: ["visitNode:"],
  12435. referencedClasses: []
  12436. }),
  12437. smalltalk.NodeVisitor);
  12438. smalltalk.addMethod(
  12439. "_visitVariableNode_",
  12440. smalltalk.method({
  12441. selector: "visitVariableNode:",
  12442. category: 'visiting',
  12443. fn: function (aNode) {
  12444. var self=this;
  12445. smalltalk.send(self, "_visitNode_", [aNode]);
  12446. return self;},
  12447. args: ["aNode"],
  12448. source: "visitVariableNode: aNode\x0a\x09self visitNode: aNode",
  12449. messageSends: ["visitNode:"],
  12450. referencedClasses: []
  12451. }),
  12452. smalltalk.NodeVisitor);
  12453. smalltalk.addClass('AbstractCompiler', smalltalk.NodeVisitor, ['currentClass', 'source'], 'Compiler');
  12454. smalltalk.addMethod(
  12455. "_classNameFor_",
  12456. smalltalk.method({
  12457. selector: "classNameFor:",
  12458. category: 'accessing',
  12459. fn: function (aClass) {
  12460. var self=this;
  12461. return ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [".klass"]);})() : (function(){return ((($receiver = smalltalk.send(aClass, "_isNil", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "nil";})() : (function(){return smalltalk.send(aClass, "_name", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [".klass"]);}), (function(){return ((($receiver = smalltalk.send(aClass, "_isNil", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "nil";})() : (function(){return smalltalk.send(aClass, "_name", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]));})]));
  12462. return self;},
  12463. args: ["aClass"],
  12464. source: "classNameFor: aClass\x0a\x09^aClass isMetaclass\x0a\x09 ifTrue: [aClass instanceClass name, '.klass']\x0a\x09 ifFalse: [\x0a\x09\x09aClass isNil\x0a\x09\x09 ifTrue: ['nil']\x0a\x09\x09 ifFalse: [aClass name]]",
  12465. messageSends: ["ifTrue:ifFalse:", "isMetaclass", ",", "name", "instanceClass", "isNil"],
  12466. referencedClasses: []
  12467. }),
  12468. smalltalk.AbstractCompiler);
  12469. smalltalk.addMethod(
  12470. "_compile_",
  12471. smalltalk.method({
  12472. selector: "compile:",
  12473. category: 'compiling',
  12474. fn: function (aString) {
  12475. var self=this;
  12476. return smalltalk.send(self, "_compileNode_", [smalltalk.send(self, "_parse_", [aString])]);
  12477. return self;},
  12478. args: ["aString"],
  12479. source: "compile: aString\x0a\x09^self compileNode: (self parse: aString)",
  12480. messageSends: ["compileNode:", "parse:"],
  12481. referencedClasses: []
  12482. }),
  12483. smalltalk.AbstractCompiler);
  12484. smalltalk.addMethod(
  12485. "_compile_forClass_",
  12486. smalltalk.method({
  12487. selector: "compile:forClass:",
  12488. category: 'compiling',
  12489. fn: function (aString, aClass) {
  12490. var self=this;
  12491. smalltalk.send(self, "_currentClass_", [aClass]);
  12492. smalltalk.send(self, "_source_", [aString]);
  12493. return smalltalk.send(self, "_compile_", [aString]);
  12494. return self;},
  12495. args: ["aString", "aClass"],
  12496. source: "compile: aString forClass: aClass\x0a\x09self currentClass: aClass.\x0a\x09self source: aString.\x0a\x09^self compile: aString",
  12497. messageSends: ["currentClass:", "source:", "compile:"],
  12498. referencedClasses: []
  12499. }),
  12500. smalltalk.AbstractCompiler);
  12501. smalltalk.addMethod(
  12502. "_compileExpression_",
  12503. smalltalk.method({
  12504. selector: "compileExpression:",
  12505. category: 'compiling',
  12506. fn: function (aString) {
  12507. var self=this;
  12508. smalltalk.send(self, "_currentClass_", [(smalltalk.DoIt || DoIt)]);
  12509. smalltalk.send(self, "_source_", [smalltalk.send(smalltalk.send("doIt ^[", "__comma", [aString]), "__comma", ["] value"])]);
  12510. return smalltalk.send(self, "_compileNode_", [smalltalk.send(self, "_parse_", [smalltalk.send(self, "_source", [])])]);
  12511. return self;},
  12512. args: ["aString"],
  12513. source: "compileExpression: aString\x0a\x09self currentClass: DoIt.\x0a\x09self source: 'doIt ^[', aString, '] value'.\x0a\x09^self compileNode: (self parse: self source)",
  12514. messageSends: ["currentClass:", "source:", ",", "compileNode:", "parse:", "source"],
  12515. referencedClasses: ["DoIt"]
  12516. }),
  12517. smalltalk.AbstractCompiler);
  12518. smalltalk.addMethod(
  12519. "_compileNode_",
  12520. smalltalk.method({
  12521. selector: "compileNode:",
  12522. category: 'compiling',
  12523. fn: function (aNode) {
  12524. var self=this;
  12525. smalltalk.send(self, "_subclassResponsibility", []);
  12526. return self;},
  12527. args: ["aNode"],
  12528. source: "compileNode: aNode\x0a\x09self subclassResponsibility",
  12529. messageSends: ["subclassResponsibility"],
  12530. referencedClasses: []
  12531. }),
  12532. smalltalk.AbstractCompiler);
  12533. smalltalk.addMethod(
  12534. "_currentClass",
  12535. smalltalk.method({
  12536. selector: "currentClass",
  12537. category: 'accessing',
  12538. fn: function () {
  12539. var self=this;
  12540. return self['@currentClass'];
  12541. return self;},
  12542. args: [],
  12543. source: "currentClass\x0a\x09^currentClass",
  12544. messageSends: [],
  12545. referencedClasses: []
  12546. }),
  12547. smalltalk.AbstractCompiler);
  12548. smalltalk.addMethod(
  12549. "_currentClass_",
  12550. smalltalk.method({
  12551. selector: "currentClass:",
  12552. category: 'accessing',
  12553. fn: function (aClass) {
  12554. var self=this;
  12555. (self['@currentClass']=aClass);
  12556. return self;},
  12557. args: ["aClass"],
  12558. source: "currentClass: aClass\x0a\x09currentClass := aClass",
  12559. messageSends: [],
  12560. referencedClasses: []
  12561. }),
  12562. smalltalk.AbstractCompiler);
  12563. smalltalk.addMethod(
  12564. "_eval_",
  12565. smalltalk.method({
  12566. selector: "eval:",
  12567. category: 'compiling',
  12568. fn: function (aString) {
  12569. var self=this;
  12570. return eval(aString);
  12571. return self;},
  12572. args: ["aString"],
  12573. source: "eval: aString\x0a\x09<return eval(aString)>",
  12574. messageSends: [],
  12575. referencedClasses: []
  12576. }),
  12577. smalltalk.AbstractCompiler);
  12578. smalltalk.addMethod(
  12579. "_load_forClass_",
  12580. smalltalk.method({
  12581. selector: "load:forClass:",
  12582. category: 'compiling',
  12583. fn: function (aString, aClass) {
  12584. var self=this;
  12585. var compiled=nil;
  12586. (compiled=smalltalk.send(self, "_eval_", [smalltalk.send(self, "_compile_forClass_", [aString, aClass])]));
  12587. smalltalk.send(self, "_setupClass_", [aClass]);
  12588. return compiled;
  12589. return self;},
  12590. args: ["aString", "aClass"],
  12591. source: "load: aString forClass: aClass\x0a\x09| compiled |\x0a\x09compiled := self eval: (self compile: aString forClass: aClass).\x0a\x09self setupClass: aClass.\x0a\x09^compiled",
  12592. messageSends: ["eval:", "compile:forClass:", "setupClass:"],
  12593. referencedClasses: []
  12594. }),
  12595. smalltalk.AbstractCompiler);
  12596. smalltalk.addMethod(
  12597. "_loadExpression_",
  12598. smalltalk.method({
  12599. selector: "loadExpression:",
  12600. category: 'compiling',
  12601. fn: function (aString) {
  12602. var self=this;
  12603. var result=nil;
  12604. smalltalk.send((smalltalk.DoIt || DoIt), "_addCompiledMethod_", [smalltalk.send(self, "_eval_", [smalltalk.send(self, "_compileExpression_", [aString])])]);
  12605. (result=smalltalk.send(smalltalk.send((smalltalk.DoIt || DoIt), "_new", []), "_doIt", []));
  12606. smalltalk.send((smalltalk.DoIt || DoIt), "_removeCompiledMethod_", [smalltalk.send(smalltalk.send((smalltalk.DoIt || DoIt), "_methodDictionary", []), "_at_", ["doIt"])]);
  12607. return result;
  12608. return self;},
  12609. args: ["aString"],
  12610. source: "loadExpression: aString\x0a\x09| result |\x0a\x09DoIt addCompiledMethod: (self eval: (self compileExpression: aString)).\x0a\x09result := DoIt new doIt.\x0a\x09DoIt removeCompiledMethod: (DoIt methodDictionary at: 'doIt').\x0a\x09^result",
  12611. messageSends: ["addCompiledMethod:", "eval:", "compileExpression:", "doIt", "new", "removeCompiledMethod:", "at:", "methodDictionary"],
  12612. referencedClasses: ["DoIt"]
  12613. }),
  12614. smalltalk.AbstractCompiler);
  12615. smalltalk.addMethod(
  12616. "_parse_",
  12617. smalltalk.method({
  12618. selector: "parse:",
  12619. category: 'compiling',
  12620. fn: function (aString) {
  12621. var self=this;
  12622. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_parse_", [aString]);
  12623. return self;},
  12624. args: ["aString"],
  12625. source: "parse: aString\x0a ^Smalltalk current parse: aString",
  12626. messageSends: ["parse:", "current"],
  12627. referencedClasses: ["Smalltalk"]
  12628. }),
  12629. smalltalk.AbstractCompiler);
  12630. smalltalk.addMethod(
  12631. "_parseExpression_",
  12632. smalltalk.method({
  12633. selector: "parseExpression:",
  12634. category: 'compiling',
  12635. fn: function (aString) {
  12636. var self=this;
  12637. return smalltalk.send(self, "_parse_", [smalltalk.send(smalltalk.send("doIt ^[", "__comma", [aString]), "__comma", ["] value"])]);
  12638. return self;},
  12639. args: ["aString"],
  12640. source: "parseExpression: aString\x0a ^self parse: 'doIt ^[', aString, '] value'",
  12641. messageSends: ["parse:", ","],
  12642. referencedClasses: []
  12643. }),
  12644. smalltalk.AbstractCompiler);
  12645. smalltalk.addMethod(
  12646. "_pseudoVariables",
  12647. smalltalk.method({
  12648. selector: "pseudoVariables",
  12649. category: 'accessing',
  12650. fn: function () {
  12651. var self=this;
  12652. return ["self", "super", "true", "false", "nil", "thisContext"];
  12653. return self;},
  12654. args: [],
  12655. source: "pseudoVariables\x0a\x09^#('self' 'super' 'true' 'false' 'nil' 'thisContext')",
  12656. messageSends: [],
  12657. referencedClasses: []
  12658. }),
  12659. smalltalk.AbstractCompiler);
  12660. smalltalk.addMethod(
  12661. "_recompile_",
  12662. smalltalk.method({
  12663. selector: "recompile:",
  12664. category: 'compiling',
  12665. fn: function (aClass) {
  12666. var self=this;
  12667. smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_do_", [(function(each){var method=nil;
  12668. (method=smalltalk.send(self, "_load_forClass_", [smalltalk.send(each, "_source", []), aClass]));smalltalk.send(method, "_category_", [smalltalk.send(each, "_category", [])]);return smalltalk.send(aClass, "_addCompiledMethod_", [method]);})]);
  12669. ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_recompile_", [smalltalk.send(aClass, "_class", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_recompile_", [smalltalk.send(aClass, "_class", [])]);})]));
  12670. return self;},
  12671. args: ["aClass"],
  12672. source: "recompile: aClass\x0a\x09aClass methodDictionary do: [:each || method |\x0a\x09\x09method := self load: each source forClass: aClass.\x0a\x09\x09method category: each category.\x0a\x09\x09aClass addCompiledMethod: method].\x0a\x09aClass isMetaclass ifFalse: [self recompile: aClass class]",
  12673. messageSends: ["do:", "methodDictionary", "load:forClass:", "source", "category:", "category", "addCompiledMethod:", "ifFalse:", "isMetaclass", "recompile:", "class"],
  12674. referencedClasses: []
  12675. }),
  12676. smalltalk.AbstractCompiler);
  12677. smalltalk.addMethod(
  12678. "_recompileAll",
  12679. smalltalk.method({
  12680. selector: "recompileAll",
  12681. category: 'compiling',
  12682. fn: function () {
  12683. var self=this;
  12684. smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_classes", []), "_do_", [(function(each){(function($rec){smalltalk.send($rec, "_show_", [each]);return smalltalk.send($rec, "_cr", []);})((smalltalk.Transcript || Transcript));return smalltalk.send((function(){return smalltalk.send(self, "_recompile_", [each]);}), "_valueWithTimeout_", [(100)]);})]);
  12685. return self;},
  12686. args: [],
  12687. source: "recompileAll\x0a\x09Smalltalk current classes do: [:each |\x0a\x09\x09Transcript show: each; cr.\x0a\x09\x09[self recompile: each] valueWithTimeout: 100]",
  12688. messageSends: ["do:", "classes", "current", "show:", "cr", "valueWithTimeout:", "recompile:"],
  12689. referencedClasses: ["Smalltalk", "Transcript"]
  12690. }),
  12691. smalltalk.AbstractCompiler);
  12692. smalltalk.addMethod(
  12693. "_safeVariableNameFor_",
  12694. smalltalk.method({
  12695. selector: "safeVariableNameFor:",
  12696. category: 'accessing',
  12697. fn: function (aString) {
  12698. var self=this;
  12699. return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_reservedWords", []), "_includes_", [aString])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(aString, "__comma", ["_"]);})() : (function(){return aString;})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aString, "__comma", ["_"]);}), (function(){return aString;})]));
  12700. return self;},
  12701. args: ["aString"],
  12702. source: "safeVariableNameFor: aString\x0a\x09^(Smalltalk current reservedWords includes: aString)\x0a\x09\x09ifTrue: [aString, '_']\x0a\x09\x09ifFalse: [aString]",
  12703. messageSends: ["ifTrue:ifFalse:", "includes:", "reservedWords", "current", ","],
  12704. referencedClasses: ["Smalltalk"]
  12705. }),
  12706. smalltalk.AbstractCompiler);
  12707. smalltalk.addMethod(
  12708. "_setupClass_",
  12709. smalltalk.method({
  12710. selector: "setupClass:",
  12711. category: 'compiling',
  12712. fn: function (aClass) {
  12713. var self=this;
  12714. smalltalk.init(aClass);
  12715. return self;},
  12716. args: ["aClass"],
  12717. source: "setupClass: aClass\x0a\x09<smalltalk.init(aClass)>",
  12718. messageSends: [],
  12719. referencedClasses: []
  12720. }),
  12721. smalltalk.AbstractCompiler);
  12722. smalltalk.addMethod(
  12723. "_source",
  12724. smalltalk.method({
  12725. selector: "source",
  12726. category: 'accessing',
  12727. fn: function () {
  12728. var self=this;
  12729. return (($receiver = self['@source']) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  12730. return self;},
  12731. args: [],
  12732. source: "source\x0a\x09^source ifNil: ['']",
  12733. messageSends: ["ifNil:"],
  12734. referencedClasses: []
  12735. }),
  12736. smalltalk.AbstractCompiler);
  12737. smalltalk.addMethod(
  12738. "_source_",
  12739. smalltalk.method({
  12740. selector: "source:",
  12741. category: 'accessing',
  12742. fn: function (aString) {
  12743. var self=this;
  12744. (self['@source']=aString);
  12745. return self;},
  12746. args: ["aString"],
  12747. source: "source: aString\x0a\x09source := aString",
  12748. messageSends: [],
  12749. referencedClasses: []
  12750. }),
  12751. smalltalk.AbstractCompiler);
  12752. smalltalk.addMethod(
  12753. "_recompile_",
  12754. smalltalk.method({
  12755. selector: "recompile:",
  12756. category: 'compiling',
  12757. fn: function (aClass) {
  12758. var self=this;
  12759. smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_do_", [(function(each){var method=nil;
  12760. (method=smalltalk.send(smalltalk.send(self, "_new", []), "_load_forClass_", [smalltalk.send(each, "_source", []), aClass]));smalltalk.send(method, "_category_", [smalltalk.send(each, "_category", [])]);return smalltalk.send(aClass, "_addCompiledMethod_", [method]);})]);
  12761. ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_recompile_", [smalltalk.send(aClass, "_class", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_recompile_", [smalltalk.send(aClass, "_class", [])]);})]));
  12762. return self;},
  12763. args: ["aClass"],
  12764. source: "recompile: aClass\x0a\x09aClass methodDictionary do: [:each || method |\x0a\x09\x09method := self new load: each source forClass: aClass.\x0a\x09\x09method category: each category.\x0a\x09\x09aClass addCompiledMethod: method].\x0a\x09aClass isMetaclass ifFalse: [self recompile: aClass class]",
  12765. messageSends: ["do:", "methodDictionary", "load:forClass:", "new", "source", "category:", "category", "addCompiledMethod:", "ifFalse:", "isMetaclass", "recompile:", "class"],
  12766. referencedClasses: []
  12767. }),
  12768. smalltalk.AbstractCompiler.klass);
  12769. smalltalk.addMethod(
  12770. "_recompileAll",
  12771. smalltalk.method({
  12772. selector: "recompileAll",
  12773. category: 'compiling',
  12774. fn: function () {
  12775. var self=this;
  12776. smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_classes", []), "_do_", [(function(each){return smalltalk.send(self, "_recompile_", [each]);})]);
  12777. return self;},
  12778. args: [],
  12779. source: "recompileAll\x0a\x09Smalltalk current classes do: [:each |\x0a\x09\x09self recompile: each]",
  12780. messageSends: ["do:", "classes", "current", "recompile:"],
  12781. referencedClasses: ["Smalltalk"]
  12782. }),
  12783. smalltalk.AbstractCompiler.klass);
  12784. smalltalk.addClass('Compiler', smalltalk.AbstractCompiler, ['stream', 'nestedBlocks', 'earlyReturn', 'currentSelector', 'unknownVariables', 'tempVariables', 'messageSends', 'referencedClasses', 'classReferenced', 'argVariables'], 'Compiler');
  12785. smalltalk.addMethod(
  12786. "_argVariables",
  12787. smalltalk.method({
  12788. selector: "argVariables",
  12789. category: 'accessing',
  12790. fn: function () {
  12791. var self=this;
  12792. return smalltalk.send(self['@argVariables'], "_copy", []);
  12793. return self;},
  12794. args: [],
  12795. source: "argVariables\x0a\x09^argVariables copy",
  12796. messageSends: ["copy"],
  12797. referencedClasses: []
  12798. }),
  12799. smalltalk.Compiler);
  12800. smalltalk.addMethod(
  12801. "_checkClass_for_",
  12802. smalltalk.method({
  12803. selector: "checkClass:for:",
  12804. category: 'optimizations',
  12805. fn: function (aClassName, receiver) {
  12806. var self=this;
  12807. smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%28%28%28%24receiver%20%3D%20"), "__comma", [receiver]), "__comma", [unescape("%29.klass%20%3D%3D%3D%20smalltalk.")]), "__comma", [aClassName]), "__comma", [unescape("%29%20%3F%20")])]);
  12808. return self;},
  12809. args: ["aClassName", "receiver"],
  12810. source: "checkClass: aClassName for: receiver\x0a stream nextPutAll: '((($receiver = ', receiver, ').klass === smalltalk.', aClassName, ') ? '",
  12811. messageSends: ["nextPutAll:", ","],
  12812. referencedClasses: []
  12813. }),
  12814. smalltalk.Compiler);
  12815. smalltalk.addMethod(
  12816. "_compileNode_",
  12817. smalltalk.method({
  12818. selector: "compileNode:",
  12819. category: 'compiling',
  12820. fn: function (aNode) {
  12821. var self=this;
  12822. (self['@stream']=smalltalk.send("", "_writeStream", []));
  12823. smalltalk.send(self, "_visit_", [aNode]);
  12824. return smalltalk.send(self['@stream'], "_contents", []);
  12825. return self;},
  12826. args: ["aNode"],
  12827. source: "compileNode: aNode\x0a\x09stream := '' writeStream.\x0a\x09self visit: aNode.\x0a\x09^stream contents",
  12828. messageSends: ["writeStream", "visit:", "contents"],
  12829. referencedClasses: []
  12830. }),
  12831. smalltalk.Compiler);
  12832. smalltalk.addMethod(
  12833. "_initialize",
  12834. smalltalk.method({
  12835. selector: "initialize",
  12836. category: 'initialization',
  12837. fn: function () {
  12838. var self=this;
  12839. smalltalk.send(self, "_initialize", [], smalltalk.NodeVisitor);
  12840. (self['@stream']=smalltalk.send("", "_writeStream", []));
  12841. (self['@unknownVariables']=[]);
  12842. (self['@tempVariables']=[]);
  12843. (self['@argVariables']=[]);
  12844. (self['@messageSends']=[]);
  12845. (self['@classReferenced']=[]);
  12846. return self;},
  12847. args: [],
  12848. source: "initialize\x0a\x09super initialize.\x0a\x09stream := '' writeStream. \x0a\x09unknownVariables := #().\x0a\x09tempVariables := #().\x0a\x09argVariables := #().\x0a\x09messageSends := #().\x0a\x09classReferenced := #()",
  12849. messageSends: ["initialize", "writeStream"],
  12850. referencedClasses: []
  12851. }),
  12852. smalltalk.Compiler);
  12853. smalltalk.addMethod(
  12854. "_inline_receiver_argumentNodes_",
  12855. smalltalk.method({
  12856. selector: "inline:receiver:argumentNodes:",
  12857. category: 'optimizations',
  12858. fn: function (aSelector, receiver, aCollection) {
  12859. var self=this;
  12860. var inlined=nil;
  12861. (inlined=false);
  12862. ((($receiver = smalltalk.send(aSelector, "__eq", ["ifFalse:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%21%20%24receiver%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20nil%29")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%21%20%24receiver%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20nil%29")]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%21%20%24receiver%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20nil%29")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%21%20%24receiver%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20nil%29")]);return (inlined=true);})]));})]));
  12863. ((($receiver = smalltalk.send(aSelector, "__eq", ["ifTrue:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%24receiver%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20nil%29")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%24receiver%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20nil%29")]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%24receiver%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20nil%29")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%24receiver%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20nil%29")]);return (inlined=true);})]));})]));
  12864. ((($receiver = smalltalk.send(aSelector, "__eq", ["ifTrue:ifFalse:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%24receiver%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%24receiver%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29")]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%24receiver%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%24receiver%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29")]);return (inlined=true);})]));})]));
  12865. ((($receiver = smalltalk.send(aSelector, "__eq", ["ifFalse:ifTrue:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%21%20%24receiver%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%21%20%24receiver%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29")]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%21%20%24receiver%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%21%20%24receiver%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29")]);return (inlined=true);})]));})]));
  12866. ((($receiver = smalltalk.send(aSelector, "__eq", [unescape("%3C")])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%24receiver%20%3C")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%24receiver%20%3C")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  12867. ((($receiver = smalltalk.send(aSelector, "__eq", [unescape("%3C%3D")])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%24receiver%20%3C%3D")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%24receiver%20%3C%3D")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  12868. ((($receiver = smalltalk.send(aSelector, "__eq", [unescape("%3E")])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%24receiver%20%3E")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%24receiver%20%3E")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  12869. ((($receiver = smalltalk.send(aSelector, "__eq", [unescape("%3E%3D")])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%24receiver%20%3E%3D")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%24receiver%20%3E%3D")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  12870. ((($receiver = smalltalk.send(aSelector, "__eq", [unescape("+")])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%24receiver%20+")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%24receiver%20+")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  12871. ((($receiver = smalltalk.send(aSelector, "__eq", [unescape("-")])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%24receiver%20-")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%24receiver%20-")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  12872. ((($receiver = smalltalk.send(aSelector, "__eq", [unescape("*")])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%24receiver%20*")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%24receiver%20*")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  12873. ((($receiver = smalltalk.send(aSelector, "__eq", [unescape("/")])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%24receiver%20/")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%24receiver%20/")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  12874. return inlined;
  12875. return self;},
  12876. args: ["aSelector", "receiver", "aCollection"],
  12877. source: "inline: aSelector receiver: receiver argumentNodes: aCollection\x0a | inlined |\x0a inlined := false.\x0a\x0a\x09\x22-- Booleans --\x22\x0a\x0a\x09(aSelector = 'ifFalse:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [\x0a \x09self checkClass: 'Boolean' for: receiver.\x0a \x09stream nextPutAll: '(! $receiver ? '.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '() : nil)'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifTrue:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [\x0a \x09self checkClass: 'Boolean' for: receiver.\x0a \x09stream nextPutAll: '($receiver ? '.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '() : nil)'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifTrue:ifFalse:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [\x0a \x09self checkClass: 'Boolean' for: receiver.\x0a \x09stream nextPutAll: '($receiver ? '.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '() : '.\x0a \x09\x09self visit: aCollection second.\x0a \x09\x09stream nextPutAll: '())'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifFalse:ifTrue:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [\x0a \x09self checkClass: 'Boolean' for: receiver.\x0a \x09stream nextPutAll: '(! $receiver ? '.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '() : '.\x0a \x09\x09self visit: aCollection second.\x0a \x09\x09stream nextPutAll: '())'.\x0a \x09inlined := true]].\x0a\x0a\x09\x22-- Numbers --\x22\x0a\x0a\x09(aSelector = '<') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver <'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a\x09(aSelector = '<=') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver <='.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a\x09(aSelector = '>') ifTrue: [ \x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver >'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a\x09(aSelector = '>=') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver >='.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a (aSelector = '+') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver +'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a (aSelector = '-') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver -'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a (aSelector = '*') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver *'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a (aSelector = '/') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver /'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a ^inlined",
  12878. messageSends: ["ifTrue:", "=", "isBlockNode", "first", "checkClass:for:", "nextPutAll:", "visit:", "and:", "second"],
  12879. referencedClasses: []
  12880. }),
  12881. smalltalk.Compiler);
  12882. smalltalk.addMethod(
  12883. "_inlineLiteral_receiverNode_argumentNodes_",
  12884. smalltalk.method({
  12885. selector: "inlineLiteral:receiverNode:argumentNodes:",
  12886. category: 'optimizations',
  12887. fn: function (aSelector, anObject, aCollection) {
  12888. var self=this;
  12889. var inlined=nil;
  12890. (inlined=false);
  12891. ((($receiver = smalltalk.send(aSelector, "__eq", ["whileTrue:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(anObject, "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28function%28%29%7Bwhile%28")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29%20%7B")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%7D%7D%29%28%29")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28function%28%29%7Bwhile%28")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29%20%7B")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%7D%7D%29%28%29")]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(anObject, "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28function%28%29%7Bwhile%28")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29%20%7B")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%7D%7D%29%28%29")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28function%28%29%7Bwhile%28")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29%20%7B")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%7D%7D%29%28%29")]);return (inlined=true);})]));})]));
  12892. ((($receiver = smalltalk.send(aSelector, "__eq", ["whileFalse:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(anObject, "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28function%28%29%7Bwhile%28%21")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29%20%7B")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%7D%7D%29%28%29")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28function%28%29%7Bwhile%28%21")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29%20%7B")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%7D%7D%29%28%29")]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(anObject, "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28function%28%29%7Bwhile%28%21")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29%20%7B")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%7D%7D%29%28%29")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28function%28%29%7Bwhile%28%21")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29%20%7B")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%7D%7D%29%28%29")]);return (inlined=true);})]));})]));
  12893. ((($receiver = smalltalk.send(aSelector, "__eq", ["whileTrue"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28function%28%29%7Bwhile%28")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29%20%7B%7D%7D%29%28%29")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28function%28%29%7Bwhile%28")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29%20%7B%7D%7D%29%28%29")]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28function%28%29%7Bwhile%28")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29%20%7B%7D%7D%29%28%29")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28function%28%29%7Bwhile%28")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29%20%7B%7D%7D%29%28%29")]);return (inlined=true);})]));})]));
  12894. ((($receiver = smalltalk.send(aSelector, "__eq", ["whileFalse"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28function%28%29%7Bwhile%28%21")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29%20%7B%7D%7D%29%28%29")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28function%28%29%7Bwhile%28%21")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29%20%7B%7D%7D%29%28%29")]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28function%28%29%7Bwhile%28%21")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29%20%7B%7D%7D%29%28%29")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28function%28%29%7Bwhile%28%21")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%29%20%7B%7D%7D%29%28%29")]);return (inlined=true);})]));})]));
  12895. ((($receiver = smalltalk.send(aSelector, "__eq", [unescape("+")])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20+%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20+%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20+%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20+%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  12896. ((($receiver = smalltalk.send(aSelector, "__eq", [unescape("-")])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20-%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20-%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20-%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20-%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  12897. ((($receiver = smalltalk.send(aSelector, "__eq", [unescape("*")])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20*%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20*%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20*%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20*%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  12898. ((($receiver = smalltalk.send(aSelector, "__eq", [unescape("/")])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20/%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20/%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20/%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20/%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  12899. ((($receiver = smalltalk.send(aSelector, "__eq", [unescape("%3C")])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20%3C%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20%3C%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20%3C%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20%3C%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  12900. ((($receiver = smalltalk.send(aSelector, "__eq", [unescape("%3C%3D")])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20%3C%3D%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20%3C%3D%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20%3C%3D%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20%3C%3D%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  12901. ((($receiver = smalltalk.send(aSelector, "__eq", [unescape("%3E")])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20%3E%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20%3E%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20%3E%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20%3E%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  12902. ((($receiver = smalltalk.send(aSelector, "__eq", [unescape("%3E%3D")])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20%3E%3D%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20%3E%3D%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20%3E%3D%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%20%3E%3D%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  12903. ((($receiver = smalltalk.send(aSelector, "__eq", ["ifNil:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%28%24receiver%20%3D%20")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29%20%3D%3D%20nil%20%7C%7C%20%24receiver%20%3D%3D%20undefined%29%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20%24receiver")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%28%24receiver%20%3D%20")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29%20%3D%3D%20nil%20%7C%7C%20%24receiver%20%3D%3D%20undefined%29%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20%24receiver")]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%28%24receiver%20%3D%20")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29%20%3D%3D%20nil%20%7C%7C%20%24receiver%20%3D%3D%20undefined%29%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20%24receiver")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%28%24receiver%20%3D%20")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29%20%3D%3D%20nil%20%7C%7C%20%24receiver%20%3D%3D%20undefined%29%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20%24receiver")]);return (inlined=true);})]));})]));
  12904. ((($receiver = smalltalk.send(aSelector, "__eq", ["ifNotNil:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%28%24receiver%20%3D%20")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29%20%21%3D%20nil%20%26%26%20%24receiver%20%21%3D%20undefined%29%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20nil")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%28%24receiver%20%3D%20")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29%20%21%3D%20nil%20%26%26%20%24receiver%20%21%3D%20undefined%29%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20nil")]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%28%24receiver%20%3D%20")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29%20%21%3D%20nil%20%26%26%20%24receiver%20%21%3D%20undefined%29%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20nil")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%28%24receiver%20%3D%20")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29%20%21%3D%20nil%20%26%26%20%24receiver%20%21%3D%20undefined%29%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20nil")]);return (inlined=true);})]));})]));
  12905. ((($receiver = smalltalk.send(aSelector, "__eq", ["ifNil:ifNotNil:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%28%24receiver%20%3D%20")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29%20%3D%3D%20nil%20%7C%7C%20%24receiver%20%3D%3D%20undefined%29%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%28%24receiver%20%3D%20")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29%20%3D%3D%20nil%20%7C%7C%20%24receiver%20%3D%3D%20undefined%29%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29")]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%28%24receiver%20%3D%20")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29%20%3D%3D%20nil%20%7C%7C%20%24receiver%20%3D%3D%20undefined%29%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%28%24receiver%20%3D%20")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29%20%3D%3D%20nil%20%7C%7C%20%24receiver%20%3D%3D%20undefined%29%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29")]);return (inlined=true);})]));})]));
  12906. ((($receiver = smalltalk.send(aSelector, "__eq", ["ifNotNil:ifNil:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%28%24receiver%20%3D%20")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29%20%3D%3D%20nil%20%7C%7C%20%24receiver%20%3D%3D%20undefined%29%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%28%24receiver%20%3D%20")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29%20%3D%3D%20nil%20%7C%7C%20%24receiver%20%3D%3D%20undefined%29%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29")]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%28%24receiver%20%3D%20")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29%20%3D%3D%20nil%20%7C%7C%20%24receiver%20%3D%3D%20undefined%29%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29")]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%28%24receiver%20%3D%20")]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29%20%3D%3D%20nil%20%7C%7C%20%24receiver%20%3D%3D%20undefined%29%20%3F%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29%20%3A%20")]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28%29")]);return (inlined=true);})]));})]));
  12907. return inlined;
  12908. return self;},
  12909. args: ["aSelector", "anObject", "aCollection"],
  12910. source: "inlineLiteral: aSelector receiverNode: anObject argumentNodes: aCollection\x0a | inlined |\x0a inlined := false.\x0a \x0a\x09\x22-- BlockClosures --\x22\x0a\x0a\x09(aSelector = 'whileTrue:') ifTrue: [\x0a \x09(anObject isBlockNode and: [aCollection first isBlockNode]) ifTrue: [\x0a \x09stream nextPutAll: '(function(){while('.\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: '()) {'.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '()}})()'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'whileFalse:') ifTrue: [\x0a \x09(anObject isBlockNode and: [aCollection first isBlockNode]) ifTrue: [\x0a \x09stream nextPutAll: '(function(){while(!'.\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: '()) {'.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '()}})()'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'whileTrue') ifTrue: [\x0a \x09anObject isBlockNode ifTrue: [\x0a \x09stream nextPutAll: '(function(){while('.\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: '()) {}})()'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'whileFalse') ifTrue: [\x0a \x09anObject isBlockNode ifTrue: [\x0a \x09stream nextPutAll: '(function(){while(!'.\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: '()) {}})()'.\x0a \x09inlined := true]].\x0a\x0a\x09\x22-- Numbers --\x22\x0a\x0a\x09(aSelector = '+') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' + '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '-') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' - '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '*') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' * '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '/') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' / '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '<') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' < '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '<=') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' <= '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '>') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' > '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '>=') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' >= '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a \x09 \x0a\x09\x22-- UndefinedObject --\x22\x0a\x0a\x09(aSelector = 'ifNil:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [\x0a \x09\x09stream nextPutAll: '(($receiver = '.\x0a \x09\x09self visit: anObject.\x0a \x09\x09stream nextPutAll: ') == nil || $receiver == undefined) ? '.\x0a \x09self visit: aCollection first.\x0a \x09stream nextPutAll: '() : $receiver'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifNotNil:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [\x0a \x09\x09stream nextPutAll: '(($receiver = '.\x0a \x09\x09self visit: anObject.\x0a \x09\x09stream nextPutAll: ') != nil && $receiver != undefined) ? '.\x0a \x09self visit: aCollection first.\x0a \x09stream nextPutAll: '() : nil'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifNil:ifNotNil:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [\x0a \x09\x09stream nextPutAll: '(($receiver = '.\x0a \x09\x09self visit: anObject.\x0a \x09\x09stream nextPutAll: ') == nil || $receiver == undefined) ? '.\x0a \x09self visit: aCollection first.\x0a \x09stream nextPutAll: '() : '.\x0a \x09self visit: aCollection second.\x0a \x09stream nextPutAll: '()'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifNotNil:ifNil:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [\x0a \x09\x09stream nextPutAll: '(($receiver = '.\x0a \x09\x09self visit: anObject.\x0a \x09\x09stream nextPutAll: ') == nil || $receiver == undefined) ? '.\x0a \x09self visit: aCollection second.\x0a \x09stream nextPutAll: '() : '.\x0a \x09self visit: aCollection first.\x0a \x09stream nextPutAll: '()'.\x0a \x09inlined := true]].\x0a \x0a ^inlined",
  12911. messageSends: ["ifTrue:", "=", "and:", "isBlockNode", "first", "nextPutAll:", "visit:", "isNode:ofClass:", "second"],
  12912. referencedClasses: ["Number"]
  12913. }),
  12914. smalltalk.Compiler);
  12915. smalltalk.addMethod(
  12916. "_isNode_ofClass_",
  12917. smalltalk.method({
  12918. selector: "isNode:ofClass:",
  12919. category: 'optimizations',
  12920. fn: function (aNode, aClass) {
  12921. var self=this;
  12922. return smalltalk.send(smalltalk.send(aNode, "_isValueNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_value", []), "_class", []), "__eq", [aClass]), "_or_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["self"]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_currentClass", []), "__eq", [aClass]);})]);})]);})]);
  12923. return self;},
  12924. args: ["aNode", "aClass"],
  12925. source: "isNode: aNode ofClass: aClass\x0a\x09^aNode isValueNode and: [\x0a \x09aNode value class = aClass or: [\x0a \x09\x09aNode value = 'self' and: [self currentClass = aClass]]]",
  12926. messageSends: ["and:", "isValueNode", "or:", "=", "class", "value", "currentClass"],
  12927. referencedClasses: []
  12928. }),
  12929. smalltalk.Compiler);
  12930. smalltalk.addMethod(
  12931. "_knownVariables",
  12932. smalltalk.method({
  12933. selector: "knownVariables",
  12934. category: 'accessing',
  12935. fn: function () {
  12936. var self=this;
  12937. return (function($rec){smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_tempVariables", [])]);smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_argVariables", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_pseudoVariables", []));
  12938. return self;},
  12939. args: [],
  12940. source: "knownVariables\x0a\x09^self pseudoVariables \x0a\x09\x09addAll: self tempVariables;\x0a\x09\x09addAll: self argVariables;\x0a\x09\x09yourself",
  12941. messageSends: ["addAll:", "tempVariables", "argVariables", "yourself", "pseudoVariables"],
  12942. referencedClasses: []
  12943. }),
  12944. smalltalk.Compiler);
  12945. smalltalk.addMethod(
  12946. "_performOptimizations",
  12947. smalltalk.method({
  12948. selector: "performOptimizations",
  12949. category: 'testing',
  12950. fn: function () {
  12951. var self=this;
  12952. return smalltalk.send(smalltalk.send(self, "_class", []), "_performOptimizations", []);
  12953. return self;},
  12954. args: [],
  12955. source: "performOptimizations\x0a\x09^self class performOptimizations",
  12956. messageSends: ["performOptimizations", "class"],
  12957. referencedClasses: []
  12958. }),
  12959. smalltalk.Compiler);
  12960. smalltalk.addMethod(
  12961. "_send_to_arguments_superSend_",
  12962. smalltalk.method({
  12963. selector: "send:to:arguments:superSend:",
  12964. category: 'visiting',
  12965. fn: function (aSelector, aReceiver, aCollection, aBoolean) {
  12966. var self=this;
  12967. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(str){var tmp=nil;
  12968. (tmp=self['@stream']);smalltalk.send(str, "_nextPutAll_", [unescape("smalltalk.send%28")]);smalltalk.send(str, "_nextPutAll_", [aReceiver]);smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%2C%20%22"), "__comma", [smalltalk.send(aSelector, "_asSelector", [])]), "__comma", [unescape("%22%2C%20%5B")])]);(self['@stream']=str);smalltalk.send(aCollection, "_do_separatedBy_", [(function(each){return smalltalk.send(self, "_visit_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%2C%20")]);})]);(self['@stream']=tmp);smalltalk.send(str, "_nextPutAll_", [unescape("%5D")]);((($receiver = aBoolean).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(unescape("%2C%20smalltalk."), "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(smalltalk.send(self, "_currentClass", []), "_superclass", [])])])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(unescape("%2C%20smalltalk."), "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(smalltalk.send(self, "_currentClass", []), "_superclass", [])])])]);})]));return smalltalk.send(str, "_nextPutAll_", [unescape("%29")]);})]);
  12969. return self;},
  12970. args: ["aSelector", "aReceiver", "aCollection", "aBoolean"],
  12971. source: "send: aSelector to: aReceiver arguments: aCollection superSend: aBoolean\x0a\x09^String streamContents: [:str || tmp |\x0a \x09tmp := stream.\x0a\x09\x09str nextPutAll: 'smalltalk.send('.\x0a\x09\x09str nextPutAll: aReceiver.\x0a\x09\x09str nextPutAll: ', \x22', aSelector asSelector, '\x22, ['.\x0a stream := str.\x0a\x09\x09aCollection\x0a\x09 \x09\x09do: [:each | self visit: each]\x0a\x09 \x09\x09separatedBy: [stream nextPutAll: ', '].\x0a stream := tmp.\x0a str nextPutAll: ']'.\x0a\x09\x09aBoolean ifTrue: [\x0a\x09\x09\x09str nextPutAll: ', smalltalk.', (self classNameFor: self currentClass superclass)].\x0a\x09\x09str nextPutAll: ')']",
  12972. messageSends: ["streamContents:", "nextPutAll:", ",", "asSelector", "do:separatedBy:", "visit:", "ifTrue:", "classNameFor:", "superclass", "currentClass"],
  12973. referencedClasses: ["String"]
  12974. }),
  12975. smalltalk.Compiler);
  12976. smalltalk.addMethod(
  12977. "_tempVariables",
  12978. smalltalk.method({
  12979. selector: "tempVariables",
  12980. category: 'accessing',
  12981. fn: function () {
  12982. var self=this;
  12983. return smalltalk.send(self['@tempVariables'], "_copy", []);
  12984. return self;},
  12985. args: [],
  12986. source: "tempVariables\x0a\x09^tempVariables copy",
  12987. messageSends: ["copy"],
  12988. referencedClasses: []
  12989. }),
  12990. smalltalk.Compiler);
  12991. smalltalk.addMethod(
  12992. "_unknownVariables",
  12993. smalltalk.method({
  12994. selector: "unknownVariables",
  12995. category: 'accessing',
  12996. fn: function () {
  12997. var self=this;
  12998. return smalltalk.send(self['@unknownVariables'], "_copy", []);
  12999. return self;},
  13000. args: [],
  13001. source: "unknownVariables\x0a\x09^unknownVariables copy",
  13002. messageSends: ["copy"],
  13003. referencedClasses: []
  13004. }),
  13005. smalltalk.Compiler);
  13006. smalltalk.addMethod(
  13007. "_visit_",
  13008. smalltalk.method({
  13009. selector: "visit:",
  13010. category: 'visiting',
  13011. fn: function (aNode) {
  13012. var self=this;
  13013. smalltalk.send(aNode, "_accept_", [self]);
  13014. return self;},
  13015. args: ["aNode"],
  13016. source: "visit: aNode\x0a\x09aNode accept: self",
  13017. messageSends: ["accept:"],
  13018. referencedClasses: []
  13019. }),
  13020. smalltalk.Compiler);
  13021. smalltalk.addMethod(
  13022. "_visitAssignmentNode_",
  13023. smalltalk.method({
  13024. selector: "visitAssignmentNode:",
  13025. category: 'visiting',
  13026. fn: function (aNode) {
  13027. var self=this;
  13028. smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28")]);
  13029. smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_left", [])]);
  13030. smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%3D")]);
  13031. smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_right", [])]);
  13032. smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29")]);
  13033. return self;},
  13034. args: ["aNode"],
  13035. source: "visitAssignmentNode: aNode\x0a\x09stream nextPutAll: '('.\x0a\x09self visit: aNode left.\x0a\x09stream nextPutAll: '='.\x0a\x09self visit: aNode right.\x0a\x09stream nextPutAll: ')'",
  13036. messageSends: ["nextPutAll:", "visit:", "left", "right"],
  13037. referencedClasses: []
  13038. }),
  13039. smalltalk.Compiler);
  13040. smalltalk.addMethod(
  13041. "_visitBlockNode_",
  13042. smalltalk.method({
  13043. selector: "visitBlockNode:",
  13044. category: 'visiting',
  13045. fn: function (aNode) {
  13046. var self=this;
  13047. smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28function%28")]);
  13048. smalltalk.send(smalltalk.send(aNode, "_parameters", []), "_do_separatedBy_", [(function(each){smalltalk.send(self['@tempVariables'], "_add_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%2C%20")]);})]);
  13049. smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29%7B")]);
  13050. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
  13051. smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%7D%29")]);
  13052. return self;},
  13053. args: ["aNode"],
  13054. source: "visitBlockNode: aNode\x0a\x09stream nextPutAll: '(function('.\x0a\x09aNode parameters \x0a\x09 do: [:each |\x0a\x09\x09tempVariables add: each.\x0a\x09\x09stream nextPutAll: each]\x0a\x09 separatedBy: [stream nextPutAll: ', '].\x0a\x09stream nextPutAll: '){'.\x0a\x09aNode nodes do: [:each | self visit: each].\x0a\x09stream nextPutAll: '})'",
  13055. messageSends: ["nextPutAll:", "do:separatedBy:", "parameters", "add:", "do:", "nodes", "visit:"],
  13056. referencedClasses: []
  13057. }),
  13058. smalltalk.Compiler);
  13059. smalltalk.addMethod(
  13060. "_visitBlockSequenceNode_",
  13061. smalltalk.method({
  13062. selector: "visitBlockSequenceNode:",
  13063. category: 'visiting',
  13064. fn: function (aNode) {
  13065. var self=this;
  13066. var index=nil;
  13067. (self['@nestedBlocks']=((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));
  13068. ((($receiver = smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("return%20nil%3B")]);})() : (function(){smalltalk.send(smalltalk.send(aNode, "_temps", []), "_do_", [(function(each){var temp=nil;
  13069. (temp=smalltalk.send(self, "_safeVariableNameFor_", [each]));smalltalk.send(self['@tempVariables'], "_add_", [temp]);return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("var ", "__comma", [temp]), "__comma", [unescape("%3Dnil%3B")])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);})]);(index=(0));return smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){(index=((($receiver = index).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));((($receiver = smalltalk.send(index, "__eq", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_size", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})]));smalltalk.send(self, "_visit_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%3B")]);})]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("return%20nil%3B")]);}), (function(){smalltalk.send(smalltalk.send(aNode, "_temps", []), "_do_", [(function(each){var temp=nil;
  13070. (temp=smalltalk.send(self, "_safeVariableNameFor_", [each]));smalltalk.send(self['@tempVariables'], "_add_", [temp]);return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("var ", "__comma", [temp]), "__comma", [unescape("%3Dnil%3B")])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);})]);(index=(0));return smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){(index=((($receiver = index).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));((($receiver = smalltalk.send(index, "__eq", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_size", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})]));smalltalk.send(self, "_visit_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%3B")]);})]);})]));
  13071. (self['@nestedBlocks']=((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])));
  13072. return self;},
  13073. args: ["aNode"],
  13074. source: "visitBlockSequenceNode: aNode\x0a\x09| index |\x0a\x09nestedBlocks := nestedBlocks + 1.\x0a\x09aNode nodes isEmpty\x0a\x09 ifTrue: [\x0a\x09\x09stream nextPutAll: 'return nil;']\x0a\x09 ifFalse: [\x0a\x09\x09aNode temps do: [:each | | temp |\x0a temp := self safeVariableNameFor: each.\x0a\x09\x09 tempVariables add: temp.\x0a\x09\x09 stream nextPutAll: 'var ', temp, '=nil;'; lf].\x0a\x09\x09index := 0.\x0a\x09\x09aNode nodes do: [:each |\x0a\x09\x09 index := index + 1.\x0a\x09\x09 index = aNode nodes size ifTrue: [\x0a\x09\x09\x09stream nextPutAll: 'return '].\x0a\x09\x09 self visit: each.\x0a\x09\x09 stream nextPutAll: ';']].\x0a\x09nestedBlocks := nestedBlocks - 1",
  13075. messageSends: ["+", "ifTrue:ifFalse:", "isEmpty", "nodes", "nextPutAll:", "do:", "temps", "safeVariableNameFor:", "add:", ",", "lf", "ifTrue:", "=", "size", "visit:", "-"],
  13076. referencedClasses: []
  13077. }),
  13078. smalltalk.Compiler);
  13079. smalltalk.addMethod(
  13080. "_visitCascadeNode_",
  13081. smalltalk.method({
  13082. selector: "visitCascadeNode:",
  13083. category: 'visiting',
  13084. fn: function (aNode) {
  13085. var self=this;
  13086. var index=nil;
  13087. (index=(0));
  13088. ((($receiver = smalltalk.send(self['@tempVariables'], "_includes_", ["$rec"])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self['@tempVariables'], "_add_", ["$rec"]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self['@tempVariables'], "_add_", ["$rec"]);})]));
  13089. smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28function%28%24rec%29%7B")]);
  13090. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){(index=((($receiver = index).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));((($receiver = smalltalk.send(index, "__eq", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_size", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})]));smalltalk.send(each, "_receiver_", [smalltalk.send(smalltalk.send((smalltalk.VariableNode || VariableNode), "_new", []), "_value_", ["$rec"])]);smalltalk.send(self, "_visit_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%3B")]);})]);
  13091. smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%7D%29%28")]);
  13092. smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_receiver", [])]);
  13093. smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29")]);
  13094. return self;},
  13095. args: ["aNode"],
  13096. source: "visitCascadeNode: aNode\x0a\x09| index |\x0a\x09index := 0.\x0a\x09(tempVariables includes: '$rec') ifFalse: [\x0a\x09\x09tempVariables add: '$rec'].\x0a\x09stream nextPutAll: '(function($rec){'.\x0a\x09aNode nodes do: [:each |\x0a\x09 index := index + 1.\x0a\x09 index = aNode nodes size ifTrue: [\x0a\x09\x09stream nextPutAll: 'return '].\x0a\x09 each receiver: (VariableNode new value: '$rec').\x0a\x09 self visit: each.\x0a\x09 stream nextPutAll: ';'].\x0a\x09stream nextPutAll: '})('.\x0a\x09self visit: aNode receiver.\x0a\x09stream nextPutAll: ')'",
  13097. messageSends: ["ifFalse:", "includes:", "add:", "nextPutAll:", "do:", "nodes", "+", "ifTrue:", "=", "size", "receiver:", "value:", "new", "visit:", "receiver"],
  13098. referencedClasses: ["VariableNode"]
  13099. }),
  13100. smalltalk.Compiler);
  13101. smalltalk.addMethod(
  13102. "_visitClassReferenceNode_",
  13103. smalltalk.method({
  13104. selector: "visitClassReferenceNode:",
  13105. category: 'visiting',
  13106. fn: function (aNode) {
  13107. var self=this;
  13108. ((($receiver = smalltalk.send(self['@referencedClasses'], "_includes_", [smalltalk.send(aNode, "_value", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self['@referencedClasses'], "_add_", [smalltalk.send(aNode, "_value", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self['@referencedClasses'], "_add_", [smalltalk.send(aNode, "_value", [])]);})]));
  13109. smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%28smalltalk."), "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", [unescape("%20%7C%7C%20")]), "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", [unescape("%29")])]);
  13110. return self;},
  13111. args: ["aNode"],
  13112. source: "visitClassReferenceNode: aNode\x0a\x09(referencedClasses includes: aNode value) ifFalse: [\x0a\x09\x09referencedClasses add: aNode value].\x0a\x09stream nextPutAll: '(smalltalk.', aNode value, ' || ', aNode value, ')'",
  13113. messageSends: ["ifFalse:", "includes:", "value", "add:", "nextPutAll:", ","],
  13114. referencedClasses: []
  13115. }),
  13116. smalltalk.Compiler);
  13117. smalltalk.addMethod(
  13118. "_visitDynamicArrayNode_",
  13119. smalltalk.method({
  13120. selector: "visitDynamicArrayNode:",
  13121. category: 'visiting',
  13122. fn: function (aNode) {
  13123. var self=this;
  13124. smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%5B")]);
  13125. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_separatedBy_", [(function(each){return smalltalk.send(self, "_visit_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%2C")]);})]);
  13126. smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%5D")]);
  13127. return self;},
  13128. args: ["aNode"],
  13129. source: "visitDynamicArrayNode: aNode\x0a\x09stream nextPutAll: '['.\x0a\x09aNode nodes \x0a\x09\x09do: [:each | self visit: each]\x0a\x09\x09separatedBy: [stream nextPutAll: ','].\x0a\x09stream nextPutAll: ']'",
  13130. messageSends: ["nextPutAll:", "do:separatedBy:", "nodes", "visit:"],
  13131. referencedClasses: []
  13132. }),
  13133. smalltalk.Compiler);
  13134. smalltalk.addMethod(
  13135. "_visitDynamicDictionaryNode_",
  13136. smalltalk.method({
  13137. selector: "visitDynamicDictionaryNode:",
  13138. category: 'visiting',
  13139. fn: function (aNode) {
  13140. var self=this;
  13141. smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("smalltalk.HashedCollection._fromPairs_%28%5B")]);
  13142. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_separatedBy_", [(function(each){return smalltalk.send(self, "_visit_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%2C")]);})]);
  13143. smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%5D%29")]);
  13144. return self;},
  13145. args: ["aNode"],
  13146. source: "visitDynamicDictionaryNode: aNode\x0a\x09stream nextPutAll: 'smalltalk.HashedCollection._fromPairs_(['.\x0a\x09\x09aNode nodes \x0a\x09\x09\x09do: [:each | self visit: each]\x0a\x09\x09\x09separatedBy: [stream nextPutAll: ','].\x0a\x09\x09stream nextPutAll: '])'",
  13147. messageSends: ["nextPutAll:", "do:separatedBy:", "nodes", "visit:"],
  13148. referencedClasses: []
  13149. }),
  13150. smalltalk.Compiler);
  13151. smalltalk.addMethod(
  13152. "_visitFailure_",
  13153. smalltalk.method({
  13154. selector: "visitFailure:",
  13155. category: 'visiting',
  13156. fn: function (aFailure) {
  13157. var self=this;
  13158. smalltalk.send(self, "_error_", [smalltalk.send(aFailure, "_asString", [])]);
  13159. return self;},
  13160. args: ["aFailure"],
  13161. source: "visitFailure: aFailure\x0a\x09self error: aFailure asString",
  13162. messageSends: ["error:", "asString"],
  13163. referencedClasses: []
  13164. }),
  13165. smalltalk.Compiler);
  13166. smalltalk.addMethod(
  13167. "_visitJSStatementNode_",
  13168. smalltalk.method({
  13169. selector: "visitJSStatementNode:",
  13170. category: 'visiting',
  13171. fn: function (aNode) {
  13172. var self=this;
  13173. smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(aNode, "_source", []), "_replace_with_", [unescape("%3E%3E"), unescape("%3E")])]);
  13174. return self;},
  13175. args: ["aNode"],
  13176. source: "visitJSStatementNode: aNode\x0a\x09stream nextPutAll: (aNode source replace: '>>' with: '>')",
  13177. messageSends: ["nextPutAll:", "replace:with:", "source"],
  13178. referencedClasses: []
  13179. }),
  13180. smalltalk.Compiler);
  13181. smalltalk.addMethod(
  13182. "_visitMethodNode_",
  13183. smalltalk.method({
  13184. selector: "visitMethodNode:",
  13185. category: 'visiting',
  13186. fn: function (aNode) {
  13187. var self=this;
  13188. var str=nil;
  13189. var currentSelector=nil;
  13190. (self['@currentSelector']=smalltalk.send(smalltalk.send(aNode, "_selector", []), "_asSelector", []));
  13191. (self['@nestedBlocks']=(0));
  13192. (self['@earlyReturn']=false);
  13193. (self['@messageSends']=[]);
  13194. (self['@referencedClasses']=[]);
  13195. (self['@unknownVariables']=[]);
  13196. (self['@tempVariables']=[]);
  13197. (self['@argVariables']=[]);
  13198. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["smalltalk.method({"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("selector: \x22", "__comma", [smalltalk.send(aNode, "_selector", [])]), "__comma", ["\x22,"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  13199. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("source: ", "__comma", [smalltalk.send(smalltalk.send(self, "_source", []), "_asJavascript", [])]), "__comma", [","])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  13200. smalltalk.send(self['@stream'], "_nextPutAll_", ["fn: function("]);
  13201. smalltalk.send(smalltalk.send(aNode, "_arguments", []), "_do_separatedBy_", [(function(each){smalltalk.send(self['@argVariables'], "_add_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [", "]);})]);
  13202. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["){"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["var self=this;"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  13203. (str=self['@stream']);
  13204. (self['@stream']=smalltalk.send("", "_writeStream", []));
  13205. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
  13206. ((($receiver = self['@earlyReturn']).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["var $early={};"]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["try{"]);})(str);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["var $early={};"]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["try{"]);})(str);})]));
  13207. smalltalk.send(str, "_nextPutAll_", [smalltalk.send(self['@stream'], "_contents", [])]);
  13208. (self['@stream']=str);
  13209. (function($rec){smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["return self;"]);})(self['@stream']);
  13210. ((($receiver = self['@earlyReturn']).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function($rec){smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["} catch(e) {if(e===$early)return e[0]; throw e}"]);})(self['@stream']);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function($rec){smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["} catch(e) {if(e===$early)return e[0]; throw e}"]);})(self['@stream']);})]));
  13211. smalltalk.send(self['@stream'], "_nextPutAll_", ["}"]);
  13212. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(",", "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])]), "__comma", ["messageSends: "])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(self['@messageSends'], "_asJavascript", []), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("args: ", "__comma", [smalltalk.send(self['@argVariables'], "_asJavascript", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["referencedClasses: ["]);})(self['@stream']);
  13213. smalltalk.send(self['@referencedClasses'], "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(each, "_printString", [])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
  13214. smalltalk.send(self['@stream'], "_nextPutAll_", ["]"]);
  13215. smalltalk.send(self['@stream'], "_nextPutAll_", ["})"]);
  13216. return self;},
  13217. args: ["aNode"],
  13218. source: "visitMethodNode: aNode\x0a\x09| str currentSelector | \x0a\x09currentSelector := aNode selector asSelector.\x0a\x09nestedBlocks := 0.\x0a\x09earlyReturn := false.\x0a\x09messageSends := #().\x0a\x09referencedClasses := #().\x0a\x09unknownVariables := #().\x0a\x09tempVariables := #().\x0a\x09argVariables := #().\x0a\x09stream \x0a\x09 nextPutAll: 'smalltalk.method({'; lf;\x0a\x09 nextPutAll: 'selector: \x22', aNode selector, '\x22,'; lf.\x0a\x09stream nextPutAll: 'source: ', self source asJavascript, ',';lf.\x0a\x09stream nextPutAll: 'fn: function('.\x0a\x09aNode arguments \x0a\x09 do: [:each | \x0a\x09\x09argVariables add: each.\x0a\x09\x09stream nextPutAll: each]\x0a\x09 separatedBy: [stream nextPutAll: ', '].\x0a\x09stream \x0a\x09 nextPutAll: '){'; lf;\x0a\x09 nextPutAll: 'var self=this;'; lf.\x0a\x09str := stream.\x0a\x09stream := '' writeStream.\x0a\x09aNode nodes do: [:each |\x0a\x09 self visit: each].\x0a\x09earlyReturn ifTrue: [\x0a\x09 str nextPutAll: 'var $early={};'; lf; nextPutAll: 'try{'].\x0a\x09str nextPutAll: stream contents.\x0a\x09stream := str.\x0a\x09stream \x0a\x09 lf; \x0a\x09 nextPutAll: 'return self;'.\x0a\x09earlyReturn ifTrue: [\x0a\x09 stream lf; nextPutAll: '} catch(e) {if(e===$early)return e[0]; throw e}'].\x0a\x09stream nextPutAll: '}'.\x0a\x09stream \x0a\x09\x09nextPutAll: ',', String lf, 'messageSends: ';\x0a\x09\x09nextPutAll: messageSends asJavascript, ','; lf;\x0a \x09nextPutAll: 'args: ', argVariables asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ['.\x0a\x09referencedClasses \x0a\x09\x09do: [:each | stream nextPutAll: each printString]\x0a\x09\x09separatedBy: [stream nextPutAll: ','].\x0a\x09stream nextPutAll: ']'.\x0a\x09stream nextPutAll: '})'",
  13219. messageSends: ["asSelector", "selector", "nextPutAll:", "lf", ",", "asJavascript", "source", "do:separatedBy:", "arguments", "add:", "writeStream", "do:", "nodes", "visit:", "ifTrue:", "contents", "printString"],
  13220. referencedClasses: ["String"]
  13221. }),
  13222. smalltalk.Compiler);
  13223. smalltalk.addMethod(
  13224. "_visitReturnNode_",
  13225. smalltalk.method({
  13226. selector: "visitReturnNode:",
  13227. category: 'visiting',
  13228. fn: function (aNode) {
  13229. var self=this;
  13230. ((($receiver = ((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver >(0) : smalltalk.send($receiver, "__gt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (self['@earlyReturn']=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (self['@earlyReturn']=true);})]));
  13231. ((($receiver = ((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver >(0) : smalltalk.send($receiver, "__gt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){throw $early=["]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){throw $early=["]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})]));
  13232. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
  13233. ((($receiver = ((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver >(0) : smalltalk.send($receiver, "__gt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["]})()"]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["]})()"]);})]));
  13234. return self;},
  13235. args: ["aNode"],
  13236. source: "visitReturnNode: aNode\x0a\x09nestedBlocks > 0 ifTrue: [\x0a\x09 earlyReturn := true].\x0a\x09nestedBlocks > 0\x0a\x09 ifTrue: [\x0a\x09\x09stream\x0a\x09\x09 nextPutAll: '(function(){throw $early=[']\x0a\x09 ifFalse: [stream nextPutAll: 'return '].\x0a\x09aNode nodes do: [:each |\x0a\x09 self visit: each].\x0a\x09nestedBlocks > 0 ifTrue: [\x0a\x09 stream nextPutAll: ']})()']",
  13237. messageSends: ["ifTrue:", ">", "ifTrue:ifFalse:", "nextPutAll:", "do:", "nodes", "visit:"],
  13238. referencedClasses: []
  13239. }),
  13240. smalltalk.Compiler);
  13241. smalltalk.addMethod(
  13242. "_visitSendNode_",
  13243. smalltalk.method({
  13244. selector: "visitSendNode:",
  13245. category: 'visiting',
  13246. fn: function (aNode) {
  13247. var self=this;
  13248. var str=nil;
  13249. var receiver=nil;
  13250. var superSend=nil;
  13251. var inlined=nil;
  13252. (str=self['@stream']);
  13253. ((($receiver = smalltalk.send(self['@messageSends'], "_includes_", [smalltalk.send(aNode, "_selector", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self['@messageSends'], "_add_", [smalltalk.send(aNode, "_selector", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self['@messageSends'], "_add_", [smalltalk.send(aNode, "_selector", [])]);})]));
  13254. (self['@stream']=smalltalk.send("", "_writeStream", []));
  13255. smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_receiver", [])]);
  13256. (superSend=smalltalk.send(smalltalk.send(self['@stream'], "_contents", []), "__eq", ["super"]));
  13257. (receiver=((($receiver = superSend).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "self";})() : (function(){return smalltalk.send(self['@stream'], "_contents", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "self";}), (function(){return smalltalk.send(self['@stream'], "_contents", []);})])));
  13258. (self['@stream']=str);
  13259. ((($receiver = smalltalk.send(self, "_performOptimizations", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_inlineLiteral_receiverNode_argumentNodes_", [smalltalk.send(aNode, "_selector", []), smalltalk.send(aNode, "_receiver", []), smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return ((($receiver = smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [unescape("%29")])]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [unescape("%29")])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return ((($receiver = smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [unescape("%29")])]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [unescape("%29")])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));})]));})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return ((($receiver = smalltalk.send(self, "_inlineLiteral_receiverNode_argumentNodes_", [smalltalk.send(aNode, "_selector", []), smalltalk.send(aNode, "_receiver", []), smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return ((($receiver = smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [unescape("%29")])]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [unescape("%29")])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return ((($receiver = smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [unescape("%29")])]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [unescape("%29")])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));})]));}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));
  13260. return self;},
  13261. args: ["aNode"],
  13262. source: "visitSendNode: aNode\x0a | str receiver superSend inlined |\x0a str := stream.\x0a (messageSends includes: aNode selector) ifFalse: [\x0a messageSends add: aNode selector].\x0a stream := '' writeStream.\x0a self visit: aNode receiver.\x0a superSend := stream contents = 'super'.\x0a receiver := superSend ifTrue: ['self'] ifFalse: [stream contents].\x0a stream := str.\x0a\x09\x0a\x09self performOptimizations \x0a\x09\x09ifTrue: [\x0a\x09\x09\x09(self inlineLiteral: aNode selector receiverNode: aNode receiver argumentNodes: aNode arguments) ifFalse: [\x0a\x09\x09\x09\x09(self inline: aNode selector receiver: receiver argumentNodes: aNode arguments)\x0a \x09\x09\x09ifTrue: [stream nextPutAll: ' : ', (self send: aNode selector to: '$receiver' arguments: aNode arguments superSend: superSend), ')']\x0a \x09\x09\x09ifFalse: [stream nextPutAll: (self send: aNode selector to: receiver arguments: aNode arguments superSend: superSend)]]]\x0a\x09\x09ifFalse: [stream nextPutAll: (self send: aNode selector to: receiver arguments: aNode arguments superSend: superSend)]",
  13263. messageSends: ["ifFalse:", "includes:", "selector", "add:", "writeStream", "visit:", "receiver", "=", "contents", "ifTrue:ifFalse:", "performOptimizations", "inlineLiteral:receiverNode:argumentNodes:", "arguments", "inline:receiver:argumentNodes:", "nextPutAll:", ",", "send:to:arguments:superSend:"],
  13264. referencedClasses: []
  13265. }),
  13266. smalltalk.Compiler);
  13267. smalltalk.addMethod(
  13268. "_visitSequenceNode_",
  13269. smalltalk.method({
  13270. selector: "visitSequenceNode:",
  13271. category: 'visiting',
  13272. fn: function (aNode) {
  13273. var self=this;
  13274. smalltalk.send(smalltalk.send(aNode, "_temps", []), "_do_", [(function(each){var temp=nil;
  13275. (temp=smalltalk.send(self, "_safeVariableNameFor_", [each]));smalltalk.send(self['@tempVariables'], "_add_", [temp]);return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("var ", "__comma", [temp]), "__comma", [unescape("%3Dnil%3B")])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);})]);
  13276. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_separatedBy_", [(function(each){smalltalk.send(self, "_visit_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%3B")]);}), (function(){return smalltalk.send(self['@stream'], "_lf", []);})]);
  13277. return self;},
  13278. args: ["aNode"],
  13279. source: "visitSequenceNode: aNode\x0a\x09aNode temps do: [:each || temp |\x0a temp := self safeVariableNameFor: each.\x0a\x09 tempVariables add: temp.\x0a\x09 stream nextPutAll: 'var ', temp, '=nil;'; lf].\x0a\x09aNode nodes do: [:each |\x0a\x09 self visit: each.\x0a\x09 stream nextPutAll: ';']\x0a\x09 separatedBy: [stream lf]",
  13280. messageSends: ["do:", "temps", "safeVariableNameFor:", "add:", "nextPutAll:", ",", "lf", "do:separatedBy:", "nodes", "visit:"],
  13281. referencedClasses: []
  13282. }),
  13283. smalltalk.Compiler);
  13284. smalltalk.addMethod(
  13285. "_visitValueNode_",
  13286. smalltalk.method({
  13287. selector: "visitValueNode:",
  13288. category: 'visiting',
  13289. fn: function (aNode) {
  13290. var self=this;
  13291. smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(aNode, "_value", []), "_asJavascript", [])]);
  13292. return self;},
  13293. args: ["aNode"],
  13294. source: "visitValueNode: aNode\x0a\x09stream nextPutAll: aNode value asJavascript",
  13295. messageSends: ["nextPutAll:", "asJavascript", "value"],
  13296. referencedClasses: []
  13297. }),
  13298. smalltalk.Compiler);
  13299. smalltalk.addMethod(
  13300. "_visitVariableNode_",
  13301. smalltalk.method({
  13302. selector: "visitVariableNode:",
  13303. category: 'visiting',
  13304. fn: function (aNode) {
  13305. var self=this;
  13306. var varName=nil;
  13307. ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(self, "_currentClass", []), "_allInstanceVariableNames", []), "_includes_", [smalltalk.send(aNode, "_value", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("self%5B%27@"), "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", [unescape("%27%5D")])]);})() : (function(){(varName=smalltalk.send(self, "_safeVariableNameFor_", [smalltalk.send(aNode, "_value", [])]));return ((($receiver = smalltalk.send(smalltalk.send(self, "_knownVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);return ((($receiver = smalltalk.send(aNode, "_assigned", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%28typeof%20"), "__comma", [varName]), "__comma", [unescape("%20%3D%3D%20%27undefined%27%20%3F%20nil%20%3A%20")]), "__comma", [varName]), "__comma", [unescape("%29")])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%28typeof%20"), "__comma", [varName]), "__comma", [unescape("%20%3D%3D%20%27undefined%27%20%3F%20nil%20%3A%20")]), "__comma", [varName]), "__comma", [unescape("%29")])]);})]));})() : (function(){return ((($receiver = smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["thisContext"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28smalltalk.getThisContext%28%29%29")]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28smalltalk.getThisContext%28%29%29")]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})]));})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);return ((($receiver = smalltalk.send(aNode, "_assigned", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%28typeof%20"), "__comma", [varName]), "__comma", [unescape("%20%3D%3D%20%27undefined%27%20%3F%20nil%20%3A%20")]), "__comma", [varName]), "__comma", [unescape("%29")])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%28typeof%20"), "__comma", [varName]), "__comma", [unescape("%20%3D%3D%20%27undefined%27%20%3F%20nil%20%3A%20")]), "__comma", [varName]), "__comma", [unescape("%29")])]);})]));}), (function(){return ((($receiver = smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["thisContext"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28smalltalk.getThisContext%28%29%29")]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28smalltalk.getThisContext%28%29%29")]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})]));})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("self%5B%27@"), "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", [unescape("%27%5D")])]);}), (function(){(varName=smalltalk.send(self, "_safeVariableNameFor_", [smalltalk.send(aNode, "_value", [])]));return ((($receiver = smalltalk.send(smalltalk.send(self, "_knownVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);return ((($receiver = smalltalk.send(aNode, "_assigned", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%28typeof%20"), "__comma", [varName]), "__comma", [unescape("%20%3D%3D%20%27undefined%27%20%3F%20nil%20%3A%20")]), "__comma", [varName]), "__comma", [unescape("%29")])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%28typeof%20"), "__comma", [varName]), "__comma", [unescape("%20%3D%3D%20%27undefined%27%20%3F%20nil%20%3A%20")]), "__comma", [varName]), "__comma", [unescape("%29")])]);})]));})() : (function(){return ((($receiver = smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["thisContext"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28smalltalk.getThisContext%28%29%29")]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28smalltalk.getThisContext%28%29%29")]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})]));})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);return ((($receiver = smalltalk.send(aNode, "_assigned", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%28typeof%20"), "__comma", [varName]), "__comma", [unescape("%20%3D%3D%20%27undefined%27%20%3F%20nil%20%3A%20")]), "__comma", [varName]), "__comma", [unescape("%29")])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%28typeof%20"), "__comma", [varName]), "__comma", [unescape("%20%3D%3D%20%27undefined%27%20%3F%20nil%20%3A%20")]), "__comma", [varName]), "__comma", [unescape("%29")])]);})]));}), (function(){return ((($receiver = smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["thisContext"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28smalltalk.getThisContext%28%29%29")]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28smalltalk.getThisContext%28%29%29")]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})]));})]));})]));
  13308. return self;},
  13309. args: ["aNode"],
  13310. source: "visitVariableNode: aNode\x0a\x09| varName |\x0a\x09(self currentClass allInstanceVariableNames includes: aNode value) \x0a\x09\x09ifTrue: [stream nextPutAll: 'self[''@', aNode value, ''']']\x0a\x09\x09ifFalse: [\x0a \x09varName := self safeVariableNameFor: aNode value.\x0a\x09\x09\x09(self knownVariables includes: varName) \x0a \x09\x09ifFalse: [\x0a \x09unknownVariables add: aNode value.\x0a \x09aNode assigned \x0a \x09\x09ifTrue: [stream nextPutAll: varName]\x0a \x09\x09ifFalse: [stream nextPutAll: '(typeof ', varName, ' == ''undefined'' ? nil : ', varName, ')']]\x0a \x09\x09ifTrue: [\x0a \x09aNode value = 'thisContext'\x0a \x09\x09ifTrue: [stream nextPutAll: '(smalltalk.getThisContext())']\x0a \x09\x09\x09\x09ifFalse: [stream nextPutAll: varName]]]",
  13311. messageSends: ["ifTrue:ifFalse:", "includes:", "allInstanceVariableNames", "currentClass", "value", "nextPutAll:", ",", "safeVariableNameFor:", "ifFalse:ifTrue:", "knownVariables", "add:", "assigned", "="],
  13312. referencedClasses: []
  13313. }),
  13314. smalltalk.Compiler);
  13315. smalltalk.Compiler.klass.iVarNames = ['performOptimizations'];
  13316. smalltalk.addMethod(
  13317. "_performOptimizations",
  13318. smalltalk.method({
  13319. selector: "performOptimizations",
  13320. category: 'accessing',
  13321. fn: function () {
  13322. var self=this;
  13323. return (($receiver = self['@performOptimizations']) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver;
  13324. return self;},
  13325. args: [],
  13326. source: "performOptimizations\x0a\x09^performOptimizations ifNil: [true]",
  13327. messageSends: ["ifNil:"],
  13328. referencedClasses: []
  13329. }),
  13330. smalltalk.Compiler.klass);
  13331. smalltalk.addMethod(
  13332. "_performOptimizations_",
  13333. smalltalk.method({
  13334. selector: "performOptimizations:",
  13335. category: 'accessing',
  13336. fn: function (aBoolean) {
  13337. var self=this;
  13338. (self['@performOptimizations']=aBoolean);
  13339. return self;},
  13340. args: ["aBoolean"],
  13341. source: "performOptimizations: aBoolean\x0a\x09performOptimizations := aBoolean",
  13342. messageSends: [],
  13343. referencedClasses: []
  13344. }),
  13345. smalltalk.Compiler.klass);
  13346. smalltalk.parser = (function(){
  13347. /* Generated by PEG.js 0.6.2 (http://pegjs.majda.cz/). */
  13348. var result = {
  13349. /*
  13350. * Parses the input with a generated parser. If the parsing is successfull,
  13351. * returns a value explicitly or implicitly specified by the grammar from
  13352. * which the parser was generated (see |PEG.buildParser|). If the parsing is
  13353. * unsuccessful, throws |PEG.parser.SyntaxError| describing the error.
  13354. */
  13355. parse: function(input, startRule) {
  13356. var parseFunctions = {
  13357. "assignment": parse_assignment,
  13358. "binaryMessage": parse_binaryMessage,
  13359. "binaryPattern": parse_binaryPattern,
  13360. "binarySelector": parse_binarySelector,
  13361. "binarySend": parse_binarySend,
  13362. "binaryTail": parse_binaryTail,
  13363. "block": parse_block,
  13364. "blockParamList": parse_blockParamList,
  13365. "cascade": parse_cascade,
  13366. "className": parse_className,
  13367. "classReference": parse_classReference,
  13368. "comments": parse_comments,
  13369. "dynamicArray": parse_dynamicArray,
  13370. "dynamicDictionary": parse_dynamicDictionary,
  13371. "expression": parse_expression,
  13372. "expressionList": parse_expressionList,
  13373. "expressions": parse_expressions,
  13374. "float": parse_float,
  13375. "identifier": parse_identifier,
  13376. "integer": parse_integer,
  13377. "jsStatement": parse_jsStatement,
  13378. "keyword": parse_keyword,
  13379. "keywordMessage": parse_keywordMessage,
  13380. "keywordPair": parse_keywordPair,
  13381. "keywordPattern": parse_keywordPattern,
  13382. "keywordSend": parse_keywordSend,
  13383. "literal": parse_literal,
  13384. "literalArray": parse_literalArray,
  13385. "message": parse_message,
  13386. "method": parse_method,
  13387. "number": parse_number,
  13388. "operand": parse_operand,
  13389. "pseudoVariable": parse_pseudoVariable,
  13390. "reference": parse_reference,
  13391. "ret": parse_ret,
  13392. "separator": parse_separator,
  13393. "sequence": parse_sequence,
  13394. "statements": parse_statements,
  13395. "string": parse_string,
  13396. "subexpression": parse_subexpression,
  13397. "symbol": parse_symbol,
  13398. "temps": parse_temps,
  13399. "unaryMessage": parse_unaryMessage,
  13400. "unaryPattern": parse_unaryPattern,
  13401. "unarySend": parse_unarySend,
  13402. "unaryTail": parse_unaryTail,
  13403. "varIdentifier": parse_varIdentifier,
  13404. "variable": parse_variable,
  13405. "ws": parse_ws
  13406. };
  13407. if (startRule !== undefined) {
  13408. if (parseFunctions[startRule] === undefined) {
  13409. throw new Error("Invalid rule name: " + quote(startRule) + ".");
  13410. }
  13411. } else {
  13412. startRule = "method";
  13413. }
  13414. var pos = 0;
  13415. var reportMatchFailures = true;
  13416. var rightmostMatchFailuresPos = 0;
  13417. var rightmostMatchFailuresExpected = [];
  13418. var cache = {};
  13419. function padLeft(input, padding, length) {
  13420. var result = input;
  13421. var padLength = length - input.length;
  13422. for (var i = 0; i < padLength; i++) {
  13423. result = padding + result;
  13424. }
  13425. return result;
  13426. }
  13427. function escape(ch) {
  13428. var charCode = ch.charCodeAt(0);
  13429. if (charCode <= 0xFF) {
  13430. var escapeChar = 'x';
  13431. var length = 2;
  13432. } else {
  13433. var escapeChar = 'u';
  13434. var length = 4;
  13435. }
  13436. return '\\' + escapeChar + padLeft(charCode.toString(16).toUpperCase(), '0', length);
  13437. }
  13438. function quote(s) {
  13439. /*
  13440. * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a
  13441. * string literal except for the closing quote character, backslash,
  13442. * carriage return, line separator, paragraph separator, and line feed.
  13443. * Any character may appear in the form of an escape sequence.
  13444. */
  13445. return '"' + s
  13446. .replace(/\\/g, '\\\\') // backslash
  13447. .replace(/"/g, '\\"') // closing quote character
  13448. .replace(/\r/g, '\\r') // carriage return
  13449. .replace(/\n/g, '\\n') // line feed
  13450. .replace(/[\x80-\uFFFF]/g, escape) // non-ASCII characters
  13451. + '"';
  13452. }
  13453. function matchFailed(failure) {
  13454. if (pos < rightmostMatchFailuresPos) {
  13455. return;
  13456. }
  13457. if (pos > rightmostMatchFailuresPos) {
  13458. rightmostMatchFailuresPos = pos;
  13459. rightmostMatchFailuresExpected = [];
  13460. }
  13461. rightmostMatchFailuresExpected.push(failure);
  13462. }
  13463. function parse_separator() {
  13464. var cacheKey = 'separator@' + pos;
  13465. var cachedResult = cache[cacheKey];
  13466. if (cachedResult) {
  13467. pos = cachedResult.nextPos;
  13468. return cachedResult.result;
  13469. }
  13470. if (input.substr(pos).match(/^[ \xA0\uFEFF\n\r\u2028\u2029]/) !== null) {
  13471. var result1 = input.charAt(pos);
  13472. pos++;
  13473. } else {
  13474. var result1 = null;
  13475. if (reportMatchFailures) {
  13476. matchFailed("[ \\xA0\\uFEFF\\n\\r\\u2028\\u2029]");
  13477. }
  13478. }
  13479. if (result1 !== null) {
  13480. var result0 = [];
  13481. while (result1 !== null) {
  13482. result0.push(result1);
  13483. if (input.substr(pos).match(/^[ \xA0\uFEFF\n\r\u2028\u2029]/) !== null) {
  13484. var result1 = input.charAt(pos);
  13485. pos++;
  13486. } else {
  13487. var result1 = null;
  13488. if (reportMatchFailures) {
  13489. matchFailed("[ \\xA0\\uFEFF\\n\\r\\u2028\\u2029]");
  13490. }
  13491. }
  13492. }
  13493. } else {
  13494. var result0 = null;
  13495. }
  13496. cache[cacheKey] = {
  13497. nextPos: pos,
  13498. result: result0
  13499. };
  13500. return result0;
  13501. }
  13502. function parse_comments() {
  13503. var cacheKey = 'comments@' + pos;
  13504. var cachedResult = cache[cacheKey];
  13505. if (cachedResult) {
  13506. pos = cachedResult.nextPos;
  13507. return cachedResult.result;
  13508. }
  13509. var savedPos0 = pos;
  13510. if (input.substr(pos).match(/^["]/) !== null) {
  13511. var result2 = input.charAt(pos);
  13512. pos++;
  13513. } else {
  13514. var result2 = null;
  13515. if (reportMatchFailures) {
  13516. matchFailed("[\"]");
  13517. }
  13518. }
  13519. if (result2 !== null) {
  13520. var result3 = [];
  13521. if (input.substr(pos).match(/^[^"]/) !== null) {
  13522. var result5 = input.charAt(pos);
  13523. pos++;
  13524. } else {
  13525. var result5 = null;
  13526. if (reportMatchFailures) {
  13527. matchFailed("[^\"]");
  13528. }
  13529. }
  13530. while (result5 !== null) {
  13531. result3.push(result5);
  13532. if (input.substr(pos).match(/^[^"]/) !== null) {
  13533. var result5 = input.charAt(pos);
  13534. pos++;
  13535. } else {
  13536. var result5 = null;
  13537. if (reportMatchFailures) {
  13538. matchFailed("[^\"]");
  13539. }
  13540. }
  13541. }
  13542. if (result3 !== null) {
  13543. if (input.substr(pos).match(/^["]/) !== null) {
  13544. var result4 = input.charAt(pos);
  13545. pos++;
  13546. } else {
  13547. var result4 = null;
  13548. if (reportMatchFailures) {
  13549. matchFailed("[\"]");
  13550. }
  13551. }
  13552. if (result4 !== null) {
  13553. var result1 = [result2, result3, result4];
  13554. } else {
  13555. var result1 = null;
  13556. pos = savedPos0;
  13557. }
  13558. } else {
  13559. var result1 = null;
  13560. pos = savedPos0;
  13561. }
  13562. } else {
  13563. var result1 = null;
  13564. pos = savedPos0;
  13565. }
  13566. if (result1 !== null) {
  13567. var result0 = [];
  13568. while (result1 !== null) {
  13569. result0.push(result1);
  13570. var savedPos0 = pos;
  13571. if (input.substr(pos).match(/^["]/) !== null) {
  13572. var result2 = input.charAt(pos);
  13573. pos++;
  13574. } else {
  13575. var result2 = null;
  13576. if (reportMatchFailures) {
  13577. matchFailed("[\"]");
  13578. }
  13579. }
  13580. if (result2 !== null) {
  13581. var result3 = [];
  13582. if (input.substr(pos).match(/^[^"]/) !== null) {
  13583. var result5 = input.charAt(pos);
  13584. pos++;
  13585. } else {
  13586. var result5 = null;
  13587. if (reportMatchFailures) {
  13588. matchFailed("[^\"]");
  13589. }
  13590. }
  13591. while (result5 !== null) {
  13592. result3.push(result5);
  13593. if (input.substr(pos).match(/^[^"]/) !== null) {
  13594. var result5 = input.charAt(pos);
  13595. pos++;
  13596. } else {
  13597. var result5 = null;
  13598. if (reportMatchFailures) {
  13599. matchFailed("[^\"]");
  13600. }
  13601. }
  13602. }
  13603. if (result3 !== null) {
  13604. if (input.substr(pos).match(/^["]/) !== null) {
  13605. var result4 = input.charAt(pos);
  13606. pos++;
  13607. } else {
  13608. var result4 = null;
  13609. if (reportMatchFailures) {
  13610. matchFailed("[\"]");
  13611. }
  13612. }
  13613. if (result4 !== null) {
  13614. var result1 = [result2, result3, result4];
  13615. } else {
  13616. var result1 = null;
  13617. pos = savedPos0;
  13618. }
  13619. } else {
  13620. var result1 = null;
  13621. pos = savedPos0;
  13622. }
  13623. } else {
  13624. var result1 = null;
  13625. pos = savedPos0;
  13626. }
  13627. }
  13628. } else {
  13629. var result0 = null;
  13630. }
  13631. cache[cacheKey] = {
  13632. nextPos: pos,
  13633. result: result0
  13634. };
  13635. return result0;
  13636. }
  13637. function parse_ws() {
  13638. var cacheKey = 'ws@' + pos;
  13639. var cachedResult = cache[cacheKey];
  13640. if (cachedResult) {
  13641. pos = cachedResult.nextPos;
  13642. return cachedResult.result;
  13643. }
  13644. var result0 = [];
  13645. var result3 = parse_separator();
  13646. if (result3 !== null) {
  13647. var result1 = result3;
  13648. } else {
  13649. var result2 = parse_comments();
  13650. if (result2 !== null) {
  13651. var result1 = result2;
  13652. } else {
  13653. var result1 = null;;
  13654. };
  13655. }
  13656. while (result1 !== null) {
  13657. result0.push(result1);
  13658. var result3 = parse_separator();
  13659. if (result3 !== null) {
  13660. var result1 = result3;
  13661. } else {
  13662. var result2 = parse_comments();
  13663. if (result2 !== null) {
  13664. var result1 = result2;
  13665. } else {
  13666. var result1 = null;;
  13667. };
  13668. }
  13669. }
  13670. cache[cacheKey] = {
  13671. nextPos: pos,
  13672. result: result0
  13673. };
  13674. return result0;
  13675. }
  13676. function parse_identifier() {
  13677. var cacheKey = 'identifier@' + pos;
  13678. var cachedResult = cache[cacheKey];
  13679. if (cachedResult) {
  13680. pos = cachedResult.nextPos;
  13681. return cachedResult.result;
  13682. }
  13683. var savedPos0 = pos;
  13684. var savedPos1 = pos;
  13685. if (input.substr(pos).match(/^[a-zA-Z]/) !== null) {
  13686. var result3 = input.charAt(pos);
  13687. pos++;
  13688. } else {
  13689. var result3 = null;
  13690. if (reportMatchFailures) {
  13691. matchFailed("[a-zA-Z]");
  13692. }
  13693. }
  13694. if (result3 !== null) {
  13695. var result4 = [];
  13696. if (input.substr(pos).match(/^[a-zA-Z0-9]/) !== null) {
  13697. var result5 = input.charAt(pos);
  13698. pos++;
  13699. } else {
  13700. var result5 = null;
  13701. if (reportMatchFailures) {
  13702. matchFailed("[a-zA-Z0-9]");
  13703. }
  13704. }
  13705. while (result5 !== null) {
  13706. result4.push(result5);
  13707. if (input.substr(pos).match(/^[a-zA-Z0-9]/) !== null) {
  13708. var result5 = input.charAt(pos);
  13709. pos++;
  13710. } else {
  13711. var result5 = null;
  13712. if (reportMatchFailures) {
  13713. matchFailed("[a-zA-Z0-9]");
  13714. }
  13715. }
  13716. }
  13717. if (result4 !== null) {
  13718. var result1 = [result3, result4];
  13719. } else {
  13720. var result1 = null;
  13721. pos = savedPos1;
  13722. }
  13723. } else {
  13724. var result1 = null;
  13725. pos = savedPos1;
  13726. }
  13727. var result2 = result1 !== null
  13728. ? (function(first, others) {return first + others.join("")})(result1[0], result1[1])
  13729. : null;
  13730. if (result2 !== null) {
  13731. var result0 = result2;
  13732. } else {
  13733. var result0 = null;
  13734. pos = savedPos0;
  13735. }
  13736. cache[cacheKey] = {
  13737. nextPos: pos,
  13738. result: result0
  13739. };
  13740. return result0;
  13741. }
  13742. function parse_varIdentifier() {
  13743. var cacheKey = 'varIdentifier@' + pos;
  13744. var cachedResult = cache[cacheKey];
  13745. if (cachedResult) {
  13746. pos = cachedResult.nextPos;
  13747. return cachedResult.result;
  13748. }
  13749. var savedPos0 = pos;
  13750. var savedPos1 = pos;
  13751. if (input.substr(pos).match(/^[a-z]/) !== null) {
  13752. var result3 = input.charAt(pos);
  13753. pos++;
  13754. } else {
  13755. var result3 = null;
  13756. if (reportMatchFailures) {
  13757. matchFailed("[a-z]");
  13758. }
  13759. }
  13760. if (result3 !== null) {
  13761. var result4 = [];
  13762. if (input.substr(pos).match(/^[a-zA-Z0-9]/) !== null) {
  13763. var result5 = input.charAt(pos);
  13764. pos++;
  13765. } else {
  13766. var result5 = null;
  13767. if (reportMatchFailures) {
  13768. matchFailed("[a-zA-Z0-9]");
  13769. }
  13770. }
  13771. while (result5 !== null) {
  13772. result4.push(result5);
  13773. if (input.substr(pos).match(/^[a-zA-Z0-9]/) !== null) {
  13774. var result5 = input.charAt(pos);
  13775. pos++;
  13776. } else {
  13777. var result5 = null;
  13778. if (reportMatchFailures) {
  13779. matchFailed("[a-zA-Z0-9]");
  13780. }
  13781. }
  13782. }
  13783. if (result4 !== null) {
  13784. var result1 = [result3, result4];
  13785. } else {
  13786. var result1 = null;
  13787. pos = savedPos1;
  13788. }
  13789. } else {
  13790. var result1 = null;
  13791. pos = savedPos1;
  13792. }
  13793. var result2 = result1 !== null
  13794. ? (function(first, others) {return first + others.join("")})(result1[0], result1[1])
  13795. : null;
  13796. if (result2 !== null) {
  13797. var result0 = result2;
  13798. } else {
  13799. var result0 = null;
  13800. pos = savedPos0;
  13801. }
  13802. cache[cacheKey] = {
  13803. nextPos: pos,
  13804. result: result0
  13805. };
  13806. return result0;
  13807. }
  13808. function parse_keyword() {
  13809. var cacheKey = 'keyword@' + pos;
  13810. var cachedResult = cache[cacheKey];
  13811. if (cachedResult) {
  13812. pos = cachedResult.nextPos;
  13813. return cachedResult.result;
  13814. }
  13815. var savedPos0 = pos;
  13816. var savedPos1 = pos;
  13817. var result3 = parse_identifier();
  13818. if (result3 !== null) {
  13819. if (input.substr(pos).match(/^[:]/) !== null) {
  13820. var result4 = input.charAt(pos);
  13821. pos++;
  13822. } else {
  13823. var result4 = null;
  13824. if (reportMatchFailures) {
  13825. matchFailed("[:]");
  13826. }
  13827. }
  13828. if (result4 !== null) {
  13829. var result1 = [result3, result4];
  13830. } else {
  13831. var result1 = null;
  13832. pos = savedPos1;
  13833. }
  13834. } else {
  13835. var result1 = null;
  13836. pos = savedPos1;
  13837. }
  13838. var result2 = result1 !== null
  13839. ? (function(first, last) {return first + last})(result1[0], result1[1])
  13840. : null;
  13841. if (result2 !== null) {
  13842. var result0 = result2;
  13843. } else {
  13844. var result0 = null;
  13845. pos = savedPos0;
  13846. }
  13847. cache[cacheKey] = {
  13848. nextPos: pos,
  13849. result: result0
  13850. };
  13851. return result0;
  13852. }
  13853. function parse_className() {
  13854. var cacheKey = 'className@' + pos;
  13855. var cachedResult = cache[cacheKey];
  13856. if (cachedResult) {
  13857. pos = cachedResult.nextPos;
  13858. return cachedResult.result;
  13859. }
  13860. var savedPos0 = pos;
  13861. var savedPos1 = pos;
  13862. if (input.substr(pos).match(/^[A-Z]/) !== null) {
  13863. var result3 = input.charAt(pos);
  13864. pos++;
  13865. } else {
  13866. var result3 = null;
  13867. if (reportMatchFailures) {
  13868. matchFailed("[A-Z]");
  13869. }
  13870. }
  13871. if (result3 !== null) {
  13872. var result4 = [];
  13873. if (input.substr(pos).match(/^[a-zA-Z0-9]/) !== null) {
  13874. var result5 = input.charAt(pos);
  13875. pos++;
  13876. } else {
  13877. var result5 = null;
  13878. if (reportMatchFailures) {
  13879. matchFailed("[a-zA-Z0-9]");
  13880. }
  13881. }
  13882. while (result5 !== null) {
  13883. result4.push(result5);
  13884. if (input.substr(pos).match(/^[a-zA-Z0-9]/) !== null) {
  13885. var result5 = input.charAt(pos);
  13886. pos++;
  13887. } else {
  13888. var result5 = null;
  13889. if (reportMatchFailures) {
  13890. matchFailed("[a-zA-Z0-9]");
  13891. }
  13892. }
  13893. }
  13894. if (result4 !== null) {
  13895. var result1 = [result3, result4];
  13896. } else {
  13897. var result1 = null;
  13898. pos = savedPos1;
  13899. }
  13900. } else {
  13901. var result1 = null;
  13902. pos = savedPos1;
  13903. }
  13904. var result2 = result1 !== null
  13905. ? (function(first, others) {return first + others.join("")})(result1[0], result1[1])
  13906. : null;
  13907. if (result2 !== null) {
  13908. var result0 = result2;
  13909. } else {
  13910. var result0 = null;
  13911. pos = savedPos0;
  13912. }
  13913. cache[cacheKey] = {
  13914. nextPos: pos,
  13915. result: result0
  13916. };
  13917. return result0;
  13918. }
  13919. function parse_string() {
  13920. var cacheKey = 'string@' + pos;
  13921. var cachedResult = cache[cacheKey];
  13922. if (cachedResult) {
  13923. pos = cachedResult.nextPos;
  13924. return cachedResult.result;
  13925. }
  13926. var savedPos0 = pos;
  13927. var savedPos1 = pos;
  13928. if (input.substr(pos).match(/^[']/) !== null) {
  13929. var result3 = input.charAt(pos);
  13930. pos++;
  13931. } else {
  13932. var result3 = null;
  13933. if (reportMatchFailures) {
  13934. matchFailed("[']");
  13935. }
  13936. }
  13937. if (result3 !== null) {
  13938. var result4 = [];
  13939. var savedPos2 = pos;
  13940. if (input.substr(pos, 2) === "''") {
  13941. var result9 = "''";
  13942. pos += 2;
  13943. } else {
  13944. var result9 = null;
  13945. if (reportMatchFailures) {
  13946. matchFailed("\"''\"");
  13947. }
  13948. }
  13949. var result10 = result9 !== null
  13950. ? (function() {return "'"})()
  13951. : null;
  13952. if (result10 !== null) {
  13953. var result8 = result10;
  13954. } else {
  13955. var result8 = null;
  13956. pos = savedPos2;
  13957. }
  13958. if (result8 !== null) {
  13959. var result6 = result8;
  13960. } else {
  13961. if (input.substr(pos).match(/^[^']/) !== null) {
  13962. var result7 = input.charAt(pos);
  13963. pos++;
  13964. } else {
  13965. var result7 = null;
  13966. if (reportMatchFailures) {
  13967. matchFailed("[^']");
  13968. }
  13969. }
  13970. if (result7 !== null) {
  13971. var result6 = result7;
  13972. } else {
  13973. var result6 = null;;
  13974. };
  13975. }
  13976. while (result6 !== null) {
  13977. result4.push(result6);
  13978. var savedPos2 = pos;
  13979. if (input.substr(pos, 2) === "''") {
  13980. var result9 = "''";
  13981. pos += 2;
  13982. } else {
  13983. var result9 = null;
  13984. if (reportMatchFailures) {
  13985. matchFailed("\"''\"");
  13986. }
  13987. }
  13988. var result10 = result9 !== null
  13989. ? (function() {return "'"})()
  13990. : null;
  13991. if (result10 !== null) {
  13992. var result8 = result10;
  13993. } else {
  13994. var result8 = null;
  13995. pos = savedPos2;
  13996. }
  13997. if (result8 !== null) {
  13998. var result6 = result8;
  13999. } else {
  14000. if (input.substr(pos).match(/^[^']/) !== null) {
  14001. var result7 = input.charAt(pos);
  14002. pos++;
  14003. } else {
  14004. var result7 = null;
  14005. if (reportMatchFailures) {
  14006. matchFailed("[^']");
  14007. }
  14008. }
  14009. if (result7 !== null) {
  14010. var result6 = result7;
  14011. } else {
  14012. var result6 = null;;
  14013. };
  14014. }
  14015. }
  14016. if (result4 !== null) {
  14017. if (input.substr(pos).match(/^[']/) !== null) {
  14018. var result5 = input.charAt(pos);
  14019. pos++;
  14020. } else {
  14021. var result5 = null;
  14022. if (reportMatchFailures) {
  14023. matchFailed("[']");
  14024. }
  14025. }
  14026. if (result5 !== null) {
  14027. var result1 = [result3, result4, result5];
  14028. } else {
  14029. var result1 = null;
  14030. pos = savedPos1;
  14031. }
  14032. } else {
  14033. var result1 = null;
  14034. pos = savedPos1;
  14035. }
  14036. } else {
  14037. var result1 = null;
  14038. pos = savedPos1;
  14039. }
  14040. var result2 = result1 !== null
  14041. ? (function(val) {
  14042. return smalltalk.ValueNode._new()
  14043. ._value_(val.join("").replace(/\"/ig, '"'))
  14044. })(result1[1])
  14045. : null;
  14046. if (result2 !== null) {
  14047. var result0 = result2;
  14048. } else {
  14049. var result0 = null;
  14050. pos = savedPos0;
  14051. }
  14052. cache[cacheKey] = {
  14053. nextPos: pos,
  14054. result: result0
  14055. };
  14056. return result0;
  14057. }
  14058. function parse_symbol() {
  14059. var cacheKey = 'symbol@' + pos;
  14060. var cachedResult = cache[cacheKey];
  14061. if (cachedResult) {
  14062. pos = cachedResult.nextPos;
  14063. return cachedResult.result;
  14064. }
  14065. var savedPos0 = pos;
  14066. var savedPos1 = pos;
  14067. if (input.substr(pos, 1) === "#") {
  14068. var result3 = "#";
  14069. pos += 1;
  14070. } else {
  14071. var result3 = null;
  14072. if (reportMatchFailures) {
  14073. matchFailed("\"#\"");
  14074. }
  14075. }
  14076. if (result3 !== null) {
  14077. var result4 = [];
  14078. var savedPos3 = pos;
  14079. if (input.substr(pos).match(/^[a-zA-Z0-9:]/) !== null) {
  14080. var result12 = input.charAt(pos);
  14081. pos++;
  14082. } else {
  14083. var result12 = null;
  14084. if (reportMatchFailures) {
  14085. matchFailed("[a-zA-Z0-9:]");
  14086. }
  14087. }
  14088. if (result12 !== null) {
  14089. var result10 = [];
  14090. while (result12 !== null) {
  14091. result10.push(result12);
  14092. if (input.substr(pos).match(/^[a-zA-Z0-9:]/) !== null) {
  14093. var result12 = input.charAt(pos);
  14094. pos++;
  14095. } else {
  14096. var result12 = null;
  14097. if (reportMatchFailures) {
  14098. matchFailed("[a-zA-Z0-9:]");
  14099. }
  14100. }
  14101. }
  14102. } else {
  14103. var result10 = null;
  14104. }
  14105. var result11 = result10 !== null
  14106. ? (function(digits) {return digits.join("")})(result10)
  14107. : null;
  14108. if (result11 !== null) {
  14109. var result9 = result11;
  14110. } else {
  14111. var result9 = null;
  14112. pos = savedPos3;
  14113. }
  14114. if (result9 !== null) {
  14115. var result5 = result9;
  14116. } else {
  14117. var savedPos2 = pos;
  14118. var result7 = parse_string();
  14119. var result8 = result7 !== null
  14120. ? (function(node) {return node._value()})(result7)
  14121. : null;
  14122. if (result8 !== null) {
  14123. var result6 = result8;
  14124. } else {
  14125. var result6 = null;
  14126. pos = savedPos2;
  14127. }
  14128. if (result6 !== null) {
  14129. var result5 = result6;
  14130. } else {
  14131. var result5 = null;;
  14132. };
  14133. }
  14134. while (result5 !== null) {
  14135. result4.push(result5);
  14136. var savedPos3 = pos;
  14137. if (input.substr(pos).match(/^[a-zA-Z0-9:]/) !== null) {
  14138. var result12 = input.charAt(pos);
  14139. pos++;
  14140. } else {
  14141. var result12 = null;
  14142. if (reportMatchFailures) {
  14143. matchFailed("[a-zA-Z0-9:]");
  14144. }
  14145. }
  14146. if (result12 !== null) {
  14147. var result10 = [];
  14148. while (result12 !== null) {
  14149. result10.push(result12);
  14150. if (input.substr(pos).match(/^[a-zA-Z0-9:]/) !== null) {
  14151. var result12 = input.charAt(pos);
  14152. pos++;
  14153. } else {
  14154. var result12 = null;
  14155. if (reportMatchFailures) {
  14156. matchFailed("[a-zA-Z0-9:]");
  14157. }
  14158. }
  14159. }
  14160. } else {
  14161. var result10 = null;
  14162. }
  14163. var result11 = result10 !== null
  14164. ? (function(digits) {return digits.join("")})(result10)
  14165. : null;
  14166. if (result11 !== null) {
  14167. var result9 = result11;
  14168. } else {
  14169. var result9 = null;
  14170. pos = savedPos3;
  14171. }
  14172. if (result9 !== null) {
  14173. var result5 = result9;
  14174. } else {
  14175. var savedPos2 = pos;
  14176. var result7 = parse_string();
  14177. var result8 = result7 !== null
  14178. ? (function(node) {return node._value()})(result7)
  14179. : null;
  14180. if (result8 !== null) {
  14181. var result6 = result8;
  14182. } else {
  14183. var result6 = null;
  14184. pos = savedPos2;
  14185. }
  14186. if (result6 !== null) {
  14187. var result5 = result6;
  14188. } else {
  14189. var result5 = null;;
  14190. };
  14191. }
  14192. }
  14193. if (result4 !== null) {
  14194. var result1 = [result3, result4];
  14195. } else {
  14196. var result1 = null;
  14197. pos = savedPos1;
  14198. }
  14199. } else {
  14200. var result1 = null;
  14201. pos = savedPos1;
  14202. }
  14203. var result2 = result1 !== null
  14204. ? (function(val) {
  14205. return smalltalk.ValueNode._new()
  14206. ._value_(smalltalk.symbolFor(val.join("").replace(/\"/ig, '"')))
  14207. })(result1[1])
  14208. : null;
  14209. if (result2 !== null) {
  14210. var result0 = result2;
  14211. } else {
  14212. var result0 = null;
  14213. pos = savedPos0;
  14214. }
  14215. cache[cacheKey] = {
  14216. nextPos: pos,
  14217. result: result0
  14218. };
  14219. return result0;
  14220. }
  14221. function parse_number() {
  14222. var cacheKey = 'number@' + pos;
  14223. var cachedResult = cache[cacheKey];
  14224. if (cachedResult) {
  14225. pos = cachedResult.nextPos;
  14226. return cachedResult.result;
  14227. }
  14228. var savedPos0 = pos;
  14229. var result4 = parse_float();
  14230. if (result4 !== null) {
  14231. var result1 = result4;
  14232. } else {
  14233. var result3 = parse_integer();
  14234. if (result3 !== null) {
  14235. var result1 = result3;
  14236. } else {
  14237. var result1 = null;;
  14238. };
  14239. }
  14240. var result2 = result1 !== null
  14241. ? (function(n) {
  14242. return smalltalk.ValueNode._new()
  14243. ._value_(n)
  14244. })(result1)
  14245. : null;
  14246. if (result2 !== null) {
  14247. var result0 = result2;
  14248. } else {
  14249. var result0 = null;
  14250. pos = savedPos0;
  14251. }
  14252. cache[cacheKey] = {
  14253. nextPos: pos,
  14254. result: result0
  14255. };
  14256. return result0;
  14257. }
  14258. function parse_float() {
  14259. var cacheKey = 'float@' + pos;
  14260. var cachedResult = cache[cacheKey];
  14261. if (cachedResult) {
  14262. pos = cachedResult.nextPos;
  14263. return cachedResult.result;
  14264. }
  14265. var savedPos0 = pos;
  14266. var savedPos1 = pos;
  14267. if (input.substr(pos).match(/^[\-]/) !== null) {
  14268. var result9 = input.charAt(pos);
  14269. pos++;
  14270. } else {
  14271. var result9 = null;
  14272. if (reportMatchFailures) {
  14273. matchFailed("[\\-]");
  14274. }
  14275. }
  14276. var result3 = result9 !== null ? result9 : '';
  14277. if (result3 !== null) {
  14278. if (input.substr(pos).match(/^[0-9]/) !== null) {
  14279. var result8 = input.charAt(pos);
  14280. pos++;
  14281. } else {
  14282. var result8 = null;
  14283. if (reportMatchFailures) {
  14284. matchFailed("[0-9]");
  14285. }
  14286. }
  14287. if (result8 !== null) {
  14288. var result4 = [];
  14289. while (result8 !== null) {
  14290. result4.push(result8);
  14291. if (input.substr(pos).match(/^[0-9]/) !== null) {
  14292. var result8 = input.charAt(pos);
  14293. pos++;
  14294. } else {
  14295. var result8 = null;
  14296. if (reportMatchFailures) {
  14297. matchFailed("[0-9]");
  14298. }
  14299. }
  14300. }
  14301. } else {
  14302. var result4 = null;
  14303. }
  14304. if (result4 !== null) {
  14305. if (input.substr(pos, 1) === ".") {
  14306. var result5 = ".";
  14307. pos += 1;
  14308. } else {
  14309. var result5 = null;
  14310. if (reportMatchFailures) {
  14311. matchFailed("\".\"");
  14312. }
  14313. }
  14314. if (result5 !== null) {
  14315. if (input.substr(pos).match(/^[0-9]/) !== null) {
  14316. var result7 = input.charAt(pos);
  14317. pos++;
  14318. } else {
  14319. var result7 = null;
  14320. if (reportMatchFailures) {
  14321. matchFailed("[0-9]");
  14322. }
  14323. }
  14324. if (result7 !== null) {
  14325. var result6 = [];
  14326. while (result7 !== null) {
  14327. result6.push(result7);
  14328. if (input.substr(pos).match(/^[0-9]/) !== null) {
  14329. var result7 = input.charAt(pos);
  14330. pos++;
  14331. } else {
  14332. var result7 = null;
  14333. if (reportMatchFailures) {
  14334. matchFailed("[0-9]");
  14335. }
  14336. }
  14337. }
  14338. } else {
  14339. var result6 = null;
  14340. }
  14341. if (result6 !== null) {
  14342. var result1 = [result3, result4, result5, result6];
  14343. } else {
  14344. var result1 = null;
  14345. pos = savedPos1;
  14346. }
  14347. } else {
  14348. var result1 = null;
  14349. pos = savedPos1;
  14350. }
  14351. } else {
  14352. var result1 = null;
  14353. pos = savedPos1;
  14354. }
  14355. } else {
  14356. var result1 = null;
  14357. pos = savedPos1;
  14358. }
  14359. var result2 = result1 !== null
  14360. ? (function(neg, int, dec) {return parseFloat((neg + int.join("") + "." + dec.join("")), 10)})(result1[0], result1[1], result1[3])
  14361. : null;
  14362. if (result2 !== null) {
  14363. var result0 = result2;
  14364. } else {
  14365. var result0 = null;
  14366. pos = savedPos0;
  14367. }
  14368. cache[cacheKey] = {
  14369. nextPos: pos,
  14370. result: result0
  14371. };
  14372. return result0;
  14373. }
  14374. function parse_integer() {
  14375. var cacheKey = 'integer@' + pos;
  14376. var cachedResult = cache[cacheKey];
  14377. if (cachedResult) {
  14378. pos = cachedResult.nextPos;
  14379. return cachedResult.result;
  14380. }
  14381. var savedPos0 = pos;
  14382. var savedPos1 = pos;
  14383. if (input.substr(pos).match(/^[\-]/) !== null) {
  14384. var result6 = input.charAt(pos);
  14385. pos++;
  14386. } else {
  14387. var result6 = null;
  14388. if (reportMatchFailures) {
  14389. matchFailed("[\\-]");
  14390. }
  14391. }
  14392. var result3 = result6 !== null ? result6 : '';
  14393. if (result3 !== null) {
  14394. if (input.substr(pos).match(/^[0-9]/) !== null) {
  14395. var result5 = input.charAt(pos);
  14396. pos++;
  14397. } else {
  14398. var result5 = null;
  14399. if (reportMatchFailures) {
  14400. matchFailed("[0-9]");
  14401. }
  14402. }
  14403. if (result5 !== null) {
  14404. var result4 = [];
  14405. while (result5 !== null) {
  14406. result4.push(result5);
  14407. if (input.substr(pos).match(/^[0-9]/) !== null) {
  14408. var result5 = input.charAt(pos);
  14409. pos++;
  14410. } else {
  14411. var result5 = null;
  14412. if (reportMatchFailures) {
  14413. matchFailed("[0-9]");
  14414. }
  14415. }
  14416. }
  14417. } else {
  14418. var result4 = null;
  14419. }
  14420. if (result4 !== null) {
  14421. var result1 = [result3, result4];
  14422. } else {
  14423. var result1 = null;
  14424. pos = savedPos1;
  14425. }
  14426. } else {
  14427. var result1 = null;
  14428. pos = savedPos1;
  14429. }
  14430. var result2 = result1 !== null
  14431. ? (function(neg, digits) {return (parseInt(neg+digits.join(""), 10))})(result1[0], result1[1])
  14432. : null;
  14433. if (result2 !== null) {
  14434. var result0 = result2;
  14435. } else {
  14436. var result0 = null;
  14437. pos = savedPos0;
  14438. }
  14439. cache[cacheKey] = {
  14440. nextPos: pos,
  14441. result: result0
  14442. };
  14443. return result0;
  14444. }
  14445. function parse_literalArray() {
  14446. var cacheKey = 'literalArray@' + pos;
  14447. var cachedResult = cache[cacheKey];
  14448. if (cachedResult) {
  14449. pos = cachedResult.nextPos;
  14450. return cachedResult.result;
  14451. }
  14452. var savedPos0 = pos;
  14453. var savedPos1 = pos;
  14454. if (input.substr(pos, 2) === "#(") {
  14455. var result3 = "#(";
  14456. pos += 2;
  14457. } else {
  14458. var result3 = null;
  14459. if (reportMatchFailures) {
  14460. matchFailed("\"#(\"");
  14461. }
  14462. }
  14463. if (result3 !== null) {
  14464. var result4 = parse_ws();
  14465. if (result4 !== null) {
  14466. var result5 = [];
  14467. var savedPos2 = pos;
  14468. var savedPos3 = pos;
  14469. var result11 = parse_literal();
  14470. if (result11 !== null) {
  14471. var result12 = parse_ws();
  14472. if (result12 !== null) {
  14473. var result9 = [result11, result12];
  14474. } else {
  14475. var result9 = null;
  14476. pos = savedPos3;
  14477. }
  14478. } else {
  14479. var result9 = null;
  14480. pos = savedPos3;
  14481. }
  14482. var result10 = result9 !== null
  14483. ? (function(lit) {return lit._value()})(result9[0])
  14484. : null;
  14485. if (result10 !== null) {
  14486. var result8 = result10;
  14487. } else {
  14488. var result8 = null;
  14489. pos = savedPos2;
  14490. }
  14491. while (result8 !== null) {
  14492. result5.push(result8);
  14493. var savedPos2 = pos;
  14494. var savedPos3 = pos;
  14495. var result11 = parse_literal();
  14496. if (result11 !== null) {
  14497. var result12 = parse_ws();
  14498. if (result12 !== null) {
  14499. var result9 = [result11, result12];
  14500. } else {
  14501. var result9 = null;
  14502. pos = savedPos3;
  14503. }
  14504. } else {
  14505. var result9 = null;
  14506. pos = savedPos3;
  14507. }
  14508. var result10 = result9 !== null
  14509. ? (function(lit) {return lit._value()})(result9[0])
  14510. : null;
  14511. if (result10 !== null) {
  14512. var result8 = result10;
  14513. } else {
  14514. var result8 = null;
  14515. pos = savedPos2;
  14516. }
  14517. }
  14518. if (result5 !== null) {
  14519. var result6 = parse_ws();
  14520. if (result6 !== null) {
  14521. if (input.substr(pos, 1) === ")") {
  14522. var result7 = ")";
  14523. pos += 1;
  14524. } else {
  14525. var result7 = null;
  14526. if (reportMatchFailures) {
  14527. matchFailed("\")\"");
  14528. }
  14529. }
  14530. if (result7 !== null) {
  14531. var result1 = [result3, result4, result5, result6, result7];
  14532. } else {
  14533. var result1 = null;
  14534. pos = savedPos1;
  14535. }
  14536. } else {
  14537. var result1 = null;
  14538. pos = savedPos1;
  14539. }
  14540. } else {
  14541. var result1 = null;
  14542. pos = savedPos1;
  14543. }
  14544. } else {
  14545. var result1 = null;
  14546. pos = savedPos1;
  14547. }
  14548. } else {
  14549. var result1 = null;
  14550. pos = savedPos1;
  14551. }
  14552. var result2 = result1 !== null
  14553. ? (function(lits) {
  14554. return smalltalk.ValueNode._new()
  14555. ._value_(lits)
  14556. })(result1[2])
  14557. : null;
  14558. if (result2 !== null) {
  14559. var result0 = result2;
  14560. } else {
  14561. var result0 = null;
  14562. pos = savedPos0;
  14563. }
  14564. cache[cacheKey] = {
  14565. nextPos: pos,
  14566. result: result0
  14567. };
  14568. return result0;
  14569. }
  14570. function parse_dynamicArray() {
  14571. var cacheKey = 'dynamicArray@' + pos;
  14572. var cachedResult = cache[cacheKey];
  14573. if (cachedResult) {
  14574. pos = cachedResult.nextPos;
  14575. return cachedResult.result;
  14576. }
  14577. var savedPos0 = pos;
  14578. var savedPos1 = pos;
  14579. if (input.substr(pos, 1) === "{") {
  14580. var result3 = "{";
  14581. pos += 1;
  14582. } else {
  14583. var result3 = null;
  14584. if (reportMatchFailures) {
  14585. matchFailed("\"{\"");
  14586. }
  14587. }
  14588. if (result3 !== null) {
  14589. var result4 = parse_ws();
  14590. if (result4 !== null) {
  14591. var result8 = parse_expressions();
  14592. var result5 = result8 !== null ? result8 : '';
  14593. if (result5 !== null) {
  14594. var result6 = parse_ws();
  14595. if (result6 !== null) {
  14596. if (input.substr(pos, 1) === "}") {
  14597. var result7 = "}";
  14598. pos += 1;
  14599. } else {
  14600. var result7 = null;
  14601. if (reportMatchFailures) {
  14602. matchFailed("\"}\"");
  14603. }
  14604. }
  14605. if (result7 !== null) {
  14606. var result1 = [result3, result4, result5, result6, result7];
  14607. } else {
  14608. var result1 = null;
  14609. pos = savedPos1;
  14610. }
  14611. } else {
  14612. var result1 = null;
  14613. pos = savedPos1;
  14614. }
  14615. } else {
  14616. var result1 = null;
  14617. pos = savedPos1;
  14618. }
  14619. } else {
  14620. var result1 = null;
  14621. pos = savedPos1;
  14622. }
  14623. } else {
  14624. var result1 = null;
  14625. pos = savedPos1;
  14626. }
  14627. var result2 = result1 !== null
  14628. ? (function(expressions) {
  14629. return smalltalk.DynamicArrayNode._new()
  14630. ._nodes_(expressions)
  14631. })(result1[2])
  14632. : null;
  14633. if (result2 !== null) {
  14634. var result0 = result2;
  14635. } else {
  14636. var result0 = null;
  14637. pos = savedPos0;
  14638. }
  14639. cache[cacheKey] = {
  14640. nextPos: pos,
  14641. result: result0
  14642. };
  14643. return result0;
  14644. }
  14645. function parse_dynamicDictionary() {
  14646. var cacheKey = 'dynamicDictionary@' + pos;
  14647. var cachedResult = cache[cacheKey];
  14648. if (cachedResult) {
  14649. pos = cachedResult.nextPos;
  14650. return cachedResult.result;
  14651. }
  14652. var savedPos0 = pos;
  14653. var savedPos1 = pos;
  14654. if (input.substr(pos, 2) === "#{") {
  14655. var result3 = "#{";
  14656. pos += 2;
  14657. } else {
  14658. var result3 = null;
  14659. if (reportMatchFailures) {
  14660. matchFailed("\"#{\"");
  14661. }
  14662. }
  14663. if (result3 !== null) {
  14664. var result4 = parse_ws();
  14665. if (result4 !== null) {
  14666. var result8 = parse_expressions();
  14667. var result5 = result8 !== null ? result8 : '';
  14668. if (result5 !== null) {
  14669. var result6 = parse_ws();
  14670. if (result6 !== null) {
  14671. if (input.substr(pos, 1) === "}") {
  14672. var result7 = "}";
  14673. pos += 1;
  14674. } else {
  14675. var result7 = null;
  14676. if (reportMatchFailures) {
  14677. matchFailed("\"}\"");
  14678. }
  14679. }
  14680. if (result7 !== null) {
  14681. var result1 = [result3, result4, result5, result6, result7];
  14682. } else {
  14683. var result1 = null;
  14684. pos = savedPos1;
  14685. }
  14686. } else {
  14687. var result1 = null;
  14688. pos = savedPos1;
  14689. }
  14690. } else {
  14691. var result1 = null;
  14692. pos = savedPos1;
  14693. }
  14694. } else {
  14695. var result1 = null;
  14696. pos = savedPos1;
  14697. }
  14698. } else {
  14699. var result1 = null;
  14700. pos = savedPos1;
  14701. }
  14702. var result2 = result1 !== null
  14703. ? (function(expressions) {
  14704. return smalltalk.DynamicDictionaryNode._new()
  14705. ._nodes_(expressions)
  14706. })(result1[2])
  14707. : null;
  14708. if (result2 !== null) {
  14709. var result0 = result2;
  14710. } else {
  14711. var result0 = null;
  14712. pos = savedPos0;
  14713. }
  14714. cache[cacheKey] = {
  14715. nextPos: pos,
  14716. result: result0
  14717. };
  14718. return result0;
  14719. }
  14720. function parse_pseudoVariable() {
  14721. var cacheKey = 'pseudoVariable@' + pos;
  14722. var cachedResult = cache[cacheKey];
  14723. if (cachedResult) {
  14724. pos = cachedResult.nextPos;
  14725. return cachedResult.result;
  14726. }
  14727. var savedPos0 = pos;
  14728. var savedPos3 = pos;
  14729. if (input.substr(pos, 4) === "true") {
  14730. var result10 = "true";
  14731. pos += 4;
  14732. } else {
  14733. var result10 = null;
  14734. if (reportMatchFailures) {
  14735. matchFailed("\"true\"");
  14736. }
  14737. }
  14738. var result11 = result10 !== null
  14739. ? (function() {return true})()
  14740. : null;
  14741. if (result11 !== null) {
  14742. var result9 = result11;
  14743. } else {
  14744. var result9 = null;
  14745. pos = savedPos3;
  14746. }
  14747. if (result9 !== null) {
  14748. var result1 = result9;
  14749. } else {
  14750. var savedPos2 = pos;
  14751. if (input.substr(pos, 5) === "false") {
  14752. var result7 = "false";
  14753. pos += 5;
  14754. } else {
  14755. var result7 = null;
  14756. if (reportMatchFailures) {
  14757. matchFailed("\"false\"");
  14758. }
  14759. }
  14760. var result8 = result7 !== null
  14761. ? (function() {return false})()
  14762. : null;
  14763. if (result8 !== null) {
  14764. var result6 = result8;
  14765. } else {
  14766. var result6 = null;
  14767. pos = savedPos2;
  14768. }
  14769. if (result6 !== null) {
  14770. var result1 = result6;
  14771. } else {
  14772. var savedPos1 = pos;
  14773. if (input.substr(pos, 3) === "nil") {
  14774. var result4 = "nil";
  14775. pos += 3;
  14776. } else {
  14777. var result4 = null;
  14778. if (reportMatchFailures) {
  14779. matchFailed("\"nil\"");
  14780. }
  14781. }
  14782. var result5 = result4 !== null
  14783. ? (function() {return nil})()
  14784. : null;
  14785. if (result5 !== null) {
  14786. var result3 = result5;
  14787. } else {
  14788. var result3 = null;
  14789. pos = savedPos1;
  14790. }
  14791. if (result3 !== null) {
  14792. var result1 = result3;
  14793. } else {
  14794. var result1 = null;;
  14795. };
  14796. };
  14797. }
  14798. var result2 = result1 !== null
  14799. ? (function(val) {
  14800. return smalltalk.ValueNode._new()._value_(val)
  14801. })(result1)
  14802. : null;
  14803. if (result2 !== null) {
  14804. var result0 = result2;
  14805. } else {
  14806. var result0 = null;
  14807. pos = savedPos0;
  14808. }
  14809. cache[cacheKey] = {
  14810. nextPos: pos,
  14811. result: result0
  14812. };
  14813. return result0;
  14814. }
  14815. function parse_literal() {
  14816. var cacheKey = 'literal@' + pos;
  14817. var cachedResult = cache[cacheKey];
  14818. if (cachedResult) {
  14819. pos = cachedResult.nextPos;
  14820. return cachedResult.result;
  14821. }
  14822. var result8 = parse_pseudoVariable();
  14823. if (result8 !== null) {
  14824. var result0 = result8;
  14825. } else {
  14826. var result7 = parse_number();
  14827. if (result7 !== null) {
  14828. var result0 = result7;
  14829. } else {
  14830. var result6 = parse_literalArray();
  14831. if (result6 !== null) {
  14832. var result0 = result6;
  14833. } else {
  14834. var result5 = parse_dynamicDictionary();
  14835. if (result5 !== null) {
  14836. var result0 = result5;
  14837. } else {
  14838. var result4 = parse_dynamicArray();
  14839. if (result4 !== null) {
  14840. var result0 = result4;
  14841. } else {
  14842. var result3 = parse_string();
  14843. if (result3 !== null) {
  14844. var result0 = result3;
  14845. } else {
  14846. var result2 = parse_symbol();
  14847. if (result2 !== null) {
  14848. var result0 = result2;
  14849. } else {
  14850. var result1 = parse_block();
  14851. if (result1 !== null) {
  14852. var result0 = result1;
  14853. } else {
  14854. var result0 = null;;
  14855. };
  14856. };
  14857. };
  14858. };
  14859. };
  14860. };
  14861. };
  14862. }
  14863. cache[cacheKey] = {
  14864. nextPos: pos,
  14865. result: result0
  14866. };
  14867. return result0;
  14868. }
  14869. function parse_variable() {
  14870. var cacheKey = 'variable@' + pos;
  14871. var cachedResult = cache[cacheKey];
  14872. if (cachedResult) {
  14873. pos = cachedResult.nextPos;
  14874. return cachedResult.result;
  14875. }
  14876. var savedPos0 = pos;
  14877. var result1 = parse_varIdentifier();
  14878. var result2 = result1 !== null
  14879. ? (function(identifier) {
  14880. return smalltalk.VariableNode._new()
  14881. ._value_(identifier)
  14882. })(result1)
  14883. : null;
  14884. if (result2 !== null) {
  14885. var result0 = result2;
  14886. } else {
  14887. var result0 = null;
  14888. pos = savedPos0;
  14889. }
  14890. cache[cacheKey] = {
  14891. nextPos: pos,
  14892. result: result0
  14893. };
  14894. return result0;
  14895. }
  14896. function parse_classReference() {
  14897. var cacheKey = 'classReference@' + pos;
  14898. var cachedResult = cache[cacheKey];
  14899. if (cachedResult) {
  14900. pos = cachedResult.nextPos;
  14901. return cachedResult.result;
  14902. }
  14903. var savedPos0 = pos;
  14904. var result1 = parse_className();
  14905. var result2 = result1 !== null
  14906. ? (function(className) {
  14907. return smalltalk.ClassReferenceNode._new()
  14908. ._value_(className)
  14909. })(result1)
  14910. : null;
  14911. if (result2 !== null) {
  14912. var result0 = result2;
  14913. } else {
  14914. var result0 = null;
  14915. pos = savedPos0;
  14916. }
  14917. cache[cacheKey] = {
  14918. nextPos: pos,
  14919. result: result0
  14920. };
  14921. return result0;
  14922. }
  14923. function parse_reference() {
  14924. var cacheKey = 'reference@' + pos;
  14925. var cachedResult = cache[cacheKey];
  14926. if (cachedResult) {
  14927. pos = cachedResult.nextPos;
  14928. return cachedResult.result;
  14929. }
  14930. var result2 = parse_variable();
  14931. if (result2 !== null) {
  14932. var result0 = result2;
  14933. } else {
  14934. var result1 = parse_classReference();
  14935. if (result1 !== null) {
  14936. var result0 = result1;
  14937. } else {
  14938. var result0 = null;;
  14939. };
  14940. }
  14941. cache[cacheKey] = {
  14942. nextPos: pos,
  14943. result: result0
  14944. };
  14945. return result0;
  14946. }
  14947. function parse_keywordPair() {
  14948. var cacheKey = 'keywordPair@' + pos;
  14949. var cachedResult = cache[cacheKey];
  14950. if (cachedResult) {
  14951. pos = cachedResult.nextPos;
  14952. return cachedResult.result;
  14953. }
  14954. var savedPos0 = pos;
  14955. var savedPos1 = pos;
  14956. var result3 = parse_keyword();
  14957. if (result3 !== null) {
  14958. var result4 = parse_ws();
  14959. if (result4 !== null) {
  14960. var result5 = parse_binarySend();
  14961. if (result5 !== null) {
  14962. var result6 = parse_ws();
  14963. if (result6 !== null) {
  14964. var result1 = [result3, result4, result5, result6];
  14965. } else {
  14966. var result1 = null;
  14967. pos = savedPos1;
  14968. }
  14969. } else {
  14970. var result1 = null;
  14971. pos = savedPos1;
  14972. }
  14973. } else {
  14974. var result1 = null;
  14975. pos = savedPos1;
  14976. }
  14977. } else {
  14978. var result1 = null;
  14979. pos = savedPos1;
  14980. }
  14981. var result2 = result1 !== null
  14982. ? (function(key, arg) {return {key:key, arg: arg}})(result1[0], result1[2])
  14983. : null;
  14984. if (result2 !== null) {
  14985. var result0 = result2;
  14986. } else {
  14987. var result0 = null;
  14988. pos = savedPos0;
  14989. }
  14990. cache[cacheKey] = {
  14991. nextPos: pos,
  14992. result: result0
  14993. };
  14994. return result0;
  14995. }
  14996. function parse_binarySelector() {
  14997. var cacheKey = 'binarySelector@' + pos;
  14998. var cachedResult = cache[cacheKey];
  14999. if (cachedResult) {
  15000. pos = cachedResult.nextPos;
  15001. return cachedResult.result;
  15002. }
  15003. var savedPos0 = pos;
  15004. if (input.substr(pos).match(/^[\\+*\/=><,@%~|&\-]/) !== null) {
  15005. var result3 = input.charAt(pos);
  15006. pos++;
  15007. } else {
  15008. var result3 = null;
  15009. if (reportMatchFailures) {
  15010. matchFailed("[\\\\+*\\/=><,@%~|&\\-]");
  15011. }
  15012. }
  15013. if (result3 !== null) {
  15014. var result1 = [];
  15015. while (result3 !== null) {
  15016. result1.push(result3);
  15017. if (input.substr(pos).match(/^[\\+*\/=><,@%~|&\-]/) !== null) {
  15018. var result3 = input.charAt(pos);
  15019. pos++;
  15020. } else {
  15021. var result3 = null;
  15022. if (reportMatchFailures) {
  15023. matchFailed("[\\\\+*\\/=><,@%~|&\\-]");
  15024. }
  15025. }
  15026. }
  15027. } else {
  15028. var result1 = null;
  15029. }
  15030. var result2 = result1 !== null
  15031. ? (function(bin) {return bin.join("").replace(/\\/g, '\\\\')})(result1)
  15032. : null;
  15033. if (result2 !== null) {
  15034. var result0 = result2;
  15035. } else {
  15036. var result0 = null;
  15037. pos = savedPos0;
  15038. }
  15039. cache[cacheKey] = {
  15040. nextPos: pos,
  15041. result: result0
  15042. };
  15043. return result0;
  15044. }
  15045. function parse_keywordPattern() {
  15046. var cacheKey = 'keywordPattern@' + pos;
  15047. var cachedResult = cache[cacheKey];
  15048. if (cachedResult) {
  15049. pos = cachedResult.nextPos;
  15050. return cachedResult.result;
  15051. }
  15052. var savedPos0 = pos;
  15053. var savedPos1 = pos;
  15054. var savedPos2 = pos;
  15055. var result6 = parse_ws();
  15056. if (result6 !== null) {
  15057. var result7 = parse_keyword();
  15058. if (result7 !== null) {
  15059. var result8 = parse_ws();
  15060. if (result8 !== null) {
  15061. var result9 = parse_identifier();
  15062. if (result9 !== null) {
  15063. var result4 = [result6, result7, result8, result9];
  15064. } else {
  15065. var result4 = null;
  15066. pos = savedPos2;
  15067. }
  15068. } else {
  15069. var result4 = null;
  15070. pos = savedPos2;
  15071. }
  15072. } else {
  15073. var result4 = null;
  15074. pos = savedPos2;
  15075. }
  15076. } else {
  15077. var result4 = null;
  15078. pos = savedPos2;
  15079. }
  15080. var result5 = result4 !== null
  15081. ? (function(key, arg) {return {key:key, arg: arg}})(result4[1], result4[3])
  15082. : null;
  15083. if (result5 !== null) {
  15084. var result3 = result5;
  15085. } else {
  15086. var result3 = null;
  15087. pos = savedPos1;
  15088. }
  15089. if (result3 !== null) {
  15090. var result1 = [];
  15091. while (result3 !== null) {
  15092. result1.push(result3);
  15093. var savedPos1 = pos;
  15094. var savedPos2 = pos;
  15095. var result6 = parse_ws();
  15096. if (result6 !== null) {
  15097. var result7 = parse_keyword();
  15098. if (result7 !== null) {
  15099. var result8 = parse_ws();
  15100. if (result8 !== null) {
  15101. var result9 = parse_identifier();
  15102. if (result9 !== null) {
  15103. var result4 = [result6, result7, result8, result9];
  15104. } else {
  15105. var result4 = null;
  15106. pos = savedPos2;
  15107. }
  15108. } else {
  15109. var result4 = null;
  15110. pos = savedPos2;
  15111. }
  15112. } else {
  15113. var result4 = null;
  15114. pos = savedPos2;
  15115. }
  15116. } else {
  15117. var result4 = null;
  15118. pos = savedPos2;
  15119. }
  15120. var result5 = result4 !== null
  15121. ? (function(key, arg) {return {key:key, arg: arg}})(result4[1], result4[3])
  15122. : null;
  15123. if (result5 !== null) {
  15124. var result3 = result5;
  15125. } else {
  15126. var result3 = null;
  15127. pos = savedPos1;
  15128. }
  15129. }
  15130. } else {
  15131. var result1 = null;
  15132. }
  15133. var result2 = result1 !== null
  15134. ? (function(pairs) {
  15135. var keywords = [];
  15136. var params = [];
  15137. for(var i=0;i<pairs.length;i++){
  15138. keywords.push(pairs[i].key);
  15139. }
  15140. for(var i=0;i<pairs.length;i++){
  15141. params.push(pairs[i].arg);
  15142. }
  15143. return [keywords.join(""), params]
  15144. })(result1)
  15145. : null;
  15146. if (result2 !== null) {
  15147. var result0 = result2;
  15148. } else {
  15149. var result0 = null;
  15150. pos = savedPos0;
  15151. }
  15152. cache[cacheKey] = {
  15153. nextPos: pos,
  15154. result: result0
  15155. };
  15156. return result0;
  15157. }
  15158. function parse_binaryPattern() {
  15159. var cacheKey = 'binaryPattern@' + pos;
  15160. var cachedResult = cache[cacheKey];
  15161. if (cachedResult) {
  15162. pos = cachedResult.nextPos;
  15163. return cachedResult.result;
  15164. }
  15165. var savedPos0 = pos;
  15166. var savedPos1 = pos;
  15167. var result3 = parse_ws();
  15168. if (result3 !== null) {
  15169. var result4 = parse_binarySelector();
  15170. if (result4 !== null) {
  15171. var result5 = parse_ws();
  15172. if (result5 !== null) {
  15173. var result6 = parse_identifier();
  15174. if (result6 !== null) {
  15175. var result1 = [result3, result4, result5, result6];
  15176. } else {
  15177. var result1 = null;
  15178. pos = savedPos1;
  15179. }
  15180. } else {
  15181. var result1 = null;
  15182. pos = savedPos1;
  15183. }
  15184. } else {
  15185. var result1 = null;
  15186. pos = savedPos1;
  15187. }
  15188. } else {
  15189. var result1 = null;
  15190. pos = savedPos1;
  15191. }
  15192. var result2 = result1 !== null
  15193. ? (function(selector, arg) {return [selector, [arg]]})(result1[1], result1[3])
  15194. : null;
  15195. if (result2 !== null) {
  15196. var result0 = result2;
  15197. } else {
  15198. var result0 = null;
  15199. pos = savedPos0;
  15200. }
  15201. cache[cacheKey] = {
  15202. nextPos: pos,
  15203. result: result0
  15204. };
  15205. return result0;
  15206. }
  15207. function parse_unaryPattern() {
  15208. var cacheKey = 'unaryPattern@' + pos;
  15209. var cachedResult = cache[cacheKey];
  15210. if (cachedResult) {
  15211. pos = cachedResult.nextPos;
  15212. return cachedResult.result;
  15213. }
  15214. var savedPos0 = pos;
  15215. var savedPos1 = pos;
  15216. var result3 = parse_ws();
  15217. if (result3 !== null) {
  15218. var result4 = parse_identifier();
  15219. if (result4 !== null) {
  15220. var result1 = [result3, result4];
  15221. } else {
  15222. var result1 = null;
  15223. pos = savedPos1;
  15224. }
  15225. } else {
  15226. var result1 = null;
  15227. pos = savedPos1;
  15228. }
  15229. var result2 = result1 !== null
  15230. ? (function(selector) {return [selector, []]})(result1[1])
  15231. : null;
  15232. if (result2 !== null) {
  15233. var result0 = result2;
  15234. } else {
  15235. var result0 = null;
  15236. pos = savedPos0;
  15237. }
  15238. cache[cacheKey] = {
  15239. nextPos: pos,
  15240. result: result0
  15241. };
  15242. return result0;
  15243. }
  15244. function parse_expression() {
  15245. var cacheKey = 'expression@' + pos;
  15246. var cachedResult = cache[cacheKey];
  15247. if (cachedResult) {
  15248. pos = cachedResult.nextPos;
  15249. return cachedResult.result;
  15250. }
  15251. var result5 = parse_assignment();
  15252. if (result5 !== null) {
  15253. var result0 = result5;
  15254. } else {
  15255. var result4 = parse_cascade();
  15256. if (result4 !== null) {
  15257. var result0 = result4;
  15258. } else {
  15259. var result3 = parse_keywordSend();
  15260. if (result3 !== null) {
  15261. var result0 = result3;
  15262. } else {
  15263. var result2 = parse_binarySend();
  15264. if (result2 !== null) {
  15265. var result0 = result2;
  15266. } else {
  15267. var result1 = parse_jsStatement();
  15268. if (result1 !== null) {
  15269. var result0 = result1;
  15270. } else {
  15271. var result0 = null;;
  15272. };
  15273. };
  15274. };
  15275. };
  15276. }
  15277. cache[cacheKey] = {
  15278. nextPos: pos,
  15279. result: result0
  15280. };
  15281. return result0;
  15282. }
  15283. function parse_expressionList() {
  15284. var cacheKey = 'expressionList@' + pos;
  15285. var cachedResult = cache[cacheKey];
  15286. if (cachedResult) {
  15287. pos = cachedResult.nextPos;
  15288. return cachedResult.result;
  15289. }
  15290. var savedPos0 = pos;
  15291. var savedPos1 = pos;
  15292. var result3 = parse_ws();
  15293. if (result3 !== null) {
  15294. if (input.substr(pos, 1) === ".") {
  15295. var result4 = ".";
  15296. pos += 1;
  15297. } else {
  15298. var result4 = null;
  15299. if (reportMatchFailures) {
  15300. matchFailed("\".\"");
  15301. }
  15302. }
  15303. if (result4 !== null) {
  15304. var result5 = parse_ws();
  15305. if (result5 !== null) {
  15306. var result6 = parse_expression();
  15307. if (result6 !== null) {
  15308. var result1 = [result3, result4, result5, result6];
  15309. } else {
  15310. var result1 = null;
  15311. pos = savedPos1;
  15312. }
  15313. } else {
  15314. var result1 = null;
  15315. pos = savedPos1;
  15316. }
  15317. } else {
  15318. var result1 = null;
  15319. pos = savedPos1;
  15320. }
  15321. } else {
  15322. var result1 = null;
  15323. pos = savedPos1;
  15324. }
  15325. var result2 = result1 !== null
  15326. ? (function(expression) {return expression})(result1[3])
  15327. : null;
  15328. if (result2 !== null) {
  15329. var result0 = result2;
  15330. } else {
  15331. var result0 = null;
  15332. pos = savedPos0;
  15333. }
  15334. cache[cacheKey] = {
  15335. nextPos: pos,
  15336. result: result0
  15337. };
  15338. return result0;
  15339. }
  15340. function parse_expressions() {
  15341. var cacheKey = 'expressions@' + pos;
  15342. var cachedResult = cache[cacheKey];
  15343. if (cachedResult) {
  15344. pos = cachedResult.nextPos;
  15345. return cachedResult.result;
  15346. }
  15347. var savedPos0 = pos;
  15348. var savedPos1 = pos;
  15349. var result3 = parse_expression();
  15350. if (result3 !== null) {
  15351. var result4 = [];
  15352. var result5 = parse_expressionList();
  15353. while (result5 !== null) {
  15354. result4.push(result5);
  15355. var result5 = parse_expressionList();
  15356. }
  15357. if (result4 !== null) {
  15358. var result1 = [result3, result4];
  15359. } else {
  15360. var result1 = null;
  15361. pos = savedPos1;
  15362. }
  15363. } else {
  15364. var result1 = null;
  15365. pos = savedPos1;
  15366. }
  15367. var result2 = result1 !== null
  15368. ? (function(first, others) {
  15369. var result = [first];
  15370. for(var i=0;i<others.length;i++) {
  15371. result.push(others[i]);
  15372. }
  15373. return result;
  15374. })(result1[0], result1[1])
  15375. : null;
  15376. if (result2 !== null) {
  15377. var result0 = result2;
  15378. } else {
  15379. var result0 = null;
  15380. pos = savedPos0;
  15381. }
  15382. cache[cacheKey] = {
  15383. nextPos: pos,
  15384. result: result0
  15385. };
  15386. return result0;
  15387. }
  15388. function parse_assignment() {
  15389. var cacheKey = 'assignment@' + pos;
  15390. var cachedResult = cache[cacheKey];
  15391. if (cachedResult) {
  15392. pos = cachedResult.nextPos;
  15393. return cachedResult.result;
  15394. }
  15395. var savedPos0 = pos;
  15396. var savedPos1 = pos;
  15397. var result3 = parse_variable();
  15398. if (result3 !== null) {
  15399. var result4 = parse_ws();
  15400. if (result4 !== null) {
  15401. if (input.substr(pos, 2) === ":=") {
  15402. var result5 = ":=";
  15403. pos += 2;
  15404. } else {
  15405. var result5 = null;
  15406. if (reportMatchFailures) {
  15407. matchFailed("\":=\"");
  15408. }
  15409. }
  15410. if (result5 !== null) {
  15411. var result6 = parse_ws();
  15412. if (result6 !== null) {
  15413. var result7 = parse_expression();
  15414. if (result7 !== null) {
  15415. var result1 = [result3, result4, result5, result6, result7];
  15416. } else {
  15417. var result1 = null;
  15418. pos = savedPos1;
  15419. }
  15420. } else {
  15421. var result1 = null;
  15422. pos = savedPos1;
  15423. }
  15424. } else {
  15425. var result1 = null;
  15426. pos = savedPos1;
  15427. }
  15428. } else {
  15429. var result1 = null;
  15430. pos = savedPos1;
  15431. }
  15432. } else {
  15433. var result1 = null;
  15434. pos = savedPos1;
  15435. }
  15436. var result2 = result1 !== null
  15437. ? (function(variable, expression) {
  15438. return smalltalk.AssignmentNode._new()
  15439. ._left_(variable)
  15440. ._right_(expression)
  15441. })(result1[0], result1[4])
  15442. : null;
  15443. if (result2 !== null) {
  15444. var result0 = result2;
  15445. } else {
  15446. var result0 = null;
  15447. pos = savedPos0;
  15448. }
  15449. cache[cacheKey] = {
  15450. nextPos: pos,
  15451. result: result0
  15452. };
  15453. return result0;
  15454. }
  15455. function parse_ret() {
  15456. var cacheKey = 'ret@' + pos;
  15457. var cachedResult = cache[cacheKey];
  15458. if (cachedResult) {
  15459. pos = cachedResult.nextPos;
  15460. return cachedResult.result;
  15461. }
  15462. var savedPos0 = pos;
  15463. var savedPos1 = pos;
  15464. if (input.substr(pos, 1) === "^") {
  15465. var result3 = "^";
  15466. pos += 1;
  15467. } else {
  15468. var result3 = null;
  15469. if (reportMatchFailures) {
  15470. matchFailed("\"^\"");
  15471. }
  15472. }
  15473. if (result3 !== null) {
  15474. var result4 = parse_ws();
  15475. if (result4 !== null) {
  15476. var result5 = parse_expression();
  15477. if (result5 !== null) {
  15478. var result6 = parse_ws();
  15479. if (result6 !== null) {
  15480. if (input.substr(pos, 1) === ".") {
  15481. var result8 = ".";
  15482. pos += 1;
  15483. } else {
  15484. var result8 = null;
  15485. if (reportMatchFailures) {
  15486. matchFailed("\".\"");
  15487. }
  15488. }
  15489. var result7 = result8 !== null ? result8 : '';
  15490. if (result7 !== null) {
  15491. var result1 = [result3, result4, result5, result6, result7];
  15492. } else {
  15493. var result1 = null;
  15494. pos = savedPos1;
  15495. }
  15496. } else {
  15497. var result1 = null;
  15498. pos = savedPos1;
  15499. }
  15500. } else {
  15501. var result1 = null;
  15502. pos = savedPos1;
  15503. }
  15504. } else {
  15505. var result1 = null;
  15506. pos = savedPos1;
  15507. }
  15508. } else {
  15509. var result1 = null;
  15510. pos = savedPos1;
  15511. }
  15512. var result2 = result1 !== null
  15513. ? (function(expression) {
  15514. return smalltalk.ReturnNode._new()
  15515. ._nodes_([expression])
  15516. })(result1[2])
  15517. : null;
  15518. if (result2 !== null) {
  15519. var result0 = result2;
  15520. } else {
  15521. var result0 = null;
  15522. pos = savedPos0;
  15523. }
  15524. cache[cacheKey] = {
  15525. nextPos: pos,
  15526. result: result0
  15527. };
  15528. return result0;
  15529. }
  15530. function parse_temps() {
  15531. var cacheKey = 'temps@' + pos;
  15532. var cachedResult = cache[cacheKey];
  15533. if (cachedResult) {
  15534. pos = cachedResult.nextPos;
  15535. return cachedResult.result;
  15536. }
  15537. var savedPos0 = pos;
  15538. var savedPos1 = pos;
  15539. if (input.substr(pos, 1) === "|") {
  15540. var result3 = "|";
  15541. pos += 1;
  15542. } else {
  15543. var result3 = null;
  15544. if (reportMatchFailures) {
  15545. matchFailed("\"|\"");
  15546. }
  15547. }
  15548. if (result3 !== null) {
  15549. var result4 = [];
  15550. var savedPos2 = pos;
  15551. var savedPos3 = pos;
  15552. var result9 = parse_ws();
  15553. if (result9 !== null) {
  15554. var result10 = parse_identifier();
  15555. if (result10 !== null) {
  15556. var result11 = parse_ws();
  15557. if (result11 !== null) {
  15558. var result7 = [result9, result10, result11];
  15559. } else {
  15560. var result7 = null;
  15561. pos = savedPos3;
  15562. }
  15563. } else {
  15564. var result7 = null;
  15565. pos = savedPos3;
  15566. }
  15567. } else {
  15568. var result7 = null;
  15569. pos = savedPos3;
  15570. }
  15571. var result8 = result7 !== null
  15572. ? (function(variable) {return variable})(result7[1])
  15573. : null;
  15574. if (result8 !== null) {
  15575. var result6 = result8;
  15576. } else {
  15577. var result6 = null;
  15578. pos = savedPos2;
  15579. }
  15580. while (result6 !== null) {
  15581. result4.push(result6);
  15582. var savedPos2 = pos;
  15583. var savedPos3 = pos;
  15584. var result9 = parse_ws();
  15585. if (result9 !== null) {
  15586. var result10 = parse_identifier();
  15587. if (result10 !== null) {
  15588. var result11 = parse_ws();
  15589. if (result11 !== null) {
  15590. var result7 = [result9, result10, result11];
  15591. } else {
  15592. var result7 = null;
  15593. pos = savedPos3;
  15594. }
  15595. } else {
  15596. var result7 = null;
  15597. pos = savedPos3;
  15598. }
  15599. } else {
  15600. var result7 = null;
  15601. pos = savedPos3;
  15602. }
  15603. var result8 = result7 !== null
  15604. ? (function(variable) {return variable})(result7[1])
  15605. : null;
  15606. if (result8 !== null) {
  15607. var result6 = result8;
  15608. } else {
  15609. var result6 = null;
  15610. pos = savedPos2;
  15611. }
  15612. }
  15613. if (result4 !== null) {
  15614. if (input.substr(pos, 1) === "|") {
  15615. var result5 = "|";
  15616. pos += 1;
  15617. } else {
  15618. var result5 = null;
  15619. if (reportMatchFailures) {
  15620. matchFailed("\"|\"");
  15621. }
  15622. }
  15623. if (result5 !== null) {
  15624. var result1 = [result3, result4, result5];
  15625. } else {
  15626. var result1 = null;
  15627. pos = savedPos1;
  15628. }
  15629. } else {
  15630. var result1 = null;
  15631. pos = savedPos1;
  15632. }
  15633. } else {
  15634. var result1 = null;
  15635. pos = savedPos1;
  15636. }
  15637. var result2 = result1 !== null
  15638. ? (function(vars) {return vars})(result1[1])
  15639. : null;
  15640. if (result2 !== null) {
  15641. var result0 = result2;
  15642. } else {
  15643. var result0 = null;
  15644. pos = savedPos0;
  15645. }
  15646. cache[cacheKey] = {
  15647. nextPos: pos,
  15648. result: result0
  15649. };
  15650. return result0;
  15651. }
  15652. function parse_blockParamList() {
  15653. var cacheKey = 'blockParamList@' + pos;
  15654. var cachedResult = cache[cacheKey];
  15655. if (cachedResult) {
  15656. pos = cachedResult.nextPos;
  15657. return cachedResult.result;
  15658. }
  15659. var savedPos0 = pos;
  15660. var savedPos1 = pos;
  15661. var savedPos2 = pos;
  15662. var savedPos3 = pos;
  15663. var result9 = parse_ws();
  15664. if (result9 !== null) {
  15665. if (input.substr(pos, 1) === ":") {
  15666. var result10 = ":";
  15667. pos += 1;
  15668. } else {
  15669. var result10 = null;
  15670. if (reportMatchFailures) {
  15671. matchFailed("\":\"");
  15672. }
  15673. }
  15674. if (result10 !== null) {
  15675. var result11 = parse_ws();
  15676. if (result11 !== null) {
  15677. var result12 = parse_identifier();
  15678. if (result12 !== null) {
  15679. var result7 = [result9, result10, result11, result12];
  15680. } else {
  15681. var result7 = null;
  15682. pos = savedPos3;
  15683. }
  15684. } else {
  15685. var result7 = null;
  15686. pos = savedPos3;
  15687. }
  15688. } else {
  15689. var result7 = null;
  15690. pos = savedPos3;
  15691. }
  15692. } else {
  15693. var result7 = null;
  15694. pos = savedPos3;
  15695. }
  15696. var result8 = result7 !== null
  15697. ? (function(param) {return param})(result7[3])
  15698. : null;
  15699. if (result8 !== null) {
  15700. var result6 = result8;
  15701. } else {
  15702. var result6 = null;
  15703. pos = savedPos2;
  15704. }
  15705. if (result6 !== null) {
  15706. var result3 = [];
  15707. while (result6 !== null) {
  15708. result3.push(result6);
  15709. var savedPos2 = pos;
  15710. var savedPos3 = pos;
  15711. var result9 = parse_ws();
  15712. if (result9 !== null) {
  15713. if (input.substr(pos, 1) === ":") {
  15714. var result10 = ":";
  15715. pos += 1;
  15716. } else {
  15717. var result10 = null;
  15718. if (reportMatchFailures) {
  15719. matchFailed("\":\"");
  15720. }
  15721. }
  15722. if (result10 !== null) {
  15723. var result11 = parse_ws();
  15724. if (result11 !== null) {
  15725. var result12 = parse_identifier();
  15726. if (result12 !== null) {
  15727. var result7 = [result9, result10, result11, result12];
  15728. } else {
  15729. var result7 = null;
  15730. pos = savedPos3;
  15731. }
  15732. } else {
  15733. var result7 = null;
  15734. pos = savedPos3;
  15735. }
  15736. } else {
  15737. var result7 = null;
  15738. pos = savedPos3;
  15739. }
  15740. } else {
  15741. var result7 = null;
  15742. pos = savedPos3;
  15743. }
  15744. var result8 = result7 !== null
  15745. ? (function(param) {return param})(result7[3])
  15746. : null;
  15747. if (result8 !== null) {
  15748. var result6 = result8;
  15749. } else {
  15750. var result6 = null;
  15751. pos = savedPos2;
  15752. }
  15753. }
  15754. } else {
  15755. var result3 = null;
  15756. }
  15757. if (result3 !== null) {
  15758. var result4 = parse_ws();
  15759. if (result4 !== null) {
  15760. if (input.substr(pos, 1) === "|") {
  15761. var result5 = "|";
  15762. pos += 1;
  15763. } else {
  15764. var result5 = null;
  15765. if (reportMatchFailures) {
  15766. matchFailed("\"|\"");
  15767. }
  15768. }
  15769. if (result5 !== null) {
  15770. var result1 = [result3, result4, result5];
  15771. } else {
  15772. var result1 = null;
  15773. pos = savedPos1;
  15774. }
  15775. } else {
  15776. var result1 = null;
  15777. pos = savedPos1;
  15778. }
  15779. } else {
  15780. var result1 = null;
  15781. pos = savedPos1;
  15782. }
  15783. var result2 = result1 !== null
  15784. ? (function(params) {return params})(result1[0])
  15785. : null;
  15786. if (result2 !== null) {
  15787. var result0 = result2;
  15788. } else {
  15789. var result0 = null;
  15790. pos = savedPos0;
  15791. }
  15792. cache[cacheKey] = {
  15793. nextPos: pos,
  15794. result: result0
  15795. };
  15796. return result0;
  15797. }
  15798. function parse_subexpression() {
  15799. var cacheKey = 'subexpression@' + pos;
  15800. var cachedResult = cache[cacheKey];
  15801. if (cachedResult) {
  15802. pos = cachedResult.nextPos;
  15803. return cachedResult.result;
  15804. }
  15805. var savedPos0 = pos;
  15806. var savedPos1 = pos;
  15807. if (input.substr(pos, 1) === "(") {
  15808. var result3 = "(";
  15809. pos += 1;
  15810. } else {
  15811. var result3 = null;
  15812. if (reportMatchFailures) {
  15813. matchFailed("\"(\"");
  15814. }
  15815. }
  15816. if (result3 !== null) {
  15817. var result4 = parse_ws();
  15818. if (result4 !== null) {
  15819. var result5 = parse_expression();
  15820. if (result5 !== null) {
  15821. var result6 = parse_ws();
  15822. if (result6 !== null) {
  15823. if (input.substr(pos, 1) === ")") {
  15824. var result7 = ")";
  15825. pos += 1;
  15826. } else {
  15827. var result7 = null;
  15828. if (reportMatchFailures) {
  15829. matchFailed("\")\"");
  15830. }
  15831. }
  15832. if (result7 !== null) {
  15833. var result1 = [result3, result4, result5, result6, result7];
  15834. } else {
  15835. var result1 = null;
  15836. pos = savedPos1;
  15837. }
  15838. } else {
  15839. var result1 = null;
  15840. pos = savedPos1;
  15841. }
  15842. } else {
  15843. var result1 = null;
  15844. pos = savedPos1;
  15845. }
  15846. } else {
  15847. var result1 = null;
  15848. pos = savedPos1;
  15849. }
  15850. } else {
  15851. var result1 = null;
  15852. pos = savedPos1;
  15853. }
  15854. var result2 = result1 !== null
  15855. ? (function(expression) {return expression})(result1[2])
  15856. : null;
  15857. if (result2 !== null) {
  15858. var result0 = result2;
  15859. } else {
  15860. var result0 = null;
  15861. pos = savedPos0;
  15862. }
  15863. cache[cacheKey] = {
  15864. nextPos: pos,
  15865. result: result0
  15866. };
  15867. return result0;
  15868. }
  15869. function parse_statements() {
  15870. var cacheKey = 'statements@' + pos;
  15871. var cachedResult = cache[cacheKey];
  15872. if (cachedResult) {
  15873. pos = cachedResult.nextPos;
  15874. return cachedResult.result;
  15875. }
  15876. var savedPos4 = pos;
  15877. var savedPos5 = pos;
  15878. var result22 = parse_ret();
  15879. if (result22 !== null) {
  15880. var result23 = [];
  15881. if (input.substr(pos).match(/^[.]/) !== null) {
  15882. var result24 = input.charAt(pos);
  15883. pos++;
  15884. } else {
  15885. var result24 = null;
  15886. if (reportMatchFailures) {
  15887. matchFailed("[.]");
  15888. }
  15889. }
  15890. while (result24 !== null) {
  15891. result23.push(result24);
  15892. if (input.substr(pos).match(/^[.]/) !== null) {
  15893. var result24 = input.charAt(pos);
  15894. pos++;
  15895. } else {
  15896. var result24 = null;
  15897. if (reportMatchFailures) {
  15898. matchFailed("[.]");
  15899. }
  15900. }
  15901. }
  15902. if (result23 !== null) {
  15903. var result20 = [result22, result23];
  15904. } else {
  15905. var result20 = null;
  15906. pos = savedPos5;
  15907. }
  15908. } else {
  15909. var result20 = null;
  15910. pos = savedPos5;
  15911. }
  15912. var result21 = result20 !== null
  15913. ? (function(ret) {return [ret]})(result20[0])
  15914. : null;
  15915. if (result21 !== null) {
  15916. var result19 = result21;
  15917. } else {
  15918. var result19 = null;
  15919. pos = savedPos4;
  15920. }
  15921. if (result19 !== null) {
  15922. var result0 = result19;
  15923. } else {
  15924. var savedPos2 = pos;
  15925. var savedPos3 = pos;
  15926. var result11 = parse_expressions();
  15927. if (result11 !== null) {
  15928. var result12 = parse_ws();
  15929. if (result12 !== null) {
  15930. if (input.substr(pos).match(/^[.]/) !== null) {
  15931. var result18 = input.charAt(pos);
  15932. pos++;
  15933. } else {
  15934. var result18 = null;
  15935. if (reportMatchFailures) {
  15936. matchFailed("[.]");
  15937. }
  15938. }
  15939. if (result18 !== null) {
  15940. var result13 = [];
  15941. while (result18 !== null) {
  15942. result13.push(result18);
  15943. if (input.substr(pos).match(/^[.]/) !== null) {
  15944. var result18 = input.charAt(pos);
  15945. pos++;
  15946. } else {
  15947. var result18 = null;
  15948. if (reportMatchFailures) {
  15949. matchFailed("[.]");
  15950. }
  15951. }
  15952. }
  15953. } else {
  15954. var result13 = null;
  15955. }
  15956. if (result13 !== null) {
  15957. var result14 = parse_ws();
  15958. if (result14 !== null) {
  15959. var result15 = parse_ret();
  15960. if (result15 !== null) {
  15961. var result16 = [];
  15962. if (input.substr(pos).match(/^[.]/) !== null) {
  15963. var result17 = input.charAt(pos);
  15964. pos++;
  15965. } else {
  15966. var result17 = null;
  15967. if (reportMatchFailures) {
  15968. matchFailed("[.]");
  15969. }
  15970. }
  15971. while (result17 !== null) {
  15972. result16.push(result17);
  15973. if (input.substr(pos).match(/^[.]/) !== null) {
  15974. var result17 = input.charAt(pos);
  15975. pos++;
  15976. } else {
  15977. var result17 = null;
  15978. if (reportMatchFailures) {
  15979. matchFailed("[.]");
  15980. }
  15981. }
  15982. }
  15983. if (result16 !== null) {
  15984. var result9 = [result11, result12, result13, result14, result15, result16];
  15985. } else {
  15986. var result9 = null;
  15987. pos = savedPos3;
  15988. }
  15989. } else {
  15990. var result9 = null;
  15991. pos = savedPos3;
  15992. }
  15993. } else {
  15994. var result9 = null;
  15995. pos = savedPos3;
  15996. }
  15997. } else {
  15998. var result9 = null;
  15999. pos = savedPos3;
  16000. }
  16001. } else {
  16002. var result9 = null;
  16003. pos = savedPos3;
  16004. }
  16005. } else {
  16006. var result9 = null;
  16007. pos = savedPos3;
  16008. }
  16009. var result10 = result9 !== null
  16010. ? (function(exps, ret) {
  16011. var expressions = exps;
  16012. expressions.push(ret);
  16013. return expressions
  16014. })(result9[0], result9[4])
  16015. : null;
  16016. if (result10 !== null) {
  16017. var result8 = result10;
  16018. } else {
  16019. var result8 = null;
  16020. pos = savedPos2;
  16021. }
  16022. if (result8 !== null) {
  16023. var result0 = result8;
  16024. } else {
  16025. var savedPos0 = pos;
  16026. var savedPos1 = pos;
  16027. var result7 = parse_expressions();
  16028. var result4 = result7 !== null ? result7 : '';
  16029. if (result4 !== null) {
  16030. var result5 = [];
  16031. if (input.substr(pos).match(/^[.]/) !== null) {
  16032. var result6 = input.charAt(pos);
  16033. pos++;
  16034. } else {
  16035. var result6 = null;
  16036. if (reportMatchFailures) {
  16037. matchFailed("[.]");
  16038. }
  16039. }
  16040. while (result6 !== null) {
  16041. result5.push(result6);
  16042. if (input.substr(pos).match(/^[.]/) !== null) {
  16043. var result6 = input.charAt(pos);
  16044. pos++;
  16045. } else {
  16046. var result6 = null;
  16047. if (reportMatchFailures) {
  16048. matchFailed("[.]");
  16049. }
  16050. }
  16051. }
  16052. if (result5 !== null) {
  16053. var result2 = [result4, result5];
  16054. } else {
  16055. var result2 = null;
  16056. pos = savedPos1;
  16057. }
  16058. } else {
  16059. var result2 = null;
  16060. pos = savedPos1;
  16061. }
  16062. var result3 = result2 !== null
  16063. ? (function(expressions) {
  16064. return expressions || []
  16065. })(result2[0])
  16066. : null;
  16067. if (result3 !== null) {
  16068. var result1 = result3;
  16069. } else {
  16070. var result1 = null;
  16071. pos = savedPos0;
  16072. }
  16073. if (result1 !== null) {
  16074. var result0 = result1;
  16075. } else {
  16076. var result0 = null;;
  16077. };
  16078. };
  16079. }
  16080. cache[cacheKey] = {
  16081. nextPos: pos,
  16082. result: result0
  16083. };
  16084. return result0;
  16085. }
  16086. function parse_sequence() {
  16087. var cacheKey = 'sequence@' + pos;
  16088. var cachedResult = cache[cacheKey];
  16089. if (cachedResult) {
  16090. pos = cachedResult.nextPos;
  16091. return cachedResult.result;
  16092. }
  16093. var savedPos0 = pos;
  16094. var savedPos1 = pos;
  16095. var result8 = parse_temps();
  16096. var result3 = result8 !== null ? result8 : '';
  16097. if (result3 !== null) {
  16098. var result4 = parse_ws();
  16099. if (result4 !== null) {
  16100. var result7 = parse_statements();
  16101. var result5 = result7 !== null ? result7 : '';
  16102. if (result5 !== null) {
  16103. var result6 = parse_ws();
  16104. if (result6 !== null) {
  16105. var result1 = [result3, result4, result5, result6];
  16106. } else {
  16107. var result1 = null;
  16108. pos = savedPos1;
  16109. }
  16110. } else {
  16111. var result1 = null;
  16112. pos = savedPos1;
  16113. }
  16114. } else {
  16115. var result1 = null;
  16116. pos = savedPos1;
  16117. }
  16118. } else {
  16119. var result1 = null;
  16120. pos = savedPos1;
  16121. }
  16122. var result2 = result1 !== null
  16123. ? (function(temps, statements) {
  16124. return smalltalk.SequenceNode._new()
  16125. ._temps_(temps || [])
  16126. ._nodes_(statements || [])
  16127. })(result1[0], result1[2])
  16128. : null;
  16129. if (result2 !== null) {
  16130. var result0 = result2;
  16131. } else {
  16132. var result0 = null;
  16133. pos = savedPos0;
  16134. }
  16135. cache[cacheKey] = {
  16136. nextPos: pos,
  16137. result: result0
  16138. };
  16139. return result0;
  16140. }
  16141. function parse_block() {
  16142. var cacheKey = 'block@' + pos;
  16143. var cachedResult = cache[cacheKey];
  16144. if (cachedResult) {
  16145. pos = cachedResult.nextPos;
  16146. return cachedResult.result;
  16147. }
  16148. var savedPos0 = pos;
  16149. var savedPos1 = pos;
  16150. if (input.substr(pos, 1) === "[") {
  16151. var result3 = "[";
  16152. pos += 1;
  16153. } else {
  16154. var result3 = null;
  16155. if (reportMatchFailures) {
  16156. matchFailed("\"[\"");
  16157. }
  16158. }
  16159. if (result3 !== null) {
  16160. var result4 = parse_ws();
  16161. if (result4 !== null) {
  16162. var result11 = parse_blockParamList();
  16163. var result5 = result11 !== null ? result11 : '';
  16164. if (result5 !== null) {
  16165. var result6 = parse_ws();
  16166. if (result6 !== null) {
  16167. var result10 = parse_sequence();
  16168. var result7 = result10 !== null ? result10 : '';
  16169. if (result7 !== null) {
  16170. var result8 = parse_ws();
  16171. if (result8 !== null) {
  16172. if (input.substr(pos, 1) === "]") {
  16173. var result9 = "]";
  16174. pos += 1;
  16175. } else {
  16176. var result9 = null;
  16177. if (reportMatchFailures) {
  16178. matchFailed("\"]\"");
  16179. }
  16180. }
  16181. if (result9 !== null) {
  16182. var result1 = [result3, result4, result5, result6, result7, result8, result9];
  16183. } else {
  16184. var result1 = null;
  16185. pos = savedPos1;
  16186. }
  16187. } else {
  16188. var result1 = null;
  16189. pos = savedPos1;
  16190. }
  16191. } else {
  16192. var result1 = null;
  16193. pos = savedPos1;
  16194. }
  16195. } else {
  16196. var result1 = null;
  16197. pos = savedPos1;
  16198. }
  16199. } else {
  16200. var result1 = null;
  16201. pos = savedPos1;
  16202. }
  16203. } else {
  16204. var result1 = null;
  16205. pos = savedPos1;
  16206. }
  16207. } else {
  16208. var result1 = null;
  16209. pos = savedPos1;
  16210. }
  16211. var result2 = result1 !== null
  16212. ? (function(params, sequence) {
  16213. return smalltalk.BlockNode._new()
  16214. ._parameters_(params || [])
  16215. ._nodes_([sequence._asBlockSequenceNode()])
  16216. })(result1[2], result1[4])
  16217. : null;
  16218. if (result2 !== null) {
  16219. var result0 = result2;
  16220. } else {
  16221. var result0 = null;
  16222. pos = savedPos0;
  16223. }
  16224. cache[cacheKey] = {
  16225. nextPos: pos,
  16226. result: result0
  16227. };
  16228. return result0;
  16229. }
  16230. function parse_operand() {
  16231. var cacheKey = 'operand@' + pos;
  16232. var cachedResult = cache[cacheKey];
  16233. if (cachedResult) {
  16234. pos = cachedResult.nextPos;
  16235. return cachedResult.result;
  16236. }
  16237. var result3 = parse_literal();
  16238. if (result3 !== null) {
  16239. var result0 = result3;
  16240. } else {
  16241. var result2 = parse_reference();
  16242. if (result2 !== null) {
  16243. var result0 = result2;
  16244. } else {
  16245. var result1 = parse_subexpression();
  16246. if (result1 !== null) {
  16247. var result0 = result1;
  16248. } else {
  16249. var result0 = null;;
  16250. };
  16251. };
  16252. }
  16253. cache[cacheKey] = {
  16254. nextPos: pos,
  16255. result: result0
  16256. };
  16257. return result0;
  16258. }
  16259. function parse_unaryMessage() {
  16260. var cacheKey = 'unaryMessage@' + pos;
  16261. var cachedResult = cache[cacheKey];
  16262. if (cachedResult) {
  16263. pos = cachedResult.nextPos;
  16264. return cachedResult.result;
  16265. }
  16266. var savedPos0 = pos;
  16267. var savedPos1 = pos;
  16268. var result3 = parse_ws();
  16269. if (result3 !== null) {
  16270. var result4 = parse_identifier();
  16271. if (result4 !== null) {
  16272. var savedPos2 = pos;
  16273. var savedReportMatchFailuresVar0 = reportMatchFailures;
  16274. reportMatchFailures = false;
  16275. if (input.substr(pos).match(/^[:]/) !== null) {
  16276. var result6 = input.charAt(pos);
  16277. pos++;
  16278. } else {
  16279. var result6 = null;
  16280. if (reportMatchFailures) {
  16281. matchFailed("[:]");
  16282. }
  16283. }
  16284. reportMatchFailures = savedReportMatchFailuresVar0;
  16285. if (result6 === null) {
  16286. var result5 = '';
  16287. } else {
  16288. var result5 = null;
  16289. pos = savedPos2;
  16290. }
  16291. if (result5 !== null) {
  16292. var result1 = [result3, result4, result5];
  16293. } else {
  16294. var result1 = null;
  16295. pos = savedPos1;
  16296. }
  16297. } else {
  16298. var result1 = null;
  16299. pos = savedPos1;
  16300. }
  16301. } else {
  16302. var result1 = null;
  16303. pos = savedPos1;
  16304. }
  16305. var result2 = result1 !== null
  16306. ? (function(selector) {
  16307. return smalltalk.SendNode._new()
  16308. ._selector_(selector)
  16309. })(result1[1])
  16310. : null;
  16311. if (result2 !== null) {
  16312. var result0 = result2;
  16313. } else {
  16314. var result0 = null;
  16315. pos = savedPos0;
  16316. }
  16317. cache[cacheKey] = {
  16318. nextPos: pos,
  16319. result: result0
  16320. };
  16321. return result0;
  16322. }
  16323. function parse_unaryTail() {
  16324. var cacheKey = 'unaryTail@' + pos;
  16325. var cachedResult = cache[cacheKey];
  16326. if (cachedResult) {
  16327. pos = cachedResult.nextPos;
  16328. return cachedResult.result;
  16329. }
  16330. var savedPos0 = pos;
  16331. var savedPos1 = pos;
  16332. var result3 = parse_unaryMessage();
  16333. if (result3 !== null) {
  16334. var result4 = parse_ws();
  16335. if (result4 !== null) {
  16336. var result7 = parse_unaryTail();
  16337. var result5 = result7 !== null ? result7 : '';
  16338. if (result5 !== null) {
  16339. var result6 = parse_ws();
  16340. if (result6 !== null) {
  16341. var result1 = [result3, result4, result5, result6];
  16342. } else {
  16343. var result1 = null;
  16344. pos = savedPos1;
  16345. }
  16346. } else {
  16347. var result1 = null;
  16348. pos = savedPos1;
  16349. }
  16350. } else {
  16351. var result1 = null;
  16352. pos = savedPos1;
  16353. }
  16354. } else {
  16355. var result1 = null;
  16356. pos = savedPos1;
  16357. }
  16358. var result2 = result1 !== null
  16359. ? (function(message, tail) {
  16360. if(tail) {
  16361. return tail._valueForReceiver_(message);
  16362. }
  16363. else {
  16364. return message;
  16365. }
  16366. })(result1[0], result1[2])
  16367. : null;
  16368. if (result2 !== null) {
  16369. var result0 = result2;
  16370. } else {
  16371. var result0 = null;
  16372. pos = savedPos0;
  16373. }
  16374. cache[cacheKey] = {
  16375. nextPos: pos,
  16376. result: result0
  16377. };
  16378. return result0;
  16379. }
  16380. function parse_unarySend() {
  16381. var cacheKey = 'unarySend@' + pos;
  16382. var cachedResult = cache[cacheKey];
  16383. if (cachedResult) {
  16384. pos = cachedResult.nextPos;
  16385. return cachedResult.result;
  16386. }
  16387. var savedPos0 = pos;
  16388. var savedPos1 = pos;
  16389. var result3 = parse_operand();
  16390. if (result3 !== null) {
  16391. var result4 = parse_ws();
  16392. if (result4 !== null) {
  16393. var result6 = parse_unaryTail();
  16394. var result5 = result6 !== null ? result6 : '';
  16395. if (result5 !== null) {
  16396. var result1 = [result3, result4, result5];
  16397. } else {
  16398. var result1 = null;
  16399. pos = savedPos1;
  16400. }
  16401. } else {
  16402. var result1 = null;
  16403. pos = savedPos1;
  16404. }
  16405. } else {
  16406. var result1 = null;
  16407. pos = savedPos1;
  16408. }
  16409. var result2 = result1 !== null
  16410. ? (function(receiver, tail) {
  16411. if(tail) {
  16412. return tail._valueForReceiver_(receiver);
  16413. }
  16414. else {
  16415. return receiver;
  16416. }
  16417. })(result1[0], result1[2])
  16418. : null;
  16419. if (result2 !== null) {
  16420. var result0 = result2;
  16421. } else {
  16422. var result0 = null;
  16423. pos = savedPos0;
  16424. }
  16425. cache[cacheKey] = {
  16426. nextPos: pos,
  16427. result: result0
  16428. };
  16429. return result0;
  16430. }
  16431. function parse_binaryMessage() {
  16432. var cacheKey = 'binaryMessage@' + pos;
  16433. var cachedResult = cache[cacheKey];
  16434. if (cachedResult) {
  16435. pos = cachedResult.nextPos;
  16436. return cachedResult.result;
  16437. }
  16438. var savedPos0 = pos;
  16439. var savedPos1 = pos;
  16440. var result3 = parse_ws();
  16441. if (result3 !== null) {
  16442. var result4 = parse_binarySelector();
  16443. if (result4 !== null) {
  16444. var result5 = parse_ws();
  16445. if (result5 !== null) {
  16446. var result8 = parse_unarySend();
  16447. if (result8 !== null) {
  16448. var result6 = result8;
  16449. } else {
  16450. var result7 = parse_operand();
  16451. if (result7 !== null) {
  16452. var result6 = result7;
  16453. } else {
  16454. var result6 = null;;
  16455. };
  16456. }
  16457. if (result6 !== null) {
  16458. var result1 = [result3, result4, result5, result6];
  16459. } else {
  16460. var result1 = null;
  16461. pos = savedPos1;
  16462. }
  16463. } else {
  16464. var result1 = null;
  16465. pos = savedPos1;
  16466. }
  16467. } else {
  16468. var result1 = null;
  16469. pos = savedPos1;
  16470. }
  16471. } else {
  16472. var result1 = null;
  16473. pos = savedPos1;
  16474. }
  16475. var result2 = result1 !== null
  16476. ? (function(selector, arg) {
  16477. return smalltalk.SendNode._new()
  16478. ._selector_(selector)
  16479. ._arguments_([arg])
  16480. })(result1[1], result1[3])
  16481. : null;
  16482. if (result2 !== null) {
  16483. var result0 = result2;
  16484. } else {
  16485. var result0 = null;
  16486. pos = savedPos0;
  16487. }
  16488. cache[cacheKey] = {
  16489. nextPos: pos,
  16490. result: result0
  16491. };
  16492. return result0;
  16493. }
  16494. function parse_binaryTail() {
  16495. var cacheKey = 'binaryTail@' + pos;
  16496. var cachedResult = cache[cacheKey];
  16497. if (cachedResult) {
  16498. pos = cachedResult.nextPos;
  16499. return cachedResult.result;
  16500. }
  16501. var savedPos0 = pos;
  16502. var savedPos1 = pos;
  16503. var result3 = parse_binaryMessage();
  16504. if (result3 !== null) {
  16505. var result5 = parse_binaryTail();
  16506. var result4 = result5 !== null ? result5 : '';
  16507. if (result4 !== null) {
  16508. var result1 = [result3, result4];
  16509. } else {
  16510. var result1 = null;
  16511. pos = savedPos1;
  16512. }
  16513. } else {
  16514. var result1 = null;
  16515. pos = savedPos1;
  16516. }
  16517. var result2 = result1 !== null
  16518. ? (function(message, tail) {
  16519. if(tail) {
  16520. return tail._valueForReceiver_(message);
  16521. }
  16522. else {
  16523. return message;
  16524. }
  16525. })(result1[0], result1[1])
  16526. : null;
  16527. if (result2 !== null) {
  16528. var result0 = result2;
  16529. } else {
  16530. var result0 = null;
  16531. pos = savedPos0;
  16532. }
  16533. cache[cacheKey] = {
  16534. nextPos: pos,
  16535. result: result0
  16536. };
  16537. return result0;
  16538. }
  16539. function parse_binarySend() {
  16540. var cacheKey = 'binarySend@' + pos;
  16541. var cachedResult = cache[cacheKey];
  16542. if (cachedResult) {
  16543. pos = cachedResult.nextPos;
  16544. return cachedResult.result;
  16545. }
  16546. var savedPos0 = pos;
  16547. var savedPos1 = pos;
  16548. var result3 = parse_unarySend();
  16549. if (result3 !== null) {
  16550. var result5 = parse_binaryTail();
  16551. var result4 = result5 !== null ? result5 : '';
  16552. if (result4 !== null) {
  16553. var result1 = [result3, result4];
  16554. } else {
  16555. var result1 = null;
  16556. pos = savedPos1;
  16557. }
  16558. } else {
  16559. var result1 = null;
  16560. pos = savedPos1;
  16561. }
  16562. var result2 = result1 !== null
  16563. ? (function(receiver, tail) {
  16564. if(tail) {
  16565. return tail._valueForReceiver_(receiver);
  16566. }
  16567. else {
  16568. return receiver;
  16569. }
  16570. })(result1[0], result1[1])
  16571. : null;
  16572. if (result2 !== null) {
  16573. var result0 = result2;
  16574. } else {
  16575. var result0 = null;
  16576. pos = savedPos0;
  16577. }
  16578. cache[cacheKey] = {
  16579. nextPos: pos,
  16580. result: result0
  16581. };
  16582. return result0;
  16583. }
  16584. function parse_keywordMessage() {
  16585. var cacheKey = 'keywordMessage@' + pos;
  16586. var cachedResult = cache[cacheKey];
  16587. if (cachedResult) {
  16588. pos = cachedResult.nextPos;
  16589. return cachedResult.result;
  16590. }
  16591. var savedPos0 = pos;
  16592. var savedPos1 = pos;
  16593. var result3 = parse_ws();
  16594. if (result3 !== null) {
  16595. var savedPos2 = pos;
  16596. var savedPos3 = pos;
  16597. var result8 = parse_keywordPair();
  16598. if (result8 !== null) {
  16599. var result9 = parse_ws();
  16600. if (result9 !== null) {
  16601. var result6 = [result8, result9];
  16602. } else {
  16603. var result6 = null;
  16604. pos = savedPos3;
  16605. }
  16606. } else {
  16607. var result6 = null;
  16608. pos = savedPos3;
  16609. }
  16610. var result7 = result6 !== null
  16611. ? (function(pair) {return pair})(result6[0])
  16612. : null;
  16613. if (result7 !== null) {
  16614. var result5 = result7;
  16615. } else {
  16616. var result5 = null;
  16617. pos = savedPos2;
  16618. }
  16619. if (result5 !== null) {
  16620. var result4 = [];
  16621. while (result5 !== null) {
  16622. result4.push(result5);
  16623. var savedPos2 = pos;
  16624. var savedPos3 = pos;
  16625. var result8 = parse_keywordPair();
  16626. if (result8 !== null) {
  16627. var result9 = parse_ws();
  16628. if (result9 !== null) {
  16629. var result6 = [result8, result9];
  16630. } else {
  16631. var result6 = null;
  16632. pos = savedPos3;
  16633. }
  16634. } else {
  16635. var result6 = null;
  16636. pos = savedPos3;
  16637. }
  16638. var result7 = result6 !== null
  16639. ? (function(pair) {return pair})(result6[0])
  16640. : null;
  16641. if (result7 !== null) {
  16642. var result5 = result7;
  16643. } else {
  16644. var result5 = null;
  16645. pos = savedPos2;
  16646. }
  16647. }
  16648. } else {
  16649. var result4 = null;
  16650. }
  16651. if (result4 !== null) {
  16652. var result1 = [result3, result4];
  16653. } else {
  16654. var result1 = null;
  16655. pos = savedPos1;
  16656. }
  16657. } else {
  16658. var result1 = null;
  16659. pos = savedPos1;
  16660. }
  16661. var result2 = result1 !== null
  16662. ? (function(pairs) {
  16663. var selector = [];
  16664. var args = [];
  16665. for(var i=0;i<pairs.length;i++) {
  16666. selector.push(pairs[i].key);
  16667. args.push(pairs[i].arg);
  16668. }
  16669. return smalltalk.SendNode._new()
  16670. ._selector_(selector.join(""))
  16671. ._arguments_(args)
  16672. })(result1[1])
  16673. : null;
  16674. if (result2 !== null) {
  16675. var result0 = result2;
  16676. } else {
  16677. var result0 = null;
  16678. pos = savedPos0;
  16679. }
  16680. cache[cacheKey] = {
  16681. nextPos: pos,
  16682. result: result0
  16683. };
  16684. return result0;
  16685. }
  16686. function parse_keywordSend() {
  16687. var cacheKey = 'keywordSend@' + pos;
  16688. var cachedResult = cache[cacheKey];
  16689. if (cachedResult) {
  16690. pos = cachedResult.nextPos;
  16691. return cachedResult.result;
  16692. }
  16693. var savedPos0 = pos;
  16694. var savedPos1 = pos;
  16695. var result3 = parse_binarySend();
  16696. if (result3 !== null) {
  16697. var result4 = parse_keywordMessage();
  16698. if (result4 !== null) {
  16699. var result1 = [result3, result4];
  16700. } else {
  16701. var result1 = null;
  16702. pos = savedPos1;
  16703. }
  16704. } else {
  16705. var result1 = null;
  16706. pos = savedPos1;
  16707. }
  16708. var result2 = result1 !== null
  16709. ? (function(receiver, tail) {
  16710. return tail._valueForReceiver_(receiver);
  16711. })(result1[0], result1[1])
  16712. : null;
  16713. if (result2 !== null) {
  16714. var result0 = result2;
  16715. } else {
  16716. var result0 = null;
  16717. pos = savedPos0;
  16718. }
  16719. cache[cacheKey] = {
  16720. nextPos: pos,
  16721. result: result0
  16722. };
  16723. return result0;
  16724. }
  16725. function parse_message() {
  16726. var cacheKey = 'message@' + pos;
  16727. var cachedResult = cache[cacheKey];
  16728. if (cachedResult) {
  16729. pos = cachedResult.nextPos;
  16730. return cachedResult.result;
  16731. }
  16732. var result3 = parse_binaryMessage();
  16733. if (result3 !== null) {
  16734. var result0 = result3;
  16735. } else {
  16736. var result2 = parse_unaryMessage();
  16737. if (result2 !== null) {
  16738. var result0 = result2;
  16739. } else {
  16740. var result1 = parse_keywordMessage();
  16741. if (result1 !== null) {
  16742. var result0 = result1;
  16743. } else {
  16744. var result0 = null;;
  16745. };
  16746. };
  16747. }
  16748. cache[cacheKey] = {
  16749. nextPos: pos,
  16750. result: result0
  16751. };
  16752. return result0;
  16753. }
  16754. function parse_cascade() {
  16755. var cacheKey = 'cascade@' + pos;
  16756. var cachedResult = cache[cacheKey];
  16757. if (cachedResult) {
  16758. pos = cachedResult.nextPos;
  16759. return cachedResult.result;
  16760. }
  16761. var savedPos0 = pos;
  16762. var savedPos1 = pos;
  16763. var result3 = parse_ws();
  16764. if (result3 !== null) {
  16765. var result15 = parse_keywordSend();
  16766. if (result15 !== null) {
  16767. var result4 = result15;
  16768. } else {
  16769. var result14 = parse_binarySend();
  16770. if (result14 !== null) {
  16771. var result4 = result14;
  16772. } else {
  16773. var result4 = null;;
  16774. };
  16775. }
  16776. if (result4 !== null) {
  16777. var savedPos2 = pos;
  16778. var savedPos3 = pos;
  16779. var result9 = parse_ws();
  16780. if (result9 !== null) {
  16781. if (input.substr(pos, 1) === ";") {
  16782. var result10 = ";";
  16783. pos += 1;
  16784. } else {
  16785. var result10 = null;
  16786. if (reportMatchFailures) {
  16787. matchFailed("\";\"");
  16788. }
  16789. }
  16790. if (result10 !== null) {
  16791. var result11 = parse_ws();
  16792. if (result11 !== null) {
  16793. var result12 = parse_message();
  16794. if (result12 !== null) {
  16795. var result13 = parse_ws();
  16796. if (result13 !== null) {
  16797. var result7 = [result9, result10, result11, result12, result13];
  16798. } else {
  16799. var result7 = null;
  16800. pos = savedPos3;
  16801. }
  16802. } else {
  16803. var result7 = null;
  16804. pos = savedPos3;
  16805. }
  16806. } else {
  16807. var result7 = null;
  16808. pos = savedPos3;
  16809. }
  16810. } else {
  16811. var result7 = null;
  16812. pos = savedPos3;
  16813. }
  16814. } else {
  16815. var result7 = null;
  16816. pos = savedPos3;
  16817. }
  16818. var result8 = result7 !== null
  16819. ? (function(mess) {return mess})(result7[3])
  16820. : null;
  16821. if (result8 !== null) {
  16822. var result6 = result8;
  16823. } else {
  16824. var result6 = null;
  16825. pos = savedPos2;
  16826. }
  16827. if (result6 !== null) {
  16828. var result5 = [];
  16829. while (result6 !== null) {
  16830. result5.push(result6);
  16831. var savedPos2 = pos;
  16832. var savedPos3 = pos;
  16833. var result9 = parse_ws();
  16834. if (result9 !== null) {
  16835. if (input.substr(pos, 1) === ";") {
  16836. var result10 = ";";
  16837. pos += 1;
  16838. } else {
  16839. var result10 = null;
  16840. if (reportMatchFailures) {
  16841. matchFailed("\";\"");
  16842. }
  16843. }
  16844. if (result10 !== null) {
  16845. var result11 = parse_ws();
  16846. if (result11 !== null) {
  16847. var result12 = parse_message();
  16848. if (result12 !== null) {
  16849. var result13 = parse_ws();
  16850. if (result13 !== null) {
  16851. var result7 = [result9, result10, result11, result12, result13];
  16852. } else {
  16853. var result7 = null;
  16854. pos = savedPos3;
  16855. }
  16856. } else {
  16857. var result7 = null;
  16858. pos = savedPos3;
  16859. }
  16860. } else {
  16861. var result7 = null;
  16862. pos = savedPos3;
  16863. }
  16864. } else {
  16865. var result7 = null;
  16866. pos = savedPos3;
  16867. }
  16868. } else {
  16869. var result7 = null;
  16870. pos = savedPos3;
  16871. }
  16872. var result8 = result7 !== null
  16873. ? (function(mess) {return mess})(result7[3])
  16874. : null;
  16875. if (result8 !== null) {
  16876. var result6 = result8;
  16877. } else {
  16878. var result6 = null;
  16879. pos = savedPos2;
  16880. }
  16881. }
  16882. } else {
  16883. var result5 = null;
  16884. }
  16885. if (result5 !== null) {
  16886. var result1 = [result3, result4, result5];
  16887. } else {
  16888. var result1 = null;
  16889. pos = savedPos1;
  16890. }
  16891. } else {
  16892. var result1 = null;
  16893. pos = savedPos1;
  16894. }
  16895. } else {
  16896. var result1 = null;
  16897. pos = savedPos1;
  16898. }
  16899. var result2 = result1 !== null
  16900. ? (function(send, messages) {
  16901. var cascade = [];
  16902. cascade.push(send);
  16903. for(var i=0;i<messages.length;i++) {
  16904. cascade.push(messages[i]);
  16905. }
  16906. return smalltalk.CascadeNode._new()
  16907. ._receiver_(send._receiver())
  16908. ._nodes_(cascade)
  16909. })(result1[1], result1[2])
  16910. : null;
  16911. if (result2 !== null) {
  16912. var result0 = result2;
  16913. } else {
  16914. var result0 = null;
  16915. pos = savedPos0;
  16916. }
  16917. cache[cacheKey] = {
  16918. nextPos: pos,
  16919. result: result0
  16920. };
  16921. return result0;
  16922. }
  16923. function parse_jsStatement() {
  16924. var cacheKey = 'jsStatement@' + pos;
  16925. var cachedResult = cache[cacheKey];
  16926. if (cachedResult) {
  16927. pos = cachedResult.nextPos;
  16928. return cachedResult.result;
  16929. }
  16930. var savedPos0 = pos;
  16931. var savedPos1 = pos;
  16932. if (input.substr(pos, 1) === "<") {
  16933. var result3 = "<";
  16934. pos += 1;
  16935. } else {
  16936. var result3 = null;
  16937. if (reportMatchFailures) {
  16938. matchFailed("\"<\"");
  16939. }
  16940. }
  16941. if (result3 !== null) {
  16942. var result4 = [];
  16943. var savedPos2 = pos;
  16944. if (input.substr(pos, 2) === ">>") {
  16945. var result9 = ">>";
  16946. pos += 2;
  16947. } else {
  16948. var result9 = null;
  16949. if (reportMatchFailures) {
  16950. matchFailed("\">>\"");
  16951. }
  16952. }
  16953. var result10 = result9 !== null
  16954. ? (function() {return ">"})()
  16955. : null;
  16956. if (result10 !== null) {
  16957. var result8 = result10;
  16958. } else {
  16959. var result8 = null;
  16960. pos = savedPos2;
  16961. }
  16962. if (result8 !== null) {
  16963. var result6 = result8;
  16964. } else {
  16965. if (input.substr(pos).match(/^[^>]/) !== null) {
  16966. var result7 = input.charAt(pos);
  16967. pos++;
  16968. } else {
  16969. var result7 = null;
  16970. if (reportMatchFailures) {
  16971. matchFailed("[^>]");
  16972. }
  16973. }
  16974. if (result7 !== null) {
  16975. var result6 = result7;
  16976. } else {
  16977. var result6 = null;;
  16978. };
  16979. }
  16980. while (result6 !== null) {
  16981. result4.push(result6);
  16982. var savedPos2 = pos;
  16983. if (input.substr(pos, 2) === ">>") {
  16984. var result9 = ">>";
  16985. pos += 2;
  16986. } else {
  16987. var result9 = null;
  16988. if (reportMatchFailures) {
  16989. matchFailed("\">>\"");
  16990. }
  16991. }
  16992. var result10 = result9 !== null
  16993. ? (function() {return ">"})()
  16994. : null;
  16995. if (result10 !== null) {
  16996. var result8 = result10;
  16997. } else {
  16998. var result8 = null;
  16999. pos = savedPos2;
  17000. }
  17001. if (result8 !== null) {
  17002. var result6 = result8;
  17003. } else {
  17004. if (input.substr(pos).match(/^[^>]/) !== null) {
  17005. var result7 = input.charAt(pos);
  17006. pos++;
  17007. } else {
  17008. var result7 = null;
  17009. if (reportMatchFailures) {
  17010. matchFailed("[^>]");
  17011. }
  17012. }
  17013. if (result7 !== null) {
  17014. var result6 = result7;
  17015. } else {
  17016. var result6 = null;;
  17017. };
  17018. }
  17019. }
  17020. if (result4 !== null) {
  17021. if (input.substr(pos, 1) === ">") {
  17022. var result5 = ">";
  17023. pos += 1;
  17024. } else {
  17025. var result5 = null;
  17026. if (reportMatchFailures) {
  17027. matchFailed("\">\"");
  17028. }
  17029. }
  17030. if (result5 !== null) {
  17031. var result1 = [result3, result4, result5];
  17032. } else {
  17033. var result1 = null;
  17034. pos = savedPos1;
  17035. }
  17036. } else {
  17037. var result1 = null;
  17038. pos = savedPos1;
  17039. }
  17040. } else {
  17041. var result1 = null;
  17042. pos = savedPos1;
  17043. }
  17044. var result2 = result1 !== null
  17045. ? (function(val) {
  17046. return smalltalk.JSStatementNode._new()
  17047. ._source_(val.join(""))
  17048. })(result1[1])
  17049. : null;
  17050. if (result2 !== null) {
  17051. var result0 = result2;
  17052. } else {
  17053. var result0 = null;
  17054. pos = savedPos0;
  17055. }
  17056. cache[cacheKey] = {
  17057. nextPos: pos,
  17058. result: result0
  17059. };
  17060. return result0;
  17061. }
  17062. function parse_method() {
  17063. var cacheKey = 'method@' + pos;
  17064. var cachedResult = cache[cacheKey];
  17065. if (cachedResult) {
  17066. pos = cachedResult.nextPos;
  17067. return cachedResult.result;
  17068. }
  17069. var savedPos0 = pos;
  17070. var savedPos1 = pos;
  17071. var result3 = parse_ws();
  17072. if (result3 !== null) {
  17073. var result11 = parse_keywordPattern();
  17074. if (result11 !== null) {
  17075. var result4 = result11;
  17076. } else {
  17077. var result10 = parse_binaryPattern();
  17078. if (result10 !== null) {
  17079. var result4 = result10;
  17080. } else {
  17081. var result9 = parse_unaryPattern();
  17082. if (result9 !== null) {
  17083. var result4 = result9;
  17084. } else {
  17085. var result4 = null;;
  17086. };
  17087. };
  17088. }
  17089. if (result4 !== null) {
  17090. var result5 = parse_ws();
  17091. if (result5 !== null) {
  17092. var result8 = parse_sequence();
  17093. var result6 = result8 !== null ? result8 : '';
  17094. if (result6 !== null) {
  17095. var result7 = parse_ws();
  17096. if (result7 !== null) {
  17097. var result1 = [result3, result4, result5, result6, result7];
  17098. } else {
  17099. var result1 = null;
  17100. pos = savedPos1;
  17101. }
  17102. } else {
  17103. var result1 = null;
  17104. pos = savedPos1;
  17105. }
  17106. } else {
  17107. var result1 = null;
  17108. pos = savedPos1;
  17109. }
  17110. } else {
  17111. var result1 = null;
  17112. pos = savedPos1;
  17113. }
  17114. } else {
  17115. var result1 = null;
  17116. pos = savedPos1;
  17117. }
  17118. var result2 = result1 !== null
  17119. ? (function(pattern, sequence) {
  17120. return smalltalk.MethodNode._new()
  17121. ._selector_(pattern[0])
  17122. ._arguments_(pattern[1])
  17123. ._nodes_([sequence])
  17124. })(result1[1], result1[3])
  17125. : null;
  17126. if (result2 !== null) {
  17127. var result0 = result2;
  17128. } else {
  17129. var result0 = null;
  17130. pos = savedPos0;
  17131. }
  17132. cache[cacheKey] = {
  17133. nextPos: pos,
  17134. result: result0
  17135. };
  17136. return result0;
  17137. }
  17138. function buildErrorMessage() {
  17139. function buildExpected(failuresExpected) {
  17140. failuresExpected.sort();
  17141. var lastFailure = null;
  17142. var failuresExpectedUnique = [];
  17143. for (var i = 0; i < failuresExpected.length; i++) {
  17144. if (failuresExpected[i] !== lastFailure) {
  17145. failuresExpectedUnique.push(failuresExpected[i]);
  17146. lastFailure = failuresExpected[i];
  17147. }
  17148. }
  17149. switch (failuresExpectedUnique.length) {
  17150. case 0:
  17151. return 'end of input';
  17152. case 1:
  17153. return failuresExpectedUnique[0];
  17154. default:
  17155. return failuresExpectedUnique.slice(0, failuresExpectedUnique.length - 1).join(', ')
  17156. + ' or '
  17157. + failuresExpectedUnique[failuresExpectedUnique.length - 1];
  17158. }
  17159. }
  17160. var expected = buildExpected(rightmostMatchFailuresExpected);
  17161. var actualPos = Math.max(pos, rightmostMatchFailuresPos);
  17162. var actual = actualPos < input.length
  17163. ? quote(input.charAt(actualPos))
  17164. : 'end of input';
  17165. return 'Expected ' + expected + ' but ' + actual + ' found.';
  17166. }
  17167. function computeErrorPosition() {
  17168. /*
  17169. * The first idea was to use |String.split| to break the input up to the
  17170. * error position along newlines and derive the line and column from
  17171. * there. However IE's |split| implementation is so broken that it was
  17172. * enough to prevent it.
  17173. */
  17174. var line = 1;
  17175. var column = 1;
  17176. var seenCR = false;
  17177. for (var i = 0; i < rightmostMatchFailuresPos; i++) {
  17178. var ch = input.charAt(i);
  17179. if (ch === '\n') {
  17180. if (!seenCR) { line++; }
  17181. column = 1;
  17182. seenCR = false;
  17183. } else if (ch === '\r' | ch === '\u2028' || ch === '\u2029') {
  17184. line++;
  17185. column = 1;
  17186. seenCR = true;
  17187. } else {
  17188. column++;
  17189. seenCR = false;
  17190. }
  17191. }
  17192. return { line: line, column: column };
  17193. }
  17194. var result = parseFunctions[startRule]();
  17195. /*
  17196. * The parser is now in one of the following three states:
  17197. *
  17198. * 1. The parser successfully parsed the whole input.
  17199. *
  17200. * - |result !== null|
  17201. * - |pos === input.length|
  17202. * - |rightmostMatchFailuresExpected| may or may not contain something
  17203. *
  17204. * 2. The parser successfully parsed only a part of the input.
  17205. *
  17206. * - |result !== null|
  17207. * - |pos < input.length|
  17208. * - |rightmostMatchFailuresExpected| may or may not contain something
  17209. *
  17210. * 3. The parser did not successfully parse any part of the input.
  17211. *
  17212. * - |result === null|
  17213. * - |pos === 0|
  17214. * - |rightmostMatchFailuresExpected| contains at least one failure
  17215. *
  17216. * All code following this comment (including called functions) must
  17217. * handle these states.
  17218. */
  17219. if (result === null || pos !== input.length) {
  17220. var errorPosition = computeErrorPosition();
  17221. throw new this.SyntaxError(
  17222. buildErrorMessage(),
  17223. errorPosition.line,
  17224. errorPosition.column
  17225. );
  17226. }
  17227. return result;
  17228. },
  17229. /* Returns the parser source code. */
  17230. toSource: function() { return this._source; }
  17231. };
  17232. /* Thrown when a parser encounters a syntax error. */
  17233. result.SyntaxError = function(message, line, column) {
  17234. this.name = 'SyntaxError';
  17235. this.message = message;
  17236. this.line = line;
  17237. this.column = column;
  17238. };
  17239. result.SyntaxError.prototype = Error.prototype;
  17240. return result;
  17241. })();
  17242. smalltalk.addPackage('REPL', {});
  17243. smalltalk.addClass('Repl', smalltalk.Object, ['readline', 'interface', 'util'], 'REPL');
  17244. smalltalk.addMethod(
  17245. "_close",
  17246. smalltalk.method({
  17247. selector: "close",
  17248. category: 'actions',
  17249. fn: function (){
  17250. var self=this;
  17251. smalltalk.send(smalltalk.send((typeof process == 'undefined' ? nil : process), "_stdin", []), "_destroy", []);
  17252. return self;},
  17253. args: [],
  17254. source: "close\x0a\x09process stdin destroy",
  17255. messageSends: ["destroy", "stdin"],
  17256. referencedClasses: []
  17257. }),
  17258. smalltalk.Repl);
  17259. smalltalk.addMethod(
  17260. "_createInterface",
  17261. smalltalk.method({
  17262. selector: "createInterface",
  17263. category: 'actions',
  17264. fn: function (){
  17265. var self=this;
  17266. (self['@interface']=smalltalk.send(self['@readline'], "_createInterface_stdout_", [smalltalk.send((typeof process == 'undefined' ? nil : process), "_stdin", []), smalltalk.send((typeof process == 'undefined' ? nil : process), "_stdout", [])]));
  17267. smalltalk.send(self['@interface'], "_on_do_", ["line", (function(buffer){return smalltalk.send(self, "_eval_", [buffer]);})]);
  17268. smalltalk.send(self['@interface'], "_on_do_", ["close", (function(){return smalltalk.send(self, "_close", []);})]);
  17269. smalltalk.send(self, "_setPrompt", []);
  17270. smalltalk.send(self['@interface'], "_prompt", []);
  17271. return self;},
  17272. args: [],
  17273. source: "createInterface\x0a\x09\x22No completion for now\x22\x0a\x09interface := readline createInterface: process stdin stdout: process stdout.\x0a\x09interface on: 'line' do: [:buffer | self eval: buffer].\x0a\x09interface on: 'close' do: [self close].\x0a\x09self setPrompt.\x0a\x09interface prompt",
  17274. messageSends: ["createInterface:stdout:", "stdin", "stdout", "on:do:", "eval:", "close", "setPrompt", "prompt"],
  17275. referencedClasses: []
  17276. }),
  17277. smalltalk.Repl);
  17278. smalltalk.addMethod(
  17279. "_eval_",
  17280. smalltalk.method({
  17281. selector: "eval:",
  17282. category: 'actions',
  17283. fn: function (buffer){
  17284. var self=this;
  17285. var result=nil;
  17286. ((($receiver = smalltalk.send(buffer, "_isEmpty", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_try_catch_", [(function(){(result=smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_loadExpression_", [buffer]));return smalltalk.send((smalltalk.Transcript || Transcript), "_show_", [result]);}), (function(e){return ((($receiver = smalltalk.send(e, "_isSmalltalkError", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(smalltalk.send((smalltalk.ErrorHandler || ErrorHandler), "_new", []), "_handleError_", [e]);})() : (function(){return smalltalk.send(smalltalk.send((typeof process == 'undefined' ? nil : process), "_stdout", []), "_write_", [smalltalk.send(e, "_jsStack", [])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.ErrorHandler || ErrorHandler), "_new", []), "_handleError_", [e]);}), (function(){return smalltalk.send(smalltalk.send((typeof process == 'undefined' ? nil : process), "_stdout", []), "_write_", [smalltalk.send(e, "_jsStack", [])]);})]));})]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_try_catch_", [(function(){(result=smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_loadExpression_", [buffer]));return smalltalk.send((smalltalk.Transcript || Transcript), "_show_", [result]);}), (function(e){return ((($receiver = smalltalk.send(e, "_isSmalltalkError", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(smalltalk.send((smalltalk.ErrorHandler || ErrorHandler), "_new", []), "_handleError_", [e]);})() : (function(){return smalltalk.send(smalltalk.send((typeof process == 'undefined' ? nil : process), "_stdout", []), "_write_", [smalltalk.send(e, "_jsStack", [])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send((smalltalk.ErrorHandler || ErrorHandler), "_new", []), "_handleError_", [e]);}), (function(){return smalltalk.send(smalltalk.send((typeof process == 'undefined' ? nil : process), "_stdout", []), "_write_", [smalltalk.send(e, "_jsStack", [])]);})]));})]);})]));
  17287. smalltalk.send(self['@interface'], "_prompt", []);
  17288. return self;},
  17289. args: ["buffer"],
  17290. source: "eval: buffer\x0a\x09| result |\x0a\x09buffer isEmpty ifFalse: [\x0a\x09\x09self try: [\x0a\x09\x09\x09result := Compiler new loadExpression: buffer.\x0a\x09\x09\x09Transcript show: result]\x0a\x09\x09catch: [:e |\x0a\x09\x09\x09e isSmalltalkError\x0a\x09\x09\x09 ifTrue: [ErrorHandler new handleError: e]\x0a\x09\x09\x09 ifFalse: [process stdout write: e jsStack]]].\x0a\x09interface prompt",
  17291. messageSends: ["ifFalse:", "isEmpty", "try:catch:", "loadExpression:", "new", "show:", "ifTrue:ifFalse:", "isSmalltalkError", "handleError:", "write:", "stdout", "jsStack", "prompt"],
  17292. referencedClasses: ["Compiler", "Transcript", "ErrorHandler"]
  17293. }),
  17294. smalltalk.Repl);
  17295. smalltalk.addMethod(
  17296. "_initialize",
  17297. smalltalk.method({
  17298. selector: "initialize",
  17299. category: 'initialization',
  17300. fn: function (){
  17301. var self=this;
  17302. smalltalk.send(self, "_initialize", [], smalltalk.Object);
  17303. (self['@readline']=smalltalk.send((typeof require == 'undefined' ? nil : require), "_value_", ["readline"]));
  17304. (self['@util']=smalltalk.send((typeof require == 'undefined' ? nil : require), "_value_", ["util"]));
  17305. return self;},
  17306. args: [],
  17307. source: "initialize\x0a\x09super initialize.\x0a\x09readline := require value: 'readline'.\x0a\x09util := require value: 'util'",
  17308. messageSends: ["initialize", "value:"],
  17309. referencedClasses: []
  17310. }),
  17311. smalltalk.Repl);
  17312. smalltalk.addMethod(
  17313. "_prompt",
  17314. smalltalk.method({
  17315. selector: "prompt",
  17316. category: 'accessing',
  17317. fn: function (){
  17318. var self=this;
  17319. return "amber >> ";
  17320. return self;},
  17321. args: [],
  17322. source: "prompt\x0a\x09^'amber >> '",
  17323. messageSends: [],
  17324. referencedClasses: []
  17325. }),
  17326. smalltalk.Repl);
  17327. smalltalk.addMethod(
  17328. "_setPrompt",
  17329. smalltalk.method({
  17330. selector: "setPrompt",
  17331. category: 'actions',
  17332. fn: function (){
  17333. var self=this;
  17334. smalltalk.send(self['@interface'], "_setPrompt_", [smalltalk.send(self, "_prompt", [])]);
  17335. return self;},
  17336. args: [],
  17337. source: "setPrompt\x0a\x09interface setPrompt: self prompt",
  17338. messageSends: ["setPrompt:", "prompt"],
  17339. referencedClasses: []
  17340. }),
  17341. smalltalk.Repl);
  17342. smalltalk.addMethod(
  17343. "_main",
  17344. smalltalk.method({
  17345. selector: "main",
  17346. category: 'not yet classified',
  17347. fn: function (){
  17348. var self=this;
  17349. smalltalk.send(smalltalk.send(self, "_new", []), "_createInterface", []);
  17350. return self;},
  17351. args: [],
  17352. source: "main\x0a\x09self new createInterface",
  17353. messageSends: ["createInterface", "new"],
  17354. referencedClasses: []
  17355. }),
  17356. smalltalk.Repl.klass);
  17357. smalltalk.initSubTree(smalltalk.Object); //metaclasses are in through Class
  17358. smalltalk.classes()._do_(function(each) {
  17359. each._initialize()});
  17360. /* Similar to jQuery(document).ready() */
  17361. if(this.smalltalkReady) {
  17362. this.smalltalkReady();
  17363. }
  17364. smalltalk.Repl._main()