1
0

jtalk.js 393 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156
  1. function Smalltalk(){};
  2. function SmalltalkObject(){};
  3. function SmalltalkBehavior(){};
  4. function SmalltalkClass(){};
  5. function SmalltalkMetaclass(){
  6. this.meta = true;
  7. };
  8. function SmalltalkMethod(){};
  9. function SmalltalkNil(){};
  10. var nil = new SmalltalkNil();
  11. var smalltalk = new Smalltalk();
  12. smalltalk.klass = function(spec) {
  13. var spec = spec || {};
  14. var that;
  15. if(spec.meta) {
  16. that = new SmalltalkMetaclass();
  17. } else {
  18. that = new (smalltalk.klass({meta: true})).fn;
  19. that.klass.instanceClass = that;
  20. that.className = spec.className;
  21. that.klass.className = that.className + ' class';
  22. }
  23. that.fn = spec.fn || function(){};
  24. that.superclass = spec.superclass;
  25. that.iVarNames = spec.iVarNames || [];
  26. if(that.superclass) {
  27. that.klass.superclass = that.superclass.klass;
  28. }
  29. that.category = spec.category || "";
  30. that.fn.prototype.methods = {};
  31. that.fn.prototype.klass = that;
  32. return that;
  33. };
  34. smalltalk.method = function(spec) {
  35. var that = new SmalltalkMethod();
  36. that.selector = spec.selector;
  37. that.category = spec.category;
  38. that.source = spec.source;
  39. that.fn = spec.fn;
  40. return that
  41. };
  42. smalltalk.init = function(klass) {
  43. var subclasses = smalltalk.subclasses(klass);
  44. for(var i=0;i<klass.iVarNames.length;i++) {
  45. klass.fn.prototype["@"+klass.iVarNames[i]] = nil;
  46. }
  47. if(klass.superclass && klass.superclass !== nil) {
  48. klass.fn.prototype.__proto__ = klass.superclass.fn.prototype;
  49. for(var i=0;i<klass.superclass.iVarNames.length;i++) {
  50. if(!klass["@"+klass.superclass.iVarNames[i]]) {
  51. klass.fn.prototype["@"+klass.superclass.iVarNames[i]] = nil;
  52. }
  53. }
  54. }
  55. for(var i=0;i<subclasses.length;i++) {
  56. smalltalk.init(subclasses[i]);
  57. }
  58. if(klass.klass && !klass.meta) {
  59. smalltalk.init(klass.klass);
  60. }
  61. };
  62. smalltalk.classes = function() {
  63. var classes = [];
  64. for(var i in smalltalk) {
  65. if(i.search(/^[A-Z]/g) != -1) {
  66. classes.push(smalltalk[i]);
  67. }
  68. }
  69. return classes
  70. };
  71. smalltalk.subclasses = function(klass) {
  72. var subclasses = [];
  73. var classes = smalltalk.classes();
  74. for(var i in classes) {
  75. if(classes[i].fn) {
  76. //Metaclasses
  77. if(classes[i].klass && classes[i].klass.superclass === klass) {
  78. subclasses.push(classes[i].klass);
  79. }
  80. //Classes
  81. if(classes[i].superclass === klass) {
  82. subclasses.push(classes[i]);
  83. }
  84. }
  85. }
  86. return subclasses;
  87. };
  88. smalltalk.mapClassName = function(className, category, fn, superclass) {
  89. smalltalk[className] = smalltalk.klass({
  90. className: className,
  91. category: category,
  92. superclass: superclass,
  93. fn: fn
  94. });
  95. };
  96. smalltalk.addClass = function(className, superclass, iVarNames, category) {
  97. if(smalltalk[className]) {
  98. smalltalk[className].superclass = superclass;
  99. smalltalk[className].iVarNames = iVarNames;
  100. } else {
  101. smalltalk[className] = smalltalk.klass({
  102. className: className,
  103. iVarNames: iVarNames,
  104. superclass: superclass
  105. });
  106. }
  107. smalltalk[className].category = category || '';
  108. };
  109. smalltalk.addMethod = function(jsSelector, method, klass) {
  110. klass.fn.prototype[jsSelector] = method.fn;
  111. klass.fn.prototype.methods[method.selector] = method;
  112. };
  113. smalltalk.mapClassName("Object", "Kernel", SmalltalkObject);
  114. smalltalk.mapClassName("Smalltalk", "Kernel", Smalltalk, smalltalk.Object);
  115. smalltalk.mapClassName("Behavior", "Kernel", SmalltalkBehavior, smalltalk.Object);
  116. smalltalk.mapClassName("Class", "Kernel", SmalltalkClass, smalltalk.Behavior);
  117. smalltalk.mapClassName("Metaclass", "Kernel", SmalltalkMetaclass, smalltalk.Behavior);
  118. smalltalk.mapClassName("CompiledMethod", "Kernel", SmalltalkMethod, smalltalk.Object);
  119. smalltalk.Object.klass.superclass = smalltalk.Class
  120. smalltalk.mapClassName("Number", "Kernel", Number, smalltalk.Object);
  121. smalltalk.mapClassName("BlockClosure", "Kernel", Function, smalltalk.Object);
  122. smalltalk.mapClassName("Boolean", "Kernel", Boolean, smalltalk.Object);
  123. smalltalk.mapClassName("UndefinedObject", "Kernel", SmalltalkNil, smalltalk.Object);
  124. smalltalk.mapClassName("Collection", "Kernel", null, smalltalk.Object);
  125. smalltalk.mapClassName("String", "Kernel", String, smalltalk.Collection);
  126. smalltalk.mapClassName("RegularExpression", "Kernel", RegExp, smalltalk.String);
  127. smalltalk.mapClassName("Array", "Kernel", Array, smalltalk.Collection);
  128. if(CanvasRenderingContext2D) {
  129. smalltalk.mapClassName("CanvasRenderingContext", "Canvas", CanvasRenderingContext2D, smalltalk.Object);
  130. }
  131. smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel');
  132. smalltalk.addMethod(
  133. '__eq',
  134. smalltalk.method({
  135. selector: '=',
  136. category: 'comparing',
  137. fn: function (anObject) {
  138. var self = this;
  139. return function () {return self == anObject;}();
  140. return self;
  141. },
  142. source: unescape('%3D%20anObject%0A%09%5E%7B%27return%20self%20%3D%3D%20anObject%27%7D%0A')}),
  143. smalltalk.Object);
  144. smalltalk.addMethod(
  145. '_~_eq',
  146. smalltalk.method({
  147. selector: '~=',
  148. category: 'comparing',
  149. fn: function (anObject) {
  150. var self = this;
  151. return self.__eq(anObject).__eq_eq(false);
  152. return self;
  153. },
  154. source: unescape('%7E%3D%20anObject%0A%09%5E%28self%20%3D%20anObject%29%20%3D%3D%20false%0A')}),
  155. smalltalk.Object);
  156. smalltalk.addMethod(
  157. '_initialize',
  158. smalltalk.method({
  159. selector: 'initialize',
  160. category: 'initialization',
  161. fn: function () {
  162. var self = this;
  163. return self;
  164. },
  165. source: unescape('initialize%0A')}),
  166. smalltalk.Object);
  167. smalltalk.addMethod(
  168. '_yourself',
  169. smalltalk.method({
  170. selector: 'yourself',
  171. category: 'accessing',
  172. fn: function () {
  173. var self = this;
  174. return self;
  175. return self;
  176. },
  177. source: unescape('yourself%0A%09%5Eself%0A')}),
  178. smalltalk.Object);
  179. smalltalk.addMethod(
  180. '_class',
  181. smalltalk.method({
  182. selector: 'class',
  183. category: 'accessing',
  184. fn: function () {
  185. var self = this;
  186. return function () {return self.klass;}();
  187. return self;
  188. },
  189. source: unescape('class%0A%09%5E%7B%27return%20self.klass%27%7D%0A')}),
  190. smalltalk.Object);
  191. smalltalk.addMethod(
  192. '_size',
  193. smalltalk.method({
  194. selector: 'size',
  195. category: 'accessing',
  196. fn: function () {
  197. var self = this;
  198. self._error_("Object not indexable");
  199. return self;
  200. },
  201. source: unescape('size%0A%09self%20error%3A%20%27Object%20not%20indexable%27%0A')}),
  202. smalltalk.Object);
  203. smalltalk.addMethod(
  204. '_copy',
  205. smalltalk.method({
  206. selector: 'copy',
  207. category: 'copying',
  208. fn: function () {
  209. var self = this;
  210. return self._shallowCopy()._postCopy();
  211. return self;
  212. },
  213. source: unescape('copy%0A%09%5Eself%20shallowCopy%20postCopy%0A')}),
  214. smalltalk.Object);
  215. smalltalk.addMethod(
  216. '_shallowCopy',
  217. smalltalk.method({
  218. selector: 'shallowCopy',
  219. category: 'copying',
  220. fn: function () {
  221. var self = this;
  222. return function () {var copy = self.klass._new();for (var i in self) {if (/^@.+/.test(i)) {copy[i] = self[i];}}return copy;}();
  223. return self;
  224. },
  225. source: unescape('shallowCopy%0A%09%5E%7B%27%0A%09%20%20%20%20var%20copy%20%3D%20self.klass._new%28%29%3B%0A%09%20%20%20%20for%28var%20i%20in%20self%29%20%7B%0A%09%09if%28/%5E@.+/.test%28i%29%29%20%7B%0A%09%09%20%20%20%20copy%5Bi%5D%20%3D%20self%5Bi%5D%3B%0A%09%09%7D%0A%09%20%20%20%20%7D%0A%09%20%20%20%20return%20copy%3B%0A%09%27%7D%0A')}),
  226. smalltalk.Object);
  227. smalltalk.addMethod(
  228. '_deepCopy',
  229. smalltalk.method({
  230. selector: 'deepCopy',
  231. category: 'copying',
  232. fn: function () {
  233. var self = this;
  234. (function () {var copy = self.klass._new();for (var i in self) {if (/^@.+/.test(i)) {copy[i] = self[i]._deepCopy();}}return copy;}());
  235. return self;
  236. },
  237. source: unescape('deepCopy%0A%09%7B%27%09%20%20%20%20%0A%09%20%20%20%20var%20copy%20%3D%20self.klass._new%28%29%3B%0A%09%20%20%20%20for%28var%20i%20in%20self%29%20%7B%0A%09%09if%28/%5E@.+/.test%28i%29%29%20%7B%0A%09%09%20%20%20%20copy%5Bi%5D%20%3D%20self%5Bi%5D._deepCopy%28%29%3B%0A%09%09%7D%0A%09%20%20%20%20%7D%0A%09%20%20%20%20return%20copy%3B%0A%09%27%7D.%0A')}),
  238. smalltalk.Object);
  239. smalltalk.addMethod(
  240. '_postCopy',
  241. smalltalk.method({
  242. selector: 'postCopy',
  243. category: 'copying',
  244. fn: function () {
  245. var self = this;
  246. return self;
  247. },
  248. source: unescape('postCopy%0A')}),
  249. smalltalk.Object);
  250. smalltalk.addMethod(
  251. '__minus_gt',
  252. smalltalk.method({
  253. selector: '->',
  254. category: 'converting',
  255. fn: function (anObject) {
  256. var self = this;
  257. return smalltalk.Association._key_value_(self, anObject);
  258. return self;
  259. },
  260. source: unescape('-%3E%20anObject%0A%09%5EAssociation%20key%3A%20self%20value%3A%20anObject%0A')}),
  261. smalltalk.Object);
  262. smalltalk.addMethod(
  263. '_asString',
  264. smalltalk.method({
  265. selector: 'asString',
  266. category: 'converting',
  267. fn: function () {
  268. var self = this;
  269. return self._printString();
  270. return self;
  271. },
  272. source: unescape('asString%0A%09%5Eself%20printString%0A')}),
  273. smalltalk.Object);
  274. smalltalk.addMethod(
  275. '_asJavascript',
  276. smalltalk.method({
  277. selector: 'asJavascript',
  278. category: 'converting',
  279. fn: function () {
  280. var self = this;
  281. return self._asString();
  282. return self;
  283. },
  284. source: unescape('asJavascript%0A%09%5Eself%20asString%0A')}),
  285. smalltalk.Object);
  286. smalltalk.addMethod(
  287. '_perform_',
  288. smalltalk.method({
  289. selector: 'perform:',
  290. category: 'message handling',
  291. fn: function (aSymbol) {
  292. var self = this;
  293. return self._perform_withArguments_(aSymbol, []);
  294. return self;
  295. },
  296. source: unescape('perform%3A%20aSymbol%0A%09%5Eself%20perform%3A%20aSymbol%20withArguments%3A%20%23%28%29%0A')}),
  297. smalltalk.Object);
  298. smalltalk.addMethod(
  299. '_perform_withArguments_',
  300. smalltalk.method({
  301. selector: 'perform:withArguments:',
  302. category: 'error handling',
  303. fn: function (aSymbol, aCollection) {
  304. var self = this;
  305. return self._basicPerform_withArguments_(aSymbol._asSelector(), aCollection);
  306. return self;
  307. },
  308. source: unescape('perform%3A%20aSymbol%20withArguments%3A%20aCollection%0A%09%5Eself%20basicPerform%3A%20aSymbol%20asSelector%20withArguments%3A%20aCollection%0A')}),
  309. smalltalk.Object);
  310. smalltalk.addMethod(
  311. '_instVarAt_',
  312. smalltalk.method({
  313. selector: 'instVarAt:',
  314. category: 'accessing',
  315. fn: function (aString) {
  316. var self = this;
  317. return function () {var value = self["@" + aString];if (typeof value == "undefined") {return nil;} else {return value;}}();
  318. return self;
  319. },
  320. source: unescape('instVarAt%3A%20aString%0A%09%5E%7B%27%0A%09%20%20%20%20var%20value%20%3D%20self%5B%27%27@%27%27+aString%5D%3B%0A%09%20%20%20%20if%28typeof%28value%29%20%3D%3D%20%27%27undefined%27%27%29%20%7B%0A%09%09return%20nil%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20value%3B%0A%09%20%20%20%20%7D%0A%09%27%7D%0A')}),
  321. smalltalk.Object);
  322. smalltalk.addMethod(
  323. '_instVarAt_put_',
  324. smalltalk.method({
  325. selector: 'instVarAt:put:',
  326. category: 'accessing',
  327. fn: function (aString, anObject) {
  328. var self = this;
  329. return function () {self["@" + aString] = anObject;}();
  330. return self;
  331. },
  332. source: unescape('instVarAt%3A%20aString%20put%3A%20anObject%0A%09%5E%7B%27self%5B%27%27@%27%27%20+%20aString%5D%20%3D%20anObject%27%7D%0A')}),
  333. smalltalk.Object);
  334. smalltalk.addMethod(
  335. '_basicAt_',
  336. smalltalk.method({
  337. selector: 'basicAt:',
  338. category: 'accessing',
  339. fn: function (aString) {
  340. var self = this;
  341. return function () {var value = self[aString];if (typeof value == "undefined") {return nil;} else {return value;}}();
  342. return self;
  343. },
  344. source: unescape('basicAt%3A%20aString%0A%09%5E%7B%27%0A%09%20%20%20%20var%20value%20%3D%20self%5BaString%5D%3B%0A%09%20%20%20%20if%28typeof%28value%29%20%3D%3D%20%27%27undefined%27%27%29%20%7B%0A%09%09return%20nil%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20value%3B%0A%09%20%20%20%20%7D%0A%09%27%7D%0A')}),
  345. smalltalk.Object);
  346. smalltalk.addMethod(
  347. '_basicAt_put_',
  348. smalltalk.method({
  349. selector: 'basicAt:put:',
  350. category: 'accessing',
  351. fn: function (aString, anObject) {
  352. var self = this;
  353. return function () {return self[aString] = anObject;}();
  354. return self;
  355. },
  356. source: unescape('basicAt%3A%20aString%20put%3A%20anObject%0A%09%5E%7B%27return%20self%5BaString%5D%20%3D%20anObject%27%7D%0A')}),
  357. smalltalk.Object);
  358. smalltalk.addMethod(
  359. '_error_',
  360. smalltalk.method({
  361. selector: 'error:',
  362. category: 'error handling',
  363. fn: function (aString) {
  364. var self = this;
  365. smalltalk.Error._signal_(aString);
  366. return self;
  367. },
  368. source: unescape('error%3A%20aString%0A%09Error%20signal%3A%20aString%0A')}),
  369. smalltalk.Object);
  370. smalltalk.addMethod(
  371. '_subclassResponsibility',
  372. smalltalk.method({
  373. selector: 'subclassResponsibility',
  374. category: 'error handling',
  375. fn: function () {
  376. var self = this;
  377. self._error_("This method is a responsibility of a subclass");
  378. return self;
  379. },
  380. source: unescape('subclassResponsibility%0A%09self%20error%3A%20%27This%20method%20is%20a%20responsibility%20of%20a%20subclass%27%0A')}),
  381. smalltalk.Object);
  382. smalltalk.addMethod(
  383. '_shouldNotImplement',
  384. smalltalk.method({
  385. selector: 'shouldNotImplement',
  386. category: 'error handling',
  387. fn: function () {
  388. var self = this;
  389. self._error_("This method should not be implemented in ".__comma(self._class()._name()));
  390. return self;
  391. },
  392. source: unescape('shouldNotImplement%0A%09self%20error%3A%20%27This%20method%20should%20not%20be%20implemented%20in%20%27%2C%20self%20class%20name%0A')}),
  393. smalltalk.Object);
  394. smalltalk.addMethod(
  395. '_try_catch_',
  396. smalltalk.method({
  397. selector: 'try:catch:',
  398. category: 'error handling',
  399. fn: function (aBlock, anotherBlock) {
  400. var self = this;
  401. (function () {try {aBlock();} catch (e) {anotherBlock(e);}}());
  402. return self;
  403. },
  404. source: unescape('try%3A%20aBlock%20catch%3A%20anotherBlock%0A%09%7B%27try%7BaBlock%28%29%7D%20catch%28e%29%20%7BanotherBlock%28e%29%7D%27%7D%0A')}),
  405. smalltalk.Object);
  406. smalltalk.addMethod(
  407. '_printString',
  408. smalltalk.method({
  409. selector: 'printString',
  410. category: 'printing',
  411. fn: function () {
  412. var self = this;
  413. return "a ".__comma(self._class()._name());
  414. return self;
  415. },
  416. source: unescape('printString%0A%09%5E%27a%20%27%2C%20self%20class%20name%0A')}),
  417. smalltalk.Object);
  418. smalltalk.addMethod(
  419. '_printNl',
  420. smalltalk.method({
  421. selector: 'printNl',
  422. category: 'printing',
  423. fn: function () {
  424. var self = this;
  425. (function () {console.log(self);}());
  426. return self;
  427. },
  428. source: unescape('printNl%0A%09%7B%27console.log%28self%29%27%7D%0A')}),
  429. smalltalk.Object);
  430. smalltalk.addMethod(
  431. '_isKindOf_',
  432. smalltalk.method({
  433. selector: 'isKindOf:',
  434. category: 'testing',
  435. fn: function (aClass) {
  436. var self = this;
  437. return self._isMemberOf_(aClass)._ifTrue_ifFalse_(function () {return true;}, function () {return self._class()._inheritsFrom_(aClass);});
  438. return self;
  439. },
  440. source: unescape('isKindOf%3A%20aClass%0A%09%5E%28self%20isMemberOf%3A%20aClass%29%0A%09%20%20%20%20ifTrue%3A%20%5Btrue%5D%0A%09%20%20%20%20ifFalse%3A%20%5Bself%20class%20inheritsFrom%3A%20aClass%5D%0A')}),
  441. smalltalk.Object);
  442. smalltalk.addMethod(
  443. '_isMemberOf_',
  444. smalltalk.method({
  445. selector: 'isMemberOf:',
  446. category: 'testing',
  447. fn: function (aClass) {
  448. var self = this;
  449. return self._class().__eq(aClass);
  450. return self;
  451. },
  452. source: unescape('isMemberOf%3A%20aClass%0A%09%5Eself%20class%20%3D%20aClass%0A')}),
  453. smalltalk.Object);
  454. smalltalk.addMethod(
  455. '_ifNil_',
  456. smalltalk.method({
  457. selector: 'ifNil:',
  458. category: 'testing',
  459. fn: function (aBlock) {
  460. var self = this;
  461. return self;
  462. return self;
  463. },
  464. source: unescape('ifNil%3A%20aBlock%0A%09%5Eself%0A')}),
  465. smalltalk.Object);
  466. smalltalk.addMethod(
  467. '_ifNil_ifNotNil_',
  468. smalltalk.method({
  469. selector: 'ifNil:ifNotNil:',
  470. category: 'testing',
  471. fn: function (aBlock, anotherBlock) {
  472. var self = this;
  473. return anotherBlock._value();
  474. return self;
  475. },
  476. source: unescape('ifNil%3A%20aBlock%20ifNotNil%3A%20anotherBlock%0A%09%5EanotherBlock%20value%0A')}),
  477. smalltalk.Object);
  478. smalltalk.addMethod(
  479. '_ifNotNil_',
  480. smalltalk.method({
  481. selector: 'ifNotNil:',
  482. category: 'testing',
  483. fn: function (aBlock) {
  484. var self = this;
  485. return aBlock._value();
  486. return self;
  487. },
  488. source: unescape('ifNotNil%3A%20aBlock%0A%09%5EaBlock%20value%0A')}),
  489. smalltalk.Object);
  490. smalltalk.addMethod(
  491. '_ifNotNil_ifNil_',
  492. smalltalk.method({
  493. selector: 'ifNotNil:ifNil:',
  494. category: 'testing',
  495. fn: function (aBlock, anotherBlock) {
  496. var self = this;
  497. return aBlock._value();
  498. return self;
  499. },
  500. source: unescape('ifNotNil%3A%20aBlock%20ifNil%3A%20anotherBlock%0A%09%5EaBlock%20value%0A')}),
  501. smalltalk.Object);
  502. smalltalk.addMethod(
  503. '_isNil',
  504. smalltalk.method({
  505. selector: 'isNil',
  506. category: 'testing',
  507. fn: function () {
  508. var self = this;
  509. return false;
  510. return self;
  511. },
  512. source: unescape('isNil%0A%09%5Efalse%0A')}),
  513. smalltalk.Object);
  514. smalltalk.addMethod(
  515. '_notNil',
  516. smalltalk.method({
  517. selector: 'notNil',
  518. category: 'testing',
  519. fn: function () {
  520. var self = this;
  521. return self._isNil()._not();
  522. return self;
  523. },
  524. source: unescape('notNil%0A%09%5Eself%20isNil%20not%0A')}),
  525. smalltalk.Object);
  526. smalltalk.addMethod(
  527. '_isClass',
  528. smalltalk.method({
  529. selector: 'isClass',
  530. category: 'testing',
  531. fn: function () {
  532. var self = this;
  533. return false;
  534. return self;
  535. },
  536. source: unescape('isClass%0A%09%5Efalse%0A')}),
  537. smalltalk.Object);
  538. smalltalk.addMethod(
  539. '_isMetaclass',
  540. smalltalk.method({
  541. selector: 'isMetaclass',
  542. category: 'testing',
  543. fn: function () {
  544. var self = this;
  545. return false;
  546. return self;
  547. },
  548. source: unescape('isMetaclass%0A%09%5Efalse%0A')}),
  549. smalltalk.Object);
  550. smalltalk.addMethod(
  551. '_isNumber',
  552. smalltalk.method({
  553. selector: 'isNumber',
  554. category: 'testing',
  555. fn: function () {
  556. var self = this;
  557. return false;
  558. return self;
  559. },
  560. source: unescape('isNumber%0A%09%5Efalse%0A')}),
  561. smalltalk.Object);
  562. smalltalk.addMethod(
  563. '_isString',
  564. smalltalk.method({
  565. selector: 'isString',
  566. category: 'testing',
  567. fn: function () {
  568. var self = this;
  569. return false;
  570. return self;
  571. },
  572. source: unescape('isString%0A%09%5Efalse%0A')}),
  573. smalltalk.Object);
  574. smalltalk.addMethod(
  575. '_isParseFailure',
  576. smalltalk.method({
  577. selector: 'isParseFailure',
  578. category: 'testing',
  579. fn: function () {
  580. var self = this;
  581. return false;
  582. return self;
  583. },
  584. source: unescape('isParseFailure%0A%09%5Efalse%0A')}),
  585. smalltalk.Object);
  586. smalltalk.addMethod(
  587. '_basicPerform_',
  588. smalltalk.method({
  589. selector: 'basicPerform:',
  590. category: 'error handling',
  591. fn: function (aSymbol) {
  592. var self = this;
  593. return self._basicPerform_withArguments_(aSymbol, []);
  594. return self;
  595. },
  596. source: unescape('basicPerform%3A%20aSymbol%20%0A%20%20%20%20%5Eself%20basicPerform%3A%20aSymbol%20withArguments%3A%20%23%28%29%0A')}),
  597. smalltalk.Object);
  598. smalltalk.addMethod(
  599. '_basicPerform_withArguments_',
  600. smalltalk.method({
  601. selector: 'basicPerform:withArguments:',
  602. category: 'error handling',
  603. fn: function (aSymbol, aCollection) {
  604. var self = this;
  605. return function () {return self[aSymbol].apply(self, aCollection);}();
  606. return self;
  607. },
  608. source: unescape('basicPerform%3A%20aSymbol%20withArguments%3A%20aCollection%0A%09%5E%7B%27return%20self%5BaSymbol%5D.apply%28self%2C%20aCollection%29%3B%27%7D%0A')}),
  609. smalltalk.Object);
  610. smalltalk.addMethod(
  611. '_appendToBrush_',
  612. smalltalk.method({
  613. selector: 'appendToBrush:',
  614. category: '*Canvas',
  615. fn: function (aTagBrush) {
  616. var self = this;
  617. aTagBrush._append_(self._asString());
  618. return self;
  619. },
  620. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20aTagBrush%20append%3A%20self%20asString%0A')}),
  621. smalltalk.Object);
  622. smalltalk.addMethod(
  623. '_basicDelete_',
  624. smalltalk.method({
  625. selector: 'basicDelete:',
  626. category: 'accessing',
  627. fn: function (aString) {
  628. var self = this;
  629. (function () {delete self[aString];}());
  630. return self;
  631. },
  632. source: unescape('basicDelete%3A%20aString%0A%20%20%20%20%7B%27delete%20self%5BaString%5D%27%7D%0A')}),
  633. smalltalk.Object);
  634. smalltalk.addMethod(
  635. '_inspect',
  636. smalltalk.method({
  637. selector: 'inspect',
  638. category: '*IDE',
  639. fn: function () {
  640. var self = this;
  641. (function ($rec) {$rec._inspect_(self);return $rec._open();}(smalltalk.Inspector._new()));
  642. return self;
  643. },
  644. source: unescape('inspect%0A%09Inspector%20new%20%0A%09%09inspect%3A%20self%3B%0A%09%09open')}),
  645. smalltalk.Object);
  646. smalltalk.addMethod(
  647. '_inspectOn_',
  648. smalltalk.method({
  649. selector: 'inspectOn:',
  650. category: '*IDE',
  651. fn: function (anInspector) {
  652. var self = this;
  653. var variables = nil;
  654. variables = smalltalk.Dictionary._new();
  655. variables._at_put_(unescape("%23self"), self);
  656. self._class()._instanceVariableNames()._do_(function (each) {return variables._at_put_(each, self._instVarAt_(each));});
  657. (function ($rec) {$rec._setLabel_(self._printString());return $rec._setVariables_(variables);}(anInspector));
  658. return self;
  659. },
  660. source: unescape('inspectOn%3A%20anInspector%0A%09%7C%20variables%20%7C%0A%09variables%20%3A%3D%20Dictionary%20new.%0A%09variables%20at%3A%20%27%23self%27%20put%3A%20self.%0A%09self%20class%20instanceVariableNames%20do%3A%20%5B%3Aeach%20%7C%0A%09%09variables%20at%3A%20each%20put%3A%20%28self%20instVarAt%3A%20each%29%5D.%0A%09anInspector%20%0A%09%09setLabel%3A%20self%20printString%3B%0A%09%09setVariables%3A%20variables%0A%09%0A%09')}),
  661. smalltalk.Object);
  662. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel');
  663. smalltalk.addMethod(
  664. '_classes',
  665. smalltalk.method({
  666. selector: 'classes',
  667. category: 'accessing',
  668. fn: function () {
  669. var self = this;
  670. return function () {return self.classes();}();
  671. return self;
  672. },
  673. source: unescape('classes%0A%09%5E%7B%27return%20self.classes%28%29%27%7D%0A')}),
  674. smalltalk.Smalltalk);
  675. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  676. smalltalk.addMethod(
  677. '_current',
  678. smalltalk.method({
  679. selector: 'current',
  680. category: 'accessing',
  681. fn: function () {
  682. var self = this;
  683. return function () {return smalltalk;}();
  684. return self;
  685. },
  686. source: unescape('current%0A%09%20%20%20%20%5E%7B%27return%20smalltalk%27%7D%0A')}),
  687. smalltalk.Smalltalk.klass);
  688. smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel');
  689. smalltalk.addMethod(
  690. '_new',
  691. smalltalk.method({
  692. selector: 'new',
  693. category: 'instance creation',
  694. fn: function () {
  695. var self = this;
  696. return function ($rec) {$rec._initialize();return $rec._yourself();}(self._basicNew());
  697. return self;
  698. },
  699. source: unescape('new%0A%09%5Eself%20basicNew%20%0A%09%20%20%20%20initialize%3B%0A%09%20%20%20%20yourself%0A')}),
  700. smalltalk.Behavior);
  701. smalltalk.addMethod(
  702. '_basicNew',
  703. smalltalk.method({
  704. selector: 'basicNew',
  705. category: 'instance creation',
  706. fn: function () {
  707. var self = this;
  708. return function () {return new self.fn;}();
  709. return self;
  710. },
  711. source: unescape('basicNew%0A%09%5E%7B%27return%20new%20self.fn%28%29%3B%27%7D%0A')}),
  712. smalltalk.Behavior);
  713. smalltalk.addMethod(
  714. '_name',
  715. smalltalk.method({
  716. selector: 'name',
  717. category: 'accessing',
  718. fn: function () {
  719. var self = this;
  720. return function () {return self.className || nil;}();
  721. return self;
  722. },
  723. source: unescape('name%0A%09%5E%7B%27return%20self.className%20%7C%7C%20nil%27%7D%0A')}),
  724. smalltalk.Behavior);
  725. smalltalk.addMethod(
  726. '_superclass',
  727. smalltalk.method({
  728. selector: 'superclass',
  729. category: 'accessing',
  730. fn: function () {
  731. var self = this;
  732. return function () {return self.superclass || nil;}();
  733. return self;
  734. },
  735. source: unescape('superclass%0A%09%5E%7B%27return%20self.superclass%20%7C%7C%20nil%27%7D%0A')}),
  736. smalltalk.Behavior);
  737. smalltalk.addMethod(
  738. '_subclasses',
  739. smalltalk.method({
  740. selector: 'subclasses',
  741. category: 'accessing',
  742. fn: function () {
  743. var self = this;
  744. return function () {return smalltalk.subclasses(self);}();
  745. return self;
  746. },
  747. source: unescape('subclasses%0A%09%5E%7B%27return%20smalltalk.subclasses%28self%29%27%7D%0A')}),
  748. smalltalk.Behavior);
  749. smalltalk.addMethod(
  750. '_allSubclasses',
  751. smalltalk.method({
  752. selector: 'allSubclasses',
  753. category: 'accessing',
  754. fn: function () {
  755. var self = this;
  756. var result = nil;
  757. result = self._subclasses();
  758. self._subclasses()._do_(function (each) {return result._addAll_(each._allSubclasses());});
  759. return result;
  760. return self;
  761. },
  762. 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%0A')}),
  763. smalltalk.Behavior);
  764. smalltalk.addMethod(
  765. '_withAllSubclasses',
  766. smalltalk.method({
  767. selector: 'withAllSubclasses',
  768. category: 'accessing',
  769. fn: function () {
  770. var self = this;
  771. return function ($rec) {$rec._addAll_(self._allSubclasses());return $rec._yourself();}(smalltalk.Array._with_(self));
  772. return self;
  773. },
  774. source: unescape('withAllSubclasses%0A%09%5E%28Array%20with%3A%20self%29%20addAll%3A%20self%20allSubclasses%3B%20yourself%0A')}),
  775. smalltalk.Behavior);
  776. smalltalk.addMethod(
  777. '_prototype',
  778. smalltalk.method({
  779. selector: 'prototype',
  780. category: 'accessing',
  781. fn: function () {
  782. var self = this;
  783. return function () {return self.fn.prototype;}();
  784. return self;
  785. },
  786. source: unescape('prototype%0A%09%5E%7B%27return%20self.fn.prototype%27%7D%0A')}),
  787. smalltalk.Behavior);
  788. smalltalk.addMethod(
  789. '_methodDictionary',
  790. smalltalk.method({
  791. selector: 'methodDictionary',
  792. category: 'accessing',
  793. fn: function () {
  794. var self = this;
  795. return function () {var dict = smalltalk.Dictionary._new();var methods = self.fn.prototype.methods;for (var i in methods) {if (methods[i].selector) {dict._at_put_(methods[i].selector, methods[i]);}}return dict;}();
  796. return self;
  797. },
  798. source: unescape('methodDictionary%0A%09%5E%7B%27var%20dict%20%3D%20smalltalk.Dictionary._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%27%7D%0A')}),
  799. smalltalk.Behavior);
  800. smalltalk.addMethod(
  801. '_instVarNames',
  802. smalltalk.method({
  803. selector: 'instVarNames',
  804. category: '',
  805. fn: function () {
  806. var self = this;
  807. return function () {return self.iVarNames;}();
  808. return self;
  809. },
  810. source: unescape('')}),
  811. smalltalk.Behavior);
  812. smalltalk.addMethod(
  813. '_methodsFor_',
  814. smalltalk.method({
  815. selector: 'methodsFor:',
  816. category: 'accessing',
  817. fn: function (aString) {
  818. var self = this;
  819. return function ($rec) {$rec._class_category_(self, aString);return $rec._yourself();}(smalltalk.ClassCategoryReader._new());
  820. return self;
  821. },
  822. 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%0A')}),
  823. smalltalk.Behavior);
  824. smalltalk.addMethod(
  825. '_addCompiledMethod_',
  826. smalltalk.method({
  827. selector: 'addCompiledMethod:',
  828. category: 'accessing',
  829. fn: function (aMethod) {
  830. var self = this;
  831. (function () {self.fn.prototype[aMethod.selector._asSelector()] = aMethod.fn;self.fn.prototype.methods[aMethod.selector] = aMethod;}());
  832. return self;
  833. },
  834. source: unescape('addCompiledMethod%3A%20aMethod%0A%09%7B%27self.fn.prototype%5BaMethod.selector._asSelector%28%29%5D%20%3D%20aMethod.fn%3B%0A%09self.fn.prototype.methods%5BaMethod.selector%5D%20%3D%20aMethod%27%7D%0A')}),
  835. smalltalk.Behavior);
  836. smalltalk.addMethod(
  837. '_instanceVariableNames',
  838. smalltalk.method({
  839. selector: 'instanceVariableNames',
  840. category: 'accessing',
  841. fn: function () {
  842. var self = this;
  843. return function () {return self.iVarNames;}();
  844. return self;
  845. },
  846. source: unescape('instanceVariableNames%0A%09%5E%7B%27return%20self.iVarNames%27%7D%0A')}),
  847. smalltalk.Behavior);
  848. smalltalk.addMethod(
  849. '_comment',
  850. smalltalk.method({
  851. selector: 'comment',
  852. category: 'accessing',
  853. fn: function () {
  854. var self = this;
  855. return self._basicAt_("comment")._ifNil_(function () {return "";});
  856. return self;
  857. },
  858. source: unescape('comment%0A%20%20%20%20%5E%28self%20basicAt%3A%20%27comment%27%29%20ifNil%3A%20%5B%27%27%5D%0A')}),
  859. smalltalk.Behavior);
  860. smalltalk.addMethod(
  861. '_comment_',
  862. smalltalk.method({
  863. selector: 'comment:',
  864. category: 'accessing',
  865. fn: function (aString) {
  866. var self = this;
  867. self._basicAt_put_("comment", aString);
  868. return self;
  869. },
  870. source: unescape('comment%3A%20aString%0A%20%20%20%20self%20basicAt%3A%20%27comment%27%20put%3A%20aString%0A')}),
  871. smalltalk.Behavior);
  872. smalltalk.addMethod(
  873. '_commentStamp',
  874. smalltalk.method({
  875. selector: 'commentStamp',
  876. category: 'accessing',
  877. fn: function () {
  878. var self = this;
  879. return function ($rec) {$rec._class_(self);return $rec._yourself();}(smalltalk.ClassCommentReader._new());
  880. return self;
  881. },
  882. source: unescape('commentStamp%0A%20%20%20%20%5EClassCommentReader%20new%0A%09class%3A%20self%3B%0A%09yourself%0A')}),
  883. smalltalk.Behavior);
  884. smalltalk.addMethod(
  885. '_removeCompiledMethod_',
  886. smalltalk.method({
  887. selector: 'removeCompiledMethod:',
  888. category: 'accessing',
  889. fn: function (aMethod) {
  890. var self = this;
  891. (function () {delete self.fn.prototype[aMethod.selector._asSelector()];delete self.fn.prototype.methods[aMethod.selector];}());
  892. return self;
  893. },
  894. source: unescape('removeCompiledMethod%3A%20aMethod%0A%09%7B%27delete%20self.fn.prototype%5BaMethod.selector._asSelector%28%29%5D%3B%0A%09delete%20self.fn.prototype.methods%5BaMethod.selector%5D%27%7D%0A')}),
  895. smalltalk.Behavior);
  896. smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel');
  897. smalltalk.addMethod(
  898. '_category',
  899. smalltalk.method({
  900. selector: 'category',
  901. category: 'accessing',
  902. fn: function () {
  903. var self = this;
  904. return function () {return self.category;}();
  905. return self;
  906. },
  907. source: unescape('category%0A%09%5E%7B%27return%20self.category%27%7D%0A')}),
  908. smalltalk.Class);
  909. smalltalk.addMethod(
  910. '_category_',
  911. smalltalk.method({
  912. selector: 'category:',
  913. category: 'accessing',
  914. fn: function (aString) {
  915. var self = this;
  916. (function () {self.category = aString;}());
  917. return self;
  918. },
  919. source: unescape('category%3A%20aString%0A%09%7B%27self.category%20%3D%20aString%27%7D%0A')}),
  920. smalltalk.Class);
  921. smalltalk.addMethod(
  922. '_subclass_instanceVariableNames_',
  923. smalltalk.method({
  924. selector: 'subclass:instanceVariableNames:',
  925. category: 'class creation',
  926. fn: function (aString, anotherString) {
  927. var self = this;
  928. return self._subclass_instanceVariableNames_category_(aString, anotherString, nil);
  929. return self;
  930. },
  931. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%0A%09%5Eself%20subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%20category%3A%20nil%0A')}),
  932. smalltalk.Class);
  933. smalltalk.addMethod(
  934. '_subclass_instanceVariableNames_category_',
  935. smalltalk.method({
  936. selector: 'subclass:instanceVariableNames:category:',
  937. category: 'class creation',
  938. fn: function (aString, aString2, aString3) {
  939. var self = this;
  940. return smalltalk.ClassBuilder._new()._superclass_subclass_instanceVariableNames_category_(self, aString, aString2, aString3);
  941. return self;
  942. },
  943. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A%09%5EClassBuilder%20new%0A%09%20%20%20%20superclass%3A%20self%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A')}),
  944. smalltalk.Class);
  945. smalltalk.addMethod(
  946. '_isClass',
  947. smalltalk.method({
  948. selector: 'isClass',
  949. category: 'testing',
  950. fn: function () {
  951. var self = this;
  952. return true;
  953. return self;
  954. },
  955. source: unescape('isClass%0A%09%5Etrue%0A')}),
  956. smalltalk.Class);
  957. smalltalk.addMethod(
  958. '_printString',
  959. smalltalk.method({
  960. selector: 'printString',
  961. category: 'printing',
  962. fn: function () {
  963. var self = this;
  964. return self._name();
  965. return self;
  966. },
  967. source: unescape('printString%0A%09%5Eself%20name%0A')}),
  968. smalltalk.Class);
  969. smalltalk.addMethod(
  970. '_rename_',
  971. smalltalk.method({
  972. selector: 'rename:',
  973. category: 'accessing',
  974. fn: function (aString) {
  975. var self = this;
  976. (function () {smalltalk[aString] = self;delete smalltalk[self.className];self.className = aString;}());
  977. return self;
  978. },
  979. source: unescape('rename%3A%20aString%0A%09%7B%27%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%27%7D')}),
  980. smalltalk.Class);
  981. smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel');
  982. smalltalk.addMethod(
  983. '_instanceClass',
  984. smalltalk.method({
  985. selector: 'instanceClass',
  986. category: 'accessing',
  987. fn: function () {
  988. var self = this;
  989. return function () {return self.instanceClass;}();
  990. return self;
  991. },
  992. source: unescape('instanceClass%0A%09%5E%7B%27return%20self.instanceClass%27%7D%0A')}),
  993. smalltalk.Metaclass);
  994. smalltalk.addMethod(
  995. '_instanceVariableNames_',
  996. smalltalk.method({
  997. selector: 'instanceVariableNames:',
  998. category: 'accessing',
  999. fn: function (aCollection) {
  1000. var self = this;
  1001. smalltalk.ClassBuilder._new()._class_instanceVariableNames_(self, aCollection);
  1002. return self;
  1003. },
  1004. source: unescape('instanceVariableNames%3A%20aCollection%0A%09ClassBuilder%20new%0A%09%20%20%20%20class%3A%20self%20instanceVariableNames%3A%20aCollection%0A')}),
  1005. smalltalk.Metaclass);
  1006. smalltalk.addMethod(
  1007. '_isMetaclass',
  1008. smalltalk.method({
  1009. selector: 'isMetaclass',
  1010. category: 'testing',
  1011. fn: function () {
  1012. var self = this;
  1013. return true;
  1014. return self;
  1015. },
  1016. source: unescape('isMetaclass%0A%09%5Etrue%0A')}),
  1017. smalltalk.Metaclass);
  1018. smalltalk.addMethod(
  1019. '_printString',
  1020. smalltalk.method({
  1021. selector: 'printString',
  1022. category: 'printing',
  1023. fn: function () {
  1024. var self = this;
  1025. return self._instanceClass()._name().__comma(" class");
  1026. return self;
  1027. },
  1028. source: unescape('printString%0A%09%5Eself%20instanceClass%20name%2C%20%27%20class%27%0A')}),
  1029. smalltalk.Metaclass);
  1030. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel');
  1031. smalltalk.addMethod(
  1032. '_source',
  1033. smalltalk.method({
  1034. selector: 'source',
  1035. category: 'accessing',
  1036. fn: function () {
  1037. var self = this;
  1038. return self._basicAt_("source")._ifNil_(function () {return "";});
  1039. return self;
  1040. },
  1041. source: unescape('source%0A%09%5E%28self%20basicAt%3A%20%27source%27%29%20ifNil%3A%20%5B%27%27%5D%0A')}),
  1042. smalltalk.CompiledMethod);
  1043. smalltalk.addMethod(
  1044. '_source_',
  1045. smalltalk.method({
  1046. selector: 'source:',
  1047. category: 'accessing',
  1048. fn: function (aString) {
  1049. var self = this;
  1050. self._basicAt_put_("source", aString);
  1051. return self;
  1052. },
  1053. source: unescape('source%3A%20aString%0A%09self%20basicAt%3A%20%27source%27%20put%3A%20aString%0A')}),
  1054. smalltalk.CompiledMethod);
  1055. smalltalk.addMethod(
  1056. '_category',
  1057. smalltalk.method({
  1058. selector: 'category',
  1059. category: 'accessing',
  1060. fn: function () {
  1061. var self = this;
  1062. return self._basicAt_("category")._ifNil_(function () {return "";});
  1063. return self;
  1064. },
  1065. source: unescape('category%0A%09%5E%28self%20basicAt%3A%20%27category%27%29%20ifNil%3A%20%5B%27%27%5D%0A')}),
  1066. smalltalk.CompiledMethod);
  1067. smalltalk.addMethod(
  1068. '_category_',
  1069. smalltalk.method({
  1070. selector: 'category:',
  1071. category: 'accessing',
  1072. fn: function (aString) {
  1073. var self = this;
  1074. self._basicAt_put_("category", aString);
  1075. return self;
  1076. },
  1077. source: unescape('category%3A%20aString%0A%09self%20basicAt%3A%20%27category%27%20put%3A%20aString%0A')}),
  1078. smalltalk.CompiledMethod);
  1079. smalltalk.addMethod(
  1080. '_selector',
  1081. smalltalk.method({
  1082. selector: 'selector',
  1083. category: 'accessing',
  1084. fn: function () {
  1085. var self = this;
  1086. return self._basicAt_("selector");
  1087. return self;
  1088. },
  1089. source: unescape('selector%0A%09%5Eself%20basicAt%3A%20%27selector%27%0A')}),
  1090. smalltalk.CompiledMethod);
  1091. smalltalk.addMethod(
  1092. '_selector_',
  1093. smalltalk.method({
  1094. selector: 'selector:',
  1095. category: 'accessing',
  1096. fn: function (aString) {
  1097. var self = this;
  1098. self._basicAt_put_("selector", aString);
  1099. return self;
  1100. },
  1101. source: unescape('selector%3A%20aString%0A%09self%20basicAt%3A%20%27selector%27%20put%3A%20aString%0A')}),
  1102. smalltalk.CompiledMethod);
  1103. smalltalk.addMethod(
  1104. '_fn',
  1105. smalltalk.method({
  1106. selector: 'fn',
  1107. category: 'accessing',
  1108. fn: function () {
  1109. var self = this;
  1110. return self._basicAt_("fn");
  1111. return self;
  1112. },
  1113. source: unescape('fn%0A%09%5Eself%20basicAt%3A%20%27fn%27%0A')}),
  1114. smalltalk.CompiledMethod);
  1115. smalltalk.addMethod(
  1116. '_fn_',
  1117. smalltalk.method({
  1118. selector: 'fn:',
  1119. category: 'accessing',
  1120. fn: function (aBlock) {
  1121. var self = this;
  1122. self._basicAt_put_("fn", aBlock);
  1123. return self;
  1124. },
  1125. source: unescape('fn%3A%20aBlock%0A%09self%20basicAt%3A%20%27fn%27%20put%3A%20aBlock%0A')}),
  1126. smalltalk.CompiledMethod);
  1127. smalltalk.addClass('Number', smalltalk.Object, [], 'Kernel');
  1128. smalltalk.addMethod(
  1129. '__eq',
  1130. smalltalk.method({
  1131. selector: '=',
  1132. category: 'comparing',
  1133. fn: function (aNumber) {
  1134. var self = this;
  1135. return function () {return Number(self) == aNumber;}();
  1136. return self;
  1137. },
  1138. source: unescape('%3D%20aNumber%0A%09%5E%7B%27return%20Number%28self%29%20%3D%3D%20aNumber%27%7D%0A')}),
  1139. smalltalk.Number);
  1140. smalltalk.addMethod(
  1141. '__gt',
  1142. smalltalk.method({
  1143. selector: '>',
  1144. category: 'comparing',
  1145. fn: function (aNumber) {
  1146. var self = this;
  1147. return function () {return self > aNumber;}();
  1148. return self;
  1149. },
  1150. source: unescape('%3E%20aNumber%0A%09%5E%7B%27return%20self%20%3E%20aNumber%27%7D%0A')}),
  1151. smalltalk.Number);
  1152. smalltalk.addMethod(
  1153. '__lt',
  1154. smalltalk.method({
  1155. selector: '<',
  1156. category: 'comparing',
  1157. fn: function (aNumber) {
  1158. var self = this;
  1159. return function () {return self < aNumber;}();
  1160. return self;
  1161. },
  1162. source: unescape('%3C%20aNumber%0A%09%5E%7B%27return%20self%20%3C%20aNumber%27%7D%0A')}),
  1163. smalltalk.Number);
  1164. smalltalk.addMethod(
  1165. '__gt_eq',
  1166. smalltalk.method({
  1167. selector: '>=',
  1168. category: 'comparing',
  1169. fn: function (aNumber) {
  1170. var self = this;
  1171. return function () {return self >= aNumber;}();
  1172. return self;
  1173. },
  1174. source: unescape('%3E%3D%20aNumber%0A%09%5E%7B%27return%20self%20%3E%3D%20aNumber%27%7D%0A')}),
  1175. smalltalk.Number);
  1176. smalltalk.addMethod(
  1177. '__lt_eq',
  1178. smalltalk.method({
  1179. selector: '<=',
  1180. category: 'comparing',
  1181. fn: function (aNumber) {
  1182. var self = this;
  1183. return function () {return self <= aNumber;}();
  1184. return self;
  1185. },
  1186. source: unescape('%3C%3D%20aNumber%0A%09%5E%7B%27return%20self%20%3C%3D%20aNumber%27%7D%0A')}),
  1187. smalltalk.Number);
  1188. smalltalk.addMethod(
  1189. '__plus',
  1190. smalltalk.method({
  1191. selector: '+',
  1192. category: 'arithmetic',
  1193. fn: function (aNumber) {
  1194. var self = this;
  1195. return function () {return self + aNumber;}();
  1196. return self;
  1197. },
  1198. source: unescape('+%20aNumber%0A%09%5E%7B%27return%20self%20+%20aNumber%27%7D%0A')}),
  1199. smalltalk.Number);
  1200. smalltalk.addMethod(
  1201. '__minus',
  1202. smalltalk.method({
  1203. selector: '-',
  1204. category: 'arithmetic',
  1205. fn: function (aNumber) {
  1206. var self = this;
  1207. return function () {return self - aNumber;}();
  1208. return self;
  1209. },
  1210. source: unescape('-%20aNumber%0A%09%5E%7B%27return%20self%20-%20aNumber%27%7D%0A')}),
  1211. smalltalk.Number);
  1212. smalltalk.addMethod(
  1213. '__star',
  1214. smalltalk.method({
  1215. selector: '*',
  1216. category: 'arithmetic',
  1217. fn: function (aNumber) {
  1218. var self = this;
  1219. return function () {return self * aNumber;}();
  1220. return self;
  1221. },
  1222. source: unescape('*%20aNumber%0A%09%5E%7B%27return%20self%20*%20aNumber%27%7D%0A')}),
  1223. smalltalk.Number);
  1224. smalltalk.addMethod(
  1225. '__slash',
  1226. smalltalk.method({
  1227. selector: '/',
  1228. category: 'arithmetic',
  1229. fn: function (aNumber) {
  1230. var self = this;
  1231. return function () {return self / aNumber;}();
  1232. return self;
  1233. },
  1234. source: unescape('/%20aNumber%0A%09%5E%7B%27return%20self%20/%20aNumber%27%7D%0A')}),
  1235. smalltalk.Number);
  1236. smalltalk.addMethod(
  1237. '_max_',
  1238. smalltalk.method({
  1239. selector: 'max:',
  1240. category: 'arithmetic',
  1241. fn: function (aNumber) {
  1242. var self = this;
  1243. return function () {return Math.max(self, aNumber);}();
  1244. return self;
  1245. },
  1246. source: unescape('max%3A%20aNumber%0A%09%5E%7B%27return%20Math.max%28self%2C%20aNumber%29%3B%27%7D%0A')}),
  1247. smalltalk.Number);
  1248. smalltalk.addMethod(
  1249. '_min_',
  1250. smalltalk.method({
  1251. selector: 'min:',
  1252. category: 'arithmetic',
  1253. fn: function (aNumber) {
  1254. var self = this;
  1255. return function () {return Math.min(self, aNumber);}();
  1256. return self;
  1257. },
  1258. source: unescape('min%3A%20aNumber%0A%09%5E%7B%27return%20Math.min%28self%2C%20aNumber%29%3B%27%7D%0A')}),
  1259. smalltalk.Number);
  1260. smalltalk.addMethod(
  1261. '_rounded',
  1262. smalltalk.method({
  1263. selector: 'rounded',
  1264. category: 'converting',
  1265. fn: function () {
  1266. var self = this;
  1267. return function () {return Math.round(self);}();
  1268. return self;
  1269. },
  1270. source: unescape('rounded%0A%09%5E%7B%27return%20Math.round%28self%29%3B%27%7D%0A')}),
  1271. smalltalk.Number);
  1272. smalltalk.addMethod(
  1273. '_truncated',
  1274. smalltalk.method({
  1275. selector: 'truncated',
  1276. category: 'converting',
  1277. fn: function () {
  1278. var self = this;
  1279. return function () {return Math.floor(self);}();
  1280. return self;
  1281. },
  1282. source: unescape('truncated%0A%09%5E%7B%27return%20Math.floor%28self%29%3B%27%7D%0A')}),
  1283. smalltalk.Number);
  1284. smalltalk.addMethod(
  1285. '_to_',
  1286. smalltalk.method({
  1287. selector: 'to:',
  1288. category: 'converting',
  1289. fn: function (aNumber) {
  1290. var self = this;
  1291. var array = nil;
  1292. var first = nil;
  1293. var last = nil;
  1294. var count = nil;
  1295. first = self._truncated();
  1296. last = aNumber._truncated().__plus(1);
  1297. count = 1;
  1298. first.__lt_eq(last)._ifFalse_(function () {return self._error_("Wrong interval");});
  1299. array = smalltalk.Array._new();
  1300. last.__minus(first)._timesRepeat_(function () {array._at_put_(count, first);count = count.__plus(1);return first = first.__plus(1);});
  1301. return array;
  1302. return self;
  1303. },
  1304. source: unescape('to%3A%20aNumber%0A%09%7C%20array%20first%20last%20count%20%7C%0A%09first%20%3A%3D%20self%20truncated.%0A%09last%20%3A%3D%20aNumber%20truncated%20+%201.%0A%09count%20%3A%3D%201.%0A%09%28first%20%3C%3D%20last%29%20ifFalse%3A%20%5Bself%20error%3A%20%27Wrong%20interval%27%5D.%0A%09array%20%3A%3D%20Array%20new.%0A%09%28last%20-%20first%29%20timesRepeat%3A%20%5B%0A%09%20%20%20%20array%20at%3A%20count%20put%3A%20first.%0A%09%20%20%20%20count%20%3A%3D%20count%20+%201.%0A%09%20%20%20%20first%20%3A%3D%20first%20+%201%5D.%0A%09%5Earray%0A')}),
  1305. smalltalk.Number);
  1306. smalltalk.addMethod(
  1307. '_timesRepeat_',
  1308. smalltalk.method({
  1309. selector: 'timesRepeat:',
  1310. category: 'enumerating',
  1311. fn: function (aBlock) {
  1312. var self = this;
  1313. var integer = nil;
  1314. var count = nil;
  1315. integer = self._truncated();
  1316. count = 1;
  1317. (function () {return count.__gt(self);}._whileFalse_(function () {aBlock._value();return count = count.__plus(1);}));
  1318. return self;
  1319. },
  1320. source: unescape('timesRepeat%3A%20aBlock%0A%09%7C%20integer%20count%20%7C%0A%09integer%20%3A%3D%20self%20truncated.%0A%09count%20%3A%3D%201.%0A%09%5Bcount%20%3E%20self%5D%20whileFalse%3A%20%5B%0A%09%20%20%20%20aBlock%20value.%0A%09%20%20%20%20count%20%3A%3D%20count%20+%201%5D%0A')}),
  1321. smalltalk.Number);
  1322. smalltalk.addMethod(
  1323. '_to_do_',
  1324. smalltalk.method({
  1325. selector: 'to:do:',
  1326. category: 'enumerating',
  1327. fn: function (aNumber, aBlock) {
  1328. var self = this;
  1329. return self._to_(aNumber)._do_(aBlock);
  1330. return self;
  1331. },
  1332. source: unescape('to%3A%20aNumber%20do%3A%20aBlock%0A%09%5E%28self%20to%3A%20aNumber%29%20do%3A%20aBlock%0A')}),
  1333. smalltalk.Number);
  1334. smalltalk.addMethod(
  1335. '_asString',
  1336. smalltalk.method({
  1337. selector: 'asString',
  1338. category: 'converting',
  1339. fn: function () {
  1340. var self = this;
  1341. return self._printString();
  1342. return self;
  1343. },
  1344. source: unescape('asString%0A%09%5Eself%20printString%0A')}),
  1345. smalltalk.Number);
  1346. smalltalk.addMethod(
  1347. '_asJavascript',
  1348. smalltalk.method({
  1349. selector: 'asJavascript',
  1350. category: 'converting',
  1351. fn: function () {
  1352. var self = this;
  1353. return unescape("%28").__comma(self._printString()).__comma(unescape("%29"));
  1354. return self;
  1355. },
  1356. source: unescape('asJavascript%0A%09%5E%27%28%27%2C%20self%20printString%2C%20%27%29%27%0A')}),
  1357. smalltalk.Number);
  1358. smalltalk.addMethod(
  1359. '_printString',
  1360. smalltalk.method({
  1361. selector: 'printString',
  1362. category: 'printing',
  1363. fn: function () {
  1364. var self = this;
  1365. return function () {return String(self);}();
  1366. return self;
  1367. },
  1368. source: unescape('printString%0A%09%5E%7B%27return%20String%28self%29%27%7D%0A')}),
  1369. smalltalk.Number);
  1370. smalltalk.addMethod(
  1371. '_isNumber',
  1372. smalltalk.method({
  1373. selector: 'isNumber',
  1374. category: 'testing',
  1375. fn: function () {
  1376. var self = this;
  1377. return true;
  1378. return self;
  1379. },
  1380. source: unescape('isNumber%0A%09%5Etrue%0A')}),
  1381. smalltalk.Number);
  1382. smalltalk.addMethod(
  1383. '_atRandom',
  1384. smalltalk.method({
  1385. selector: 'atRandom',
  1386. category: 'converting',
  1387. fn: function () {
  1388. var self = this;
  1389. return smalltalk.Random._new()._next().__star(self)._truncated().__plus(1);
  1390. return self;
  1391. },
  1392. source: unescape('atRandom%0A%20%20%20%20%5E%28Random%20new%20next%20*%20self%29%20truncated%20+%201%0A')}),
  1393. smalltalk.Number);
  1394. smalltalk.addMethod(
  1395. '__at',
  1396. smalltalk.method({
  1397. selector: '@',
  1398. category: 'converting',
  1399. fn: function (aNumber) {
  1400. var self = this;
  1401. return smalltalk.Point._x_y_(self, aNumber);
  1402. return self;
  1403. },
  1404. source: unescape('@%20aNumber%0A%09%5EPoint%20x%3A%20self%20y%3A%20aNumber')}),
  1405. smalltalk.Number);
  1406. smalltalk.addMethod(
  1407. '_asPoint',
  1408. smalltalk.method({
  1409. selector: 'asPoint',
  1410. category: 'converting',
  1411. fn: function () {
  1412. var self = this;
  1413. return smalltalk.Point._x_y_(self, self);
  1414. return self;
  1415. },
  1416. source: unescape('asPoint%0A%09%5EPoint%20x%3A%20self%20y%3A%20self')}),
  1417. smalltalk.Number);
  1418. smalltalk.addMethod(
  1419. '_clearInterval',
  1420. smalltalk.method({
  1421. selector: 'clearInterval',
  1422. category: 'intervals',
  1423. fn: function () {
  1424. var self = this;
  1425. (function () {clearInterval(Number(self));}());
  1426. return self;
  1427. },
  1428. source: unescape('clearInterval%0A%09%7B%27clearInterval%28Number%28self%29%29%27%7D')}),
  1429. smalltalk.Number);
  1430. smalltalk.addMethod(
  1431. '_pi',
  1432. smalltalk.method({
  1433. selector: 'pi',
  1434. category: 'instance creation',
  1435. fn: function () {
  1436. var self = this;
  1437. return function () {return Math.PI;}();
  1438. return self;
  1439. },
  1440. source: unescape('pi%0A%09%5E%7B%27return%20Math.PI%27%7D')}),
  1441. smalltalk.Number.klass);
  1442. smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel');
  1443. smalltalk.addMethod(
  1444. '_compiledSource',
  1445. smalltalk.method({
  1446. selector: 'compiledSource',
  1447. category: 'accessing',
  1448. fn: function () {
  1449. var self = this;
  1450. return function () {return self.toString();}();
  1451. return self;
  1452. },
  1453. source: unescape('compiledSource%0A%09%5E%7B%27return%20self.toString%28%29%27%7D%0A')}),
  1454. smalltalk.BlockClosure);
  1455. smalltalk.addMethod(
  1456. '_whileTrue_',
  1457. smalltalk.method({
  1458. selector: 'whileTrue:',
  1459. category: 'controlling',
  1460. fn: function (aBlock) {
  1461. var self = this;
  1462. (function () {while (self()) {aBlock();}}());
  1463. return self;
  1464. },
  1465. source: unescape('whileTrue%3A%20aBlock%0A%09%7B%27while%28self%28%29%29%20%7BaBlock%28%29%7D%27%7D%0A')}),
  1466. smalltalk.BlockClosure);
  1467. smalltalk.addMethod(
  1468. '_whileFalse_',
  1469. smalltalk.method({
  1470. selector: 'whileFalse:',
  1471. category: 'controlling',
  1472. fn: function (aBlock) {
  1473. var self = this;
  1474. (function () {while (!self()) {aBlock();}}());
  1475. return self;
  1476. },
  1477. source: unescape('whileFalse%3A%20aBlock%0A%09%7B%27while%28%21self%28%29%29%20%7BaBlock%28%29%7D%27%7D%0A')}),
  1478. smalltalk.BlockClosure);
  1479. smalltalk.addMethod(
  1480. '_value',
  1481. smalltalk.method({
  1482. selector: 'value',
  1483. category: 'evaluating',
  1484. fn: function () {
  1485. var self = this;
  1486. return function () {return self();}();
  1487. return self;
  1488. },
  1489. source: unescape('value%0A%09%5E%7B%27return%20self%28%29%3B%27%7D%0A')}),
  1490. smalltalk.BlockClosure);
  1491. smalltalk.addMethod(
  1492. '_value_',
  1493. smalltalk.method({
  1494. selector: 'value:',
  1495. category: 'evaluating',
  1496. fn: function (anArg) {
  1497. var self = this;
  1498. return function () {return self(anArg);}();
  1499. return self;
  1500. },
  1501. source: unescape('value%3A%20anArg%0A%09%5E%7B%27return%20self%28anArg%29%3B%27%7D%0A')}),
  1502. smalltalk.BlockClosure);
  1503. smalltalk.addMethod(
  1504. '_value_value_',
  1505. smalltalk.method({
  1506. selector: 'value:value:',
  1507. category: 'evaluating',
  1508. fn: function (firstArg, secondArg) {
  1509. var self = this;
  1510. return function () {return self(firstArg, secondArg);}();
  1511. return self;
  1512. },
  1513. source: unescape('value%3A%20firstArg%20value%3A%20secondArg%0A%09%5E%7B%27return%20self%28firstArg%2C%20secondArg%29%3B%27%7D%0A')}),
  1514. smalltalk.BlockClosure);
  1515. smalltalk.addMethod(
  1516. '_value_value_value_',
  1517. smalltalk.method({
  1518. selector: 'value:value:value:',
  1519. category: 'evaluating',
  1520. fn: function (firstArg, secondArg, thirdArg) {
  1521. var self = this;
  1522. return function () {return self(firstArg, secondArg, thirdArg);}();
  1523. return self;
  1524. },
  1525. source: unescape('value%3A%20firstArg%20value%3A%20secondArg%20value%3A%20thirdArg%0A%09%5E%7B%27return%20self%28firstArg%2C%20secondArg%2C%20thirdArg%29%3B%27%7D%0A')}),
  1526. smalltalk.BlockClosure);
  1527. smalltalk.addMethod(
  1528. '_valueWithPossibleArguments_',
  1529. smalltalk.method({
  1530. selector: 'valueWithPossibleArguments:',
  1531. category: 'evaluating',
  1532. fn: function (aCollection) {
  1533. var self = this;
  1534. return function () {return self.apply(null, aCollection);}();
  1535. return self;
  1536. },
  1537. source: unescape('valueWithPossibleArguments%3A%20aCollection%0A%09%5E%7B%27return%20self.apply%28null%2C%20aCollection%29%3B%27%7D%0A')}),
  1538. smalltalk.BlockClosure);
  1539. smalltalk.addMethod(
  1540. '_on_do_',
  1541. smalltalk.method({
  1542. selector: 'on:do:',
  1543. category: 'error handling',
  1544. fn: function (anErrorClass, aBlock) {
  1545. var self = this;
  1546. self._try_catch_(self, function (error) {return error._isKindOf_(anErrorClass)._ifTrue_ifFalse_(function () {return aBlock._value();}, function () {return error._signal();});});
  1547. return self;
  1548. },
  1549. source: unescape('on%3A%20anErrorClass%20do%3A%20aBlock%0A%09self%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%5D%0A%09%20%20%20%20%20ifFalse%3A%20%5Berror%20signal%5D%5D%0A')}),
  1550. smalltalk.BlockClosure);
  1551. smalltalk.addMethod(
  1552. '_appendToJQuery_',
  1553. smalltalk.method({
  1554. selector: 'appendToJQuery:',
  1555. category: '*JQuery',
  1556. fn: function (aJQuery) {
  1557. var self = this;
  1558. var canvas = nil;
  1559. canvas = smalltalk.HTMLCanvas._new();
  1560. self._value_(canvas);
  1561. aJQuery._append_(canvas);
  1562. return self;
  1563. },
  1564. source: unescape('appendToJQuery%3A%20aJQuery%0A%09%7C%20canvas%20%7C%0A%09canvas%20%3A%3D%20HTMLCanvas%20new.%0A%09self%20value%3A%20canvas.%0A%09aJQuery%20append%3A%20canvas%0A')}),
  1565. smalltalk.BlockClosure);
  1566. smalltalk.addMethod(
  1567. '_appendToBrush_',
  1568. smalltalk.method({
  1569. selector: 'appendToBrush:',
  1570. category: '*Canvas',
  1571. fn: function (aTagBrush) {
  1572. var self = this;
  1573. aTagBrush._appendBlock_(self);
  1574. return self;
  1575. },
  1576. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20aTagBrush%20appendBlock%3A%20self%0A')}),
  1577. smalltalk.BlockClosure);
  1578. smalltalk.addMethod(
  1579. '_valueWithTimeout_',
  1580. smalltalk.method({
  1581. selector: 'valueWithTimeout:',
  1582. category: 'timeout/interval',
  1583. fn: function (aNumber) {
  1584. var self = this;
  1585. (function () {setTimeout(self, aNumber);}());
  1586. return self;
  1587. },
  1588. source: unescape('valueWithTimeout%3A%20aNumber%0A%09%7B%27setTimeout%28self%2C%20aNumber%29%27%7D')}),
  1589. smalltalk.BlockClosure);
  1590. smalltalk.addMethod(
  1591. '_valueWithInterval_',
  1592. smalltalk.method({
  1593. selector: 'valueWithInterval:',
  1594. category: 'timeout/interval',
  1595. fn: function (aNumber) {
  1596. var self = this;
  1597. return function () {return setInterval(self, aNumber);}();
  1598. return self;
  1599. },
  1600. source: unescape('valueWithInterval%3A%20aNumber%0A%09%5E%7B%27return%20setInterval%28self%2C%20aNumber%29%27%7D')}),
  1601. smalltalk.BlockClosure);
  1602. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel');
  1603. smalltalk.addMethod(
  1604. '__eq',
  1605. smalltalk.method({
  1606. selector: '=',
  1607. category: 'comparing',
  1608. fn: function (aBoolean) {
  1609. var self = this;
  1610. return function () {return Boolean(self == true) == aBoolean;}();
  1611. return self;
  1612. },
  1613. source: unescape('%3D%20aBoolean%0A%20%20%20%20%09%5E%7B%27return%20Boolean%28self%20%3D%3D%20true%29%20%3D%3D%20aBoolean%27%7D%0A')}),
  1614. smalltalk.Boolean);
  1615. smalltalk.addMethod(
  1616. '_shallowCopy',
  1617. smalltalk.method({
  1618. selector: 'shallowCopy',
  1619. category: 'copying',
  1620. fn: function () {
  1621. var self = this;
  1622. return self;
  1623. return self;
  1624. },
  1625. source: unescape('shallowCopy%0A%09%5Eself%0A')}),
  1626. smalltalk.Boolean);
  1627. smalltalk.addMethod(
  1628. '_deepCopy',
  1629. smalltalk.method({
  1630. selector: 'deepCopy',
  1631. category: 'copying',
  1632. fn: function () {
  1633. var self = this;
  1634. return self;
  1635. return self;
  1636. },
  1637. source: unescape('deepCopy%0A%09%5Eself%0A')}),
  1638. smalltalk.Boolean);
  1639. smalltalk.addMethod(
  1640. '_ifTrue_',
  1641. smalltalk.method({
  1642. selector: 'ifTrue:',
  1643. category: 'controlling',
  1644. fn: function (aBlock) {
  1645. var self = this;
  1646. return self._ifTrue_ifFalse_(aBlock, function () {return nil;});
  1647. return self;
  1648. },
  1649. source: unescape('ifTrue%3A%20aBlock%0A%09%5Eself%20ifTrue%3A%20aBlock%20ifFalse%3A%20%5B%5D%0A')}),
  1650. smalltalk.Boolean);
  1651. smalltalk.addMethod(
  1652. '_ifFalse_',
  1653. smalltalk.method({
  1654. selector: 'ifFalse:',
  1655. category: 'controlling',
  1656. fn: function (aBlock) {
  1657. var self = this;
  1658. return self._ifTrue_ifFalse_(function () {return nil;}, aBlock);
  1659. return self;
  1660. },
  1661. source: unescape('ifFalse%3A%20aBlock%0A%09%5Eself%20ifTrue%3A%20%5B%5D%20ifFalse%3A%20aBlock%0A')}),
  1662. smalltalk.Boolean);
  1663. smalltalk.addMethod(
  1664. '_ifFalse_ifTrue_',
  1665. smalltalk.method({
  1666. selector: 'ifFalse:ifTrue:',
  1667. category: 'controlling',
  1668. fn: function (aBlock, anotherBlock) {
  1669. var self = this;
  1670. return self._ifTrue_ifFalse_(anotherBlock, aBlock);
  1671. return self;
  1672. },
  1673. source: unescape('ifFalse%3A%20aBlock%20ifTrue%3A%20anotherBlock%0A%09%5Eself%20ifTrue%3A%20anotherBlock%20ifFalse%3A%20aBlock%0A')}),
  1674. smalltalk.Boolean);
  1675. smalltalk.addMethod(
  1676. '_ifTrue_ifFalse_',
  1677. smalltalk.method({
  1678. selector: 'ifTrue:ifFalse:',
  1679. category: 'controlling',
  1680. fn: function (aBlock, anotherBlock) {
  1681. var self = this;
  1682. return function () {if (self == true) {return aBlock();} else {return anotherBlock();}}();
  1683. return self;
  1684. },
  1685. source: unescape('ifTrue%3A%20aBlock%20ifFalse%3A%20anotherBlock%0A%09%5E%7B%27%0A%09%20%20%20%20if%28self%20%3D%3D%20true%29%20%7B%0A%09%09return%20aBlock%28%29%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20anotherBlock%28%29%3B%0A%09%20%20%20%20%7D%0A%09%27%7D%0A')}),
  1686. smalltalk.Boolean);
  1687. smalltalk.addMethod(
  1688. '_and_',
  1689. smalltalk.method({
  1690. selector: 'and:',
  1691. category: 'controlling',
  1692. fn: function (aBlock) {
  1693. var self = this;
  1694. return self.__eq(true)._ifTrue_ifFalse_(aBlock, function () {return false;});
  1695. return self;
  1696. },
  1697. source: unescape('and%3A%20aBlock%0A%09%5Eself%20%3D%20true%0A%09%20%20%20%20ifTrue%3A%20aBlock%0A%09%20%20%20%20ifFalse%3A%20%5Bfalse%5D%0A')}),
  1698. smalltalk.Boolean);
  1699. smalltalk.addMethod(
  1700. '_or_',
  1701. smalltalk.method({
  1702. selector: 'or:',
  1703. category: 'controlling',
  1704. fn: function (aBlock) {
  1705. var self = this;
  1706. return self.__eq(true)._ifTrue_ifFalse_(function () {return true;}, aBlock);
  1707. return self;
  1708. },
  1709. source: unescape('or%3A%20aBlock%0A%09%5Eself%20%3D%20true%0A%09%20%20%20%20ifTrue%3A%20%5Btrue%5D%0A%09%20%20%20%20ifFalse%3A%20aBlock%0A')}),
  1710. smalltalk.Boolean);
  1711. smalltalk.addMethod(
  1712. '_not',
  1713. smalltalk.method({
  1714. selector: 'not',
  1715. category: 'controlling',
  1716. fn: function () {
  1717. var self = this;
  1718. return self.__eq(false);
  1719. return self;
  1720. },
  1721. source: unescape('not%0A%09%5Eself%20%3D%20false%0A')}),
  1722. smalltalk.Boolean);
  1723. smalltalk.addMethod(
  1724. '_printString',
  1725. smalltalk.method({
  1726. selector: 'printString',
  1727. category: 'printing',
  1728. fn: function () {
  1729. var self = this;
  1730. return function () {return self.toString();}();
  1731. return self;
  1732. },
  1733. source: unescape('printString%0A%09%5E%7B%27return%20self.toString%28%29%27%7D%0A')}),
  1734. smalltalk.Boolean);
  1735. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel');
  1736. smalltalk.addMethod(
  1737. '_subclass_instanceVariableNames_',
  1738. smalltalk.method({
  1739. selector: 'subclass:instanceVariableNames:',
  1740. category: 'class creation',
  1741. fn: function (aString, anotherString) {
  1742. var self = this;
  1743. return self._subclass_instanceVariableNames_category_(aString, anotherString, nil);
  1744. return self;
  1745. },
  1746. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%0A%09%5Eself%20subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%20category%3A%20nil%0A')}),
  1747. smalltalk.UndefinedObject);
  1748. smalltalk.addMethod(
  1749. '_subclass_instanceVariableNames_category_',
  1750. smalltalk.method({
  1751. selector: 'subclass:instanceVariableNames:category:',
  1752. category: 'class creation',
  1753. fn: function (aString, aString2, aString3) {
  1754. var self = this;
  1755. return smalltalk.ClassBuilder._new()._superclass_subclass_instanceVariableNames_category_(self, aString, aString2, aString3);
  1756. return self;
  1757. },
  1758. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A%09%5EClassBuilder%20new%0A%09%20%20%20%20superclass%3A%20self%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A')}),
  1759. smalltalk.UndefinedObject);
  1760. smalltalk.addMethod(
  1761. '_shallowCopy',
  1762. smalltalk.method({
  1763. selector: 'shallowCopy',
  1764. category: 'copying',
  1765. fn: function () {
  1766. var self = this;
  1767. return self;
  1768. return self;
  1769. },
  1770. source: unescape('shallowCopy%0A%09%5Eself%0A')}),
  1771. smalltalk.UndefinedObject);
  1772. smalltalk.addMethod(
  1773. '_deepCopy',
  1774. smalltalk.method({
  1775. selector: 'deepCopy',
  1776. category: 'copying',
  1777. fn: function () {
  1778. var self = this;
  1779. return self;
  1780. return self;
  1781. },
  1782. source: unescape('deepCopy%0A%09%5Eself%0A')}),
  1783. smalltalk.UndefinedObject);
  1784. smalltalk.addMethod(
  1785. '_ifNil_',
  1786. smalltalk.method({
  1787. selector: 'ifNil:',
  1788. category: 'testing',
  1789. fn: function (aBlock) {
  1790. var self = this;
  1791. return self._ifNil_ifNotNil_(aBlock, function () {return nil;});
  1792. return self;
  1793. },
  1794. source: unescape('ifNil%3A%20aBlock%0A%09%5Eself%20ifNil%3A%20aBlock%20ifNotNil%3A%20%5B%5D%0A')}),
  1795. smalltalk.UndefinedObject);
  1796. smalltalk.addMethod(
  1797. '_ifNotNil_',
  1798. smalltalk.method({
  1799. selector: 'ifNotNil:',
  1800. category: 'testing',
  1801. fn: function (aBlock) {
  1802. var self = this;
  1803. return self;
  1804. return self;
  1805. },
  1806. source: unescape('ifNotNil%3A%20aBlock%0A%09%5Eself%0A')}),
  1807. smalltalk.UndefinedObject);
  1808. smalltalk.addMethod(
  1809. '_ifNil_ifNotNil_',
  1810. smalltalk.method({
  1811. selector: 'ifNil:ifNotNil:',
  1812. category: 'testing',
  1813. fn: function (aBlock, anotherBlock) {
  1814. var self = this;
  1815. return aBlock._value();
  1816. return self;
  1817. },
  1818. source: unescape('ifNil%3A%20aBlock%20ifNotNil%3A%20anotherBlock%0A%09%5EaBlock%20value%0A')}),
  1819. smalltalk.UndefinedObject);
  1820. smalltalk.addMethod(
  1821. '_ifNotNil_ifNil_',
  1822. smalltalk.method({
  1823. selector: 'ifNotNil:ifNil:',
  1824. category: 'testing',
  1825. fn: function (aBlock, anotherBlock) {
  1826. var self = this;
  1827. return anotherBlock._value();
  1828. return self;
  1829. },
  1830. source: unescape('ifNotNil%3A%20aBlock%20ifNil%3A%20anotherBlock%0A%09%5EanotherBlock%20value%0A')}),
  1831. smalltalk.UndefinedObject);
  1832. smalltalk.addMethod(
  1833. '_isNil',
  1834. smalltalk.method({
  1835. selector: 'isNil',
  1836. category: 'testing',
  1837. fn: function () {
  1838. var self = this;
  1839. return true;
  1840. return self;
  1841. },
  1842. source: unescape('isNil%0A%09%5Etrue%0A')}),
  1843. smalltalk.UndefinedObject);
  1844. smalltalk.addMethod(
  1845. '_notNil',
  1846. smalltalk.method({
  1847. selector: 'notNil',
  1848. category: 'testing',
  1849. fn: function () {
  1850. var self = this;
  1851. return false;
  1852. return self;
  1853. },
  1854. source: unescape('notNil%0A%09%5Efalse%0A')}),
  1855. smalltalk.UndefinedObject);
  1856. smalltalk.addMethod(
  1857. '_printString',
  1858. smalltalk.method({
  1859. selector: 'printString',
  1860. category: 'printing',
  1861. fn: function () {
  1862. var self = this;
  1863. return "nil";
  1864. return self;
  1865. },
  1866. source: unescape('printString%0A%20%20%20%20%5E%27nil%27%0A')}),
  1867. smalltalk.UndefinedObject);
  1868. smalltalk.addMethod(
  1869. '_new',
  1870. smalltalk.method({
  1871. selector: 'new',
  1872. category: 'instance creation',
  1873. fn: function () {
  1874. var self = this;
  1875. self._error_("You cannot create new instances of UndefinedObject. Use nil");
  1876. return self;
  1877. },
  1878. source: unescape('new%0A%09%20%20%20%20self%20error%3A%20%27You%20cannot%20create%20new%20instances%20of%20UndefinedObject.%20Use%20nil%27%0A')}),
  1879. smalltalk.UndefinedObject.klass);
  1880. smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel');
  1881. smalltalk.addMethod(
  1882. '_size',
  1883. smalltalk.method({
  1884. selector: 'size',
  1885. category: 'accessing',
  1886. fn: function () {
  1887. var self = this;
  1888. self._subclassResponsibility();
  1889. return self;
  1890. },
  1891. source: unescape('size%0A%09self%20subclassResponsibility%0A')}),
  1892. smalltalk.Collection);
  1893. smalltalk.addMethod(
  1894. '_at_',
  1895. smalltalk.method({
  1896. selector: 'at:',
  1897. category: 'accessing',
  1898. fn: function (anIndex) {
  1899. var self = this;
  1900. return self._at_ifAbsent_(anIndex, function () {return self._errorNotFound();});
  1901. return self;
  1902. },
  1903. source: unescape('at%3A%20anIndex%0A%09%5Eself%20at%3A%20anIndex%20ifAbsent%3A%20%5B%0A%09%20%20%20%20self%20errorNotFound%5D%0A')}),
  1904. smalltalk.Collection);
  1905. smalltalk.addMethod(
  1906. '_at_put_',
  1907. smalltalk.method({
  1908. selector: 'at:put:',
  1909. category: 'accessing',
  1910. fn: function (anIndex, anObject) {
  1911. var self = this;
  1912. self._subclassResponsibility();
  1913. return self;
  1914. },
  1915. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09self%20subclassResponsibility%0A')}),
  1916. smalltalk.Collection);
  1917. smalltalk.addMethod(
  1918. '_at_ifAbsent_',
  1919. smalltalk.method({
  1920. selector: 'at:ifAbsent:',
  1921. category: 'accessing',
  1922. fn: function (anIndex, aBlock) {
  1923. var self = this;
  1924. self._subclassResponsibility();
  1925. return self;
  1926. },
  1927. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09self%20subclassResponsibility%0A')}),
  1928. smalltalk.Collection);
  1929. smalltalk.addMethod(
  1930. '_first',
  1931. smalltalk.method({
  1932. selector: 'first',
  1933. category: 'accessing',
  1934. fn: function () {
  1935. var self = this;
  1936. return self._at_(1);
  1937. return self;
  1938. },
  1939. source: unescape('first%0A%09%5Eself%20at%3A%201%0A')}),
  1940. smalltalk.Collection);
  1941. smalltalk.addMethod(
  1942. '_second',
  1943. smalltalk.method({
  1944. selector: 'second',
  1945. category: 'accessing',
  1946. fn: function () {
  1947. var self = this;
  1948. return self._at_(2);
  1949. return self;
  1950. },
  1951. source: unescape('second%0A%09%5Eself%20at%3A%202%0A')}),
  1952. smalltalk.Collection);
  1953. smalltalk.addMethod(
  1954. '_third',
  1955. smalltalk.method({
  1956. selector: 'third',
  1957. category: 'accessing',
  1958. fn: function () {
  1959. var self = this;
  1960. return self._at_(3);
  1961. return self;
  1962. },
  1963. source: unescape('third%0A%09%5Eself%20at%3A%203%0A')}),
  1964. smalltalk.Collection);
  1965. smalltalk.addMethod(
  1966. '_fourth',
  1967. smalltalk.method({
  1968. selector: 'fourth',
  1969. category: 'accessing',
  1970. fn: function () {
  1971. var self = this;
  1972. return self._at_(4);
  1973. return self;
  1974. },
  1975. source: unescape('fourth%0A%09%5Eself%20at%3A%204%0A')}),
  1976. smalltalk.Collection);
  1977. smalltalk.addMethod(
  1978. '_last',
  1979. smalltalk.method({
  1980. selector: 'last',
  1981. category: 'accessing',
  1982. fn: function () {
  1983. var self = this;
  1984. return self._at_(self._size());
  1985. return self;
  1986. },
  1987. source: unescape('last%0A%09%5Eself%20at%3A%20self%20size%0A')}),
  1988. smalltalk.Collection);
  1989. smalltalk.addMethod(
  1990. '_readStream',
  1991. smalltalk.method({
  1992. selector: 'readStream',
  1993. category: 'accessing',
  1994. fn: function () {
  1995. var self = this;
  1996. return self._stream();
  1997. return self;
  1998. },
  1999. source: unescape('readStream%0A%09%5Eself%20stream%0A')}),
  2000. smalltalk.Collection);
  2001. smalltalk.addMethod(
  2002. '_writeStream',
  2003. smalltalk.method({
  2004. selector: 'writeStream',
  2005. category: 'accessing',
  2006. fn: function () {
  2007. var self = this;
  2008. return self._stream();
  2009. return self;
  2010. },
  2011. source: unescape('writeStream%0A%09%5Eself%20stream%0A')}),
  2012. smalltalk.Collection);
  2013. smalltalk.addMethod(
  2014. '_stream',
  2015. smalltalk.method({
  2016. selector: 'stream',
  2017. category: 'accessing',
  2018. fn: function () {
  2019. var self = this;
  2020. return self._streamClass()._on_(self);
  2021. return self;
  2022. },
  2023. source: unescape('stream%0A%09%5Eself%20streamClass%20on%3A%20self%0A')}),
  2024. smalltalk.Collection);
  2025. smalltalk.addMethod(
  2026. '_streamClass',
  2027. smalltalk.method({
  2028. selector: 'streamClass',
  2029. category: 'accessing',
  2030. fn: function () {
  2031. var self = this;
  2032. return self._class()._streamClass();
  2033. return self;
  2034. },
  2035. source: unescape('streamClass%0A%09%5Eself%20class%20streamClass%0A')}),
  2036. smalltalk.Collection);
  2037. smalltalk.addMethod(
  2038. '_add_',
  2039. smalltalk.method({
  2040. selector: 'add:',
  2041. category: 'adding/removing',
  2042. fn: function (anObject) {
  2043. var self = this;
  2044. self._subclassResponsibility();
  2045. return self;
  2046. },
  2047. source: unescape('add%3A%20anObject%0A%09self%20subclassResponsibility%0A')}),
  2048. smalltalk.Collection);
  2049. smalltalk.addMethod(
  2050. '_addAll_',
  2051. smalltalk.method({
  2052. selector: 'addAll:',
  2053. category: 'adding/removing',
  2054. fn: function (aCollection) {
  2055. var self = this;
  2056. aCollection._do_(function (each) {return self._add_(each);});
  2057. return aCollection;
  2058. return self;
  2059. },
  2060. source: unescape('addAll%3A%20aCollection%0A%09aCollection%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20self%20add%3A%20each%5D.%0A%09%5EaCollection%0A')}),
  2061. smalltalk.Collection);
  2062. smalltalk.addMethod(
  2063. '__comma',
  2064. smalltalk.method({
  2065. selector: ',',
  2066. category: 'copying',
  2067. fn: function (aCollection) {
  2068. var self = this;
  2069. return function ($rec) {$rec._addAll_(aCollection);return $rec._yourself();}(self._copy());
  2070. return self;
  2071. },
  2072. source: unescape('%2C%20aCollection%0A%09%5Eself%20copy%20%0A%09%20%20%20%20addAll%3A%20aCollection%3B%20%0A%09%20%20%20%20yourself%0A')}),
  2073. smalltalk.Collection);
  2074. smalltalk.addMethod(
  2075. '_copyFrom_to_',
  2076. smalltalk.method({
  2077. selector: 'copyFrom:to:',
  2078. category: 'copying',
  2079. fn: function (anIndex, anotherIndex) {
  2080. var self = this;
  2081. self._subclassResponsibility();
  2082. return self;
  2083. },
  2084. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09self%20subclassResponsibility%0A')}),
  2085. smalltalk.Collection);
  2086. smalltalk.addMethod(
  2087. '_copyWith_',
  2088. smalltalk.method({
  2089. selector: 'copyWith:',
  2090. category: 'copying',
  2091. fn: function (anObject) {
  2092. var self = this;
  2093. return function ($rec) {$rec._add_(anObject);return $rec._yourself();}(self._copy());
  2094. return self;
  2095. },
  2096. source: unescape('copyWith%3A%20anObject%0A%09%5Eself%20copy%20add%3A%20anObject%3B%20yourself%0A')}),
  2097. smalltalk.Collection);
  2098. smalltalk.addMethod(
  2099. '_copyWithAll_',
  2100. smalltalk.method({
  2101. selector: 'copyWithAll:',
  2102. category: 'copying',
  2103. fn: function (aCollection) {
  2104. var self = this;
  2105. return function ($rec) {$rec._addAll_(aCollection);return $rec._yourself();}(self._copy());
  2106. return self;
  2107. },
  2108. source: unescape('copyWithAll%3A%20aCollection%0A%09%5Eself%20copy%20addAll%3A%20aCollection%3B%20yourself%0A')}),
  2109. smalltalk.Collection);
  2110. smalltalk.addMethod(
  2111. '_asArray',
  2112. smalltalk.method({
  2113. selector: 'asArray',
  2114. category: 'converting',
  2115. fn: function () {
  2116. var self = this;
  2117. var array = nil;
  2118. var index = nil;
  2119. array = smalltalk.Array._new();
  2120. index = 0;
  2121. self._do_(function (each) {index = index.__plus(1);return array._at_put_(index, each);});
  2122. return array;
  2123. return self;
  2124. },
  2125. source: unescape('asArray%0A%09%7C%20array%20index%20%7C%0A%09array%20%3A%3D%20Array%20new.%0A%09index%20%3A%3D%200.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20index%20%3A%3D%20index%20+%201.%0A%09%20%20%20%20array%20at%3A%20index%20put%3A%20each%5D.%0A%09%5Earray%0A')}),
  2126. smalltalk.Collection);
  2127. smalltalk.addMethod(
  2128. '_do_',
  2129. smalltalk.method({
  2130. selector: 'do:',
  2131. category: 'enumerating',
  2132. fn: function (aBlock) {
  2133. var self = this;
  2134. (function () {for (var i = 0; i < self.length; i++) {aBlock(self[i]);}}());
  2135. return self;
  2136. },
  2137. source: unescape('do%3A%20aBlock%0A%09%7B%27for%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%7BaBlock%28self%5Bi%5D%29%3B%7D%27%7D%0A')}),
  2138. smalltalk.Collection);
  2139. smalltalk.addMethod(
  2140. '_collect_',
  2141. smalltalk.method({
  2142. selector: 'collect:',
  2143. category: 'enumerating',
  2144. fn: function (aBlock) {
  2145. var self = this;
  2146. var stream = nil;
  2147. stream = self._class()._new()._writeStream();
  2148. self._do_(function (each) {return stream._nextPut_(aBlock._value_(each));});
  2149. return stream._contents();
  2150. return self;
  2151. },
  2152. source: unescape('collect%3A%20aBlock%0A%09%7C%20stream%20%7C%0A%09stream%20%3A%3D%20self%20class%20new%20writeStream.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20stream%20nextPut%3A%20%28aBlock%20value%3A%20each%29%5D.%0A%09%5Estream%20contents%0A')}),
  2153. smalltalk.Collection);
  2154. smalltalk.addMethod(
  2155. '_detect_',
  2156. smalltalk.method({
  2157. selector: 'detect:',
  2158. category: 'enumerating',
  2159. fn: function (aBlock) {
  2160. var self = this;
  2161. return self._detect_ifNone_(aBlock, function () {return self._errorNotFound();});
  2162. return self;
  2163. },
  2164. source: unescape('detect%3A%20aBlock%0A%09%5Eself%20detect%3A%20aBlock%20ifNone%3A%20%5Bself%20errorNotFound%5D%0A')}),
  2165. smalltalk.Collection);
  2166. smalltalk.addMethod(
  2167. '_detect_ifNone_',
  2168. smalltalk.method({
  2169. selector: 'detect:ifNone:',
  2170. category: 'enumerating',
  2171. fn: function (aBlock, anotherBlock) {
  2172. var self = this;
  2173. return function () {for (var i = 0; i < self.length; i++) {if (aBlock(self[i])) {return self[i];}}return anotherBlock();}();
  2174. return self;
  2175. },
  2176. source: unescape('detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A%09%5E%7B%27%0A%09for%28var%20i%20%3D%200%3B%20i%20%3C%20self.length%3B%20i++%29%0A%09%09if%28aBlock%28self%5Bi%5D%29%29%0A%09%09%09return%20self%5Bi%5D%3B%0A%09return%20anotherBlock%28%29%3B%0A%09%27%7D%0A')}),
  2177. smalltalk.Collection);
  2178. smalltalk.addMethod(
  2179. '_do_separatedBy_',
  2180. smalltalk.method({
  2181. selector: 'do:separatedBy:',
  2182. category: 'enumerating',
  2183. fn: function (aBlock, anotherBlock) {
  2184. var self = this;
  2185. var first = nil;
  2186. first = true;
  2187. self._do_(function (each) {first._ifTrue_ifFalse_(function () {return first = false;}, function () {return anotherBlock._value();});return aBlock._value_(each);});
  2188. return self;
  2189. },
  2190. source: unescape('do%3A%20aBlock%20separatedBy%3A%20anotherBlock%0A%20%20%20%20%09%7C%20first%20%7C%0A%20%20%20%20%09first%20%3A%3D%20true.%0A%20%20%20%20%09self%20do%3A%20%5B%3Aeach%20%7C%0A%20%20%20%20%09%20%20%20%20first%0A%20%20%20%20%09%09ifTrue%3A%20%5Bfirst%20%3A%3D%20false%5D%0A%20%20%20%20%09%09ifFalse%3A%20%5BanotherBlock%20value%5D.%0A%20%20%20%20%09%20%20%20%20aBlock%20value%3A%20each%5D%0A')}),
  2191. smalltalk.Collection);
  2192. smalltalk.addMethod(
  2193. '_inject_into_',
  2194. smalltalk.method({
  2195. selector: 'inject:into:',
  2196. category: 'enumerating',
  2197. fn: function (anObject, aBlock) {
  2198. var self = this;
  2199. var result = nil;
  2200. result = anObject;
  2201. self._do_(function (each) {return result = aBlock._value_value_(result, each);});
  2202. return result;
  2203. return self;
  2204. },
  2205. source: unescape('inject%3A%20anObject%20into%3A%20aBlock%0A%09%7C%20result%20%7C%0A%09result%20%3A%3D%20anObject.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%20%0A%09%20%20%20%20result%20%3A%3D%20aBlock%20value%3A%20result%20value%3A%20each%5D.%0A%09%5Eresult%0A')}),
  2206. smalltalk.Collection);
  2207. smalltalk.addMethod(
  2208. '_reject_',
  2209. smalltalk.method({
  2210. selector: 'reject:',
  2211. category: 'enumerating',
  2212. fn: function (aBlock) {
  2213. var self = this;
  2214. return self._select_(function (each) {return aBlock._value_(each).__eq(false);});
  2215. return self;
  2216. },
  2217. source: unescape('reject%3A%20aBlock%0A%09%5Eself%20select%3A%20%5B%3Aeach%20%7C%20%28aBlock%20value%3A%20each%29%20%3D%20false%5D%0A')}),
  2218. smalltalk.Collection);
  2219. smalltalk.addMethod(
  2220. '_select_',
  2221. smalltalk.method({
  2222. selector: 'select:',
  2223. category: 'enumerating',
  2224. fn: function (aBlock) {
  2225. var self = this;
  2226. var stream = nil;
  2227. stream = self._class()._new()._writeStream();
  2228. self._do_(function (each) {return aBlock._value_(each)._ifTrue_(function () {return stream._nextPut_(each);});});
  2229. return stream._contents();
  2230. return self;
  2231. },
  2232. source: unescape('select%3A%20aBlock%0A%09%7C%20stream%20%7C%0A%09stream%20%3A%3D%20self%20class%20new%20writeStream.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20%28aBlock%20value%3A%20each%29%20ifTrue%3A%20%5B%0A%09%09stream%20nextPut%3A%20each%5D%5D.%0A%09%5Estream%20contents%0A')}),
  2233. smalltalk.Collection);
  2234. smalltalk.addMethod(
  2235. '_errorNotFound',
  2236. smalltalk.method({
  2237. selector: 'errorNotFound',
  2238. category: 'error handling',
  2239. fn: function () {
  2240. var self = this;
  2241. self._error_("Object is not in the collection");
  2242. return self;
  2243. },
  2244. source: unescape('errorNotFound%0A%09self%20error%3A%20%27Object%20is%20not%20in%20the%20collection%27%0A')}),
  2245. smalltalk.Collection);
  2246. smalltalk.addMethod(
  2247. '_includes_',
  2248. smalltalk.method({
  2249. selector: 'includes:',
  2250. category: 'testing',
  2251. fn: function (anObject) {
  2252. var self = this;
  2253. return function () {var i = self.length;while (i--) {if (self[i].__eq(anObject)) {return true;}}return false;}();
  2254. return self;
  2255. },
  2256. source: unescape('includes%3A%20anObject%0A%09%5E%7B%27%0A%09%09var%20i%20%3D%20self.length%3B%0A%09%09while%20%28i--%29%20%7B%0A%09%09%09if%20%28self%5Bi%5D.__eq%28anObject%29%29%20%7B%0A%09%09%09%09return%20true%3B%0A%09%09%09%7D%09%0A%09%09%7D%0A%09%09return%20false%3B%0A%0A%09%27%7D%0A')}),
  2257. smalltalk.Collection);
  2258. smalltalk.addMethod(
  2259. '_notEmpty',
  2260. smalltalk.method({
  2261. selector: 'notEmpty',
  2262. category: 'testing',
  2263. fn: function () {
  2264. var self = this;
  2265. return self._isEmpty()._not();
  2266. return self;
  2267. },
  2268. source: unescape('notEmpty%0A%09%5Eself%20isEmpty%20not%0A')}),
  2269. smalltalk.Collection);
  2270. smalltalk.addMethod(
  2271. '_isEmpty',
  2272. smalltalk.method({
  2273. selector: 'isEmpty',
  2274. category: 'testing',
  2275. fn: function () {
  2276. var self = this;
  2277. return self._size().__eq(0);
  2278. return self;
  2279. },
  2280. source: unescape('isEmpty%0A%09%5Eself%20size%20%3D%200%0A')}),
  2281. smalltalk.Collection);
  2282. smalltalk.addMethod(
  2283. '_remove_',
  2284. smalltalk.method({
  2285. selector: 'remove:',
  2286. category: 'adding/removing',
  2287. fn: function (anObject) {
  2288. var self = this;
  2289. self._subclassResponsibility();
  2290. return self;
  2291. },
  2292. source: unescape('remove%3A%20anObject%0A%20%20%20%20self%20subclassResponsibility%0A')}),
  2293. smalltalk.Collection);
  2294. smalltalk.addMethod(
  2295. '_streamClass',
  2296. smalltalk.method({
  2297. selector: 'streamClass',
  2298. category: 'accessing',
  2299. fn: function () {
  2300. var self = this;
  2301. return smalltalk.Stream;
  2302. return self;
  2303. },
  2304. source: unescape('streamClass%0A%09%20%20%20%20%5EStream%0A')}),
  2305. smalltalk.Collection.klass);
  2306. smalltalk.addMethod(
  2307. '_with_',
  2308. smalltalk.method({
  2309. selector: 'with:',
  2310. category: 'instance creation',
  2311. fn: function (anObject) {
  2312. var self = this;
  2313. return function ($rec) {$rec._add_(anObject);return $rec._yourself();}(self._new());
  2314. return self;
  2315. },
  2316. source: unescape('with%3A%20anObject%0A%09%20%20%20%20%5Eself%20new%0A%09%09add%3A%20anObject%3B%0A%09%09yourself%0A')}),
  2317. smalltalk.Collection.klass);
  2318. smalltalk.addMethod(
  2319. '_with_with_',
  2320. smalltalk.method({
  2321. selector: 'with:with:',
  2322. category: 'instance creation',
  2323. fn: function (anObject, anotherObject) {
  2324. var self = this;
  2325. return function ($rec) {$rec._add_(anObject);$rec._add_(anotherObject);return $rec._yourself();}(self._new());
  2326. return self;
  2327. },
  2328. source: unescape('with%3A%20anObject%20with%3A%20anotherObject%0A%09%20%20%20%20%5Eself%20new%0A%09%09add%3A%20anObject%3B%0A%09%09add%3A%20anotherObject%3B%0A%09%09yourself%0A')}),
  2329. smalltalk.Collection.klass);
  2330. smalltalk.addMethod(
  2331. '_with_with_with_',
  2332. smalltalk.method({
  2333. selector: 'with:with:with:',
  2334. category: 'instance creation',
  2335. fn: function (firstObject, secondObject, thirdObject) {
  2336. var self = this;
  2337. return function ($rec) {$rec._add_(firstObject);$rec._add_(secondObject);$rec._add_(thirdObject);return $rec._yourself();}(self._new());
  2338. return self;
  2339. },
  2340. source: unescape('with%3A%20firstObject%20with%3A%20secondObject%20with%3A%20thirdObject%0A%09%20%20%20%20%5Eself%20new%0A%09%09add%3A%20firstObject%3B%0A%09%09add%3A%20secondObject%3B%0A%09%09add%3A%20thirdObject%3B%0A%09%09yourself%0A')}),
  2341. smalltalk.Collection.klass);
  2342. smalltalk.addMethod(
  2343. '_withAll_',
  2344. smalltalk.method({
  2345. selector: 'withAll:',
  2346. category: 'instance creation',
  2347. fn: function (aCollection) {
  2348. var self = this;
  2349. return function ($rec) {$rec._addAll_(aCollection);return $rec._yourself();}(self._new());
  2350. return self;
  2351. },
  2352. source: unescape('withAll%3A%20aCollection%0A%09%20%20%20%20%5Eself%20new%0A%09%09addAll%3A%20aCollection%3B%0A%09%09yourself%0A')}),
  2353. smalltalk.Collection.klass);
  2354. smalltalk.addClass('String', smalltalk.Collection, [], 'Kernel');
  2355. smalltalk.addMethod(
  2356. '__eq',
  2357. smalltalk.method({
  2358. selector: '=',
  2359. category: 'comparing',
  2360. fn: function (aString) {
  2361. var self = this;
  2362. return function () {return String(self) == aString;}();
  2363. return self;
  2364. },
  2365. source: unescape('%3D%20aString%0A%09%5E%7B%27return%20String%28self%29%20%3D%3D%20aString%27%7D%0A')}),
  2366. smalltalk.String);
  2367. smalltalk.addMethod(
  2368. '_size',
  2369. smalltalk.method({
  2370. selector: 'size',
  2371. category: 'accessing',
  2372. fn: function () {
  2373. var self = this;
  2374. return function () {return self.length;}();
  2375. return self;
  2376. },
  2377. source: unescape('size%0A%09%5E%7B%27return%20self.length%27%7D%0A')}),
  2378. smalltalk.String);
  2379. smalltalk.addMethod(
  2380. '_at_',
  2381. smalltalk.method({
  2382. selector: 'at:',
  2383. category: 'accessing',
  2384. fn: function (anIndex) {
  2385. var self = this;
  2386. return function () {return self[anIndex - 1] || nil;}();
  2387. return self;
  2388. },
  2389. source: unescape('at%3A%20anIndex%0A%20%20%20%20%09%5E%7B%27return%20self%5BanIndex%20-%201%5D%20%7C%7C%20nil%3B%27%7D%0A')}),
  2390. smalltalk.String);
  2391. smalltalk.addMethod(
  2392. '_at_put_',
  2393. smalltalk.method({
  2394. selector: 'at:put:',
  2395. category: 'accessing',
  2396. fn: function (anIndex, anObject) {
  2397. var self = this;
  2398. self._errorReadOnly();
  2399. return self;
  2400. },
  2401. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%20%20%20%20%09self%20errorReadOnly%0A')}),
  2402. smalltalk.String);
  2403. smalltalk.addMethod(
  2404. '_at_ifAbsent_',
  2405. smalltalk.method({
  2406. selector: 'at:ifAbsent:',
  2407. category: 'accessing',
  2408. fn: function (anIndex, aBlock) {
  2409. var self = this;
  2410. self._at_(anIndex)._ifNil_(function () {return aBlock;});
  2411. return self;
  2412. },
  2413. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%20%20%20%20%09%28self%20at%3A%20anIndex%29%20ifNil%3A%20%5BaBlock%5D%0A')}),
  2414. smalltalk.String);
  2415. smalltalk.addMethod(
  2416. '_escaped',
  2417. smalltalk.method({
  2418. selector: 'escaped',
  2419. category: 'accessing',
  2420. fn: function () {
  2421. var self = this;
  2422. return function () {return escape(self);}();
  2423. return self;
  2424. },
  2425. source: unescape('escaped%0A%09%5E%7B%27return%20escape%28self%29%27%7D%0A')}),
  2426. smalltalk.String);
  2427. smalltalk.addMethod(
  2428. '_unescaped',
  2429. smalltalk.method({
  2430. selector: 'unescaped',
  2431. category: 'accessing',
  2432. fn: function () {
  2433. var self = this;
  2434. return function () {return unescape(self);}();
  2435. return self;
  2436. },
  2437. source: unescape('unescaped%0A%09%5E%7B%27return%20unescape%28self%29%27%7D%0A')}),
  2438. smalltalk.String);
  2439. smalltalk.addMethod(
  2440. '_add_',
  2441. smalltalk.method({
  2442. selector: 'add:',
  2443. category: 'adding',
  2444. fn: function (anObject) {
  2445. var self = this;
  2446. self._errorReadOnly();
  2447. return self;
  2448. },
  2449. source: unescape('add%3A%20anObject%0A%20%20%20%20%09self%20errorReadOnly%0A')}),
  2450. smalltalk.String);
  2451. smalltalk.addMethod(
  2452. '__comma',
  2453. smalltalk.method({
  2454. selector: ',',
  2455. category: 'copying',
  2456. fn: function (aString) {
  2457. var self = this;
  2458. return function () {return self + aString;}();
  2459. return self;
  2460. },
  2461. source: unescape('%2C%20aString%0A%20%20%20%20%09%5E%7B%27return%20self%20+%20aString%27%7D%0A')}),
  2462. smalltalk.String);
  2463. smalltalk.addMethod(
  2464. '_copyFrom_to_',
  2465. smalltalk.method({
  2466. selector: 'copyFrom:to:',
  2467. category: 'copying',
  2468. fn: function (anIndex, anotherIndex) {
  2469. var self = this;
  2470. return function () {return self.substring(anIndex - 1, anotherIndex);}();
  2471. return self;
  2472. },
  2473. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%20%20%20%20%09%5E%7B%27return%20self.substring%28anIndex%20-%201%2C%20anotherIndex%29%3B%27%7D%0A')}),
  2474. smalltalk.String);
  2475. smalltalk.addMethod(
  2476. '_shallowCopy',
  2477. smalltalk.method({
  2478. selector: 'shallowCopy',
  2479. category: 'copying',
  2480. fn: function () {
  2481. var self = this;
  2482. return self._class()._fromString_(self);
  2483. return self;
  2484. },
  2485. source: unescape('shallowCopy%0A%20%20%20%20%09%5Eself%20class%20fromString%3A%20self%0A')}),
  2486. smalltalk.String);
  2487. smalltalk.addMethod(
  2488. '_deepCopy',
  2489. smalltalk.method({
  2490. selector: 'deepCopy',
  2491. category: 'copying',
  2492. fn: function () {
  2493. var self = this;
  2494. return self._shallowCopy();
  2495. return self;
  2496. },
  2497. source: unescape('deepCopy%0A%20%20%20%20%09%5Eself%20shallowCopy%0A')}),
  2498. smalltalk.String);
  2499. smalltalk.addMethod(
  2500. '_asSelector',
  2501. smalltalk.method({
  2502. selector: 'asSelector',
  2503. category: 'converting',
  2504. fn: function () {
  2505. var self = this;
  2506. var selector = nil;
  2507. selector = "_".__comma(self);
  2508. selector = selector._replace_with_(":", "_");
  2509. selector = selector._replace_with_(unescape("%5B+%5D"), "_plus");
  2510. selector = selector._replace_with_(unescape("-"), "_minus");
  2511. selector = selector._replace_with_(unescape("%5B*%5D"), "_star");
  2512. selector = selector._replace_with_(unescape("%5B/%5D"), "_slash");
  2513. selector = selector._replace_with_(unescape("%3E"), "_gt");
  2514. selector = selector._replace_with_(unescape("%3C"), "_lt");
  2515. selector = selector._replace_with_(unescape("%3D"), "_eq");
  2516. selector = selector._replace_with_(unescape("%2C"), "_comma");
  2517. selector = selector._replace_with_(unescape("%5B@%5D"), "_at");
  2518. return selector;
  2519. return self;
  2520. },
  2521. source: unescape('asSelector%0A%09%7C%20selector%20%7C%0A%09selector%20%3A%3D%20%27_%27%2C%20self.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3A%27%20with%3A%20%27_%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B+%5D%27%20with%3A%20%27_plus%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27-%27%20with%3A%20%27_minus%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B*%5D%27%20with%3A%20%27_star%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B/%5D%27%20with%3A%20%27_slash%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3E%27%20with%3A%20%27_gt%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3C%27%20with%3A%20%27_lt%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3D%27%20with%3A%20%27_eq%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%2C%27%20with%3A%20%27_comma%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B@%5D%27%20with%3A%20%27_at%27.%0A%09%5Eselector%0A')}),
  2522. smalltalk.String);
  2523. smalltalk.addMethod(
  2524. '_asJavascript',
  2525. smalltalk.method({
  2526. selector: 'asJavascript',
  2527. category: 'converting',
  2528. fn: function () {
  2529. var self = this;
  2530. return function () {if (self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1) {return "unescape(\"" + escape(self) + "\")";} else {return "\"" + self + "\"";}}();
  2531. return self;
  2532. },
  2533. source: unescape('asJavascript%0A%09%5E%7B%27%0A%09if%28self.search%28/%5E%5Ba-zA-Z0-9_%3A.%24%20%5D*%24/%29%20%3D%3D%20-1%29%0A%09%09return%20%22unescape%28%5C%22%22%20+%20escape%28self%29%20+%20%22%5C%22%29%22%3B%0A%09else%0A%09%09return%20%22%5C%22%22%20+%20self%20+%20%22%5C%22%22%3B%0A%09%27%7D%0A')}),
  2534. smalltalk.String);
  2535. smalltalk.addMethod(
  2536. '_replace_with_',
  2537. smalltalk.method({
  2538. selector: 'replace:with:',
  2539. category: 'regular expressions',
  2540. fn: function (aString, anotherString) {
  2541. var self = this;
  2542. return self._replaceRegexp_with_(smalltalk.RegularExpression._fromString_flag_(aString, "g"), anotherString);
  2543. return self;
  2544. },
  2545. source: unescape('replace%3A%20aString%20with%3A%20anotherString%0A%20%20%20%20%09%5Eself%20replaceRegexp%3A%20%28RegularExpression%20fromString%3A%20aString%20flag%3A%20%27g%27%29%20with%3A%20anotherString%0A')}),
  2546. smalltalk.String);
  2547. smalltalk.addMethod(
  2548. '_replaceRegexp_with_',
  2549. smalltalk.method({
  2550. selector: 'replaceRegexp:with:',
  2551. category: 'regular expressions',
  2552. fn: function (aRegexp, aString) {
  2553. var self = this;
  2554. return function () {return self.replace(aRegexp, aString);}();
  2555. return self;
  2556. },
  2557. source: unescape('replaceRegexp%3A%20aRegexp%20with%3A%20aString%0A%20%20%20%20%09%5E%7B%27return%20self.replace%28aRegexp%2C%20aString%29%3B%27%7D%0A')}),
  2558. smalltalk.String);
  2559. smalltalk.addMethod(
  2560. '_tokenize_',
  2561. smalltalk.method({
  2562. selector: 'tokenize:',
  2563. category: 'converting',
  2564. fn: function (aString) {
  2565. var self = this;
  2566. return function () {return self.split(aString);}();
  2567. return self;
  2568. },
  2569. source: unescape('tokenize%3A%20aString%0A%09%5E%7B%27return%20self.split%28aString%29%27%7D%0A')}),
  2570. smalltalk.String);
  2571. smalltalk.addMethod(
  2572. '_match_',
  2573. smalltalk.method({
  2574. selector: 'match:',
  2575. category: 'regular expressions',
  2576. fn: function (aRegexp) {
  2577. var self = this;
  2578. return function () {return self.search(aRegexp) != -1;}();
  2579. return self;
  2580. },
  2581. source: unescape('match%3A%20aRegexp%0A%20%20%20%20%09%5E%7B%27return%20self.search%28aRegexp%29%20%21%3D%20-1%27%7D%0A')}),
  2582. smalltalk.String);
  2583. smalltalk.addMethod(
  2584. '_asString',
  2585. smalltalk.method({
  2586. selector: 'asString',
  2587. category: 'converting',
  2588. fn: function () {
  2589. var self = this;
  2590. return self;
  2591. return self;
  2592. },
  2593. source: unescape('asString%0A%20%20%20%20%09%5Eself%0A')}),
  2594. smalltalk.String);
  2595. smalltalk.addMethod(
  2596. '_asNumber',
  2597. smalltalk.method({
  2598. selector: 'asNumber',
  2599. category: 'converting',
  2600. fn: function () {
  2601. var self = this;
  2602. return function () {return Number(self);}();
  2603. return self;
  2604. },
  2605. source: unescape('asNumber%0A%09%5E%7B%27return%20Number%28self%29%3B%27%7D%0A')}),
  2606. smalltalk.String);
  2607. smalltalk.addMethod(
  2608. '_asParser',
  2609. smalltalk.method({
  2610. selector: 'asParser',
  2611. category: 'converting',
  2612. fn: function () {
  2613. var self = this;
  2614. return smalltalk.PPStringParser._new()._string_(self);
  2615. return self;
  2616. },
  2617. source: unescape('asParser%0A%20%20%20%20%09%5EPPStringParser%20new%20string%3A%20self%0A')}),
  2618. smalltalk.String);
  2619. smalltalk.addMethod(
  2620. '_asChoiceParser',
  2621. smalltalk.method({
  2622. selector: 'asChoiceParser',
  2623. category: 'converting',
  2624. fn: function () {
  2625. var self = this;
  2626. return smalltalk.PPChoiceParser._withAll_(self._asArray()._collect_(function (each) {return each._asParser();}));
  2627. return self;
  2628. },
  2629. source: unescape('asChoiceParser%0A%20%20%20%20%09%5EPPChoiceParser%20withAll%3A%20%28self%20asArray%20collect%3A%20%5B%3Aeach%20%7C%20each%20asParser%5D%29%0A')}),
  2630. smalltalk.String);
  2631. smalltalk.addMethod(
  2632. '_asCharacterParser',
  2633. smalltalk.method({
  2634. selector: 'asCharacterParser',
  2635. category: 'converting',
  2636. fn: function () {
  2637. var self = this;
  2638. return smalltalk.PPCharacterParser._new()._string_(self);
  2639. return self;
  2640. },
  2641. source: unescape('asCharacterParser%0A%20%20%20%20%09%5EPPCharacterParser%20new%20string%3A%20self%0A')}),
  2642. smalltalk.String);
  2643. smalltalk.addMethod(
  2644. '_errorReadOnly',
  2645. smalltalk.method({
  2646. selector: 'errorReadOnly',
  2647. category: 'error handling',
  2648. fn: function () {
  2649. var self = this;
  2650. self._error_(unescape("Object%20is%20read-only"));
  2651. return self;
  2652. },
  2653. source: unescape('errorReadOnly%0A%20%20%20%20%09self%20error%3A%20%27Object%20is%20read-only%27%0A')}),
  2654. smalltalk.String);
  2655. smalltalk.addMethod(
  2656. '_printString',
  2657. smalltalk.method({
  2658. selector: 'printString',
  2659. category: 'printing',
  2660. fn: function () {
  2661. var self = this;
  2662. return unescape("%27").__comma(self).__comma(unescape("%27"));
  2663. return self;
  2664. },
  2665. source: unescape('printString%0A%20%20%20%20%09%5E%27%27%27%27%2C%20self%2C%20%27%27%27%27%0A')}),
  2666. smalltalk.String);
  2667. smalltalk.addMethod(
  2668. '_printNl',
  2669. smalltalk.method({
  2670. selector: 'printNl',
  2671. category: 'printing',
  2672. fn: function () {
  2673. var self = this;
  2674. (function () {console.log(self);}());
  2675. return self;
  2676. },
  2677. source: unescape('printNl%0A%09%7B%27console.log%28self%29%27%7D%0A')}),
  2678. smalltalk.String);
  2679. smalltalk.addMethod(
  2680. '_isString',
  2681. smalltalk.method({
  2682. selector: 'isString',
  2683. category: 'testing',
  2684. fn: function () {
  2685. var self = this;
  2686. return true;
  2687. return self;
  2688. },
  2689. source: unescape('isString%0A%20%20%20%20%09%5Etrue%0A')}),
  2690. smalltalk.String);
  2691. smalltalk.addMethod(
  2692. '_asJQuery',
  2693. smalltalk.method({
  2694. selector: 'asJQuery',
  2695. category: '*JQuery',
  2696. fn: function () {
  2697. var self = this;
  2698. return smalltalk.JQuery._fromString_(self);
  2699. return self;
  2700. },
  2701. source: unescape('asJQuery%0A%20%20%20%20%5EJQuery%20fromString%3A%20self%0A')}),
  2702. smalltalk.String);
  2703. smalltalk.addMethod(
  2704. '_appendToJQuery_',
  2705. smalltalk.method({
  2706. selector: 'appendToJQuery:',
  2707. category: '*JQuery',
  2708. fn: function (aJQuery) {
  2709. var self = this;
  2710. (function () {aJQuery._appendElement_(String(self));}());
  2711. return self;
  2712. },
  2713. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20%7B%27aJQuery._appendElement_%28String%28self%29%29%27%7D%0A')}),
  2714. smalltalk.String);
  2715. smalltalk.addMethod(
  2716. '_appendToBrush_',
  2717. smalltalk.method({
  2718. selector: 'appendToBrush:',
  2719. category: '*Canvas',
  2720. fn: function (aTagBrush) {
  2721. var self = this;
  2722. aTagBrush._appendString_(self);
  2723. return self;
  2724. },
  2725. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20aTagBrush%20appendString%3A%20self%0A')}),
  2726. smalltalk.String);
  2727. smalltalk.addMethod(
  2728. '__gt',
  2729. smalltalk.method({
  2730. selector: '>',
  2731. category: 'comparing',
  2732. fn: function (aString) {
  2733. var self = this;
  2734. return function () {return String(self) > aString;}();
  2735. return self;
  2736. },
  2737. source: unescape('%3E%20aString%0A%09%5E%7B%27return%20String%28self%29%20%3E%20aString%27%7D%0A')}),
  2738. smalltalk.String);
  2739. smalltalk.addMethod(
  2740. '__lt',
  2741. smalltalk.method({
  2742. selector: '<',
  2743. category: 'comparing',
  2744. fn: function (aString) {
  2745. var self = this;
  2746. return function () {return String(self) < aString;}();
  2747. return self;
  2748. },
  2749. source: unescape('%3C%20aString%0A%09%5E%7B%27return%20String%28self%29%20%3C%20aString%27%7D%0A')}),
  2750. smalltalk.String);
  2751. smalltalk.addMethod(
  2752. '__gt_eq',
  2753. smalltalk.method({
  2754. selector: '>=',
  2755. category: 'comparing',
  2756. fn: function (aString) {
  2757. var self = this;
  2758. return function () {return String(self) >= aString;}();
  2759. return self;
  2760. },
  2761. source: unescape('%3E%3D%20aString%0A%09%5E%7B%27return%20String%28self%29%20%3E%3D%20aString%27%7D%0A')}),
  2762. smalltalk.String);
  2763. smalltalk.addMethod(
  2764. '__lt_eq',
  2765. smalltalk.method({
  2766. selector: '<=',
  2767. category: 'comparing',
  2768. fn: function (aString) {
  2769. var self = this;
  2770. return function () {return String(self) <= aString;}();
  2771. return self;
  2772. },
  2773. source: unescape('%3C%3D%20aString%0A%09%5E%7B%27return%20String%28self%29%20%3C%3D%20aString%27%7D%0A')}),
  2774. smalltalk.String);
  2775. smalltalk.addMethod(
  2776. '_remove_',
  2777. smalltalk.method({
  2778. selector: 'remove:',
  2779. category: 'adding',
  2780. fn: function (anObject) {
  2781. var self = this;
  2782. self._errorReadOnly();
  2783. return self;
  2784. },
  2785. source: unescape('remove%3A%20anObject%0A%20%20%20%20self%20errorReadOnly%0A')}),
  2786. smalltalk.String);
  2787. smalltalk.addMethod(
  2788. '_streamClass',
  2789. smalltalk.method({
  2790. selector: 'streamClass',
  2791. category: 'accessing',
  2792. fn: function () {
  2793. var self = this;
  2794. return smalltalk.StringStream;
  2795. return self;
  2796. },
  2797. source: unescape('streamClass%0A%09%20%20%20%20%5EStringStream%0A')}),
  2798. smalltalk.String.klass);
  2799. smalltalk.addMethod(
  2800. '_fromString_',
  2801. smalltalk.method({
  2802. selector: 'fromString:',
  2803. category: 'instance creation',
  2804. fn: function (aString) {
  2805. var self = this;
  2806. return function () {return new self.fn(aString);}();
  2807. return self;
  2808. },
  2809. source: unescape('fromString%3A%20aString%0A%09%20%20%20%20%5E%7B%27return%20new%20self.fn%28aString%29%3B%27%7D%0A')}),
  2810. smalltalk.String.klass);
  2811. smalltalk.addMethod(
  2812. '_cr',
  2813. smalltalk.method({
  2814. selector: 'cr',
  2815. category: 'accessing',
  2816. fn: function () {
  2817. var self = this;
  2818. return function () {return "\n";}();
  2819. return self;
  2820. },
  2821. source: unescape('cr%0A%09%20%20%20%20%5E%7B%27%7Breturn%20%27%27%5Cn%27%27%7D%3B%27%7D%0A')}),
  2822. smalltalk.String.klass);
  2823. smalltalk.addMethod(
  2824. '_lf',
  2825. smalltalk.method({
  2826. selector: 'lf',
  2827. category: 'accessing',
  2828. fn: function () {
  2829. var self = this;
  2830. return function () {return "\r";}();
  2831. return self;
  2832. },
  2833. source: unescape('lf%0A%09%20%20%20%20%5E%7B%27return%20%27%27%5Cr%27%27%3B%27%7D%0A')}),
  2834. smalltalk.String.klass);
  2835. smalltalk.addMethod(
  2836. '_space',
  2837. smalltalk.method({
  2838. selector: 'space',
  2839. category: 'accessing',
  2840. fn: function () {
  2841. var self = this;
  2842. return function () {return " ";}();
  2843. return self;
  2844. },
  2845. source: unescape('space%0A%09%20%20%20%20%5E%7B%27return%20%27%27%20%27%27%3B%27%7D%0A')}),
  2846. smalltalk.String.klass);
  2847. smalltalk.addMethod(
  2848. '_tab',
  2849. smalltalk.method({
  2850. selector: 'tab',
  2851. category: 'accessing',
  2852. fn: function () {
  2853. var self = this;
  2854. return function () {return "\t";}();
  2855. return self;
  2856. },
  2857. source: unescape('tab%0A%09%20%20%20%20%5E%7B%27return%20%27%27%5Ct%27%27%3B%27%7D%0A')}),
  2858. smalltalk.String.klass);
  2859. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel');
  2860. smalltalk.addMethod(
  2861. '_compile_',
  2862. smalltalk.method({
  2863. selector: 'compile:',
  2864. category: 'evaluating',
  2865. fn: function (aString) {
  2866. var self = this;
  2867. return function () {return self.compile(aString);}();
  2868. return self;
  2869. },
  2870. source: unescape('compile%3A%20aString%0A%09%5E%7B%27return%20self.compile%28aString%29%3B%27%7D%0A')}),
  2871. smalltalk.RegularExpression);
  2872. smalltalk.addMethod(
  2873. '_exec_',
  2874. smalltalk.method({
  2875. selector: 'exec:',
  2876. category: 'evaluating',
  2877. fn: function (aString) {
  2878. var self = this;
  2879. return function () {return self.exec(aString);}();
  2880. return self;
  2881. },
  2882. source: unescape('exec%3A%20aString%0A%09%5E%7B%27return%20self.exec%28aString%29%3B%27%7D%0A')}),
  2883. smalltalk.RegularExpression);
  2884. smalltalk.addMethod(
  2885. '_test_',
  2886. smalltalk.method({
  2887. selector: 'test:',
  2888. category: 'evaluating',
  2889. fn: function (aString) {
  2890. var self = this;
  2891. return function () {return self.test(aString);}();
  2892. return self;
  2893. },
  2894. source: unescape('test%3A%20aString%0A%09%5E%7B%27return%20self.test%28aString%29%3B%27%7D%0A')}),
  2895. smalltalk.RegularExpression);
  2896. smalltalk.addMethod(
  2897. '_fromString_flag_',
  2898. smalltalk.method({
  2899. selector: 'fromString:flag:',
  2900. category: 'instance creation',
  2901. fn: function (aString, anotherString) {
  2902. var self = this;
  2903. return function () {return new RegExp(aString, anotherString);}();
  2904. return self;
  2905. },
  2906. source: unescape('fromString%3A%20aString%20flag%3A%20anotherString%0A%09%20%20%20%20%5E%7B%27return%20new%20RegExp%28aString%2C%20anotherString%29%3B%27%7D%0A')}),
  2907. smalltalk.RegularExpression.klass);
  2908. smalltalk.addMethod(
  2909. '_fromString_',
  2910. smalltalk.method({
  2911. selector: 'fromString:',
  2912. category: 'instance creation',
  2913. fn: function (aString) {
  2914. var self = this;
  2915. return self._fromString_flag_(aString, "");
  2916. return self;
  2917. },
  2918. source: unescape('fromString%3A%20aString%0A%09%20%20%20%20%5Eself%20fromString%3A%20aString%20flag%3A%20%27%27%0A')}),
  2919. smalltalk.RegularExpression.klass);
  2920. smalltalk.addClass('Array', smalltalk.Collection, [], 'Kernel');
  2921. smalltalk.addMethod(
  2922. '_size',
  2923. smalltalk.method({
  2924. selector: 'size',
  2925. category: 'accessing',
  2926. fn: function () {
  2927. var self = this;
  2928. return function () {return self.length;}();
  2929. return self;
  2930. },
  2931. source: unescape('size%0A%09%5E%7B%27return%20self.length%27%7D%0A')}),
  2932. smalltalk.Array);
  2933. smalltalk.addMethod(
  2934. '_at_put_',
  2935. smalltalk.method({
  2936. selector: 'at:put:',
  2937. category: 'accessing',
  2938. fn: function (anIndex, anObject) {
  2939. var self = this;
  2940. return function () {return self[anIndex - 1] = anObject;}();
  2941. return self;
  2942. },
  2943. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09%5E%7B%27return%20self%5BanIndex%20-%201%5D%20%3D%20anObject%27%7D%0A')}),
  2944. smalltalk.Array);
  2945. smalltalk.addMethod(
  2946. '_at_ifAbsent_',
  2947. smalltalk.method({
  2948. selector: 'at:ifAbsent:',
  2949. category: 'accessing',
  2950. fn: function (anIndex, aBlock) {
  2951. var self = this;
  2952. return function () {var value = self[anIndex - 1];if (value === undefined) {return aBlock();} else {return value;}}();
  2953. return self;
  2954. },
  2955. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09%5E%7B%27%0A%09%20%20%20%20var%20value%20%3D%20self%5BanIndex%20-%201%5D%3B%0A%09%20%20%20%20if%28value%20%3D%3D%3D%20undefined%29%20%7B%0A%09%09return%20aBlock%28%29%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20value%3B%0A%09%20%20%20%20%7D%0A%09%27%7D%0A')}),
  2956. smalltalk.Array);
  2957. smalltalk.addMethod(
  2958. '_add_',
  2959. smalltalk.method({
  2960. selector: 'add:',
  2961. category: 'adding',
  2962. fn: function (anObject) {
  2963. var self = this;
  2964. return function () {self.push(anObject);return anObject;}();
  2965. return self;
  2966. },
  2967. source: unescape('add%3A%20anObject%0A%09%5E%7B%27self.push%28anObject%29%3B%20return%20anObject%3B%27%7D%0A')}),
  2968. smalltalk.Array);
  2969. smalltalk.addMethod(
  2970. '_addLast_',
  2971. smalltalk.method({
  2972. selector: 'addLast:',
  2973. category: 'adding',
  2974. fn: function (anObject) {
  2975. var self = this;
  2976. return self._add_(anObject);
  2977. return self;
  2978. },
  2979. source: unescape('addLast%3A%20anObject%0A%09%5Eself%20add%3A%20anObject%0A')}),
  2980. smalltalk.Array);
  2981. smalltalk.addMethod(
  2982. '_shallowCopy',
  2983. smalltalk.method({
  2984. selector: 'shallowCopy',
  2985. category: 'copying',
  2986. fn: function () {
  2987. var self = this;
  2988. var newCollection = nil;
  2989. newCollection = self._class()._new();
  2990. self._do_(function (each) {return newCollection._add_(each);});
  2991. return newCollection;
  2992. return self;
  2993. },
  2994. source: unescape('shallowCopy%0A%09%7C%20newCollection%20%7C%0A%09newCollection%20%3A%3D%20self%20class%20new.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%20newCollection%20add%3A%20each%5D.%0A%09%5EnewCollection%0A')}),
  2995. smalltalk.Array);
  2996. smalltalk.addMethod(
  2997. '_deepCopy',
  2998. smalltalk.method({
  2999. selector: 'deepCopy',
  3000. category: 'copying',
  3001. fn: function () {
  3002. var self = this;
  3003. var newCollection = nil;
  3004. newCollection = self._class()._new();
  3005. self._do_(function (each) {return newCollection._add_(each._deepCopy());});
  3006. return newCollection;
  3007. return self;
  3008. },
  3009. source: unescape('deepCopy%0A%09%7C%20newCollection%20%7C%0A%09newCollection%20%3A%3D%20self%20class%20new.%0A%09self%20do%3A%20%5B%3Aeach%20%7C%20newCollection%20add%3A%20each%20deepCopy%5D.%0A%09%5EnewCollection%0A')}),
  3010. smalltalk.Array);
  3011. smalltalk.addMethod(
  3012. '_copyFrom_to_',
  3013. smalltalk.method({
  3014. selector: 'copyFrom:to:',
  3015. category: 'copying',
  3016. fn: function (anIndex, anotherIndex) {
  3017. var self = this;
  3018. var array = nil;
  3019. array = self._class()._new();
  3020. anIndex._to_do_(anotherIndex, function (each) {return array._add_(self._at_(each));});
  3021. return array;
  3022. return self;
  3023. },
  3024. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09%7C%20array%20%7C%0A%09array%20%3A%3D%20self%20class%20new.%0A%09anIndex%20to%3A%20anotherIndex%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20array%20add%3A%20%28self%20at%3A%20each%29%5D.%0A%09%5Earray%0A')}),
  3025. smalltalk.Array);
  3026. smalltalk.addMethod(
  3027. '_join_',
  3028. smalltalk.method({
  3029. selector: 'join:',
  3030. category: 'enumerating',
  3031. fn: function (aString) {
  3032. var self = this;
  3033. return function () {return self.join(aString);}();
  3034. return self;
  3035. },
  3036. source: unescape('join%3A%20aString%0A%09%5E%7B%27return%20self.join%28aString%29%3B%27%7D%0A')}),
  3037. smalltalk.Array);
  3038. smalltalk.addMethod(
  3039. '_asJavascript',
  3040. smalltalk.method({
  3041. selector: 'asJavascript',
  3042. category: 'converting',
  3043. fn: function () {
  3044. var self = this;
  3045. return unescape("%5B").__comma(self._collect_(function (each) {return each._asJavascript();})._join_(unescape("%2C%20"))).__comma(unescape("%5D"));
  3046. return self;
  3047. },
  3048. source: unescape('asJavascript%0A%09%5E%27%5B%27%2C%20%28%28self%20collect%3A%20%5B%3Aeach%20%7C%20each%20asJavascript%5D%29%20join%3A%20%27%2C%20%27%29%2C%20%20%27%5D%27%0A')}),
  3049. smalltalk.Array);
  3050. smalltalk.addMethod(
  3051. '_sort',
  3052. smalltalk.method({
  3053. selector: 'sort',
  3054. category: 'enumerating',
  3055. fn: function () {
  3056. var self = this;
  3057. return self._copy()._basicPerform_("sort");
  3058. return self;
  3059. },
  3060. source: unescape('sort%0A%20%20%20%20%5Eself%20copy%20basicPerform%3A%20%27sort%27%0A')}),
  3061. smalltalk.Array);
  3062. smalltalk.addMethod(
  3063. '_sort_',
  3064. smalltalk.method({
  3065. selector: 'sort:',
  3066. category: 'enumerating',
  3067. fn: function (aBlock) {
  3068. var self = this;
  3069. return self._copy()._basicPerform_withArguments_("sort", smalltalk.Array._with_(aBlock));
  3070. return self;
  3071. },
  3072. source: unescape('sort%3A%20aBlock%0A%20%20%20%20%5Eself%20copy%20basicPerform%3A%20%27sort%27%20withArguments%3A%20%28Array%20with%3A%20aBlock%29%0A')}),
  3073. smalltalk.Array);
  3074. smalltalk.addMethod(
  3075. '_remove_',
  3076. smalltalk.method({
  3077. selector: 'remove:',
  3078. category: 'adding',
  3079. fn: function (anObject) {
  3080. var self = this;
  3081. (function () {for (var i = 0; i < self.length; i++) {if (self[i] == anObject) {self.splice(i, 1);break;}}}());
  3082. return self;
  3083. },
  3084. source: unescape('remove%3A%20anObject%0A%20%20%20%20%7B%27for%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%20%7B%0A%09if%28self%5Bi%5D%20%3D%3D%20anObject%29%20%7B%0A%09%09self.splice%28i%2C1%29%3B%0A%09%09break%3B%0A%09%7D%0A%20%20%20%20%7D%27%7D%0A')}),
  3085. smalltalk.Array);
  3086. smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel');
  3087. smalltalk.addMethod(
  3088. '_messageText',
  3089. smalltalk.method({
  3090. selector: 'messageText',
  3091. category: 'accessing',
  3092. fn: function () {
  3093. var self = this;
  3094. return self['@messageText'];
  3095. return self;
  3096. },
  3097. source: unescape('messageText%0A%09%5EmessageText%0A')}),
  3098. smalltalk.Error);
  3099. smalltalk.addMethod(
  3100. '_messageText_',
  3101. smalltalk.method({
  3102. selector: 'messageText:',
  3103. category: 'accessing',
  3104. fn: function (aString) {
  3105. var self = this;
  3106. self['@messageText'] = aString;
  3107. return self;
  3108. },
  3109. source: unescape('messageText%3A%20aString%0A%09messageText%20%3A%3D%20aString%0A')}),
  3110. smalltalk.Error);
  3111. smalltalk.addMethod(
  3112. '_signal',
  3113. smalltalk.method({
  3114. selector: 'signal',
  3115. category: 'signaling',
  3116. fn: function () {
  3117. var self = this;
  3118. return function () {throw {smalltalkError: self};}();
  3119. return self;
  3120. },
  3121. source: unescape('signal%0A%09%5E%7B%27throw%28%7BsmalltalkError%3A%20self%7D%29%27%7D%0A')}),
  3122. smalltalk.Error);
  3123. smalltalk.addMethod(
  3124. '_signal_',
  3125. smalltalk.method({
  3126. selector: 'signal:',
  3127. category: 'instance creation',
  3128. fn: function (aString) {
  3129. var self = this;
  3130. return function ($rec) {$rec._messageText_(aString);return $rec._signal();}(self._new());
  3131. return self;
  3132. },
  3133. source: unescape('signal%3A%20aString%0A%09%20%20%20%20%5Eself%20new%0A%09%09messageText%3A%20aString%3B%0A%09%09signal%0A')}),
  3134. smalltalk.Error.klass);
  3135. smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel');
  3136. smalltalk.addMethod(
  3137. '__eq',
  3138. smalltalk.method({
  3139. selector: '=',
  3140. category: 'comparing',
  3141. fn: function (anAssociation) {
  3142. var self = this;
  3143. return self._class().__eq(anAssociation._class())._and_(function () {return self._key().__eq(anAssociation._key())._and_(function () {return self._value().__eq(anAssociation._value());});});
  3144. return self;
  3145. },
  3146. source: unescape('%3D%20anAssociation%0A%09%5Eself%20class%20%3D%20anAssociation%20class%20and%3A%20%5B%0A%09%20%20%20%20self%20key%20%3D%20anAssociation%20key%20and%3A%20%5B%0A%09%09self%20value%20%3D%20anAssociation%20value%5D%5D%0A')}),
  3147. smalltalk.Association);
  3148. smalltalk.addMethod(
  3149. '_key_',
  3150. smalltalk.method({
  3151. selector: 'key:',
  3152. category: 'accessing',
  3153. fn: function (aKey) {
  3154. var self = this;
  3155. self['@key'] = aKey;
  3156. return self;
  3157. },
  3158. source: unescape('key%3A%20aKey%0A%09key%20%3A%3D%20aKey%0A')}),
  3159. smalltalk.Association);
  3160. smalltalk.addMethod(
  3161. '_key',
  3162. smalltalk.method({
  3163. selector: 'key',
  3164. category: 'accessing',
  3165. fn: function () {
  3166. var self = this;
  3167. return self['@key'];
  3168. return self;
  3169. },
  3170. source: unescape('key%0A%09%5Ekey%0A')}),
  3171. smalltalk.Association);
  3172. smalltalk.addMethod(
  3173. '_value_',
  3174. smalltalk.method({
  3175. selector: 'value:',
  3176. category: 'accessing',
  3177. fn: function (aValue) {
  3178. var self = this;
  3179. self['@value'] = aValue;
  3180. return self;
  3181. },
  3182. source: unescape('value%3A%20aValue%0A%09value%20%3A%3D%20aValue%0A')}),
  3183. smalltalk.Association);
  3184. smalltalk.addMethod(
  3185. '_value',
  3186. smalltalk.method({
  3187. selector: 'value',
  3188. category: 'accessing',
  3189. fn: function () {
  3190. var self = this;
  3191. return self['@value'];
  3192. return self;
  3193. },
  3194. source: unescape('value%0A%09%5Evalue%0A')}),
  3195. smalltalk.Association);
  3196. smalltalk.addMethod(
  3197. '_key_value_',
  3198. smalltalk.method({
  3199. selector: 'key:value:',
  3200. category: 'instance creation',
  3201. fn: function (aKey, aValue) {
  3202. var self = this;
  3203. return function ($rec) {$rec._key_(aKey);$rec._value_(aValue);return $rec._yourself();}(self._new());
  3204. return self;
  3205. },
  3206. source: unescape('key%3A%20aKey%20value%3A%20aValue%0A%09%20%20%20%20%5Eself%20new%0A%09%09key%3A%20aKey%3B%0A%09%09value%3A%20aValue%3B%0A%09%09yourself%0A')}),
  3207. smalltalk.Association.klass);
  3208. smalltalk.addClass('Dictionary', smalltalk.Collection, ['keys'], 'Kernel');
  3209. smalltalk.addMethod(
  3210. '__eq',
  3211. smalltalk.method({
  3212. selector: '=',
  3213. category: 'comparing',
  3214. fn: function (aDictionary) {
  3215. var self = this;
  3216. try {
  3217. self._class().__eq(aDictionary._class())._ifFalse_(function () {return function () {throw {name: "stReturn", selector: "__eq", fn: function () {return false;}};}();});
  3218. self._associationsDo_(function (assoc) {return aDictionary._at_ifAbsent_(assoc._key(), function () {return function () {throw {name: "stReturn", selector: "__eq", fn: function () {return false;}};}();}).__eq(assoc._value())._ifFalse_(function () {return function () {throw {name: "stReturn", selector: "__eq", fn: function () {return false;}};}();});});
  3219. (function () {throw {name: "stReturn", selector: "__eq", fn: function () {return true;}};}());
  3220. return self;
  3221. } catch (e) {
  3222. if (e.name === "stReturn" && e.selector === "__eq") {
  3223. return e.fn();
  3224. }
  3225. throw e;
  3226. }
  3227. },
  3228. source: unescape('%3D%20aDictionary%0A%09self%20class%20%3D%20aDictionary%20class%20ifFalse%3A%20%5B%5Efalse%5D.%0A%09self%20associationsDo%3A%20%5B%3Aassoc%20%7C%0A%09%20%20%20%20%28aDictionary%20at%3A%20assoc%20key%20ifAbsent%3A%20%5B%5Efalse%5D%29%20%3D%20assoc%20value%20%0A%09%09ifFalse%3A%20%5B%5Efalse%5D%5D.%0A%09%5Etrue%0A')}),
  3229. smalltalk.Dictionary);
  3230. smalltalk.addMethod(
  3231. '_shallowCopy',
  3232. smalltalk.method({
  3233. selector: 'shallowCopy',
  3234. category: 'copying',
  3235. fn: function () {
  3236. var self = this;
  3237. var copy = nil;
  3238. copy = self._class()._new();
  3239. self._associationsDo_(function (each) {return copy._at_put_(each._key(), each._value());});
  3240. return copy;
  3241. return self;
  3242. },
  3243. source: unescape('shallowCopy%0A%09%7C%20copy%20%7C%0A%09copy%20%3A%3D%20self%20class%20new.%0A%09self%20associationsDo%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20copy%20at%3A%20each%20key%20%20put%3A%20each%20value%5D.%0A%09%5Ecopy%0A')}),
  3244. smalltalk.Dictionary);
  3245. smalltalk.addMethod(
  3246. '_initialize',
  3247. smalltalk.method({
  3248. selector: 'initialize',
  3249. category: 'initialization',
  3250. fn: function () {
  3251. var self = this;
  3252. self.klass.superclass.fn.prototype._initialize.apply(self, []);
  3253. self['@keys'] = [];
  3254. return self;
  3255. },
  3256. source: unescape('initialize%0A%20%20%20%20%09super%20initialize.%0A%20%20%20%20%09keys%20%3A%3D%20%23%28%29%0A')}),
  3257. smalltalk.Dictionary);
  3258. smalltalk.addMethod(
  3259. '_size',
  3260. smalltalk.method({
  3261. selector: 'size',
  3262. category: 'accessing',
  3263. fn: function () {
  3264. var self = this;
  3265. return self['@keys']._size();
  3266. return self;
  3267. },
  3268. source: unescape('size%0A%09%5Ekeys%20size%0A')}),
  3269. smalltalk.Dictionary);
  3270. smalltalk.addMethod(
  3271. '_associations',
  3272. smalltalk.method({
  3273. selector: 'associations',
  3274. category: 'accessing',
  3275. fn: function () {
  3276. var self = this;
  3277. var associations = nil;
  3278. associations = [];
  3279. self['@keys']._do_(function (each) {return associations._add_(smalltalk.Association._key_value_(each, self._at_(each)));});
  3280. return associations;
  3281. return self;
  3282. },
  3283. source: unescape('associations%0A%09%7C%20associations%20%7C%0A%09associations%20%3A%3D%20%23%28%29.%0A%09keys%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20associations%20add%3A%20%28Association%20key%3A%20each%20value%3A%20%28self%20at%3A%20each%29%29%5D.%0A%09%5Eassociations%0A')}),
  3284. smalltalk.Dictionary);
  3285. smalltalk.addMethod(
  3286. '_keys',
  3287. smalltalk.method({
  3288. selector: 'keys',
  3289. category: 'accessing',
  3290. fn: function () {
  3291. var self = this;
  3292. return self['@keys']._copy();
  3293. return self;
  3294. },
  3295. source: unescape('keys%0A%09%5Ekeys%20copy%0A')}),
  3296. smalltalk.Dictionary);
  3297. smalltalk.addMethod(
  3298. '_values',
  3299. smalltalk.method({
  3300. selector: 'values',
  3301. category: 'accessing',
  3302. fn: function () {
  3303. var self = this;
  3304. return self['@keys']._collect_(function (each) {return self._at_(each);});
  3305. return self;
  3306. },
  3307. source: unescape('values%0A%20%20%20%20%09%5Ekeys%20collect%3A%20%5B%3Aeach%20%7C%20self%20at%3A%20each%5D%0A')}),
  3308. smalltalk.Dictionary);
  3309. smalltalk.addMethod(
  3310. '_at_put_',
  3311. smalltalk.method({
  3312. selector: 'at:put:',
  3313. category: 'accessing',
  3314. fn: function (aKey, aValue) {
  3315. var self = this;
  3316. self['@keys']._includes_(aKey)._ifFalse_(function () {return self['@keys']._add_(aKey);});
  3317. return self._basicAt_put_(aKey, aValue);
  3318. return self;
  3319. },
  3320. source: unescape('at%3A%20aKey%20put%3A%20aValue%0A%09%28keys%20includes%3A%20aKey%29%20ifFalse%3A%20%5Bkeys%20add%3A%20aKey%5D.%0A%09%5Eself%20basicAt%3A%20aKey%20put%3A%20aValue%0A')}),
  3321. smalltalk.Dictionary);
  3322. smalltalk.addMethod(
  3323. '_at_ifAbsent_',
  3324. smalltalk.method({
  3325. selector: 'at:ifAbsent:',
  3326. category: 'accessing',
  3327. fn: function (aKey, aBlock) {
  3328. var self = this;
  3329. return self._basicAt_(aKey)._ifNil_(aBlock);
  3330. return self;
  3331. },
  3332. source: unescape('at%3A%20aKey%20ifAbsent%3A%20aBlock%0A%09%5E%28self%20basicAt%3A%20aKey%29%20ifNil%3A%20aBlock%0A')}),
  3333. smalltalk.Dictionary);
  3334. smalltalk.addMethod(
  3335. '_at_ifAbsentPut_',
  3336. smalltalk.method({
  3337. selector: 'at:ifAbsentPut:',
  3338. category: 'accessing',
  3339. fn: function (aKey, aBlock) {
  3340. var self = this;
  3341. return self._at_ifAbsent_(aKey, function () {return self._at_put_(aKey, aBlock._value());});
  3342. return self;
  3343. },
  3344. source: unescape('at%3A%20aKey%20ifAbsentPut%3A%20aBlock%0A%20%20%20%20%09%5Eself%20at%3A%20aKey%20ifAbsent%3A%20%5B%0A%20%20%20%20%09%20%20%20%20self%20at%3A%20aKey%20put%3A%20aBlock%20value%5D%0A')}),
  3345. smalltalk.Dictionary);
  3346. smalltalk.addMethod(
  3347. '_at_ifPresent_',
  3348. smalltalk.method({
  3349. selector: 'at:ifPresent:',
  3350. category: 'accessing',
  3351. fn: function (aKey, aBlock) {
  3352. var self = this;
  3353. return self._basicAt_(aKey)._ifNotNil_(function () {return aBlock._value_(self._at_(aKey));});
  3354. return self;
  3355. },
  3356. source: unescape('at%3A%20aKey%20ifPresent%3A%20aBlock%0A%09%5E%28self%20basicAt%3A%20aKey%29%20ifNotNil%3A%20%5BaBlock%20value%3A%20%28self%20at%3A%20aKey%29%5D%0A')}),
  3357. smalltalk.Dictionary);
  3358. smalltalk.addMethod(
  3359. '_at_ifPresent_ifAbsent_',
  3360. smalltalk.method({
  3361. selector: 'at:ifPresent:ifAbsent:',
  3362. category: 'accessing',
  3363. fn: function (aKey, aBlock, anotherBlock) {
  3364. var self = this;
  3365. return self._basicAt_(aKey)._ifNil_ifNotNil_(anotherBlock, function () {return aBlock._value_(self._at_(aKey));});
  3366. return self;
  3367. },
  3368. source: unescape('at%3A%20aKey%20ifPresent%3A%20aBlock%20ifAbsent%3A%20anotherBlock%0A%09%5E%28self%20basicAt%3A%20aKey%29%0A%09%20%20%20%20ifNil%3A%20anotherBlock%0A%09%20%20%20%20ifNotNil%3A%20%5BaBlock%20value%3A%20%28self%20at%3A%20aKey%29%5D%0A')}),
  3369. smalltalk.Dictionary);
  3370. smalltalk.addMethod(
  3371. '_add_',
  3372. smalltalk.method({
  3373. selector: 'add:',
  3374. category: 'adding/removing',
  3375. fn: function (anAssociation) {
  3376. var self = this;
  3377. self._at_put_(anAssociation._key(), anAssociation._value());
  3378. return self;
  3379. },
  3380. source: unescape('add%3A%20anAssociation%0A%20%20%20%20%09self%20at%3A%20anAssociation%20key%20put%3A%20anAssociation%20value%0A')}),
  3381. smalltalk.Dictionary);
  3382. smalltalk.addMethod(
  3383. '_addAll_',
  3384. smalltalk.method({
  3385. selector: 'addAll:',
  3386. category: 'adding/removing',
  3387. fn: function (aDictionary) {
  3388. var self = this;
  3389. self.klass.superclass.fn.prototype._addAll_.apply(self, [aDictionary._associations()]);
  3390. return aDictionary;
  3391. return self;
  3392. },
  3393. source: unescape('addAll%3A%20aDictionary%0A%20%20%20%20%09super%20addAll%3A%20aDictionary%20associations.%0A%20%20%20%20%09%5EaDictionary%0A')}),
  3394. smalltalk.Dictionary);
  3395. smalltalk.addMethod(
  3396. '__comma',
  3397. smalltalk.method({
  3398. selector: ',',
  3399. category: 'copying',
  3400. fn: function (aCollection) {
  3401. var self = this;
  3402. self._shouldNotImplement();
  3403. return self;
  3404. },
  3405. source: unescape('%2C%20aCollection%0A%09self%20shouldNotImplement%0A')}),
  3406. smalltalk.Dictionary);
  3407. smalltalk.addMethod(
  3408. '_copyFrom_to_',
  3409. smalltalk.method({
  3410. selector: 'copyFrom:to:',
  3411. category: 'copying',
  3412. fn: function (anIndex, anotherIndex) {
  3413. var self = this;
  3414. self._shouldNotImplement();
  3415. return self;
  3416. },
  3417. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09self%20shouldNotImplement%0A')}),
  3418. smalltalk.Dictionary);
  3419. smalltalk.addMethod(
  3420. '_associationsDo_',
  3421. smalltalk.method({
  3422. selector: 'associationsDo:',
  3423. category: 'enumerating',
  3424. fn: function (aBlock) {
  3425. var self = this;
  3426. self._associations()._do_(aBlock);
  3427. return self;
  3428. },
  3429. source: unescape('associationsDo%3A%20aBlock%0A%20%20%20%20%09self%20associations%20do%3A%20aBlock%0A')}),
  3430. smalltalk.Dictionary);
  3431. smalltalk.addMethod(
  3432. '_keysAndValuesDo_',
  3433. smalltalk.method({
  3434. selector: 'keysAndValuesDo:',
  3435. category: 'enumerating',
  3436. fn: function (aBlock) {
  3437. var self = this;
  3438. self._associationsDo_(function (each) {return aBlock._value_value_(each._key(), each._value());});
  3439. return self;
  3440. },
  3441. source: unescape('keysAndValuesDo%3A%20aBlock%0A%20%20%20%20%09self%20associationsDo%3A%20%5B%3Aeach%20%7C%0A%20%20%20%20%09%20%20%20%20aBlock%20value%3A%20each%20key%20value%3A%20each%20value%5D%0A')}),
  3442. smalltalk.Dictionary);
  3443. smalltalk.addMethod(
  3444. '_do_',
  3445. smalltalk.method({
  3446. selector: 'do:',
  3447. category: 'enumerating',
  3448. fn: function (aBlock) {
  3449. var self = this;
  3450. self._values()._do_(aBlock);
  3451. return self;
  3452. },
  3453. source: unescape('do%3A%20aBlock%0A%20%20%20%20%09self%20values%20do%3A%20aBlock%0A')}),
  3454. smalltalk.Dictionary);
  3455. smalltalk.addMethod(
  3456. '_select_',
  3457. smalltalk.method({
  3458. selector: 'select:',
  3459. category: 'enumerating',
  3460. fn: function (aBlock) {
  3461. var self = this;
  3462. var newDict = nil;
  3463. newDict = self._class()._new();
  3464. self._keysAndValuesDo_(function (key, value) {return aBlock._value_(value)._ifTrue_(function () {return newDict._at_put_(key, value);});});
  3465. return newDict;
  3466. return self;
  3467. },
  3468. source: unescape('select%3A%20aBlock%0A%20%20%20%20%09%7C%20newDict%20%7C%0A%20%20%20%20%09newDict%20%3A%3D%20self%20class%20new.%0A%20%20%20%20%09self%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%20%20%20%20%09%20%20%20%20%28aBlock%20value%3A%20value%29%20ifTrue%3A%20%5BnewDict%20at%3A%20key%20put%3A%20value%5D%5D.%0A%20%20%20%20%09%5EnewDict%0A')}),
  3469. smalltalk.Dictionary);
  3470. smalltalk.addMethod(
  3471. '_collect_',
  3472. smalltalk.method({
  3473. selector: 'collect:',
  3474. category: 'enumerating',
  3475. fn: function (aBlock) {
  3476. var self = this;
  3477. var newDict = nil;
  3478. newDict = self._class()._new();
  3479. self._keysAndValuesDo_(function (key, value) {return aBlock._value_(value)._ifTrue_(function () {return newDict._at_put_(key, value);});});
  3480. return newDict;
  3481. return self;
  3482. },
  3483. source: unescape('collect%3A%20aBlock%0A%20%20%20%20%09%7C%20newDict%20%7C%0A%20%20%20%20%09newDict%20%3A%3D%20self%20class%20new.%0A%20%20%20%20%09self%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%20%20%20%20%09%20%20%20%20%28aBlock%20value%3A%20value%29%20ifTrue%3A%20%5BnewDict%20at%3A%20key%20put%3A%20value%5D%5D.%0A%20%20%20%20%09%5EnewDict%0A')}),
  3484. smalltalk.Dictionary);
  3485. smalltalk.addMethod(
  3486. '_detect_ifNone_',
  3487. smalltalk.method({
  3488. selector: 'detect:ifNone:',
  3489. category: 'enumerating',
  3490. fn: function (aBlock, anotherBlock) {
  3491. var self = this;
  3492. return self._values()._detect_ifNone_(aBlock, anotherBlock);
  3493. return self;
  3494. },
  3495. source: unescape('detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A%09%5Eself%20values%20detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A')}),
  3496. smalltalk.Dictionary);
  3497. smalltalk.addMethod(
  3498. '_includes_',
  3499. smalltalk.method({
  3500. selector: 'includes:',
  3501. category: 'enumerating',
  3502. fn: function (anObject) {
  3503. var self = this;
  3504. return self._values()._includes_(anObject);
  3505. return self;
  3506. },
  3507. source: unescape('includes%3A%20anObject%0A%09%5Eself%20values%20includes%3A%20anObject%0A')}),
  3508. smalltalk.Dictionary);
  3509. smalltalk.addMethod(
  3510. '_remove_',
  3511. smalltalk.method({
  3512. selector: 'remove:',
  3513. category: 'adding/removing',
  3514. fn: function (aKey) {
  3515. var self = this;
  3516. self._removeKey_(aKey);
  3517. return self;
  3518. },
  3519. source: unescape('remove%3A%20aKey%0A%20%20%20%20self%20removeKey%3A%20aKey%0A')}),
  3520. smalltalk.Dictionary);
  3521. smalltalk.addMethod(
  3522. '_removeKey_',
  3523. smalltalk.method({
  3524. selector: 'removeKey:',
  3525. category: 'adding/removing',
  3526. fn: function (aKey) {
  3527. var self = this;
  3528. self['@keys']._remove_(aKey);
  3529. return self;
  3530. },
  3531. source: unescape('removeKey%3A%20aKey%0A%20%20%20%20keys%20remove%3A%20aKey%0A')}),
  3532. smalltalk.Dictionary);
  3533. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel');
  3534. smalltalk.addMethod(
  3535. '_superclass_subclass_',
  3536. smalltalk.method({
  3537. selector: 'superclass:subclass:',
  3538. category: 'class creation',
  3539. fn: function (aClass, aString) {
  3540. var self = this;
  3541. self._superclass_subclass_instanceVariableNames_category_(aClass, aString, "", nil);
  3542. return self;
  3543. },
  3544. source: unescape('superclass%3A%20aClass%20subclass%3A%20aString%0A%09self%20superclass%3A%20aClass%20subclass%3A%20aString%20instanceVariableNames%3A%20%27%27%20category%3A%20nil%0A')}),
  3545. smalltalk.ClassBuilder);
  3546. smalltalk.addMethod(
  3547. '_superclass_subclass_instanceVariableNames_category_',
  3548. smalltalk.method({
  3549. selector: 'superclass:subclass:instanceVariableNames:category:',
  3550. category: 'class creation',
  3551. fn: function (aClass, aString, aString2, aString3) {
  3552. var self = this;
  3553. var newClass = nil;
  3554. newClass = self._addSubclassOf_named_instanceVariableNames_(aClass, aString, self._instanceVariableNamesFor_(aString2));
  3555. self._setupClass_(newClass);
  3556. newClass._category_(aString3._ifNil_(function () {return "unclassified";}));
  3557. return self;
  3558. },
  3559. source: unescape('superclass%3A%20aClass%20subclass%3A%20aString%20instanceVariableNames%3A%20aString2%20category%3A%20aString3%0A%09%7C%20newClass%20%7C%0A%09newClass%20%3A%3D%20self%20addSubclassOf%3A%20aClass%20named%3A%20aString%20instanceVariableNames%3A%20%28self%20instanceVariableNamesFor%3A%20aString2%29.%0A%09self%20setupClass%3A%20newClass.%0A%09newClass%20category%3A%20%28aString3%20ifNil%3A%20%5B%27unclassified%27%5D%29%0A')}),
  3560. smalltalk.ClassBuilder);
  3561. smalltalk.addMethod(
  3562. '_class_instanceVariableNames_',
  3563. smalltalk.method({
  3564. selector: 'class:instanceVariableNames:',
  3565. category: 'class creation',
  3566. fn: function (aClass, aString) {
  3567. var self = this;
  3568. aClass._isMetaclass()._ifFalse_(function () {return self._error_(aClass._name().__comma(" is not a metaclass"));});
  3569. aClass._basicAt_put_("iVarNames", self._instanceVariableNamesFor_(aString));
  3570. self._setupClass_(aClass);
  3571. return self;
  3572. },
  3573. 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%0A')}),
  3574. smalltalk.ClassBuilder);
  3575. smalltalk.addMethod(
  3576. '_instanceVariableNamesFor_',
  3577. smalltalk.method({
  3578. selector: 'instanceVariableNamesFor:',
  3579. category: 'private',
  3580. fn: function (aString) {
  3581. var self = this;
  3582. return aString._tokenize_(" ")._reject_(function (each) {return each._isEmpty();});
  3583. return self;
  3584. },
  3585. 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%0A')}),
  3586. smalltalk.ClassBuilder);
  3587. smalltalk.addMethod(
  3588. '_addSubclassOf_named_instanceVariableNames_',
  3589. smalltalk.method({
  3590. selector: 'addSubclassOf:named:instanceVariableNames:',
  3591. category: 'private',
  3592. fn: function (aClass, aString, aCollection) {
  3593. var self = this;
  3594. return function () {smalltalk.addClass(aString, aClass, aCollection);return smalltalk[aString];}();
  3595. return self;
  3596. },
  3597. source: unescape('addSubclassOf%3A%20aClass%20named%3A%20aString%20instanceVariableNames%3A%20aCollection%0A%09%5E%7B%27smalltalk.addClass%28aString%2C%20aClass%2C%20aCollection%29%3B%0A%09%20%20%20%20return%20smalltalk%5BaString%5D%27%7D%0A')}),
  3598. smalltalk.ClassBuilder);
  3599. smalltalk.addMethod(
  3600. '_setupClass_',
  3601. smalltalk.method({
  3602. selector: 'setupClass:',
  3603. category: 'private',
  3604. fn: function (aClass) {
  3605. var self = this;
  3606. (function () {smalltalk.init(aClass);}());
  3607. return self;
  3608. },
  3609. source: unescape('setupClass%3A%20aClass%0A%09%7B%27smalltalk.init%28aClass%29%3B%27%7D%0A')}),
  3610. smalltalk.ClassBuilder);
  3611. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category', 'chunkParser'], 'Kernel');
  3612. smalltalk.addMethod(
  3613. '_initialize',
  3614. smalltalk.method({
  3615. selector: 'initialize',
  3616. category: 'initialization',
  3617. fn: function () {
  3618. var self = this;
  3619. self.klass.superclass.fn.prototype._initialize.apply(self, []);
  3620. self['@chunkParser'] = smalltalk.ChunkParser._new();
  3621. return self;
  3622. },
  3623. source: unescape('initialize%0A%09super%20initialize.%0A%09chunkParser%20%3A%3D%20ChunkParser%20new.%0A')}),
  3624. smalltalk.ClassCategoryReader);
  3625. smalltalk.addMethod(
  3626. '_class_category_',
  3627. smalltalk.method({
  3628. selector: 'class:category:',
  3629. category: 'accessing',
  3630. fn: function (aClass, aString) {
  3631. var self = this;
  3632. self['@class'] = aClass;
  3633. self['@category'] = aString;
  3634. return self;
  3635. },
  3636. source: unescape('class%3A%20aClass%20category%3A%20aString%0A%09class%20%3A%3D%20aClass.%0A%09category%20%3A%3D%20aString%0A')}),
  3637. smalltalk.ClassCategoryReader);
  3638. smalltalk.addMethod(
  3639. '_scanFrom_',
  3640. smalltalk.method({
  3641. selector: 'scanFrom:',
  3642. category: 'fileIn',
  3643. fn: function (aStream) {
  3644. var self = this;
  3645. var nextChunk = nil;
  3646. nextChunk = self['@chunkParser']._emptyChunk().__slash(self['@chunkParser']._chunk())._parse_(aStream);
  3647. nextChunk._isEmptyChunk()._ifFalse_(function () {self._compileMethod_(nextChunk._contents());return self._scanFrom_(aStream);});
  3648. return self;
  3649. },
  3650. source: unescape('scanFrom%3A%20aStream%0A%09%7C%20nextChunk%20%7C%0A%09nextChunk%20%3A%3D%20%28chunkParser%20emptyChunk%20/%20chunkParser%20chunk%29%20parse%3A%20aStream.%0A%09nextChunk%20isEmptyChunk%20ifFalse%3A%20%5B%0A%09%20%20%20%20self%20compileMethod%3A%20nextChunk%20contents.%0A%09%20%20%20%20self%20scanFrom%3A%20aStream%5D.%0A')}),
  3651. smalltalk.ClassCategoryReader);
  3652. smalltalk.addMethod(
  3653. '_compileMethod_',
  3654. smalltalk.method({
  3655. selector: 'compileMethod:',
  3656. category: 'private',
  3657. fn: function (aString) {
  3658. var self = this;
  3659. var method = nil;
  3660. method = smalltalk.Compiler._new()._load_forClass_(aString, self['@class']);
  3661. method._category_(self['@category']);
  3662. self['@class']._addCompiledMethod_(method);
  3663. return self;
  3664. },
  3665. source: unescape('compileMethod%3A%20aString%0A%09%7C%20method%20%7C%0A%09method%20%3A%3D%20Compiler%20new%20load%3A%20aString%20forClass%3A%20class.%0A%09method%20category%3A%20category.%0A%09class%20addCompiledMethod%3A%20method%0A')}),
  3666. smalltalk.ClassCategoryReader);
  3667. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel');
  3668. smalltalk.addMethod(
  3669. '_collection',
  3670. smalltalk.method({
  3671. selector: 'collection',
  3672. category: 'accessing',
  3673. fn: function () {
  3674. var self = this;
  3675. return self['@collection'];
  3676. return self;
  3677. },
  3678. source: unescape('collection%0A%09%5Ecollection%0A')}),
  3679. smalltalk.Stream);
  3680. smalltalk.addMethod(
  3681. '_setCollection_',
  3682. smalltalk.method({
  3683. selector: 'setCollection:',
  3684. category: 'accessing',
  3685. fn: function (aCollection) {
  3686. var self = this;
  3687. self['@collection'] = aCollection;
  3688. return self;
  3689. },
  3690. source: unescape('setCollection%3A%20aCollection%0A%09collection%20%3A%3D%20aCollection%0A')}),
  3691. smalltalk.Stream);
  3692. smalltalk.addMethod(
  3693. '_position',
  3694. smalltalk.method({
  3695. selector: 'position',
  3696. category: 'accessing',
  3697. fn: function () {
  3698. var self = this;
  3699. return self['@position']._ifNil_(function () {return self['@position'] = 0;});
  3700. return self;
  3701. },
  3702. source: unescape('position%0A%09%5Eposition%20ifNil%3A%20%5Bposition%20%3A%3D%200%5D%0A')}),
  3703. smalltalk.Stream);
  3704. smalltalk.addMethod(
  3705. '_position_',
  3706. smalltalk.method({
  3707. selector: 'position:',
  3708. category: 'accessing',
  3709. fn: function (anInteger) {
  3710. var self = this;
  3711. self['@position'] = anInteger;
  3712. return self;
  3713. },
  3714. source: unescape('position%3A%20anInteger%0A%09position%20%3A%3D%20anInteger%0A')}),
  3715. smalltalk.Stream);
  3716. smalltalk.addMethod(
  3717. '_streamSize',
  3718. smalltalk.method({
  3719. selector: 'streamSize',
  3720. category: 'accessing',
  3721. fn: function () {
  3722. var self = this;
  3723. return self['@streamSize'];
  3724. return self;
  3725. },
  3726. source: unescape('streamSize%0A%09%5EstreamSize%0A')}),
  3727. smalltalk.Stream);
  3728. smalltalk.addMethod(
  3729. '_setStreamSize_',
  3730. smalltalk.method({
  3731. selector: 'setStreamSize:',
  3732. category: 'accessing',
  3733. fn: function (anInteger) {
  3734. var self = this;
  3735. self['@streamSize'] = anInteger;
  3736. return self;
  3737. },
  3738. source: unescape('setStreamSize%3A%20anInteger%0A%09streamSize%20%3A%3D%20anInteger%0A')}),
  3739. smalltalk.Stream);
  3740. smalltalk.addMethod(
  3741. '_contents',
  3742. smalltalk.method({
  3743. selector: 'contents',
  3744. category: 'accessing',
  3745. fn: function () {
  3746. var self = this;
  3747. return self._collection()._copyFrom_to_(1, self._streamSize());
  3748. return self;
  3749. },
  3750. source: unescape('contents%0A%09%5Eself%20collection%0A%09%20%20%20%20copyFrom%3A%201%20%0A%09%20%20%20%20to%3A%20self%20streamSize%0A')}),
  3751. smalltalk.Stream);
  3752. smalltalk.addMethod(
  3753. '_size',
  3754. smalltalk.method({
  3755. selector: 'size',
  3756. category: 'accessing',
  3757. fn: function () {
  3758. var self = this;
  3759. return self._streamSize();
  3760. return self;
  3761. },
  3762. source: unescape('size%0A%09%5Eself%20streamSize%0A')}),
  3763. smalltalk.Stream);
  3764. smalltalk.addMethod(
  3765. '_reset',
  3766. smalltalk.method({
  3767. selector: 'reset',
  3768. category: 'actions',
  3769. fn: function () {
  3770. var self = this;
  3771. self._position_(0);
  3772. return self;
  3773. },
  3774. source: unescape('reset%0A%09self%20position%3A%200%0A')}),
  3775. smalltalk.Stream);
  3776. smalltalk.addMethod(
  3777. '_close',
  3778. smalltalk.method({
  3779. selector: 'close',
  3780. category: 'actions',
  3781. fn: function () {
  3782. var self = this;
  3783. return self;
  3784. },
  3785. source: unescape('close%0A')}),
  3786. smalltalk.Stream);
  3787. smalltalk.addMethod(
  3788. '_flush',
  3789. smalltalk.method({
  3790. selector: 'flush',
  3791. category: 'actions',
  3792. fn: function () {
  3793. var self = this;
  3794. return self;
  3795. },
  3796. source: unescape('flush%0A')}),
  3797. smalltalk.Stream);
  3798. smalltalk.addMethod(
  3799. '_resetContents',
  3800. smalltalk.method({
  3801. selector: 'resetContents',
  3802. category: 'actions',
  3803. fn: function () {
  3804. var self = this;
  3805. self._reset();
  3806. self._setStreamSize_(0);
  3807. return self;
  3808. },
  3809. source: unescape('resetContents%0A%09self%20reset.%0A%09self%20setStreamSize%3A%200%0A')}),
  3810. smalltalk.Stream);
  3811. smalltalk.addMethod(
  3812. '_do_',
  3813. smalltalk.method({
  3814. selector: 'do:',
  3815. category: 'enumerating',
  3816. fn: function (aBlock) {
  3817. var self = this;
  3818. (function () {return self._atEnd();}._whileFalse_(function () {return aBlock._value_(self._next());}));
  3819. return self;
  3820. },
  3821. source: unescape('do%3A%20aBlock%0A%09%5Bself%20atEnd%5D%20whileFalse%3A%20%5BaBlock%20value%3A%20self%20next%5D%0A')}),
  3822. smalltalk.Stream);
  3823. smalltalk.addMethod(
  3824. '_setToEnd',
  3825. smalltalk.method({
  3826. selector: 'setToEnd',
  3827. category: 'positioning',
  3828. fn: function () {
  3829. var self = this;
  3830. self._position_(self._size());
  3831. return self;
  3832. },
  3833. source: unescape('setToEnd%0A%09self%20position%3A%20self%20size%0A')}),
  3834. smalltalk.Stream);
  3835. smalltalk.addMethod(
  3836. '_skip_',
  3837. smalltalk.method({
  3838. selector: 'skip:',
  3839. category: 'positioning',
  3840. fn: function (anInteger) {
  3841. var self = this;
  3842. self._position_(self._position().__plus(anInteger)._min_max_(self._size(), 0));
  3843. return self;
  3844. },
  3845. source: unescape('skip%3A%20anInteger%0A%09self%20position%3A%20%28%28self%20position%20+%20anInteger%29%20min%3A%20self%20size%20max%3A%200%29%0A')}),
  3846. smalltalk.Stream);
  3847. smalltalk.addMethod(
  3848. '_next',
  3849. smalltalk.method({
  3850. selector: 'next',
  3851. category: 'reading',
  3852. fn: function () {
  3853. var self = this;
  3854. self._position_(self._position().__plus(1));
  3855. return self['@collection']._at_(self._position());
  3856. return self;
  3857. },
  3858. source: unescape('next%0A%09self%20position%3A%20self%20position%20+%201.%20%0A%09%5Ecollection%20at%3A%20self%20position%0A')}),
  3859. smalltalk.Stream);
  3860. smalltalk.addMethod(
  3861. '_next_',
  3862. smalltalk.method({
  3863. selector: 'next:',
  3864. category: 'reading',
  3865. fn: function (anInteger) {
  3866. var self = this;
  3867. var tempCollection = nil;
  3868. tempCollection = self._collection()._class()._new();
  3869. anInteger._timesRepeat_(function () {return self._atEnd()._ifFalse_(function () {return tempCollection._add_(self._next());});});
  3870. return tempCollection;
  3871. return self;
  3872. },
  3873. source: unescape('next%3A%20anInteger%0A%09%7C%20tempCollection%20%7C%0A%09tempCollection%20%3A%3D%20self%20collection%20class%20new.%0A%09anInteger%20timesRepeat%3A%20%5B%0A%09%20%20%20%20self%20atEnd%20ifFalse%3A%20%5B%0A%09%09tempCollection%20add%3A%20self%20next%5D%5D.%0A%09%5EtempCollection%0A')}),
  3874. smalltalk.Stream);
  3875. smalltalk.addMethod(
  3876. '_nextPut_',
  3877. smalltalk.method({
  3878. selector: 'nextPut:',
  3879. category: 'writing',
  3880. fn: function (anObject) {
  3881. var self = this;
  3882. self._position_(self._position().__plus(1));
  3883. self._collection()._at_put_(self._position(), anObject);
  3884. self._setStreamSize_(self._streamSize()._max_(self._position()));
  3885. return self;
  3886. },
  3887. source: unescape('nextPut%3A%20anObject%0A%09self%20position%3A%20self%20position%20+%201.%0A%09self%20collection%20at%3A%20self%20position%20put%3A%20anObject.%0A%09self%20setStreamSize%3A%20%28self%20streamSize%20max%3A%20self%20position%29%0A')}),
  3888. smalltalk.Stream);
  3889. smalltalk.addMethod(
  3890. '_nextPutAll_',
  3891. smalltalk.method({
  3892. selector: 'nextPutAll:',
  3893. category: 'writing',
  3894. fn: function (aCollection) {
  3895. var self = this;
  3896. aCollection._do_(function (each) {return self._nextPut_(each);});
  3897. return self;
  3898. },
  3899. source: unescape('nextPutAll%3A%20aCollection%0A%09aCollection%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20self%20nextPut%3A%20each%5D%0A')}),
  3900. smalltalk.Stream);
  3901. smalltalk.addMethod(
  3902. '_peek',
  3903. smalltalk.method({
  3904. selector: 'peek',
  3905. category: 'reading',
  3906. fn: function () {
  3907. var self = this;
  3908. return self._atEnd()._ifFalse_(function () {return self._collection()._at_(self._position().__plus(1));});
  3909. return self;
  3910. },
  3911. source: unescape('peek%0A%09%5Eself%20atEnd%20ifFalse%3A%20%5B%0A%09%20%20%20%20self%20collection%20at%3A%20self%20position%20+%201%5D%0A')}),
  3912. smalltalk.Stream);
  3913. smalltalk.addMethod(
  3914. '_atEnd',
  3915. smalltalk.method({
  3916. selector: 'atEnd',
  3917. category: 'testing',
  3918. fn: function () {
  3919. var self = this;
  3920. return self._position().__eq(self._size());
  3921. return self;
  3922. },
  3923. source: unescape('atEnd%0A%09%5Eself%20position%20%3D%20self%20size%0A')}),
  3924. smalltalk.Stream);
  3925. smalltalk.addMethod(
  3926. '_atStart',
  3927. smalltalk.method({
  3928. selector: 'atStart',
  3929. category: 'testing',
  3930. fn: function () {
  3931. var self = this;
  3932. return self._position().__eq(0);
  3933. return self;
  3934. },
  3935. source: unescape('atStart%0A%09%5Eself%20position%20%3D%200%0A')}),
  3936. smalltalk.Stream);
  3937. smalltalk.addMethod(
  3938. '_isEmpty',
  3939. smalltalk.method({
  3940. selector: 'isEmpty',
  3941. category: 'testing',
  3942. fn: function () {
  3943. var self = this;
  3944. return self._size().__eq(0);
  3945. return self;
  3946. },
  3947. source: unescape('isEmpty%0A%09%5Eself%20size%20%3D%200%0A')}),
  3948. smalltalk.Stream);
  3949. smalltalk.addMethod(
  3950. '_on_',
  3951. smalltalk.method({
  3952. selector: 'on:',
  3953. category: 'instance creation',
  3954. fn: function (aCollection) {
  3955. var self = this;
  3956. return function ($rec) {$rec._setCollection_(aCollection);$rec._setStreamSize_(aCollection._size());return $rec._yourself();}(self._new());
  3957. return self;
  3958. },
  3959. source: unescape('on%3A%20aCollection%0A%09%20%20%20%20%5Eself%20new%20%0A%09%09setCollection%3A%20aCollection%3B%0A%09%09setStreamSize%3A%20aCollection%20size%3B%0A%09%09yourself%0A')}),
  3960. smalltalk.Stream.klass);
  3961. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel');
  3962. smalltalk.addMethod(
  3963. '_next_',
  3964. smalltalk.method({
  3965. selector: 'next:',
  3966. category: 'reading',
  3967. fn: function (anInteger) {
  3968. var self = this;
  3969. var tempCollection = nil;
  3970. tempCollection = self._collection()._class()._new();
  3971. anInteger._timesRepeat_(function () {return self._atEnd()._ifFalse_(function () {return tempCollection = tempCollection.__comma(self._next());});});
  3972. return tempCollection;
  3973. return self;
  3974. },
  3975. source: unescape('next%3A%20anInteger%0A%09%7C%20tempCollection%20%7C%0A%09tempCollection%20%3A%3D%20self%20collection%20class%20new.%0A%09anInteger%20timesRepeat%3A%20%5B%0A%09%20%20%20%20self%20atEnd%20ifFalse%3A%20%5B%0A%09%09tempCollection%20%3A%3D%20tempCollection%2C%20self%20next%5D%5D.%0A%09%5EtempCollection%0A')}),
  3976. smalltalk.StringStream);
  3977. smalltalk.addMethod(
  3978. '_nextPut_',
  3979. smalltalk.method({
  3980. selector: 'nextPut:',
  3981. category: 'writing',
  3982. fn: function (aString) {
  3983. var self = this;
  3984. self._nextPutAll_(aString);
  3985. return self;
  3986. },
  3987. source: unescape('nextPut%3A%20aString%0A%09self%20nextPutAll%3A%20aString%0A')}),
  3988. smalltalk.StringStream);
  3989. smalltalk.addMethod(
  3990. '_nextPutAll_',
  3991. smalltalk.method({
  3992. selector: 'nextPutAll:',
  3993. category: 'writing',
  3994. fn: function (aString) {
  3995. var self = this;
  3996. self._setCollection_(self._collection()._copyFrom_to_(1, self._position()).__comma(aString).__comma(self._collection()._copyFrom_to_(self._position().__plus(1).__plus(aString._size()), self._collection()._size())));
  3997. self._position_(self._position().__plus(aString._size()));
  3998. self._setStreamSize_(self._streamSize()._max_(self._position()));
  3999. return self;
  4000. },
  4001. source: unescape('nextPutAll%3A%20aString%0A%09self%20setCollection%3A%20%0A%09%20%20%20%20%28self%20collection%20copyFrom%3A%201%20to%3A%20self%20position%29%2C%0A%09%20%20%20%20aString%2C%0A%09%20%20%20%20%28self%20collection%20copyFrom%3A%20%28self%20position%20+%201%20+%20aString%20size%29%20to%3A%20self%20collection%20size%29.%0A%09self%20position%3A%20self%20position%20+%20aString%20size.%0A%09self%20setStreamSize%3A%20%28self%20streamSize%20max%3A%20self%20position%29%0A')}),
  4002. smalltalk.StringStream);
  4003. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class', 'chunkParser'], 'Kernel');
  4004. smalltalk.addMethod(
  4005. '_class_',
  4006. smalltalk.method({
  4007. selector: 'class:',
  4008. category: 'accessing',
  4009. fn: function (aClass) {
  4010. var self = this;
  4011. self['@class'] = aClass;
  4012. return self;
  4013. },
  4014. source: unescape('class%3A%20aClass%0A%09class%20%3A%3D%20aClass%0A')}),
  4015. smalltalk.ClassCommentReader);
  4016. smalltalk.addMethod(
  4017. '_scanFrom_',
  4018. smalltalk.method({
  4019. selector: 'scanFrom:',
  4020. category: 'fileIn',
  4021. fn: function (aStream) {
  4022. var self = this;
  4023. var nextChunk = nil;
  4024. nextChunk = self['@chunkParser']._emptyChunk().__slash(self['@chunkParser']._chunk())._parse_(aStream);
  4025. nextChunk._isEmptyChunk()._ifFalse_(function () {return self._setComment_(nextChunk._contents());});
  4026. return self;
  4027. },
  4028. source: unescape('scanFrom%3A%20aStream%0A%09%7C%20nextChunk%20%7C%0A%09nextChunk%20%3A%3D%20%28chunkParser%20emptyChunk%20/%20chunkParser%20chunk%29%20parse%3A%20aStream.%0A%09nextChunk%20isEmptyChunk%20ifFalse%3A%20%5B%0A%09%20%20%20%20self%20setComment%3A%20nextChunk%20contents%5D.%0A')}),
  4029. smalltalk.ClassCommentReader);
  4030. smalltalk.addMethod(
  4031. '_initialize',
  4032. smalltalk.method({
  4033. selector: 'initialize',
  4034. category: 'initialization',
  4035. fn: function () {
  4036. var self = this;
  4037. self.klass.superclass.fn.prototype._initialize.apply(self, []);
  4038. self['@chunkParser'] = smalltalk.ChunkParser._new();
  4039. return self;
  4040. },
  4041. source: unescape('initialize%0A%09super%20initialize.%0A%09chunkParser%20%3A%3D%20ChunkParser%20new.%0A')}),
  4042. smalltalk.ClassCommentReader);
  4043. smalltalk.addMethod(
  4044. '_setComment_',
  4045. smalltalk.method({
  4046. selector: 'setComment:',
  4047. category: 'private',
  4048. fn: function (aString) {
  4049. var self = this;
  4050. self['@class']._comment_(aString);
  4051. return self;
  4052. },
  4053. source: unescape('setComment%3A%20aString%0A%20%20%20%20class%20comment%3A%20aString%0A')}),
  4054. smalltalk.ClassCommentReader);
  4055. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel');
  4056. smalltalk.addMethod(
  4057. '_next',
  4058. smalltalk.method({
  4059. selector: 'next',
  4060. category: 'accessing',
  4061. fn: function () {
  4062. var self = this;
  4063. return function () {return Math.random();}();
  4064. return self;
  4065. },
  4066. source: unescape('next%0A%20%20%20%20%5E%7B%27return%20Math.random%28%29%27%7D%0A')}),
  4067. smalltalk.Random);
  4068. smalltalk.addMethod(
  4069. '_next_',
  4070. smalltalk.method({
  4071. selector: 'next:',
  4072. category: 'accessing',
  4073. fn: function (anInteger) {
  4074. var self = this;
  4075. return (1)._to_collect_(anInteger, function (each) {return self._next();});
  4076. return self;
  4077. },
  4078. source: unescape('next%3A%20anInteger%0A%20%20%20%20%5E1%20to%3A%20anInteger%20collect%3A%20%5B%3Aeach%20%7C%20self%20next%5D%0A')}),
  4079. smalltalk.Random);
  4080. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel');
  4081. smalltalk.addMethod(
  4082. '_x',
  4083. smalltalk.method({
  4084. selector: 'x',
  4085. category: 'accessing',
  4086. fn: function () {
  4087. var self = this;
  4088. return self['@x'];
  4089. return self;
  4090. },
  4091. source: unescape('x%0A%09%5Ex')}),
  4092. smalltalk.Point);
  4093. smalltalk.addMethod(
  4094. '_y',
  4095. smalltalk.method({
  4096. selector: 'y',
  4097. category: 'accessing',
  4098. fn: function () {
  4099. var self = this;
  4100. return self['@y'];
  4101. return self;
  4102. },
  4103. source: unescape('y%0A%09%5Ey')}),
  4104. smalltalk.Point);
  4105. smalltalk.addMethod(
  4106. '_y_',
  4107. smalltalk.method({
  4108. selector: 'y:',
  4109. category: 'accessing',
  4110. fn: function (aNumber) {
  4111. var self = this;
  4112. self['@y'] = aNumber;
  4113. return self;
  4114. },
  4115. source: unescape('y%3A%20aNumber%0A%09y%20%3A%3D%20aNumber')}),
  4116. smalltalk.Point);
  4117. smalltalk.addMethod(
  4118. '_x_',
  4119. smalltalk.method({
  4120. selector: 'x:',
  4121. category: 'accessing',
  4122. fn: function (aNumber) {
  4123. var self = this;
  4124. self['@x'] = aNumber;
  4125. return self;
  4126. },
  4127. source: unescape('x%3A%20aNumber%0A%09x%20%3A%3D%20aNumber')}),
  4128. smalltalk.Point);
  4129. smalltalk.addMethod(
  4130. '__star',
  4131. smalltalk.method({
  4132. selector: '*',
  4133. category: 'arithmetic',
  4134. fn: function (aPoint) {
  4135. var self = this;
  4136. return smalltalk.Point._x_y_(self._x().__star(aPoint._asPoint()._x()), self._y().__star(aPoint._asPoint()._y()));
  4137. return self;
  4138. },
  4139. source: unescape('*%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20*%20aPoint%20asPoint%20x%20y%3A%20self%20y%20*%20aPoint%20asPoint%20y')}),
  4140. smalltalk.Point);
  4141. smalltalk.addMethod(
  4142. '__plus',
  4143. smalltalk.method({
  4144. selector: '+',
  4145. category: 'arithmetic',
  4146. fn: function (aPoint) {
  4147. var self = this;
  4148. return smalltalk.Point._x_y_(self._x().__plus(aPoint._asPoint()._x()), self._y().__plus(aPoint._asPoint()._y()));
  4149. return self;
  4150. },
  4151. source: unescape('+%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20+%20aPoint%20asPoint%20x%20y%3A%20self%20y%20+%20aPoint%20asPoint%20y')}),
  4152. smalltalk.Point);
  4153. smalltalk.addMethod(
  4154. '__minus',
  4155. smalltalk.method({
  4156. selector: '-',
  4157. category: 'arithmetic',
  4158. fn: function (aPoint) {
  4159. var self = this;
  4160. return smalltalk.Point._x_y_(self._x().__minus(aPoint._asPoint()._x()), self._y().__minus(aPoint._asPoint()._y()));
  4161. return self;
  4162. },
  4163. source: unescape('-%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20-%20aPoint%20asPoint%20x%20y%3A%20self%20y%20-%20aPoint%20asPoint%20y')}),
  4164. smalltalk.Point);
  4165. smalltalk.addMethod(
  4166. '__slash',
  4167. smalltalk.method({
  4168. selector: '/',
  4169. category: 'arithmetic',
  4170. fn: function (aPoint) {
  4171. var self = this;
  4172. return smalltalk.Point._x_y_(self._x().__slash(aPoint._asPoint()._x()), self._y().__slash(aPoint._asPoint()._y()));
  4173. return self;
  4174. },
  4175. source: unescape('/%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20/%20aPoint%20asPoint%20x%20y%3A%20self%20y%20/%20aPoint%20asPoint%20y')}),
  4176. smalltalk.Point);
  4177. smalltalk.addMethod(
  4178. '_asPoint',
  4179. smalltalk.method({
  4180. selector: 'asPoint',
  4181. category: 'converting',
  4182. fn: function () {
  4183. var self = this;
  4184. return self;
  4185. return self;
  4186. },
  4187. source: unescape('asPoint%0A%09%5Eself')}),
  4188. smalltalk.Point);
  4189. smalltalk.addMethod(
  4190. '_x_y_',
  4191. smalltalk.method({
  4192. selector: 'x:y:',
  4193. category: 'instance creation',
  4194. fn: function (aNumber, anotherNumber) {
  4195. var self = this;
  4196. return function ($rec) {$rec._x_(aNumber);$rec._y_(anotherNumber);return $rec._yourself();}(self._new());
  4197. return self;
  4198. },
  4199. source: unescape('x%3A%20aNumber%20y%3A%20anotherNumber%0A%09%5Eself%20new%0A%09%09x%3A%20aNumber%3B%0A%09%09y%3A%20anotherNumber%3B%0A%09%09yourself')}),
  4200. smalltalk.Point.klass);
  4201. smalltalk.addClass('PPParser', smalltalk.Object, ['memo'], 'Parser');
  4202. smalltalk.addMethod(
  4203. '_initialize',
  4204. smalltalk.method({
  4205. selector: 'initialize',
  4206. category: 'initialization',
  4207. fn: function (){
  4208. var self=this;
  4209. self['@memo']=smalltalk.Dictionary._new();
  4210. return self;},
  4211. source: unescape('initialize%0A%09memo%20%3A%3D%20Dictionary%20new%0A')}),
  4212. smalltalk.PPParser);
  4213. smalltalk.addMethod(
  4214. '_memo',
  4215. smalltalk.method({
  4216. selector: 'memo',
  4217. category: 'accessing',
  4218. fn: function (){
  4219. var self=this;
  4220. return self['@memo'];
  4221. return self;},
  4222. source: unescape('memo%0A%09%5Ememo%0A')}),
  4223. smalltalk.PPParser);
  4224. smalltalk.addMethod(
  4225. '_onFailure_',
  4226. smalltalk.method({
  4227. selector: 'onFailure:',
  4228. category: 'error handling',
  4229. fn: function (aBlock){
  4230. var self=this;
  4231. return smalltalk.PPFailureActionParser._on_block_(self,aBlock);
  4232. return self;},
  4233. source: unescape('onFailure%3A%20aBlock%0A%09%5EPPFailureActionParser%20on%3A%20self%20block%3A%20aBlock%0A')}),
  4234. smalltalk.PPParser);
  4235. smalltalk.addMethod(
  4236. '_flatten',
  4237. smalltalk.method({
  4238. selector: 'flatten',
  4239. category: 'operations',
  4240. fn: function (){
  4241. var self=this;
  4242. return smalltalk.PPFlattenParser._on_(self);
  4243. return self;},
  4244. source: unescape('flatten%0A%09%5EPPFlattenParser%20on%3A%20self%0A')}),
  4245. smalltalk.PPParser);
  4246. smalltalk.addMethod(
  4247. '_withSource',
  4248. smalltalk.method({
  4249. selector: 'withSource',
  4250. category: 'operations',
  4251. fn: function (){
  4252. var self=this;
  4253. return smalltalk.PPSourceParser._on_(self);
  4254. return self;},
  4255. source: unescape('withSource%0A%09%5EPPSourceParser%20on%3A%20self%0A')}),
  4256. smalltalk.PPParser);
  4257. smalltalk.addMethod(
  4258. '__eq_eq_gt',
  4259. smalltalk.method({
  4260. selector: '==>',
  4261. category: 'operations',
  4262. fn: function (aBlock){
  4263. var self=this;
  4264. return smalltalk.PPActionParser._on_block_(self,aBlock);
  4265. return self;},
  4266. source: unescape('%3D%3D%3E%20aBlock%0A%09%5EPPActionParser%20on%3A%20self%20block%3A%20aBlock%0A')}),
  4267. smalltalk.PPParser);
  4268. smalltalk.addMethod(
  4269. '__comma',
  4270. smalltalk.method({
  4271. selector: ',',
  4272. category: 'operations',
  4273. fn: function (aParser){
  4274. var self=this;
  4275. return smalltalk.PPSequenceParser._with_with_(self,aParser);
  4276. return self;},
  4277. source: unescape('%2C%20aParser%0A%09%5EPPSequenceParser%20with%3A%20self%20with%3A%20aParser%0A')}),
  4278. smalltalk.PPParser);
  4279. smalltalk.addMethod(
  4280. '__slash',
  4281. smalltalk.method({
  4282. selector: '/',
  4283. category: 'operations',
  4284. fn: function (aParser){
  4285. var self=this;
  4286. return smalltalk.PPChoiceParser._with_with_(self,aParser);
  4287. return self;},
  4288. source: unescape('/%20aParser%0A%09%5EPPChoiceParser%20with%3A%20self%20with%3A%20aParser%0A')}),
  4289. smalltalk.PPParser);
  4290. smalltalk.addMethod(
  4291. '_plus',
  4292. smalltalk.method({
  4293. selector: 'plus',
  4294. category: 'operations',
  4295. fn: function (){
  4296. var self=this;
  4297. return smalltalk.PPRepeatingParser._on_min_(self,(1));
  4298. return self;},
  4299. source: unescape('plus%0A%09%5EPPRepeatingParser%20on%3A%20self%20min%3A%201%0A')}),
  4300. smalltalk.PPParser);
  4301. smalltalk.addMethod(
  4302. '_star',
  4303. smalltalk.method({
  4304. selector: 'star',
  4305. category: 'operations',
  4306. fn: function (){
  4307. var self=this;
  4308. return smalltalk.PPRepeatingParser._on_min_(self,(0));
  4309. return self;},
  4310. source: unescape('star%0A%09%5EPPRepeatingParser%20on%3A%20self%20min%3A%200%0A')}),
  4311. smalltalk.PPParser);
  4312. smalltalk.addMethod(
  4313. '_not',
  4314. smalltalk.method({
  4315. selector: 'not',
  4316. category: 'operations',
  4317. fn: function (){
  4318. var self=this;
  4319. return smalltalk.PPNotParser._on_(self);
  4320. return self;},
  4321. source: unescape('not%0A%09%5EPPNotParser%20on%3A%20self%0A')}),
  4322. smalltalk.PPParser);
  4323. smalltalk.addMethod(
  4324. '_optional',
  4325. smalltalk.method({
  4326. selector: 'optional',
  4327. category: 'operations',
  4328. fn: function (){
  4329. var self=this;
  4330. return self.__slash(smalltalk.PPEpsilonParser._new());
  4331. return self;},
  4332. source: unescape('optional%0A%09%5Eself%20/%20PPEpsilonParser%20new%0A')}),
  4333. smalltalk.PPParser);
  4334. smalltalk.addMethod(
  4335. '_memoizedParse_',
  4336. smalltalk.method({
  4337. selector: 'memoizedParse:',
  4338. category: 'operations',
  4339. fn: function (aStream){
  4340. var self=this;
  4341. var start=nil;
  4342. var end=nil;
  4343. var node=nil;
  4344. start=aStream._position();
  4345. return self._memo()._at_ifPresent_ifAbsent_(start,(function(value){aStream._position_(self._memo()._at_(start)._second());return value._first();}),(function(){node=self._parse_(aStream);end=aStream._position();self._memo()._at_put_(start,smalltalk.Array._with_with_(node,end));return node;}));
  4346. return self;},
  4347. source: unescape('memoizedParse%3A%20aStream%0A%09%7C%20start%20end%20node%20%7C%0A%09start%20%3A%3D%20aStream%20position.%0A%09%5Eself%20memo%20at%3A%20start%20%0A%09%20%20%20%20ifPresent%3A%20%5B%3Avalue%20%7C%0A%09%09aStream%20position%3A%20%28self%20memo%20at%3A%20start%29%20second.%0A%09%09value%20first%5D%0A%09%20%20%20%20ifAbsent%3A%20%5B%0A%09%09node%20%3A%3D%20self%20parse%3A%20aStream.%0A%09%09end%20%3A%3D%20aStream%20position.%0A%09%09self%20memo%20at%3A%20start%20put%3A%20%28Array%20with%3A%20node%20with%3A%20end%29.%0A%09%09node%5D%0A')}),
  4348. smalltalk.PPParser);
  4349. smalltalk.addMethod(
  4350. '_parse_',
  4351. smalltalk.method({
  4352. selector: 'parse:',
  4353. category: 'parsing',
  4354. fn: function (aStream){
  4355. var self=this;
  4356. self._subclassResponsibility();
  4357. return self;},
  4358. source: unescape('parse%3A%20aStream%0A%09self%20subclassResponsibility%0A')}),
  4359. smalltalk.PPParser);
  4360. smalltalk.addMethod(
  4361. '_parseAll_',
  4362. smalltalk.method({
  4363. selector: 'parseAll:',
  4364. category: 'parsing',
  4365. fn: function (aStream){
  4366. var self=this;
  4367. var result=nil;
  4368. result=smalltalk.PPSequenceParser._with_with_(self,smalltalk.PPEOFParser._new())._memoizedParse_(aStream);
  4369. return result._isParseFailure()._ifTrue_ifFalse_((function(){return self._error_(result._messageFor_(aStream._contents()));}),(function(){return result._first();}));
  4370. return self;},
  4371. source: unescape('parseAll%3A%20aStream%0A%09%7C%20result%20%7C%0A%09result%20%3A%3D%20%28PPSequenceParser%20with%3A%20self%20with%3A%20PPEOFParser%20new%29%20memoizedParse%3A%20aStream.%0A%09%5Eresult%20isParseFailure%20%0A%09%20%20%20%20ifTrue%3A%20%5Bself%20error%3A%20%28result%20messageFor%3A%20aStream%20contents%29%5D%0A%09%20%20%20%20ifFalse%3A%20%5Bresult%20first%5D%0A')}),
  4372. smalltalk.PPParser);
  4373. smalltalk.addClass('PPEOFParser', smalltalk.PPParser, [], 'Parser');
  4374. smalltalk.addMethod(
  4375. '_parse_',
  4376. smalltalk.method({
  4377. selector: 'parse:',
  4378. category: 'parsing',
  4379. fn: function (aStream){
  4380. var self=this;
  4381. return aStream._atEnd()._ifFalse_ifTrue_((function(){return smalltalk.PPFailure._new()._reason_at_("EOF expected",aStream._position());}),(function(){return nil;}));
  4382. return self;},
  4383. source: unescape('parse%3A%20aStream%0A%09%5EaStream%20atEnd%20%0A%09%20%20%20%20ifFalse%3A%20%5B%0A%09%09PPFailure%20new%20reason%3A%20%27EOF%20expected%27%20at%3A%20aStream%20position%5D%0A%09%20%20%20%20ifTrue%3A%20%5Bnil%5D%0A')}),
  4384. smalltalk.PPEOFParser);
  4385. smalltalk.addClass('PPAnyParser', smalltalk.PPParser, [], 'Parser');
  4386. smalltalk.addMethod(
  4387. '_parse_',
  4388. smalltalk.method({
  4389. selector: 'parse:',
  4390. category: 'parsing',
  4391. fn: function (aStream){
  4392. var self=this;
  4393. return aStream._atEnd()._ifTrue_ifFalse_((function(){return smalltalk.PPFailure._new()._reason_at_("did not expect EOF",aStream._position());}),(function(){return aStream._next();}));
  4394. return self;},
  4395. source: unescape('parse%3A%20aStream%0A%09%5EaStream%20atEnd%0A%09%20%20%20%20ifTrue%3A%20%5BPPFailure%20new%0A%09%09%09%20reason%3A%20%27did%20not%20expect%20EOF%27%20at%3A%20aStream%20position%5D%0A%09%20%20%20%20ifFalse%3A%20%5BaStream%20next%5D%0A')}),
  4396. smalltalk.PPAnyParser);
  4397. smalltalk.addClass('PPEpsilonParser', smalltalk.PPParser, [], 'Parser');
  4398. smalltalk.addMethod(
  4399. '_parse_',
  4400. smalltalk.method({
  4401. selector: 'parse:',
  4402. category: 'parsing',
  4403. fn: function (aStream){
  4404. var self=this;
  4405. return nil;
  4406. return self;},
  4407. source: unescape('parse%3A%20aStream%0A%09%5Enil%0A')}),
  4408. smalltalk.PPEpsilonParser);
  4409. smalltalk.addClass('PPStringParser', smalltalk.PPParser, ['string'], 'Parser');
  4410. smalltalk.addMethod(
  4411. '_string',
  4412. smalltalk.method({
  4413. selector: 'string',
  4414. category: 'accessing',
  4415. fn: function (){
  4416. var self=this;
  4417. return self['@string'];
  4418. return self;},
  4419. source: unescape('string%0A%09%5Estring%0A')}),
  4420. smalltalk.PPStringParser);
  4421. smalltalk.addMethod(
  4422. '_string_',
  4423. smalltalk.method({
  4424. selector: 'string:',
  4425. category: 'accessing',
  4426. fn: function (aString){
  4427. var self=this;
  4428. self['@string']=aString;
  4429. return self;},
  4430. source: unescape('string%3A%20aString%0A%09string%20%3A%3D%20aString%0A')}),
  4431. smalltalk.PPStringParser);
  4432. smalltalk.addMethod(
  4433. '_parse_',
  4434. smalltalk.method({
  4435. selector: 'parse:',
  4436. category: 'parsing',
  4437. fn: function (aStream){
  4438. var self=this;
  4439. var position=nil;
  4440. var result=nil;
  4441. position=aStream._position();
  4442. result=aStream._next_(self._string()._size());
  4443. return result.__eq(self._string())._ifTrue_ifFalse_((function(){return result;}),(function(){aStream._position_(position);return (function($rec){$rec._reason_("Expected ".__comma(self._string()).__comma(" but got ").__comma(result._at_(position)._printString()));return $rec._yourself();})(smalltalk.PPFailure._new());}));
  4444. return self;},
  4445. source: unescape('parse%3A%20aStream%0A%09%7C%20position%20result%20%7C%0A%09position%20%3A%3D%20aStream%20position.%0A%09result%20%3A%3D%20aStream%20next%3A%20self%20string%20size.%0A%09%5Eresult%20%3D%20self%20string%0A%09%20%20%20%20ifTrue%3A%20%5Bresult%5D%0A%09%20%20%20%20ifFalse%3A%20%5B%0A%09%09aStream%20position%3A%20position.%0A%09%09PPFailure%20new%20reason%3A%20%27Expected%20%27%2C%20self%20string%2C%20%27%20but%20got%20%27%2C%20%28result%20at%3A%20position%29%20printString%3B%20yourself%5D%0A')}),
  4446. smalltalk.PPStringParser);
  4447. smalltalk.addClass('PPCharacterParser', smalltalk.PPParser, ['regexp'], 'Parser');
  4448. smalltalk.addMethod(
  4449. '_string_',
  4450. smalltalk.method({
  4451. selector: 'string:',
  4452. category: 'accessing',
  4453. fn: function (aString){
  4454. var self=this;
  4455. self['@regexp']=smalltalk.RegularExpression._fromString_(unescape("%5B").__comma(aString).__comma(unescape("%5D")));
  4456. return self;},
  4457. source: unescape('string%3A%20aString%0A%09regexp%20%3A%3D%20RegularExpression%20fromString%3A%20%27%5B%27%2C%20aString%2C%20%27%5D%27%0A')}),
  4458. smalltalk.PPCharacterParser);
  4459. smalltalk.addMethod(
  4460. '_parse_',
  4461. smalltalk.method({
  4462. selector: 'parse:',
  4463. category: 'parsing',
  4464. fn: function (aStream){
  4465. var self=this;
  4466. return aStream._peek()._notNil()._and_((function(){return self._match_(aStream._peek());}))._ifTrue_ifFalse_((function(){return aStream._next();}),(function(){return smalltalk.PPFailure._new()._reason_at_("Could not match",aStream._position());}));
  4467. return self;},
  4468. source: unescape('parse%3A%20aStream%0A%09%5E%28aStream%20peek%20notNil%20and%3A%20%5Bself%20match%3A%20aStream%20peek%5D%29%0A%09%20%20%20%20ifTrue%3A%20%5BaStream%20next%5D%0A%09%20%20%20%20ifFalse%3A%20%5BPPFailure%20new%20reason%3A%20%27Could%20not%20match%27%20at%3A%20aStream%20position%5D%0A')}),
  4469. smalltalk.PPCharacterParser);
  4470. smalltalk.addMethod(
  4471. '_match_',
  4472. smalltalk.method({
  4473. selector: 'match:',
  4474. category: 'private',
  4475. fn: function (aString){
  4476. var self=this;
  4477. return aString._match_(self['@regexp']);
  4478. return self;},
  4479. source: unescape('match%3A%20aString%0A%09%5EaString%20match%3A%20regexp%0A')}),
  4480. smalltalk.PPCharacterParser);
  4481. smalltalk.addClass('PPListParser', smalltalk.PPParser, ['parsers'], 'Parser');
  4482. smalltalk.addMethod(
  4483. '_parsers',
  4484. smalltalk.method({
  4485. selector: 'parsers',
  4486. category: 'accessing',
  4487. fn: function (){
  4488. var self=this;
  4489. return self['@parsers']._ifNil_((function(){return [];}));
  4490. return self;},
  4491. source: unescape('parsers%0A%09%5Eparsers%20ifNil%3A%20%5B%23%28%29%5D%0A')}),
  4492. smalltalk.PPListParser);
  4493. smalltalk.addMethod(
  4494. '_parsers_',
  4495. smalltalk.method({
  4496. selector: 'parsers:',
  4497. category: 'accessing',
  4498. fn: function (aCollection){
  4499. var self=this;
  4500. self['@parsers']=aCollection;
  4501. return self;},
  4502. source: unescape('parsers%3A%20aCollection%0A%09parsers%20%3A%3D%20aCollection%0A')}),
  4503. smalltalk.PPListParser);
  4504. smalltalk.addMethod(
  4505. '_copyWith_',
  4506. smalltalk.method({
  4507. selector: 'copyWith:',
  4508. category: 'copying',
  4509. fn: function (aParser){
  4510. var self=this;
  4511. return self._class()._withAll_(self._parsers()._copyWith_(aParser));
  4512. return self;},
  4513. source: unescape('copyWith%3A%20aParser%0A%09%5Eself%20class%20withAll%3A%20%28self%20parsers%20copyWith%3A%20aParser%29%0A')}),
  4514. smalltalk.PPListParser);
  4515. smalltalk.addMethod(
  4516. '_withAll_',
  4517. smalltalk.method({
  4518. selector: 'withAll:',
  4519. category: 'instance creation',
  4520. fn: function (aCollection){
  4521. var self=this;
  4522. return (function($rec){$rec._parsers_(aCollection);return $rec._yourself();})(self._new());
  4523. return self;},
  4524. source: unescape('withAll%3A%20aCollection%0A%09%20%20%20%20%5Eself%20new%0A%09%09parsers%3A%20aCollection%3B%0A%09%09yourself%0A')}),
  4525. smalltalk.PPListParser.klass);
  4526. smalltalk.addMethod(
  4527. '_with_with_',
  4528. smalltalk.method({
  4529. selector: 'with:with:',
  4530. category: 'instance creation',
  4531. fn: function (aParser, anotherParser){
  4532. var self=this;
  4533. return self._withAll_(smalltalk.Array._with_with_(aParser,anotherParser));
  4534. return self;},
  4535. source: unescape('with%3A%20aParser%20with%3A%20anotherParser%0A%09%20%20%20%20%5Eself%20withAll%3A%20%28Array%20with%3A%20aParser%20with%3A%20anotherParser%29%0A')}),
  4536. smalltalk.PPListParser.klass);
  4537. smalltalk.addClass('PPSequenceParser', smalltalk.PPListParser, [], 'Parser');
  4538. smalltalk.addMethod(
  4539. '__comma',
  4540. smalltalk.method({
  4541. selector: ',',
  4542. category: 'copying',
  4543. fn: function (aRule){
  4544. var self=this;
  4545. return self._copyWith_(aRule);
  4546. return self;},
  4547. source: unescape('%2C%20aRule%0A%09%5Eself%20copyWith%3A%20aRule%0A')}),
  4548. smalltalk.PPSequenceParser);
  4549. smalltalk.addMethod(
  4550. '_parse_',
  4551. smalltalk.method({
  4552. selector: 'parse:',
  4553. category: 'parsing',
  4554. fn: function (aStream){
  4555. var self=this;
  4556. var start=nil;
  4557. var elements=nil;
  4558. var element=nil;
  4559. start=aStream._position();
  4560. elements=[];
  4561. self._parsers()._detect_ifNone_((function(each){element=each._memoizedParse_(aStream);elements._add_(element);return element._isParseFailure();}),(function(){return nil;}));
  4562. return element._isParseFailure()._ifFalse_ifTrue_((function(){return elements;}),(function(){aStream._position_(start);return element;}));
  4563. return self;},
  4564. source: unescape('parse%3A%20aStream%0A%09%7C%20start%20elements%20element%20%7C%0A%09start%20%3A%3D%20aStream%20position.%0A%09elements%20%3A%3D%20%23%28%29.%0A%09self%20parsers%20%0A%09%20%20%20%20detect%3A%20%5B%3Aeach%20%7C%0A%09%09element%20%3A%3D%20each%20memoizedParse%3A%20aStream.%0A%09%09elements%20add%3A%20element.%0A%09%09element%20isParseFailure%5D%20%0A%09%20%20%20%20ifNone%3A%20%5B%5D.%0A%09%5Eelement%20isParseFailure%0A%09%20%20%20%20ifFalse%3A%20%5Belements%5D%0A%09%20%20%20%20ifTrue%3A%20%5BaStream%20position%3A%20start.%20element%5D%0A')}),
  4565. smalltalk.PPSequenceParser);
  4566. smalltalk.addClass('PPChoiceParser', smalltalk.PPListParser, [], 'Parser');
  4567. smalltalk.addMethod(
  4568. '__slash',
  4569. smalltalk.method({
  4570. selector: '/',
  4571. category: 'copying',
  4572. fn: function (aRule){
  4573. var self=this;
  4574. return self._copyWith_(aRule);
  4575. return self;},
  4576. source: unescape('/%20aRule%0A%09%5Eself%20copyWith%3A%20aRule%0A')}),
  4577. smalltalk.PPChoiceParser);
  4578. smalltalk.addMethod(
  4579. '_parse_',
  4580. smalltalk.method({
  4581. selector: 'parse:',
  4582. category: 'parsing',
  4583. fn: function (aStream){
  4584. var self=this;
  4585. var result=nil;
  4586. self._parsers()._detect_ifNone_((function(each){result=each._memoizedParse_(aStream);return result._isParseFailure()._not();}),(function(){return nil;}));
  4587. return result;
  4588. return self;},
  4589. source: unescape('parse%3A%20aStream%0A%09%7C%20result%20%7C%0A%09self%20parsers%0A%20%20%20%20%09%20%20%20%20detect%3A%20%5B%3Aeach%20%7C%0A%09%09result%20%3A%3D%20each%20memoizedParse%3A%20aStream.%0A%09%09result%20isParseFailure%20not%5D%0A%09%20%20%20%20ifNone%3A%20%5B%5D.%0A%09%5Eresult%0A')}),
  4590. smalltalk.PPChoiceParser);
  4591. smalltalk.addClass('PPDelegateParser', smalltalk.PPParser, ['parser'], 'Parser');
  4592. smalltalk.addMethod(
  4593. '_parser',
  4594. smalltalk.method({
  4595. selector: 'parser',
  4596. category: 'accessing',
  4597. fn: function (){
  4598. var self=this;
  4599. return self['@parser'];
  4600. return self;},
  4601. source: unescape('parser%0A%09%5Eparser%0A')}),
  4602. smalltalk.PPDelegateParser);
  4603. smalltalk.addMethod(
  4604. '_parser_',
  4605. smalltalk.method({
  4606. selector: 'parser:',
  4607. category: 'accessing',
  4608. fn: function (aParser){
  4609. var self=this;
  4610. self['@parser']=aParser;
  4611. return self;},
  4612. source: unescape('parser%3A%20aParser%0A%09parser%20%3A%3D%20aParser%0A')}),
  4613. smalltalk.PPDelegateParser);
  4614. smalltalk.addMethod(
  4615. '_parse_',
  4616. smalltalk.method({
  4617. selector: 'parse:',
  4618. category: 'parsing',
  4619. fn: function (aStream){
  4620. var self=this;
  4621. return self._parser()._memoizedParse_(aStream);
  4622. return self;},
  4623. source: unescape('parse%3A%20aStream%0A%09%5Eself%20parser%20memoizedParse%3A%20aStream%0A')}),
  4624. smalltalk.PPDelegateParser);
  4625. smalltalk.addMethod(
  4626. '_on_',
  4627. smalltalk.method({
  4628. selector: 'on:',
  4629. category: 'instance creation',
  4630. fn: function (aParser){
  4631. var self=this;
  4632. return (function($rec){$rec._parser_(aParser);return $rec._yourself();})(self._new());
  4633. return self;},
  4634. source: unescape('on%3A%20aParser%0A%09%20%20%20%20%5Eself%20new%0A%09%09parser%3A%20aParser%3B%0A%09%09yourself%0A')}),
  4635. smalltalk.PPDelegateParser.klass);
  4636. smalltalk.addClass('PPAndParser', smalltalk.PPDelegateParser, [], 'Parser');
  4637. smalltalk.addMethod(
  4638. '_parse_',
  4639. smalltalk.method({
  4640. selector: 'parse:',
  4641. category: 'parsing',
  4642. fn: function (aStream){
  4643. var self=this;
  4644. return self._basicParse_(aStream);
  4645. return self;},
  4646. source: unescape('parse%3A%20aStream%0A%09%5Eself%20basicParse%3A%20aStream%0A')}),
  4647. smalltalk.PPAndParser);
  4648. smalltalk.addMethod(
  4649. '_basicParse_',
  4650. smalltalk.method({
  4651. selector: 'basicParse:',
  4652. category: 'parsing',
  4653. fn: function (aStream){
  4654. var self=this;
  4655. var element=nil;
  4656. var position=nil;
  4657. position=aStream._position();
  4658. element=self._parser()._memoizedParse_(aStream);
  4659. aStream._position_(position);
  4660. return element;
  4661. return self;},
  4662. source: unescape('basicParse%3A%20aStream%0A%09%7C%20element%20position%20%7C%0A%09position%20%3A%3D%20aStream%20position.%0A%09element%20%3A%3D%20self%20parser%20memoizedParse%3A%20aStream.%0A%09aStream%20position%3A%20position.%0A%09%5Eelement%0A')}),
  4663. smalltalk.PPAndParser);
  4664. smalltalk.addClass('PPNotParser', smalltalk.PPAndParser, [], 'Parser');
  4665. smalltalk.addMethod(
  4666. '_parse_',
  4667. smalltalk.method({
  4668. selector: 'parse:',
  4669. category: 'parsing',
  4670. fn: function (aStream){
  4671. var self=this;
  4672. var element=nil;
  4673. element=self._basicParse_(aStream);
  4674. return element._isParseFailure()._ifTrue_ifFalse_((function(){return nil;}),(function(){return smalltalk.PPFailure._reason_at_(element,aStream._position());}));
  4675. return self;},
  4676. source: unescape('parse%3A%20aStream%0A%09%7C%20element%20%7C%0A%09element%20%3A%3D%20self%20basicParse%3A%20aStream.%0A%09%5Eelement%20isParseFailure%20%0A%09%20%20%20%20ifTrue%3A%20%5Bnil%5D%0A%09%20%20%20%20ifFalse%3A%20%5BPPFailure%20reason%3A%20element%20at%3A%20aStream%20position%5D%0A')}),
  4677. smalltalk.PPNotParser);
  4678. smalltalk.addClass('PPActionParser', smalltalk.PPDelegateParser, ['block'], 'Parser');
  4679. smalltalk.addMethod(
  4680. '_block',
  4681. smalltalk.method({
  4682. selector: 'block',
  4683. category: 'accessing',
  4684. fn: function (){
  4685. var self=this;
  4686. return self['@block'];
  4687. return self;},
  4688. source: unescape('block%0A%09%5Eblock%0A')}),
  4689. smalltalk.PPActionParser);
  4690. smalltalk.addMethod(
  4691. '_block_',
  4692. smalltalk.method({
  4693. selector: 'block:',
  4694. category: 'accessing',
  4695. fn: function (aBlock){
  4696. var self=this;
  4697. self['@block']=aBlock;
  4698. return self;},
  4699. source: unescape('block%3A%20aBlock%0A%09block%20%3A%3D%20aBlock%0A')}),
  4700. smalltalk.PPActionParser);
  4701. smalltalk.addMethod(
  4702. '_parse_',
  4703. smalltalk.method({
  4704. selector: 'parse:',
  4705. category: 'parsing',
  4706. fn: function (aStream){
  4707. var self=this;
  4708. var element=nil;
  4709. element=self._parser()._memoizedParse_(aStream);
  4710. return element._isParseFailure()._ifFalse_ifTrue_((function(){return self._block()._value_(element);}),(function(){return element;}));
  4711. return self;},
  4712. source: unescape('parse%3A%20aStream%0A%09%7C%20element%20%7C%0A%09element%20%3A%3D%20self%20parser%20memoizedParse%3A%20aStream.%0A%09%5Eelement%20isParseFailure%0A%09%20%20%20%20ifFalse%3A%20%5Bself%20block%20value%3A%20element%5D%0A%09%20%20%20%20ifTrue%3A%20%5Belement%5D%0A')}),
  4713. smalltalk.PPActionParser);
  4714. smalltalk.addMethod(
  4715. '_on_block_',
  4716. smalltalk.method({
  4717. selector: 'on:block:',
  4718. category: 'instance creation',
  4719. fn: function (aParser, aBlock){
  4720. var self=this;
  4721. return (function($rec){$rec._parser_(aParser);$rec._block_(aBlock);return $rec._yourself();})(self._new());
  4722. return self;},
  4723. source: unescape('on%3A%20aParser%20block%3A%20aBlock%0A%09%20%20%20%20%5Eself%20new%0A%09%09parser%3A%20aParser%3B%0A%09%09block%3A%20aBlock%3B%0A%09%09yourself%0A')}),
  4724. smalltalk.PPActionParser.klass);
  4725. smalltalk.addClass('PPFlattenParser', smalltalk.PPDelegateParser, [], 'Parser');
  4726. smalltalk.addMethod(
  4727. '_parse_',
  4728. smalltalk.method({
  4729. selector: 'parse:',
  4730. category: 'parsing',
  4731. fn: function (aStream){
  4732. var self=this;
  4733. var start=nil;
  4734. var element=nil;
  4735. var stop=nil;
  4736. start=aStream._position();
  4737. element=self._parser()._memoizedParse_(aStream);
  4738. return element._isParseFailure()._ifTrue_ifFalse_((function(){return element;}),(function(){return aStream._collection()._copyFrom_to_(start.__plus((1)),aStream._position());}));
  4739. return self;},
  4740. source: unescape('parse%3A%20aStream%0A%09%7C%20start%20element%20stop%20%7C%0A%09start%20%3A%3D%20aStream%20position.%0A%09element%20%3A%3D%20self%20parser%20memoizedParse%3A%20aStream.%0A%09%5Eelement%20isParseFailure%0A%09%20%20%20%20ifTrue%3A%20%5Belement%5D%0A%09%20%20%20%20ifFalse%3A%20%5BaStream%20collection%20%0A%09%09copyFrom%3A%20start%20+%201%20%0A%09%09to%3A%20aStream%20position%5D%0A')}),
  4741. smalltalk.PPFlattenParser);
  4742. smalltalk.addClass('PPSourceParser', smalltalk.PPDelegateParser, [], 'Parser');
  4743. smalltalk.addMethod(
  4744. '_parse_',
  4745. smalltalk.method({
  4746. selector: 'parse:',
  4747. category: 'parsing',
  4748. fn: function (aStream){
  4749. var self=this;
  4750. var start=nil;
  4751. var element=nil;
  4752. var stop=nil;
  4753. var result=nil;
  4754. start=aStream._position();
  4755. element=self._parser()._memoizedParse_(aStream);
  4756. return element._isParseFailure()._ifTrue_ifFalse_((function(){return element;}),(function(){result=aStream._collection()._copyFrom_to_(start.__plus((1)),aStream._position());return smalltalk.Array._with_with_(element,result);}));
  4757. return self;},
  4758. source: unescape('parse%3A%20aStream%0A%09%7C%20start%20element%20stop%20result%20%7C%0A%09start%20%3A%3D%20aStream%20position.%0A%09element%20%3A%3D%20self%20parser%20memoizedParse%3A%20aStream.%0A%09%5Eelement%20isParseFailure%0A%09%09ifTrue%3A%20%5Belement%5D%0A%09%09ifFalse%3A%20%5Bresult%20%3A%3D%20aStream%20collection%20copyFrom%3A%20start%20+%201%20to%3A%20aStream%20position.%0A%09%09%09Array%20with%3A%20element%20with%3A%20result%5D.%0A')}),
  4759. smalltalk.PPSourceParser);
  4760. smalltalk.addClass('PPRepeatingParser', smalltalk.PPDelegateParser, ['min'], 'Parser');
  4761. smalltalk.addMethod(
  4762. '_min',
  4763. smalltalk.method({
  4764. selector: 'min',
  4765. category: 'accessing',
  4766. fn: function (){
  4767. var self=this;
  4768. return self['@min'];
  4769. return self;},
  4770. source: unescape('min%0A%09%5Emin%0A')}),
  4771. smalltalk.PPRepeatingParser);
  4772. smalltalk.addMethod(
  4773. '_min_',
  4774. smalltalk.method({
  4775. selector: 'min:',
  4776. category: 'accessing',
  4777. fn: function (aNumber){
  4778. var self=this;
  4779. self['@min']=aNumber;
  4780. return self;},
  4781. source: unescape('min%3A%20aNumber%0A%09min%20%3A%3D%20aNumber%0A')}),
  4782. smalltalk.PPRepeatingParser);
  4783. smalltalk.addMethod(
  4784. '_parse_',
  4785. smalltalk.method({
  4786. selector: 'parse:',
  4787. category: 'parsing',
  4788. fn: function (aStream){
  4789. var self=this;
  4790. var start=nil;
  4791. var element=nil;
  4792. var elements=nil;
  4793. var failure=nil;
  4794. start=aStream._position();
  4795. elements=smalltalk.Array._new();
  4796. (function(){return elements._size().__lt(self._min())._and_((function(){return failure._isNil();}));})._whileTrue_((function(){element=self._parser()._memoizedParse_(aStream);return element._isParseFailure()._ifFalse_ifTrue_((function(){return elements._addLast_(element);}),(function(){aStream._position_(start);return failure=element;}));}));
  4797. return failure._ifNil_ifNotNil_((function(){(function(){return failure._isNil();})._whileTrue_((function(){element=self._parser()._memoizedParse_(aStream);return element._isParseFailure()._ifTrue_ifFalse_((function(){return failure=element;}),(function(){return elements._addLast_(element);}));}));return elements;}),(function(){return failure;}));
  4798. return self;},
  4799. source: unescape('parse%3A%20aStream%0A%09%7C%20start%20element%20elements%20failure%20%7C%0A%09start%20%3A%3D%20aStream%20position.%0A%09elements%20%3A%3D%20Array%20new.%0A%09%5B%28elements%20size%20%3C%20self%20min%29%20and%3A%20%5Bfailure%20isNil%5D%5D%20whileTrue%3A%20%5B%0A%09%20%20%20%20element%20%3A%3D%20self%20parser%20memoizedParse%3A%20aStream.%0A%09%20%20%20%20element%20isParseFailure%0A%09%09%09ifFalse%3A%20%5Belements%20addLast%3A%20element%5D%0A%09%09%09ifTrue%3A%20%5BaStream%20position%3A%20start.%0A%09%09%09%09%20failure%20%3A%3D%20element%5D%5D.%0A%09%5Efailure%20ifNil%3A%20%5B%0A%09%20%20%20%20%5Bfailure%20isNil%5D%20whileTrue%3A%20%5B%0A%09%09%09element%20%3A%3D%20self%20parser%20memoizedParse%3A%20aStream.%0A%09%20%09%09element%20isParseFailure%0A%09%09%09%09ifTrue%3A%20%5Bfailure%20%3A%3D%20element%5D%0A%09%09%09%09ifFalse%3A%20%5Belements%20addLast%3A%20element%5D%5D.%0A%09%09%09%09elements%5D%0A%09%09ifNotNil%3A%20%5Bfailure%5D.%0A')}),
  4800. smalltalk.PPRepeatingParser);
  4801. smalltalk.addMethod(
  4802. '_on_min_',
  4803. smalltalk.method({
  4804. selector: 'on:min:',
  4805. category: 'instance creation',
  4806. fn: function (aParser, aNumber){
  4807. var self=this;
  4808. return (function($rec){$rec._parser_(aParser);$rec._min_(aNumber);return $rec._yourself();})(self._new());
  4809. return self;},
  4810. source: unescape('on%3A%20aParser%20min%3A%20aNumber%0A%09%20%20%20%20%5Eself%20new%0A%09%09parser%3A%20aParser%3B%0A%09%09min%3A%20aNumber%3B%0A%09%09yourself%0A')}),
  4811. smalltalk.PPRepeatingParser.klass);
  4812. smalltalk.addClass('PPFailure', smalltalk.Object, ['position', 'reason'], 'Parser');
  4813. smalltalk.addMethod(
  4814. '_position',
  4815. smalltalk.method({
  4816. selector: 'position',
  4817. category: 'accessing',
  4818. fn: function (){
  4819. var self=this;
  4820. return self['@position']._ifNil_((function(){return (0);}));
  4821. return self;},
  4822. source: unescape('position%0A%09%5Eposition%20ifNil%3A%20%5B0%5D%0A')}),
  4823. smalltalk.PPFailure);
  4824. smalltalk.addMethod(
  4825. '_position_',
  4826. smalltalk.method({
  4827. selector: 'position:',
  4828. category: 'accessing',
  4829. fn: function (aNumber){
  4830. var self=this;
  4831. self['@position']=aNumber;
  4832. return self;},
  4833. source: unescape('position%3A%20aNumber%0A%09position%20%3A%3D%20aNumber%0A')}),
  4834. smalltalk.PPFailure);
  4835. smalltalk.addMethod(
  4836. '_reason',
  4837. smalltalk.method({
  4838. selector: 'reason',
  4839. category: 'accessing',
  4840. fn: function (){
  4841. var self=this;
  4842. return self['@reason']._ifNil_((function(){return "";}));
  4843. return self;},
  4844. source: unescape('reason%0A%09%5Ereason%20ifNil%3A%20%5B%27%27%5D%0A')}),
  4845. smalltalk.PPFailure);
  4846. smalltalk.addMethod(
  4847. '_reason_',
  4848. smalltalk.method({
  4849. selector: 'reason:',
  4850. category: 'accessing',
  4851. fn: function (aString){
  4852. var self=this;
  4853. self['@reason']=aString;
  4854. return self;},
  4855. source: unescape('reason%3A%20aString%0A%09reason%20%3A%3D%20aString%0A')}),
  4856. smalltalk.PPFailure);
  4857. smalltalk.addMethod(
  4858. '_reason_at_',
  4859. smalltalk.method({
  4860. selector: 'reason:at:',
  4861. category: 'accessing',
  4862. fn: function (aString, anInteger){
  4863. var self=this;
  4864. (function($rec){$rec._reason_(aString);return $rec._position_(anInteger);})(self);
  4865. return self;},
  4866. source: unescape('reason%3A%20aString%20at%3A%20anInteger%0A%09self%20%0A%09%20%20%20%20reason%3A%20aString%3B%20%0A%09%20%20%20%20position%3A%20anInteger%0A')}),
  4867. smalltalk.PPFailure);
  4868. smalltalk.addMethod(
  4869. '_isParseFailure',
  4870. smalltalk.method({
  4871. selector: 'isParseFailure',
  4872. category: 'testing',
  4873. fn: function (){
  4874. var self=this;
  4875. return true;
  4876. return self;},
  4877. source: unescape('isParseFailure%0A%09%5Etrue%0A')}),
  4878. smalltalk.PPFailure);
  4879. smalltalk.addMethod(
  4880. '_reason_at_',
  4881. smalltalk.method({
  4882. selector: 'reason:at:',
  4883. category: 'instance creation',
  4884. fn: function (aString, anInteger){
  4885. var self=this;
  4886. return (function($rec){$rec._reason_at_(aString,anInteger);return $rec._yourself();})(self._new());
  4887. return self;},
  4888. source: unescape('reason%3A%20aString%20at%3A%20anInteger%0A%09%20%20%20%20%5Eself%20new%0A%09%09reason%3A%20aString%20at%3A%20anInteger%3B%0A%09%09yourself%0A')}),
  4889. smalltalk.PPFailure.klass);
  4890. smalltalk.addClass('SmalltalkParser', smalltalk.Object, [], 'Parser');
  4891. smalltalk.addMethod(
  4892. '_parse_',
  4893. smalltalk.method({
  4894. selector: 'parse:',
  4895. category: 'parsing',
  4896. fn: function (aStream){
  4897. var self=this;
  4898. return self._parser()._parse_(aStream);
  4899. return self;},
  4900. source: unescape('parse%3A%20aStream%0A%09%5Eself%20parser%20parse%3A%20aStream%0A')}),
  4901. smalltalk.SmalltalkParser);
  4902. smalltalk.addMethod(
  4903. '_parser',
  4904. smalltalk.method({
  4905. selector: 'parser',
  4906. category: 'grammar',
  4907. fn: function (){
  4908. var self=this;
  4909. var method=nil;
  4910. var expression=nil;
  4911. var separator=nil;
  4912. var comment=nil;
  4913. var ws=nil;
  4914. var identifier=nil;
  4915. var keyword=nil;
  4916. var className=nil;
  4917. var string=nil;
  4918. var symbol=nil;
  4919. var number=nil;
  4920. var literalArray=nil;
  4921. var variable=nil;
  4922. var reference=nil;
  4923. var classReference=nil;
  4924. var literal=nil;
  4925. var ret=nil;
  4926. var methodParser=nil;
  4927. var expressionParser=nil;
  4928. var keyword=nil;
  4929. var unarySelector=nil;
  4930. var binarySelector=nil;
  4931. var keywordPattern=nil;
  4932. var unaryPattern=nil;
  4933. var binaryPattern=nil;
  4934. var assignment=nil;
  4935. var temps=nil;
  4936. var blockParamList=nil;
  4937. var block=nil;
  4938. var expression=nil;
  4939. var expressions=nil;
  4940. var subexpression=nil;
  4941. var statements=nil;
  4942. var sequence=nil;
  4943. var operand=nil;
  4944. var unaryMessage=nil;
  4945. var unarySend=nil;
  4946. var unaryTail=nil;
  4947. var binaryMessage=nil;
  4948. var binarySend=nil;
  4949. var binaryTail=nil;
  4950. var keywordMessage=nil;
  4951. var keywordSend=nil;
  4952. var keywordPair=nil;
  4953. var cascade=nil;
  4954. var message=nil;
  4955. var jsStatement=nil;
  4956. separator=smalltalk.String._cr().__comma(smalltalk.String._space()).__comma(smalltalk.String._lf()).__comma(smalltalk.String._tab())._asChoiceParser();
  4957. comment=unescape("%22")._asCharacterParser().__comma(unescape("%22")._asParser()._not().__comma(smalltalk.PPAnyParser._new())._star()).__comma(unescape("%22")._asCharacterParser())._flatten();
  4958. ws=separator.__slash(comment)._star();
  4959. identifier=unescape("a-z")._asCharacterParser().__comma(unescape("a-zA-Z0-9")._asCharacterParser()._star())._flatten();
  4960. keyword=identifier.__comma(":"._asParser())._flatten();
  4961. className=unescape("A-Z")._asCharacterParser().__comma(unescape("a-zA-Z0-9")._asCharacterParser()._star())._flatten();
  4962. string=unescape("%27")._asParser().__comma(unescape("%27%27")._asParser().__slash(unescape("%27")._asParser()._not().__comma(smalltalk.PPAnyParser._new()))._star()._flatten()).__comma(unescape("%27")._asParser()).__eq_eq_gt((function(node){return smalltalk.ValueNode._new()._value_(node._at_((2))._replace_with_(unescape("%27%27"),unescape("%27")));}));
  4963. symbol=unescape("%23")._asParser().__comma(unescape("a-zA-Z0-9")._asCharacterParser()._plus()._flatten()).__eq_eq_gt((function(node){return smalltalk.ValueNode._new()._value_(node._second());}));
  4964. number=unescape("0-9")._asCharacterParser()._plus().__comma("."._asParser().__comma(unescape("0-9")._asCharacterParser()._plus())._optional())._flatten().__eq_eq_gt((function(node){return smalltalk.ValueNode._new()._value_(node._asNumber());}));
  4965. literal=smalltalk.PPDelegateParser._new();
  4966. literalArray=unescape("%23%28")._asParser().__comma(ws.__comma(literal).__comma(ws)._star()).__comma(unescape("%29")._asParser()).__eq_eq_gt((function(node){return smalltalk.ValueNode._new()._value_(smalltalk.Array._withAll_(node._second()._collect_((function(each){return each._second()._value();}))));}));
  4967. variable=identifier.__eq_eq_gt((function(token){return smalltalk.VariableNode._new()._value_(token);}));
  4968. classReference=className.__eq_eq_gt((function(token){return smalltalk.ClassReferenceNode._new()._value_(token);}));
  4969. reference=variable.__slash(classReference);
  4970. binarySelector=unescape("+*/%3D%3E%3C%2C@%25%7E-")._asCharacterParser()._plus()._flatten();
  4971. unarySelector=identifier;
  4972. keywordPattern=ws.__comma(keyword).__comma(ws).__comma(identifier)._plus().__eq_eq_gt((function(nodes){return smalltalk.Array._with_with_(nodes._collect_((function(each){return each._at_((2));}))._join_(""),nodes._collect_((function(each){return each._at_((4));})));}));
  4973. binaryPattern=ws.__comma(binarySelector).__comma(ws).__comma(identifier).__eq_eq_gt((function(node){return smalltalk.Array._with_with_(node._second(),smalltalk.Array._with_(node._fourth()));}));
  4974. unaryPattern=ws.__comma(unarySelector).__eq_eq_gt((function(node){return smalltalk.Array._with_with_(node._second(),smalltalk.Array._new());}));
  4975. expression=smalltalk.PPDelegateParser._new();
  4976. expressions=expression.__comma(ws.__comma("."._asParser()).__comma(ws).__comma(expression).__eq_eq_gt((function(node){return node._fourth();}))._star()).__eq_eq_gt((function(node){var result=nil;
  4977. result=smalltalk.Array._with_(node._first());node._second()._do_((function(each){return result._add_(each);}));return result;}));
  4978. assignment=reference.__comma(ws).__comma(unescape("%3A%3D")._asParser()).__comma(ws).__comma(expression).__eq_eq_gt((function(node){return (function($rec){$rec._left_(node._first());return $rec._right_(node._at_((5)));})(smalltalk.AssignmentNode._new());}));
  4979. ret=unescape("%5E")._asParser().__comma(ws).__comma(expression).__comma(ws).__comma("."._asParser()._optional()).__eq_eq_gt((function(node){return (function($rec){$rec._addNode_(node._third());return $rec._yourself();})(smalltalk.ReturnNode._new());}));
  4980. temps=unescape("%7C")._asParser().__comma(ws.__comma(identifier)._star()).__comma(ws).__comma(unescape("%7C")._asParser()).__eq_eq_gt((function(node){return node._second()._collect_((function(each){return each._second();}));}));
  4981. blockParamList=":"._asParser().__comma(identifier).__comma(ws)._plus().__comma(unescape("%7C")._asParser()).__eq_eq_gt((function(node){return node._first()._collect_((function(each){return each._second();}));}));
  4982. subexpression=unescape("%28")._asParser().__comma(ws).__comma(expression).__comma(ws).__comma(unescape("%29")._asParser()).__eq_eq_gt((function(node){return node._third();}));
  4983. statements=ret.__eq_eq_gt((function(node){return smalltalk.Array._with_(node);})).__slash(expressions.__comma(ws).__comma("."._asParser()).__comma(ws).__comma(ret).__eq_eq_gt((function(node){return (function($rec){$rec._add_(node._at_((5)));return $rec._yourself();})(node._first());}))).__slash(expressions.__comma("."._asParser()._optional()).__eq_eq_gt((function(node){return node._first();})));
  4984. sequence=temps._optional().__comma(ws).__comma(statements._optional()).__comma(ws).__eq_eq_gt((function(node){return (function($rec){$rec._temps_(node._first());$rec._nodes_(node._third());return $rec._yourself();})(smalltalk.SequenceNode._new());}));
  4985. block=unescape("%5B")._asParser().__comma(ws).__comma(blockParamList._optional()).__comma(ws).__comma(sequence._optional()).__comma(ws).__comma(unescape("%5D")._asParser()).__eq_eq_gt((function(node){return (function($rec){$rec._parameters_(node._third());return $rec._addNode_(node._at_((5))._asBlockSequenceNode());})(smalltalk.BlockNode._new());}));
  4986. operand=literal.__slash(reference).__slash(subexpression);
  4987. literal._parser_(number.__slash(string).__slash(literalArray).__slash(symbol).__slash(block));
  4988. unaryMessage=ws.__comma(unarySelector).__comma(":"._asParser()._not()).__eq_eq_gt((function(node){return smalltalk.SendNode._new()._selector_(node._second());}));
  4989. unaryTail=smalltalk.PPDelegateParser._new();
  4990. unaryTail._parser_(unaryMessage.__comma(unaryTail._optional()).__eq_eq_gt((function(node){return node._second()._ifNil_ifNotNil_((function(){return node._first();}),(function(){return node._second()._valueForReceiver_(node._first());}));})));
  4991. unarySend=operand.__comma(unaryTail._optional()).__eq_eq_gt((function(node){return node._second()._ifNil_ifNotNil_((function(){return node._first();}),(function(){return node._second()._valueForReceiver_(node._first());}));}));
  4992. binaryMessage=ws.__comma(binarySelector).__comma(ws).__comma(unarySend.__slash(operand)).__eq_eq_gt((function(node){return (function($rec){$rec._selector_(node._second());return $rec._arguments_(smalltalk.Array._with_(node._fourth()));})(smalltalk.SendNode._new());}));
  4993. binaryTail=smalltalk.PPDelegateParser._new();
  4994. binaryTail._parser_(binaryMessage.__comma(binaryTail._optional()).__eq_eq_gt((function(node){return node._second()._ifNil_ifNotNil_((function(){return node._first();}),(function(){return node._second()._valueForReceiver_(node._first());}));})));
  4995. binarySend=unarySend.__comma(binaryTail._optional()).__eq_eq_gt((function(node){return node._second()._ifNil_ifNotNil_((function(){return node._first();}),(function(){return node._second()._valueForReceiver_(node._first());}));}));
  4996. keywordPair=keyword.__comma(ws).__comma(binarySend);
  4997. keywordMessage=ws.__comma(keywordPair)._plus().__eq_eq_gt((function(nodes){return (function($rec){$rec._selector_(nodes._collect_((function(each){return each._second()._first();}))._join_(""));return $rec._arguments_(nodes._collect_((function(each){return each._second()._third();})));})(smalltalk.SendNode._new());}));
  4998. keywordSend=binarySend.__comma(keywordMessage).__eq_eq_gt((function(node){return node._second()._valueForReceiver_(node._first());}));
  4999. message=binaryMessage.__slash(unaryMessage).__slash(keywordMessage);
  5000. cascade=keywordSend.__slash(binarySend).__comma(ws.__comma(unescape("%3B")._asParser()).__comma(message)._plus()).__eq_eq_gt((function(node){return node._first()._cascadeNodeWithMessages_(node._second()._collect_((function(each){return each._third();})));}));
  5001. jsStatement=unescape("%7B")._asParser().__comma(ws).__comma(string).__comma(ws).__comma(unescape("%7D")._asParser()).__eq_eq_gt((function(node){return (function($rec){$rec._source_(node._third());return $rec._yourself();})(smalltalk.JSStatementNode._new());}));
  5002. expression._parser_(assignment.__slash(cascade).__slash(keywordSend).__slash(binarySend).__slash(jsStatement));
  5003. method=ws.__comma(keywordPattern.__slash(binaryPattern).__slash(unaryPattern)).__comma(ws).__comma(sequence._optional()).__comma(ws)._withSource().__eq_eq_gt((function(node){return (function($rec){$rec._selector_(node._first()._second()._first());$rec._arguments_(node._first()._second()._second());$rec._addNode_(node._first()._fourth());$rec._source_(node._second());return $rec._yourself();})(smalltalk.MethodNode._new());}));
  5004. return method.__comma(smalltalk.PPEOFParser._new()).__eq_eq_gt((function(node){return node._first();}));
  5005. return self;},
  5006. source: unescape('parser%0A%09%7C%20method%20expression%20separator%20comment%20ws%20identifier%20keyword%20className%20string%20symbol%20number%20literalArray%20variable%20reference%20classReference%20literal%20ret%20methodParser%20expressionParser%20keyword%20unarySelector%20binarySelector%20keywordPattern%20unaryPattern%20binaryPattern%20assignment%20temps%20blockParamList%20block%20expression%20expressions%20subexpression%20statements%20sequence%20operand%20unaryMessage%20unarySend%20unaryTail%20binaryMessage%20binarySend%20binaryTail%20keywordMessage%20keywordSend%20keywordPair%20cascade%20message%20jsStatement%20%7C%0A%09%0A%09separator%20%3A%3D%20%28String%20cr%2C%20String%20space%2C%20String%20lf%2C%20String%20tab%29%20asChoiceParser.%0A%09comment%20%3A%3D%20%28%27%22%27%20asCharacterParser%2C%20%28%27%22%27%20asParser%20not%2C%20PPAnyParser%20new%29%20star%2C%20%27%22%27%20asCharacterParser%29%20flatten.%0A%0A%09ws%20%3A%3D%20%28separator%20/%20comment%29%20star.%0A%09%0A%09identifier%20%3A%3D%20%28%27a-z%27%20asCharacterParser%2C%20%27a-zA-Z0-9%27%20asCharacterParser%20star%29%20flatten.%0A%0A%09keyword%20%3A%3D%20%28identifier%2C%20%27%3A%27%20asParser%29%20flatten.%0A%0A%09className%20%3A%3D%20%28%27A-Z%27%20asCharacterParser%2C%20%27a-zA-Z0-9%27%20asCharacterParser%20star%29%20flatten.%0A%0A%09string%20%3A%3D%20%27%27%27%27%20asParser%2C%20%28%27%27%27%27%27%27%20asParser%20/%20%28%27%27%27%27%20asParser%20not%2C%20PPAnyParser%20new%29%29%20star%20flatten%2C%20%27%27%27%27%20asParser%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20ValueNode%20new%20value%3A%20%28%28node%20at%3A%202%29%20replace%3A%20%27%27%27%27%27%27%20with%3A%20%27%27%27%27%29%5D.%0A%0A%09symbol%20%3A%3D%20%27%23%27%20asParser%2C%20%27a-zA-Z0-9%27%20asCharacterParser%20plus%20flatten%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20ValueNode%20new%20value%3A%20node%20second%5D.%0A%0A%09number%20%3A%3D%20%28%270-9%27%20asCharacterParser%20plus%2C%20%28%27.%27%20asParser%2C%20%270-9%27%20asCharacterParser%20plus%29%20optional%29%20flatten%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20ValueNode%20new%20value%3A%20node%20asNumber%5D.%0A%0A%09literal%20%3A%3D%20PPDelegateParser%20new.%0A%0A%09literalArray%20%3A%3D%20%27%23%28%27%20asParser%2C%20%28ws%2C%20literal%2C%20ws%29%20star%2C%20%27%29%27%20asParser%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20ValueNode%20new%20value%3A%20%28Array%20withAll%3A%20%28node%20second%20collect%3A%20%5B%3Aeach%20%7C%20each%20second%20value%5D%29%29%5D.%0A%0A%09variable%20%3A%3D%20identifier%20%3D%3D%3E%20%5B%3Atoken%20%7C%20VariableNode%20new%20value%3A%20token%5D.%0A%0A%09classReference%20%3A%3D%20className%20%3D%3D%3E%20%5B%3Atoken%20%7C%20ClassReferenceNode%20new%20value%3A%20token%5D.%0A%0A%09reference%20%3A%3D%20variable%20/%20classReference.%0A%0A%09binarySelector%20%3A%3D%20%27+*/%3D%3E%3C%2C@%25%7E-%27%20asCharacterParser%20plus%20flatten.%0A%0A%09unarySelector%20%3A%3D%20identifier.%0A%0A%09keywordPattern%20%3A%3D%20%28ws%2C%20keyword%2C%20ws%2C%20identifier%29%20plus%0A%09%09%3D%3D%3E%20%5B%3Anodes%20%7C%20Array%0A%09%09%09%09%20%20with%3A%20%28%28nodes%20collect%3A%20%5B%3Aeach%20%7C%20each%20at%3A%202%5D%29%20join%3A%20%27%27%29%0A%09%09%09%09%20%20with%3A%20%28nodes%20collect%3A%20%5B%3Aeach%20%7C%20each%20at%3A%204%5D%29%5D.%0A%0A%09binaryPattern%20%3A%3D%20ws%2C%20binarySelector%2C%20ws%2C%20identifier%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20Array%20with%3A%20node%20second%20with%3A%20%28Array%20with%3A%20node%20fourth%29%5D.%0A%0A%09unaryPattern%20%3A%3D%20ws%2C%20unarySelector%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20Array%20with%3A%20node%20second%20with%3A%20Array%20new%5D.%0A%09%0A%09expression%20%3A%3D%20PPDelegateParser%20new.%0A%0A%09expressions%20%3A%3D%20expression%2C%20%28%28ws%2C%20%27.%27%20asParser%2C%20ws%2C%20expression%29%20%3D%3D%3E%20%5B%3Anode%20%7C%20node%20fourth%5D%29%20star%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%7C%20result%20%7C%0A%09%09%20%20%20%20result%20%3A%3D%20Array%20with%3A%20node%20first.%0A%09%09%20%20%20%20node%20second%20do%3A%20%5B%3Aeach%20%7C%20result%20add%3A%20each%5D.%0A%09%09%20%20%20%20result%5D.%0A%0A%09assignment%20%3A%3D%20reference%2C%20ws%2C%20%27%3A%3D%27%20asParser%2C%20ws%2C%20expression%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20AssignmentNode%20new%20left%3A%20node%20first%3B%20right%3A%20%28node%20at%3A%205%29%5D.%0A%0A%09ret%20%3A%3D%20%27%5E%27%20asParser%2C%20ws%2C%20expression%2C%20ws%2C%20%27.%27%20asParser%20optional%0A%09%20%20%20%20%3D%3D%3E%20%5B%3Anode%20%7C%20ReturnNode%20new%0A%09%09%09%20%20%20%20%20addNode%3A%20node%20third%3B%0A%09%09%09%20%20%20%20%20yourself%5D.%0A%0A%09temps%20%3A%3D%20%27%7C%27%20asParser%2C%20%28ws%2C%20identifier%29%20star%2C%20ws%2C%20%27%7C%27%20asParser%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20node%20second%20collect%3A%20%5B%3Aeach%20%7C%20each%20second%5D%5D.%0A%0A%09blockParamList%20%3A%3D%20%28%27%3A%27%20asParser%2C%20identifier%2C%20ws%29%20plus%2C%20%27%7C%27%20asParser%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20node%20first%20collect%3A%20%5B%3Aeach%20%7C%20each%20second%5D%5D.%0A%0A%09subexpression%20%3A%3D%20%27%28%27%20asParser%2C%20ws%2C%20expression%2C%20ws%2C%20%27%29%27%20asParser%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20node%20third%5D.%0A%0A%09statements%20%3A%3D%20%28ret%20%3D%3D%3E%20%5B%3Anode%20%7C%20Array%20with%3A%20node%5D%29%20/%20%28expressions%2C%20ws%2C%20%27.%27%20asParser%2C%20ws%2C%20ret%20%3D%3D%3E%20%5B%3Anode%20%7C%20node%20first%20add%3A%20%28node%20at%3A%205%29%3B%20yourself%5D%29%20/%20%28expressions%20%2C%20%27.%27%20asParser%20optional%20%3D%3D%3E%20%5B%3Anode%20%7C%20node%20first%5D%29.%0A%0A%09sequence%20%3A%3D%20temps%20optional%2C%20ws%2C%20statements%20optional%2C%20ws%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20SequenceNode%20new%0A%09%09%09%09%20temps%3A%20node%20first%3B%0A%09%09%09%09%20nodes%3A%20node%20third%3B%0A%09%09%09%09%20yourself%5D.%0A%0A%09block%20%3A%3D%20%27%5B%27%20asParser%2C%20ws%2C%20blockParamList%20optional%2C%20ws%2C%20sequence%20optional%2C%20ws%2C%20%27%5D%27%20asParser%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%0A%09%09%20%20%20%20BlockNode%20new%0A%09%09%09parameters%3A%20node%20third%3B%0A%09%09%09addNode%3A%20%28node%20at%3A%205%29%20asBlockSequenceNode%5D.%0A%0A%09operand%20%3A%3D%20literal%20/%20reference%20/%20subexpression.%0A%0A%09literal%20parser%3A%20number%20/%20string%20/%20literalArray%20/%20symbol%20/%20block.%0A%0A%09unaryMessage%20%3A%3D%20ws%2C%20unarySelector%2C%20%27%3A%27%20asParser%20not%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20SendNode%20new%20selector%3A%20node%20second%5D.%0A%0A%09unaryTail%20%3A%3D%20PPDelegateParser%20new.%0A%09unaryTail%20parser%3A%20%28unaryMessage%2C%20unaryTail%20optional%0A%09%09%09%20%20%20%20%20%20%20%3D%3D%3E%20%5B%3Anode%20%7C%0A%09%09%09%09%20%20%20node%20second%0A%09%09%09%09%09%20%20%20ifNil%3A%20%5Bnode%20first%5D%0A%09%09%09%09%09%20%20%20ifNotNil%3A%20%5Bnode%20second%20valueForReceiver%3A%20node%20first%5D%5D%29.%0A%0A%09unarySend%20%3A%3D%20operand%2C%20unaryTail%20optional%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%0A%09%09%20%20%20%20node%20second%20%0A%09%09%09ifNil%3A%20%5Bnode%20first%5D%0A%09%09%09ifNotNil%3A%20%5Bnode%20second%20valueForReceiver%3A%20node%20first%5D%5D.%0A%0A%09binaryMessage%20%3A%3D%20ws%2C%20binarySelector%2C%20ws%2C%20%28unarySend%20/%20operand%29%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%0A%09%09%20%20%20%20SendNode%20new%0A%09%09%09selector%3A%20node%20second%3B%0A%09%09%09arguments%3A%20%28Array%20with%3A%20node%20fourth%29%5D.%0A%0A%09binaryTail%20%3A%3D%20PPDelegateParser%20new.%0A%09binaryTail%20parser%3A%20%28binaryMessage%2C%20binaryTail%20optional%0A%09%09%09%09%20%20%20%20%3D%3D%3E%20%5B%3Anode%20%7C%0A%09%09%09%09%09node%20second%20%0A%09%09%09%09%09%20%20%20%20ifNil%3A%20%5Bnode%20first%5D%0A%09%09%09%09%09%20%20%20%20ifNotNil%3A%20%5B%20node%20second%20valueForReceiver%3A%20node%20first%5D%5D%29.%0A%0A%09binarySend%20%3A%3D%20unarySend%2C%20binaryTail%20optional%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%0A%09%09%20%20%20%20node%20second%0A%09%09%09ifNil%3A%20%5Bnode%20first%5D%0A%09%09%09ifNotNil%3A%20%5Bnode%20second%20valueForReceiver%3A%20node%20first%5D%5D.%0A%0A%09keywordPair%20%3A%3D%20keyword%2C%20ws%2C%20binarySend.%0A%0A%09keywordMessage%20%3A%3D%20%28ws%2C%20keywordPair%29%20plus%0A%09%09%3D%3D%3E%20%5B%3Anodes%20%7C%0A%09%09%20%20%20%20SendNode%20new%0A%09%09%09selector%3A%20%28%28nodes%20collect%3A%20%5B%3Aeach%20%7C%20each%20second%20first%5D%29%20join%3A%20%27%27%29%3B%0A%09%09%09arguments%3A%20%28nodes%20collect%3A%20%5B%3Aeach%20%7C%20each%20second%20third%5D%29%5D.%0A%0A%09keywordSend%20%3A%3D%20binarySend%2C%20keywordMessage%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%0A%09%09%20%20%20%20node%20second%20valueForReceiver%3A%20node%20first%5D.%0A%0A%09message%20%3A%3D%20binaryMessage%20/%20unaryMessage%20/%20keywordMessage.%0A%0A%09cascade%20%3A%3D%20%28keywordSend%20/%20binarySend%29%2C%20%28ws%2C%20%27%3B%27%20asParser%2C%20message%29%20plus%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%0A%09%09%20%20%20%20node%20first%20cascadeNodeWithMessages%3A%20%0A%09%09%09%28node%20second%20collect%3A%20%5B%3Aeach%20%7C%20each%20third%5D%29%5D.%0A%0A%09jsStatement%20%3A%3D%20%27%7B%27%20asParser%2C%20ws%2C%20string%2C%20ws%2C%20%27%7D%27%20asParser%0A%09%20%20%20%20%3D%3D%3E%20%5B%3Anode%20%7C%20JSStatementNode%20new%0A%09%09%09%20%20%20%20%20source%3A%20node%20third%3B%0A%09%09%09%20%20%20%20%20yourself%5D.%0A%0A%09expression%20parser%3A%20assignment%20/%20cascade%20/%20keywordSend%20/%20binarySend%20/%20jsStatement.%0A%0A%09method%20%3A%3D%20%28ws%2C%20%28keywordPattern%20/%20binaryPattern%20/%20unaryPattern%29%2C%20ws%2C%20sequence%20optional%2C%20ws%29%20withSource%0A%09%20%20%20%20%3D%3D%3E%20%5B%3Anode%20%7C%0A%09%09MethodNode%20new%0A%09%09%20%20%20%20selector%3A%20node%20first%20second%20first%3B%0A%09%09%20%20%20%20arguments%3A%20node%20first%20second%20second%3B%0A%09%09%20%20%20%20addNode%3A%20node%20first%20fourth%3B%0A%09%09%20%20%20%20source%3A%20node%20second%3B%0A%09%09%20%20%20%20yourself%5D.%0A%09%0A%09%5Emethod%2C%20PPEOFParser%20new%20%3D%3D%3E%20%5B%3Anode%20%7C%20node%20first%5D%0A')}),
  5007. smalltalk.SmalltalkParser);
  5008. smalltalk.addMethod(
  5009. '_parse_',
  5010. smalltalk.method({
  5011. selector: 'parse:',
  5012. category: 'instance creation',
  5013. fn: function (aStream){
  5014. var self=this;
  5015. return self._new()._parse_(aStream);
  5016. return self;},
  5017. source: unescape('parse%3A%20aStream%0A%09%20%20%20%20%5Eself%20new%0A%09%09parse%3A%20aStream%0A')}),
  5018. smalltalk.SmalltalkParser.klass);
  5019. smalltalk.addClass('Chunk', smalltalk.Object, ['contents'], 'Parser');
  5020. smalltalk.addMethod(
  5021. '_contents',
  5022. smalltalk.method({
  5023. selector: 'contents',
  5024. category: 'accessing',
  5025. fn: function (){
  5026. var self=this;
  5027. return self['@contents']._ifNil_((function(){return "";}));
  5028. return self;},
  5029. source: unescape('contents%0A%09%5Econtents%20ifNil%3A%20%5B%27%27%5D%0A')}),
  5030. smalltalk.Chunk);
  5031. smalltalk.addMethod(
  5032. '_contents_',
  5033. smalltalk.method({
  5034. selector: 'contents:',
  5035. category: 'accessing',
  5036. fn: function (aString){
  5037. var self=this;
  5038. self['@contents']=aString;
  5039. return self;},
  5040. source: unescape('contents%3A%20aString%0A%09contents%20%3A%3D%20aString%0A')}),
  5041. smalltalk.Chunk);
  5042. smalltalk.addMethod(
  5043. '_isEmptyChunk',
  5044. smalltalk.method({
  5045. selector: 'isEmptyChunk',
  5046. category: 'testing',
  5047. fn: function (){
  5048. var self=this;
  5049. return false;
  5050. return self;},
  5051. source: unescape('isEmptyChunk%0A%09%5Efalse%0A')}),
  5052. smalltalk.Chunk);
  5053. smalltalk.addMethod(
  5054. '_isInstructionChunk',
  5055. smalltalk.method({
  5056. selector: 'isInstructionChunk',
  5057. category: 'testing',
  5058. fn: function (){
  5059. var self=this;
  5060. return false;
  5061. return self;},
  5062. source: unescape('isInstructionChunk%0A%09%5Efalse%0A')}),
  5063. smalltalk.Chunk);
  5064. smalltalk.addClass('InstructionChunk', smalltalk.Chunk, [], 'Parser');
  5065. smalltalk.addMethod(
  5066. '_isInstructionChunk',
  5067. smalltalk.method({
  5068. selector: 'isInstructionChunk',
  5069. category: 'testing',
  5070. fn: function (){
  5071. var self=this;
  5072. return true;
  5073. return self;},
  5074. source: unescape('isInstructionChunk%0A%09%5Etrue%0A')}),
  5075. smalltalk.InstructionChunk);
  5076. smalltalk.addClass('EmptyChunk', smalltalk.Chunk, [], 'Parser');
  5077. smalltalk.addMethod(
  5078. '_isEmptyChunk',
  5079. smalltalk.method({
  5080. selector: 'isEmptyChunk',
  5081. category: 'testing',
  5082. fn: function (){
  5083. var self=this;
  5084. return true;
  5085. return self;},
  5086. source: unescape('isEmptyChunk%0A%09%5Etrue%0A')}),
  5087. smalltalk.EmptyChunk);
  5088. smalltalk.addClass('ChunkParser', smalltalk.Object, ['parser', 'separator', 'eof', 'ws', 'chunk', 'emptyChunk', 'instructionChunk'], 'Parser');
  5089. smalltalk.addMethod(
  5090. '_parser',
  5091. smalltalk.method({
  5092. selector: 'parser',
  5093. category: 'accessing',
  5094. fn: function (){
  5095. var self=this;
  5096. return self['@parser']._ifNil_((function(){return self['@parser']=self._instructionChunk().__slash(self._emptyChunk()).__slash(self._chunk()).__slash(self._eof());}));
  5097. return self;},
  5098. source: unescape('parser%0A%09%5Eparser%20ifNil%3A%20%5B%0A%09%20%20%20%20parser%20%3A%3D%20self%20instructionChunk%20/%20self%20emptyChunk%20/%20self%20chunk%20/%20self%20eof%5D%0A')}),
  5099. smalltalk.ChunkParser);
  5100. smalltalk.addMethod(
  5101. '_eof',
  5102. smalltalk.method({
  5103. selector: 'eof',
  5104. category: 'accessing',
  5105. fn: function (){
  5106. var self=this;
  5107. return self['@eof']._ifNil_((function(){return self['@eof']=self._ws().__comma(smalltalk.PPEOFParser._new()).__eq_eq_gt((function(node){return nil;}));}));
  5108. return self;},
  5109. source: unescape('eof%0A%09%5Eeof%20ifNil%3A%20%5Beof%20%3A%3D%20self%20ws%2C%20PPEOFParser%20new%20%3D%3D%3E%20%5B%3Anode%20%7C%20nil%5D%5D%0A')}),
  5110. smalltalk.ChunkParser);
  5111. smalltalk.addMethod(
  5112. '_separator',
  5113. smalltalk.method({
  5114. selector: 'separator',
  5115. category: 'accessing',
  5116. fn: function (){
  5117. var self=this;
  5118. return self['@separator']._ifNil_((function(){return self['@separator']=smalltalk.String._cr().__comma(smalltalk.String._space()).__comma(smalltalk.String._lf()).__comma(smalltalk.String._tab())._asChoiceParser();}));
  5119. return self;},
  5120. source: unescape('separator%0A%09%5Eseparator%20ifNil%3A%20%5Bseparator%20%3A%3D%20%28String%20cr%2C%20String%20space%2C%20String%20lf%2C%20String%20tab%29%20asChoiceParser%5D%0A')}),
  5121. smalltalk.ChunkParser);
  5122. smalltalk.addMethod(
  5123. '_ws',
  5124. smalltalk.method({
  5125. selector: 'ws',
  5126. category: 'accessing',
  5127. fn: function (){
  5128. var self=this;
  5129. return self['@ws']._ifNil_((function(){return self['@ws']=self._separator()._star();}));
  5130. return self;},
  5131. source: unescape('ws%0A%09%5Ews%20ifNil%3A%20%5Bws%20%3A%3D%20self%20separator%20star%5D%0A')}),
  5132. smalltalk.ChunkParser);
  5133. smalltalk.addMethod(
  5134. '_chunk',
  5135. smalltalk.method({
  5136. selector: 'chunk',
  5137. category: 'accessing',
  5138. fn: function (){
  5139. var self=this;
  5140. return self['@chunk']._ifNil_((function(){return self['@chunk']=self._ws().__comma(unescape("%21%21")._asParser().__slash(unescape("%21")._asParser()._not().__comma(smalltalk.PPAnyParser._new()))._plus()._flatten()).__comma(unescape("%21")._asParser()).__eq_eq_gt((function(node){return smalltalk.Chunk._new()._contents_(node._second()._replace_with_(unescape("%21%21"),unescape("%21")));}));}));
  5141. return self;},
  5142. source: unescape('chunk%0A%09%5Echunk%20ifNil%3A%20%5Bchunk%20%3A%3D%20self%20ws%2C%20%28%27%21%21%27%20asParser%20/%20%28%27%21%27%20asParser%20not%2C%20PPAnyParser%20new%29%29%20plus%20flatten%2C%20%27%21%27%20asParser%20%3D%3D%3E%20%5B%3Anode%20%7C%20Chunk%20new%20contents%3A%20%28node%20second%20replace%3A%20%27%21%21%27%20with%3A%20%27%21%27%29%5D%5D%0A')}),
  5143. smalltalk.ChunkParser);
  5144. smalltalk.addMethod(
  5145. '_emptyChunk',
  5146. smalltalk.method({
  5147. selector: 'emptyChunk',
  5148. category: 'accessing',
  5149. fn: function (){
  5150. var self=this;
  5151. return self['@emptyChunk']._ifNil_((function(){return self['@emptyChunk']=self._separator()._plus().__comma(unescape("%21")._asParser()).__comma(self._ws()).__eq_eq_gt((function(node){return smalltalk.EmptyChunk._new();}));}));
  5152. return self;},
  5153. source: unescape('emptyChunk%0A%09%5EemptyChunk%20ifNil%3A%20%5BemptyChunk%20%3A%3D%20self%20separator%20plus%2C%20%27%21%27%20asParser%2C%20self%20ws%20%3D%3D%3E%20%5B%3Anode%20%7C%20EmptyChunk%20new%5D%5D%0A')}),
  5154. smalltalk.ChunkParser);
  5155. smalltalk.addMethod(
  5156. '_instructionChunk',
  5157. smalltalk.method({
  5158. selector: 'instructionChunk',
  5159. category: '',
  5160. fn: function (){
  5161. var self=this;
  5162. return self['@instructionChunk']._ifNil_((function(){return self['@instructionChunk']=self._ws().__comma(unescape("%21")._asParser()).__comma(self._chunk()).__eq_eq_gt((function(node){return smalltalk.InstructionChunk._new()._contents_(node._last()._contents());}));}));
  5163. return self;},
  5164. source: unescape('instructionChunk%0A%09%5EinstructionChunk%20ifNil%3A%20%5B%0A%09%20%20%20%20instructionChunk%20%3A%3D%20self%20ws%2C%20%27%21%27%20asParser%2C%20self%20chunk%0A%09%20%20%20%20%3D%3D%3E%20%5B%3Anode%20%7C%20InstructionChunk%20new%20contents%3A%20node%20last%20contents%5D%5D%0A')}),
  5165. smalltalk.ChunkParser);
  5166. smalltalk.addClass('Importer', smalltalk.Object, ['chunkParser'], 'Parser');
  5167. smalltalk.addMethod(
  5168. '_chunkParser',
  5169. smalltalk.method({
  5170. selector: 'chunkParser',
  5171. category: 'accessing',
  5172. fn: function (){
  5173. var self=this;
  5174. return self['@chunkParser']._ifNil_((function(){return self['@chunkParser']=smalltalk.ChunkParser._new()._parser();}));
  5175. return self;},
  5176. source: unescape('chunkParser%0A%09%5EchunkParser%20ifNil%3A%20%5BchunkParser%20%3A%3D%20ChunkParser%20new%20parser%5D%0A')}),
  5177. smalltalk.Importer);
  5178. smalltalk.addMethod(
  5179. '_import_',
  5180. smalltalk.method({
  5181. selector: 'import:',
  5182. category: 'fileIn',
  5183. fn: function (aStream){
  5184. var self=this;
  5185. aStream._atEnd()._ifFalse_((function(){var nextChunk=nil;
  5186. nextChunk=self._chunkParser()._parse_(aStream);return nextChunk._ifNotNil_((function(){nextChunk._isInstructionChunk()._ifTrue_ifFalse_((function(){return smalltalk.Compiler._new()._loadExpression_(nextChunk._contents())._scanFrom_(aStream);}),(function(){return smalltalk.Compiler._new()._loadExpression_(nextChunk._contents());}));return self._import_(aStream);}));}));
  5187. return self;},
  5188. source: unescape('import%3A%20aStream%0A%09aStream%20atEnd%20ifFalse%3A%20%5B%0A%09%20%20%20%20%7C%20nextChunk%20%7C%0A%09%20%20%20%20nextChunk%20%3A%3D%20self%20chunkParser%20parse%3A%20aStream.%0A%09%20%20%20%20nextChunk%20ifNotNil%3A%20%5B%0A%09%09nextChunk%20isInstructionChunk%20%0A%09%09%20%20%20%20ifTrue%3A%20%5B%28Compiler%20new%20loadExpression%3A%20nextChunk%20contents%29%0A%09%09%09%09%09%20scanFrom%3A%20aStream%5D%0A%09%09%20%20%20%20ifFalse%3A%20%5BCompiler%20new%20loadExpression%3A%20nextChunk%20contents%5D.%0A%09%09self%20import%3A%20aStream%5D%5D%0A')}),
  5189. smalltalk.Importer);
  5190. smalltalk.addClass('Exporter', smalltalk.Object, [], 'Parser');
  5191. smalltalk.addMethod(
  5192. '_exportCategory_',
  5193. smalltalk.method({
  5194. selector: 'exportCategory:',
  5195. category: 'fileout',
  5196. fn: function (aString){
  5197. var self=this;
  5198. var stream=nil;
  5199. stream=""._writeStream();
  5200. smalltalk.Smalltalk._current()._classes()._select_((function(each){return each._category().__eq(aString);}))._do_((function(each){return stream._nextPutAll_(self._export_(each));}));
  5201. return stream._contents();
  5202. return self;},
  5203. source: unescape('exportCategory%3A%20aString%0A%09%7C%20stream%20%7C%0A%09stream%20%3A%3D%20%27%27%20writeStream.%0A%09%28Smalltalk%20current%20classes%20%0A%09%20%20%20%20select%3A%20%5B%3Aeach%20%7C%20each%20category%20%3D%20aString%5D%29%0A%09%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20stream%20nextPutAll%3A%20%28self%20export%3A%20each%29%5D.%0A%09%5Estream%20contents%0A')}),
  5204. smalltalk.Exporter);
  5205. smalltalk.addMethod(
  5206. '_export_',
  5207. smalltalk.method({
  5208. selector: 'export:',
  5209. category: 'fileOut',
  5210. fn: function (aClass){
  5211. var self=this;
  5212. var stream=nil;
  5213. stream=""._writeStream();
  5214. self._exportDefinitionOf_on_(aClass,stream);
  5215. stream._nextPutAll_(smalltalk.String._cr());
  5216. self._exportMethodsOf_on_(aClass,stream);
  5217. stream._nextPutAll_(smalltalk.String._cr());
  5218. self._exportMetaDefinitionOf_on_(aClass,stream);
  5219. self._exportMethodsOf_on_(aClass._class(),stream);
  5220. stream._nextPutAll_(smalltalk.String._cr());
  5221. return stream._contents();
  5222. return self;},
  5223. source: unescape('export%3A%20aClass%0A%09%7C%20stream%20%7C%0A%09stream%20%3A%3D%20%27%27%20writeStream.%0A%09self%20exportDefinitionOf%3A%20aClass%20on%3A%20stream.%0A%09stream%20nextPutAll%3A%20String%20cr.%0A%09self%20exportMethodsOf%3A%20aClass%20on%3A%20stream.%0A%09stream%20nextPutAll%3A%20String%20cr.%0A%09self%20exportMetaDefinitionOf%3A%20aClass%20on%3A%20stream.%0A%09self%20exportMethodsOf%3A%20aClass%20class%20on%3A%20stream.%0A%09stream%20nextPutAll%3A%20String%20cr.%0A%09%5Estream%20contents%0A')}),
  5224. smalltalk.Exporter);
  5225. smalltalk.addMethod(
  5226. '_exportDefinitionOf_on_',
  5227. smalltalk.method({
  5228. selector: 'exportDefinitionOf:on:',
  5229. category: 'private',
  5230. fn: function (aClass, aStream){
  5231. var self=this;
  5232. (function($rec){$rec._nextPutAll_(unescape("smalltalk.addClass%28"));$rec._nextPutAll_(unescape("%27").__comma(self._classNameFor_(aClass)).__comma(unescape("%27%2C%20")));$rec._nextPutAll_("smalltalk.".__comma(self._classNameFor_(aClass._superclass())));return $rec._nextPutAll_(unescape("%2C%20%5B"));})(aStream);
  5233. aClass._instVarNames()._do_separatedBy_((function(each){return aStream._nextPutAll_(unescape("%27").__comma(each).__comma(unescape("%27")));}),(function(){return aStream._nextPutAll_(unescape("%2C%20"));}));
  5234. (function($rec){$rec._nextPutAll_(unescape("%5D%2C%20%27"));$rec._nextPutAll_(aClass._category().__comma(unescape("%27")));return $rec._nextPutAll_(unescape("%29%3B"));})(aStream);
  5235. aClass._comment()._notEmpty()._ifTrue_((function(){return (function($rec){$rec._nextPutAll_(smalltalk.String._cr());$rec._nextPutAll_("smalltalk.");$rec._nextPutAll_(self._classNameFor_(aClass));$rec._nextPutAll_(unescape(".comment%3D"));return $rec._nextPutAll_(unescape("unescape%28%27").__comma(aClass._comment()._escaped()).__comma(unescape("%27%29")));})(aStream);}));
  5236. return self;},
  5237. source: unescape('exportDefinitionOf%3A%20aClass%20on%3A%20aStream%0A%09aStream%20%0A%09%20%20%20%20nextPutAll%3A%20%27smalltalk.addClass%28%27%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%27%27%27%2C%20%28self%20classNameFor%3A%20aClass%29%2C%20%27%27%27%2C%20%27%3B%0A%09%20%20%20%20nextPutAll%3A%20%27smalltalk.%27%2C%20%28self%20classNameFor%3A%20aClass%20superclass%29%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%2C%20%5B%27.%0A%09aClass%20instVarNames%20%0A%09%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20aStream%20nextPutAll%3A%20%27%27%27%27%2C%20each%2C%20%27%27%27%27%5D%0A%09%20%20%20%20separatedBy%3A%20%5BaStream%20nextPutAll%3A%20%27%2C%20%27%5D.%0A%09aStream%09%0A%09%20%20%20%20nextPutAll%3A%20%27%5D%2C%20%27%27%27%3B%0A%09%20%20%20%20nextPutAll%3A%20aClass%20category%2C%20%27%27%27%27%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%29%3B%27.%0A%09aClass%20comment%20notEmpty%20ifTrue%3A%20%5B%0A%09%20%20%20%20aStream%20%0A%09%20%20%20%20%09nextPutAll%3A%20String%20cr%3B%0A%09%09nextPutAll%3A%20%27smalltalk.%27%3B%0A%09%09nextPutAll%3A%20%28self%20classNameFor%3A%20aClass%29%3B%0A%09%09nextPutAll%3A%20%27.comment%3D%27%3B%0A%09%09nextPutAll%3A%20%27unescape%28%27%27%27%2C%20aClass%20comment%20escaped%2C%20%27%27%27%29%27%5D%0A')}),
  5238. smalltalk.Exporter);
  5239. smalltalk.addMethod(
  5240. '_exportMetaDefinitionOf_on_',
  5241. smalltalk.method({
  5242. selector: 'exportMetaDefinitionOf:on:',
  5243. category: 'private',
  5244. fn: function (aClass, aStream){
  5245. var self=this;
  5246. aClass._class()._instVarNames()._isEmpty()._ifFalse_((function(){(function($rec){$rec._nextPutAll_("smalltalk.".__comma(self._classNameFor_(aClass._class())));return $rec._nextPutAll_(unescape(".iVarNames%20%3D%20%5B"));})(aStream);aClass._class()._instVarNames()._do_separatedBy_((function(each){return aStream._nextPutAll_(unescape("%27").__comma(each).__comma(unescape("%27")));}),(function(){return aStream._nextPutAll_(unescape("%2C"));}));return aStream._nextPutAll_(unescape("%5D%3B").__comma(smalltalk.String._cr()));}));
  5247. return self;},
  5248. source: unescape('exportMetaDefinitionOf%3A%20aClass%20on%3A%20aStream%0A%09aClass%20class%20instVarNames%20isEmpty%20ifFalse%3A%20%5B%0A%09%20%20%20%20aStream%20%0A%09%09nextPutAll%3A%20%27smalltalk.%27%2C%20%28self%20classNameFor%3A%20aClass%20class%29%3B%0A%09%09nextPutAll%3A%20%27.iVarNames%20%3D%20%5B%27.%0A%09%20%20%20%20aClass%20class%20instVarNames%0A%09%09do%3A%20%5B%3Aeach%20%7C%20aStream%20nextPutAll%3A%20%27%27%27%27%2C%20each%2C%20%27%27%27%27%5D%0A%09%09separatedBy%3A%20%5BaStream%20nextPutAll%3A%20%27%2C%27%5D.%0A%09%20%20%20%20aStream%20nextPutAll%3A%20%27%5D%3B%27%2C%20String%20cr%5D%0A')}),
  5249. smalltalk.Exporter);
  5250. smalltalk.addMethod(
  5251. '_exportMethodsOf_on_',
  5252. smalltalk.method({
  5253. selector: 'exportMethodsOf:on:',
  5254. category: 'private',
  5255. fn: function (aClass, aStream){
  5256. var self=this;
  5257. aClass._methodDictionary()._keysAndValuesDo_((function(key, value){return (function($rec){$rec._nextPutAll_(unescape("smalltalk.addMethod%28").__comma(smalltalk.String._cr()));$rec._nextPutAll_(unescape("%27").__comma(value._selector()._asSelector()).__comma(unescape("%27%2C")).__comma(smalltalk.String._cr()));$rec._nextPutAll_(unescape("smalltalk.method%28%7B").__comma(smalltalk.String._cr()));$rec._nextPutAll_(unescape("selector%3A%20%27").__comma(value._selector()).__comma(unescape("%27%2C")).__comma(smalltalk.String._cr()));$rec._nextPutAll_(unescape("category%3A%20%27").__comma(value._category()).__comma(unescape("%27%2C")).__comma(smalltalk.String._cr()));$rec._nextPutAll_("fn: ".__comma(value._fn()._compiledSource()).__comma(unescape("%2C")).__comma(smalltalk.String._cr()));$rec._nextPutAll_(unescape("source%3A%20unescape%28%27").__comma(value._source()._escaped()).__comma(unescape("%27%29")));$rec._nextPutAll_(unescape("%7D%29%2C").__comma(smalltalk.String._cr()));$rec._nextPutAll_("smalltalk.".__comma(self._classNameFor_(aClass)));return $rec._nextPutAll_(unescape("%29%3B").__comma(smalltalk.String._cr()).__comma(smalltalk.String._cr()));})(aStream);}));
  5258. return self;},
  5259. source: unescape('exportMethodsOf%3A%20aClass%20on%3A%20aStream%0A%09aClass%20methodDictionary%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%09%20%20%20%20aStream%20%0A%09%09nextPutAll%3A%20%27smalltalk.addMethod%28%27%2C%20String%20cr%3B%0A%09%09nextPutAll%3A%20%27%27%27%27%2C%20value%20selector%20asSelector%2C%20%27%27%27%2C%27%2C%20String%20cr%3B%0A%09%09nextPutAll%3A%20%27smalltalk.method%28%7B%27%2C%20String%20cr%3B%0A%09%09nextPutAll%3A%20%27selector%3A%20%27%27%27%2C%20value%20selector%2C%20%27%27%27%2C%27%2C%20String%20cr%3B%0A%09%09nextPutAll%3A%20%27category%3A%20%27%27%27%2C%20value%20category%2C%20%27%27%27%2C%27%2C%20String%20cr%3B%0A%09%09nextPutAll%3A%20%27fn%3A%20%27%2C%20value%20fn%20compiledSource%2C%20%27%2C%27%2C%20String%20cr%3B%0A%09%09nextPutAll%3A%20%27source%3A%20unescape%28%27%27%27%2C%20value%20source%20escaped%2C%20%27%27%27%29%27%3B%0A%09%09nextPutAll%3A%20%27%7D%29%2C%27%2C%20String%20cr%3B%0A%09%09nextPutAll%3A%20%27smalltalk.%27%2C%20%28self%20classNameFor%3A%20aClass%29%3B%0A%09%09nextPutAll%3A%20%27%29%3B%27%2C%20String%20cr%2C%20String%20cr%5D%0A')}),
  5260. smalltalk.Exporter);
  5261. smalltalk.addMethod(
  5262. '_classNameFor_',
  5263. smalltalk.method({
  5264. selector: 'classNameFor:',
  5265. category: 'private',
  5266. fn: function (aClass){
  5267. var self=this;
  5268. return aClass._isMetaclass()._ifTrue_ifFalse_((function(){return aClass._instanceClass()._name().__comma(".klass");}),(function(){return aClass._isNil()._ifTrue_ifFalse_((function(){return "nil";}),(function(){return aClass._name();}));}));
  5269. return self;},
  5270. source: unescape('classNameFor%3A%20aClass%0A%09%5EaClass%20isMetaclass%0A%09%20%20%20%20ifTrue%3A%20%5BaClass%20instanceClass%20name%2C%20%27.klass%27%5D%0A%09%20%20%20%20ifFalse%3A%20%5B%0A%09%09aClass%20isNil%0A%09%09%20%20%20%20ifTrue%3A%20%5B%27nil%27%5D%0A%09%09%20%20%20%20ifFalse%3A%20%5BaClass%20name%5D%5D%0A')}),
  5271. smalltalk.Exporter);
  5272. smalltalk.addClass('Node', smalltalk.Object, ['nodes'], 'Compiler');
  5273. smalltalk.addMethod(
  5274. '_nodes',
  5275. smalltalk.method({
  5276. selector: 'nodes',
  5277. category: 'accessing',
  5278. fn: function (){
  5279. var self=this;
  5280. return self['@nodes']._ifNil_((function(){return self['@nodes']=smalltalk.Array._new();}));
  5281. return self;},
  5282. source: unescape('nodes%0A%09%5Enodes%20ifNil%3A%20%5Bnodes%20%3A%3D%20Array%20new%5D%0A')}),
  5283. smalltalk.Node);
  5284. smalltalk.addMethod(
  5285. '_nodes_',
  5286. smalltalk.method({
  5287. selector: 'nodes:',
  5288. category: 'building',
  5289. fn: function (aCollection){
  5290. var self=this;
  5291. self['@nodes']=aCollection;
  5292. return self;},
  5293. source: unescape('nodes%3A%20aCollection%0A%09nodes%20%3A%3D%20aCollection%0A')}),
  5294. smalltalk.Node);
  5295. smalltalk.addMethod(
  5296. '_addNode_',
  5297. smalltalk.method({
  5298. selector: 'addNode:',
  5299. category: 'accessing',
  5300. fn: function (aNode){
  5301. var self=this;
  5302. self._nodes()._add_(aNode);
  5303. return self;},
  5304. source: unescape('addNode%3A%20aNode%0A%09self%20nodes%20add%3A%20aNode%0A')}),
  5305. smalltalk.Node);
  5306. smalltalk.addMethod(
  5307. '_accept_',
  5308. smalltalk.method({
  5309. selector: 'accept:',
  5310. category: 'visiting',
  5311. fn: function (aVisitor){
  5312. var self=this;
  5313. aVisitor._visitNode_(self);
  5314. return self;},
  5315. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitNode%3A%20self%0A')}),
  5316. smalltalk.Node);
  5317. smalltalk.addClass('MethodNode', smalltalk.Node, ['selector', 'arguments', 'source'], 'Compiler');
  5318. smalltalk.addMethod(
  5319. '_selector',
  5320. smalltalk.method({
  5321. selector: 'selector',
  5322. category: 'accessing',
  5323. fn: function (){
  5324. var self=this;
  5325. return self['@selector'];
  5326. return self;},
  5327. source: unescape('selector%0A%09%5Eselector%0A')}),
  5328. smalltalk.MethodNode);
  5329. smalltalk.addMethod(
  5330. '_selector_',
  5331. smalltalk.method({
  5332. selector: 'selector:',
  5333. category: 'accessing',
  5334. fn: function (aString){
  5335. var self=this;
  5336. self['@selector']=aString;
  5337. return self;},
  5338. source: unescape('selector%3A%20aString%0A%09selector%20%3A%3D%20aString%0A')}),
  5339. smalltalk.MethodNode);
  5340. smalltalk.addMethod(
  5341. '_arguments',
  5342. smalltalk.method({
  5343. selector: 'arguments',
  5344. category: 'accessing',
  5345. fn: function (){
  5346. var self=this;
  5347. return self['@arguments']._ifNil_((function(){return [];}));
  5348. return self;},
  5349. source: unescape('arguments%0A%09%5Earguments%20ifNil%3A%20%5B%23%28%29%5D%0A')}),
  5350. smalltalk.MethodNode);
  5351. smalltalk.addMethod(
  5352. '_arguments_',
  5353. smalltalk.method({
  5354. selector: 'arguments:',
  5355. category: 'accessing',
  5356. fn: function (aCollection){
  5357. var self=this;
  5358. self['@arguments']=aCollection;
  5359. return self;},
  5360. source: unescape('arguments%3A%20aCollection%0A%09arguments%20%3A%3D%20aCollection%0A')}),
  5361. smalltalk.MethodNode);
  5362. smalltalk.addMethod(
  5363. '_source',
  5364. smalltalk.method({
  5365. selector: 'source',
  5366. category: 'accessing',
  5367. fn: function (){
  5368. var self=this;
  5369. return self['@source'];
  5370. return self;},
  5371. source: unescape('source%0A%09%5Esource%0A')}),
  5372. smalltalk.MethodNode);
  5373. smalltalk.addMethod(
  5374. '_source_',
  5375. smalltalk.method({
  5376. selector: 'source:',
  5377. category: 'accessing',
  5378. fn: function (aString){
  5379. var self=this;
  5380. self['@source']=aString;
  5381. return self;},
  5382. source: unescape('source%3A%20aString%0A%09source%20%3A%3D%20aString%0A')}),
  5383. smalltalk.MethodNode);
  5384. smalltalk.addMethod(
  5385. '_accept_',
  5386. smalltalk.method({
  5387. selector: 'accept:',
  5388. category: 'visiting',
  5389. fn: function (aVisitor){
  5390. var self=this;
  5391. aVisitor._visitMethodNode_(self);
  5392. return self;},
  5393. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitMethodNode%3A%20self%0A')}),
  5394. smalltalk.MethodNode);
  5395. smalltalk.addClass('SendNode', smalltalk.Node, ['selector', 'arguments', 'receiver'], 'Compiler');
  5396. smalltalk.addMethod(
  5397. '_selector',
  5398. smalltalk.method({
  5399. selector: 'selector',
  5400. category: 'accessing',
  5401. fn: function (){
  5402. var self=this;
  5403. return self['@selector'];
  5404. return self;},
  5405. source: unescape('selector%0A%09%5Eselector%0A')}),
  5406. smalltalk.SendNode);
  5407. smalltalk.addMethod(
  5408. '_selector_',
  5409. smalltalk.method({
  5410. selector: 'selector:',
  5411. category: 'accessing',
  5412. fn: function (aString){
  5413. var self=this;
  5414. self['@selector']=aString;
  5415. return self;},
  5416. source: unescape('selector%3A%20aString%0A%09selector%20%3A%3D%20aString%0A')}),
  5417. smalltalk.SendNode);
  5418. smalltalk.addMethod(
  5419. '_arguments',
  5420. smalltalk.method({
  5421. selector: 'arguments',
  5422. category: 'accessing',
  5423. fn: function (){
  5424. var self=this;
  5425. return self['@arguments']._ifNil_((function(){return self['@arguments']=[];}));
  5426. return self;},
  5427. source: unescape('arguments%0A%09%5Earguments%20ifNil%3A%20%5Barguments%20%3A%3D%20%23%28%29%5D%0A')}),
  5428. smalltalk.SendNode);
  5429. smalltalk.addMethod(
  5430. '_arguments_',
  5431. smalltalk.method({
  5432. selector: 'arguments:',
  5433. category: 'accessing',
  5434. fn: function (aCollection){
  5435. var self=this;
  5436. self['@arguments']=aCollection;
  5437. return self;},
  5438. source: unescape('arguments%3A%20aCollection%0A%09arguments%20%3A%3D%20aCollection%0A')}),
  5439. smalltalk.SendNode);
  5440. smalltalk.addMethod(
  5441. '_receiver',
  5442. smalltalk.method({
  5443. selector: 'receiver',
  5444. category: 'accessing',
  5445. fn: function (){
  5446. var self=this;
  5447. return self['@receiver'];
  5448. return self;},
  5449. source: unescape('receiver%0A%09%5Ereceiver%0A')}),
  5450. smalltalk.SendNode);
  5451. smalltalk.addMethod(
  5452. '_receiver_',
  5453. smalltalk.method({
  5454. selector: 'receiver:',
  5455. category: 'accessing',
  5456. fn: function (aNode){
  5457. var self=this;
  5458. self['@receiver']=aNode;
  5459. return self;},
  5460. source: unescape('receiver%3A%20aNode%0A%09receiver%20%3A%3D%20aNode%0A')}),
  5461. smalltalk.SendNode);
  5462. smalltalk.addMethod(
  5463. '_valueForReceiver_',
  5464. smalltalk.method({
  5465. selector: 'valueForReceiver:',
  5466. category: 'accessing',
  5467. fn: function (anObject){
  5468. var self=this;
  5469. return (function($rec){$rec._receiver_(self._receiver()._ifNil_ifNotNil_((function(){return anObject;}),(function(){return self._receiver()._valueForReceiver_(anObject);})));$rec._selector_(self._selector());$rec._arguments_(self._arguments());return $rec._yourself();})(smalltalk.SendNode._new());
  5470. return self;},
  5471. source: unescape('valueForReceiver%3A%20anObject%0A%09%5ESendNode%20new%0A%09%20%20%20%20receiver%3A%20%28self%20receiver%20%0A%09%09ifNil%3A%20%5BanObject%5D%0A%09%09ifNotNil%3A%20%5Bself%20receiver%20valueForReceiver%3A%20anObject%5D%29%3B%0A%09%20%20%20%20selector%3A%20self%20selector%3B%0A%09%20%20%20%20arguments%3A%20self%20arguments%3B%0A%09%20%20%20%20yourself%0A')}),
  5472. smalltalk.SendNode);
  5473. smalltalk.addMethod(
  5474. '_cascadeNodeWithMessages_',
  5475. smalltalk.method({
  5476. selector: 'cascadeNodeWithMessages:',
  5477. category: 'accessing',
  5478. fn: function (aCollection){
  5479. var self=this;
  5480. var first=nil;
  5481. first=(function($rec){$rec._selector_(self._selector());$rec._arguments_(self._arguments());return $rec._yourself();})(smalltalk.SendNode._new());
  5482. return (function($rec){$rec._receiver_(self._receiver());$rec._nodes_(smalltalk.Array._with_(first).__comma(aCollection));return $rec._yourself();})(smalltalk.CascadeNode._new());
  5483. return self;},
  5484. source: unescape('cascadeNodeWithMessages%3A%20aCollection%0A%09%7C%20first%20%7C%0A%09first%20%3A%3D%20SendNode%20new%0A%09%20%20%20%20selector%3A%20self%20selector%3B%0A%09%20%20%20%20arguments%3A%20self%20arguments%3B%0A%09%20%20%20%20yourself.%0A%09%5ECascadeNode%20new%0A%09%20%20%20%20receiver%3A%20self%20receiver%3B%0A%09%20%20%20%20nodes%3A%20%28Array%20with%3A%20first%29%2C%20aCollection%3B%0A%09%20%20%20%20yourself%0A')}),
  5485. smalltalk.SendNode);
  5486. smalltalk.addMethod(
  5487. '_accept_',
  5488. smalltalk.method({
  5489. selector: 'accept:',
  5490. category: 'visiting',
  5491. fn: function (aVisitor){
  5492. var self=this;
  5493. aVisitor._visitSendNode_(self);
  5494. return self;},
  5495. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitSendNode%3A%20self%0A')}),
  5496. smalltalk.SendNode);
  5497. smalltalk.addClass('CascadeNode', smalltalk.Node, ['receiver'], 'Compiler');
  5498. smalltalk.addMethod(
  5499. '_receiver',
  5500. smalltalk.method({
  5501. selector: 'receiver',
  5502. category: 'accessing',
  5503. fn: function (){
  5504. var self=this;
  5505. return self['@receiver'];
  5506. return self;},
  5507. source: unescape('receiver%0A%09%5Ereceiver%0A')}),
  5508. smalltalk.CascadeNode);
  5509. smalltalk.addMethod(
  5510. '_receiver_',
  5511. smalltalk.method({
  5512. selector: 'receiver:',
  5513. category: 'accessing',
  5514. fn: function (aNode){
  5515. var self=this;
  5516. self['@receiver']=aNode;
  5517. return self;},
  5518. source: unescape('receiver%3A%20aNode%0A%09receiver%20%3A%3D%20aNode%0A')}),
  5519. smalltalk.CascadeNode);
  5520. smalltalk.addMethod(
  5521. '_accept_',
  5522. smalltalk.method({
  5523. selector: 'accept:',
  5524. category: 'visiting',
  5525. fn: function (aVisitor){
  5526. var self=this;
  5527. aVisitor._visitCascadeNode_(self);
  5528. return self;},
  5529. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitCascadeNode%3A%20self%0A')}),
  5530. smalltalk.CascadeNode);
  5531. smalltalk.addClass('AssignmentNode', smalltalk.Node, ['left', 'right'], 'Compiler');
  5532. smalltalk.addMethod(
  5533. '_left',
  5534. smalltalk.method({
  5535. selector: 'left',
  5536. category: 'accessing',
  5537. fn: function (){
  5538. var self=this;
  5539. return self['@left'];
  5540. return self;},
  5541. source: unescape('left%0A%09%5Eleft%0A')}),
  5542. smalltalk.AssignmentNode);
  5543. smalltalk.addMethod(
  5544. '_left_',
  5545. smalltalk.method({
  5546. selector: 'left:',
  5547. category: 'accessing',
  5548. fn: function (aNode){
  5549. var self=this;
  5550. self['@left']=aNode;
  5551. return self;},
  5552. source: unescape('left%3A%20aNode%0A%09left%20%3A%3D%20aNode%0A')}),
  5553. smalltalk.AssignmentNode);
  5554. smalltalk.addMethod(
  5555. '_right',
  5556. smalltalk.method({
  5557. selector: 'right',
  5558. category: 'accessing',
  5559. fn: function (){
  5560. var self=this;
  5561. return self['@right'];
  5562. return self;},
  5563. source: unescape('right%0A%09%5Eright%0A')}),
  5564. smalltalk.AssignmentNode);
  5565. smalltalk.addMethod(
  5566. '_right_',
  5567. smalltalk.method({
  5568. selector: 'right:',
  5569. category: 'accessing',
  5570. fn: function (aNode){
  5571. var self=this;
  5572. self['@right']=aNode;
  5573. return self;},
  5574. source: unescape('right%3A%20aNode%0A%09right%20%3A%3D%20aNode%0A')}),
  5575. smalltalk.AssignmentNode);
  5576. smalltalk.addMethod(
  5577. '_accept_',
  5578. smalltalk.method({
  5579. selector: 'accept:',
  5580. category: 'visiting',
  5581. fn: function (aVisitor){
  5582. var self=this;
  5583. aVisitor._visitAssignmentNode_(self);
  5584. return self;},
  5585. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitAssignmentNode%3A%20self%0A')}),
  5586. smalltalk.AssignmentNode);
  5587. smalltalk.addClass('BlockNode', smalltalk.Node, ['parameters'], 'Compiler');
  5588. smalltalk.addMethod(
  5589. '_parameters',
  5590. smalltalk.method({
  5591. selector: 'parameters',
  5592. category: 'accessing',
  5593. fn: function (){
  5594. var self=this;
  5595. return self['@parameters']._ifNil_((function(){return self['@parameters']=smalltalk.Array._new();}));
  5596. return self;},
  5597. source: unescape('parameters%0A%09%5Eparameters%20ifNil%3A%20%5Bparameters%20%3A%3D%20Array%20new%5D%0A')}),
  5598. smalltalk.BlockNode);
  5599. smalltalk.addMethod(
  5600. '_parameters_',
  5601. smalltalk.method({
  5602. selector: 'parameters:',
  5603. category: 'accessing',
  5604. fn: function (aCollection){
  5605. var self=this;
  5606. self['@parameters']=aCollection;
  5607. return self;},
  5608. source: unescape('parameters%3A%20aCollection%0A%09parameters%20%3A%3D%20aCollection%0A')}),
  5609. smalltalk.BlockNode);
  5610. smalltalk.addMethod(
  5611. '_accept_',
  5612. smalltalk.method({
  5613. selector: 'accept:',
  5614. category: 'visiting',
  5615. fn: function (aVisitor){
  5616. var self=this;
  5617. aVisitor._visitBlockNode_(self);
  5618. return self;},
  5619. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitBlockNode%3A%20self%0A')}),
  5620. smalltalk.BlockNode);
  5621. smalltalk.addClass('SequenceNode', smalltalk.Node, ['temps'], 'Compiler');
  5622. smalltalk.addMethod(
  5623. '_temps',
  5624. smalltalk.method({
  5625. selector: 'temps',
  5626. category: 'accessing',
  5627. fn: function (){
  5628. var self=this;
  5629. return self['@temps']._ifNil_((function(){return [];}));
  5630. return self;},
  5631. source: unescape('temps%0A%09%5Etemps%20ifNil%3A%20%5B%23%28%29%5D%0A')}),
  5632. smalltalk.SequenceNode);
  5633. smalltalk.addMethod(
  5634. '_temps_',
  5635. smalltalk.method({
  5636. selector: 'temps:',
  5637. category: 'accessing',
  5638. fn: function (aCollection){
  5639. var self=this;
  5640. self['@temps']=aCollection;
  5641. return self;},
  5642. source: unescape('temps%3A%20aCollection%0A%09temps%20%3A%3D%20aCollection%0A')}),
  5643. smalltalk.SequenceNode);
  5644. smalltalk.addMethod(
  5645. '_asBlockSequenceNode',
  5646. smalltalk.method({
  5647. selector: 'asBlockSequenceNode',
  5648. category: 'testing',
  5649. fn: function (){
  5650. var self=this;
  5651. return (function($rec){$rec._nodes_(self._nodes());$rec._temps_(self._temps());return $rec._yourself();})(smalltalk.BlockSequenceNode._new());
  5652. return self;},
  5653. source: unescape('asBlockSequenceNode%0A%09%5EBlockSequenceNode%20new%0A%09%20%20%20%20nodes%3A%20self%20nodes%3B%0A%09%20%20%20%20temps%3A%20self%20temps%3B%0A%09%20%20%20%20yourself%0A')}),
  5654. smalltalk.SequenceNode);
  5655. smalltalk.addMethod(
  5656. '_accept_',
  5657. smalltalk.method({
  5658. selector: 'accept:',
  5659. category: 'visiting',
  5660. fn: function (aVisitor){
  5661. var self=this;
  5662. aVisitor._visitSequenceNode_(self);
  5663. return self;},
  5664. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitSequenceNode%3A%20self%0A')}),
  5665. smalltalk.SequenceNode);
  5666. smalltalk.addClass('BlockSequenceNode', smalltalk.SequenceNode, [], 'Compiler');
  5667. smalltalk.addMethod(
  5668. '_accept_',
  5669. smalltalk.method({
  5670. selector: 'accept:',
  5671. category: 'visiting',
  5672. fn: function (aVisitor){
  5673. var self=this;
  5674. aVisitor._visitBlockSequenceNode_(self);
  5675. return self;},
  5676. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitBlockSequenceNode%3A%20self%0A')}),
  5677. smalltalk.BlockSequenceNode);
  5678. smalltalk.addClass('ReturnNode', smalltalk.Node, [], 'Compiler');
  5679. smalltalk.addMethod(
  5680. '_accept_',
  5681. smalltalk.method({
  5682. selector: 'accept:',
  5683. category: 'visiting',
  5684. fn: function (aVisitor){
  5685. var self=this;
  5686. aVisitor._visitReturnNode_(self);
  5687. return self;},
  5688. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitReturnNode%3A%20self%0A')}),
  5689. smalltalk.ReturnNode);
  5690. smalltalk.addClass('ValueNode', smalltalk.Node, ['value'], 'Compiler');
  5691. smalltalk.addMethod(
  5692. '_value',
  5693. smalltalk.method({
  5694. selector: 'value',
  5695. category: 'accessing',
  5696. fn: function (){
  5697. var self=this;
  5698. return self['@value'];
  5699. return self;},
  5700. source: unescape('value%0A%09%5Evalue%0A')}),
  5701. smalltalk.ValueNode);
  5702. smalltalk.addMethod(
  5703. '_value_',
  5704. smalltalk.method({
  5705. selector: 'value:',
  5706. category: 'accessing',
  5707. fn: function (anObject){
  5708. var self=this;
  5709. self['@value']=anObject;
  5710. return self;},
  5711. source: unescape('value%3A%20anObject%0A%09value%20%3A%3D%20anObject%0A')}),
  5712. smalltalk.ValueNode);
  5713. smalltalk.addMethod(
  5714. '_accept_',
  5715. smalltalk.method({
  5716. selector: 'accept:',
  5717. category: 'visiting',
  5718. fn: function (aVisitor){
  5719. var self=this;
  5720. aVisitor._visitValueNode_(self);
  5721. return self;},
  5722. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitValueNode%3A%20self%0A')}),
  5723. smalltalk.ValueNode);
  5724. smalltalk.addClass('VariableNode', smalltalk.ValueNode, [], 'Compiler');
  5725. smalltalk.addMethod(
  5726. '_accept_',
  5727. smalltalk.method({
  5728. selector: 'accept:',
  5729. category: 'visiting',
  5730. fn: function (aVisitor){
  5731. var self=this;
  5732. aVisitor._visitVariableNode_(self);
  5733. return self;},
  5734. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitVariableNode%3A%20self%0A')}),
  5735. smalltalk.VariableNode);
  5736. smalltalk.addClass('ClassReferenceNode', smalltalk.VariableNode, [], 'Compiler');
  5737. smalltalk.addMethod(
  5738. '_accept_',
  5739. smalltalk.method({
  5740. selector: 'accept:',
  5741. category: 'visiting',
  5742. fn: function (aVisitor){
  5743. var self=this;
  5744. aVisitor._visitClassReferenceNode_(self);
  5745. return self;},
  5746. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitClassReferenceNode%3A%20self%0A')}),
  5747. smalltalk.ClassReferenceNode);
  5748. smalltalk.addClass('JSStatementNode', smalltalk.Node, ['source'], 'Compiler');
  5749. smalltalk.addMethod(
  5750. '_source',
  5751. smalltalk.method({
  5752. selector: 'source',
  5753. category: 'accessing',
  5754. fn: function (){
  5755. var self=this;
  5756. return self['@source']._ifNil_((function(){return "";}));
  5757. return self;},
  5758. source: unescape('source%0A%09%5Esource%20ifNil%3A%20%5B%27%27%5D%0A')}),
  5759. smalltalk.JSStatementNode);
  5760. smalltalk.addMethod(
  5761. '_source_',
  5762. smalltalk.method({
  5763. selector: 'source:',
  5764. category: 'accessing',
  5765. fn: function (aString){
  5766. var self=this;
  5767. self['@source']=aString;
  5768. return self;},
  5769. source: unescape('source%3A%20aString%0A%09source%20%3A%3D%20aString%0A')}),
  5770. smalltalk.JSStatementNode);
  5771. smalltalk.addMethod(
  5772. '_accept_',
  5773. smalltalk.method({
  5774. selector: 'accept:',
  5775. category: 'visiting',
  5776. fn: function (aVisitor){
  5777. var self=this;
  5778. aVisitor._visitJSStatementNode_(self);
  5779. return self;},
  5780. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitJSStatementNode%3A%20self%0A')}),
  5781. smalltalk.JSStatementNode);
  5782. smalltalk.addClass('NodeVisitor', smalltalk.Object, [], 'Compiler');
  5783. smalltalk.addMethod(
  5784. '_visit_',
  5785. smalltalk.method({
  5786. selector: 'visit:',
  5787. category: 'visiting',
  5788. fn: function (aNode){
  5789. var self=this;
  5790. aNode._accept_(self);
  5791. return self;},
  5792. source: unescape('visit%3A%20aNode%0A%09aNode%20accept%3A%20self%0A')}),
  5793. smalltalk.NodeVisitor);
  5794. smalltalk.addMethod(
  5795. '_visitNode_',
  5796. smalltalk.method({
  5797. selector: 'visitNode:',
  5798. category: 'visiting',
  5799. fn: function (aNode){
  5800. var self=this;
  5801. return self;},
  5802. source: unescape('visitNode%3A%20aNode%0A')}),
  5803. smalltalk.NodeVisitor);
  5804. smalltalk.addMethod(
  5805. '_visitMethodNode_',
  5806. smalltalk.method({
  5807. selector: 'visitMethodNode:',
  5808. category: 'visiting',
  5809. fn: function (aNode){
  5810. var self=this;
  5811. self._visitNode_(aNode);
  5812. return self;},
  5813. source: unescape('visitMethodNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  5814. smalltalk.NodeVisitor);
  5815. smalltalk.addMethod(
  5816. '_visitSequenceNode_',
  5817. smalltalk.method({
  5818. selector: 'visitSequenceNode:',
  5819. category: 'visiting',
  5820. fn: function (aNode){
  5821. var self=this;
  5822. self._visitNode_(aNode);
  5823. return self;},
  5824. source: unescape('visitSequenceNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  5825. smalltalk.NodeVisitor);
  5826. smalltalk.addMethod(
  5827. '_visitBlockSequenceNode_',
  5828. smalltalk.method({
  5829. selector: 'visitBlockSequenceNode:',
  5830. category: 'visiting',
  5831. fn: function (aNode){
  5832. var self=this;
  5833. self._visitSequenceNode_(aNode);
  5834. return self;},
  5835. source: unescape('visitBlockSequenceNode%3A%20aNode%0A%09self%20visitSequenceNode%3A%20aNode%0A')}),
  5836. smalltalk.NodeVisitor);
  5837. smalltalk.addMethod(
  5838. '_visitBlockNode_',
  5839. smalltalk.method({
  5840. selector: 'visitBlockNode:',
  5841. category: 'visiting',
  5842. fn: function (aNode){
  5843. var self=this;
  5844. self._visitNode_(aNode);
  5845. return self;},
  5846. source: unescape('visitBlockNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  5847. smalltalk.NodeVisitor);
  5848. smalltalk.addMethod(
  5849. '_visitReturnNode_',
  5850. smalltalk.method({
  5851. selector: 'visitReturnNode:',
  5852. category: 'visiting',
  5853. fn: function (aNode){
  5854. var self=this;
  5855. self._visitNode_(aNode);
  5856. return self;},
  5857. source: unescape('visitReturnNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  5858. smalltalk.NodeVisitor);
  5859. smalltalk.addMethod(
  5860. '_visitSendNode_',
  5861. smalltalk.method({
  5862. selector: 'visitSendNode:',
  5863. category: 'visiting',
  5864. fn: function (aNode){
  5865. var self=this;
  5866. self._visitNode_(aNode);
  5867. return self;},
  5868. source: unescape('visitSendNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  5869. smalltalk.NodeVisitor);
  5870. smalltalk.addMethod(
  5871. '_visitCascadeNode_',
  5872. smalltalk.method({
  5873. selector: 'visitCascadeNode:',
  5874. category: 'visiting',
  5875. fn: function (aNode){
  5876. var self=this;
  5877. self._visitNode_(aNode);
  5878. return self;},
  5879. source: unescape('visitCascadeNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  5880. smalltalk.NodeVisitor);
  5881. smalltalk.addMethod(
  5882. '_visitValueNode_',
  5883. smalltalk.method({
  5884. selector: 'visitValueNode:',
  5885. category: 'visiting',
  5886. fn: function (aNode){
  5887. var self=this;
  5888. self._visitNode_(aNode);
  5889. return self;},
  5890. source: unescape('visitValueNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  5891. smalltalk.NodeVisitor);
  5892. smalltalk.addMethod(
  5893. '_visitVariableNode_',
  5894. smalltalk.method({
  5895. selector: 'visitVariableNode:',
  5896. category: 'visiting',
  5897. fn: function (aNode){
  5898. var self=this;
  5899. return self;},
  5900. source: unescape('visitVariableNode%3A%20aNode%0A')}),
  5901. smalltalk.NodeVisitor);
  5902. smalltalk.addMethod(
  5903. '_visitAssignmentNode_',
  5904. smalltalk.method({
  5905. selector: 'visitAssignmentNode:',
  5906. category: 'visiting',
  5907. fn: function (aNode){
  5908. var self=this;
  5909. self._visitNode_(aNode);
  5910. return self;},
  5911. source: unescape('visitAssignmentNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  5912. smalltalk.NodeVisitor);
  5913. smalltalk.addMethod(
  5914. '_visitClassReferenceNode_',
  5915. smalltalk.method({
  5916. selector: 'visitClassReferenceNode:',
  5917. category: 'visiting',
  5918. fn: function (aNode){
  5919. var self=this;
  5920. (function($rec){$rec._nextPutAll_("smalltalk.");return $rec._nextPutAll_(aNode._value());})(self);
  5921. return self;},
  5922. source: unescape('visitClassReferenceNode%3A%20aNode%0A%09self%20%0A%09%20%20%20%20nextPutAll%3A%20%27smalltalk.%27%3B%0A%09%20%20%20%20nextPutAll%3A%20aNode%20value%0A')}),
  5923. smalltalk.NodeVisitor);
  5924. smalltalk.addMethod(
  5925. '_visitJSStatementNode_',
  5926. smalltalk.method({
  5927. selector: 'visitJSStatementNode:',
  5928. category: 'visiting',
  5929. fn: function (aNode){
  5930. var self=this;
  5931. (function($rec){$rec._nextPutAll_(unescape("function%28%29%7B"));$rec._nextPutAll_(aNode._source());return $rec._nextPutAll_(unescape("%7D%29%28%29"));})(self);
  5932. return self;},
  5933. source: unescape('visitJSStatementNode%3A%20aNode%0A%09self%20%0A%09%20%20%20%20nextPutAll%3A%20%27function%28%29%7B%27%3B%0A%09%20%20%20%20nextPutAll%3A%20aNode%20source%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%7D%29%28%29%27%0A')}),
  5934. smalltalk.NodeVisitor);
  5935. smalltalk.addClass('Compiler', smalltalk.NodeVisitor, ['stream', 'nestedBlocks', 'earlyReturn', 'currentClass', 'currentSelector'], 'Compiler');
  5936. smalltalk.addMethod(
  5937. '_initialize',
  5938. smalltalk.method({
  5939. selector: 'initialize',
  5940. category: 'initialization',
  5941. fn: function (){
  5942. var self=this;
  5943. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  5944. self['@stream']=""._writeStream();
  5945. return self;},
  5946. source: unescape('initialize%0A%09super%20initialize.%0A%09stream%20%3A%3D%20%27%27%20writeStream%0A')}),
  5947. smalltalk.Compiler);
  5948. smalltalk.addMethod(
  5949. '_parser',
  5950. smalltalk.method({
  5951. selector: 'parser',
  5952. category: 'accessing',
  5953. fn: function (){
  5954. var self=this;
  5955. return smalltalk.SmalltalkParser._new();
  5956. return self;},
  5957. source: unescape('parser%0A%09%5ESmalltalkParser%20new%0A')}),
  5958. smalltalk.Compiler);
  5959. smalltalk.addMethod(
  5960. '_currentClass',
  5961. smalltalk.method({
  5962. selector: 'currentClass',
  5963. category: 'accessing',
  5964. fn: function (){
  5965. var self=this;
  5966. return self['@currentClass'];
  5967. return self;},
  5968. source: unescape('currentClass%0A%09%5EcurrentClass%0A')}),
  5969. smalltalk.Compiler);
  5970. smalltalk.addMethod(
  5971. '_currentClass_',
  5972. smalltalk.method({
  5973. selector: 'currentClass:',
  5974. category: 'accessing',
  5975. fn: function (aClass){
  5976. var self=this;
  5977. self['@currentClass']=aClass;
  5978. return self;},
  5979. source: unescape('currentClass%3A%20aClass%0A%09currentClass%20%3A%3D%20aClass%0A')}),
  5980. smalltalk.Compiler);
  5981. smalltalk.addMethod(
  5982. '_loadExpression_',
  5983. smalltalk.method({
  5984. selector: 'loadExpression:',
  5985. category: 'compiling',
  5986. fn: function (aString){
  5987. var self=this;
  5988. smalltalk.DoIt._addCompiledMethod_(self._eval_(self._compileExpression_(aString)));
  5989. return smalltalk.DoIt._new()._doIt();
  5990. return self;},
  5991. source: unescape('loadExpression%3A%20aString%0A%09DoIt%20addCompiledMethod%3A%20%28self%20eval%3A%20%28self%20compileExpression%3A%20aString%29%29.%0A%09%5EDoIt%20new%20doIt%0A')}),
  5992. smalltalk.Compiler);
  5993. smalltalk.addMethod(
  5994. '_load_forClass_',
  5995. smalltalk.method({
  5996. selector: 'load:forClass:',
  5997. category: 'compiling',
  5998. fn: function (aString, aClass){
  5999. var self=this;
  6000. return self._eval_(self._compile_forClass_(aString,aClass));
  6001. return self;},
  6002. source: unescape('load%3A%20aString%20forClass%3A%20aClass%0A%09%5Eself%20eval%3A%20%28self%20compile%3A%20aString%20forClass%3A%20aClass%29%0A')}),
  6003. smalltalk.Compiler);
  6004. smalltalk.addMethod(
  6005. '_compile_forClass_',
  6006. smalltalk.method({
  6007. selector: 'compile:forClass:',
  6008. category: 'compiling',
  6009. fn: function (aString, aClass){
  6010. var self=this;
  6011. self._currentClass_(aClass);
  6012. return self._compile_(aString);
  6013. return self;},
  6014. source: unescape('compile%3A%20aString%20forClass%3A%20aClass%0A%09self%20currentClass%3A%20aClass.%0A%09%5Eself%20compile%3A%20aString%0A')}),
  6015. smalltalk.Compiler);
  6016. smalltalk.addMethod(
  6017. '_compileExpression_',
  6018. smalltalk.method({
  6019. selector: 'compileExpression:',
  6020. category: 'compiling',
  6021. fn: function (aString){
  6022. var self=this;
  6023. self._currentClass_(smalltalk.DoIt);
  6024. return self._compileNode_(self._parseExpression_(aString));
  6025. return self;},
  6026. source: unescape('compileExpression%3A%20aString%0A%09self%20currentClass%3A%20DoIt.%0A%09%5Eself%20compileNode%3A%20%28self%20parseExpression%3A%20aString%29%0A')}),
  6027. smalltalk.Compiler);
  6028. smalltalk.addMethod(
  6029. '_eval_',
  6030. smalltalk.method({
  6031. selector: 'eval:',
  6032. category: 'compiling',
  6033. fn: function (aString){
  6034. var self=this;
  6035. return (function(){return eval(aString);})();
  6036. return self;},
  6037. source: unescape('eval%3A%20aString%0A%09%5E%7B%27return%20eval%28aString%29%3B%27%7D%0A')}),
  6038. smalltalk.Compiler);
  6039. smalltalk.addMethod(
  6040. '_compile_',
  6041. smalltalk.method({
  6042. selector: 'compile:',
  6043. category: 'compiling',
  6044. fn: function (aString){
  6045. var self=this;
  6046. return self._compileNode_(self._parse_(aString));
  6047. return self;},
  6048. source: unescape('compile%3A%20aString%0A%09%5Eself%20compileNode%3A%20%28self%20parse%3A%20aString%29%0A')}),
  6049. smalltalk.Compiler);
  6050. smalltalk.addMethod(
  6051. '_compileNode_',
  6052. smalltalk.method({
  6053. selector: 'compileNode:',
  6054. category: 'compiling',
  6055. fn: function (aNode){
  6056. var self=this;
  6057. self['@stream']=""._writeStream();
  6058. self._visit_(aNode);
  6059. return self['@stream']._contents();
  6060. return self;},
  6061. source: unescape('compileNode%3A%20aNode%0A%09stream%20%3A%3D%20%27%27%20writeStream.%0A%09self%20visit%3A%20aNode.%0A%09%5Estream%20contents%0A')}),
  6062. smalltalk.Compiler);
  6063. smalltalk.addMethod(
  6064. '_visit_',
  6065. smalltalk.method({
  6066. selector: 'visit:',
  6067. category: 'visiting',
  6068. fn: function (aNode){
  6069. var self=this;
  6070. aNode._accept_(self);
  6071. return self;},
  6072. source: unescape('visit%3A%20aNode%0A%09aNode%20accept%3A%20self%0A')}),
  6073. smalltalk.Compiler);
  6074. smalltalk.addMethod(
  6075. '_visitMethodNode_',
  6076. smalltalk.method({
  6077. selector: 'visitMethodNode:',
  6078. category: 'visiting',
  6079. fn: function (aNode){
  6080. var self=this;
  6081. var str=nil;
  6082. var currentSelector=nil;
  6083. self['@currentSelector']=aNode._selector()._asSelector();
  6084. self['@nestedBlocks']=(0);
  6085. self['@earlyReturn']=false;
  6086. (function($rec){$rec._nextPutAll_(unescape("smalltalk.method%28%7B").__comma(smalltalk.String._cr()));$rec._nextPutAll_(unescape("selector%3A%20%22").__comma(aNode._selector()).__comma(unescape("%22%2C")).__comma(smalltalk.String._cr()));$rec._nextPutAll_(unescape("source%3A%20unescape%28%22").__comma(aNode._source()._escaped()).__comma(unescape("%22%29%2C")).__comma(smalltalk.String._cr()));return $rec._nextPutAll_(unescape("fn%3A%20function%28"));})(self['@stream']);
  6087. aNode._arguments()._do_separatedBy_((function(each){return self['@stream']._nextPutAll_(each);}),(function(){return self['@stream']._nextPutAll_(unescape("%2C%20"));}));
  6088. (function($rec){$rec._nextPutAll_(unescape("%29%7B").__comma(smalltalk.String._cr()));return $rec._nextPutAll_(unescape("var%20self%3Dthis%3B").__comma(smalltalk.String._cr()));})(self['@stream']);
  6089. str=self['@stream'];
  6090. self['@stream']=""._writeStream();
  6091. aNode._nodes()._do_((function(each){return self._visit_(each);}));
  6092. self['@earlyReturn']._ifTrue_((function(){return str._nextPutAll_(unescape("try%7B"));}));
  6093. str._nextPutAll_(self['@stream']._contents());
  6094. self['@stream']=str;
  6095. (function($rec){$rec._nextPutAll_(smalltalk.String._cr());return $rec._nextPutAll_(unescape("return%20self%3B"));})(self['@stream']);
  6096. self['@earlyReturn']._ifTrue_((function(){return self['@stream']._nextPutAll_(smalltalk.String._cr().__comma(unescape("%7D%20catch%28e%29%20%7Bif%28e.name%20%3D%3D%3D%20%27stReturn%27%20%26%26%20e.selector%20%3D%3D%3D%20")).__comma(self['@currentSelector']._printString()).__comma(unescape("%29%7Breturn%20e.fn%28%29%7D%20throw%28e%29%7D")));}));
  6097. (function($rec){$rec._nextPutAll_(unescape("%7D").__comma(smalltalk.String._cr()));return $rec._nextPutAll_(unescape("%7D%29"));})(self['@stream']);
  6098. return self;},
  6099. source: unescape('visitMethodNode%3A%20aNode%0A%09%7C%20str%20currentSelector%20%7C%0A%09currentSelector%20%3A%3D%20aNode%20selector%20asSelector.%0A%09nestedBlocks%20%3A%3D%200.%0A%09earlyReturn%20%3A%3D%20false.%0A%09stream%20%0A%09%20%20%20%20nextPutAll%3A%20%27smalltalk.method%28%7B%27%2C%20String%20cr%3B%0A%09%20%20%20%20nextPutAll%3A%20%27selector%3A%20%22%27%2C%20aNode%20selector%2C%20%27%22%2C%27%2C%20String%20cr%3B%0A%09%20%20%20%20nextPutAll%3A%20%27source%3A%20unescape%28%22%27%2C%20aNode%20source%20escaped%2C%20%27%22%29%2C%27%2C%20String%20cr%3B%0A%09%20%20%20%20nextPutAll%3A%20%27fn%3A%20function%28%27.%0A%09aNode%20arguments%20%0A%09%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20stream%20nextPutAll%3A%20each%5D%0A%09%20%20%20%20separatedBy%3A%20%5Bstream%20nextPutAll%3A%20%27%2C%20%27%5D.%0A%09stream%20%0A%09%20%20%20%20nextPutAll%3A%20%27%29%7B%27%2C%20String%20cr%3B%0A%09%20%20%20%20nextPutAll%3A%20%27var%20self%3Dthis%3B%27%2C%20String%20cr.%0A%09str%20%3A%3D%20stream.%0A%09stream%20%3A%3D%20%27%27%20writeStream.%0A%09aNode%20nodes%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20self%20visit%3A%20each%5D.%0A%09earlyReturn%20ifTrue%3A%20%5B%0A%09%20%20%20%20str%20nextPutAll%3A%20%27try%7B%27%5D.%0A%09str%20nextPutAll%3A%20stream%20contents.%0A%09stream%20%3A%3D%20str.%0A%09stream%20%0A%09%20%20%20%20nextPutAll%3A%20String%20cr%3B%20%0A%09%20%20%20%20nextPutAll%3A%20%27return%20self%3B%27.%0A%09earlyReturn%20ifTrue%3A%20%5B%0A%09%20%20%20%20stream%20nextPutAll%3A%20String%20cr%2C%20%27%7D%20catch%28e%29%20%7Bif%28e.name%20%3D%3D%3D%20%27%27stReturn%27%27%20%26%26%20e.selector%20%3D%3D%3D%20%27%2C%20currentSelector%20printString%2C%20%27%29%7Breturn%20e.fn%28%29%7D%20throw%28e%29%7D%27%5D.%0A%09stream%20%0A%09%20%20%20%20nextPutAll%3A%20%27%7D%27%2C%20String%20cr%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%7D%29%27%0A')}),
  6100. smalltalk.Compiler);
  6101. smalltalk.addMethod(
  6102. '_visitBlockNode_',
  6103. smalltalk.method({
  6104. selector: 'visitBlockNode:',
  6105. category: 'visiting',
  6106. fn: function (aNode){
  6107. var self=this;
  6108. self['@stream']._nextPutAll_(unescape("%28function%28"));
  6109. aNode._parameters()._do_separatedBy_((function(each){return self['@stream']._nextPutAll_(each);}),(function(){return self['@stream']._nextPutAll_(unescape("%2C%20"));}));
  6110. self['@stream']._nextPutAll_(unescape("%29%7B"));
  6111. aNode._nodes()._do_((function(each){return self._visit_(each);}));
  6112. self['@stream']._nextPutAll_(unescape("%7D%29"));
  6113. return self;},
  6114. source: unescape('visitBlockNode%3A%20aNode%0A%09stream%20nextPutAll%3A%20%27%28function%28%27.%0A%09aNode%20parameters%20%0A%09%20%20%20%20do%3A%20%5B%3Aeach%20%7C%0A%09%09stream%20nextPutAll%3A%20each%5D%0A%09%20%20%20%20separatedBy%3A%20%5Bstream%20nextPutAll%3A%20%27%2C%20%27%5D.%0A%09stream%20nextPutAll%3A%20%27%29%7B%27.%0A%09aNode%20nodes%20do%3A%20%5B%3Aeach%20%7C%20self%20visit%3A%20each%5D.%0A%09stream%20nextPutAll%3A%20%27%7D%29%27%0A')}),
  6115. smalltalk.Compiler);
  6116. smalltalk.addMethod(
  6117. '_visitSequenceNode_',
  6118. smalltalk.method({
  6119. selector: 'visitSequenceNode:',
  6120. category: 'visiting',
  6121. fn: function (aNode){
  6122. var self=this;
  6123. aNode._temps()._do_((function(each){self['@stream']._nextPutAll_("var ".__comma(each).__comma(unescape("%3Dnil%3B")));return self['@stream']._nextPutAll_(smalltalk.String._cr());}));
  6124. aNode._nodes()._do_separatedBy_((function(each){self._visit_(each);return self['@stream']._nextPutAll_(unescape("%3B"));}),(function(){return self['@stream']._nextPutAll_(smalltalk.String._cr());}));
  6125. return self;},
  6126. source: unescape('visitSequenceNode%3A%20aNode%0A%09aNode%20temps%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20stream%20nextPutAll%3A%20%27var%20%27%2C%20each%2C%20%27%3Dnil%3B%27.%0A%09%20%20%20%20stream%20nextPutAll%3A%20String%20cr%5D.%0A%09aNode%20nodes%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20self%20visit%3A%20each.%0A%09%20%20%20%20stream%20nextPutAll%3A%20%27%3B%27%5D%0A%09%20%20%20%20separatedBy%3A%20%5Bstream%20nextPutAll%3A%20String%20cr%5D%0A')}),
  6127. smalltalk.Compiler);
  6128. smalltalk.addMethod(
  6129. '_visitBlockSequenceNode_',
  6130. smalltalk.method({
  6131. selector: 'visitBlockSequenceNode:',
  6132. category: 'visiting',
  6133. fn: function (aNode){
  6134. var self=this;
  6135. var index=nil;
  6136. self['@nestedBlocks']=self['@nestedBlocks'].__plus((1));
  6137. aNode._nodes()._isEmpty()._ifTrue_ifFalse_((function(){return self['@stream']._nextPutAll_(unescape("return%20nil%3B"));}),(function(){aNode._temps()._do_((function(each){self['@stream']._nextPutAll_("var ".__comma(each).__comma(unescape("%3Dnil%3B")));return self['@stream']._nextPutAll_(smalltalk.String._cr());}));index=(0);return aNode._nodes()._do_((function(each){index=index.__plus((1));index.__eq(aNode._nodes()._size())._ifTrue_((function(){return self['@stream']._nextPutAll_("return ");}));self._visit_(each);return self['@stream']._nextPutAll_(unescape("%3B"));}));}));
  6138. self['@nestedBlocks']=self['@nestedBlocks'].__minus((1));
  6139. return self;},
  6140. source: unescape('visitBlockSequenceNode%3A%20aNode%0A%09%7C%20index%20%7C%0A%09nestedBlocks%20%3A%3D%20nestedBlocks%20+%201.%0A%09aNode%20nodes%20isEmpty%0A%09%20%20%20%20ifTrue%3A%20%5B%0A%09%09stream%20nextPutAll%3A%20%27return%20nil%3B%27%5D%0A%09%20%20%20%20ifFalse%3A%20%5B%0A%09%09aNode%20temps%20do%3A%20%5B%3Aeach%20%7C%0A%09%09%20%20%20%20stream%20nextPutAll%3A%20%27var%20%27%2C%20each%2C%20%27%3Dnil%3B%27.%0A%09%09%20%20%20%20stream%20nextPutAll%3A%20String%20cr%5D.%0A%09%09index%20%3A%3D%200.%0A%09%09aNode%20nodes%20do%3A%20%5B%3Aeach%20%7C%0A%09%09%20%20%20%20index%20%3A%3D%20index%20+%201.%0A%09%09%20%20%20%20index%20%3D%20aNode%20nodes%20size%20ifTrue%3A%20%5B%0A%09%09%09stream%20nextPutAll%3A%20%27return%20%27%5D.%0A%09%09%20%20%20%20self%20visit%3A%20each.%0A%09%09%20%20%20%20stream%20nextPutAll%3A%20%27%3B%27%5D%5D.%0A%09nestedBlocks%20%3A%3D%20nestedBlocks%20-%201%0A')}),
  6141. smalltalk.Compiler);
  6142. smalltalk.addMethod(
  6143. '_visitReturnNode_',
  6144. smalltalk.method({
  6145. selector: 'visitReturnNode:',
  6146. category: 'visiting',
  6147. fn: function (aNode){
  6148. var self=this;
  6149. self['@nestedBlocks'].__gt((0))._ifTrue_((function(){return self['@earlyReturn']=true;}));
  6150. self['@earlyReturn']._ifTrue_ifFalse_((function(){return (function($rec){$rec._nextPutAll_(unescape("%28function%28%29%7Bthrow%28"));$rec._nextPutAll_(unescape("%7Bname%3A%20%27stReturn%27%2C%20selector%3A%20"));$rec._nextPutAll_(self['@currentSelector']._printString());return $rec._nextPutAll_(unescape("%2C%20fn%3A%20function%28%29%7Breturn%20"));})(self['@stream']);}),(function(){return self['@stream']._nextPutAll_("return ");}));
  6151. aNode._nodes()._do_((function(each){return self._visit_(each);}));
  6152. self['@earlyReturn']._ifTrue_((function(){return self['@stream']._nextPutAll_(unescape("%7D%7D%29%7D%29%28%29"));}));
  6153. return self;},
  6154. source: unescape('visitReturnNode%3A%20aNode%0A%09nestedBlocks%20%3E%200%20ifTrue%3A%20%5B%0A%09%20%20%20%20earlyReturn%20%3A%3D%20true%5D.%0A%09earlyReturn%0A%09%20%20%20%20ifTrue%3A%20%5B%0A%09%09stream%0A%09%09%20%20%20%20nextPutAll%3A%20%27%28function%28%29%7Bthrow%28%27%3B%0A%09%09%20%20%20%20nextPutAll%3A%20%27%7Bname%3A%20%27%27stReturn%27%27%2C%20selector%3A%20%27%3B%0A%09%09%20%20%20%20nextPutAll%3A%20currentSelector%20printString%3B%0A%09%09%20%20%20%20nextPutAll%3A%20%27%2C%20fn%3A%20function%28%29%7Breturn%20%27%5D%0A%09%20%20%20%20ifFalse%3A%20%5Bstream%20nextPutAll%3A%20%27return%20%27%5D.%0A%09aNode%20nodes%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20self%20visit%3A%20each%5D.%0A%09earlyReturn%20ifTrue%3A%20%5B%0A%09%20%20%20%20stream%20nextPutAll%3A%20%27%7D%7D%29%7D%29%28%29%27%5D%0A')}),
  6155. smalltalk.Compiler);
  6156. smalltalk.addMethod(
  6157. '_visitSendNode_',
  6158. smalltalk.method({
  6159. selector: 'visitSendNode:',
  6160. category: 'visiting',
  6161. fn: function (aNode){
  6162. var self=this;
  6163. var str=nil;
  6164. str=self['@stream'];
  6165. self['@stream']=""._writeStream();
  6166. self._visit_(aNode._receiver());
  6167. self['@stream']._contents().__eq("super")._ifTrue_ifFalse_((function(){self['@stream']=str;(function($rec){$rec._nextPutAll_(unescape("self.klass.superclass.fn.prototype%5B%27"));$rec._nextPutAll_(aNode._selector()._asSelector());return $rec._nextPutAll_(unescape("%27%5D.apply%28self%2C%20%5B"));})(self['@stream']);aNode._arguments()._do_separatedBy_((function(each){return self._visit_(each);}),(function(){return self['@stream']._nextPutAll_(unescape("%2C"));}));return self['@stream']._nextPutAll_(unescape("%5D%29"));}),(function(){str._nextPutAll_(self['@stream']._contents());self['@stream']=str;self['@stream']._nextPutAll_(".".__comma(aNode._selector()._asSelector()).__comma(unescape("%28")));aNode._arguments()._do_separatedBy_((function(each){return self._visit_(each);}),(function(){return self['@stream']._nextPutAll_(unescape("%2C"));}));return self['@stream']._nextPutAll_(unescape("%29"));}));
  6168. return self;},
  6169. source: unescape('visitSendNode%3A%20aNode%0A%09%7C%20str%20%7C%0A%09str%20%3A%3D%20stream.%0A%09stream%20%3A%3D%20%27%27%20writeStream.%0A%09self%20visit%3A%20aNode%20receiver.%0A%09stream%20contents%20%3D%20%27super%27%20%0A%09%20%20%20%20ifTrue%3A%20%5B%0A%09%09stream%20%3A%3D%20str.%0A%09%09stream%20%0A%09%09%20%20%20%20nextPutAll%3A%20%27self.klass.superclass.fn.prototype%5B%27%27%27%3B%0A%09%09%20%20%20%20nextPutAll%3A%20aNode%20selector%20asSelector%3B%0A%09%09%20%20%20%20nextPutAll%3A%20%27%27%27%5D.apply%28self%2C%20%5B%27.%0A%09%09aNode%20arguments%20%0A%09%09%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20self%20visit%3A%20each%5D%0A%09%09%20%20%20%20separatedBy%3A%20%5Bstream%20nextPutAll%3A%20%27%2C%27%5D.%0A%09%09stream%20nextPutAll%3A%20%27%5D%29%27%5D%0A%09%20%20%20%20ifFalse%3A%20%5B%0A%09%09str%20nextPutAll%3A%20stream%20contents.%0A%09%09stream%20%3A%3D%20str.%0A%09%09stream%20nextPutAll%3A%20%27.%27%2C%20aNode%20selector%20asSelector%2C%20%27%28%27.%0A%09%09aNode%20arguments%20%0A%09%09%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20self%20visit%3A%20each%5D%0A%09%09%20%20%20%20separatedBy%3A%20%5Bstream%20nextPutAll%3A%20%27%2C%27%5D.%0A%09%09stream%20nextPutAll%3A%20%27%29%27%5D%0A')}),
  6170. smalltalk.Compiler);
  6171. smalltalk.addMethod(
  6172. '_visitCascadeNode_',
  6173. smalltalk.method({
  6174. selector: 'visitCascadeNode:',
  6175. category: 'visiting',
  6176. fn: function (aNode){
  6177. var self=this;
  6178. var index=nil;
  6179. index=(0);
  6180. self['@stream']._nextPutAll_(unescape("%28function%28%24rec%29%7B"));
  6181. aNode._nodes()._do_((function(each){index=index.__plus((1));index.__eq(aNode._nodes()._size())._ifTrue_((function(){return self['@stream']._nextPutAll_("return ");}));each._receiver_(smalltalk.VariableNode._new()._value_("$rec"));self._visit_(each);return self['@stream']._nextPutAll_(unescape("%3B"));}));
  6182. self['@stream']._nextPutAll_(unescape("%7D%29%28"));
  6183. self._visit_(aNode._receiver());
  6184. self['@stream']._nextPutAll_(unescape("%29"));
  6185. return self;},
  6186. source: unescape('visitCascadeNode%3A%20aNode%0A%09%7C%20index%20%7C%0A%09index%20%3A%3D%200.%0A%09stream%20nextPutAll%3A%20%27%28function%28%24rec%29%7B%27.%0A%09aNode%20nodes%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20index%20%3A%3D%20index%20+%201.%0A%09%20%20%20%20index%20%3D%20aNode%20nodes%20size%20ifTrue%3A%20%5B%0A%09%09stream%20nextPutAll%3A%20%27return%20%27%5D.%0A%09%20%20%20%20each%20receiver%3A%20%28VariableNode%20new%20value%3A%20%27%24rec%27%29.%0A%09%20%20%20%20self%20visit%3A%20each.%0A%09%20%20%20%20stream%20nextPutAll%3A%20%27%3B%27%5D.%0A%09stream%20nextPutAll%3A%20%27%7D%29%28%27.%0A%09self%20visit%3A%20aNode%20receiver.%0A%09stream%20nextPutAll%3A%20%27%29%27%0A')}),
  6187. smalltalk.Compiler);
  6188. smalltalk.addMethod(
  6189. '_visitValueNode_',
  6190. smalltalk.method({
  6191. selector: 'visitValueNode:',
  6192. category: 'visiting',
  6193. fn: function (aNode){
  6194. var self=this;
  6195. self['@stream']._nextPutAll_(aNode._value()._asJavascript());
  6196. return self;},
  6197. source: unescape('visitValueNode%3A%20aNode%0A%09stream%20nextPutAll%3A%20aNode%20value%20asJavascript%0A')}),
  6198. smalltalk.Compiler);
  6199. smalltalk.addMethod(
  6200. '_visitAssignmentNode_',
  6201. smalltalk.method({
  6202. selector: 'visitAssignmentNode:',
  6203. category: 'visiting',
  6204. fn: function (aNode){
  6205. var self=this;
  6206. self._visit_(aNode._left());
  6207. self['@stream']._nextPutAll_(unescape("%3D"));
  6208. self._visit_(aNode._right());
  6209. return self;},
  6210. source: unescape('visitAssignmentNode%3A%20aNode%0A%09self%20visit%3A%20aNode%20left.%0A%09stream%20nextPutAll%3A%20%27%3D%27.%0A%09self%20visit%3A%20aNode%20right%0A')}),
  6211. smalltalk.Compiler);
  6212. smalltalk.addMethod(
  6213. '_visitClassReferenceNode_',
  6214. smalltalk.method({
  6215. selector: 'visitClassReferenceNode:',
  6216. category: 'visiting',
  6217. fn: function (aNode){
  6218. var self=this;
  6219. (function($rec){$rec._nextPutAll_("smalltalk.");return $rec._nextPutAll_(aNode._value());})(self['@stream']);
  6220. return self;},
  6221. source: unescape('visitClassReferenceNode%3A%20aNode%0A%09stream%0A%09%20%20%20%20nextPutAll%3A%20%27smalltalk.%27%3B%0A%09%20%20%20%20nextPutAll%3A%20aNode%20value%0A')}),
  6222. smalltalk.Compiler);
  6223. smalltalk.addMethod(
  6224. '_visitVariableNode_',
  6225. smalltalk.method({
  6226. selector: 'visitVariableNode:',
  6227. category: 'visiting',
  6228. fn: function (aNode){
  6229. var self=this;
  6230. self._currentClass()._instVarNames()._includes_(aNode._value())._ifTrue_ifFalse_((function(){return self['@stream']._nextPutAll_(unescape("self%5B%27@").__comma(aNode._value()).__comma(unescape("%27%5D")));}),(function(){return self['@stream']._nextPutAll_(aNode._value());}));
  6231. return self;},
  6232. source: unescape('visitVariableNode%3A%20aNode%0A%09%28self%20currentClass%20instVarNames%20includes%3A%20aNode%20value%29%20%0A%09%20%20%20%20ifTrue%3A%20%5Bstream%20nextPutAll%3A%20%27self%5B%27%27@%27%2C%20aNode%20value%2C%20%27%27%27%5D%27%5D%0A%09%20%20%20%20ifFalse%3A%20%5Bstream%20nextPutAll%3A%20aNode%20value%5D%0A')}),
  6233. smalltalk.Compiler);
  6234. smalltalk.addMethod(
  6235. '_visitJSStatementNode_',
  6236. smalltalk.method({
  6237. selector: 'visitJSStatementNode:',
  6238. category: 'visiting',
  6239. fn: function (aNode){
  6240. var self=this;
  6241. self['@stream']._nextPutAll_(unescape("%28function%28%29%7B"));
  6242. self['@stream']._nextPutAll_(aNode._source()._value()._replace_with_(unescape("%27%27"),unescape("%27")));
  6243. self['@stream']._nextPutAll_(unescape("%7D%29%28%29"));
  6244. return self;},
  6245. source: unescape('visitJSStatementNode%3A%20aNode%0A%09stream%20nextPutAll%3A%20%27%28function%28%29%7B%27.%0A%09stream%20nextPutAll%3A%20%28aNode%20source%20value%20replace%3A%20%27%27%27%27%27%27%20with%3A%20%27%27%27%27%29.%0A%09stream%20nextPutAll%3A%20%27%7D%29%28%29%27%0A')}),
  6246. smalltalk.Compiler);
  6247. smalltalk.addMethod(
  6248. '_parse_',
  6249. smalltalk.method({
  6250. selector: 'parse:',
  6251. category: 'compiling',
  6252. fn: function (aString){
  6253. var self=this;
  6254. return self._parser()._parse_(aString._readStream());
  6255. return self;},
  6256. source: unescape('parse%3A%20aString%0A%20%20%20%20%5Eself%20parser%20parse%3A%20aString%20readStream%0A')}),
  6257. smalltalk.Compiler);
  6258. smalltalk.addMethod(
  6259. '_parseExpression_',
  6260. smalltalk.method({
  6261. selector: 'parseExpression:',
  6262. category: 'compiling',
  6263. fn: function (aString){
  6264. var self=this;
  6265. return self._parse_(unescape("doIt%20%5E%5B").__comma(aString).__comma(unescape("%5D%20value")));
  6266. return self;},
  6267. source: unescape('parseExpression%3A%20aString%0A%20%20%20%20%5Eself%20parse%3A%20%27doIt%20%5E%5B%27%2C%20aString%2C%20%27%5D%20value%27%0A')}),
  6268. smalltalk.Compiler);
  6269. smalltalk.addClass('DoIt', smalltalk.Object, [], 'Compiler');
  6270. smalltalk.addMethod(
  6271. '_doIt',
  6272. smalltalk.method({
  6273. selector: 'doIt',
  6274. category: '',
  6275. fn: function (){
  6276. var self=this;
  6277. return (function(){return smalltalk.Object._subclass_instanceVariableNames_category_("DoIt","","Compiler");})._value();
  6278. return self;},
  6279. source: unescape('doIt%20%5E%5BObject%20subclass%3A%20%23DoIt%0A%09instanceVariableNames%3A%20%27%27%0A%09category%3A%20%27Compiler%27%5D%20value')}),
  6280. smalltalk.DoIt);
  6281. smalltalk.addClass('JQuery', smalltalk.Object, ['jquery'], 'JQuery');
  6282. smalltalk.addMethod(
  6283. '_removeAttribute_',
  6284. smalltalk.method({
  6285. selector: 'removeAttribute:',
  6286. category: 'attributes',
  6287. fn: function (aString){
  6288. var self=this;
  6289. return self._call_withArgument_("removeAttribute",aString);
  6290. return self;},
  6291. source: unescape('removeAttribute%3A%20aString%0A%20%20%20%20%22Remove%20an%20attribute%20from%20each%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27removeAttribute%27%20withArgument%3A%20aString%0A')}),
  6292. smalltalk.JQuery);
  6293. smalltalk.addMethod(
  6294. '_attr_',
  6295. smalltalk.method({
  6296. selector: 'attr:',
  6297. category: 'attributes',
  6298. fn: function (aString){
  6299. var self=this;
  6300. return self._call_withArgument_("attr",aString);
  6301. return self;},
  6302. source: unescape('attr%3A%20aString%0A%20%20%20%20%22Get%20the%20value%20of%20an%20attribute%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27attr%27%20withArgument%3A%20aString%0A')}),
  6303. smalltalk.JQuery);
  6304. smalltalk.addMethod(
  6305. '_val',
  6306. smalltalk.method({
  6307. selector: 'val',
  6308. category: 'attributes',
  6309. fn: function (){
  6310. var self=this;
  6311. return self._call_("val");
  6312. return self;},
  6313. source: unescape('val%0A%20%20%20%20%22Get%20the%20current%20value%20of%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27val%27%0A')}),
  6314. smalltalk.JQuery);
  6315. smalltalk.addMethod(
  6316. '_val_',
  6317. smalltalk.method({
  6318. selector: 'val:',
  6319. category: 'attributes',
  6320. fn: function (aString){
  6321. var self=this;
  6322. self._call_withArgument_("val",aString);
  6323. return self;},
  6324. source: unescape('val%3A%20aString%0A%20%20%20%20self%20call%3A%20%27val%27%20withArgument%3A%20aString%0A')}),
  6325. smalltalk.JQuery);
  6326. smalltalk.addMethod(
  6327. '_cssAt_',
  6328. smalltalk.method({
  6329. selector: 'cssAt:',
  6330. category: 'css',
  6331. fn: function (aString){
  6332. var self=this;
  6333. return (function(){return self['@jquery'].css(aString)})();
  6334. return self;},
  6335. source: unescape('cssAt%3A%20aString%0A%20%20%20%20%5E%7B%27return%20self%5B%27%27@jquery%27%27%5D.css%28aString%29%27%7D%0A')}),
  6336. smalltalk.JQuery);
  6337. smalltalk.addMethod(
  6338. '_cssAt_put_',
  6339. smalltalk.method({
  6340. selector: 'cssAt:put:',
  6341. category: 'css',
  6342. fn: function (aString, anotherString){
  6343. var self=this;
  6344. (function(){self['@jquery'].css(aString, anotherString)})();
  6345. return self;},
  6346. source: unescape('cssAt%3A%20aString%20put%3A%20anotherString%0A%20%20%20%20%7B%27self%5B%27%27@jquery%27%27%5D.css%28aString%2C%20anotherString%29%27%7D%0A')}),
  6347. smalltalk.JQuery);
  6348. smalltalk.addMethod(
  6349. '_addClass_',
  6350. smalltalk.method({
  6351. selector: 'addClass:',
  6352. category: 'css',
  6353. fn: function (aString){
  6354. var self=this;
  6355. self._call_withArgument_("addClass",aString);
  6356. return self;},
  6357. source: unescape('addClass%3A%20aString%0A%20%20%20%20%22Adds%20the%20specified%20class%28es%29%20to%20each%20of%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20self%20call%3A%20%27addClass%27%20withArgument%3A%20aString%0A')}),
  6358. smalltalk.JQuery);
  6359. smalltalk.addMethod(
  6360. '_removeClass_',
  6361. smalltalk.method({
  6362. selector: 'removeClass:',
  6363. category: 'css',
  6364. fn: function (aString){
  6365. var self=this;
  6366. self._call_withArgument_("removeClass",aString);
  6367. return self;},
  6368. source: unescape('removeClass%3A%20aString%0A%20%20%20%20%22Remove%20a%20single%20class%2C%20multiple%20classes%2C%20or%20all%20classes%20from%20each%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20self%20call%3A%20%27removeClass%27%20withArgument%3A%20aString%0A')}),
  6369. smalltalk.JQuery);
  6370. smalltalk.addMethod(
  6371. '_toggleClass_',
  6372. smalltalk.method({
  6373. selector: 'toggleClass:',
  6374. category: 'css',
  6375. fn: function (aString){
  6376. var self=this;
  6377. self._call_withArgument_("toggleClass",aString);
  6378. return self;},
  6379. source: unescape('toggleClass%3A%20aString%0A%20%20%20%20%22Add%20or%20remove%20one%20or%20more%20classes%20from%20each%20element%20in%20the%20set%20of%20matched%20elements%2C%20depending%20on%20either%20the%20class%27s%20presence%20or%20the%20value%20of%20the%20switch%20argument.%22%0A%20%20%20%20self%20call%3A%20%27toggleClass%27%20withArgument%3A%20aString%0A')}),
  6380. smalltalk.JQuery);
  6381. smalltalk.addMethod(
  6382. '_height',
  6383. smalltalk.method({
  6384. selector: 'height',
  6385. category: 'css',
  6386. fn: function (){
  6387. var self=this;
  6388. return self._call_("height");
  6389. return self;},
  6390. source: unescape('height%20%0A%20%20%20%20%22Get%20the%20current%20computed%20height%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27height%27%0A')}),
  6391. smalltalk.JQuery);
  6392. smalltalk.addMethod(
  6393. '_height_',
  6394. smalltalk.method({
  6395. selector: 'height:',
  6396. category: 'css',
  6397. fn: function (anInteger){
  6398. var self=this;
  6399. self._call_withArgument_("height",anInteger);
  6400. return self;},
  6401. source: unescape('height%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27height%27%20withArgument%3A%20anInteger%0A')}),
  6402. smalltalk.JQuery);
  6403. smalltalk.addMethod(
  6404. '_width_',
  6405. smalltalk.method({
  6406. selector: 'width:',
  6407. category: 'css',
  6408. fn: function (anInteger){
  6409. var self=this;
  6410. self._call_withArgument_("width",anInteger);
  6411. return self;},
  6412. source: unescape('width%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27width%27%20withArgument%3A%20anInteger%0A')}),
  6413. smalltalk.JQuery);
  6414. smalltalk.addMethod(
  6415. '_width',
  6416. smalltalk.method({
  6417. selector: 'width',
  6418. category: 'css',
  6419. fn: function (){
  6420. var self=this;
  6421. return self._call_("width");
  6422. return self;},
  6423. source: unescape('width%0A%20%20%20%20%22Get%20the%20current%20computed%20width%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27width%27%0A')}),
  6424. smalltalk.JQuery);
  6425. smalltalk.addMethod(
  6426. '_innerHeight',
  6427. smalltalk.method({
  6428. selector: 'innerHeight',
  6429. category: 'css',
  6430. fn: function (){
  6431. var self=this;
  6432. return self._call_("innerHeight");
  6433. return self;},
  6434. source: unescape('innerHeight%0A%20%20%20%20%22Get%20the%20current%20computed%20height%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20including%20padding%20but%20not%20border.%22%0A%20%20%20%20%5Eself%20call%3A%20%27innerHeight%27%0A')}),
  6435. smalltalk.JQuery);
  6436. smalltalk.addMethod(
  6437. '_innerWidth',
  6438. smalltalk.method({
  6439. selector: 'innerWidth',
  6440. category: 'css',
  6441. fn: function (){
  6442. var self=this;
  6443. return self._call_("innerWidth");
  6444. return self;},
  6445. source: unescape('innerWidth%0A%20%20%20%20%22Get%20the%20current%20computed%20width%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20including%20padding%20but%20not%20border.%22%0A%20%20%20%20%5Eself%20call%3A%20%27innerWidth%27%0A')}),
  6446. smalltalk.JQuery);
  6447. smalltalk.addMethod(
  6448. '_outerHeight',
  6449. smalltalk.method({
  6450. selector: 'outerHeight',
  6451. category: 'css',
  6452. fn: function (){
  6453. var self=this;
  6454. return self._call_("outerHeight");
  6455. return self;},
  6456. source: unescape('outerHeight%0A%20%20%20%20%22Get%20the%20current%20computed%20height%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20including%20padding%2C%20border%2C%20and%20optionally%20margin.%22%0A%20%20%20%20%5Eself%20call%3A%20%27outerHeight%27%0A')}),
  6457. smalltalk.JQuery);
  6458. smalltalk.addMethod(
  6459. '_outerWidth',
  6460. smalltalk.method({
  6461. selector: 'outerWidth',
  6462. category: 'css',
  6463. fn: function (){
  6464. var self=this;
  6465. return self._call_("outerWidth");
  6466. return self;},
  6467. source: unescape('outerWidth%0A%20%20%20%20%22Get%20the%20current%20computed%20width%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20including%20padding%20and%20border.%22%0A%20%20%20%20%5Eself%20call%3A%20%27outerWidth%27%0A')}),
  6468. smalltalk.JQuery);
  6469. smalltalk.addMethod(
  6470. '_top',
  6471. smalltalk.method({
  6472. selector: 'top',
  6473. category: 'css',
  6474. fn: function (){
  6475. var self=this;
  6476. return self._call_("position")._basicAt_("top");
  6477. return self;},
  6478. source: unescape('top%0A%20%20%20%20%22Get%20the%20current%20y%20coordinate%20of%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20relative%20to%20the%20offset%20parent.%22%0A%20%20%20%20%5E%28self%20call%3A%20%27position%27%29%20basicAt%3A%20%27top%27%0A')}),
  6479. smalltalk.JQuery);
  6480. smalltalk.addMethod(
  6481. '_left',
  6482. smalltalk.method({
  6483. selector: 'left',
  6484. category: 'css',
  6485. fn: function (){
  6486. var self=this;
  6487. return self._call_("position")._basicAt_("left");
  6488. return self;},
  6489. source: unescape('left%0A%20%20%20%20%22Get%20the%20current%20x%20coordinate%20of%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20relative%20to%20the%20offset%20parent.%22%0A%20%20%20%20%5E%28self%20call%3A%20%27position%27%29%20basicAt%3A%20%27left%27%0A')}),
  6490. smalltalk.JQuery);
  6491. smalltalk.addMethod(
  6492. '_offsetLeft',
  6493. smalltalk.method({
  6494. selector: 'offsetLeft',
  6495. category: 'css',
  6496. fn: function (){
  6497. var self=this;
  6498. return self._call_("offset")._basicAt_("left");
  6499. return self;},
  6500. source: unescape('offsetLeft%0A%20%20%20%20%22Get%20the%20current%20coordinates%20of%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20relative%20to%20the%20document.%22%0A%20%20%20%20%5E%28self%20call%3A%20%27offset%27%29%20basicAt%3A%20%27left%27%0A')}),
  6501. smalltalk.JQuery);
  6502. smalltalk.addMethod(
  6503. '_offsetTop',
  6504. smalltalk.method({
  6505. selector: 'offsetTop',
  6506. category: 'css',
  6507. fn: function (){
  6508. var self=this;
  6509. return self._call_("offset")._basicAt_("top");
  6510. return self;},
  6511. source: unescape('offsetTop%0A%20%20%20%20%22Get%20the%20current%20coordinates%20of%20the%20first%20element%20in%20the%20set%20of%20matched%20elements%2C%20relative%20to%20the%20document.%22%0A%20%20%20%20%5E%28self%20call%3A%20%27offset%27%29%20basicAt%3A%20%27top%27%0A')}),
  6512. smalltalk.JQuery);
  6513. smalltalk.addMethod(
  6514. '_scrollLeft',
  6515. smalltalk.method({
  6516. selector: 'scrollLeft',
  6517. category: 'css',
  6518. fn: function (){
  6519. var self=this;
  6520. return self._call_("scrollLeft");
  6521. return self;},
  6522. source: unescape('scrollLeft%0A%20%20%20%20%22Get%20the%20current%20horizontal%20position%20of%20the%20scroll%20bar%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27scrollLeft%27%0A')}),
  6523. smalltalk.JQuery);
  6524. smalltalk.addMethod(
  6525. '_scrollTop',
  6526. smalltalk.method({
  6527. selector: 'scrollTop',
  6528. category: 'css',
  6529. fn: function (){
  6530. var self=this;
  6531. return self._call_("scrollTop");
  6532. return self;},
  6533. source: unescape('scrollTop%0A%20%20%20%20%22Get%20the%20current%20vertical%20position%20of%20the%20scroll%20bar%20for%20the%20first%20element%20in%20the%20set%20of%20matched%20elements.%22%0A%20%20%20%20%5Eself%20call%3A%20%27scrollTop%27%0A')}),
  6534. smalltalk.JQuery);
  6535. smalltalk.addMethod(
  6536. '_scrollLeft_',
  6537. smalltalk.method({
  6538. selector: 'scrollLeft:',
  6539. category: 'css',
  6540. fn: function (anInteger){
  6541. var self=this;
  6542. self._call_withArgument_("scrollLeft",anInteger);
  6543. return self;},
  6544. source: unescape('scrollLeft%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27scrollLeft%27%20withArgument%3A%20anInteger%0A')}),
  6545. smalltalk.JQuery);
  6546. smalltalk.addMethod(
  6547. '_scrollTop_',
  6548. smalltalk.method({
  6549. selector: 'scrollTop:',
  6550. category: 'css',
  6551. fn: function (anInteger){
  6552. var self=this;
  6553. self._call_withArgument_("scrollTop",anInteger);
  6554. return self;},
  6555. source: unescape('scrollTop%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27scrollTop%27%20withArgument%3A%20anInteger%0A')}),
  6556. smalltalk.JQuery);
  6557. smalltalk.addMethod(
  6558. '_focus',
  6559. smalltalk.method({
  6560. selector: 'focus',
  6561. category: 'events',
  6562. fn: function (){
  6563. var self=this;
  6564. self._call_("focus");
  6565. return self;},
  6566. source: unescape('focus%0A%20%20%20%20self%20call%3A%20%27focus%27%0A')}),
  6567. smalltalk.JQuery);
  6568. smalltalk.addMethod(
  6569. '_show',
  6570. smalltalk.method({
  6571. selector: 'show',
  6572. category: 'events',
  6573. fn: function (){
  6574. var self=this;
  6575. self._call_("show");
  6576. return self;},
  6577. source: unescape('show%0A%20%20%20%20self%20call%3A%20%27show%27%0A')}),
  6578. smalltalk.JQuery);
  6579. smalltalk.addMethod(
  6580. '_hide',
  6581. smalltalk.method({
  6582. selector: 'hide',
  6583. category: 'events',
  6584. fn: function (){
  6585. var self=this;
  6586. self._call_("hide");
  6587. return self;},
  6588. source: unescape('hide%0A%20%20%20%20self%20call%3A%20%27hide%27%0A')}),
  6589. smalltalk.JQuery);
  6590. smalltalk.addMethod(
  6591. '_remove',
  6592. smalltalk.method({
  6593. selector: 'remove',
  6594. category: 'events',
  6595. fn: function (){
  6596. var self=this;
  6597. self._call_("remove");
  6598. return self;},
  6599. source: unescape('remove%0A%20%20%20%20self%20call%3A%20%27remove%27%0A')}),
  6600. smalltalk.JQuery);
  6601. smalltalk.addMethod(
  6602. '_on_do_',
  6603. smalltalk.method({
  6604. selector: 'on:do:',
  6605. category: 'events',
  6606. fn: function (anEventString, aBlock){
  6607. var self=this;
  6608. (function(){self['@jquery'].bind(anEventString, function(e){aBlock(self)})})();
  6609. return self;},
  6610. source: unescape('on%3A%20anEventString%20do%3A%20aBlock%0A%20%20%20%20%22Attach%20aBlock%20for%20anEventString%20on%20the%20element%22%0A%20%20%20%20%7B%27self%5B%27%27@jquery%27%27%5D.bind%28anEventString%2C%20function%28e%29%7BaBlock%28self%29%7D%29%27%7D%0A')}),
  6611. smalltalk.JQuery);
  6612. smalltalk.addMethod(
  6613. '_removeEvents_',
  6614. smalltalk.method({
  6615. selector: 'removeEvents:',
  6616. category: 'events',
  6617. fn: function (aString){
  6618. var self=this;
  6619. self._call_withArgument_("unbind",aString);
  6620. return self;},
  6621. source: unescape('removeEvents%3A%20aString%0A%20%20%20%20%22Unbind%20all%20handlers%20attached%20to%20the%20event%20aString%22%0A%20%20%20%20self%20call%3A%20%27unbind%27%20withArgument%3A%20aString%0A')}),
  6622. smalltalk.JQuery);
  6623. smalltalk.addMethod(
  6624. '_append_',
  6625. smalltalk.method({
  6626. selector: 'append:',
  6627. category: 'DOM insertion',
  6628. fn: function (anObject){
  6629. var self=this;
  6630. anObject._appendToJQuery_(self);
  6631. return self;},
  6632. source: unescape('append%3A%20anObject%0A%20%20%20%20%22Append%20anObject%20at%20the%20end%20of%20the%20element.%22%0A%20%20%20%20anObject%20appendToJQuery%3A%20self%0A')}),
  6633. smalltalk.JQuery);
  6634. smalltalk.addMethod(
  6635. '_appendElement_',
  6636. smalltalk.method({
  6637. selector: 'appendElement:',
  6638. category: 'DOM insertion',
  6639. fn: function (anElement){
  6640. var self=this;
  6641. self._call_withArgument_("append",anElement);
  6642. return self;},
  6643. source: unescape('appendElement%3A%20anElement%0A%20%20%20%20%22Append%20anElement%20at%20the%20end%20of%20the%20element.%0A%20%20%20%20%20Dont%27t%20call%20this%20method%20directly%2C%20use%20%23append%3A%20instead%22%0A%20%20%20%20self%20call%3A%20%27append%27%20withArgument%3A%20anElement%0A')}),
  6644. smalltalk.JQuery);
  6645. smalltalk.addMethod(
  6646. '_appendToJQuery_',
  6647. smalltalk.method({
  6648. selector: 'appendToJQuery:',
  6649. category: 'DOM insertion',
  6650. fn: function (aJQuery){
  6651. var self=this;
  6652. aJQuery._appendElement_(self['@jquery']);
  6653. return self;},
  6654. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20aJQuery%20appendElement%3A%20jquery%0A')}),
  6655. smalltalk.JQuery);
  6656. smalltalk.addMethod(
  6657. '_contents_',
  6658. smalltalk.method({
  6659. selector: 'contents:',
  6660. category: 'DOM insertion',
  6661. fn: function (anObject){
  6662. var self=this;
  6663. self._empty();
  6664. self._append_(anObject);
  6665. return self;},
  6666. source: unescape('contents%3A%20anObject%0A%20%20%20%20self%20empty.%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  6667. smalltalk.JQuery);
  6668. smalltalk.addMethod(
  6669. '_empty',
  6670. smalltalk.method({
  6671. selector: 'empty',
  6672. category: 'DOM insertion',
  6673. fn: function (){
  6674. var self=this;
  6675. self._call_("empty");
  6676. return self;},
  6677. source: unescape('empty%0A%20%20%20%20self%20call%3A%20%27empty%27%0A')}),
  6678. smalltalk.JQuery);
  6679. smalltalk.addMethod(
  6680. '_initializeWithJQueryObject_',
  6681. smalltalk.method({
  6682. selector: 'initializeWithJQueryObject:',
  6683. category: 'initialization',
  6684. fn: function (anObject){
  6685. var self=this;
  6686. self['@jquery']=anObject;
  6687. return self;},
  6688. source: unescape('initializeWithJQueryObject%3A%20anObject%0A%20%20%20%20jquery%20%3A%3D%20anObject%0A')}),
  6689. smalltalk.JQuery);
  6690. smalltalk.addMethod(
  6691. '_call_',
  6692. smalltalk.method({
  6693. selector: 'call:',
  6694. category: 'private',
  6695. fn: function (aString){
  6696. var self=this;
  6697. return (function(){return self['@jquery'][aString]()})();
  6698. return self;},
  6699. source: unescape('call%3A%20aString%0A%20%20%20%20%5E%7B%27return%20self%5B%27%27@jquery%27%27%5D%5BaString%5D%28%29%27%7D%0A')}),
  6700. smalltalk.JQuery);
  6701. smalltalk.addMethod(
  6702. '_call_withArgument_',
  6703. smalltalk.method({
  6704. selector: 'call:withArgument:',
  6705. category: 'private',
  6706. fn: function (aString, anObject){
  6707. var self=this;
  6708. return (function(){return self['@jquery'][aString](anObject)})();
  6709. return self;},
  6710. source: unescape('call%3A%20aString%20withArgument%3A%20anObject%0A%20%20%20%20%5E%7B%27return%20self%5B%27%27@jquery%27%27%5D%5BaString%5D%28anObject%29%27%7D%0A')}),
  6711. smalltalk.JQuery);
  6712. smalltalk.addMethod(
  6713. '_hasClass_',
  6714. smalltalk.method({
  6715. selector: 'hasClass:',
  6716. category: 'testing',
  6717. fn: function (aString){
  6718. var self=this;
  6719. return self._call_withArgument_("hasClass",aString);
  6720. return self;},
  6721. source: unescape('hasClass%3A%20aString%0A%20%20%20%20%22Determine%20whether%20any%20of%20the%20matched%20elements%20are%20assigned%20the%20given%20class.%22%0A%20%20%20%20%5Eself%20call%3A%20%27hasClass%27%20withArgument%3A%20aString%0A')}),
  6722. smalltalk.JQuery);
  6723. smalltalk.addMethod(
  6724. '_fromString_',
  6725. smalltalk.method({
  6726. selector: 'fromString:',
  6727. category: 'instance creation',
  6728. fn: function (aString){
  6729. var self=this;
  6730. var newJQuery=nil;
  6731. (function(){newJQuery = jQuery(String(aString))})();
  6732. return self._from_(newJQuery);
  6733. return self;},
  6734. source: unescape('fromString%3A%20aString%0A%20%20%20%20%7C%20newJQuery%20%7C%0A%20%20%20%20%7B%27newJQuery%20%3D%20jQuery%28String%28aString%29%29%27%7D.%0A%20%20%20%20%5Eself%20from%3A%20newJQuery%0A')}),
  6735. smalltalk.JQuery.klass);
  6736. smalltalk.addMethod(
  6737. '_from_',
  6738. smalltalk.method({
  6739. selector: 'from:',
  6740. category: 'instance creation',
  6741. fn: function (anObject){
  6742. var self=this;
  6743. return (function($rec){$rec._initializeWithJQueryObject_(anObject);return $rec._yourself();})(self._new());
  6744. return self;},
  6745. source: unescape('from%3A%20anObject%0A%20%20%20%20%5Eself%20new%0A%09initializeWithJQueryObject%3A%20anObject%3B%0A%09yourself%0A')}),
  6746. smalltalk.JQuery.klass);
  6747. smalltalk.addClass('Ajax', smalltalk.Object, ['settings'], 'JQuery');
  6748. smalltalk.Ajax.comment=unescape('instance%20variable%20names%3A%0A-%20settings%20%20A%20set%20of%20key/value%20pairs%20that%20configure%20the%20Ajax%20request.%20All%20settings%20are%20optional.%0A%0AFull%20list%20of%20settings%20options%20at%20http%3A//api.jquery.com/jQuery.ajax/%0A')
  6749. smalltalk.addMethod(
  6750. '_initialize',
  6751. smalltalk.method({
  6752. selector: 'initialize',
  6753. category: 'initialization',
  6754. fn: function (){
  6755. var self=this;
  6756. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  6757. self['@settings']=smalltalk.Dictionary._new();
  6758. return self;},
  6759. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20settings%20%3A%3D%20Dictionary%20new%0A')}),
  6760. smalltalk.Ajax);
  6761. smalltalk.addMethod(
  6762. '_at_',
  6763. smalltalk.method({
  6764. selector: 'at:',
  6765. category: 'accessing',
  6766. fn: function (aKey){
  6767. var self=this;
  6768. return self['@settings']._at_ifAbsent_(aKey,(function(){return nil;}));
  6769. return self;},
  6770. source: unescape('at%3A%20aKey%0A%20%20%20%20%5Esettings%20at%3A%20aKey%20ifAbsent%3A%20%5Bnil%5D%0A')}),
  6771. smalltalk.Ajax);
  6772. smalltalk.addMethod(
  6773. '_at_put_',
  6774. smalltalk.method({
  6775. selector: 'at:put:',
  6776. category: 'accessing',
  6777. fn: function (aKey, aValue){
  6778. var self=this;
  6779. self['@settings']._at_put_(aKey,aValue);
  6780. return self;},
  6781. source: unescape('at%3A%20aKey%20put%3A%20aValue%0A%20%20%20%20settings%20at%3A%20aKey%20put%3A%20aValue%0A')}),
  6782. smalltalk.Ajax);
  6783. smalltalk.addMethod(
  6784. '_url',
  6785. smalltalk.method({
  6786. selector: 'url',
  6787. category: 'accessing',
  6788. fn: function (){
  6789. var self=this;
  6790. return self._at_("url");
  6791. return self;},
  6792. source: unescape('url%0A%20%20%20%20%5Eself%20at%3A%20%27url%27%0A')}),
  6793. smalltalk.Ajax);
  6794. smalltalk.addMethod(
  6795. '_url_',
  6796. smalltalk.method({
  6797. selector: 'url:',
  6798. category: 'accessing',
  6799. fn: function (aString){
  6800. var self=this;
  6801. self._at_put_("url",aString);
  6802. return self;},
  6803. source: unescape('url%3A%20aString%0A%20%20%20%20self%20at%3A%20%27url%27%20put%3A%20aString%0A')}),
  6804. smalltalk.Ajax);
  6805. smalltalk.addMethod(
  6806. '_send',
  6807. smalltalk.method({
  6808. selector: 'send',
  6809. category: 'actions',
  6810. fn: function (){
  6811. var self=this;
  6812. (function(){jQuery.ajax(self['@settings'])})();
  6813. return self;},
  6814. source: unescape('send%0A%20%20%20%20%7B%27jQuery.ajax%28self%5B%27%27@settings%27%27%5D%29%27%7D%0A')}),
  6815. smalltalk.Ajax);
  6816. smalltalk.addMethod(
  6817. '_url_',
  6818. smalltalk.method({
  6819. selector: 'url:',
  6820. category: 'instance creation',
  6821. fn: function (aString){
  6822. var self=this;
  6823. return (function($rec){$rec._url_(aString);return $rec._yourself();})(self._new());
  6824. return self;},
  6825. source: unescape('url%3A%20aString%0A%20%20%20%20%5Eself%20new%0A%09url%3A%20aString%3B%0A%09yourself%0A')}),
  6826. smalltalk.Ajax.klass);
  6827. smalltalk.addClass('CanvasRenderingContext', smalltalk.Object, [], 'Canvas');
  6828. smalltalk.addMethod(
  6829. '_fillStyle_',
  6830. smalltalk.method({
  6831. selector: 'fillStyle:',
  6832. category: 'drawing paths',
  6833. fn: function (aString) {
  6834. var self = this;
  6835. (function () {self.fillStyle = String(aString);}());
  6836. return self;
  6837. },
  6838. source: unescape('fillStyle%3A%20aString%0A%09%7B%27self.fillStyle%20%3D%20String%28aString%29%27%7D')}),
  6839. smalltalk.CanvasRenderingContext);
  6840. smalltalk.addMethod(
  6841. '_beginPath',
  6842. smalltalk.method({
  6843. selector: 'beginPath',
  6844. category: 'drawing paths',
  6845. fn: function () {
  6846. var self = this;
  6847. (function () {self.beginPath();}());
  6848. return self;
  6849. },
  6850. source: unescape('beginPath%0A%09%7B%27self.beginPath%28%29%27%7D')}),
  6851. smalltalk.CanvasRenderingContext);
  6852. smalltalk.addMethod(
  6853. '_closePath',
  6854. smalltalk.method({
  6855. selector: 'closePath',
  6856. category: 'drawing paths',
  6857. fn: function () {
  6858. var self = this;
  6859. (function () {self.closePath();}());
  6860. return self;
  6861. },
  6862. source: unescape('closePath%0A%09%7B%27self.closePath%28%29%27%7D')}),
  6863. smalltalk.CanvasRenderingContext);
  6864. smalltalk.addMethod(
  6865. '_fill',
  6866. smalltalk.method({
  6867. selector: 'fill',
  6868. category: 'drawing paths',
  6869. fn: function () {
  6870. var self = this;
  6871. (function () {self.fill();}());
  6872. return self;
  6873. },
  6874. source: unescape('fill%0A%09%7B%27self.fill%28%29%27%7D')}),
  6875. smalltalk.CanvasRenderingContext);
  6876. smalltalk.addMethod(
  6877. '_stroke',
  6878. smalltalk.method({
  6879. selector: 'stroke',
  6880. category: 'drawing paths',
  6881. fn: function () {
  6882. var self = this;
  6883. (function () {self.stroke();}());
  6884. return self;
  6885. },
  6886. source: unescape('stroke%0A%09%7B%27self.stroke%28%29%27%7D')}),
  6887. smalltalk.CanvasRenderingContext);
  6888. smalltalk.addMethod(
  6889. '_moveTo_',
  6890. smalltalk.method({
  6891. selector: 'moveTo:',
  6892. category: 'drawing paths',
  6893. fn: function (aPoint) {
  6894. var self = this;
  6895. (function () {self.moveTo(aPoint._x(), aPoint._y());}());
  6896. return self;
  6897. },
  6898. source: unescape('moveTo%3A%20aPoint%0A%09%7B%27self.moveTo%28aPoint._x%28%29%2C%20aPoint._y%28%29%29%27%7D')}),
  6899. smalltalk.CanvasRenderingContext);
  6900. smalltalk.addMethod(
  6901. '_lineTo_',
  6902. smalltalk.method({
  6903. selector: 'lineTo:',
  6904. category: 'drawing paths',
  6905. fn: function (aPoint) {
  6906. var self = this;
  6907. (function () {self.lineTo(aPoint._x(), aPoint._y());}());
  6908. return self;
  6909. },
  6910. source: unescape('lineTo%3A%20aPoint%0A%09%7B%27self.lineTo%28aPoint._x%28%29%2C%20aPoint._y%28%29%29%27%7D')}),
  6911. smalltalk.CanvasRenderingContext);
  6912. smalltalk.addMethod(
  6913. '_arcTo_radius_startAngle_endAngle_anticlockwise_',
  6914. smalltalk.method({
  6915. selector: 'arcTo:radius:startAngle:endAngle:anticlockwise:',
  6916. category: 'drawing arcs',
  6917. fn: function (aPoint, aNumber, aNumber2, aNumber3, aBoolean) {
  6918. var self = this;
  6919. (function () {self.arc(aPoint._x(), aPoint._y(), aNumber, aNumber2, aNumber3, aBoolean);}());
  6920. return self;
  6921. },
  6922. source: unescape('arcTo%3A%20aPoint%20radius%3A%20aNumber%20startAngle%3A%20aNumber2%20endAngle%3A%20aNumber3%20anticlockwise%3A%20aBoolean%0A%09%7B%27self.arc%28aPoint._x%28%29%2C%20aPoint._y%28%29%2C%20aNumber%2C%20aNumber2%2C%20aNumber3%2C%20aBoolean%29%27%7D%20')}),
  6923. smalltalk.CanvasRenderingContext);
  6924. smalltalk.addMethod(
  6925. '_arcTo_radius_',
  6926. smalltalk.method({
  6927. selector: 'arcTo:radius:',
  6928. category: 'drawing arcs',
  6929. fn: function (aPoint, aNumber) {
  6930. var self = this;
  6931. self._arcTo_radius_startAngle_endAngle_anticlockwise_(aPoint, aNumber, 0, smalltalk.Number._pi().__star(2), false);
  6932. return self;
  6933. },
  6934. source: unescape('arcTo%3A%20aPoint%20radius%3A%20aNumber%0A%09self%20arcTo%3A%20aPoint%20radius%3A%20aNumber%20startAngle%3A%200%20endAngle%3A%20Number%20pi%20*%202%20anticlockwise%3A%20false')}),
  6935. smalltalk.CanvasRenderingContext);
  6936. smalltalk.addMethod(
  6937. '_fillRectFrom_to_',
  6938. smalltalk.method({
  6939. selector: 'fillRectFrom:to:',
  6940. category: 'drawing rectangles',
  6941. fn: function (aPoint, anotherPoint) {
  6942. var self = this;
  6943. (function () {self.fillRect(aPoint._x(), aPoint._y(), anotherPoint._x(), anotherPoint._y());}());
  6944. return self;
  6945. },
  6946. source: unescape('fillRectFrom%3A%20aPoint%20to%3A%20anotherPoint%0A%09%7B%27self.fillRect%28aPoint._x%28%29%2C%20aPoint._y%28%29%2C%20anotherPoint._x%28%29%2C%20anotherPoint._y%28%29%29%27%7D')}),
  6947. smalltalk.CanvasRenderingContext);
  6948. smalltalk.addMethod(
  6949. '_strokeRectFrom_to_',
  6950. smalltalk.method({
  6951. selector: 'strokeRectFrom:to:',
  6952. category: 'drawing rectangles',
  6953. fn: function (aPoint, anotherPoint) {
  6954. var self = this;
  6955. (function () {self.strokeRect(aPoint._x(), aPoint._y(), anotherPoint._x(), anotherPoint._y());}());
  6956. return self;
  6957. },
  6958. source: unescape('strokeRectFrom%3A%20aPoint%20to%3A%20anotherPoint%0A%09%7B%27self.strokeRect%28aPoint._x%28%29%2C%20aPoint._y%28%29%2C%20anotherPoint._x%28%29%2C%20anotherPoint._y%28%29%29%27%7D')}),
  6959. smalltalk.CanvasRenderingContext);
  6960. smalltalk.addMethod(
  6961. '_clearRectFrom_to_',
  6962. smalltalk.method({
  6963. selector: 'clearRectFrom:to:',
  6964. category: 'drawing rectangles',
  6965. fn: function (aPoint, anotherPoint) {
  6966. var self = this;
  6967. (function () {self.fillRect(aPoint._x(), aPoint._y(), anotherPoint._x(), anotherPoint._y());}());
  6968. return self;
  6969. },
  6970. source: unescape('clearRectFrom%3A%20aPoint%20to%3A%20anotherPoint%0A%09%7B%27self.fillRect%28aPoint._x%28%29%2C%20aPoint._y%28%29%2C%20anotherPoint._x%28%29%2C%20anotherPoint._y%28%29%29%27%7D')}),
  6971. smalltalk.CanvasRenderingContext);
  6972. smalltalk.addMethod(
  6973. '_strokeStyle_',
  6974. smalltalk.method({
  6975. selector: 'strokeStyle:',
  6976. category: 'drawing paths',
  6977. fn: function (aString) {
  6978. var self = this;
  6979. (function () {self.strokeStyle = String(aString);}());
  6980. return self;
  6981. },
  6982. source: unescape('strokeStyle%3A%20aString%0A%09%7B%27self.strokeStyle%20%3D%20String%28aString%29%27%7D')}),
  6983. smalltalk.CanvasRenderingContext);
  6984. smalltalk.addMethod(
  6985. '_lineWidth_',
  6986. smalltalk.method({
  6987. selector: 'lineWidth:',
  6988. category: 'drawing paths',
  6989. fn: function (aNumber) {
  6990. var self = this;
  6991. (function () {self.lineWidth = aNumber;}());
  6992. return self;
  6993. },
  6994. source: unescape('lineWidth%3A%20aNumber%0A%09%7B%27self.lineWidth%20%3D%20aNumber%27%7D')}),
  6995. smalltalk.CanvasRenderingContext);
  6996. smalltalk.addMethod(
  6997. '_tagBrush_',
  6998. smalltalk.method({
  6999. selector: 'tagBrush:',
  7000. category: 'instance creation',
  7001. fn: function (aTagBrush) {
  7002. var self = this;
  7003. return function () {return aTagBrush._element().getContext("2d");}();
  7004. return self;
  7005. },
  7006. source: unescape('tagBrush%3A%20aTagBrush%0A%09%5E%7B%27return%20aTagBrush._element%28%29.getContext%28%27%272d%27%27%29%27%7D')}),
  7007. smalltalk.CanvasRenderingContext.klass);
  7008. smalltalk.addClass('HTMLCanvas', smalltalk.Object, ['root'], 'Canvas');
  7009. smalltalk.addMethod(
  7010. '_root_',
  7011. smalltalk.method({
  7012. selector: 'root:',
  7013. category: 'accessing',
  7014. fn: function (aTagBrush) {
  7015. var self = this;
  7016. self['@root'] = aTagBrush;
  7017. return self;
  7018. },
  7019. source: unescape('root%3A%20aTagBrush%0A%20%20%20%20root%20%3A%3D%20aTagBrush%0A')}),
  7020. smalltalk.HTMLCanvas);
  7021. smalltalk.addMethod(
  7022. '_root',
  7023. smalltalk.method({
  7024. selector: 'root',
  7025. category: 'accessing',
  7026. fn: function () {
  7027. var self = this;
  7028. return self['@root'];
  7029. return self;
  7030. },
  7031. source: unescape('root%0A%20%20%20%20%5Eroot%0A')}),
  7032. smalltalk.HTMLCanvas);
  7033. smalltalk.addMethod(
  7034. '_initialize',
  7035. smalltalk.method({
  7036. selector: 'initialize',
  7037. category: 'initialization',
  7038. fn: function () {
  7039. var self = this;
  7040. self.klass.superclass.fn.prototype._initialize.apply(self, []);
  7041. self['@root'] = smalltalk.TagBrush._fromString_canvas_("div", self);
  7042. return self;
  7043. },
  7044. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20root%20%3A%3D%20TagBrush%20fromString%3A%20%27div%27%20canvas%3A%20self%0A')}),
  7045. smalltalk.HTMLCanvas);
  7046. smalltalk.addMethod(
  7047. '_with_',
  7048. smalltalk.method({
  7049. selector: 'with:',
  7050. category: 'adding',
  7051. fn: function (anObject) {
  7052. var self = this;
  7053. return self._root()._with_(anObject);
  7054. return self;
  7055. },
  7056. source: unescape('with%3A%20anObject%0A%20%20%20%20%5Eself%20root%20with%3A%20anObject%0A')}),
  7057. smalltalk.HTMLCanvas);
  7058. smalltalk.addMethod(
  7059. '_newTag_',
  7060. smalltalk.method({
  7061. selector: 'newTag:',
  7062. category: 'tags',
  7063. fn: function (aString) {
  7064. var self = this;
  7065. return smalltalk.TagBrush._fromString_canvas_(aString, self);
  7066. return self;
  7067. },
  7068. source: unescape('newTag%3A%20aString%0A%20%20%20%20%5ETagBrush%20fromString%3A%20aString%20canvas%3A%20self%0A')}),
  7069. smalltalk.HTMLCanvas);
  7070. smalltalk.addMethod(
  7071. '_tag_',
  7072. smalltalk.method({
  7073. selector: 'tag:',
  7074. category: 'tags',
  7075. fn: function (aString) {
  7076. var self = this;
  7077. return self['@root']._addBrush_(self._newTag_(aString));
  7078. return self;
  7079. },
  7080. source: unescape('tag%3A%20aString%0A%20%20%20%20%5Eroot%20addBrush%3A%20%28self%20newTag%3A%20aString%29%0A')}),
  7081. smalltalk.HTMLCanvas);
  7082. smalltalk.addMethod(
  7083. '_h1',
  7084. smalltalk.method({
  7085. selector: 'h1',
  7086. category: 'tags',
  7087. fn: function () {
  7088. var self = this;
  7089. return self._tag_("h1");
  7090. return self;
  7091. },
  7092. source: unescape('h1%0A%20%20%20%20%5Eself%20tag%3A%20%27h1%27%0A')}),
  7093. smalltalk.HTMLCanvas);
  7094. smalltalk.addMethod(
  7095. '_h2',
  7096. smalltalk.method({
  7097. selector: 'h2',
  7098. category: 'tags',
  7099. fn: function () {
  7100. var self = this;
  7101. return self._tag_("h2");
  7102. return self;
  7103. },
  7104. source: unescape('h2%0A%20%20%20%20%5Eself%20tag%3A%20%27h2%27%0A')}),
  7105. smalltalk.HTMLCanvas);
  7106. smalltalk.addMethod(
  7107. '_h3',
  7108. smalltalk.method({
  7109. selector: 'h3',
  7110. category: 'tags',
  7111. fn: function () {
  7112. var self = this;
  7113. return self._tag_("h3");
  7114. return self;
  7115. },
  7116. source: unescape('h3%0A%20%20%20%20%5Eself%20tag%3A%20%27h3%27%0A')}),
  7117. smalltalk.HTMLCanvas);
  7118. smalltalk.addMethod(
  7119. '_h4',
  7120. smalltalk.method({
  7121. selector: 'h4',
  7122. category: 'tags',
  7123. fn: function () {
  7124. var self = this;
  7125. return self._tag_("h4");
  7126. return self;
  7127. },
  7128. source: unescape('h4%0A%20%20%20%20%5Eself%20tag%3A%20%27h4%27%0A')}),
  7129. smalltalk.HTMLCanvas);
  7130. smalltalk.addMethod(
  7131. '_h5',
  7132. smalltalk.method({
  7133. selector: 'h5',
  7134. category: 'tags',
  7135. fn: function () {
  7136. var self = this;
  7137. return self._tag_("h5");
  7138. return self;
  7139. },
  7140. source: unescape('h5%0A%20%20%20%20%5Eself%20tag%3A%20%27h5%27%0A')}),
  7141. smalltalk.HTMLCanvas);
  7142. smalltalk.addMethod(
  7143. '_h6',
  7144. smalltalk.method({
  7145. selector: 'h6',
  7146. category: 'tags',
  7147. fn: function () {
  7148. var self = this;
  7149. return self._tag_("h6");
  7150. return self;
  7151. },
  7152. source: unescape('h6%0A%20%20%20%20%5Eself%20tag%3A%20%27h6%27%0A')}),
  7153. smalltalk.HTMLCanvas);
  7154. smalltalk.addMethod(
  7155. '_p',
  7156. smalltalk.method({
  7157. selector: 'p',
  7158. category: 'tags',
  7159. fn: function () {
  7160. var self = this;
  7161. return self._tag_("p");
  7162. return self;
  7163. },
  7164. source: unescape('p%0A%20%20%20%20%5Eself%20tag%3A%20%27p%27%0A')}),
  7165. smalltalk.HTMLCanvas);
  7166. smalltalk.addMethod(
  7167. '_div',
  7168. smalltalk.method({
  7169. selector: 'div',
  7170. category: 'tags',
  7171. fn: function () {
  7172. var self = this;
  7173. return self._tag_("div");
  7174. return self;
  7175. },
  7176. source: unescape('div%0A%20%20%20%20%5Eself%20tag%3A%20%27div%27%0A')}),
  7177. smalltalk.HTMLCanvas);
  7178. smalltalk.addMethod(
  7179. '_span',
  7180. smalltalk.method({
  7181. selector: 'span',
  7182. category: 'tags',
  7183. fn: function () {
  7184. var self = this;
  7185. return self._tag_("span");
  7186. return self;
  7187. },
  7188. source: unescape('span%0A%20%20%20%20%5Eself%20tag%3A%20%27span%27%0A')}),
  7189. smalltalk.HTMLCanvas);
  7190. smalltalk.addMethod(
  7191. '_img',
  7192. smalltalk.method({
  7193. selector: 'img',
  7194. category: 'tags',
  7195. fn: function () {
  7196. var self = this;
  7197. return self._tag_("img");
  7198. return self;
  7199. },
  7200. source: unescape('img%0A%20%20%20%20%5Eself%20tag%3A%20%27img%27%0A')}),
  7201. smalltalk.HTMLCanvas);
  7202. smalltalk.addMethod(
  7203. '_ul',
  7204. smalltalk.method({
  7205. selector: 'ul',
  7206. category: 'tags',
  7207. fn: function () {
  7208. var self = this;
  7209. return self._tag_("ul");
  7210. return self;
  7211. },
  7212. source: unescape('ul%0A%20%20%20%20%5Eself%20tag%3A%20%27ul%27%0A')}),
  7213. smalltalk.HTMLCanvas);
  7214. smalltalk.addMethod(
  7215. '_ol',
  7216. smalltalk.method({
  7217. selector: 'ol',
  7218. category: 'tags',
  7219. fn: function () {
  7220. var self = this;
  7221. return self._tag_("ol");
  7222. return self;
  7223. },
  7224. source: unescape('ol%0A%20%20%20%20%5Eself%20tag%3A%20%27ol%27%0A')}),
  7225. smalltalk.HTMLCanvas);
  7226. smalltalk.addMethod(
  7227. '_li',
  7228. smalltalk.method({
  7229. selector: 'li',
  7230. category: 'tags',
  7231. fn: function () {
  7232. var self = this;
  7233. return self._tag_("li");
  7234. return self;
  7235. },
  7236. source: unescape('li%0A%20%20%20%20%5Eself%20tag%3A%20%27li%27%0A')}),
  7237. smalltalk.HTMLCanvas);
  7238. smalltalk.addMethod(
  7239. '_table',
  7240. smalltalk.method({
  7241. selector: 'table',
  7242. category: 'tags',
  7243. fn: function () {
  7244. var self = this;
  7245. return self._tag_("table");
  7246. return self;
  7247. },
  7248. source: unescape('table%0A%20%20%20%20%5Eself%20tag%3A%20%27table%27%0A')}),
  7249. smalltalk.HTMLCanvas);
  7250. smalltalk.addMethod(
  7251. '_tr',
  7252. smalltalk.method({
  7253. selector: 'tr',
  7254. category: 'tags',
  7255. fn: function () {
  7256. var self = this;
  7257. return self._tag_("tr");
  7258. return self;
  7259. },
  7260. source: unescape('tr%0A%20%20%20%20%5Eself%20tag%3A%20%27tr%27%0A')}),
  7261. smalltalk.HTMLCanvas);
  7262. smalltalk.addMethod(
  7263. '_td',
  7264. smalltalk.method({
  7265. selector: 'td',
  7266. category: 'tags',
  7267. fn: function () {
  7268. var self = this;
  7269. return self._tag_("td");
  7270. return self;
  7271. },
  7272. source: unescape('td%20%0A%20%20%20%20%5Eself%20tag%3A%20%27td%27%0A')}),
  7273. smalltalk.HTMLCanvas);
  7274. smalltalk.addMethod(
  7275. '_th',
  7276. smalltalk.method({
  7277. selector: 'th',
  7278. category: 'tags',
  7279. fn: function () {
  7280. var self = this;
  7281. return self._tag_("th");
  7282. return self;
  7283. },
  7284. source: unescape('th%0A%20%20%20%20%5Eself%20tag%3A%20%27th%27%0A')}),
  7285. smalltalk.HTMLCanvas);
  7286. smalltalk.addMethod(
  7287. '_form',
  7288. smalltalk.method({
  7289. selector: 'form',
  7290. category: 'tags',
  7291. fn: function () {
  7292. var self = this;
  7293. return self._tag_("form");
  7294. return self;
  7295. },
  7296. source: unescape('form%0A%20%20%20%20%5Eself%20tag%3A%20%27form%27%0A')}),
  7297. smalltalk.HTMLCanvas);
  7298. smalltalk.addMethod(
  7299. '_input',
  7300. smalltalk.method({
  7301. selector: 'input',
  7302. category: 'tags',
  7303. fn: function () {
  7304. var self = this;
  7305. return self._tag_("input");
  7306. return self;
  7307. },
  7308. source: unescape('input%0A%20%20%20%20%5Eself%20tag%3A%20%27input%27%0A')}),
  7309. smalltalk.HTMLCanvas);
  7310. smalltalk.addMethod(
  7311. '_button',
  7312. smalltalk.method({
  7313. selector: 'button',
  7314. category: 'tags',
  7315. fn: function () {
  7316. var self = this;
  7317. return self._tag_("button");
  7318. return self;
  7319. },
  7320. source: unescape('button%0A%20%20%20%20%5Eself%20tag%3A%20%27button%27%0A')}),
  7321. smalltalk.HTMLCanvas);
  7322. smalltalk.addMethod(
  7323. '_select',
  7324. smalltalk.method({
  7325. selector: 'select',
  7326. category: 'tags',
  7327. fn: function () {
  7328. var self = this;
  7329. return self._tag_("select");
  7330. return self;
  7331. },
  7332. source: unescape('select%0A%20%20%20%20%5Eself%20tag%3A%20%27select%27%0A')}),
  7333. smalltalk.HTMLCanvas);
  7334. smalltalk.addMethod(
  7335. '_option',
  7336. smalltalk.method({
  7337. selector: 'option',
  7338. category: 'tags',
  7339. fn: function () {
  7340. var self = this;
  7341. return self._tag_("option");
  7342. return self;
  7343. },
  7344. source: unescape('option%0A%20%20%20%20%5Eself%20tag%3A%20%27option%27%0A')}),
  7345. smalltalk.HTMLCanvas);
  7346. smalltalk.addMethod(
  7347. '_textarea',
  7348. smalltalk.method({
  7349. selector: 'textarea',
  7350. category: 'tags',
  7351. fn: function () {
  7352. var self = this;
  7353. return self._tag_("textarea");
  7354. return self;
  7355. },
  7356. source: unescape('textarea%0A%20%20%20%20%5Eself%20tag%3A%20%27textarea%27%0A')}),
  7357. smalltalk.HTMLCanvas);
  7358. smalltalk.addMethod(
  7359. '_a',
  7360. smalltalk.method({
  7361. selector: 'a',
  7362. category: 'tags',
  7363. fn: function () {
  7364. var self = this;
  7365. return self._tag_("a");
  7366. return self;
  7367. },
  7368. source: unescape('a%0A%20%20%20%20%5Eself%20tag%3A%20%27a%27%0A')}),
  7369. smalltalk.HTMLCanvas);
  7370. smalltalk.addMethod(
  7371. '_appendToJQuery_',
  7372. smalltalk.method({
  7373. selector: 'appendToJQuery:',
  7374. category: '*JQuery',
  7375. fn: function (aJQuery) {
  7376. var self = this;
  7377. aJQuery._appendElement_(self['@root']._element());
  7378. return self;
  7379. },
  7380. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20aJQuery%20appendElement%3A%20root%20element%0A')}),
  7381. smalltalk.HTMLCanvas);
  7382. smalltalk.addMethod(
  7383. '_canvas',
  7384. smalltalk.method({
  7385. selector: 'canvas',
  7386. category: 'tags',
  7387. fn: function () {
  7388. var self = this;
  7389. return self._tag_("canvas");
  7390. return self;
  7391. },
  7392. source: unescape('canvas%0A%09%5Eself%20tag%3A%20%27canvas%27%0A')}),
  7393. smalltalk.HTMLCanvas);
  7394. smalltalk.addClass('TagBrush', smalltalk.Object, ['canvas', 'element'], 'Canvas');
  7395. smalltalk.addMethod(
  7396. '_contents_',
  7397. smalltalk.method({
  7398. selector: 'contents:',
  7399. category: 'adding',
  7400. fn: function (anObject) {
  7401. var self = this;
  7402. self._asJQuery()._empty();
  7403. self._append_(anObject);
  7404. return self;
  7405. },
  7406. source: unescape('contents%3A%20anObject%0A%20%20%20%20self%20asJQuery%20empty.%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  7407. smalltalk.TagBrush);
  7408. smalltalk.addMethod(
  7409. '_addBrush_',
  7410. smalltalk.method({
  7411. selector: 'addBrush:',
  7412. category: 'adding',
  7413. fn: function (aTagBrush) {
  7414. var self = this;
  7415. self._appendChild_(aTagBrush._element());
  7416. return aTagBrush;
  7417. return self;
  7418. },
  7419. source: unescape('addBrush%3A%20aTagBrush%0A%20%20%20%20self%20appendChild%3A%20aTagBrush%20element.%0A%20%20%20%20%5EaTagBrush%0A')}),
  7420. smalltalk.TagBrush);
  7421. smalltalk.addMethod(
  7422. '_with_',
  7423. smalltalk.method({
  7424. selector: 'with:',
  7425. category: 'adding',
  7426. fn: function (anObject) {
  7427. var self = this;
  7428. self._append_(anObject);
  7429. return self;
  7430. },
  7431. source: unescape('with%3A%20anObject%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  7432. smalltalk.TagBrush);
  7433. smalltalk.addMethod(
  7434. '_append_',
  7435. smalltalk.method({
  7436. selector: 'append:',
  7437. category: 'adding',
  7438. fn: function (anObject) {
  7439. var self = this;
  7440. anObject._appendToBrush_(self);
  7441. return self;
  7442. },
  7443. source: unescape('append%3A%20anObject%0A%20%20%20%20anObject%20appendToBrush%3A%20self%0A')}),
  7444. smalltalk.TagBrush);
  7445. smalltalk.addMethod(
  7446. '_appendToBrush_',
  7447. smalltalk.method({
  7448. selector: 'appendToBrush:',
  7449. category: 'adding',
  7450. fn: function (aTagBrush) {
  7451. var self = this;
  7452. aTagBrush._addBrush_(self);
  7453. return self;
  7454. },
  7455. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20aTagBrush%20addBrush%3A%20self%0A')}),
  7456. smalltalk.TagBrush);
  7457. smalltalk.addMethod(
  7458. '_appendBlock_',
  7459. smalltalk.method({
  7460. selector: 'appendBlock:',
  7461. category: 'adding',
  7462. fn: function (aBlock) {
  7463. var self = this;
  7464. var root = nil;
  7465. root = canvas._root();
  7466. canvas._root_(self);
  7467. aBlock._value_(canvas);
  7468. canvas._root_(root);
  7469. return self;
  7470. },
  7471. source: unescape('appendBlock%3A%20aBlock%0A%20%20%20%20%7C%20root%20%7C%0A%20%20%20%20root%20%3A%3D%20canvas%20root.%0A%20%20%20%20canvas%20root%3A%20self.%0A%20%20%20%20aBlock%20value%3A%20canvas.%0A%20%20%20%20canvas%20root%3A%20root%0A')}),
  7472. smalltalk.TagBrush);
  7473. smalltalk.addMethod(
  7474. '_appendChild_',
  7475. smalltalk.method({
  7476. selector: 'appendChild:',
  7477. category: 'adding',
  7478. fn: function (anElement) {
  7479. var self = this;
  7480. (function () {self['@element'].appendChild(anElement);}());
  7481. return self;
  7482. },
  7483. source: unescape('appendChild%3A%20anElement%0A%20%20%20%20%7B%27self%5B%27%27@element%27%27%5D.appendChild%28anElement%29%27%7D%0A')}),
  7484. smalltalk.TagBrush);
  7485. smalltalk.addMethod(
  7486. '_appendString_',
  7487. smalltalk.method({
  7488. selector: 'appendString:',
  7489. category: 'adding',
  7490. fn: function (aString) {
  7491. var self = this;
  7492. self._appendChild_(self._createTextNodeFor_(aString));
  7493. return self;
  7494. },
  7495. source: unescape('appendString%3A%20aString%0A%20%20%20%20self%20appendChild%3A%20%28self%20createTextNodeFor%3A%20aString%29%0A')}),
  7496. smalltalk.TagBrush);
  7497. smalltalk.addMethod(
  7498. '_at_put_',
  7499. smalltalk.method({
  7500. selector: 'at:put:',
  7501. category: 'attributes',
  7502. fn: function (aString, aValue) {
  7503. var self = this;
  7504. (function () {self['@element'].setAttribute(aString, aValue);}());
  7505. return self;
  7506. },
  7507. source: unescape('at%3A%20aString%20put%3A%20aValue%0A%20%20%20%20%7B%27self%5B%27%27@element%27%27%5D.setAttribute%28aString%2C%20aValue%29%27%7D%0A')}),
  7508. smalltalk.TagBrush);
  7509. smalltalk.addMethod(
  7510. '_removeAt_',
  7511. smalltalk.method({
  7512. selector: 'removeAt:',
  7513. category: 'attributes',
  7514. fn: function (aString) {
  7515. var self = this;
  7516. (function () {self['@element'].removeAttribute(aString);}());
  7517. return self;
  7518. },
  7519. source: unescape('removeAt%3A%20aString%0A%20%20%20%20%7B%27self%5B%27%27@element%27%27%5D.removeAttribute%28aString%29%27%7D%0A')}),
  7520. smalltalk.TagBrush);
  7521. smalltalk.addMethod(
  7522. '_class_',
  7523. smalltalk.method({
  7524. selector: 'class:',
  7525. category: 'attributes',
  7526. fn: function (aString) {
  7527. var self = this;
  7528. self._at_put_("class", aString);
  7529. return self;
  7530. },
  7531. source: unescape('class%3A%20aString%0A%20%20%20%20self%20at%3A%20%27class%27%20put%3A%20aString%0A')}),
  7532. smalltalk.TagBrush);
  7533. smalltalk.addMethod(
  7534. '_id_',
  7535. smalltalk.method({
  7536. selector: 'id:',
  7537. category: 'attributes',
  7538. fn: function (aString) {
  7539. var self = this;
  7540. self._at_put_("id", aString);
  7541. return self;
  7542. },
  7543. source: unescape('id%3A%20aString%0A%20%20%20%20self%20at%3A%20%27id%27%20put%3A%20aString%0A')}),
  7544. smalltalk.TagBrush);
  7545. smalltalk.addMethod(
  7546. '_src_',
  7547. smalltalk.method({
  7548. selector: 'src:',
  7549. category: 'attributes',
  7550. fn: function (aString) {
  7551. var self = this;
  7552. self._at_put_("src", aString);
  7553. return self;
  7554. },
  7555. source: unescape('src%3A%20aString%0A%20%20%20%20self%20%20at%3A%20%27src%27%20put%3A%20aString%0A')}),
  7556. smalltalk.TagBrush);
  7557. smalltalk.addMethod(
  7558. '_href_',
  7559. smalltalk.method({
  7560. selector: 'href:',
  7561. category: 'attributes',
  7562. fn: function (aString) {
  7563. var self = this;
  7564. self._at_put_("href", aString);
  7565. return self;
  7566. },
  7567. source: unescape('href%3A%20aString%0A%20%20%20%20self%20at%3A%20%27href%27%20put%3A%20aString%0A')}),
  7568. smalltalk.TagBrush);
  7569. smalltalk.addMethod(
  7570. '_title_',
  7571. smalltalk.method({
  7572. selector: 'title:',
  7573. category: 'attributes',
  7574. fn: function (aString) {
  7575. var self = this;
  7576. self._at_put_("title", aString);
  7577. return self;
  7578. },
  7579. source: unescape('title%3A%20aString%0A%20%20%20%20self%20at%3A%20%27title%27%20put%3A%20aString%0A')}),
  7580. smalltalk.TagBrush);
  7581. smalltalk.addMethod(
  7582. '_style_',
  7583. smalltalk.method({
  7584. selector: 'style:',
  7585. category: 'attributes',
  7586. fn: function (aString) {
  7587. var self = this;
  7588. self._at_put_("style", aString);
  7589. return self;
  7590. },
  7591. source: unescape('style%3A%20aString%0A%20%20%20%20self%20at%3A%20%27style%27%20put%3A%20aString%0A')}),
  7592. smalltalk.TagBrush);
  7593. smalltalk.addMethod(
  7594. '_initializeFromString_canvas_',
  7595. smalltalk.method({
  7596. selector: 'initializeFromString:canvas:',
  7597. category: 'initialization',
  7598. fn: function (aString, aCanvas) {
  7599. var self = this;
  7600. self['@element'] = self._createElementFor_(aString);
  7601. canvas = aCanvas;
  7602. return self;
  7603. },
  7604. source: unescape('initializeFromString%3A%20aString%20canvas%3A%20aCanvas%0A%20%20%20%20element%20%3A%3D%20self%20createElementFor%3A%20aString.%0A%20%20%20%20canvas%20%3A%3D%20aCanvas%0A')}),
  7605. smalltalk.TagBrush);
  7606. smalltalk.addMethod(
  7607. '_element',
  7608. smalltalk.method({
  7609. selector: 'element',
  7610. category: 'accessing',
  7611. fn: function () {
  7612. var self = this;
  7613. return self['@element'];
  7614. return self;
  7615. },
  7616. source: unescape('element%0A%20%20%20%20%5Eelement%0A')}),
  7617. smalltalk.TagBrush);
  7618. smalltalk.addMethod(
  7619. '_asJQuery',
  7620. smalltalk.method({
  7621. selector: 'asJQuery',
  7622. category: 'converting',
  7623. fn: function () {
  7624. var self = this;
  7625. return function () {return smalltalk.JQuery._from_(jQuery(self['@element']));}();
  7626. return self;
  7627. },
  7628. source: unescape('asJQuery%0A%20%20%20%20%5E%7B%27return%20smalltalk.JQuery._from_%28jQuery%28self%5B%27%27@element%27%27%5D%29%29%27%7D%0A')}),
  7629. smalltalk.TagBrush);
  7630. smalltalk.addMethod(
  7631. '_asJQueryDo_',
  7632. smalltalk.method({
  7633. selector: 'asJQueryDo:',
  7634. category: 'converting',
  7635. fn: function (aBlock) {
  7636. var self = this;
  7637. aBlock._value_(self._asJQuery());
  7638. return self;
  7639. },
  7640. source: unescape('asJQueryDo%3A%20aBlock%0A%20%20%20%20aBlock%20value%3A%20self%20asJQuery%0A')}),
  7641. smalltalk.TagBrush);
  7642. smalltalk.addMethod(
  7643. '_onKeyDown_',
  7644. smalltalk.method({
  7645. selector: 'onKeyDown:',
  7646. category: 'events',
  7647. fn: function (aBlock) {
  7648. var self = this;
  7649. self._asJQuery()._on_do_("keydown", aBlock);
  7650. return self;
  7651. },
  7652. source: unescape('onKeyDown%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keydown%27%20do%3A%20aBlock%0A')}),
  7653. smalltalk.TagBrush);
  7654. smalltalk.addMethod(
  7655. '_onKeyPress_',
  7656. smalltalk.method({
  7657. selector: 'onKeyPress:',
  7658. category: 'events',
  7659. fn: function (aBlock) {
  7660. var self = this;
  7661. self._asJQuery()._on_do_("keypress", aBlock);
  7662. return self;
  7663. },
  7664. source: unescape('onKeyPress%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keypress%27%20do%3A%20aBlock%0A')}),
  7665. smalltalk.TagBrush);
  7666. smalltalk.addMethod(
  7667. '_onKeyUp_',
  7668. smalltalk.method({
  7669. selector: 'onKeyUp:',
  7670. category: 'events',
  7671. fn: function (aBlock) {
  7672. var self = this;
  7673. self._asJQuery()._on_do_("keyup", aBlock);
  7674. return self;
  7675. },
  7676. source: unescape('onKeyUp%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keyup%27%20do%3A%20aBlock%0A')}),
  7677. smalltalk.TagBrush);
  7678. smalltalk.addMethod(
  7679. '_onFocus_',
  7680. smalltalk.method({
  7681. selector: 'onFocus:',
  7682. category: 'events',
  7683. fn: function (aBlock) {
  7684. var self = this;
  7685. self._asJQuery()._on_do_("focus", aBlock);
  7686. return self;
  7687. },
  7688. source: unescape('onFocus%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27focus%27%20do%3A%20aBlock%0A')}),
  7689. smalltalk.TagBrush);
  7690. smalltalk.addMethod(
  7691. '_onBlur_',
  7692. smalltalk.method({
  7693. selector: 'onBlur:',
  7694. category: 'events',
  7695. fn: function (aBlock) {
  7696. var self = this;
  7697. self._asJQuery()._on_do_("blur", aBlock);
  7698. return self;
  7699. },
  7700. source: unescape('onBlur%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27blur%27%20do%3A%20aBlock%0A')}),
  7701. smalltalk.TagBrush);
  7702. smalltalk.addMethod(
  7703. '_onChange_',
  7704. smalltalk.method({
  7705. selector: 'onChange:',
  7706. category: 'events',
  7707. fn: function (aBlock) {
  7708. var self = this;
  7709. self._asJQuery()._on_do_("change", aBlock);
  7710. return self;
  7711. },
  7712. source: unescape('onChange%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27change%27%20do%3A%20aBlock%0A')}),
  7713. smalltalk.TagBrush);
  7714. smalltalk.addMethod(
  7715. '_onClick_',
  7716. smalltalk.method({
  7717. selector: 'onClick:',
  7718. category: 'events',
  7719. fn: function (aBlock) {
  7720. var self = this;
  7721. self._asJQuery()._on_do_("click", aBlock);
  7722. return self;
  7723. },
  7724. source: unescape('onClick%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27click%27%20do%3A%20aBlock%0A')}),
  7725. smalltalk.TagBrush);
  7726. smalltalk.addMethod(
  7727. '_createElementFor_',
  7728. smalltalk.method({
  7729. selector: 'createElementFor:',
  7730. category: 'private',
  7731. fn: function (aString) {
  7732. var self = this;
  7733. return function () {return document.createElement(String(aString));}();
  7734. return self;
  7735. },
  7736. source: unescape('createElementFor%3A%20aString%0A%20%20%20%20%5E%7B%27return%20document.createElement%28String%28aString%29%29%27%7D%0A')}),
  7737. smalltalk.TagBrush);
  7738. smalltalk.addMethod(
  7739. '_createTextNodeFor_',
  7740. smalltalk.method({
  7741. selector: 'createTextNodeFor:',
  7742. category: 'private',
  7743. fn: function (aString) {
  7744. var self = this;
  7745. return function () {return document.createTextNode(String(aString));}();
  7746. return self;
  7747. },
  7748. source: unescape('createTextNodeFor%3A%20aString%0A%20%20%20%20%5E%7B%27return%20document.createTextNode%28String%28aString%29%29%27%7D%0A')}),
  7749. smalltalk.TagBrush);
  7750. smalltalk.addMethod(
  7751. '_fromString_canvas_',
  7752. smalltalk.method({
  7753. selector: 'fromString:canvas:',
  7754. category: 'instance creation',
  7755. fn: function (aString, aCanvas) {
  7756. var self = this;
  7757. return function ($rec) {$rec._initializeFromString_canvas_(aString, aCanvas);return $rec._yourself();}(self._new());
  7758. return self;
  7759. },
  7760. source: unescape('fromString%3A%20aString%20canvas%3A%20aCanvas%0A%20%20%20%20%5Eself%20new%0A%09initializeFromString%3A%20aString%20canvas%3A%20aCanvas%3B%0A%09yourself%0A')}),
  7761. smalltalk.TagBrush.klass);
  7762. smalltalk.addClass('Widget', smalltalk.Object, ['root'], 'Canvas');
  7763. smalltalk.addMethod(
  7764. '_root',
  7765. smalltalk.method({
  7766. selector: 'root',
  7767. category: 'accessing',
  7768. fn: function () {
  7769. var self = this;
  7770. return self['@root'];
  7771. return self;
  7772. },
  7773. source: unescape('root%0A%20%20%20%20%5Eroot%0A')}),
  7774. smalltalk.Widget);
  7775. smalltalk.addMethod(
  7776. '_appendToBrush_',
  7777. smalltalk.method({
  7778. selector: 'appendToBrush:',
  7779. category: 'adding',
  7780. fn: function (aTagBrush) {
  7781. var self = this;
  7782. self._appendToJQuery_(aTagBrush._asJQuery());
  7783. return self;
  7784. },
  7785. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20self%20appendToJQuery%3A%20aTagBrush%20asJQuery%0A')}),
  7786. smalltalk.Widget);
  7787. smalltalk.addMethod(
  7788. '_appendToJQuery_',
  7789. smalltalk.method({
  7790. selector: 'appendToJQuery:',
  7791. category: 'adding',
  7792. fn: function (aJQuery) {
  7793. var self = this;
  7794. self._render();
  7795. aJQuery._append_(self._root()._asJQuery());
  7796. return self;
  7797. },
  7798. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20self%20render.%0A%20%20%20%20aJQuery%20append%3A%20self%20root%20asJQuery%0A')}),
  7799. smalltalk.Widget);
  7800. smalltalk.addMethod(
  7801. '_alert_',
  7802. smalltalk.method({
  7803. selector: 'alert:',
  7804. category: 'actions',
  7805. fn: function (aString) {
  7806. var self = this;
  7807. (function () {alert(aString);}());
  7808. return self;
  7809. },
  7810. source: unescape('alert%3A%20aString%0A%20%20%20%20%7B%27alert%28aString%29%27%7D%0A')}),
  7811. smalltalk.Widget);
  7812. smalltalk.addMethod(
  7813. '_confirm_',
  7814. smalltalk.method({
  7815. selector: 'confirm:',
  7816. category: 'actions',
  7817. fn: function (aString) {
  7818. var self = this;
  7819. return function () {return window.confirm(aString);}();
  7820. return self;
  7821. },
  7822. source: unescape('confirm%3A%20aString%0A%20%20%20%20%5E%7B%27return%20window.confirm%28aString%29%27%7D%0A')}),
  7823. smalltalk.Widget);
  7824. smalltalk.addMethod(
  7825. '_prompt_',
  7826. smalltalk.method({
  7827. selector: 'prompt:',
  7828. category: 'actions',
  7829. fn: function (aString) {
  7830. var self = this;
  7831. return self._prompt_default_(aString, "");
  7832. return self;
  7833. },
  7834. source: unescape('prompt%3A%20aString%0A%20%20%20%20%5Eself%20prompt%3A%20aString%20default%3A%20%27%27%0A')}),
  7835. smalltalk.Widget);
  7836. smalltalk.addMethod(
  7837. '_prompt_default_',
  7838. smalltalk.method({
  7839. selector: 'prompt:default:',
  7840. category: 'actions',
  7841. fn: function (aString, anotherString) {
  7842. var self = this;
  7843. return function () {return window.prompt(aString, anotherString);}();
  7844. return self;
  7845. },
  7846. source: unescape('prompt%3A%20aString%20default%3A%20anotherString%0A%20%20%20%20%5E%7B%27return%20window.prompt%28aString%2C%20anotherString%29%27%7D%0A')}),
  7847. smalltalk.Widget);
  7848. smalltalk.addMethod(
  7849. '_update',
  7850. smalltalk.method({
  7851. selector: 'update',
  7852. category: 'actions',
  7853. fn: function () {
  7854. var self = this;
  7855. var canvas = nil;
  7856. canvas = smalltalk.HTMLCanvas._new();
  7857. canvas._root_(self._root());
  7858. self._root()._asJQuery()._empty();
  7859. self._renderOn_(canvas);
  7860. return self;
  7861. },
  7862. source: unescape('update%0A%20%20%20%20%7C%20canvas%20%7C%0A%20%20%20%20canvas%20%3A%3D%20HTMLCanvas%20new.%0A%20%20%20%20canvas%20root%3A%20self%20root.%0A%20%20%20%20self%20root%20asJQuery%20empty.%0A%20%20%20%20self%20renderOn%3A%20canvas%0A')}),
  7863. smalltalk.Widget);
  7864. smalltalk.addMethod(
  7865. '_render',
  7866. smalltalk.method({
  7867. selector: 'render',
  7868. category: 'rendering',
  7869. fn: function () {
  7870. var self = this;
  7871. var canvas = nil;
  7872. canvas = smalltalk.HTMLCanvas._new();
  7873. self['@root'] = canvas._root();
  7874. self._renderOn_(canvas);
  7875. return self;
  7876. },
  7877. source: unescape('render%0A%20%20%20%20%7C%20canvas%20%7C%0A%20%20%20%20canvas%20%3A%3D%20HTMLCanvas%20new.%0A%20%20%20%20root%20%3A%3D%20canvas%20root.%0A%20%20%20%20self%20renderOn%3A%20canvas%0A')}),
  7878. smalltalk.Widget);
  7879. smalltalk.addMethod(
  7880. '_renderOn_',
  7881. smalltalk.method({
  7882. selector: 'renderOn:',
  7883. category: 'rendering',
  7884. fn: function (html) {
  7885. var self = this;
  7886. return self;
  7887. },
  7888. source: unescape('renderOn%3A%20html%0A%20%20%20%20self%0A')}),
  7889. smalltalk.Widget);
  7890. smalltalk.addClass('CanvasBrush', smalltalk.TagBrush, [], 'Canvas');
  7891. smalltalk.addMethod(
  7892. '_createElement',
  7893. smalltalk.method({
  7894. selector: 'createElement',
  7895. category: 'private',
  7896. fn: function () {
  7897. var self = this;
  7898. return function () {return document.createElement("canvas");}();
  7899. return self;
  7900. },
  7901. source: unescape('createElement%0A%20%20%20%20%5E%7B%27return%20document.createElement%28%27%27canvas%27%27%29%27%7D%0A')}),
  7902. smalltalk.CanvasBrush);
  7903. smalltalk.addMethod(
  7904. '_initializeWithCanvas_',
  7905. smalltalk.method({
  7906. selector: 'initializeWithCanvas:',
  7907. category: 'initialization',
  7908. fn: function (aCanvas) {
  7909. var self = this;
  7910. canvas = aCanvas;
  7911. return self;
  7912. },
  7913. source: unescape('initializeWithCanvas%3A%20aCanvas%0A%09canvas%20%3A%3D%20aCanvas')}),
  7914. smalltalk.CanvasBrush);
  7915. smalltalk.addMethod(
  7916. '_canvas_',
  7917. smalltalk.method({
  7918. selector: 'canvas:',
  7919. category: 'instance creation',
  7920. fn: function (aCanvas) {
  7921. var self = this;
  7922. return function ($rec) {$rec._initializeWithCanvas_(aCanvas);return $rec._yourself();}(self._new());
  7923. return self;
  7924. },
  7925. source: unescape('canvas%3A%20aCanvas%0A%09%5Eself%20new%0A%09%09initializeWithCanvas%3A%20aCanvas%3B%0A%09%09yourself')}),
  7926. smalltalk.CanvasBrush.klass);
  7927. smalltalk.addClass('Counter', smalltalk.Widget, ['count'], 'Examples');
  7928. smalltalk.addMethod(
  7929. '_initialize',
  7930. smalltalk.method({
  7931. selector: 'initialize',
  7932. category: 'initialization',
  7933. fn: function () {
  7934. var self = this;
  7935. self.klass.superclass.fn.prototype._initialize.apply(self, []);
  7936. self['@count'] = 0;
  7937. return self;
  7938. },
  7939. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20count%20%3A%3D%200%0A')}),
  7940. smalltalk.Counter);
  7941. smalltalk.addMethod(
  7942. '_renderOn_',
  7943. smalltalk.method({
  7944. selector: 'renderOn:',
  7945. category: 'rendering',
  7946. fn: function (html) {
  7947. var self = this;
  7948. html._h1()._with_(self['@count']._asString());
  7949. (function ($rec) {$rec._with_(unescape("++"));return $rec._onClick_(function () {return self._increase();});}(html._button()));
  7950. (function ($rec) {$rec._with_(unescape("--"));return $rec._onClick_(function () {return self._decrease();});}(html._button()));
  7951. return self;
  7952. },
  7953. source: unescape('renderOn%3A%20html%0A%20%20%20%20html%20h1%20with%3A%20count%20asString.%0A%20%20%20%20html%20button%0A%09with%3A%20%27++%27%3B%0A%09onClick%3A%20%5Bself%20increase%5D.%0A%20%20%20%20html%20button%0A%09with%3A%20%27--%27%3B%0A%09onClick%3A%20%5Bself%20decrease%5D%0A')}),
  7954. smalltalk.Counter);
  7955. smalltalk.addMethod(
  7956. '_increase',
  7957. smalltalk.method({
  7958. selector: 'increase',
  7959. category: 'actions',
  7960. fn: function () {
  7961. var self = this;
  7962. self['@count'] = self['@count'].__plus(1);
  7963. self._update();
  7964. return self;
  7965. },
  7966. source: unescape('increase%0A%20%20%20%20count%20%3A%3D%20count%20+%201.%0A%20%20%20%20self%20update%0A')}),
  7967. smalltalk.Counter);
  7968. smalltalk.addMethod(
  7969. '_decrease',
  7970. smalltalk.method({
  7971. selector: 'decrease',
  7972. category: 'actions',
  7973. fn: function () {
  7974. var self = this;
  7975. self['@count'] = self['@count'].__minus(1);
  7976. self._update();
  7977. return self;
  7978. },
  7979. source: unescape('decrease%0A%20%20%20%20count%20%3A%3D%20count%20-%201.%0A%20%20%20%20self%20update%0A')}),
  7980. smalltalk.Counter);
  7981. smalltalk.addClass('Tetris', smalltalk.Widget, ['renderingContext', 'timer', 'speed', 'score', 'rows', 'movingPiece'], 'Examples');
  7982. smalltalk.addMethod(
  7983. '_renderOn_',
  7984. smalltalk.method({
  7985. selector: 'renderOn:',
  7986. category: 'rendering',
  7987. fn: function (html) {
  7988. var self = this;
  7989. (function ($rec) {$rec._class_("tetris");return $rec._with_(function () {html._h3()._with_("Tetris");self._renderCanvasOn_(html);return self._renderButtonsOn_(html);});}(html._div()));
  7990. return self;
  7991. },
  7992. source: unescape('renderOn%3A%20html%0A%09html%20div%0A%09%09class%3A%20%27tetris%27%3B%0A%09%09with%3A%20%5B%0A%09%09%09html%20h3%20with%3A%20%27Tetris%27.%0A%09%09%09self%20renderCanvasOn%3A%20html.%0A%09%09%09self%20renderButtonsOn%3A%20html%5D')}),
  7993. smalltalk.Tetris);
  7994. smalltalk.addMethod(
  7995. '_renderCanvasOn_',
  7996. smalltalk.method({
  7997. selector: 'renderCanvasOn:',
  7998. category: 'rendering',
  7999. fn: function (html) {
  8000. var self = this;
  8001. var canvas = nil;
  8002. canvas = html._canvas();
  8003. canvas._at_put_("width", self._width()._asString());
  8004. canvas._at_put_("height", self._height()._asString());
  8005. self['@renderingContext'] = smalltalk.CanvasRenderingContext._tagBrush_(canvas);
  8006. self._redraw();
  8007. return self;
  8008. },
  8009. source: unescape('renderCanvasOn%3A%20html%0A%09%7C%20canvas%20%7C%0A%09canvas%20%3A%3D%20html%20canvas.%0A%09canvas%20at%3A%20%27width%27%20put%3A%20self%20width%20asString.%0A%09canvas%20at%3A%20%27height%27%20put%3A%20self%20height%20asString.%0A%09renderingContext%20%3A%3D%20CanvasRenderingContext%20tagBrush%3A%20canvas.%0A%09self%20redraw')}),
  8010. smalltalk.Tetris);
  8011. smalltalk.addMethod(
  8012. '_renderButtonsOn_',
  8013. smalltalk.method({
  8014. selector: 'renderButtonsOn:',
  8015. category: 'rendering',
  8016. fn: function (html) {
  8017. var self = this;
  8018. (function ($rec) {$rec._class_("tetris_buttons");return $rec._with_(function () {(function ($rec) {$rec._with_("New game");return $rec._onClick_(function () {return self._startNewGame();});}(html._button()));return function ($rec) {$rec._with_(unescape("play/pause"));return $rec._onClick_(function () {return self._update();});}(html._button());});}(html._div()));
  8019. return self;
  8020. },
  8021. source: unescape('renderButtonsOn%3A%20html%0A%09html%20div%20%0A%09%09class%3A%20%27tetris_buttons%27%3B%0A%09%09with%3A%20%5B%0A%09%09%09html%20button%0A%09%09%09%09with%3A%20%27New%20game%27%3B%0A%09%09%09%09onClick%3A%20%5Bself%20startNewGame%5D.%0A%09%09%09html%20button%0A%09%09%09%09with%3A%20%27play/pause%27%3B%0A%09%09%09%09onClick%3A%20%5Bself%20update%5D%5D')}),
  8022. smalltalk.Tetris);
  8023. smalltalk.addMethod(
  8024. '_initialize',
  8025. smalltalk.method({
  8026. selector: 'initialize',
  8027. category: 'initialization',
  8028. fn: function () {
  8029. var self = this;
  8030. self.klass.superclass.fn.prototype._initialize.apply(self, []);
  8031. self._newGame();
  8032. return self;
  8033. },
  8034. source: unescape('initialize%0A%09super%20initialize.%0A%09self%20newGame')}),
  8035. smalltalk.Tetris);
  8036. smalltalk.addMethod(
  8037. '_startNewGame',
  8038. smalltalk.method({
  8039. selector: 'startNewGame',
  8040. category: 'actions',
  8041. fn: function () {
  8042. var self = this;
  8043. self._newGame();
  8044. self['@timer']._ifNotNil_(function () {return self['@timer']._clearInterval();});
  8045. self['@timer'] = function () {return self._nextStep();}._valueWithInterval_(self['@speed']);
  8046. return self;
  8047. },
  8048. source: unescape('startNewGame%0A%09self%20newGame.%0A%09timer%20ifNotNil%3A%20%5Btimer%20clearInterval%5D.%0A%09timer%20%3A%3D%20%5Bself%20nextStep%5D%20valueWithInterval%3A%20speed')}),
  8049. smalltalk.Tetris);
  8050. smalltalk.addMethod(
  8051. '_width',
  8052. smalltalk.method({
  8053. selector: 'width',
  8054. category: 'accessing',
  8055. fn: function () {
  8056. var self = this;
  8057. return self._class()._width();
  8058. return self;
  8059. },
  8060. source: unescape('width%0A%09%5Eself%20class%20width')}),
  8061. smalltalk.Tetris);
  8062. smalltalk.addMethod(
  8063. '_height',
  8064. smalltalk.method({
  8065. selector: 'height',
  8066. category: 'accessing',
  8067. fn: function () {
  8068. var self = this;
  8069. return self._class()._height();
  8070. return self;
  8071. },
  8072. source: unescape('height%0A%09%5Eself%20class%20height')}),
  8073. smalltalk.Tetris);
  8074. smalltalk.addMethod(
  8075. '_nextStep',
  8076. smalltalk.method({
  8077. selector: 'nextStep',
  8078. category: 'actions',
  8079. fn: function () {
  8080. var self = this;
  8081. self['@movingPiece']._ifNil_(function () {return self._newPiece();});
  8082. self['@movingPiece']._canMoveIn_(self)._ifTrue_ifFalse_(function () {return self['@movingPiece']._position_(self['@movingPiece']._position().__plus((0).__at(1)));}, function () {return self._newPiece();});
  8083. self._redraw();
  8084. return self;
  8085. },
  8086. source: unescape('nextStep%0A%09movingPiece%20ifNil%3A%20%5Bself%20newPiece%5D.%0A%09%28movingPiece%20canMoveIn%3A%20self%29%0A%09%09ifTrue%3A%20%5BmovingPiece%20position%3A%20movingPiece%20position%20+%20%280@1%29%5D%0A%09%09ifFalse%3A%20%5Bself%20newPiece%5D.%0A%09self%20redraw%0A%09')}),
  8087. smalltalk.Tetris);
  8088. smalltalk.addMethod(
  8089. '_redraw',
  8090. smalltalk.method({
  8091. selector: 'redraw',
  8092. category: 'actions',
  8093. fn: function () {
  8094. var self = this;
  8095. self['@renderingContext']._clearRectFrom_to_((0).__at(self._width()), (0).__at(self._height()));
  8096. (function ($rec) {$rec._drawMap();return $rec._drawPiece();}(self));
  8097. return self;
  8098. },
  8099. source: unescape('redraw%0A%09renderingContext%20clearRectFrom%3A%200@%20self%20width%20to%3A%200@%20self%20height.%0A%09self%20%0A%09%09drawMap%3B%0A%09%09drawPiece')}),
  8100. smalltalk.Tetris);
  8101. smalltalk.addMethod(
  8102. '_drawMap',
  8103. smalltalk.method({
  8104. selector: 'drawMap',
  8105. category: 'actions',
  8106. fn: function () {
  8107. var self = this;
  8108. (function ($rec) {$rec._fillStyle_(unescape("%23fafafa"));return $rec._fillRectFrom_to_((0).__at(0), self._width().__at(self._height()));}(self['@renderingContext']));
  8109. (function ($rec) {$rec._lineWidth_(0.5);return $rec._strokeStyle_(unescape("%23999"));}(self['@renderingContext']));
  8110. (0)._to_do_(self._class()._squares()._x(), function (each) {var x = nil;x = each.__star(self._class()._squareSize());return self._drawLineFrom_to_(x.__at(0), x.__at(self._height()));});
  8111. (0)._to_do_(self._class()._squares()._y(), function (each) {var y = nil;y = each.__star(self._class()._squareSize());return self._drawLineFrom_to_((0).__at(y), self._width().__at(y));});
  8112. return self;
  8113. },
  8114. source: unescape('drawMap%0A%09renderingContext%20%0A%09%09fillStyle%3A%20%27%23fafafa%27%3B%0A%09%09fillRectFrom%3A%200@0%20to%3A%20self%20width@self%20height.%0A%09renderingContext%20%0A%09%09lineWidth%3A%200.5%3B%0A%09%09strokeStyle%3A%20%27%23999%27.%0A%090%20to%3A%20self%20class%20squares%20x%20do%3A%20%5B%3Aeach%20%7C%20%7C%20x%20%7C%0A%09%09x%20%3A%3D%20each%20*%20self%20class%20squareSize.%0A%09%09self%20drawLineFrom%3A%20x@0%20to%3A%20x@self%20height%5D.%0A%090%20to%3A%20self%20class%20squares%20y%20do%3A%20%5B%3Aeach%20%7C%20%7C%20y%20%7C%0A%09%09y%20%3A%3D%20each%20*%20self%20class%20squareSize.%0A%09%09self%20drawLineFrom%3A%200@y%20to%3A%20self%20width@y%5D.')}),
  8115. smalltalk.Tetris);
  8116. smalltalk.addMethod(
  8117. '_drawLineFrom_to_',
  8118. smalltalk.method({
  8119. selector: 'drawLineFrom:to:',
  8120. category: 'actions',
  8121. fn: function (aPoint, anotherPoint) {
  8122. var self = this;
  8123. (function ($rec) {$rec._beginPath();$rec._moveTo_(aPoint);$rec._lineTo_(anotherPoint);return $rec._stroke();}(self['@renderingContext']));
  8124. return self;
  8125. },
  8126. source: unescape('drawLineFrom%3A%20aPoint%20to%3A%20anotherPoint%0A%09renderingContext%20%0A%09%09beginPath%3B%0A%09%09moveTo%3A%20aPoint%3B%0A%09%09lineTo%3A%20anotherPoint%3B%0A%09%09stroke')}),
  8127. smalltalk.Tetris);
  8128. smalltalk.addMethod(
  8129. '_newGame',
  8130. smalltalk.method({
  8131. selector: 'newGame',
  8132. category: 'actions',
  8133. fn: function () {
  8134. var self = this;
  8135. self['@rows'] = [];
  8136. self['@movingPiece'] = nil;
  8137. self['@speed'] = 200;
  8138. self['@score'] = 0;
  8139. return self;
  8140. },
  8141. source: unescape('newGame%0A%09rows%20%3A%3D%20%23%28%29.%0A%09movingPiece%20%3A%3D%20nil.%0A%09speed%20%3A%3D%20200.%0A%09score%20%3A%3D%200')}),
  8142. smalltalk.Tetris);
  8143. smalltalk.addMethod(
  8144. '_newPiece',
  8145. smalltalk.method({
  8146. selector: 'newPiece',
  8147. category: 'actions',
  8148. fn: function () {
  8149. var self = this;
  8150. self['@movingPiece'] = smalltalk.TetrisPiece._atRandom();
  8151. return self;
  8152. },
  8153. source: unescape('newPiece%0A%09movingPiece%20%3A%3D%20TetrisPiece%20atRandom')}),
  8154. smalltalk.Tetris);
  8155. smalltalk.addMethod(
  8156. '_squares',
  8157. smalltalk.method({
  8158. selector: 'squares',
  8159. category: 'accessing',
  8160. fn: function () {
  8161. var self = this;
  8162. return self._class()._squares();
  8163. return self;
  8164. },
  8165. source: unescape('squares%0A%09%5Eself%20class%20squares')}),
  8166. smalltalk.Tetris);
  8167. smalltalk.addMethod(
  8168. '_gluePiece_',
  8169. smalltalk.method({
  8170. selector: 'gluePiece:',
  8171. category: 'accessing',
  8172. fn: function (aPiece) {
  8173. var self = this;
  8174. aPiece._glueOn_(self);
  8175. return self;
  8176. },
  8177. source: unescape('gluePiece%3A%20aPiece%0A%09aPiece%20glueOn%3A%20self%0A%09')}),
  8178. smalltalk.Tetris);
  8179. smalltalk.addMethod(
  8180. '_drawRows',
  8181. smalltalk.method({
  8182. selector: 'drawRows',
  8183. category: 'actions',
  8184. fn: function () {
  8185. var self = this;
  8186. self._rows()._do_(function (each) {return nil;});
  8187. self['@movingPiece']._ifNotNil_(function () {return self['@movingPiece']._drawOn_(self['@renderingContext']);});
  8188. return self;
  8189. },
  8190. source: unescape('drawRows%0A%09self%20rows%20do%3A%20%5B%3Aeach%20%7C%5D.%0A%09movingPiece%20ifNotNil%3A%20%5BmovingPiece%20drawOn%3A%20renderingContext%5D')}),
  8191. smalltalk.Tetris);
  8192. smalltalk.addMethod(
  8193. '_drawPiece',
  8194. smalltalk.method({
  8195. selector: 'drawPiece',
  8196. category: 'actions',
  8197. fn: function () {
  8198. var self = this;
  8199. self['@movingPiece']._ifNotNil_(function () {return self['@movingPiece']._drawOn_(self['@renderingContext']);});
  8200. return self;
  8201. },
  8202. source: unescape('drawPiece%0A%09movingPiece%20ifNotNil%3A%20%5B%0A%09%09movingPiece%20drawOn%3A%20renderingContext%5D')}),
  8203. smalltalk.Tetris);
  8204. smalltalk.addMethod(
  8205. '_rows',
  8206. smalltalk.method({
  8207. selector: 'rows',
  8208. category: 'accessing',
  8209. fn: function () {
  8210. var self = this;
  8211. return self['@rows'];
  8212. return self;
  8213. },
  8214. source: unescape('rows%0A%09%22An%20array%20of%20rows.%20Each%20row%20is%20a%20collection%20of%20points.%22%0A%09%5Erows')}),
  8215. smalltalk.Tetris);
  8216. smalltalk.addMethod(
  8217. '_addRow_',
  8218. smalltalk.method({
  8219. selector: 'addRow:',
  8220. category: 'accessing',
  8221. fn: function (aCollection) {
  8222. var self = this;
  8223. self._rows()._add_(aCollection);
  8224. return self;
  8225. },
  8226. source: unescape('addRow%3A%20aCollection%0A%09self%20rows%20add%3A%20aCollection')}),
  8227. smalltalk.Tetris);
  8228. smalltalk.addMethod(
  8229. '_squareSize',
  8230. smalltalk.method({
  8231. selector: 'squareSize',
  8232. category: 'accessing',
  8233. fn: function () {
  8234. var self = this;
  8235. return 22;
  8236. return self;
  8237. },
  8238. source: unescape('squareSize%0A%09%5E22')}),
  8239. smalltalk.Tetris.klass);
  8240. smalltalk.addMethod(
  8241. '_width',
  8242. smalltalk.method({
  8243. selector: 'width',
  8244. category: 'accessing',
  8245. fn: function () {
  8246. var self = this;
  8247. return self._squareSize().__star(self._squares()._x());
  8248. return self;
  8249. },
  8250. source: unescape('width%0A%09%5Eself%20squareSize%20*%20%28self%20squares%20x%29')}),
  8251. smalltalk.Tetris.klass);
  8252. smalltalk.addMethod(
  8253. '_height',
  8254. smalltalk.method({
  8255. selector: 'height',
  8256. category: 'accessing',
  8257. fn: function () {
  8258. var self = this;
  8259. return self._squareSize().__star(self._squares()._y());
  8260. return self;
  8261. },
  8262. source: unescape('height%0A%09%5Eself%20squareSize%20*%20%28self%20squares%20y%29')}),
  8263. smalltalk.Tetris.klass);
  8264. smalltalk.addMethod(
  8265. '_squares',
  8266. smalltalk.method({
  8267. selector: 'squares',
  8268. category: 'accessing',
  8269. fn: function () {
  8270. var self = this;
  8271. return (10).__at(15);
  8272. return self;
  8273. },
  8274. source: unescape('squares%0A%09%5E10@15')}),
  8275. smalltalk.Tetris.klass);
  8276. smalltalk.addClass('TetrisPiece', smalltalk.Widget, ['rotation', 'position'], 'Examples');
  8277. smalltalk.addMethod(
  8278. '_drawOn_',
  8279. smalltalk.method({
  8280. selector: 'drawOn:',
  8281. category: 'drawing',
  8282. fn: function (aRenderingContext) {
  8283. var self = this;
  8284. aRenderingContext._fillStyle_(self._color());
  8285. self._bounds()._do_(function (each) {return function ($rec) {$rec._fillRectFrom_to_(each.__plus(self._position()).__star(smalltalk.Tetris._squareSize()), (1).__at(1).__star(smalltalk.Tetris._squareSize()));$rec._strokeStyle_(unescape("%23999"));$rec._lineWidth_(2);return $rec._strokeRectFrom_to_(each.__plus(self._position()).__star(smalltalk.Tetris._squareSize()), (1).__at(1).__star(smalltalk.Tetris._squareSize()));}(aRenderingContext);});
  8286. return self;
  8287. },
  8288. source: unescape('drawOn%3A%20aRenderingContext%0A%09aRenderingContext%20fillStyle%3A%20self%20color.%0A%09self%20bounds%20do%3A%20%5B%3Aeach%20%7C%0A%09%09aRenderingContext%20%0A%09%09%09fillRectFrom%3A%20each%20+%20self%20position*%20Tetris%20squareSize%20to%3A%201@1%20*%20Tetris%20squareSize%3B%0A%09%09%09strokeStyle%3A%20%27%23999%27%3B%0A%09%09%09lineWidth%3A%202%3B%0A%09%09%09strokeRectFrom%3A%20each%20+%20self%20position*%20Tetris%20squareSize%20to%3A%201@1%20*%20Tetris%20squareSize%5D')}),
  8289. smalltalk.TetrisPiece);
  8290. smalltalk.addMethod(
  8291. '_rotation',
  8292. smalltalk.method({
  8293. selector: 'rotation',
  8294. category: 'accessing',
  8295. fn: function () {
  8296. var self = this;
  8297. return self['@rotation']._ifNil_(function () {return self['@rotation'] = 1;});
  8298. return self;
  8299. },
  8300. source: unescape('rotation%0A%09%5Erotation%20ifNil%3A%20%5Brotation%20%3A%3D%201%5D')}),
  8301. smalltalk.TetrisPiece);
  8302. smalltalk.addMethod(
  8303. '_rotation_',
  8304. smalltalk.method({
  8305. selector: 'rotation:',
  8306. category: 'accessing',
  8307. fn: function (aNumber) {
  8308. var self = this;
  8309. self['@rotation'] = aNumber;
  8310. return self;
  8311. },
  8312. source: unescape('rotation%3A%20aNumber%0A%09rotation%20%3A%3D%20aNumber')}),
  8313. smalltalk.TetrisPiece);
  8314. smalltalk.addMethod(
  8315. '_position',
  8316. smalltalk.method({
  8317. selector: 'position',
  8318. category: 'accessing',
  8319. fn: function () {
  8320. var self = this;
  8321. return self['@position']._ifNil_(function () {return smalltalk.Tetris._squares()._x().__slash(2).__minus(1).__at(0);});
  8322. return self;
  8323. },
  8324. source: unescape('position%0A%09%5Eposition%20ifNil%3A%20%5B%28Tetris%20squares%20x%20/%202%29%20-1%20@%200%5D')}),
  8325. smalltalk.TetrisPiece);
  8326. smalltalk.addMethod(
  8327. '_position_',
  8328. smalltalk.method({
  8329. selector: 'position:',
  8330. category: 'accessing',
  8331. fn: function (aPoint) {
  8332. var self = this;
  8333. return self['@position'] = aPoint;
  8334. return self;
  8335. },
  8336. source: unescape('position%3A%20aPoint%0A%09%5Eposition%20%3A%3D%20aPoint')}),
  8337. smalltalk.TetrisPiece);
  8338. smalltalk.addMethod(
  8339. '_bounds',
  8340. smalltalk.method({
  8341. selector: 'bounds',
  8342. category: 'accessing',
  8343. fn: function () {
  8344. var self = this;
  8345. self._subclassResponsibility();
  8346. return self;
  8347. },
  8348. source: unescape('bounds%0A%09self%20subclassResponsibility')}),
  8349. smalltalk.TetrisPiece);
  8350. smalltalk.addMethod(
  8351. '_color',
  8352. smalltalk.method({
  8353. selector: 'color',
  8354. category: 'accessing',
  8355. fn: function () {
  8356. var self = this;
  8357. return unescape("%23afa");
  8358. return self;
  8359. },
  8360. source: unescape('color%0A%09%5E%27%23afa%27')}),
  8361. smalltalk.TetrisPiece);
  8362. smalltalk.addMethod(
  8363. '_canMove',
  8364. smalltalk.method({
  8365. selector: 'canMove',
  8366. category: 'testing',
  8367. fn: function () {
  8368. var self = this;
  8369. return self._position()._y().__lt(smalltalk.Tetris._squares()._y().__minus(self._height()));
  8370. return self;
  8371. },
  8372. source: unescape('canMove%0A%09%5Eself%20position%20y%20%3C%20%28Tetris%20squares%20y%20-%20self%20height%29')}),
  8373. smalltalk.TetrisPiece);
  8374. smalltalk.addMethod(
  8375. '_height',
  8376. smalltalk.method({
  8377. selector: 'height',
  8378. category: 'accessing',
  8379. fn: function () {
  8380. var self = this;
  8381. return 2;
  8382. return self;
  8383. },
  8384. source: unescape('height%0A%09%5E2')}),
  8385. smalltalk.TetrisPiece);
  8386. smalltalk.addMethod(
  8387. '_canMoveIn_',
  8388. smalltalk.method({
  8389. selector: 'canMoveIn:',
  8390. category: 'testing',
  8391. fn: function (aTetris) {
  8392. var self = this;
  8393. return self._position()._y().__lt(aTetris._squares()._y().__minus(self._height()));
  8394. return self;
  8395. },
  8396. source: unescape('canMoveIn%3A%20aTetris%0A%09%5Eself%20position%20y%20%3C%20%28aTetris%20squares%20y%20-%20self%20height%29')}),
  8397. smalltalk.TetrisPiece);
  8398. smalltalk.addMethod(
  8399. '_atRandom',
  8400. smalltalk.method({
  8401. selector: 'atRandom',
  8402. category: 'instance creation',
  8403. fn: function () {
  8404. var self = this;
  8405. return self._subclasses()._at_(self._subclasses()._size()._atRandom())._new();
  8406. return self;
  8407. },
  8408. source: unescape('atRandom%0A%09%5E%28self%20subclasses%20at%3A%20self%20subclasses%20size%20atRandom%29%20new')}),
  8409. smalltalk.TetrisPiece.klass);
  8410. smalltalk.addClass('TetrisPieceO', smalltalk.TetrisPiece, [], 'Examples');
  8411. smalltalk.addMethod(
  8412. '_bounds',
  8413. smalltalk.method({
  8414. selector: 'bounds',
  8415. category: 'accessing',
  8416. fn: function () {
  8417. var self = this;
  8418. return function ($rec) {$rec._add_((0).__at(0));$rec._add_((0).__at(1));$rec._add_((1).__at(0));$rec._add_((1).__at(1));return $rec._yourself();}(smalltalk.Array._new());
  8419. return self;
  8420. },
  8421. source: unescape('bounds%0A%09%5EArray%20new%0A%09%09add%3A%200@0%3B%0A%09%09add%3A%200@1%3B%0A%09%09add%3A%201@0%3B%0A%09%09add%3A%201@1%3B%0A%09%09yourself')}),
  8422. smalltalk.TetrisPieceO);
  8423. smalltalk.addClass('TetrisPieceL', smalltalk.TetrisPiece, [], 'Examples');
  8424. smalltalk.addMethod(
  8425. '_bounds',
  8426. smalltalk.method({
  8427. selector: 'bounds',
  8428. category: 'accessing',
  8429. fn: function () {
  8430. var self = this;
  8431. return function ($rec) {$rec._add_((0).__at(0));$rec._add_((0).__at(1));$rec._add_((0).__at(2));$rec._add_((1).__at(2));return $rec._yourself();}(smalltalk.Array._new());
  8432. return self;
  8433. },
  8434. source: unescape('bounds%0A%09%5EArray%20new%0A%09%09add%3A%200@0%3B%0A%09%09add%3A%200@1%3B%0A%09%09add%3A%200@2%3B%0A%09%09add%3A%201@2%3B%0A%09%09yourself')}),
  8435. smalltalk.TetrisPieceL);
  8436. smalltalk.addMethod(
  8437. '_color',
  8438. smalltalk.method({
  8439. selector: 'color',
  8440. category: 'accessing',
  8441. fn: function () {
  8442. var self = this;
  8443. return unescape("%23ffa");
  8444. return self;
  8445. },
  8446. source: unescape('color%0A%09%5E%27%23ffa%27')}),
  8447. smalltalk.TetrisPieceL);
  8448. smalltalk.addMethod(
  8449. '_height',
  8450. smalltalk.method({
  8451. selector: 'height',
  8452. category: 'accessing',
  8453. fn: function () {
  8454. var self = this;
  8455. return 3;
  8456. return self;
  8457. },
  8458. source: unescape('height%0A%09%5E3')}),
  8459. smalltalk.TetrisPieceL);
  8460. smalltalk.addClass('TetrisPieceJ', smalltalk.TetrisPiece, [], 'Examples');
  8461. smalltalk.addMethod(
  8462. '_color',
  8463. smalltalk.method({
  8464. selector: 'color',
  8465. category: 'accessing',
  8466. fn: function () {
  8467. var self = this;
  8468. return unescape("%23aaf");
  8469. return self;
  8470. },
  8471. source: unescape('color%0A%09%5E%27%23aaf%27')}),
  8472. smalltalk.TetrisPieceJ);
  8473. smalltalk.addMethod(
  8474. '_bounds',
  8475. smalltalk.method({
  8476. selector: 'bounds',
  8477. category: 'accessing',
  8478. fn: function () {
  8479. var self = this;
  8480. return function ($rec) {$rec._add_((1).__at(0));$rec._add_((1).__at(1));$rec._add_((1).__at(2));$rec._add_((0).__at(2));return $rec._yourself();}(smalltalk.Array._new());
  8481. return self;
  8482. },
  8483. source: unescape('bounds%0A%09%5EArray%20new%0A%09%09add%3A%201@0%3B%0A%09%09add%3A%201@1%3B%0A%09%09add%3A%201@2%3B%0A%09%09add%3A%200@2%3B%0A%09%09yourself')}),
  8484. smalltalk.TetrisPieceJ);
  8485. smalltalk.addMethod(
  8486. '_height',
  8487. smalltalk.method({
  8488. selector: 'height',
  8489. category: 'accessing',
  8490. fn: function () {
  8491. var self = this;
  8492. return 3;
  8493. return self;
  8494. },
  8495. source: unescape('height%0A%09%5E3')}),
  8496. smalltalk.TetrisPieceJ);
  8497. smalltalk.addClass('TetrisPieceI', smalltalk.TetrisPiece, [], 'Examples');
  8498. smalltalk.addMethod(
  8499. '_color',
  8500. smalltalk.method({
  8501. selector: 'color',
  8502. category: 'accessing',
  8503. fn: function () {
  8504. var self = this;
  8505. return unescape("%23faa");
  8506. return self;
  8507. },
  8508. source: unescape('color%0A%09%5E%27%23faa%27')}),
  8509. smalltalk.TetrisPieceI);
  8510. smalltalk.addMethod(
  8511. '_bounds',
  8512. smalltalk.method({
  8513. selector: 'bounds',
  8514. category: 'accessing',
  8515. fn: function () {
  8516. var self = this;
  8517. return function ($rec) {$rec._add_((0).__at(0));$rec._add_((0).__at(1));$rec._add_((0).__at(2));$rec._add_((0).__at(3));return $rec._yourself();}(smalltalk.Array._new());
  8518. return self;
  8519. },
  8520. source: unescape('bounds%0A%09%5EArray%20new%0A%09%09add%3A%200@0%3B%0A%09%09add%3A%200@1%3B%0A%09%09add%3A%200@2%3B%0A%09%09add%3A%200@3%3B%0A%09%09yourself')}),
  8521. smalltalk.TetrisPieceI);
  8522. smalltalk.addMethod(
  8523. '_height',
  8524. smalltalk.method({
  8525. selector: 'height',
  8526. category: 'accessing',
  8527. fn: function () {
  8528. var self = this;
  8529. return 4;
  8530. return self;
  8531. },
  8532. source: unescape('height%0A%09%5E4')}),
  8533. smalltalk.TetrisPieceI);
  8534. smalltalk.addClass('TetrisPieceT', smalltalk.TetrisPiece, [], 'Examples');
  8535. smalltalk.addMethod(
  8536. '_bounds',
  8537. smalltalk.method({
  8538. selector: 'bounds',
  8539. category: 'accessing',
  8540. fn: function () {
  8541. var self = this;
  8542. return function ($rec) {$rec._add_((0).__at(0));$rec._add_((1).__at(0));$rec._add_((2).__at(0));$rec._add_((1).__at(1));return $rec._yourself();}(smalltalk.Array._new());
  8543. return self;
  8544. },
  8545. source: unescape('bounds%0A%09%5EArray%20new%0A%09%09add%3A%200@0%3B%0A%09%09add%3A%201@0%3B%0A%09%09add%3A%202@0%3B%0A%09%09add%3A%201@1%3B%0A%09%09yourself')}),
  8546. smalltalk.TetrisPieceT);
  8547. smalltalk.addMethod(
  8548. '_color',
  8549. smalltalk.method({
  8550. selector: 'color',
  8551. category: 'accessing',
  8552. fn: function () {
  8553. var self = this;
  8554. return unescape("%23aaf");
  8555. return self;
  8556. },
  8557. source: unescape('color%0A%09%5E%27%23aaf%27')}),
  8558. smalltalk.TetrisPieceT);
  8559. smalltalk.addClass('TabManager', smalltalk.Widget, ['selectedTab', 'tabs', 'opened'], 'IDE');
  8560. smalltalk.addMethod(
  8561. '_initialize',
  8562. smalltalk.method({
  8563. selector: 'initialize',
  8564. category: 'initialization',
  8565. fn: function () {
  8566. var self = this;
  8567. self.klass.superclass.fn.prototype._initialize.apply(self, []);
  8568. self['@opened'] = true;
  8569. (function ($rec) {$rec._append_(self);$rec._append_(function (html) {return html._div()._id_("jtalk");});return $rec._addClass_("jtalkBody");}("body"._asJQuery()));
  8570. (function ($rec) {$rec._addTab_(smalltalk.Transcript._current());return $rec._addTab_(smalltalk.Workspace._new());}(self));
  8571. self._selectTab_(self._tabs()._last());
  8572. (function ($rec) {$rec._onResize_(function () {return function ($rec) {$rec._updateBodyMargin();return $rec._updatePosition();}(self);});return $rec._onWindowResize_(function () {return self._updatePosition();});}(self));
  8573. return self;
  8574. },
  8575. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20opened%20%3A%3D%20true.%0A%20%20%20%20%27body%27%20asJQuery%20%0A%09append%3A%20self%3B%0A%09append%3A%20%5B%3Ahtml%20%7C%20html%20div%20id%3A%20%27jtalk%27%5D%3B%0A%09addClass%3A%20%27jtalkBody%27.%0A%20%20%20%20self%20%0A%09addTab%3A%20Transcript%20current%3B%0A%09addTab%3A%20Workspace%20new.%0A%20%20%20%20self%20selectTab%3A%20self%20tabs%20last.%0A%20%20%20%20self%20%0A%09onResize%3A%20%5Bself%20updateBodyMargin%3B%20updatePosition%5D%3B%0A%09onWindowResize%3A%20%5Bself%20updatePosition%5D%0A')}),
  8576. smalltalk.TabManager);
  8577. smalltalk.addMethod(
  8578. '_tabs',
  8579. smalltalk.method({
  8580. selector: 'tabs',
  8581. category: 'accessing',
  8582. fn: function () {
  8583. var self = this;
  8584. return self['@tabs']._ifNil_(function () {return self['@tabs'] = smalltalk.Array._new();});
  8585. return self;
  8586. },
  8587. source: unescape('tabs%0A%20%20%20%20%5Etabs%20ifNil%3A%20%5Btabs%20%3A%3D%20Array%20new%5D%0A')}),
  8588. smalltalk.TabManager);
  8589. smalltalk.addMethod(
  8590. '_addTab_',
  8591. smalltalk.method({
  8592. selector: 'addTab:',
  8593. category: 'adding/Removing',
  8594. fn: function (aWidget) {
  8595. var self = this;
  8596. self._tabs()._add_(aWidget);
  8597. unescape("%23jtalk")._asJQuery()._append_(aWidget);
  8598. aWidget._root()._asJQuery()._hide();
  8599. return self;
  8600. },
  8601. source: unescape('addTab%3A%20aWidget%0A%20%20%20%20self%20tabs%20add%3A%20aWidget.%0A%20%20%20%20%27%23jtalk%27%20asJQuery%20append%3A%20aWidget.%0A%20%20%20%20aWidget%20root%20asJQuery%20hide%0A')}),
  8602. smalltalk.TabManager);
  8603. smalltalk.addMethod(
  8604. '_removeTab_',
  8605. smalltalk.method({
  8606. selector: 'removeTab:',
  8607. category: 'adding/Removing',
  8608. fn: function (aWidget) {
  8609. var self = this;
  8610. self._tabs()._remove_(aWidget);
  8611. self._update();
  8612. return self;
  8613. },
  8614. source: unescape('removeTab%3A%20aWidget%0A%20%20%20%20self%20tabs%20remove%3A%20aWidget.%0A%20%20%20%20self%20update%0A')}),
  8615. smalltalk.TabManager);
  8616. smalltalk.addMethod(
  8617. '_updateBodyMargin',
  8618. smalltalk.method({
  8619. selector: 'updateBodyMargin',
  8620. category: 'actions',
  8621. fn: function () {
  8622. var self = this;
  8623. self._setBodyMargin_(unescape("%23jtalk")._asJQuery()._height().__plus(27));
  8624. return self;
  8625. },
  8626. source: unescape('updateBodyMargin%0A%20%20%20%20self%20setBodyMargin%3A%20%27%23jtalk%27%20asJQuery%20height%20+%2027%0A')}),
  8627. smalltalk.TabManager);
  8628. smalltalk.addMethod(
  8629. '_updatePosition',
  8630. smalltalk.method({
  8631. selector: 'updatePosition',
  8632. category: 'actions',
  8633. fn: function () {
  8634. var self = this;
  8635. (function () {jQuery("#jtalk").css("top", "").css("bottom", "27px");}());
  8636. return self;
  8637. },
  8638. source: unescape('updatePosition%0A%20%20%20%20%7B%27jQuery%28%27%27%23jtalk%27%27%29.css%28%27%27top%27%27%2C%20%27%27%27%27%27%27%29.css%28%27%27bottom%27%27%2C%20%27%2727px%27%27%29%3B%27%7D%0A')}),
  8639. smalltalk.TabManager);
  8640. smalltalk.addMethod(
  8641. '_removeBodyMargin',
  8642. smalltalk.method({
  8643. selector: 'removeBodyMargin',
  8644. category: 'actions',
  8645. fn: function () {
  8646. var self = this;
  8647. self._setBodyMargin_(0);
  8648. return self;
  8649. },
  8650. source: unescape('removeBodyMargin%0A%20%20%20%20self%20setBodyMargin%3A%200%0A')}),
  8651. smalltalk.TabManager);
  8652. smalltalk.addMethod(
  8653. '_setBodyMargin_',
  8654. smalltalk.method({
  8655. selector: 'setBodyMargin:',
  8656. category: 'actions',
  8657. fn: function (anInteger) {
  8658. var self = this;
  8659. ".jtalkBody"._asJQuery()._cssAt_put_(unescape("margin-bottom"), anInteger._asString().__comma("px"));
  8660. return self;
  8661. },
  8662. source: unescape('setBodyMargin%3A%20anInteger%0A%20%20%20%20%27.jtalkBody%27%20asJQuery%20cssAt%3A%20%27margin-bottom%27%20put%3A%20anInteger%20asString%2C%20%27px%27%0A')}),
  8663. smalltalk.TabManager);
  8664. smalltalk.addMethod(
  8665. '_onResize_',
  8666. smalltalk.method({
  8667. selector: 'onResize:',
  8668. category: 'actions',
  8669. fn: function (aBlock) {
  8670. var self = this;
  8671. (function () {jQuery("#jtalk").resizable({handles: "n", resize: aBlock, minHeight: 230});}());
  8672. return self;
  8673. },
  8674. source: unescape('onResize%3A%20aBlock%0A%20%20%20%20%7B%27jQuery%28%27%27%23jtalk%27%27%29.resizable%28%7B%0A%09handles%3A%20%27%27n%27%27%2C%20%0A%09resize%3A%20aBlock%2C%0A%09minHeight%3A%20230%0A%7D%29%3B%27%7D%0A')}),
  8675. smalltalk.TabManager);
  8676. smalltalk.addMethod(
  8677. '_onWindowResize_',
  8678. smalltalk.method({
  8679. selector: 'onWindowResize:',
  8680. category: 'actions',
  8681. fn: function (aBlock) {
  8682. var self = this;
  8683. (function () {jQuery(window).resize(aBlock);}());
  8684. return self;
  8685. },
  8686. source: unescape('onWindowResize%3A%20aBlock%0A%20%20%20%20%7B%27jQuery%28window%29.resize%28aBlock%29%27%7D%0A')}),
  8687. smalltalk.TabManager);
  8688. smalltalk.addMethod(
  8689. '_open',
  8690. smalltalk.method({
  8691. selector: 'open',
  8692. category: 'actions',
  8693. fn: function () {
  8694. var self = this;
  8695. self['@opened']._ifFalse_(function () {self._root()._asJQuery()._show();"body"._asJQuery()._addClass_("jtalkBody");unescape("%23jtalk")._asJQuery()._show();self._updateBodyMargin();self['@selectedTab']._root()._asJQuery()._show();return self['@opened'] = true;});
  8696. return self;
  8697. },
  8698. source: unescape('open%0A%20%20%20%20opened%20ifFalse%3A%20%5B%0A%09self%20root%20asJQuery%20show.%0A%09%27body%27%20asJQuery%20addClass%3A%20%27jtalkBody%27.%0A%09%27%23jtalk%27%20asJQuery%20show.%0A%09self%20updateBodyMargin.%0A%09selectedTab%20root%20asJQuery%20show.%0A%09opened%20%3A%3D%20true%5D%0A')}),
  8699. smalltalk.TabManager);
  8700. smalltalk.addMethod(
  8701. '_close',
  8702. smalltalk.method({
  8703. selector: 'close',
  8704. category: 'actions',
  8705. fn: function () {
  8706. var self = this;
  8707. self['@opened']._ifTrue_(function () {self._root()._asJQuery()._hide();unescape("%23jtalk")._asJQuery()._hide();self._removeBodyMargin();"body"._asJQuery()._removeClass_("jtalkBody");return self['@opened'] = false;});
  8708. return self;
  8709. },
  8710. source: unescape('close%0A%20%20%20%20opened%20ifTrue%3A%20%5B%0A%09self%20root%20asJQuery%20hide.%0A%09%27%23jtalk%27%20asJQuery%20hide.%0A%09self%20removeBodyMargin.%0A%09%27body%27%20asJQuery%20removeClass%3A%20%27jtalkBody%27.%0A%09opened%20%3A%3D%20false%5D%0A')}),
  8711. smalltalk.TabManager);
  8712. smalltalk.addMethod(
  8713. '_newBrowserTab',
  8714. smalltalk.method({
  8715. selector: 'newBrowserTab',
  8716. category: 'actions',
  8717. fn: function () {
  8718. var self = this;
  8719. smalltalk.Browser._open();
  8720. return self;
  8721. },
  8722. source: unescape('newBrowserTab%0A%20%20%20%20Browser%20open%0A')}),
  8723. smalltalk.TabManager);
  8724. smalltalk.addMethod(
  8725. '_selectTab_',
  8726. smalltalk.method({
  8727. selector: 'selectTab:',
  8728. category: 'actions',
  8729. fn: function (aWidget) {
  8730. var self = this;
  8731. self._open();
  8732. self['@selectedTab'] = aWidget;
  8733. self._tabs()._do_(function (each) {return each._root()._asJQuery()._hide();});
  8734. aWidget._root()._asJQuery()._show();
  8735. self._update();
  8736. return self;
  8737. },
  8738. source: unescape('selectTab%3A%20aWidget%0A%20%20%20%20self%20open.%0A%20%20%20%20selectedTab%20%3A%3D%20aWidget.%0A%20%20%20%20self%20tabs%20do%3A%20%5B%3Aeach%20%7C%0A%09each%20root%20asJQuery%20hide%5D.%0A%20%20%20%20aWidget%20root%20asJQuery%20show.%0A%20%20%20%20self%20update%0A')}),
  8739. smalltalk.TabManager);
  8740. smalltalk.addMethod(
  8741. '_closeTab_',
  8742. smalltalk.method({
  8743. selector: 'closeTab:',
  8744. category: 'actions',
  8745. fn: function (aWidget) {
  8746. var self = this;
  8747. self._removeTab_(aWidget);
  8748. self._selectTab_(self._tabs()._last());
  8749. aWidget._root()._asJQuery()._remove();
  8750. self._update();
  8751. return self;
  8752. },
  8753. source: unescape('closeTab%3A%20aWidget%0A%20%20%20%20self%20removeTab%3A%20aWidget.%0A%20%20%20%20self%20selectTab%3A%20self%20tabs%20last.%0A%20%20%20%20aWidget%20root%20asJQuery%20remove.%0A%20%20%20%20self%20update%0A')}),
  8754. smalltalk.TabManager);
  8755. smalltalk.addMethod(
  8756. '_renderOn_',
  8757. smalltalk.method({
  8758. selector: 'renderOn:',
  8759. category: 'rendering',
  8760. fn: function (html) {
  8761. var self = this;
  8762. (function ($rec) {$rec._id_("jtalkTabs");return $rec._with_(function () {(function ($rec) {$rec._class_("closeAll");$rec._with_("x");return $rec._onClick_(function () {return self._close();});}(html._li()));self._tabs()._do_(function (each) {return self._renderTabFor_on_(each, html);});return function ($rec) {$rec._class_("newtab");$rec._with_(unescape("%20+%20"));return $rec._onClick_(function () {return self._newBrowserTab();});}(html._li());});}(html._ul()));
  8763. return self;
  8764. },
  8765. source: unescape('renderOn%3A%20html%0A%20%20%20%20html%20ul%0A%09id%3A%20%27jtalkTabs%27%3B%0A%09with%3A%20%5B%0A%09%20%20%20%20html%20li%20%0A%09%09class%3A%20%27closeAll%27%3B%0A%09%09with%3A%20%27x%27%3B%0A%09%09onClick%3A%20%5Bself%20close%5D.%0A%09%20%20%20%20self%20tabs%20do%3A%20%5B%3Aeach%20%7C%0A%09%09self%20renderTabFor%3A%20each%20on%3A%20html%5D.%0A%09%20%20%20%20html%20li%0A%09%09class%3A%20%27newtab%27%3B%0A%09%09with%3A%20%27%20+%20%27%3B%0A%09%09onClick%3A%20%5Bself%20newBrowserTab%5D%5D%0A')}),
  8766. smalltalk.TabManager);
  8767. smalltalk.addMethod(
  8768. '_renderTabFor_on_',
  8769. smalltalk.method({
  8770. selector: 'renderTabFor:on:',
  8771. category: 'rendering',
  8772. fn: function (aWidget, html) {
  8773. var self = this;
  8774. var li = nil;
  8775. li = html._li();
  8776. self['@selectedTab'].__eq(aWidget)._ifTrue_(function () {return li._class_("selected");});
  8777. li._with_(function () {(function ($rec) {$rec._with_(aWidget._label());return $rec._onClick_(function () {return self._selectTab_(aWidget);});}(html._span()));return aWidget._canBeClosed()._ifTrue_(function () {return function ($rec) {$rec._class_("close");$rec._with_("x");return $rec._onClick_(function () {return self._closeTab_(aWidget);});}(html._span());});});
  8778. return self;
  8779. },
  8780. source: unescape('renderTabFor%3A%20aWidget%20on%3A%20html%0A%20%20%20%20%7C%20li%20%7C%0A%20%20%20%20li%20%3A%3D%20html%20li.%0A%20%20%20%20selectedTab%20%3D%20aWidget%20ifTrue%3A%20%5B%0A%09li%20class%3A%20%27selected%27%5D.%0A%20%20%20%20li%20with%3A%20%5B%0A%09html%20span%0A%09%20%20%20%20with%3A%20aWidget%20label%3B%0A%09%20%20%20%20onClick%3A%20%5Bself%20selectTab%3A%20aWidget%5D.%0A%09aWidget%20canBeClosed%20ifTrue%3A%20%5B%0A%09%20%20%20%20html%20span%20%0A%09%09class%3A%20%27close%27%3B%0A%09%09with%3A%20%27x%27%3B%0A%09%09onClick%3A%20%5Bself%20closeTab%3A%20aWidget%5D%5D%5D%0A')}),
  8781. smalltalk.TabManager);
  8782. smalltalk.TabManager.klass.iVarNames = ['current'];
  8783. smalltalk.addMethod(
  8784. '_current',
  8785. smalltalk.method({
  8786. selector: 'current',
  8787. category: 'instance creation',
  8788. fn: function () {
  8789. var self = this;
  8790. return self['@current']._ifNil_(function () {return self['@current'] = self.klass.superclass.fn.prototype._new.apply(self, []);});
  8791. return self;
  8792. },
  8793. source: unescape('current%0A%20%20%20%20%5Ecurrent%20ifNil%3A%20%5Bcurrent%20%3A%3D%20super%20new%5D%0A')}),
  8794. smalltalk.TabManager.klass);
  8795. smalltalk.addMethod(
  8796. '_new',
  8797. smalltalk.method({
  8798. selector: 'new',
  8799. category: 'instance creation',
  8800. fn: function () {
  8801. var self = this;
  8802. self._shouldNotImplement();
  8803. return self;
  8804. },
  8805. source: unescape('new%0A%20%20%20%20self%20shouldNotImplement%0A')}),
  8806. smalltalk.TabManager.klass);
  8807. smalltalk.addClass('TabWidget', smalltalk.Widget, [], 'IDE');
  8808. smalltalk.addMethod(
  8809. '_label',
  8810. smalltalk.method({
  8811. selector: 'label',
  8812. category: 'accessing',
  8813. fn: function () {
  8814. var self = this;
  8815. self._subclassResponsibility();
  8816. return self;
  8817. },
  8818. source: unescape('label%0A%20%20%20%20self%20subclassResponsibility%0A')}),
  8819. smalltalk.TabWidget);
  8820. smalltalk.addMethod(
  8821. '_open',
  8822. smalltalk.method({
  8823. selector: 'open',
  8824. category: 'actions',
  8825. fn: function () {
  8826. var self = this;
  8827. (function ($rec) {$rec._addTab_(self);return $rec._selectTab_(self);}(smalltalk.TabManager._current()));
  8828. return self;
  8829. },
  8830. source: unescape('open%0A%20%20%20%20TabManager%20current%0A%09addTab%3A%20self%3B%0A%09selectTab%3A%20self%0A')}),
  8831. smalltalk.TabWidget);
  8832. smalltalk.addMethod(
  8833. '_canBeClosed',
  8834. smalltalk.method({
  8835. selector: 'canBeClosed',
  8836. category: 'testing',
  8837. fn: function () {
  8838. var self = this;
  8839. return false;
  8840. return self;
  8841. },
  8842. source: unescape('canBeClosed%0A%20%20%20%20%5Efalse%0A')}),
  8843. smalltalk.TabWidget);
  8844. smalltalk.addMethod(
  8845. '_renderOn_',
  8846. smalltalk.method({
  8847. selector: 'renderOn:',
  8848. category: 'rendering',
  8849. fn: function (html) {
  8850. var self = this;
  8851. (function ($rec) {$rec._class_("jtalkTool");return $rec._with_(function () {(function ($rec) {$rec._class_("jt_box");return $rec._with_(function () {return self._renderBoxOn_(html);});}(html._div()));return function ($rec) {$rec._class_("jt_buttons");return $rec._with_(function () {return self._renderButtonsOn_(html);});}(html._div());});}(html._root()));
  8852. return self;
  8853. },
  8854. source: unescape('renderOn%3A%20html%0A%20%20%20%20html%20root%0A%09class%3A%20%27jtalkTool%27%3B%0A%09with%3A%20%5B%0A%09%20%20%20%20html%20div%0A%09%09class%3A%20%27jt_box%27%3B%0A%09%09with%3A%20%5Bself%20renderBoxOn%3A%20html%5D.%0A%09%20%20%20%20html%20div%0A%09%09class%3A%20%27jt_buttons%27%3B%0A%09%09with%3A%20%5Bself%20renderButtonsOn%3A%20html%5D%5D%0A')}),
  8855. smalltalk.TabWidget);
  8856. smalltalk.addMethod(
  8857. '_renderBoxOn_',
  8858. smalltalk.method({
  8859. selector: 'renderBoxOn:',
  8860. category: 'rendering',
  8861. fn: function (html) {
  8862. var self = this;
  8863. return self;
  8864. },
  8865. source: unescape('renderBoxOn%3A%20html%0A')}),
  8866. smalltalk.TabWidget);
  8867. smalltalk.addMethod(
  8868. '_renderButtonsOn_',
  8869. smalltalk.method({
  8870. selector: 'renderButtonsOn:',
  8871. category: 'rendering',
  8872. fn: function (html) {
  8873. var self = this;
  8874. return self;
  8875. },
  8876. source: unescape('renderButtonsOn%3A%20html%0A')}),
  8877. smalltalk.TabWidget);
  8878. smalltalk.addMethod(
  8879. '_open',
  8880. smalltalk.method({
  8881. selector: 'open',
  8882. category: 'instance creation',
  8883. fn: function () {
  8884. var self = this;
  8885. return self._new()._open();
  8886. return self;
  8887. },
  8888. source: unescape('open%0A%20%20%20%20%5Eself%20new%20open%0A')}),
  8889. smalltalk.TabWidget.klass);
  8890. smalltalk.addClass('Workspace', smalltalk.TabWidget, ['textarea'], 'IDE');
  8891. smalltalk.addMethod(
  8892. '_label',
  8893. smalltalk.method({
  8894. selector: 'label',
  8895. category: 'accessing',
  8896. fn: function () {
  8897. var self = this;
  8898. return unescape("%5BWorkspace%5D");
  8899. return self;
  8900. },
  8901. source: unescape('label%0A%20%20%20%20%5E%27%5BWorkspace%5D%27%0A')}),
  8902. smalltalk.Workspace);
  8903. smalltalk.addMethod(
  8904. '_selection',
  8905. smalltalk.method({
  8906. selector: 'selection',
  8907. category: 'accessing',
  8908. fn: function () {
  8909. var self = this;
  8910. return function () {return document.selection;}();
  8911. return self;
  8912. },
  8913. source: unescape('selection%0A%20%20%20%20%5E%7B%27return%20document.selection%27%7D%0A')}),
  8914. smalltalk.Workspace);
  8915. smalltalk.addMethod(
  8916. '_selectionStart',
  8917. smalltalk.method({
  8918. selector: 'selectionStart',
  8919. category: 'accessing',
  8920. fn: function () {
  8921. var self = this;
  8922. return function () {return jQuery(".jt_workspace")[0].selectionStart;}();
  8923. return self;
  8924. },
  8925. source: unescape('selectionStart%0A%20%20%20%20%5E%7B%27return%20jQuery%28%27%27.jt_workspace%27%27%29%5B0%5D.selectionStart%27%7D%0A')}),
  8926. smalltalk.Workspace);
  8927. smalltalk.addMethod(
  8928. '_selectionEnd',
  8929. smalltalk.method({
  8930. selector: 'selectionEnd',
  8931. category: 'accessing',
  8932. fn: function () {
  8933. var self = this;
  8934. return function () {return jQuery(".jt_workspace")[0].selectionEnd;}();
  8935. return self;
  8936. },
  8937. source: unescape('selectionEnd%0A%20%20%20%20%5E%7B%27return%20jQuery%28%27%27.jt_workspace%27%27%29%5B0%5D.selectionEnd%27%7D%0A')}),
  8938. smalltalk.Workspace);
  8939. smalltalk.addMethod(
  8940. '_selectionStart_',
  8941. smalltalk.method({
  8942. selector: 'selectionStart:',
  8943. category: 'accessing',
  8944. fn: function (anInteger) {
  8945. var self = this;
  8946. (function () {jQuery(".jt_workspace")[0].selectionStart = anInteger;}());
  8947. return self;
  8948. },
  8949. source: unescape('selectionStart%3A%20anInteger%0A%20%20%20%20%7B%27jQuery%28%27%27.jt_workspace%27%27%29%5B0%5D.selectionStart%20%3D%20anInteger%27%7D%0A')}),
  8950. smalltalk.Workspace);
  8951. smalltalk.addMethod(
  8952. '_selectionEnd_',
  8953. smalltalk.method({
  8954. selector: 'selectionEnd:',
  8955. category: 'accessing',
  8956. fn: function (anInteger) {
  8957. var self = this;
  8958. (function () {jQuery(".jt_workspace")[0].selectionEnd = anInteger;}());
  8959. return self;
  8960. },
  8961. source: unescape('selectionEnd%3A%20anInteger%0A%20%20%20%20%7B%27jQuery%28%27%27.jt_workspace%27%27%29%5B0%5D.selectionEnd%20%3D%20anInteger%27%7D%0A')}),
  8962. smalltalk.Workspace);
  8963. smalltalk.addMethod(
  8964. '_currentLine',
  8965. smalltalk.method({
  8966. selector: 'currentLine',
  8967. category: 'accessing',
  8968. fn: function () {
  8969. var self = this;
  8970. try {
  8971. var lines = nil;
  8972. var startLine = nil;
  8973. var endLine = nil;
  8974. lines = self['@textarea']._asJQuery()._val()._tokenize_(smalltalk.String._cr());
  8975. startLine = endLine = 0;
  8976. lines._do_(function (each) {endLine = startLine.__plus(each._size());startLine = endLine.__plus(1);return endLine.__gt_eq(self._selectionStart())._ifTrue_(function () {self._selectionEnd_(endLine);return function () {throw {name: "stReturn", selector: "_currentLine", fn: function () {return each;}};}();});});
  8977. return self;
  8978. } catch (e) {
  8979. if (e.name === "stReturn" && e.selector === "_currentLine") {
  8980. return e.fn();
  8981. }
  8982. throw e;
  8983. }
  8984. },
  8985. source: unescape('currentLine%0A%20%20%20%20%7C%20lines%20startLine%20endLine%7C%0A%20%20%20%20lines%20%3A%3D%20textarea%20asJQuery%20val%20tokenize%3A%20String%20cr.%0A%20%20%20%20startLine%20%3A%3D%20endLine%20%3A%3D%200.%0A%20%20%20%20lines%20do%3A%20%5B%3Aeach%20%7C%0A%09endLine%20%3A%3D%20startLine%20+%20each%20size.%0A%09startLine%20%3A%3D%20endLine%20+%201.%0A%09endLine%20%3E%3D%20self%20selectionStart%20ifTrue%3A%20%5B%0A%09%20%20%20%20self%20selectionEnd%3A%20endLine.%0A%09%20%20%20%20%5Eeach%5D%5D%0A')}),
  8986. smalltalk.Workspace);
  8987. smalltalk.addMethod(
  8988. '_handleKeyDown_',
  8989. smalltalk.method({
  8990. selector: 'handleKeyDown:',
  8991. category: 'actions',
  8992. fn: function (anEvent) {
  8993. var self = this;
  8994. return function () {if (anEvent.ctrlKey) {if (anEvent.keyCode === 68) {self._printIt();return false;}if (anEvent.keyCode === 80) {self._doIt();return false;}}}();
  8995. return self;
  8996. },
  8997. source: unescape('handleKeyDown%3A%20anEvent%0A%20%20%20%20%5E%7B%27if%28anEvent.ctrlKey%29%20%7B%0A%09%09if%28anEvent.keyCode%20%3D%3D%3D%2068%29%20%7B%20//ctrl+p%0A%09%09%09self._printIt%28%29%3B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%09%09if%28anEvent.keyCode%20%3D%3D%3D%2080%29%20%7B%20//ctrl+d%0A%09%09%09self._doIt%28%29%3B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%09%7D%27%7D%0A')}),
  8998. smalltalk.Workspace);
  8999. smalltalk.addMethod(
  9000. '_clearWorkspace',
  9001. smalltalk.method({
  9002. selector: 'clearWorkspace',
  9003. category: 'actions',
  9004. fn: function () {
  9005. var self = this;
  9006. self['@textarea']._asJQuery()._val_("");
  9007. return self;
  9008. },
  9009. source: unescape('clearWorkspace%0A%20%20%20%20textarea%20asJQuery%20val%3A%20%27%27%0A')}),
  9010. smalltalk.Workspace);
  9011. smalltalk.addMethod(
  9012. '_doIt',
  9013. smalltalk.method({
  9014. selector: 'doIt',
  9015. category: 'actions',
  9016. fn: function () {
  9017. var self = this;
  9018. var selection = nil;
  9019. self['@textarea']._asJQuery()._focus();
  9020. self._selectionStart().__eq(self._selectionEnd())._ifTrue_ifFalse_(function () {return selection = self._currentLine();}, function () {return selection = self['@textarea']._asJQuery()._val()._copyFrom_to_(self._selectionStart().__plus(1), self._selectionEnd().__plus(1));});
  9021. return self._eval_(selection);
  9022. return self;
  9023. },
  9024. source: unescape('doIt%0A%20%20%20%20%7C%20selection%20%7C%0A%20%20%20%20textarea%20asJQuery%20focus.%0A%20%20%20%20self%20selectionStart%20%3D%20self%20selectionEnd%0A%09ifTrue%3A%20%5Bselection%20%3A%3D%20self%20currentLine%5D%0A%09ifFalse%3A%20%5B%0A%09%20%20%20%20selection%20%3A%3D%20textarea%20asJQuery%20val%20copyFrom%3A%20self%20selectionStart%20+%201%20to%3A%20self%20selectionEnd%20+%201%5D.%0A%20%20%20%20%5Eself%20eval%3A%20selection')}),
  9025. smalltalk.Workspace);
  9026. smalltalk.addMethod(
  9027. '_printIt',
  9028. smalltalk.method({
  9029. selector: 'printIt',
  9030. category: 'actions',
  9031. fn: function () {
  9032. var self = this;
  9033. self._print_(self._doIt()._printString());
  9034. return self;
  9035. },
  9036. source: unescape('printIt%0A%20%20%20%20self%20print%3A%20self%20doIt%20printString%0A')}),
  9037. smalltalk.Workspace);
  9038. smalltalk.addMethod(
  9039. '_print_',
  9040. smalltalk.method({
  9041. selector: 'print:',
  9042. category: 'actions',
  9043. fn: function (aString) {
  9044. var self = this;
  9045. var start = nil;
  9046. start = self._selectionEnd();
  9047. self['@textarea']._asJQuery()._val_(self['@textarea']._asJQuery()._val()._copyFrom_to_(1, start).__comma(" ").__comma(aString).__comma(" ").__comma(self['@textarea']._asJQuery()._val()._copyFrom_to_(start.__plus(1), self['@textarea']._asJQuery()._val()._size())));
  9048. self._selectionStart_(start);
  9049. self._selectionEnd_(start.__plus(aString._size()).__plus(2));
  9050. return self;
  9051. },
  9052. source: unescape('print%3A%20aString%0A%20%20%20%20%7C%20start%20%7C%0A%20%20%20%20start%20%3A%3D%20self%20selectionEnd.%0A%20%20%20%20textarea%20asJQuery%20val%3A%20%28%0A%09%28textarea%20asJQuery%20val%20copyFrom%3A%201%20to%3A%20start%29%2C%0A%09%27%20%27%2C%20aString%2C%20%27%20%27%2C%0A%09%28textarea%20asJQuery%20val%20copyFrom%3A%20start%20+%201%20to%3A%20textarea%20asJQuery%20val%20size%29%29.%0A%20%20%20%20self%20selectionStart%3A%20start.%0A%20%20%20%20self%20selectionEnd%3A%20start%20+%20aString%20size%20+%202%0A')}),
  9053. smalltalk.Workspace);
  9054. smalltalk.addMethod(
  9055. '_eval_',
  9056. smalltalk.method({
  9057. selector: 'eval:',
  9058. category: 'actions',
  9059. fn: function (aString) {
  9060. var self = this;
  9061. try {
  9062. var compiler = nil;
  9063. var node = nil;
  9064. compiler = smalltalk.Compiler._new();
  9065. node = compiler._parseExpression_(aString);
  9066. node._isParseFailure()._ifTrue_(function () {return function () {throw {name: "stReturn", selector: "_eval_", fn: function () {return self._alert_(node._reason().__comma(unescape("%2C%20position%3A%20")).__comma(node._position()));}};}();});
  9067. (function () {throw {name: "stReturn", selector: "_eval_", fn: function () {return compiler._loadExpression_(aString);}};}());
  9068. return self;
  9069. } catch (e) {
  9070. if (e.name === "stReturn" && e.selector === "_eval_") {
  9071. return e.fn();
  9072. }
  9073. throw e;
  9074. }
  9075. },
  9076. source: unescape('eval%3A%20aString%0A%20%20%20%20%7C%20compiler%20node%20%7C%0A%20%20%20%20compiler%20%3A%3D%20Compiler%20new.%0A%20%20%20%20node%20%3A%3D%20compiler%20parseExpression%3A%20aString.%0A%20%20%20%20node%20isParseFailure%20ifTrue%3A%20%5B%0A%09%5Eself%20alert%3A%20node%20reason%2C%20%27%2C%20position%3A%20%27%2C%20node%20position%5D.%0A%20%20%20%20%5Ecompiler%20loadExpression%3A%20aString%0A')}),
  9077. smalltalk.Workspace);
  9078. smalltalk.addMethod(
  9079. '_renderBoxOn_',
  9080. smalltalk.method({
  9081. selector: 'renderBoxOn:',
  9082. category: 'rendering',
  9083. fn: function (html) {
  9084. var self = this;
  9085. self['@textarea'] = html._textarea();
  9086. self['@textarea']._asJQuery()._call_("tabby");
  9087. self['@textarea']._onKeyDown_(function (e) {return self._handleKeyDown_(e);});
  9088. (function ($rec) {$rec._class_("jt_workspace");return $rec._at_put_("spellcheck", "false");}(self['@textarea']));
  9089. return self;
  9090. },
  9091. source: unescape('renderBoxOn%3A%20html%0A%20%20%20%20textarea%20%3A%3D%20html%20textarea.%0A%20%20%20%20textarea%20asJQuery%20call%3A%20%27tabby%27.%0A%20%20%20%20textarea%20onKeyDown%3A%20%5B%3Ae%20%7C%20self%20handleKeyDown%3A%20e%5D.%0A%20%20%20%20textarea%20%0A%09class%3A%20%27jt_workspace%27%3B%0A%09at%3A%20%27spellcheck%27%20put%3A%20%27false%27%0A')}),
  9092. smalltalk.Workspace);
  9093. smalltalk.addMethod(
  9094. '_renderButtonsOn_',
  9095. smalltalk.method({
  9096. selector: 'renderButtonsOn:',
  9097. category: 'rendering',
  9098. fn: function (html) {
  9099. var self = this;
  9100. (function ($rec) {$rec._with_("DoIt");$rec._title_(unescape("ctrl+d"));return $rec._onClick_(function () {return self._doIt();});}(html._button()));
  9101. (function ($rec) {$rec._with_("PrintIt");$rec._title_(unescape("ctrl+p"));return $rec._onClick_(function () {return self._printIt();});}(html._button()));
  9102. (function ($rec) {$rec._with_("InspectIt");$rec._title_(unescape("ctrl+i"));return $rec._onClick_(function () {return self._inspectIt();});}(html._button()));
  9103. (function ($rec) {$rec._with_("Clear workspace");return $rec._onClick_(function () {return self._clearWorkspace();});}(html._button()));
  9104. return self;
  9105. },
  9106. source: unescape('renderButtonsOn%3A%20html%0A%20%20%20%20html%20button%0A%09with%3A%20%27DoIt%27%3B%0A%09title%3A%20%27ctrl+d%27%3B%0A%09onClick%3A%20%5Bself%20doIt%5D.%0A%20%20%20%20html%20button%0A%09with%3A%20%27PrintIt%27%3B%0A%09title%3A%20%27ctrl+p%27%3B%0A%09onClick%3A%20%5Bself%20printIt%5D.%0A%20%20%20%20html%20button%0A%09with%3A%20%27InspectIt%27%3B%0A%09title%3A%20%27ctrl+i%27%3B%0A%09onClick%3A%20%5Bself%20inspectIt%5D.%0A%20%20%20%20html%20button%0A%09with%3A%20%27Clear%20workspace%27%3B%0A%09onClick%3A%20%5Bself%20clearWorkspace%5D%0A')}),
  9107. smalltalk.Workspace);
  9108. smalltalk.addMethod(
  9109. '_inspectIt',
  9110. smalltalk.method({
  9111. selector: 'inspectIt',
  9112. category: 'actions',
  9113. fn: function () {
  9114. var self = this;
  9115. self._doIt()._inspect();
  9116. return self;
  9117. },
  9118. source: unescape('inspectIt%0A%20%20%20%20self%20doIt%20inspect%0A')}),
  9119. smalltalk.Workspace);
  9120. smalltalk.addClass('Transcript', smalltalk.TabWidget, ['textarea'], 'IDE');
  9121. smalltalk.addMethod(
  9122. '_label',
  9123. smalltalk.method({
  9124. selector: 'label',
  9125. category: 'accessing',
  9126. fn: function () {
  9127. var self = this;
  9128. return unescape("%5BTranscript%5D");
  9129. return self;
  9130. },
  9131. source: unescape('label%0A%20%20%20%20%5E%27%5BTranscript%5D%27%0A')}),
  9132. smalltalk.Transcript);
  9133. smalltalk.addMethod(
  9134. '_show_',
  9135. smalltalk.method({
  9136. selector: 'show:',
  9137. category: 'actions',
  9138. fn: function (anObject) {
  9139. var self = this;
  9140. self['@textarea']._asJQuery()._val_(self['@textarea']._asJQuery()._val().__comma(anObject._asString()));
  9141. return self;
  9142. },
  9143. source: unescape('show%3A%20anObject%0A%20%20%20%20textarea%20asJQuery%20val%3A%20textarea%20asJQuery%20val%2C%20anObject%20asString.%0A%0A')}),
  9144. smalltalk.Transcript);
  9145. smalltalk.addMethod(
  9146. '_cr',
  9147. smalltalk.method({
  9148. selector: 'cr',
  9149. category: 'actions',
  9150. fn: function () {
  9151. var self = this;
  9152. self['@textarea']._asJQuery()._val_(self['@textarea']._asJQuery()._val().__comma(smalltalk.String._cr()));
  9153. return self;
  9154. },
  9155. source: unescape('cr%0A%20%20%20%20textarea%20asJQuery%20val%3A%20textarea%20asJQuery%20val%2C%20String%20cr.%0A')}),
  9156. smalltalk.Transcript);
  9157. smalltalk.addMethod(
  9158. '_clear',
  9159. smalltalk.method({
  9160. selector: 'clear',
  9161. category: 'actions',
  9162. fn: function () {
  9163. var self = this;
  9164. self['@textarea']._asJQuery()._val_("");
  9165. return self;
  9166. },
  9167. source: unescape('clear%0A%20%20%20%20textarea%20asJQuery%20val%3A%20%27%27%0A')}),
  9168. smalltalk.Transcript);
  9169. smalltalk.addMethod(
  9170. '_renderBoxOn_',
  9171. smalltalk.method({
  9172. selector: 'renderBoxOn:',
  9173. category: 'rendering',
  9174. fn: function (html) {
  9175. var self = this;
  9176. self['@textarea'] = html._textarea();
  9177. self['@textarea']._asJQuery()._call_("tabby");
  9178. (function ($rec) {$rec._class_("jt_transcript");return $rec._at_put_("spellcheck", "false");}(self['@textarea']));
  9179. return self;
  9180. },
  9181. source: unescape('renderBoxOn%3A%20html%0A%20%20%20%20textarea%20%3A%3D%20html%20textarea.%0A%20%20%20%20textarea%20asJQuery%20call%3A%20%27tabby%27.%0A%20%20%20%20textarea%20%0A%09class%3A%20%27jt_transcript%27%3B%0A%09at%3A%20%27spellcheck%27%20put%3A%20%27false%27%0A')}),
  9182. smalltalk.Transcript);
  9183. smalltalk.addMethod(
  9184. '_renderButtonsOn_',
  9185. smalltalk.method({
  9186. selector: 'renderButtonsOn:',
  9187. category: 'rendering',
  9188. fn: function (html) {
  9189. var self = this;
  9190. (function ($rec) {$rec._with_("Clear transcript");return $rec._onClick_(function () {return self._clear();});}(html._button()));
  9191. return self;
  9192. },
  9193. source: unescape('renderButtonsOn%3A%20html%0A%20%20%20%20html%20button%0A%09with%3A%20%27Clear%20transcript%27%3B%0A%09onClick%3A%20%5Bself%20clear%5D%0A')}),
  9194. smalltalk.Transcript);
  9195. smalltalk.Transcript.klass.iVarNames = ['current'];
  9196. smalltalk.addMethod(
  9197. '_open',
  9198. smalltalk.method({
  9199. selector: 'open',
  9200. category: 'instance creation',
  9201. fn: function () {
  9202. var self = this;
  9203. self._current()._open();
  9204. return self;
  9205. },
  9206. source: unescape('open%0A%20%20%20%20self%20current%20open%0A')}),
  9207. smalltalk.Transcript.klass);
  9208. smalltalk.addMethod(
  9209. '_new',
  9210. smalltalk.method({
  9211. selector: 'new',
  9212. category: 'instance creation',
  9213. fn: function () {
  9214. var self = this;
  9215. self._shouldNotImplement();
  9216. return self;
  9217. },
  9218. source: unescape('new%0A%20%20%20%20self%20shouldNotImplement%0A')}),
  9219. smalltalk.Transcript.klass);
  9220. smalltalk.addMethod(
  9221. '_current',
  9222. smalltalk.method({
  9223. selector: 'current',
  9224. category: 'instance creation',
  9225. fn: function () {
  9226. var self = this;
  9227. return self['@current']._ifNil_(function () {return self['@current'] = self.klass.superclass.fn.prototype._new.apply(self, []);});
  9228. return self;
  9229. },
  9230. source: unescape('current%0A%20%20%20%20%5Ecurrent%20ifNil%3A%20%5Bcurrent%20%3A%3D%20super%20new%5D%0A')}),
  9231. smalltalk.Transcript.klass);
  9232. smalltalk.addMethod(
  9233. '_show_',
  9234. smalltalk.method({
  9235. selector: 'show:',
  9236. category: 'printing',
  9237. fn: function (anObject) {
  9238. var self = this;
  9239. self._current()._show_(anObject);
  9240. return self;
  9241. },
  9242. source: unescape('show%3A%20anObject%0A%20%20%20%20self%20current%20show%3A%20anObject%0A')}),
  9243. smalltalk.Transcript.klass);
  9244. smalltalk.addMethod(
  9245. '_cr',
  9246. smalltalk.method({
  9247. selector: 'cr',
  9248. category: 'printing',
  9249. fn: function () {
  9250. var self = this;
  9251. self._current()._show_(smalltalk.String._cr());
  9252. return self;
  9253. },
  9254. source: unescape('cr%0A%20%20%20%20self%20current%20show%3A%20String%20cr%0A')}),
  9255. smalltalk.Transcript.klass);
  9256. smalltalk.addMethod(
  9257. '_clear',
  9258. smalltalk.method({
  9259. selector: 'clear',
  9260. category: 'printing',
  9261. fn: function () {
  9262. var self = this;
  9263. self._current()._clear();
  9264. return self;
  9265. },
  9266. source: unescape('clear%0A%20%20%20%20self%20current%20clear%0A')}),
  9267. smalltalk.Transcript.klass);
  9268. smalltalk.addClass('Browser', smalltalk.TabWidget, ['selectedCategory', 'selectedClass', 'selectedProtocol', 'selectedMethod', 'commitButton', 'categoriesList', 'classesList', 'protocolsList', 'methodsList', 'sourceTextarea', 'tabsList', 'selectedTab', 'saveButton', 'classButtons', 'methodButtons', 'unsavedChanges'], 'IDE');
  9269. smalltalk.addMethod(
  9270. '_initialize',
  9271. smalltalk.method({
  9272. selector: 'initialize',
  9273. category: 'initialization',
  9274. fn: function () {
  9275. var self = this;
  9276. self.klass.superclass.fn.prototype._initialize.apply(self, []);
  9277. self['@selectedTab'] = "instance";
  9278. self['@unsavedChanges'] = false;
  9279. return self;
  9280. },
  9281. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20selectedTab%20%3A%3D%20%23instance.%0A%20%20%20%20unsavedChanges%20%3A%3D%20false%0A')}),
  9282. smalltalk.Browser);
  9283. smalltalk.addMethod(
  9284. '_label',
  9285. smalltalk.method({
  9286. selector: 'label',
  9287. category: 'accessing',
  9288. fn: function () {
  9289. var self = this;
  9290. return self['@selectedClass']._ifNil_ifNotNil_(function () {return unescape("Browser%20%28nil%29");}, function () {return self['@selectedClass']._name();});
  9291. return self;
  9292. },
  9293. source: unescape('label%0A%20%20%20%20%5EselectedClass%20%0A%09ifNil%3A%20%5B%27Browser%20%28nil%29%27%5D%0A%09ifNotNil%3A%20%5BselectedClass%20name%5D%0A')}),
  9294. smalltalk.Browser);
  9295. smalltalk.addMethod(
  9296. '_categories',
  9297. smalltalk.method({
  9298. selector: 'categories',
  9299. category: 'accessing',
  9300. fn: function () {
  9301. var self = this;
  9302. var categories = nil;
  9303. categories = smalltalk.Array._new();
  9304. smalltalk.Smalltalk._current()._classes()._do_(function (each) {return categories._includes_(each._category())._ifFalse_(function () {return categories._add_(each._category());});});
  9305. return categories._sort();
  9306. return self;
  9307. },
  9308. source: unescape('categories%0A%20%20%20%20%7C%20categories%20%7C%0A%20%20%20%20categories%20%3A%3D%20Array%20new.%0A%20%20%20%20Smalltalk%20current%20classes%20do%3A%20%5B%3Aeach%20%7C%0A%09%28categories%20includes%3A%20each%20category%29%20ifFalse%3A%20%5B%0A%09%20%20%20%20categories%20add%3A%20each%20category%5D%5D.%0A%20%20%20%20%5Ecategories%20sort%0A')}),
  9309. smalltalk.Browser);
  9310. smalltalk.addMethod(
  9311. '_classes',
  9312. smalltalk.method({
  9313. selector: 'classes',
  9314. category: 'accessing',
  9315. fn: function () {
  9316. var self = this;
  9317. return smalltalk.Smalltalk._current()._classes()._select_(function (each) {return each._category().__eq(self['@selectedCategory']);})._sort_(function (a, b) {return a._name().__gt(b._name());});
  9318. return self;
  9319. },
  9320. source: unescape('classes%0A%20%20%20%20%5E%28Smalltalk%20current%20classes%20%0A%09select%3A%20%5B%3Aeach%20%7C%20each%20category%20%3D%20selectedCategory%5D%29%0A%09sort%3A%20%5B%3Aa%20%3Ab%20%7C%20a%20name%20%3E%20b%20name%5D%0A')}),
  9321. smalltalk.Browser);
  9322. smalltalk.addMethod(
  9323. '_protocols',
  9324. smalltalk.method({
  9325. selector: 'protocols',
  9326. category: 'accessing',
  9327. fn: function () {
  9328. var self = this;
  9329. try {
  9330. var klass = nil;
  9331. var protocols = nil;
  9332. protocols = smalltalk.Array._new();
  9333. self['@selectedClass']._ifNotNil_(function () {self['@selectedTab'].__eq("comment")._ifTrue_(function () {return function () {throw {name: "stReturn", selector: "_protocols", fn: function () {return [];}};}();});klass = self['@selectedTab'].__eq("instance")._ifTrue_ifFalse_(function () {return self['@selectedClass'];}, function () {return self['@selectedClass']._class();});klass._methodDictionary()._isEmpty()._ifTrue_(function () {return protocols._add_("not yet classified");});return klass._methodDictionary()._do_(function (each) {return protocols._includes_(each._category())._ifFalse_(function () {return protocols._add_(each._category());});});});
  9334. (function () {throw {name: "stReturn", selector: "_protocols", fn: function () {return protocols._sort();}};}());
  9335. return self;
  9336. } catch (e) {
  9337. if (e.name === "stReturn" && e.selector === "_protocols") {
  9338. return e.fn();
  9339. }
  9340. throw e;
  9341. }
  9342. },
  9343. source: unescape('protocols%0A%20%20%20%20%7C%20klass%20protocols%20%7C%0A%20%20%20%20protocols%20%3A%3D%20Array%20new.%0A%20%20%20%20selectedClass%20ifNotNil%3A%20%5B%0A%09selectedTab%20%3D%20%23comment%20ifTrue%3A%20%5B%5E%23%28%29%5D.%0A%09klass%20%3A%3D%20selectedTab%20%3D%20%23instance%0A%09%20%20%20%20ifTrue%3A%20%5BselectedClass%5D%0A%09%20%20%20%20ifFalse%3A%20%5BselectedClass%20class%5D.%0A%09klass%20methodDictionary%20isEmpty%20ifTrue%3A%20%5B%0A%09%20%20%20%20protocols%20add%3A%20%27not%20yet%20classified%27%5D.%0A%09klass%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%5D.%0A%20%20%20%20%5Eprotocols%20sort%0A')}),
  9344. smalltalk.Browser);
  9345. smalltalk.addMethod(
  9346. '_methods',
  9347. smalltalk.method({
  9348. selector: 'methods',
  9349. category: 'accessing',
  9350. fn: function () {
  9351. var self = this;
  9352. try {
  9353. var klass = nil;
  9354. self['@selectedTab'].__eq("comment")._ifTrue_(function () {return function () {throw {name: "stReturn", selector: "_methods", fn: function () {return [];}};}();});
  9355. self['@selectedClass']._ifNotNil_(function () {return klass = self['@selectedTab'].__eq("instance")._ifTrue_ifFalse_(function () {return self['@selectedClass'];}, function () {return self['@selectedClass']._class();});});
  9356. (function () {throw {name: "stReturn", selector: "_methods", fn: function () {return self['@selectedProtocol']._ifNil_ifNotNil_(function () {return klass._ifNil_ifNotNil_(function () {return [];}, function () {return klass._methodDictionary()._values();});}, function () {return klass._methodDictionary()._values()._select_(function (each) {return each._category().__eq(self['@selectedProtocol']);});})._sort_(function (a, b) {return a._selector().__gt(b._selector());});}};}());
  9357. return self;
  9358. } catch (e) {
  9359. if (e.name === "stReturn" && e.selector === "_methods") {
  9360. return e.fn();
  9361. }
  9362. throw e;
  9363. }
  9364. },
  9365. source: unescape('methods%0A%20%20%20%20%7C%20klass%20%7C%0A%20%20%20%20selectedTab%20%3D%20%23comment%20ifTrue%3A%20%5B%5E%23%28%29%5D.%0A%20%20%20%20selectedClass%20ifNotNil%3A%20%5B%0A%09klass%20%3A%3D%20selectedTab%20%3D%20%23instance%0A%09%20%20%20%20ifTrue%3A%20%5BselectedClass%5D%0A%09%20%20%20%20ifFalse%3A%20%5BselectedClass%20class%5D%5D.%0A%20%20%20%20%5E%28selectedProtocol%20%0A%09ifNil%3A%20%5B%0A%09%20%20%20%20klass%20%0A%09%09ifNil%3A%20%5B%23%28%29%5D%20%0A%09%09ifNotNil%3A%20%5Bklass%20methodDictionary%20values%5D%5D%0A%09ifNotNil%3A%20%5B%0A%09%20%20%20%20klass%20methodDictionary%20values%20select%3A%20%5B%3Aeach%20%7C%0A%09%09each%20category%20%3D%20selectedProtocol%5D%5D%29%20sort%3A%20%5B%3Aa%20%3Ab%20%7C%20a%20selector%20%3E%20b%20selector%5D%0A')}),
  9366. smalltalk.Browser);
  9367. smalltalk.addMethod(
  9368. '_source',
  9369. smalltalk.method({
  9370. selector: 'source',
  9371. category: 'accessing',
  9372. fn: function () {
  9373. var self = this;
  9374. try {
  9375. self['@selectedTab'].__eq("comment")._ifFalse_(function () {return function () {throw {name: "stReturn", selector: "_source", fn: function () {return self['@selectedProtocol']._notNil()._or_(function () {return self['@selectedMethod']._notNil();})._ifFalse_ifTrue_(function () {return self._declarationSource();}, function () {return self._methodSource();});}};}();});
  9376. (function () {throw {name: "stReturn", selector: "_source", fn: function () {return self['@selectedClass']._ifNil_ifNotNil_(function () {return "";}, function () {return self._classCommentSource();});}};}());
  9377. return self;
  9378. } catch (e) {
  9379. if (e.name === "stReturn" && e.selector === "_source") {
  9380. return e.fn();
  9381. }
  9382. throw e;
  9383. }
  9384. },
  9385. source: unescape('source%0A%20%20%20%20selectedTab%20%3D%20%23comment%20ifFalse%3A%20%5B%0A%09%5E%28selectedProtocol%20notNil%20or%3A%20%5BselectedMethod%20notNil%5D%29%0A%09%20%20%20%20ifFalse%3A%20%5Bself%20declarationSource%5D%0A%09%20%20%20%20ifTrue%3A%20%5Bself%20methodSource%5D%5D.%0A%20%20%20%20%5EselectedClass%0A%09ifNil%3A%20%5B%27%27%5D%0A%09ifNotNil%3A%20%5Bself%20classCommentSource%5D%0A')}),
  9386. smalltalk.Browser);
  9387. smalltalk.addMethod(
  9388. '_methodSource',
  9389. smalltalk.method({
  9390. selector: 'methodSource',
  9391. category: 'accessing',
  9392. fn: function () {
  9393. var self = this;
  9394. return self['@selectedMethod']._ifNil_ifNotNil_(function () {return self._dummyMethodSource();}, function () {return self['@selectedMethod']._source();});
  9395. return self;
  9396. },
  9397. source: unescape('methodSource%0A%20%20%20%20%5EselectedMethod%0A%09ifNil%3A%20%5Bself%20dummyMethodSource%5D%0A%09ifNotNil%3A%20%5BselectedMethod%20source%5D%0A')}),
  9398. smalltalk.Browser);
  9399. smalltalk.addMethod(
  9400. '_dummyMethodSource',
  9401. smalltalk.method({
  9402. selector: 'dummyMethodSource',
  9403. category: 'accessing',
  9404. fn: function () {
  9405. var self = this;
  9406. return unescape("messageSelectorAndArgumentNames%0A%09%22comment%20stating%20purpose%20of%20message%22%0A%0A%09%7C%20temporary%20variable%20names%20%7C%0A%09statements");
  9407. return self;
  9408. },
  9409. source: unescape('dummyMethodSource%0A%20%20%20%20%5E%27messageSelectorAndArgumentNames%0A%09%22comment%20stating%20purpose%20of%20message%22%0A%0A%09%7C%20temporary%20variable%20names%20%7C%0A%09statements%27%0A')}),
  9410. smalltalk.Browser);
  9411. smalltalk.addMethod(
  9412. '_declarationSource',
  9413. smalltalk.method({
  9414. selector: 'declarationSource',
  9415. category: 'accessing',
  9416. fn: function () {
  9417. var self = this;
  9418. return self['@selectedTab'].__eq("instance")._ifTrue_ifFalse_(function () {return self._classDeclarationSource();}, function () {return self._metaclassDeclarationSource();});
  9419. return self;
  9420. },
  9421. source: unescape('declarationSource%0A%20%20%20%20%5EselectedTab%20%3D%20%23instance%0A%09ifTrue%3A%20%5Bself%20classDeclarationSource%5D%0A%09ifFalse%3A%20%5Bself%20metaclassDeclarationSource%5D%0A')}),
  9422. smalltalk.Browser);
  9423. smalltalk.addMethod(
  9424. '_classDeclarationSource',
  9425. smalltalk.method({
  9426. selector: 'classDeclarationSource',
  9427. category: 'accessing',
  9428. fn: function () {
  9429. var self = this;
  9430. var stream = nil;
  9431. stream = ""._writeStream();
  9432. self['@selectedClass']._ifNotNil_(function () {(function ($rec) {$rec._nextPutAll_(self['@selectedClass']._superclass()._asString());$rec._nextPutAll_(unescape("%20subclass%3A%20%23"));$rec._nextPutAll_(self['@selectedClass']._name());$rec._nextPutAll_(smalltalk.String._cr().__comma(smalltalk.String._tab()));return $rec._nextPutAll_(unescape("instanceVariableNames%3A%20%27"));}(stream));self['@selectedClass']._instanceVariableNames()._do_separatedBy_(function (each) {return stream._nextPutAll_(each);}, function () {return stream._nextPutAll_(" ");});return function ($rec) {$rec._nextPutAll_(unescape("%27").__comma(smalltalk.String._cr()).__comma(smalltalk.String._tab()));$rec._nextPutAll_(unescape("category%3A%20%27"));$rec._nextPutAll_(self['@selectedClass']._category());return $rec._nextPutAll_(unescape("%27"));}(stream);});
  9433. return stream._contents();
  9434. return self;
  9435. },
  9436. source: unescape('classDeclarationSource%0A%20%20%20%20%7C%20stream%20%7C%0A%20%20%20%20stream%20%3A%3D%20%27%27%20writeStream.%0A%20%20%20%20selectedClass%20ifNotNil%3A%20%5B%0A%09stream%20%0A%09%20%20%20%20nextPutAll%3A%20selectedClass%20superclass%20asString%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%20subclass%3A%20%23%27%3B%0A%09%20%20%20%20nextPutAll%3A%20selectedClass%20name%3B%0A%09%20%20%20%20nextPutAll%3A%20String%20cr%2C%20String%20tab%3B%0A%09%20%20%20%20nextPutAll%3A%20%27instanceVariableNames%3A%20%27%27%27.%0A%09selectedClass%20instanceVariableNames%20%0A%09%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20stream%20nextPutAll%3A%20each%5D%20%0A%09%20%20%20%20separatedBy%3A%20%5Bstream%20nextPutAll%3A%20%27%20%27%5D.%0A%09stream%0A%09%20%20%20%20nextPutAll%3A%20%27%27%27%27%2C%20String%20cr%2C%20String%20tab%3B%0A%09%20%20%20%20nextPutAll%3A%20%27category%3A%20%27%27%27%3B%0A%09%20%20%20%20nextPutAll%3A%20selectedClass%20category%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%27%27%27%5D.%0A%20%20%20%20%5Estream%20contents%0A')}),
  9437. smalltalk.Browser);
  9438. smalltalk.addMethod(
  9439. '_metaclassDeclarationSource',
  9440. smalltalk.method({
  9441. selector: 'metaclassDeclarationSource',
  9442. category: 'accessing',
  9443. fn: function () {
  9444. var self = this;
  9445. var stream = nil;
  9446. stream = ""._writeStream();
  9447. self['@selectedClass']._ifNotNil_(function () {(function ($rec) {$rec._nextPutAll_(self['@selectedClass']._asString());$rec._nextPutAll_(" class ");return $rec._nextPutAll_(unescape("instanceVariableNames%3A%20%27"));}(stream));self['@selectedClass']._class()._instanceVariableNames()._do_separatedBy_(function (each) {return stream._nextPutAll_(each);}, function () {return stream._nextPutAll_(" ");});return stream._nextPutAll_(unescape("%27"));});
  9448. return stream._contents();
  9449. return self;
  9450. },
  9451. source: unescape('metaclassDeclarationSource%0A%20%20%20%20%7C%20stream%20%7C%0A%20%20%20%20stream%20%3A%3D%20%27%27%20writeStream.%0A%20%20%20%20selectedClass%20ifNotNil%3A%20%5B%0A%09stream%20%0A%09%20%20%20%20nextPutAll%3A%20selectedClass%20asString%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%20class%20%27%3B%0A%09%20%20%20%20nextPutAll%3A%20%27instanceVariableNames%3A%20%27%27%27.%0A%09selectedClass%20class%20instanceVariableNames%0A%09%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20stream%20nextPutAll%3A%20each%5D%0A%09%20%20%20%20separatedBy%3A%20%5Bstream%20nextPutAll%3A%20%27%20%27%5D.%0A%09stream%20nextPutAll%3A%20%27%27%27%27%5D.%0A%20%20%20%20%5Estream%20contents%0A')}),
  9452. smalltalk.Browser);
  9453. smalltalk.addMethod(
  9454. '_classCommentSource',
  9455. smalltalk.method({
  9456. selector: 'classCommentSource',
  9457. category: 'accessing',
  9458. fn: function () {
  9459. var self = this;
  9460. return self['@selectedClass']._comment();
  9461. return self;
  9462. },
  9463. source: unescape('classCommentSource%0A%20%20%20%20%5EselectedClass%20comment%0A')}),
  9464. smalltalk.Browser);
  9465. smalltalk.addMethod(
  9466. '_enableSaveButton',
  9467. smalltalk.method({
  9468. selector: 'enableSaveButton',
  9469. category: 'actions',
  9470. fn: function () {
  9471. var self = this;
  9472. self['@saveButton']._removeAt_("disabled");
  9473. self['@unsavedChanges'] = true;
  9474. return self;
  9475. },
  9476. source: unescape('enableSaveButton%0A%20%20%20%20saveButton%20removeAt%3A%20%27disabled%27.%0A%20%20%20%20unsavedChanges%20%3A%3D%20true%0A')}),
  9477. smalltalk.Browser);
  9478. smalltalk.addMethod(
  9479. '_disableSaveButton',
  9480. smalltalk.method({
  9481. selector: 'disableSaveButton',
  9482. category: 'actions',
  9483. fn: function () {
  9484. var self = this;
  9485. self['@saveButton']._ifNotNil_(function () {return self['@saveButton']._at_put_("disabled", true);});
  9486. self['@unsavedChanges'] = false;
  9487. return self;
  9488. },
  9489. source: unescape('disableSaveButton%0A%20%20%20%20saveButton%20ifNotNil%3A%20%5B%0A%09saveButton%20at%3A%20%27disabled%27%20put%3A%20true%5D.%0A%20%20%20%20unsavedChanges%20%3A%3D%20false%0A')}),
  9490. smalltalk.Browser);
  9491. smalltalk.addMethod(
  9492. '_hideClassButtons',
  9493. smalltalk.method({
  9494. selector: 'hideClassButtons',
  9495. category: 'actions',
  9496. fn: function () {
  9497. var self = this;
  9498. self['@classButtons']._asJQuery()._hide();
  9499. return self;
  9500. },
  9501. source: unescape('hideClassButtons%0A%20%20%20%20classButtons%20asJQuery%20hide%0A')}),
  9502. smalltalk.Browser);
  9503. smalltalk.addMethod(
  9504. '_showClassButtons',
  9505. smalltalk.method({
  9506. selector: 'showClassButtons',
  9507. category: 'actions',
  9508. fn: function () {
  9509. var self = this;
  9510. self['@classButtons']._asJQuery()._show();
  9511. return self;
  9512. },
  9513. source: unescape('showClassButtons%0A%20%20%20%20classButtons%20asJQuery%20show%0A')}),
  9514. smalltalk.Browser);
  9515. smalltalk.addMethod(
  9516. '_hideMethodButtons',
  9517. smalltalk.method({
  9518. selector: 'hideMethodButtons',
  9519. category: 'actions',
  9520. fn: function () {
  9521. var self = this;
  9522. self['@methodButtons']._asJQuery()._hide();
  9523. return self;
  9524. },
  9525. source: unescape('hideMethodButtons%0A%20%20%20%20methodButtons%20asJQuery%20hide%0A')}),
  9526. smalltalk.Browser);
  9527. smalltalk.addMethod(
  9528. '_showMethodButtons',
  9529. smalltalk.method({
  9530. selector: 'showMethodButtons',
  9531. category: 'actions',
  9532. fn: function () {
  9533. var self = this;
  9534. self['@methodButtons']._asJQuery()._show();
  9535. return self;
  9536. },
  9537. source: unescape('showMethodButtons%0A%20%20%20%20methodButtons%20asJQuery%20show%0A')}),
  9538. smalltalk.Browser);
  9539. smalltalk.addMethod(
  9540. '_compile',
  9541. smalltalk.method({
  9542. selector: 'compile',
  9543. category: 'actions',
  9544. fn: function () {
  9545. var self = this;
  9546. self._disableSaveButton();
  9547. self['@selectedTab'].__eq("comment")._ifTrue_(function () {return self['@selectedClass']._ifNotNil_(function () {return self._compileClassComment();});});
  9548. self['@selectedProtocol']._notNil()._or_(function () {return self['@selectedMethod']._notNil();})._ifFalse_ifTrue_(function () {return self._compileDefinition();}, function () {return self._compileMethodDefinition();});
  9549. return self;
  9550. },
  9551. source: unescape('compile%0A%20%20%20%20self%20disableSaveButton.%0A%20%20%20%20selectedTab%20%3D%20%23comment%20ifTrue%3A%20%5B%0A%09selectedClass%20ifNotNil%3A%20%5B%0A%09%20%20%20%20self%20compileClassComment%5D%5D.%0A%20%20%20%20%28selectedProtocol%20notNil%20or%3A%20%5BselectedMethod%20notNil%5D%29%0A%09ifFalse%3A%20%5Bself%20compileDefinition%5D%0A%09ifTrue%3A%20%5Bself%20compileMethodDefinition%5D%0A')}),
  9552. smalltalk.Browser);
  9553. smalltalk.addMethod(
  9554. '_compileClassComment',
  9555. smalltalk.method({
  9556. selector: 'compileClassComment',
  9557. category: 'actions',
  9558. fn: function () {
  9559. var self = this;
  9560. self['@selectedClass']._comment_(self['@sourceTextarea']._asJQuery()._val());
  9561. return self;
  9562. },
  9563. source: unescape('compileClassComment%0A%20%20%20%20selectedClass%20comment%3A%20sourceTextarea%20asJQuery%20val%0A')}),
  9564. smalltalk.Browser);
  9565. smalltalk.addMethod(
  9566. '_compileMethodDefinition',
  9567. smalltalk.method({
  9568. selector: 'compileMethodDefinition',
  9569. category: 'actions',
  9570. fn: function () {
  9571. var self = this;
  9572. self['@selectedTab'].__eq("instance")._ifTrue_ifFalse_(function () {return self._compileMethodDefinitionFor_(self['@selectedClass']);}, function () {return self._compileMethodDefinitionFor_(self['@selectedClass']._class());});
  9573. return self;
  9574. },
  9575. source: unescape('compileMethodDefinition%0A%20%20%20%20selectedTab%20%3D%20%23instance%0A%09ifTrue%3A%20%5Bself%20compileMethodDefinitionFor%3A%20selectedClass%5D%0A%09ifFalse%3A%20%5Bself%20compileMethodDefinitionFor%3A%20selectedClass%20class%5D%0A')}),
  9576. smalltalk.Browser);
  9577. smalltalk.addMethod(
  9578. '_compileMethodDefinitionFor_',
  9579. smalltalk.method({
  9580. selector: 'compileMethodDefinitionFor:',
  9581. category: 'actions',
  9582. fn: function (aClass) {
  9583. var self = this;
  9584. try {
  9585. var compiler = nil;
  9586. var method = nil;
  9587. var source = nil;
  9588. var node = nil;
  9589. source = self['@sourceTextarea']._asJQuery()._val();
  9590. self['@selectedProtocol']._ifNil_(function () {return self['@selectedProtocol'] = self['@selectedMethod']._category();});
  9591. compiler = smalltalk.Compiler._new();
  9592. node = compiler._parse_(source);
  9593. node._isParseFailure()._ifTrue_(function () {return function () {throw {name: "stReturn", selector: "_compileMethodDefinitionFor_", fn: function () {return self._alert_("PARSE ERROR: ".__comma(node._reason()).__comma(unescape("%2C%20position%3A%20")).__comma(node._position()._asString()));}};}();});
  9594. compiler._currentClass_(self['@selectedClass']);
  9595. method = compiler._eval_(compiler._compileNode_(node));
  9596. method._category_(self['@selectedProtocol']);
  9597. aClass._addCompiledMethod_(method);
  9598. self._updateMethodsList();
  9599. self._selectMethod_(method);
  9600. return self;
  9601. } catch (e) {
  9602. if (e.name === "stReturn" &&
  9603. e.selector === "_compileMethodDefinitionFor_") {
  9604. return e.fn();
  9605. }
  9606. throw e;
  9607. }
  9608. },
  9609. source: unescape('compileMethodDefinitionFor%3A%20aClass%0A%20%20%20%20%7C%20compiler%20method%20source%20node%20%7C%0A%20%20%20%20source%20%3A%3D%20sourceTextarea%20asJQuery%20val.%0A%20%20%20%20selectedProtocol%20ifNil%3A%20%5BselectedProtocol%20%3A%3D%20selectedMethod%20category%5D.%0A%20%20%20%20compiler%20%3A%3D%20Compiler%20new.%0A%20%20%20%20node%20%3A%3D%20compiler%20parse%3A%20source.%0A%20%20%20%20node%20isParseFailure%20ifTrue%3A%20%5B%0A%09%5Eself%20alert%3A%20%27PARSE%20ERROR%3A%20%27%2C%20node%20reason%2C%20%27%2C%20position%3A%20%27%2C%20node%20position%20asString%5D.%0A%20%20%20%20compiler%20currentClass%3A%20selectedClass.%0A%20%20%20%20method%20%3A%3D%20compiler%20eval%3A%20%28compiler%20compileNode%3A%20node%29.%0A%20%20%20%20method%20category%3A%20selectedProtocol.%0A%20%20%20%20aClass%20addCompiledMethod%3A%20method.%0A%20%20%20%20self%20updateMethodsList.%0A%20%20%20%20self%20selectMethod%3A%20method%0A')}),
  9610. smalltalk.Browser);
  9611. smalltalk.addMethod(
  9612. '_compileDefinition',
  9613. smalltalk.method({
  9614. selector: 'compileDefinition',
  9615. category: 'actions',
  9616. fn: function () {
  9617. var self = this;
  9618. var newClass = nil;
  9619. newClass = smalltalk.Compiler._new()._loadExpression_(self['@sourceTextarea']._asJQuery()._val());
  9620. (function ($rec) {$rec._updateCategoriesList();return $rec._updateClassesList();}(self));
  9621. return self;
  9622. },
  9623. source: unescape('compileDefinition%0A%20%20%20%20%7C%20newClass%20%7C%0A%20%20%20%20newClass%20%3A%3D%20Compiler%20new%20loadExpression%3A%20sourceTextarea%20asJQuery%20val.%0A%20%20%20%20self%20%0A%09updateCategoriesList%3B%0A%09updateClassesList%0A')}),
  9624. smalltalk.Browser);
  9625. smalltalk.addMethod(
  9626. '_commitCategory',
  9627. smalltalk.method({
  9628. selector: 'commitCategory',
  9629. category: 'actions',
  9630. fn: function () {
  9631. var self = this;
  9632. self['@selectedCategory']._ifNotNil_(function () {return function ($rec) {$rec._at_put_("type", "PUT");$rec._at_put_("data", smalltalk.Exporter._new()._exportCategory_(self['@selectedCategory']));$rec._at_put_("error", function () {return self._alert_(unescape("Commit%20failed%21"));});return $rec._send();}(smalltalk.Ajax._url_(self._class()._commitPath().__comma(unescape("/")).__comma(self['@selectedCategory']).__comma(".js")));});
  9633. return self;
  9634. },
  9635. source: unescape('commitCategory%0A%20%20%20%20selectedCategory%20ifNotNil%3A%20%5B%0A%09%28Ajax%20url%3A%20self%20class%20commitPath%2C%20%27/%27%2C%20selectedCategory%2C%20%27.js%27%29%0A%09%20%20%20%20at%3A%20%27type%27%20put%3A%20%27PUT%27%3B%0A%09%20%20%20%20at%3A%20%27data%27%20put%3A%20%28Exporter%20new%20exportCategory%3A%20selectedCategory%29%3B%0A%09%20%20%20%20at%3A%20%27error%27%20put%3A%20%5Bself%20alert%3A%20%27Commit%20failed%21%27%5D%3B%0A%09%20%20%20%20send%5D%0A')}),
  9636. smalltalk.Browser);
  9637. smalltalk.addMethod(
  9638. '_cancelChanges',
  9639. smalltalk.method({
  9640. selector: 'cancelChanges',
  9641. category: 'actions',
  9642. fn: function () {
  9643. var self = this;
  9644. return self['@unsavedChanges']._ifTrue_ifFalse_(function () {return self._confirm_(unescape("Cancel%20changes%3F"));}, function () {return true;});
  9645. return self;
  9646. },
  9647. source: unescape('cancelChanges%0A%20%20%20%20%5EunsavedChanges%20%0A%09ifTrue%3A%20%5Bself%20confirm%3A%20%27Cancel%20changes%3F%27%5D%0A%09ifFalse%3A%20%5Btrue%5D%0A')}),
  9648. smalltalk.Browser);
  9649. smalltalk.addMethod(
  9650. '_removeClass',
  9651. smalltalk.method({
  9652. selector: 'removeClass',
  9653. category: 'actions',
  9654. fn: function () {
  9655. var self = this;
  9656. self._confirm_("Do you really want to remove ".__comma(self['@selectedClass']._name()).__comma(unescape("%3F")))._ifTrue_(function () {smalltalk.Smalltalk._current()._basicDelete_(self['@selectedClass']._name());return self._selectClass_(nil);});
  9657. return self;
  9658. },
  9659. source: unescape('removeClass%0A%20%20%20%20%28self%20confirm%3A%20%27Do%20you%20really%20want%20to%20remove%20%27%2C%20selectedClass%20name%2C%20%27%3F%27%29%0A%09ifTrue%3A%20%5B%0A%09%20%20%20%20Smalltalk%20current%20basicDelete%3A%20selectedClass%20name.%0A%09%20%20%20%20self%20selectClass%3A%20nil%5D%0A')}),
  9660. smalltalk.Browser);
  9661. smalltalk.addMethod(
  9662. '_removeMethod',
  9663. smalltalk.method({
  9664. selector: 'removeMethod',
  9665. category: 'actions',
  9666. fn: function () {
  9667. var self = this;
  9668. self._cancelChanges()._ifTrue_(function () {return self._confirm_(unescape("Do%20you%20really%20want%20to%20remove%20%23").__comma(self['@selectedMethod']._selector()).__comma(unescape("%3F")))._ifTrue_(function () {self['@selectedTab'].__eq("instance")._ifTrue_ifFalse_(function () {return self['@selectedClass']._removeCompiledMethod_(self['@selectedMethod']);}, function () {return self['@selectedClass']._class()._removeCompiledMethod_(self['@selectedMethod']);});return self._selectMethod_(nil);});});
  9669. return self;
  9670. },
  9671. source: unescape('removeMethod%0A%20%20%20%20self%20cancelChanges%20ifTrue%3A%20%5B%0A%09%28self%20confirm%3A%20%27Do%20you%20really%20want%20to%20remove%20%23%27%2C%20selectedMethod%20selector%2C%20%27%3F%27%29%0A%09%20%20%20%20ifTrue%3A%20%5B%0A%09%09selectedTab%20%3D%20%23instance%20%0A%09%09%09ifTrue%3A%20%5BselectedClass%20removeCompiledMethod%3A%20selectedMethod%5D%0A%09%09%09ifFalse%3A%20%5BselectedClass%20class%20removeCompiledMethod%3A%20selectedMethod%5D.%0A%09%09self%20selectMethod%3A%20nil%5D%5D%0A')}),
  9672. smalltalk.Browser);
  9673. smalltalk.addMethod(
  9674. '_setMethodProtocol_',
  9675. smalltalk.method({
  9676. selector: 'setMethodProtocol:',
  9677. category: 'actions',
  9678. fn: function (aString) {
  9679. var self = this;
  9680. self._cancelChanges()._ifTrue_(function () {return self._protocols()._includes_(aString)._ifFalse_ifTrue_(function () {return self._addNewProtocol();}, function () {self['@selectedMethod']._category_(aString);self['@selectedProtocol'] = aString;self['@selectedMethod'] = self['@selectedMethod'];return function ($rec) {$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();}(self);});});
  9681. return self;
  9682. },
  9683. source: unescape('setMethodProtocol%3A%20aString%0A%20%20%20%20self%20cancelChanges%20ifTrue%3A%20%5B%0A%09%28self%20protocols%20includes%3A%20aString%29%0A%09%20%20%20%20ifFalse%3A%20%5Bself%20addNewProtocol%5D%0A%09%20%20%20%20ifTrue%3A%20%5B%0A%09%09selectedMethod%20category%3A%20aString.%0A%09%09selectedProtocol%20%3A%3D%20aString.%0A%09%09selectedMethod%20%3A%3D%20selectedMethod.%0A%09%09self%20%0A%09%09%20%20%20%20updateProtocolsList%3B%0A%09%09%20%20%20%20updateMethodsList%3B%0A%09%09%20%20%20%20updateSourceAndButtons%5D%5D%0A')}),
  9684. smalltalk.Browser);
  9685. smalltalk.addMethod(
  9686. '_addNewProtocol',
  9687. smalltalk.method({
  9688. selector: 'addNewProtocol',
  9689. category: 'actions',
  9690. fn: function () {
  9691. var self = this;
  9692. var newProtocol = nil;
  9693. newProtocol = self._prompt_("New method protocol");
  9694. newProtocol._notEmpty()._ifTrue_(function () {self['@selectedMethod']._category_(newProtocol);return self._setMethodProtocol_(newProtocol);});
  9695. return self;
  9696. },
  9697. source: unescape('addNewProtocol%0A%20%20%20%20%7C%20newProtocol%20%7C%0A%20%20%20%20newProtocol%20%3A%3D%20self%20prompt%3A%20%27New%20method%20protocol%27.%0A%20%20%20%20newProtocol%20notEmpty%20ifTrue%3A%20%5B%0A%09selectedMethod%20category%3A%20newProtocol.%0A%09self%20setMethodProtocol%3A%20newProtocol%5D%0A')}),
  9698. smalltalk.Browser);
  9699. smalltalk.addMethod(
  9700. '_selectCategory_',
  9701. smalltalk.method({
  9702. selector: 'selectCategory:',
  9703. category: 'actions',
  9704. fn: function (aCategory) {
  9705. var self = this;
  9706. self._cancelChanges()._ifTrue_(function () {self['@selectedCategory'] = aCategory;self['@selectedClass'] = self['@selectedProtocol'] = self['@selectedMethod'] = nil;return function ($rec) {$rec._updateCategoriesList();$rec._updateClassesList();$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();}(self);});
  9707. return self;
  9708. },
  9709. source: unescape('selectCategory%3A%20aCategory%0A%20%20%20%20self%20cancelChanges%20ifTrue%3A%20%5B%0A%09selectedCategory%20%3A%3D%20aCategory.%0A%09selectedClass%20%3A%3D%20selectedProtocol%20%3A%3D%20selectedMethod%20%3A%3D%20%20nil.%0A%09self%20%0A%09%20%20%20%20updateCategoriesList%3B%0A%09%20%20%20%20updateClassesList%3B%0A%09%20%20%20%20updateProtocolsList%3B%0A%09%20%20%20%20updateMethodsList%3B%0A%09%20%20%20%20updateSourceAndButtons%5D%0A')}),
  9710. smalltalk.Browser);
  9711. smalltalk.addMethod(
  9712. '_selectClass_',
  9713. smalltalk.method({
  9714. selector: 'selectClass:',
  9715. category: 'actions',
  9716. fn: function (aClass) {
  9717. var self = this;
  9718. self._cancelChanges()._ifTrue_(function () {self['@selectedClass'] = aClass;self['@selectedProtocol'] = self['@selectedMethod'] = nil;return function ($rec) {$rec._updateClassesList();$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();}(self);});
  9719. return self;
  9720. },
  9721. source: unescape('selectClass%3A%20aClass%0A%20%20%20%20self%20cancelChanges%20ifTrue%3A%20%5B%0A%09selectedClass%20%3A%3D%20aClass.%0A%09selectedProtocol%20%3A%3D%20selectedMethod%20%3A%3D%20nil.%0A%09self%20%0A%09%20%20%20%20updateClassesList%3B%0A%09%20%20%20%20updateProtocolsList%3B%0A%09%20%20%20%20updateMethodsList%3B%0A%09%20%20%20%20updateSourceAndButtons%5D%0A')}),
  9722. smalltalk.Browser);
  9723. smalltalk.addMethod(
  9724. '_selectProtocol_',
  9725. smalltalk.method({
  9726. selector: 'selectProtocol:',
  9727. category: 'actions',
  9728. fn: function (aString) {
  9729. var self = this;
  9730. self._cancelChanges()._ifTrue_(function () {self['@selectedProtocol'] = aString;self['@selectedMethod'] = nil;return function ($rec) {$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();}(self);});
  9731. return self;
  9732. },
  9733. source: unescape('selectProtocol%3A%20aString%0A%20%20%20%20self%20cancelChanges%20ifTrue%3A%20%5B%0A%09selectedProtocol%20%3A%3D%20aString.%0A%09selectedMethod%20%3A%3D%20nil.%0A%09self%20%0A%09%20%20%20%20updateProtocolsList%3B%0A%09%20%20%20%20updateMethodsList%3B%0A%09%20%20%20%20updateSourceAndButtons%5D%0A')}),
  9734. smalltalk.Browser);
  9735. smalltalk.addMethod(
  9736. '_selectMethod_',
  9737. smalltalk.method({
  9738. selector: 'selectMethod:',
  9739. category: 'actions',
  9740. fn: function (aMethod) {
  9741. var self = this;
  9742. self._cancelChanges()._ifTrue_(function () {self['@selectedMethod'] = aMethod;return function ($rec) {$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();}(self);});
  9743. return self;
  9744. },
  9745. source: unescape('selectMethod%3A%20aMethod%0A%20%20%20%20self%20cancelChanges%20ifTrue%3A%20%5B%0A%09selectedMethod%20%3A%3D%20aMethod.%0A%09self%20%0A%09%20%20%20%20updateProtocolsList%3B%0A%09%20%20%20%20updateMethodsList%3B%0A%09%20%20%20%20updateSourceAndButtons%5D%0A')}),
  9746. smalltalk.Browser);
  9747. smalltalk.addMethod(
  9748. '_selectTab_',
  9749. smalltalk.method({
  9750. selector: 'selectTab:',
  9751. category: 'actions',
  9752. fn: function (aString) {
  9753. var self = this;
  9754. self._cancelChanges()._ifTrue_(function () {self['@selectedTab'] = aString;self._selectProtocol_(nil);return self._updateTabsList();});
  9755. return self;
  9756. },
  9757. source: unescape('selectTab%3A%20aString%0A%20%20%20%20self%20cancelChanges%20ifTrue%3A%20%5B%0A%09selectedTab%20%3A%3D%20aString.%0A%09self%20selectProtocol%3A%20nil.%0A%09self%20updateTabsList%5D%0A')}),
  9758. smalltalk.Browser);
  9759. smalltalk.addMethod(
  9760. '_renderBoxOn_',
  9761. smalltalk.method({
  9762. selector: 'renderBoxOn:',
  9763. category: 'rendering',
  9764. fn: function (html) {
  9765. var self = this;
  9766. (function ($rec) {$rec._renderTopPanelOn_(html);$rec._renderTabsOn_(html);return $rec._renderBottomPanelOn_(html);}(self));
  9767. return self;
  9768. },
  9769. source: unescape('renderBoxOn%3A%20html%0A%20%20%20%20self%20%0A%09renderTopPanelOn%3A%20html%3B%0A%09renderTabsOn%3A%20html%3B%0A%09renderBottomPanelOn%3A%20html%0A')}),
  9770. smalltalk.Browser);
  9771. smalltalk.addMethod(
  9772. '_renderTopPanelOn_',
  9773. smalltalk.method({
  9774. selector: 'renderTopPanelOn:',
  9775. category: 'rendering',
  9776. fn: function (html) {
  9777. var self = this;
  9778. (function ($rec) {$rec._class_("top");return $rec._with_(function () {self['@categoriesList'] = html._ul()._class_("jt_column categories");self['@commitButton'] = function ($rec) {$rec._class_("jt_commit");$rec._title_("Commit classes in this category to disk");$rec._onClick_(function () {return self._commitCategory();});return $rec._with_("Commit category");}(html._button());self['@classesList'] = html._ul()._class_("jt_column classes");self['@protocolsList'] = html._ul()._class_("jt_column protocols");self['@methodsList'] = html._ul()._class_("jt_column methods");(function ($rec) {$rec._updateCategoriesList();$rec._updateClassesList();$rec._updateProtocolsList();return $rec._updateMethodsList();}(self));return html._div()._class_("jt_clear");});}(html._div()));
  9779. return self;
  9780. },
  9781. source: unescape('renderTopPanelOn%3A%20html%0A%20%20%20%20html%20div%20%0A%09class%3A%20%27top%27%3B%20%0A%09with%3A%20%5B%0A%09%20%20%20%20categoriesList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20categories%27.%0A%09%20%20%20%20commitButton%20%3A%3D%20html%20button%20%0A%09%09class%3A%20%27jt_commit%27%3B%0A%09%09title%3A%20%27Commit%20classes%20in%20this%20category%20to%20disk%27%3B%0A%09%09onClick%3A%20%5Bself%20commitCategory%5D%3B%0A%09%09with%3A%20%27Commit%20category%27.%0A%09%20%20%20%20classesList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20classes%27.%0A%09%20%20%20%20protocolsList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20protocols%27.%0A%09%20%20%20%20methodsList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20methods%27.%0A%09%20%20%20%20self%0A%09%09updateCategoriesList%3B%0A%09%09updateClassesList%3B%0A%09%09updateProtocolsList%3B%0A%09%09updateMethodsList.%0A%09%20%20%20%20html%20div%20class%3A%20%27jt_clear%27%5D%0A')}),
  9782. smalltalk.Browser);
  9783. smalltalk.addMethod(
  9784. '_renderTabsOn_',
  9785. smalltalk.method({
  9786. selector: 'renderTabsOn:',
  9787. category: 'rendering',
  9788. fn: function (html) {
  9789. var self = this;
  9790. self['@tabsList'] = html._ul()._class_("jt_tabs");
  9791. self._updateTabsList();
  9792. return self;
  9793. },
  9794. source: unescape('renderTabsOn%3A%20html%0A%20%20%20%20tabsList%20%3A%3D%20html%20ul%20class%3A%20%27jt_tabs%27.%0A%20%20%20%20self%20updateTabsList.%0A')}),
  9795. smalltalk.Browser);
  9796. smalltalk.addMethod(
  9797. '_renderBottomPanelOn_',
  9798. smalltalk.method({
  9799. selector: 'renderBottomPanelOn:',
  9800. category: 'rendering',
  9801. fn: function (html) {
  9802. var self = this;
  9803. (function ($rec) {$rec._class_("jt_sourceCode");return $rec._with_(function () {self['@sourceTextarea'] = function ($rec) {$rec._onKeyPress_(function () {return self._enableSaveButton();});$rec._class_("source");return $rec._at_put_("spellcheck", "false");}(html._textarea());return self['@sourceTextarea']._asJQuery()._call_("tabby");});}(html._div()));
  9804. return self;
  9805. },
  9806. source: unescape('renderBottomPanelOn%3A%20html%0A%20%20%20%20html%20div%0A%09class%3A%20%27jt_sourceCode%27%3B%0A%09with%3A%20%5B%0A%09%20%20%20%20sourceTextarea%20%3A%3D%20html%20textarea%20%0A%09%09onKeyPress%3A%20%5Bself%20enableSaveButton%5D%3B%0A%09%09class%3A%20%27source%27%3B%0A%09%09at%3A%20%27spellcheck%27%20put%3A%20%27false%27.%0A%09%20%20%20%20sourceTextarea%20asJQuery%20call%3A%20%27tabby%27%5D%0A')}),
  9807. smalltalk.Browser);
  9808. smalltalk.addMethod(
  9809. '_renderButtonsOn_',
  9810. smalltalk.method({
  9811. selector: 'renderButtonsOn:',
  9812. category: 'rendering',
  9813. fn: function (html) {
  9814. var self = this;
  9815. self['@saveButton'] = html._button();
  9816. (function ($rec) {$rec._with_("Save");return $rec._onClick_(function () {return self._compile();});}(self['@saveButton']));
  9817. self['@methodButtons'] = html._span();
  9818. self['@classButtons'] = html._span();
  9819. self._updateSourceAndButtons();
  9820. return self;
  9821. },
  9822. source: unescape('renderButtonsOn%3A%20html%0A%20%20%20%20saveButton%20%3A%3D%20html%20button.%0A%20%20%20%20saveButton%20%0A%09with%3A%20%27Save%27%3B%0A%09onClick%3A%20%5Bself%20compile%5D.%0A%20%20%20%20methodButtons%20%3A%3D%20html%20span.%0A%20%20%20%20classButtons%20%3A%3D%20html%20span.%0A%20%20%20%20self%20updateSourceAndButtons%0A')}),
  9823. smalltalk.Browser);
  9824. smalltalk.addMethod(
  9825. '_updateCategoriesList',
  9826. smalltalk.method({
  9827. selector: 'updateCategoriesList',
  9828. category: 'updating',
  9829. fn: function () {
  9830. var self = this;
  9831. self['@categoriesList']._contents_(function (html) {return self._categories()._do_(function (each) {var li = nil;li = html._li();self['@selectedCategory'].__eq(each)._ifTrue_(function () {return li._class_("selected");});return function ($rec) {$rec._with_(each);return $rec._onClick_(function () {return self._selectCategory_(each);});}(li);});});
  9832. return self;
  9833. },
  9834. source: unescape('updateCategoriesList%0A%20%20%20%20categoriesList%20contents%3A%20%5B%3Ahtml%20%7C%0A%09self%20categories%20do%3A%20%5B%3Aeach%20%7C%7C%20li%20%7C%0A%09%20%20%20%20li%20%3A%3D%20html%20li.%0A%09%20%20%20%20selectedCategory%20%3D%20each%20ifTrue%3A%20%5B%0A%09%09li%20class%3A%20%27selected%27%5D.%0A%09%20%20%20%20li%0A%09%09with%3A%20each%3B%0A%09%09onClick%3A%20%5Bself%20selectCategory%3A%20each%5D%5D%5D%0A')}),
  9835. smalltalk.Browser);
  9836. smalltalk.addMethod(
  9837. '_updateClassesList',
  9838. smalltalk.method({
  9839. selector: 'updateClassesList',
  9840. category: 'updating',
  9841. fn: function () {
  9842. var self = this;
  9843. smalltalk.TabManager._current()._update();
  9844. self['@classesList']._contents_(function (html) {return self._classes()._do_(function (each) {var li = nil;li = html._li();self['@selectedClass'].__eq(each)._ifTrue_(function () {return li._class_("selected");});return function ($rec) {$rec._with_(each._name());return $rec._onClick_(function () {return self._selectClass_(each);});}(li);});});
  9845. return self;
  9846. },
  9847. source: unescape('updateClassesList%0A%20%20%20%20TabManager%20current%20update.%0A%20%20%20%20classesList%20contents%3A%20%5B%3Ahtml%20%7C%0A%09self%20classes%20do%3A%20%5B%3Aeach%20%7C%7C%20li%20%7C%0A%09%20%20%20%20li%20%3A%3D%20html%20li.%0A%09%20%20%20%20selectedClass%20%3D%20each%20ifTrue%3A%20%5B%0A%09%09li%20class%3A%20%27selected%27%5D.%0A%09%20%20%20%20li%0A%09%09with%3A%20each%20name%3B%0A%09%09onClick%3A%20%5Bself%20selectClass%3A%20each%5D%5D%5D%0A')}),
  9848. smalltalk.Browser);
  9849. smalltalk.addMethod(
  9850. '_updateProtocolsList',
  9851. smalltalk.method({
  9852. selector: 'updateProtocolsList',
  9853. category: 'updating',
  9854. fn: function () {
  9855. var self = this;
  9856. self['@protocolsList']._contents_(function (html) {return self._protocols()._do_(function (each) {var li = nil;li = html._li();self['@selectedProtocol'].__eq(each)._ifTrue_(function () {return li._class_("selected");});return function ($rec) {$rec._with_(each);return $rec._onClick_(function () {return self._selectProtocol_(each);});}(li);});});
  9857. return self;
  9858. },
  9859. source: unescape('updateProtocolsList%0A%20%20%20%20protocolsList%20contents%3A%20%5B%3Ahtml%20%7C%0A%09self%20protocols%20do%3A%20%5B%3Aeach%20%7C%7C%20li%20%7C%0A%09%20%20%20%20li%20%3A%3D%20html%20li.%0A%09%20%20%20%20selectedProtocol%20%3D%20each%20ifTrue%3A%20%5B%0A%09%09li%20class%3A%20%27selected%27%5D.%0A%09%20%20%20%20li%20%0A%09%09with%3A%20each%3B%0A%09%09onClick%3A%20%5Bself%20selectProtocol%3A%20each%5D%5D%5D%0A')}),
  9860. smalltalk.Browser);
  9861. smalltalk.addMethod(
  9862. '_updateMethodsList',
  9863. smalltalk.method({
  9864. selector: 'updateMethodsList',
  9865. category: 'updating',
  9866. fn: function () {
  9867. var self = this;
  9868. self['@methodsList']._contents_(function (html) {return self._methods()._do_(function (each) {var li = nil;li = html._li();self['@selectedMethod'].__eq(each)._ifTrue_(function () {return li._class_("selected");});return function ($rec) {$rec._with_(each._selector());return $rec._onClick_(function () {return self._selectMethod_(each);});}(li);});});
  9869. return self;
  9870. },
  9871. source: unescape('updateMethodsList%0A%20%20%20%20methodsList%20contents%3A%20%5B%3Ahtml%20%7C%0A%09self%20methods%20do%3A%20%5B%3Aeach%20%7C%7C%20li%20%7C%0A%09%20%20%20%20li%20%3A%3D%20html%20li.%0A%09%20%20%20%20selectedMethod%20%3D%20each%20ifTrue%3A%20%5B%0A%09%09li%20class%3A%20%27selected%27%5D.%0A%09%20%20%20%20li%0A%09%09with%3A%20each%20selector%3B%0A%09%09onClick%3A%20%5Bself%20selectMethod%3A%20each%5D%5D%5D%0A')}),
  9872. smalltalk.Browser);
  9873. smalltalk.addMethod(
  9874. '_updateTabsList',
  9875. smalltalk.method({
  9876. selector: 'updateTabsList',
  9877. category: 'updating',
  9878. fn: function () {
  9879. var self = this;
  9880. self['@tabsList']._contents_(function (html) {var li = nil;li = html._li();self['@selectedTab'].__eq("instance")._ifTrue_(function () {return li._class_("selected");});(function ($rec) {$rec._with_("Instance");return $rec._onClick_(function () {return self._selectTab_("instance");});}(li));li = html._li();self['@selectedTab'].__eq("class")._ifTrue_(function () {return li._class_("selected");});(function ($rec) {$rec._with_("Class");return $rec._onClick_(function () {return self._selectTab_("class");});}(li));li = html._li();self['@selectedTab'].__eq("comment")._ifTrue_(function () {return li._class_("selected");});return function ($rec) {$rec._with_("Comment");return $rec._onClick_(function () {return self._selectTab_("comment");});}(li);});
  9881. return self;
  9882. },
  9883. source: unescape('updateTabsList%0A%20%20%20%20tabsList%20contents%3A%20%5B%3Ahtml%20%7C%7C%20li%20%7C%0A%09li%20%3A%3D%20html%20li.%0A%09selectedTab%20%3D%20%23instance%20ifTrue%3A%20%5Bli%20class%3A%20%27selected%27%5D.%0A%09li%0A%09%20%20%20%20with%3A%20%27Instance%27%3B%0A%09%20%20%20%20onClick%3A%20%5Bself%20selectTab%3A%20%23instance%5D.%0A%09li%20%3A%3D%20html%20li.%0A%09selectedTab%20%3D%20%23class%20ifTrue%3A%20%5Bli%20class%3A%20%27selected%27%5D.%0A%09li%0A%09%20%20%20%20with%3A%20%27Class%27%3B%0A%09%20%20%20%20onClick%3A%20%5Bself%20selectTab%3A%20%23class%5D.%0A%09li%20%3A%3D%20html%20li.%0A%09selectedTab%20%3D%20%23comment%20ifTrue%3A%20%5Bli%20class%3A%20%27selected%27%5D.%0A%09li%0A%09%20%20%20%20with%3A%20%27Comment%27%3B%0A%09%20%20%20%20onClick%3A%20%5Bself%20selectTab%3A%20%23comment%5D%5D%0A')}),
  9884. smalltalk.Browser);
  9885. smalltalk.addMethod(
  9886. '_updateSourceAndButtons',
  9887. smalltalk.method({
  9888. selector: 'updateSourceAndButtons',
  9889. category: 'updating',
  9890. fn: function () {
  9891. var self = this;
  9892. self._disableSaveButton();
  9893. self['@classButtons']._contents_(function (html) {(function ($rec) {$rec._with_("Rename class");return $rec._onClick_(function () {return self._renameClass();});}(html._button()));return function ($rec) {$rec._with_("Remove class");return $rec._onClick_(function () {return self._removeClass();});}(html._button());});
  9894. self['@methodButtons']._contents_(function (html) {(function ($rec) {$rec._with_("Remove method");return $rec._onClick_(function () {return self._removeMethod();});}(html._button()));return function ($rec) {$rec._onChange_(function (s) {return self._setMethodProtocol_(s._val());});return $rec._with_(function () {(function ($rec) {$rec._with_("Method protocol");return $rec._at_put_("disabled", "disabled");}(html._option()));(function ($rec) {$rec._class_("important");return $rec._with_("New...");}(html._option()));return self._protocols()._do_(function (each) {return html._option()._with_(each);});});}(html._select());});
  9895. self['@selectedMethod']._ifNil_ifNotNil_(function () {self._hideMethodButtons();return self['@selectedClass']._ifNil_ifNotNil_(function () {return self._hideClassButtons();}, function () {return self._showClassButtons();});}, function () {self._hideClassButtons();return self._showMethodButtons();});
  9896. self['@sourceTextarea']._asJQuery()._val_(self._source());
  9897. return self;
  9898. },
  9899. source: unescape('updateSourceAndButtons%0A%09self%20disableSaveButton.%0A%09classButtons%20contents%3A%20%5B%3Ahtml%20%7C%0A%09%09html%20button%0A%09%09%09with%3A%20%27Rename%20class%27%3B%0A%09%09%09onClick%3A%20%5Bself%20renameClass%5D.%0A%09%09html%20button%0A%09%09with%3A%20%27Remove%20class%27%3B%0A%09%09onClick%3A%20%5Bself%20removeClass%5D%5D.%0A%09methodButtons%20contents%3A%20%5B%3Ahtml%20%7C%0A%09%09html%20button%0A%09%09%09with%3A%20%27Remove%20method%27%3B%0A%09%09%09onClick%3A%20%5Bself%20removeMethod%5D.%0A%09%09html%20select%20%0A%09%20%20%20%20%09%09onChange%3A%20%5B%3As%20%7C%20self%20setMethodProtocol%3A%20s%20val%5D%3B%0A%09%20%20%20%20%09%09with%3A%20%5B%0A%09%09%09%09html%20option%0A%09%09%20%20%20%20%09%09%09with%3A%20%27Method%20protocol%27%3B%0A%09%09%20%20%20%20%09%09%09at%3A%20%27disabled%27%20put%3A%20%27disabled%27.%0A%09%09%09%09html%20option%0A%09%09%20%20%20%20%09%09%09class%3A%20%27important%27%3B%0A%09%09%20%20%20%20%09%09%09with%3A%20%27New...%27.%0A%09%09%09%09self%20protocols%20do%3A%20%5B%3Aeach%20%7C%0A%09%09%20%20%20%20%09%09%09html%20option%20with%3A%20each%5D%5D%5D.%0A%20%20%20%20%09selectedMethod%20%0A%09%09ifNil%3A%20%5B%0A%09%20%20%20%20%09%09self%20hideMethodButtons.%0A%09%20%20%20%20%09%09%09selectedClass%20%0A%09%09%09%09%09ifNil%3A%20%5Bself%20hideClassButtons%5D%0A%09%20%20%20%20%09%09%09%09ifNotNil%3A%20%5Bself%20showClassButtons%5D%5D%0A%09%09ifNotNil%3A%20%5B%0A%09%20%20%20%20%09%09self%20hideClassButtons.%0A%09%20%20%20%20%09%09self%20showMethodButtons%5D.%0A%20%20%20%20%09sourceTextarea%20asJQuery%20val%3A%20self%20source%0A')}),
  9900. smalltalk.Browser);
  9901. smalltalk.addMethod(
  9902. '_canBeClosed',
  9903. smalltalk.method({
  9904. selector: 'canBeClosed',
  9905. category: 'testing',
  9906. fn: function () {
  9907. var self = this;
  9908. return true;
  9909. return self;
  9910. },
  9911. source: unescape('canBeClosed%0A%20%20%20%20%5Etrue%0A')}),
  9912. smalltalk.Browser);
  9913. smalltalk.addMethod(
  9914. '_renameClass',
  9915. smalltalk.method({
  9916. selector: 'renameClass',
  9917. category: 'actions',
  9918. fn: function () {
  9919. var self = this;
  9920. var newName = nil;
  9921. newName = self._prompt_("Rename class ".__comma(self['@selectedClass']._name()));
  9922. newName._notEmpty()._ifTrue_(function () {self['@selectedClass']._rename_(newName);return function ($rec) {$rec._updateClassesList();return $rec._updateSourceAndButtons();}(self);});
  9923. return self;
  9924. },
  9925. source: unescape('renameClass%0A%20%20%20%20%7C%20newName%20%7C%0A%20%20%20%20newName%20%3A%3D%20self%20prompt%3A%20%27Rename%20class%20%27%2C%20selectedClass%20name.%0A%20%20%20%20newName%20notEmpty%20ifTrue%3A%20%5B%0A%09selectedClass%20rename%3A%20newName.%0A%09self%20%0A%09%09updateClassesList%3B%0A%09%09updateSourceAndButtons%5D%0A')}),
  9926. smalltalk.Browser);
  9927. smalltalk.addMethod(
  9928. '_openOn_',
  9929. smalltalk.method({
  9930. selector: 'openOn:',
  9931. category: 'convenience',
  9932. fn: function (aClass) {
  9933. var self = this;
  9934. (function ($rec) {$rec._open();$rec._selectCategory_(aClass._category());return $rec._selectClass_(aClass);}(self._new()));
  9935. return self;
  9936. },
  9937. source: unescape('openOn%3A%20aClass%0A%20%20%20%20self%20new%0A%09open%3B%0A%09selectCategory%3A%20aClass%20category%3B%0A%09selectClass%3A%20aClass%0A')}),
  9938. smalltalk.Browser.klass);
  9939. smalltalk.addMethod(
  9940. '_open',
  9941. smalltalk.method({
  9942. selector: 'open',
  9943. category: 'convenience',
  9944. fn: function () {
  9945. var self = this;
  9946. self._new()._open();
  9947. return self;
  9948. },
  9949. source: unescape('open%0A%20%20%20%20self%20new%20open%0A')}),
  9950. smalltalk.Browser.klass);
  9951. smalltalk.addMethod(
  9952. '_commitPath',
  9953. smalltalk.method({
  9954. selector: 'commitPath',
  9955. category: 'accessing',
  9956. fn: function () {
  9957. var self = this;
  9958. return "js";
  9959. return self;
  9960. },
  9961. source: unescape('commitPath%0A%09%5E%27js%27')}),
  9962. smalltalk.Browser.klass);
  9963. smalltalk.addClass('Inspector', smalltalk.TabWidget, ['label', 'variables', 'selectedVariable', 'variablesList', 'valueTextarea', 'workspaceTextarea'], 'IDE');
  9964. smalltalk.addMethod(
  9965. '_label',
  9966. smalltalk.method({
  9967. selector: 'label',
  9968. category: 'accessing',
  9969. fn: function () {
  9970. var self = this;
  9971. return self['@label']._ifNil_(function () {return unescape("Inspector%20%28nil%29");});
  9972. return self;
  9973. },
  9974. source: unescape('label%0A%09%5Elabel%20ifNil%3A%20%5B%27Inspector%20%28nil%29%27%5D')}),
  9975. smalltalk.Inspector);
  9976. smalltalk.addMethod(
  9977. '_canBeClosed',
  9978. smalltalk.method({
  9979. selector: 'canBeClosed',
  9980. category: 'testing',
  9981. fn: function () {
  9982. var self = this;
  9983. return true;
  9984. return self;
  9985. },
  9986. source: unescape('canBeClosed%0A%09%5Etrue')}),
  9987. smalltalk.Inspector);
  9988. smalltalk.addMethod(
  9989. '_inspect_',
  9990. smalltalk.method({
  9991. selector: 'inspect:',
  9992. category: 'accessing',
  9993. fn: function (anObject) {
  9994. var self = this;
  9995. anObject._inspectOn_(self);
  9996. return self;
  9997. },
  9998. source: unescape('inspect%3A%20anObject%0A%09anObject%20inspectOn%3A%20self')}),
  9999. smalltalk.Inspector);
  10000. smalltalk.addMethod(
  10001. '_initialize',
  10002. smalltalk.method({
  10003. selector: 'initialize',
  10004. category: 'initialization',
  10005. fn: function () {
  10006. var self = this;
  10007. self.klass.superclass.fn.prototype._initialize.apply(self, []);
  10008. self['@variables'] = [];
  10009. return self;
  10010. },
  10011. source: unescape('initialize%0A%09super%20initialize.%0A%09variables%20%3A%3D%20%23%28%29')}),
  10012. smalltalk.Inspector);
  10013. smalltalk.addMethod(
  10014. '_variables',
  10015. smalltalk.method({
  10016. selector: 'variables',
  10017. category: 'accessing',
  10018. fn: function () {
  10019. var self = this;
  10020. return self['@variables'];
  10021. return self;
  10022. },
  10023. source: unescape('variables%0A%09%5Evariables')}),
  10024. smalltalk.Inspector);
  10025. smalltalk.addMethod(
  10026. '_setVariables_',
  10027. smalltalk.method({
  10028. selector: 'setVariables:',
  10029. category: 'accessing',
  10030. fn: function (aCollection) {
  10031. var self = this;
  10032. self['@variables'] = aCollection;
  10033. return self;
  10034. },
  10035. source: unescape('setVariables%3A%20aCollection%0A%09variables%20%3A%3D%20aCollection')}),
  10036. smalltalk.Inspector);
  10037. smalltalk.addMethod(
  10038. '_setLabel_',
  10039. smalltalk.method({
  10040. selector: 'setLabel:',
  10041. category: 'accessing',
  10042. fn: function (aString) {
  10043. var self = this;
  10044. self['@label'] = aString;
  10045. return self;
  10046. },
  10047. source: unescape('setLabel%3A%20aString%0A%09label%20%3A%3D%20aString')}),
  10048. smalltalk.Inspector);
  10049. smalltalk.addMethod(
  10050. '_renderBoxOn_',
  10051. smalltalk.method({
  10052. selector: 'renderBoxOn:',
  10053. category: 'rendering',
  10054. fn: function (html) {
  10055. var self = this;
  10056. (function ($rec) {$rec._renderTopPanelOn_(html);return $rec._renderBottomPanelOn_(html);}(self));
  10057. return self;
  10058. },
  10059. source: unescape('renderBoxOn%3A%20html%0A%09self%20%0A%09%09renderTopPanelOn%3A%20html%3B%0A%09%09renderBottomPanelOn%3A%20html')}),
  10060. smalltalk.Inspector);
  10061. smalltalk.addMethod(
  10062. '_renderTopPanelOn_',
  10063. smalltalk.method({
  10064. selector: 'renderTopPanelOn:',
  10065. category: 'rendering',
  10066. fn: function (html) {
  10067. var self = this;
  10068. (function ($rec) {$rec._class_("top");return $rec._with_(function () {self['@variablesList'] = html._ul()._class_("jt_column variables");self['@valueTextarea'] = function ($rec) {$rec._class_("jt_column value");return $rec._at_put_("readonly", "readonly");}(html._textarea());(function ($rec) {$rec._updateVariablesList();return $rec._updateValueTextarea();}(self));return html._div()._class_("jt_clear");});}(html._div()));
  10069. return self;
  10070. },
  10071. source: unescape('renderTopPanelOn%3A%20html%0A%20%20%20%20html%20div%20%0A%09class%3A%20%27top%27%3B%20%0A%09with%3A%20%5B%0A%09%20%20%20%20variablesList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20variables%27.%0A%09%20%20%20%20valueTextarea%20%3A%3D%20html%20textarea%20class%3A%20%27jt_column%20value%27%3B%20at%3A%20%27readonly%27%20put%3A%20%27readonly%27.%0A%09%20%20%20%20self%0A%09%09updateVariablesList%3B%0A%09%09updateValueTextarea.%0A%09%20%20%20%20html%20div%20class%3A%20%27jt_clear%27%5D%0A')}),
  10072. smalltalk.Inspector);
  10073. smalltalk.addMethod(
  10074. '_renderBottomPanelOn_',
  10075. smalltalk.method({
  10076. selector: 'renderBottomPanelOn:',
  10077. category: 'rendering',
  10078. fn: function (html) {
  10079. var self = this;
  10080. (function ($rec) {$rec._class_("jt_sourceCode");return $rec._with_(function () {self['@workspaceTextarea'] = function ($rec) {$rec._class_("source");return $rec._at_put_("spellcheck", "false");}(html._textarea());return self['@workspaceTextarea']._asJQuery()._call_("tabby");});}(html._div()));
  10081. return self;
  10082. },
  10083. source: unescape('renderBottomPanelOn%3A%20html%0A%20%20%20%20html%20div%0A%09class%3A%20%27jt_sourceCode%27%3B%0A%09with%3A%20%5B%0A%09%20%20%20%20workspaceTextarea%20%3A%3D%20html%20textarea%20%0A%09%09class%3A%20%27source%27%3B%0A%09%09at%3A%20%27spellcheck%27%20put%3A%20%27false%27.%0A%09%20%20%20%20workspaceTextarea%20asJQuery%20call%3A%20%27tabby%27%5D%0A')}),
  10084. smalltalk.Inspector);
  10085. smalltalk.addMethod(
  10086. '_updateVariablesList',
  10087. smalltalk.method({
  10088. selector: 'updateVariablesList',
  10089. category: 'updating',
  10090. fn: function () {
  10091. var self = this;
  10092. self['@variablesList']._contents_(function (html) {return self._variables()._keys()._do_(function (each) {var li = nil;li = html._li();(function ($rec) {$rec._with_(each);return $rec._onClick_(function () {return self._selectVariable_(each);});}(li));return self._selectedVariable().__eq(each)._ifTrue_(function () {return li._class_("selected");});});});
  10093. return self;
  10094. },
  10095. source: unescape('updateVariablesList%0A%09variablesList%20contents%3A%20%5B%3Ahtml%20%7C%0A%09%09self%20variables%20keys%20do%3A%20%5B%3Aeach%20%7C%7C%20li%20%7C%0A%09%09%09li%20%3A%3D%20html%20li.%0A%09%09%09li%0A%09%09%09%09with%3A%20each%3B%0A%09%09%09%09onClick%3A%20%5Bself%20selectVariable%3A%20each%5D.%0A%09%09%09self%20selectedVariable%20%3D%20each%20ifTrue%3A%20%5B%0A%09%09%09%09li%20class%3A%20%27selected%27%5D%5D%5D')}),
  10096. smalltalk.Inspector);
  10097. smalltalk.addMethod(
  10098. '_selectedVariable',
  10099. smalltalk.method({
  10100. selector: 'selectedVariable',
  10101. category: 'accessing',
  10102. fn: function () {
  10103. var self = this;
  10104. return self['@selectedVariable'];
  10105. return self;
  10106. },
  10107. source: unescape('selectedVariable%0A%09%5EselectedVariable')}),
  10108. smalltalk.Inspector);
  10109. smalltalk.addMethod(
  10110. '_selectedVariable_',
  10111. smalltalk.method({
  10112. selector: 'selectedVariable:',
  10113. category: 'accessing',
  10114. fn: function (aString) {
  10115. var self = this;
  10116. self['@selectedVariable'] = aString;
  10117. return self;
  10118. },
  10119. source: unescape('selectedVariable%3A%20aString%0A%09selectedVariable%20%3A%3D%20aString')}),
  10120. smalltalk.Inspector);
  10121. smalltalk.addMethod(
  10122. '_selectVariable_',
  10123. smalltalk.method({
  10124. selector: 'selectVariable:',
  10125. category: 'updating',
  10126. fn: function (aString) {
  10127. var self = this;
  10128. self._selectedVariable_(aString);
  10129. (function ($rec) {$rec._updateVariablesList();return $rec._updateValueTextarea();}(self));
  10130. return self;
  10131. },
  10132. source: unescape('selectVariable%3A%20aString%0A%09self%20selectedVariable%3A%20aString.%0A%09self%20%0A%09%09updateVariablesList%3B%0A%09%09updateValueTextarea')}),
  10133. smalltalk.Inspector);
  10134. smalltalk.addMethod(
  10135. '_updateValueTextarea',
  10136. smalltalk.method({
  10137. selector: 'updateValueTextarea',
  10138. category: 'updating',
  10139. fn: function () {
  10140. var self = this;
  10141. self['@valueTextarea']._asJQuery()._val_(self._selectedVariable()._isNil()._ifTrue_ifFalse_(function () {return "";}, function () {return self._variables()._at_(self._selectedVariable())._printString();}));
  10142. return self;
  10143. },
  10144. source: unescape('updateValueTextarea%0A%09valueTextarea%20asJQuery%20val%3A%20%28self%20selectedVariable%20isNil%0A%09%09ifTrue%3A%20%5B%27%27%5D%0A%09%09ifFalse%3A%20%5B%28self%20variables%20at%3A%20self%20selectedVariable%29%20printString%5D%29')}),
  10145. smalltalk.Inspector);
  10146. smalltalk.addMethod(
  10147. '_on_',
  10148. smalltalk.method({
  10149. selector: 'on:',
  10150. category: 'instance creation',
  10151. fn: function (anObject) {
  10152. var self = this;
  10153. return function ($rec) {$rec._inspect_(anObject);return $rec._yourself();}(self._new());
  10154. return self;
  10155. },
  10156. source: unescape('on%3A%20anObject%0A%09%5Eself%20new%0A%09%09inspect%3A%20anObject%3B%0A%09%09yourself')}),
  10157. smalltalk.Inspector.klass);
  10158. smalltalk.init(smalltalk.Object);