jtalk.js 479 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023
  1. /* ====================================================================
  2. |
  3. | Jtalk Smalltalk
  4. | http://jtalk-project.org
  5. |
  6. ======================================================================
  7. ======================================================================
  8. |
  9. | Copyright (c) 2010-2011
  10. | Nicolas Petton <petton.nicolas@gmail.com>
  11. |
  12. | Jtalk is released under the MIT license
  13. |
  14. | Permission is hereby granted, free of charge, to any person obtaining
  15. | a copy of this software and associated documentation files (the
  16. | 'Software'), to deal in the Software without restriction, including
  17. | without limitation the rights to use, copy, modify, merge, publish,
  18. | distribute, sublicense, and/or sell copies of the Software, and to
  19. | permit persons to whom the Software is furnished to do so, subject to
  20. | the following conditions:
  21. |
  22. | The above copyright notice and this permission notice shall be
  23. | included in all copies or substantial portions of the Software.
  24. |
  25. | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
  26. | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  27. | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  28. | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  29. | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  30. | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  31. | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  32. |
  33. ==================================================================== */
  34. /* Smalltalk constructors definition */
  35. function Smalltalk(){};
  36. function SmalltalkObject(){};
  37. function SmalltalkBehavior(){};
  38. function SmalltalkClass(){};
  39. function SmalltalkMetaclass(){
  40. this.meta = true;
  41. };
  42. function SmalltalkMethod(){};
  43. function SmalltalkNil(){};
  44. /* Global Smalltalk objects. nil shouldn't be a global. */
  45. var nil = new SmalltalkNil();
  46. var smalltalk = new Smalltalk();
  47. /* Smalltalk class creation. A class is an instance of an automatically
  48. created metaclass object. Newly created classes (not their metaclass)
  49. should be added to the smalltalk object, see smalltalk.addClass().
  50. Superclass linking is *not* handled here, see smalltalk.init() */
  51. smalltalk.klass = function(spec) {
  52. var spec = spec || {};
  53. var that;
  54. if(spec.meta) {
  55. that = new SmalltalkMetaclass();
  56. } else {
  57. that = new (smalltalk.klass({meta: true})).fn;
  58. that.klass.instanceClass = that;
  59. that.className = spec.className;
  60. that.klass.className = that.className + ' class';
  61. }
  62. that.fn = spec.fn || function(){};
  63. that.superclass = spec.superclass;
  64. that.iVarNames = spec.iVarNames || [];
  65. if(that.superclass) {
  66. that.klass.superclass = that.superclass.klass;
  67. }
  68. that.category = spec.category || "";
  69. that.fn.prototype.methods = {};
  70. that.fn.prototype.klass = that;
  71. return that;
  72. };
  73. /* Smalltalk method object. To add a method to a class,
  74. use smalltalk.addMethod() */
  75. smalltalk.method = function(spec) {
  76. var that = new SmalltalkMethod();
  77. that.selector = spec.selector;
  78. that.category = spec.category;
  79. that.source = spec.source;
  80. that.fn = spec.fn;
  81. return that
  82. };
  83. /* Initialize a class in its class hierarchy. Handle both class and
  84. metaclasses. */
  85. smalltalk.init = function(klass) {
  86. var subclasses = smalltalk.subclasses(klass);
  87. for(var i=0;i<klass.iVarNames.length;i++) {
  88. klass.fn.prototype["@"+klass.iVarNames[i]] = nil;
  89. }
  90. if(klass.superclass && klass.superclass !== nil) {
  91. klass.fn.prototype.__proto__ = klass.superclass.fn.prototype;
  92. for(var i=0;i<klass.superclass.iVarNames.length;i++) {
  93. if(!klass["@"+klass.superclass.iVarNames[i]]) {
  94. klass.fn.prototype["@"+klass.superclass.iVarNames[i]] = nil;
  95. }
  96. }
  97. }
  98. for(var i=0;i<subclasses.length;i++) {
  99. smalltalk.init(subclasses[i]);
  100. }
  101. if(klass.klass && !klass.meta) {
  102. smalltalk.init(klass.klass);
  103. }
  104. };
  105. /* Answer all registered Smalltalk classes */
  106. smalltalk.classes = function() {
  107. var classes = [];
  108. for(var i in smalltalk) {
  109. if(i.search(/^[A-Z]/g) != -1) {
  110. classes.push(smalltalk[i]);
  111. }
  112. }
  113. return classes
  114. };
  115. /* Answer the direct subclasses of a given class.
  116. This is computed dynamically */
  117. smalltalk.subclasses = function(klass) {
  118. var subclasses = [];
  119. var classes = smalltalk.classes();
  120. for(var i in classes) {
  121. if(classes[i].fn) {
  122. //Metaclasses
  123. if(classes[i].klass && classes[i].klass.superclass === klass) {
  124. subclasses.push(classes[i].klass);
  125. }
  126. //Classes
  127. if(classes[i].superclass === klass) {
  128. subclasses.push(classes[i]);
  129. }
  130. }
  131. }
  132. return subclasses;
  133. };
  134. /* Create a new class wrapping a JavaScript constructor, and add it to the
  135. global smalltalk object. */
  136. smalltalk.mapClassName = function(className, category, fn, superclass) {
  137. smalltalk[className] = smalltalk.klass({
  138. className: className,
  139. category: category,
  140. superclass: superclass,
  141. fn: fn
  142. });
  143. };
  144. /* Add a class to the smalltalk object, creating a new one if needed. */
  145. smalltalk.addClass = function(className, superclass, iVarNames, category) {
  146. if(smalltalk[className]) {
  147. smalltalk[className].superclass = superclass;
  148. smalltalk[className].iVarNames = iVarNames;
  149. smalltalk[className].category = category || smalltalk[className].category;
  150. } else {
  151. smalltalk[className] = smalltalk.klass({
  152. className: className,
  153. iVarNames: iVarNames,
  154. superclass: superclass
  155. });
  156. smalltalk[className].category = category || '';
  157. }
  158. };
  159. /* Add a method to a class */
  160. smalltalk.addMethod = function(jsSelector, method, klass) {
  161. klass.fn.prototype[jsSelector] = method.fn;
  162. klass.fn.prototype.methods[method.selector] = method;
  163. };
  164. /* Handles Smalltalk message send. Automatically converts undefined to the nil object.
  165. If the receiver does not understand the selector, call its #doesNotUnderstand: method */
  166. smalltalk.send = function(receiver, selector, args) {
  167. if(typeof receiver === "undefined") {
  168. receiver = nil;
  169. }
  170. if(receiver[selector]) {
  171. return receiver[selector].apply(receiver, args);
  172. } else {
  173. return smalltalk.messageNotUnderstood(receiver, selector, args);
  174. }
  175. };
  176. /* handle #dnu:.
  177. Assume that the receiver understands #doesNotUnderstand: */
  178. smalltalk.messageNotUnderstood = function(receiver, selector, args) {
  179. return receiver._doesNotUnderstand_(
  180. smalltalk.Message._new()
  181. ._selector_(smalltalk.convertSelector(selector))
  182. ._arguments_(args)
  183. );
  184. };
  185. /* Convert a string to a valid smalltalk selector.
  186. if you modify the following functions, also change String>>asSelector
  187. accordingly */
  188. smalltalk.convertSelector = function(selector) {
  189. if(selector.match(/__/)) {
  190. return smalltalk.convertBinarySelector(selector);
  191. } else {
  192. return smalltalk.convertKeywordSelector(selector);
  193. }
  194. };
  195. smalltalk.convertKeywordSelector = function(selector) {
  196. return selector.replace(/^_/, '').replace(/_/g, ':');
  197. };
  198. smalltalk.convertBinarySelector = function(selector) {
  199. return selector
  200. .replace(/^_/, '')
  201. .replace(/_plus/, '+')
  202. .replace(/_minus/, '-')
  203. .replace(/_star/, '*')
  204. .replace(/_slash/, '/')
  205. .replace(/_gt/, '>')
  206. .replace(/_lt/, '<')
  207. .replace(/_eq/, '=')
  208. .replace(/_comma/, ',')
  209. .replace(/_at/, '@')
  210. };
  211. /****************************************************************************************/
  212. /* Base classes mapping. If you edit this part, do not forget to set the superclass of the
  213. object metaclass to Class after the definition of Object */
  214. smalltalk.mapClassName("Object", "Kernel", SmalltalkObject);
  215. smalltalk.mapClassName("Smalltalk", "Kernel", Smalltalk, smalltalk.Object);
  216. smalltalk.mapClassName("Behavior", "Kernel", SmalltalkBehavior, smalltalk.Object);
  217. smalltalk.mapClassName("Class", "Kernel", SmalltalkClass, smalltalk.Behavior);
  218. smalltalk.mapClassName("Metaclass", "Kernel", SmalltalkMetaclass, smalltalk.Behavior);
  219. smalltalk.mapClassName("CompiledMethod", "Kernel", SmalltalkMethod, smalltalk.Object);
  220. smalltalk.Object.klass.superclass = smalltalk.Class
  221. smalltalk.mapClassName("Number", "Kernel", Number, smalltalk.Object);
  222. smalltalk.mapClassName("BlockClosure", "Kernel", Function, smalltalk.Object);
  223. smalltalk.mapClassName("Boolean", "Kernel", Boolean, smalltalk.Object);
  224. smalltalk.mapClassName("Date", "Kernel", Date, smalltalk.Object);
  225. smalltalk.mapClassName("UndefinedObject", "Kernel", SmalltalkNil, smalltalk.Object);
  226. smalltalk.mapClassName("Collection", "Kernel", null, smalltalk.Object);
  227. smalltalk.mapClassName("String", "Kernel", String, smalltalk.Collection);
  228. smalltalk.mapClassName("RegularExpression", "Kernel", RegExp, smalltalk.String);
  229. smalltalk.mapClassName("Array", "Kernel", Array, smalltalk.Collection);
  230. if(CanvasRenderingContext2D) {
  231. smalltalk.mapClassName("CanvasRenderingContext", "Canvas", CanvasRenderingContext2D, smalltalk.Object);
  232. }
  233. smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel');
  234. smalltalk.addMethod(
  235. '__eq',
  236. smalltalk.method({
  237. selector: '=',
  238. category: 'comparing',
  239. fn: function (anObject) {
  240. var self = this;
  241. return self == anObject;
  242. return self;
  243. },
  244. source: unescape('%3D%20anObject%0A%09%7B%27return%20self%20%3D%3D%20anObject%27%7D%0A')}),
  245. smalltalk.Object);
  246. smalltalk.addMethod(
  247. '_~_eq',
  248. smalltalk.method({
  249. selector: '~=',
  250. category: 'comparing',
  251. fn: function (anObject) {
  252. var self = this;
  253. return smalltalk.send(smalltalk.send(self, "__eq", [anObject]), "__eq_eq", [false]);
  254. return self;
  255. },
  256. source: unescape('%7E%3D%20anObject%0A%09%5E%28self%20%3D%20anObject%29%20%3D%3D%20false%0A')}),
  257. smalltalk.Object);
  258. smalltalk.addMethod(
  259. '_initialize',
  260. smalltalk.method({
  261. selector: 'initialize',
  262. category: 'initialization',
  263. fn: function () {
  264. var self = this;
  265. return self;
  266. },
  267. source: unescape('initialize%0A')}),
  268. smalltalk.Object);
  269. smalltalk.addMethod(
  270. '_yourself',
  271. smalltalk.method({
  272. selector: 'yourself',
  273. category: 'accessing',
  274. fn: function () {
  275. var self = this;
  276. return self;
  277. return self;
  278. },
  279. source: unescape('yourself%0A%09%5Eself%0A')}),
  280. smalltalk.Object);
  281. smalltalk.addMethod(
  282. '_class',
  283. smalltalk.method({
  284. selector: 'class',
  285. category: 'accessing',
  286. fn: function () {
  287. var self = this;
  288. return self.klass;
  289. return self;
  290. },
  291. source: unescape('class%0A%09%7B%27return%20self.klass%27%7D%0A')}),
  292. smalltalk.Object);
  293. smalltalk.addMethod(
  294. '_size',
  295. smalltalk.method({
  296. selector: 'size',
  297. category: 'accessing',
  298. fn: function () {
  299. var self = this;
  300. smalltalk.send(self, "_error_", ["Object not indexable"]);
  301. return self;
  302. },
  303. source: unescape('size%0A%09self%20error%3A%20%27Object%20not%20indexable%27%0A')}),
  304. smalltalk.Object);
  305. smalltalk.addMethod(
  306. '_copy',
  307. smalltalk.method({
  308. selector: 'copy',
  309. category: 'copying',
  310. fn: function () {
  311. var self = this;
  312. return smalltalk.send(smalltalk.send(self, "_shallowCopy", []), "_postCopy", []);
  313. return self;
  314. },
  315. source: unescape('copy%0A%09%5Eself%20shallowCopy%20postCopy%0A')}),
  316. smalltalk.Object);
  317. smalltalk.addMethod(
  318. '_shallowCopy',
  319. smalltalk.method({
  320. selector: 'shallowCopy',
  321. category: 'copying',
  322. fn: function () {
  323. var self = this;
  324. var copy = self.klass._new();
  325. for (var i in self) {
  326. if (/^@.+/.test(i)) {
  327. copy[i] = self[i];
  328. }
  329. }
  330. return copy;
  331. return self;
  332. },
  333. source: unescape('shallowCopy%0A%09%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')}),
  334. smalltalk.Object);
  335. smalltalk.addMethod(
  336. '_deepCopy',
  337. smalltalk.method({
  338. selector: 'deepCopy',
  339. category: 'copying',
  340. fn: function () {
  341. var self = this;
  342. var copy = self.klass._new();
  343. for (var i in self) {
  344. if (/^@.+/.test(i)) {
  345. copy[i] = self[i]._deepCopy();
  346. }
  347. }
  348. return copy;
  349. return self;
  350. },
  351. 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')}),
  352. smalltalk.Object);
  353. smalltalk.addMethod(
  354. '_postCopy',
  355. smalltalk.method({
  356. selector: 'postCopy',
  357. category: 'copying',
  358. fn: function () {
  359. var self = this;
  360. return self;
  361. },
  362. source: unescape('postCopy%0A')}),
  363. smalltalk.Object);
  364. smalltalk.addMethod(
  365. '__minus_gt',
  366. smalltalk.method({
  367. selector: '->',
  368. category: 'converting',
  369. fn: function (anObject) {
  370. var self = this;
  371. return smalltalk.send(smalltalk.Association, "_key_value_", [self, anObject]);
  372. return self;
  373. },
  374. source: unescape('-%3E%20anObject%0A%09%5EAssociation%20key%3A%20self%20value%3A%20anObject%0A')}),
  375. smalltalk.Object);
  376. smalltalk.addMethod(
  377. '_asString',
  378. smalltalk.method({
  379. selector: 'asString',
  380. category: 'converting',
  381. fn: function () {
  382. var self = this;
  383. return smalltalk.send(self, "_printString", []);
  384. return self;
  385. },
  386. source: unescape('asString%0A%09%5Eself%20printString%0A')}),
  387. smalltalk.Object);
  388. smalltalk.addMethod(
  389. '_asJavascript',
  390. smalltalk.method({
  391. selector: 'asJavascript',
  392. category: 'converting',
  393. fn: function () {
  394. var self = this;
  395. return smalltalk.send(self, "_asString", []);
  396. return self;
  397. },
  398. source: unescape('asJavascript%0A%09%5Eself%20asString%0A')}),
  399. smalltalk.Object);
  400. smalltalk.addMethod(
  401. '_perform_',
  402. smalltalk.method({
  403. selector: 'perform:',
  404. category: 'message handling',
  405. fn: function (aSymbol) {
  406. var self = this;
  407. return smalltalk.send(self, "_perform_withArguments_", [aSymbol, []]);
  408. return self;
  409. },
  410. source: unescape('perform%3A%20aSymbol%0A%09%5Eself%20perform%3A%20aSymbol%20withArguments%3A%20%23%28%29%0A')}),
  411. smalltalk.Object);
  412. smalltalk.addMethod(
  413. '_perform_withArguments_',
  414. smalltalk.method({
  415. selector: 'perform:withArguments:',
  416. category: 'message handling',
  417. fn: function (aSymbol, aCollection) {
  418. var self = this;
  419. return smalltalk.send(self, "_basicPerform_withArguments_", [smalltalk.send(aSymbol, "_asSelector", []), aCollection]);
  420. return self;
  421. },
  422. source: unescape('perform%3A%20aSymbol%20withArguments%3A%20aCollection%0A%09%5Eself%20basicPerform%3A%20aSymbol%20asSelector%20withArguments%3A%20aCollection%0A')}),
  423. smalltalk.Object);
  424. smalltalk.addMethod(
  425. '_instVarAt_',
  426. smalltalk.method({
  427. selector: 'instVarAt:',
  428. category: 'accessing',
  429. fn: function (aString) {
  430. var self = this;
  431. var value = self["@" + aString];
  432. if (typeof value == "undefined") {
  433. return nil;
  434. } else {
  435. return value;
  436. }
  437. return self;
  438. },
  439. source: unescape('instVarAt%3A%20aString%0A%09%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')}),
  440. smalltalk.Object);
  441. smalltalk.addMethod(
  442. '_instVarAt_put_',
  443. smalltalk.method({
  444. selector: 'instVarAt:put:',
  445. category: 'accessing',
  446. fn: function (aString, anObject) {
  447. var self = this;
  448. self["@" + aString] = anObject;
  449. return self;
  450. },
  451. source: unescape('instVarAt%3A%20aString%20put%3A%20anObject%0A%09%7B%27self%5B%27%27@%27%27%20+%20aString%5D%20%3D%20anObject%27%7D%0A')}),
  452. smalltalk.Object);
  453. smalltalk.addMethod(
  454. '_basicAt_',
  455. smalltalk.method({
  456. selector: 'basicAt:',
  457. category: 'accessing',
  458. fn: function (aString) {
  459. var self = this;
  460. var value = self[aString];
  461. if (typeof value == "undefined") {
  462. return nil;
  463. } else {
  464. return value;
  465. }
  466. return self;
  467. },
  468. source: unescape('basicAt%3A%20aString%0A%09%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')}),
  469. smalltalk.Object);
  470. smalltalk.addMethod(
  471. '_basicAt_put_',
  472. smalltalk.method({
  473. selector: 'basicAt:put:',
  474. category: 'accessing',
  475. fn: function (aString, anObject) {
  476. var self = this;
  477. return self[aString] = anObject;
  478. return self;
  479. },
  480. source: unescape('basicAt%3A%20aString%20put%3A%20anObject%0A%09%7B%27return%20self%5BaString%5D%20%3D%20anObject%27%7D%0A')}),
  481. smalltalk.Object);
  482. smalltalk.addMethod(
  483. '_error_',
  484. smalltalk.method({
  485. selector: 'error:',
  486. category: 'error handling',
  487. fn: function (aString) {
  488. var self = this;
  489. smalltalk.send(smalltalk.Error, "_signal_", [aString]);
  490. return self;
  491. },
  492. source: unescape('error%3A%20aString%0A%09Error%20signal%3A%20aString%0A')}),
  493. smalltalk.Object);
  494. smalltalk.addMethod(
  495. '_subclassResponsibility',
  496. smalltalk.method({
  497. selector: 'subclassResponsibility',
  498. category: 'error handling',
  499. fn: function () {
  500. var self = this;
  501. smalltalk.send(self, "_error_", ["This method is a responsibility of a subclass"]);
  502. return self;
  503. },
  504. source: unescape('subclassResponsibility%0A%09self%20error%3A%20%27This%20method%20is%20a%20responsibility%20of%20a%20subclass%27%0A')}),
  505. smalltalk.Object);
  506. smalltalk.addMethod(
  507. '_shouldNotImplement',
  508. smalltalk.method({
  509. selector: 'shouldNotImplement',
  510. category: 'error handling',
  511. fn: function () {
  512. var self = this;
  513. smalltalk.send(self, "_error_", [smalltalk.send("This method should not be implemented in ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])])]);
  514. return self;
  515. },
  516. source: unescape('shouldNotImplement%0A%09self%20error%3A%20%27This%20method%20should%20not%20be%20implemented%20in%20%27%2C%20self%20class%20name%0A')}),
  517. smalltalk.Object);
  518. smalltalk.addMethod(
  519. '_try_catch_',
  520. smalltalk.method({
  521. selector: 'try:catch:',
  522. category: 'error handling',
  523. fn: function (aBlock, anotherBlock) {
  524. var self = this;
  525. try {
  526. aBlock();
  527. } catch (e) {
  528. anotherBlock(e);
  529. }
  530. return self;
  531. },
  532. 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')}),
  533. smalltalk.Object);
  534. smalltalk.addMethod(
  535. '_printString',
  536. smalltalk.method({
  537. selector: 'printString',
  538. category: 'printing',
  539. fn: function () {
  540. var self = this;
  541. return smalltalk.send("a ", "__comma", [smalltalk.send(smalltalk.send(self, "_class", []), "_name", [])]);
  542. return self;
  543. },
  544. source: unescape('printString%0A%09%5E%27a%20%27%2C%20self%20class%20name%0A')}),
  545. smalltalk.Object);
  546. smalltalk.addMethod(
  547. '_printNl',
  548. smalltalk.method({
  549. selector: 'printNl',
  550. category: 'printing',
  551. fn: function () {
  552. var self = this;
  553. console.log(self);
  554. return self;
  555. },
  556. source: unescape('printNl%0A%09%7B%27console.log%28self%29%27%7D%0A')}),
  557. smalltalk.Object);
  558. smalltalk.addMethod(
  559. '_isKindOf_',
  560. smalltalk.method({
  561. selector: 'isKindOf:',
  562. category: 'testing',
  563. fn: function (aClass) {
  564. var self = this;
  565. return smalltalk.send(smalltalk.send(self, "_isMemberOf_", [aClass]), "_ifTrue_ifFalse_", [function () {return true;}, function () {return smalltalk.send(smalltalk.send(self, "_class", []), "_inheritsFrom_", [aClass]);}]);
  566. return self;
  567. },
  568. 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')}),
  569. smalltalk.Object);
  570. smalltalk.addMethod(
  571. '_isMemberOf_',
  572. smalltalk.method({
  573. selector: 'isMemberOf:',
  574. category: 'testing',
  575. fn: function (aClass) {
  576. var self = this;
  577. return smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [aClass]);
  578. return self;
  579. },
  580. source: unescape('isMemberOf%3A%20aClass%0A%09%5Eself%20class%20%3D%20aClass%0A')}),
  581. smalltalk.Object);
  582. smalltalk.addMethod(
  583. '_ifNil_',
  584. smalltalk.method({
  585. selector: 'ifNil:',
  586. category: 'testing',
  587. fn: function (aBlock) {
  588. var self = this;
  589. return self;
  590. return self;
  591. },
  592. source: unescape('ifNil%3A%20aBlock%0A%09%5Eself%0A')}),
  593. smalltalk.Object);
  594. smalltalk.addMethod(
  595. '_ifNil_ifNotNil_',
  596. smalltalk.method({
  597. selector: 'ifNil:ifNotNil:',
  598. category: 'testing',
  599. fn: function (aBlock, anotherBlock) {
  600. var self = this;
  601. return smalltalk.send(anotherBlock, "_value", []);
  602. return self;
  603. },
  604. source: unescape('ifNil%3A%20aBlock%20ifNotNil%3A%20anotherBlock%0A%09%5EanotherBlock%20value%0A')}),
  605. smalltalk.Object);
  606. smalltalk.addMethod(
  607. '_ifNotNil_',
  608. smalltalk.method({
  609. selector: 'ifNotNil:',
  610. category: 'testing',
  611. fn: function (aBlock) {
  612. var self = this;
  613. return smalltalk.send(aBlock, "_value", []);
  614. return self;
  615. },
  616. source: unescape('ifNotNil%3A%20aBlock%0A%09%5EaBlock%20value%0A')}),
  617. smalltalk.Object);
  618. smalltalk.addMethod(
  619. '_ifNotNil_ifNil_',
  620. smalltalk.method({
  621. selector: 'ifNotNil:ifNil:',
  622. category: 'testing',
  623. fn: function (aBlock, anotherBlock) {
  624. var self = this;
  625. return smalltalk.send(aBlock, "_value", []);
  626. return self;
  627. },
  628. source: unescape('ifNotNil%3A%20aBlock%20ifNil%3A%20anotherBlock%0A%09%5EaBlock%20value%0A')}),
  629. smalltalk.Object);
  630. smalltalk.addMethod(
  631. '_isNil',
  632. smalltalk.method({
  633. selector: 'isNil',
  634. category: 'testing',
  635. fn: function () {
  636. var self = this;
  637. return false;
  638. return self;
  639. },
  640. source: unescape('isNil%0A%09%5Efalse%0A')}),
  641. smalltalk.Object);
  642. smalltalk.addMethod(
  643. '_notNil',
  644. smalltalk.method({
  645. selector: 'notNil',
  646. category: 'testing',
  647. fn: function () {
  648. var self = this;
  649. return smalltalk.send(smalltalk.send(self, "_isNil", []), "_not", []);
  650. return self;
  651. },
  652. source: unescape('notNil%0A%09%5Eself%20isNil%20not%0A')}),
  653. smalltalk.Object);
  654. smalltalk.addMethod(
  655. '_isClass',
  656. smalltalk.method({
  657. selector: 'isClass',
  658. category: 'testing',
  659. fn: function () {
  660. var self = this;
  661. return false;
  662. return self;
  663. },
  664. source: unescape('isClass%0A%09%5Efalse%0A')}),
  665. smalltalk.Object);
  666. smalltalk.addMethod(
  667. '_isMetaclass',
  668. smalltalk.method({
  669. selector: 'isMetaclass',
  670. category: 'testing',
  671. fn: function () {
  672. var self = this;
  673. return false;
  674. return self;
  675. },
  676. source: unescape('isMetaclass%0A%09%5Efalse%0A')}),
  677. smalltalk.Object);
  678. smalltalk.addMethod(
  679. '_isNumber',
  680. smalltalk.method({
  681. selector: 'isNumber',
  682. category: 'testing',
  683. fn: function () {
  684. var self = this;
  685. return false;
  686. return self;
  687. },
  688. source: unescape('isNumber%0A%09%5Efalse%0A')}),
  689. smalltalk.Object);
  690. smalltalk.addMethod(
  691. '_isString',
  692. smalltalk.method({
  693. selector: 'isString',
  694. category: 'testing',
  695. fn: function () {
  696. var self = this;
  697. return false;
  698. return self;
  699. },
  700. source: unescape('isString%0A%09%5Efalse%0A')}),
  701. smalltalk.Object);
  702. smalltalk.addMethod(
  703. '_isParseFailure',
  704. smalltalk.method({
  705. selector: 'isParseFailure',
  706. category: 'testing',
  707. fn: function () {
  708. var self = this;
  709. return false;
  710. return self;
  711. },
  712. source: unescape('isParseFailure%0A%09%5Efalse%0A')}),
  713. smalltalk.Object);
  714. smalltalk.addMethod(
  715. '_basicPerform_',
  716. smalltalk.method({
  717. selector: 'basicPerform:',
  718. category: 'message handling',
  719. fn: function (aSymbol) {
  720. var self = this;
  721. return smalltalk.send(self, "_basicPerform_withArguments_", [aSymbol, []]);
  722. return self;
  723. },
  724. source: unescape('basicPerform%3A%20aSymbol%20%0A%20%20%20%20%5Eself%20basicPerform%3A%20aSymbol%20withArguments%3A%20%23%28%29%0A')}),
  725. smalltalk.Object);
  726. smalltalk.addMethod(
  727. '_basicPerform_withArguments_',
  728. smalltalk.method({
  729. selector: 'basicPerform:withArguments:',
  730. category: 'message handling',
  731. fn: function (aSymbol, aCollection) {
  732. var self = this;
  733. return self[aSymbol].apply(self, aCollection);
  734. return self;
  735. },
  736. source: unescape('basicPerform%3A%20aSymbol%20withArguments%3A%20aCollection%0A%09%7B%27return%20self%5BaSymbol%5D.apply%28self%2C%20aCollection%29%3B%27%7D%0A')}),
  737. smalltalk.Object);
  738. smalltalk.addMethod(
  739. '_appendToBrush_',
  740. smalltalk.method({
  741. selector: 'appendToBrush:',
  742. category: '*Canvas',
  743. fn: function (aTagBrush) {
  744. var self = this;
  745. smalltalk.send(aTagBrush, "_append_", [smalltalk.send(self, "_asString", [])]);
  746. return self;
  747. },
  748. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20aTagBrush%20append%3A%20self%20asString%0A')}),
  749. smalltalk.Object);
  750. smalltalk.addMethod(
  751. '_basicDelete_',
  752. smalltalk.method({
  753. selector: 'basicDelete:',
  754. category: 'accessing',
  755. fn: function (aString) {
  756. var self = this;
  757. delete self[aString];
  758. return self;
  759. },
  760. source: unescape('basicDelete%3A%20aString%0A%20%20%20%20%7B%27delete%20self%5BaString%5D%27%7D%0A')}),
  761. smalltalk.Object);
  762. smalltalk.addMethod(
  763. '_inspect',
  764. smalltalk.method({
  765. selector: 'inspect',
  766. category: '*IDE',
  767. fn: function () {
  768. var self = this;
  769. (function ($rec) {smalltalk.send($rec, "_inspect_", [self]);return smalltalk.send($rec, "_open", []);}(smalltalk.send(smalltalk.Inspector, "_new", [])));
  770. return self;
  771. },
  772. source: unescape('inspect%0A%09Inspector%20new%20%0A%09%09inspect%3A%20self%3B%0A%09%09open')}),
  773. smalltalk.Object);
  774. smalltalk.addMethod(
  775. '_inspectOn_',
  776. smalltalk.method({
  777. selector: 'inspectOn:',
  778. category: '*IDE',
  779. fn: function (anInspector) {
  780. var self = this;
  781. var variables = nil;
  782. variables = smalltalk.send(smalltalk.Dictionary, "_new", []);
  783. smalltalk.send(variables, "_at_put_", [unescape("%23self"), self]);
  784. smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_instanceVariableNames", []), "_do_", [function (each) {return smalltalk.send(variables, "_at_put_", [each, smalltalk.send(self, "_instVarAt_", [each])]);}]);
  785. (function ($rec) {smalltalk.send($rec, "_setLabel_", [smalltalk.send(self, "_printString", [])]);return smalltalk.send($rec, "_setVariables_", [variables]);}(anInspector));
  786. return self;
  787. },
  788. 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')}),
  789. smalltalk.Object);
  790. smalltalk.addMethod(
  791. '_doesNotUnderstand_',
  792. smalltalk.method({
  793. selector: 'doesNotUnderstand:',
  794. category: 'error handling',
  795. fn: function (aMessage) {
  796. var self = this;
  797. (function ($rec) {smalltalk.send($rec, "_receiver_", [self]);smalltalk.send($rec, "_message_", [aMessage]);return smalltalk.send($rec, "_signal", []);}(smalltalk.send(smalltalk.MessageNotUnderstood, "_new", [])));
  798. return self;
  799. },
  800. source: unescape('doesNotUnderstand%3A%20aMessage%0A%09MessageNotUnderstood%20new%0A%09%09receiver%3A%20self%3B%0A%09%09message%3A%20aMessage%3B%0A%09%09signal')}),
  801. smalltalk.Object);
  802. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel');
  803. smalltalk.addMethod(
  804. '_classes',
  805. smalltalk.method({
  806. selector: 'classes',
  807. category: 'accessing',
  808. fn: function () {
  809. var self = this;
  810. return self.classes();
  811. return self;
  812. },
  813. source: unescape('classes%0A%09%7B%27return%20self.classes%28%29%27%7D')}),
  814. smalltalk.Smalltalk);
  815. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  816. smalltalk.addMethod(
  817. '_current',
  818. smalltalk.method({
  819. selector: 'current',
  820. category: 'accessing',
  821. fn: function () {
  822. var self = this;
  823. return smalltalk;
  824. return self;
  825. },
  826. source: unescape('current%0A%09%7B%27return%20smalltalk%27%7D%0A')}),
  827. smalltalk.Smalltalk.klass);
  828. smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel');
  829. smalltalk.addMethod(
  830. '_new',
  831. smalltalk.method({
  832. selector: 'new',
  833. category: 'instance creation',
  834. fn: function () {
  835. var self = this;
  836. return smalltalk.send(smalltalk.send(self, "_basicNew", []), "_initialize", []);
  837. return self;
  838. },
  839. source: unescape('new%0A%09%5Eself%20basicNew%20initialize')}),
  840. smalltalk.Behavior);
  841. smalltalk.addMethod(
  842. '_basicNew',
  843. smalltalk.method({
  844. selector: 'basicNew',
  845. category: 'instance creation',
  846. fn: function () {
  847. var self = this;
  848. return new self.fn;
  849. return self;
  850. },
  851. source: unescape('basicNew%0A%09%7B%27return%20new%20self.fn%28%29%27%7D%0A')}),
  852. smalltalk.Behavior);
  853. smalltalk.addMethod(
  854. '_name',
  855. smalltalk.method({
  856. selector: 'name',
  857. category: 'accessing',
  858. fn: function () {
  859. var self = this;
  860. return self.className || nil;
  861. return self;
  862. },
  863. source: unescape('name%0A%09%7B%27return%20self.className%20%7C%7C%20nil%27%7D%0A')}),
  864. smalltalk.Behavior);
  865. smalltalk.addMethod(
  866. '_superclass',
  867. smalltalk.method({
  868. selector: 'superclass',
  869. category: 'accessing',
  870. fn: function () {
  871. var self = this;
  872. return self.superclass || nil;
  873. return self;
  874. },
  875. source: unescape('superclass%0A%09%7B%27return%20self.superclass%20%7C%7C%20nil%27%7D%0A')}),
  876. smalltalk.Behavior);
  877. smalltalk.addMethod(
  878. '_subclasses',
  879. smalltalk.method({
  880. selector: 'subclasses',
  881. category: 'accessing',
  882. fn: function () {
  883. var self = this;
  884. return smalltalk.subclasses(self);
  885. return self;
  886. },
  887. source: unescape('subclasses%0A%09%7B%27return%20smalltalk.subclasses%28self%29%27%7D%0A')}),
  888. smalltalk.Behavior);
  889. smalltalk.addMethod(
  890. '_allSubclasses',
  891. smalltalk.method({
  892. selector: 'allSubclasses',
  893. category: 'accessing',
  894. fn: function () {
  895. var self = this;
  896. var result = nil;
  897. result = smalltalk.send(self, "_subclasses", []);
  898. smalltalk.send(smalltalk.send(self, "_subclasses", []), "_do_", [function (each) {return smalltalk.send(result, "_addAll_", [smalltalk.send(each, "_allSubclasses", [])]);}]);
  899. return result;
  900. return self;
  901. },
  902. 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')}),
  903. smalltalk.Behavior);
  904. smalltalk.addMethod(
  905. '_withAllSubclasses',
  906. smalltalk.method({
  907. selector: 'withAllSubclasses',
  908. category: 'accessing',
  909. fn: function () {
  910. var self = this;
  911. return function ($rec) {smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_allSubclasses", [])]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(smalltalk.Array, "_with_", [self]));
  912. return self;
  913. },
  914. source: unescape('withAllSubclasses%0A%09%5E%28Array%20with%3A%20self%29%20addAll%3A%20self%20allSubclasses%3B%20yourself%0A')}),
  915. smalltalk.Behavior);
  916. smalltalk.addMethod(
  917. '_prototype',
  918. smalltalk.method({
  919. selector: 'prototype',
  920. category: 'accessing',
  921. fn: function () {
  922. var self = this;
  923. return self.fn.prototype;
  924. return self;
  925. },
  926. source: unescape('prototype%0A%09%7B%27return%20self.fn.prototype%27%7D%0A')}),
  927. smalltalk.Behavior);
  928. smalltalk.addMethod(
  929. '_methodDictionary',
  930. smalltalk.method({
  931. selector: 'methodDictionary',
  932. category: 'accessing',
  933. fn: function () {
  934. var self = this;
  935. var dict = smalltalk.Dictionary._new();
  936. var methods = self.fn.prototype.methods;
  937. for (var i in methods) {
  938. if (methods[i].selector) {
  939. dict._at_put_(methods[i].selector, methods[i]);
  940. }
  941. }
  942. return dict;
  943. return self;
  944. },
  945. source: unescape('methodDictionary%0A%09%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')}),
  946. smalltalk.Behavior);
  947. smalltalk.addMethod(
  948. '_methodsFor_',
  949. smalltalk.method({
  950. selector: 'methodsFor:',
  951. category: 'accessing',
  952. fn: function (aString) {
  953. var self = this;
  954. return function ($rec) {smalltalk.send($rec, "_class_category_", [self, aString]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(smalltalk.ClassCategoryReader, "_new", []));
  955. return self;
  956. },
  957. 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')}),
  958. smalltalk.Behavior);
  959. smalltalk.addMethod(
  960. '_addCompiledMethod_',
  961. smalltalk.method({
  962. selector: 'addCompiledMethod:',
  963. category: 'accessing',
  964. fn: function (aMethod) {
  965. var self = this;
  966. self.fn.prototype[aMethod.selector._asSelector()] = aMethod.fn;
  967. self.fn.prototype.methods[aMethod.selector] = aMethod;
  968. return self;
  969. },
  970. 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')}),
  971. smalltalk.Behavior);
  972. smalltalk.addMethod(
  973. '_instanceVariableNames',
  974. smalltalk.method({
  975. selector: 'instanceVariableNames',
  976. category: 'accessing',
  977. fn: function () {
  978. var self = this;
  979. return self.iVarNames;
  980. return self;
  981. },
  982. source: unescape('instanceVariableNames%0A%09%7B%27return%20self.iVarNames%27%7D%0A')}),
  983. smalltalk.Behavior);
  984. smalltalk.addMethod(
  985. '_comment',
  986. smalltalk.method({
  987. selector: 'comment',
  988. category: 'accessing',
  989. fn: function () {
  990. var self = this;
  991. return smalltalk.send(smalltalk.send(self, "_basicAt_", ["comment"]), "_ifNil_", [function () {return "";}]);
  992. return self;
  993. },
  994. source: unescape('comment%0A%20%20%20%20%5E%28self%20basicAt%3A%20%27comment%27%29%20ifNil%3A%20%5B%27%27%5D%0A')}),
  995. smalltalk.Behavior);
  996. smalltalk.addMethod(
  997. '_comment_',
  998. smalltalk.method({
  999. selector: 'comment:',
  1000. category: 'accessing',
  1001. fn: function (aString) {
  1002. var self = this;
  1003. smalltalk.send(self, "_basicAt_put_", ["comment", aString]);
  1004. return self;
  1005. },
  1006. source: unescape('comment%3A%20aString%0A%20%20%20%20self%20basicAt%3A%20%27comment%27%20put%3A%20aString%0A')}),
  1007. smalltalk.Behavior);
  1008. smalltalk.addMethod(
  1009. '_commentStamp',
  1010. smalltalk.method({
  1011. selector: 'commentStamp',
  1012. category: 'accessing',
  1013. fn: function () {
  1014. var self = this;
  1015. return function ($rec) {smalltalk.send($rec, "_class_", [self]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(smalltalk.ClassCommentReader, "_new", []));
  1016. return self;
  1017. },
  1018. source: unescape('commentStamp%0A%20%20%20%20%5EClassCommentReader%20new%0A%09class%3A%20self%3B%0A%09yourself%0A')}),
  1019. smalltalk.Behavior);
  1020. smalltalk.addMethod(
  1021. '_removeCompiledMethod_',
  1022. smalltalk.method({
  1023. selector: 'removeCompiledMethod:',
  1024. category: 'accessing',
  1025. fn: function (aMethod) {
  1026. var self = this;
  1027. delete self.fn.prototype[aMethod.selector._asSelector()];
  1028. delete self.fn.prototype.methods[aMethod.selector];
  1029. return self;
  1030. },
  1031. 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')}),
  1032. smalltalk.Behavior);
  1033. smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel');
  1034. smalltalk.addMethod(
  1035. '_category',
  1036. smalltalk.method({
  1037. selector: 'category',
  1038. category: 'accessing',
  1039. fn: function () {
  1040. var self = this;
  1041. return self.category;
  1042. return self;
  1043. },
  1044. source: unescape('category%0A%09%7B%27return%20self.category%27%7D')}),
  1045. smalltalk.Class);
  1046. smalltalk.addMethod(
  1047. '_category_',
  1048. smalltalk.method({
  1049. selector: 'category:',
  1050. category: 'accessing',
  1051. fn: function (aString) {
  1052. var self = this;
  1053. self.category = aString;
  1054. return self;
  1055. },
  1056. source: unescape('category%3A%20aString%0A%09%7B%27self.category%20%3D%20aString%27%7D%0A')}),
  1057. smalltalk.Class);
  1058. smalltalk.addMethod(
  1059. '_subclass_instanceVariableNames_',
  1060. smalltalk.method({
  1061. selector: 'subclass:instanceVariableNames:',
  1062. category: 'class creation',
  1063. fn: function (aString, anotherString) {
  1064. var self = this;
  1065. return smalltalk.send(self, "_subclass_instanceVariableNames_category_", [aString, anotherString, nil]);
  1066. return self;
  1067. },
  1068. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%0A%09%5Eself%20subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%20category%3A%20nil%0A')}),
  1069. smalltalk.Class);
  1070. smalltalk.addMethod(
  1071. '_subclass_instanceVariableNames_category_',
  1072. smalltalk.method({
  1073. selector: 'subclass:instanceVariableNames:category:',
  1074. category: 'class creation',
  1075. fn: function (aString, aString2, aString3) {
  1076. var self = this;
  1077. return smalltalk.send(smalltalk.send(smalltalk.ClassBuilder, "_new", []), "_superclass_subclass_instanceVariableNames_category_", [self, aString, aString2, aString3]);
  1078. return self;
  1079. },
  1080. 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')}),
  1081. smalltalk.Class);
  1082. smalltalk.addMethod(
  1083. '_isClass',
  1084. smalltalk.method({
  1085. selector: 'isClass',
  1086. category: 'testing',
  1087. fn: function () {
  1088. var self = this;
  1089. return true;
  1090. return self;
  1091. },
  1092. source: unescape('isClass%0A%09%5Etrue%0A')}),
  1093. smalltalk.Class);
  1094. smalltalk.addMethod(
  1095. '_printString',
  1096. smalltalk.method({
  1097. selector: 'printString',
  1098. category: 'printing',
  1099. fn: function () {
  1100. var self = this;
  1101. return smalltalk.send(self, "_name", []);
  1102. return self;
  1103. },
  1104. source: unescape('printString%0A%09%5Eself%20name%0A')}),
  1105. smalltalk.Class);
  1106. smalltalk.addMethod(
  1107. '_rename_',
  1108. smalltalk.method({
  1109. selector: 'rename:',
  1110. category: 'accessing',
  1111. fn: function (aString) {
  1112. var self = this;
  1113. smalltalk[aString] = self;
  1114. delete smalltalk[self.className];
  1115. self.className = aString;
  1116. return self;
  1117. },
  1118. 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')}),
  1119. smalltalk.Class);
  1120. smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel');
  1121. smalltalk.addMethod(
  1122. '_instanceClass',
  1123. smalltalk.method({
  1124. selector: 'instanceClass',
  1125. category: 'accessing',
  1126. fn: function () {
  1127. var self = this;
  1128. return self.instanceClass;
  1129. return self;
  1130. },
  1131. source: unescape('instanceClass%0A%09%7B%27return%20self.instanceClass%27%7D')}),
  1132. smalltalk.Metaclass);
  1133. smalltalk.addMethod(
  1134. '_instanceVariableNames_',
  1135. smalltalk.method({
  1136. selector: 'instanceVariableNames:',
  1137. category: 'accessing',
  1138. fn: function (aCollection) {
  1139. var self = this;
  1140. smalltalk.send(smalltalk.send(smalltalk.ClassBuilder, "_new", []), "_class_instanceVariableNames_", [self, aCollection]);
  1141. return self;
  1142. },
  1143. source: unescape('instanceVariableNames%3A%20aCollection%0A%09ClassBuilder%20new%0A%09%20%20%20%20class%3A%20self%20instanceVariableNames%3A%20aCollection%0A')}),
  1144. smalltalk.Metaclass);
  1145. smalltalk.addMethod(
  1146. '_isMetaclass',
  1147. smalltalk.method({
  1148. selector: 'isMetaclass',
  1149. category: 'testing',
  1150. fn: function () {
  1151. var self = this;
  1152. return true;
  1153. return self;
  1154. },
  1155. source: unescape('isMetaclass%0A%09%5Etrue%0A')}),
  1156. smalltalk.Metaclass);
  1157. smalltalk.addMethod(
  1158. '_printString',
  1159. smalltalk.method({
  1160. selector: 'printString',
  1161. category: 'printing',
  1162. fn: function () {
  1163. var self = this;
  1164. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_instanceClass", []), "_name", []), "__comma", [" class"]);
  1165. return self;
  1166. },
  1167. source: unescape('printString%0A%09%5Eself%20instanceClass%20name%2C%20%27%20class%27%0A')}),
  1168. smalltalk.Metaclass);
  1169. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel');
  1170. smalltalk.addMethod(
  1171. '_source',
  1172. smalltalk.method({
  1173. selector: 'source',
  1174. category: 'accessing',
  1175. fn: function () {
  1176. var self = this;
  1177. return smalltalk.send(smalltalk.send(self, "_basicAt_", ["source"]), "_ifNil_", [function () {return "";}]);
  1178. return self;
  1179. },
  1180. source: unescape('source%0A%09%5E%28self%20basicAt%3A%20%27source%27%29%20ifNil%3A%20%5B%27%27%5D%0A')}),
  1181. smalltalk.CompiledMethod);
  1182. smalltalk.addMethod(
  1183. '_source_',
  1184. smalltalk.method({
  1185. selector: 'source:',
  1186. category: 'accessing',
  1187. fn: function (aString) {
  1188. var self = this;
  1189. smalltalk.send(self, "_basicAt_put_", ["source", aString]);
  1190. return self;
  1191. },
  1192. source: unescape('source%3A%20aString%0A%09self%20basicAt%3A%20%27source%27%20put%3A%20aString%0A')}),
  1193. smalltalk.CompiledMethod);
  1194. smalltalk.addMethod(
  1195. '_category',
  1196. smalltalk.method({
  1197. selector: 'category',
  1198. category: 'accessing',
  1199. fn: function () {
  1200. var self = this;
  1201. return smalltalk.send(smalltalk.send(self, "_basicAt_", ["category"]), "_ifNil_", [function () {return "";}]);
  1202. return self;
  1203. },
  1204. source: unescape('category%0A%09%5E%28self%20basicAt%3A%20%27category%27%29%20ifNil%3A%20%5B%27%27%5D%0A')}),
  1205. smalltalk.CompiledMethod);
  1206. smalltalk.addMethod(
  1207. '_category_',
  1208. smalltalk.method({
  1209. selector: 'category:',
  1210. category: 'accessing',
  1211. fn: function (aString) {
  1212. var self = this;
  1213. smalltalk.send(self, "_basicAt_put_", ["category", aString]);
  1214. return self;
  1215. },
  1216. source: unescape('category%3A%20aString%0A%09self%20basicAt%3A%20%27category%27%20put%3A%20aString%0A')}),
  1217. smalltalk.CompiledMethod);
  1218. smalltalk.addMethod(
  1219. '_selector',
  1220. smalltalk.method({
  1221. selector: 'selector',
  1222. category: 'accessing',
  1223. fn: function () {
  1224. var self = this;
  1225. return smalltalk.send(self, "_basicAt_", ["selector"]);
  1226. return self;
  1227. },
  1228. source: unescape('selector%0A%09%5Eself%20basicAt%3A%20%27selector%27%0A')}),
  1229. smalltalk.CompiledMethod);
  1230. smalltalk.addMethod(
  1231. '_selector_',
  1232. smalltalk.method({
  1233. selector: 'selector:',
  1234. category: 'accessing',
  1235. fn: function (aString) {
  1236. var self = this;
  1237. smalltalk.send(self, "_basicAt_put_", ["selector", aString]);
  1238. return self;
  1239. },
  1240. source: unescape('selector%3A%20aString%0A%09self%20basicAt%3A%20%27selector%27%20put%3A%20aString%0A')}),
  1241. smalltalk.CompiledMethod);
  1242. smalltalk.addMethod(
  1243. '_fn',
  1244. smalltalk.method({
  1245. selector: 'fn',
  1246. category: 'accessing',
  1247. fn: function () {
  1248. var self = this;
  1249. return smalltalk.send(self, "_basicAt_", ["fn"]);
  1250. return self;
  1251. },
  1252. source: unescape('fn%0A%09%5Eself%20basicAt%3A%20%27fn%27%0A')}),
  1253. smalltalk.CompiledMethod);
  1254. smalltalk.addMethod(
  1255. '_fn_',
  1256. smalltalk.method({
  1257. selector: 'fn:',
  1258. category: 'accessing',
  1259. fn: function (aBlock) {
  1260. var self = this;
  1261. smalltalk.send(self, "_basicAt_put_", ["fn", aBlock]);
  1262. return self;
  1263. },
  1264. source: unescape('fn%3A%20aBlock%0A%09self%20basicAt%3A%20%27fn%27%20put%3A%20aBlock%0A')}),
  1265. smalltalk.CompiledMethod);
  1266. smalltalk.addClass('Number', smalltalk.Object, [], 'Kernel');
  1267. smalltalk.addMethod(
  1268. '__eq',
  1269. smalltalk.method({
  1270. selector: '=',
  1271. category: 'comparing',
  1272. fn: function (aNumber) {
  1273. var self = this;
  1274. return Number(self) == aNumber;
  1275. return self;
  1276. },
  1277. source: unescape('%3D%20aNumber%0A%09%7B%27return%20Number%28self%29%20%3D%3D%20aNumber%27%7D')}),
  1278. smalltalk.Number);
  1279. smalltalk.addMethod(
  1280. '__gt',
  1281. smalltalk.method({
  1282. selector: '>',
  1283. category: 'comparing',
  1284. fn: function (aNumber) {
  1285. var self = this;
  1286. return self > aNumber;
  1287. return self;
  1288. },
  1289. source: unescape('%3E%20aNumber%0A%09%7B%27return%20self%20%3E%20aNumber%27%7D')}),
  1290. smalltalk.Number);
  1291. smalltalk.addMethod(
  1292. '__lt',
  1293. smalltalk.method({
  1294. selector: '<',
  1295. category: 'comparing',
  1296. fn: function (aNumber) {
  1297. var self = this;
  1298. return self < aNumber;
  1299. return self;
  1300. },
  1301. source: unescape('%3C%20aNumber%0A%09%7B%27return%20self%20%3C%20aNumber%27%7D')}),
  1302. smalltalk.Number);
  1303. smalltalk.addMethod(
  1304. '__gt_eq',
  1305. smalltalk.method({
  1306. selector: '>=',
  1307. category: 'comparing',
  1308. fn: function (aNumber) {
  1309. var self = this;
  1310. return self >= aNumber;
  1311. return self;
  1312. },
  1313. source: unescape('%3E%3D%20aNumber%0A%09%7B%27return%20self%20%3E%3D%20aNumber%27%7D')}),
  1314. smalltalk.Number);
  1315. smalltalk.addMethod(
  1316. '__lt_eq',
  1317. smalltalk.method({
  1318. selector: '<=',
  1319. category: 'comparing',
  1320. fn: function (aNumber) {
  1321. var self = this;
  1322. return self <= aNumber;
  1323. return self;
  1324. },
  1325. source: unescape('%3C%3D%20aNumber%0A%09%7B%27return%20self%20%3C%3D%20aNumber%27%7D')}),
  1326. smalltalk.Number);
  1327. smalltalk.addMethod(
  1328. '__plus',
  1329. smalltalk.method({
  1330. selector: '+',
  1331. category: 'arithmetic',
  1332. fn: function (aNumber) {
  1333. var self = this;
  1334. return self + aNumber;
  1335. return self;
  1336. },
  1337. source: unescape('+%20aNumber%0A%09%7B%27return%20self%20+%20aNumber%27%7D')}),
  1338. smalltalk.Number);
  1339. smalltalk.addMethod(
  1340. '__minus',
  1341. smalltalk.method({
  1342. selector: '-',
  1343. category: 'arithmetic',
  1344. fn: function (aNumber) {
  1345. var self = this;
  1346. return self - aNumber;
  1347. return self;
  1348. },
  1349. source: unescape('-%20aNumber%0A%09%7B%27return%20self%20-%20aNumber%27%7D')}),
  1350. smalltalk.Number);
  1351. smalltalk.addMethod(
  1352. '__star',
  1353. smalltalk.method({
  1354. selector: '*',
  1355. category: 'arithmetic',
  1356. fn: function (aNumber) {
  1357. var self = this;
  1358. return self * aNumber;
  1359. return self;
  1360. },
  1361. source: unescape('*%20aNumber%0A%09%7B%27return%20self%20*%20aNumber%27%7D')}),
  1362. smalltalk.Number);
  1363. smalltalk.addMethod(
  1364. '__slash',
  1365. smalltalk.method({
  1366. selector: '/',
  1367. category: 'arithmetic',
  1368. fn: function (aNumber) {
  1369. var self = this;
  1370. return self / aNumber;
  1371. return self;
  1372. },
  1373. source: unescape('/%20aNumber%0A%09%7B%27return%20self%20/%20aNumber%27%7D')}),
  1374. smalltalk.Number);
  1375. smalltalk.addMethod(
  1376. '_max_',
  1377. smalltalk.method({
  1378. selector: 'max:',
  1379. category: 'arithmetic',
  1380. fn: function (aNumber) {
  1381. var self = this;
  1382. return Math.max(self, aNumber);
  1383. return self;
  1384. },
  1385. source: unescape('max%3A%20aNumber%0A%09%7B%27return%20Math.max%28self%2C%20aNumber%29%3B%27%7D')}),
  1386. smalltalk.Number);
  1387. smalltalk.addMethod(
  1388. '_min_',
  1389. smalltalk.method({
  1390. selector: 'min:',
  1391. category: 'arithmetic',
  1392. fn: function (aNumber) {
  1393. var self = this;
  1394. return Math.min(self, aNumber);
  1395. return self;
  1396. },
  1397. source: unescape('min%3A%20aNumber%0A%09%7B%27return%20Math.min%28self%2C%20aNumber%29%3B%27%7D')}),
  1398. smalltalk.Number);
  1399. smalltalk.addMethod(
  1400. '_rounded',
  1401. smalltalk.method({
  1402. selector: 'rounded',
  1403. category: 'converting',
  1404. fn: function () {
  1405. var self = this;
  1406. return Math.round(self);
  1407. return self;
  1408. },
  1409. source: unescape('rounded%0A%09%7B%27return%20Math.round%28self%29%3B%27%7D')}),
  1410. smalltalk.Number);
  1411. smalltalk.addMethod(
  1412. '_truncated',
  1413. smalltalk.method({
  1414. selector: 'truncated',
  1415. category: 'converting',
  1416. fn: function () {
  1417. var self = this;
  1418. return Math.floor(self);
  1419. return self;
  1420. },
  1421. source: unescape('truncated%0A%09%7B%27return%20Math.floor%28self%29%3B%27%7D')}),
  1422. smalltalk.Number);
  1423. smalltalk.addMethod(
  1424. '_to_',
  1425. smalltalk.method({
  1426. selector: 'to:',
  1427. category: 'converting',
  1428. fn: function (aNumber) {
  1429. var self = this;
  1430. var array = nil;
  1431. var first = nil;
  1432. var last = nil;
  1433. var count = nil;
  1434. first = smalltalk.send(self, "_truncated", []);
  1435. last = smalltalk.send(smalltalk.send(aNumber, "_truncated", []), "__plus", [1]);
  1436. count = 1;
  1437. smalltalk.send(smalltalk.send(first, "__lt_eq", [last]), "_ifFalse_", [function () {return smalltalk.send(self, "_error_", ["Wrong interval"]);}]);
  1438. array = smalltalk.send(smalltalk.Array, "_new", []);
  1439. smalltalk.send(smalltalk.send(last, "__minus", [first]), "_timesRepeat_", [function () {smalltalk.send(array, "_at_put_", [count, first]);count = smalltalk.send(count, "__plus", [1]);return first = smalltalk.send(first, "__plus", [1]);}]);
  1440. return array;
  1441. return self;
  1442. },
  1443. 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')}),
  1444. smalltalk.Number);
  1445. smalltalk.addMethod(
  1446. '_timesRepeat_',
  1447. smalltalk.method({
  1448. selector: 'timesRepeat:',
  1449. category: 'enumerating',
  1450. fn: function (aBlock) {
  1451. var self = this;
  1452. var integer = nil;
  1453. var count = nil;
  1454. integer = smalltalk.send(self, "_truncated", []);
  1455. count = 1;
  1456. smalltalk.send(function () {return smalltalk.send(count, "__gt", [self]);}, "_whileFalse_", [function () {smalltalk.send(aBlock, "_value", []);return count = smalltalk.send(count, "__plus", [1]);}]);
  1457. return self;
  1458. },
  1459. 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')}),
  1460. smalltalk.Number);
  1461. smalltalk.addMethod(
  1462. '_to_do_',
  1463. smalltalk.method({
  1464. selector: 'to:do:',
  1465. category: 'enumerating',
  1466. fn: function (aNumber, aBlock) {
  1467. var self = this;
  1468. return smalltalk.send(smalltalk.send(self, "_to_", [aNumber]), "_do_", [aBlock]);
  1469. return self;
  1470. },
  1471. source: unescape('to%3A%20aNumber%20do%3A%20aBlock%0A%09%5E%28self%20to%3A%20aNumber%29%20do%3A%20aBlock%0A')}),
  1472. smalltalk.Number);
  1473. smalltalk.addMethod(
  1474. '_asString',
  1475. smalltalk.method({
  1476. selector: 'asString',
  1477. category: 'converting',
  1478. fn: function () {
  1479. var self = this;
  1480. return smalltalk.send(self, "_printString", []);
  1481. return self;
  1482. },
  1483. source: unescape('asString%0A%09%5Eself%20printString%0A')}),
  1484. smalltalk.Number);
  1485. smalltalk.addMethod(
  1486. '_asJavascript',
  1487. smalltalk.method({
  1488. selector: 'asJavascript',
  1489. category: 'converting',
  1490. fn: function () {
  1491. var self = this;
  1492. return smalltalk.send(smalltalk.send(unescape("%28"), "__comma", [smalltalk.send(self, "_printString", [])]), "__comma", [unescape("%29")]);
  1493. return self;
  1494. },
  1495. source: unescape('asJavascript%0A%09%5E%27%28%27%2C%20self%20printString%2C%20%27%29%27%0A')}),
  1496. smalltalk.Number);
  1497. smalltalk.addMethod(
  1498. '_printString',
  1499. smalltalk.method({
  1500. selector: 'printString',
  1501. category: 'printing',
  1502. fn: function () {
  1503. var self = this;
  1504. return String(self);
  1505. return self;
  1506. },
  1507. source: unescape('printString%0A%09%7B%27return%20String%28self%29%27%7D')}),
  1508. smalltalk.Number);
  1509. smalltalk.addMethod(
  1510. '_isNumber',
  1511. smalltalk.method({
  1512. selector: 'isNumber',
  1513. category: 'testing',
  1514. fn: function () {
  1515. var self = this;
  1516. return true;
  1517. return self;
  1518. },
  1519. source: unescape('isNumber%0A%09%5Etrue%0A')}),
  1520. smalltalk.Number);
  1521. smalltalk.addMethod(
  1522. '_atRandom',
  1523. smalltalk.method({
  1524. selector: 'atRandom',
  1525. category: 'converting',
  1526. fn: function () {
  1527. var self = this;
  1528. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Random, "_new", []), "_next", []), "__star", [self]), "_truncated", []), "__plus", [1]);
  1529. return self;
  1530. },
  1531. source: unescape('atRandom%0A%20%20%20%20%5E%28Random%20new%20next%20*%20self%29%20truncated%20+%201%0A')}),
  1532. smalltalk.Number);
  1533. smalltalk.addMethod(
  1534. '__at',
  1535. smalltalk.method({
  1536. selector: '@',
  1537. category: 'converting',
  1538. fn: function (aNumber) {
  1539. var self = this;
  1540. return smalltalk.send(smalltalk.Point, "_x_y_", [self, aNumber]);
  1541. return self;
  1542. },
  1543. source: unescape('@%20aNumber%0A%09%5EPoint%20x%3A%20self%20y%3A%20aNumber')}),
  1544. smalltalk.Number);
  1545. smalltalk.addMethod(
  1546. '_asPoint',
  1547. smalltalk.method({
  1548. selector: 'asPoint',
  1549. category: 'converting',
  1550. fn: function () {
  1551. var self = this;
  1552. return smalltalk.send(smalltalk.Point, "_x_y_", [self, self]);
  1553. return self;
  1554. },
  1555. source: unescape('asPoint%0A%09%5EPoint%20x%3A%20self%20y%3A%20self')}),
  1556. smalltalk.Number);
  1557. smalltalk.addMethod(
  1558. '_clearInterval',
  1559. smalltalk.method({
  1560. selector: 'clearInterval',
  1561. category: 'intervals',
  1562. fn: function () {
  1563. var self = this;
  1564. clearInterval(Number(self));
  1565. return self;
  1566. },
  1567. source: unescape('clearInterval%0A%09%7B%27clearInterval%28Number%28self%29%29%27%7D')}),
  1568. smalltalk.Number);
  1569. smalltalk.addMethod(
  1570. '_pi',
  1571. smalltalk.method({
  1572. selector: 'pi',
  1573. category: 'instance creation',
  1574. fn: function () {
  1575. var self = this;
  1576. return Math.PI;
  1577. return self;
  1578. },
  1579. source: unescape('pi%0A%09%7B%27return%20Math.PI%27%7D')}),
  1580. smalltalk.Number.klass);
  1581. smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel');
  1582. smalltalk.addMethod(
  1583. '_compiledSource',
  1584. smalltalk.method({
  1585. selector: 'compiledSource',
  1586. category: 'accessing',
  1587. fn: function () {
  1588. var self = this;
  1589. return self.toString();
  1590. return self;
  1591. },
  1592. source: unescape('compiledSource%0A%09%7B%27return%20self.toString%28%29%27%7D%0A')}),
  1593. smalltalk.BlockClosure);
  1594. smalltalk.addMethod(
  1595. '_whileTrue_',
  1596. smalltalk.method({
  1597. selector: 'whileTrue:',
  1598. category: 'controlling',
  1599. fn: function (aBlock) {
  1600. var self = this;
  1601. while (self()) {
  1602. aBlock();
  1603. }
  1604. return self;
  1605. },
  1606. source: unescape('whileTrue%3A%20aBlock%0A%09%7B%27while%28self%28%29%29%20%7BaBlock%28%29%7D%27%7D%0A')}),
  1607. smalltalk.BlockClosure);
  1608. smalltalk.addMethod(
  1609. '_whileFalse_',
  1610. smalltalk.method({
  1611. selector: 'whileFalse:',
  1612. category: 'controlling',
  1613. fn: function (aBlock) {
  1614. var self = this;
  1615. while (!self()) {
  1616. aBlock();
  1617. }
  1618. return self;
  1619. },
  1620. source: unescape('whileFalse%3A%20aBlock%0A%09%7B%27while%28%21self%28%29%29%20%7BaBlock%28%29%7D%27%7D%0A')}),
  1621. smalltalk.BlockClosure);
  1622. smalltalk.addMethod(
  1623. '_value',
  1624. smalltalk.method({
  1625. selector: 'value',
  1626. category: 'evaluating',
  1627. fn: function () {
  1628. var self = this;
  1629. return self();
  1630. return self;
  1631. },
  1632. source: unescape('value%0A%09%7B%27return%20self%28%29%3B%27%7D%0A')}),
  1633. smalltalk.BlockClosure);
  1634. smalltalk.addMethod(
  1635. '_value_',
  1636. smalltalk.method({
  1637. selector: 'value:',
  1638. category: 'evaluating',
  1639. fn: function (anArg) {
  1640. var self = this;
  1641. return self(anArg);
  1642. return self;
  1643. },
  1644. source: unescape('value%3A%20anArg%0A%09%7B%27return%20self%28anArg%29%3B%27%7D%0A')}),
  1645. smalltalk.BlockClosure);
  1646. smalltalk.addMethod(
  1647. '_value_value_',
  1648. smalltalk.method({
  1649. selector: 'value:value:',
  1650. category: 'evaluating',
  1651. fn: function (firstArg, secondArg) {
  1652. var self = this;
  1653. return self(firstArg, secondArg);
  1654. return self;
  1655. },
  1656. source: unescape('value%3A%20firstArg%20value%3A%20secondArg%0A%09%7B%27return%20self%28firstArg%2C%20secondArg%29%3B%27%7D%0A')}),
  1657. smalltalk.BlockClosure);
  1658. smalltalk.addMethod(
  1659. '_value_value_value_',
  1660. smalltalk.method({
  1661. selector: 'value:value:value:',
  1662. category: 'evaluating',
  1663. fn: function (firstArg, secondArg, thirdArg) {
  1664. var self = this;
  1665. return self(firstArg, secondArg, thirdArg);
  1666. return self;
  1667. },
  1668. source: unescape('value%3A%20firstArg%20value%3A%20secondArg%20value%3A%20thirdArg%0A%09%7B%27return%20self%28firstArg%2C%20secondArg%2C%20thirdArg%29%3B%27%7D%0A')}),
  1669. smalltalk.BlockClosure);
  1670. smalltalk.addMethod(
  1671. '_valueWithPossibleArguments_',
  1672. smalltalk.method({
  1673. selector: 'valueWithPossibleArguments:',
  1674. category: 'evaluating',
  1675. fn: function (aCollection) {
  1676. var self = this;
  1677. return self.apply(null, aCollection);
  1678. return self;
  1679. },
  1680. source: unescape('valueWithPossibleArguments%3A%20aCollection%0A%09%7B%27return%20self.apply%28null%2C%20aCollection%29%3B%27%7D%0A')}),
  1681. smalltalk.BlockClosure);
  1682. smalltalk.addMethod(
  1683. '_on_do_',
  1684. smalltalk.method({
  1685. selector: 'on:do:',
  1686. category: 'error handling',
  1687. fn: function (anErrorClass, aBlock) {
  1688. var self = this;
  1689. smalltalk.send(self, "_try_catch_", [self, function (error) {return smalltalk.send(smalltalk.send(error, "_isKindOf_", [anErrorClass]), "_ifTrue_ifFalse_", [function () {return smalltalk.send(aBlock, "_value", []);}, function () {return smalltalk.send(error, "_signal", []);}]);}]);
  1690. return self;
  1691. },
  1692. 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')}),
  1693. smalltalk.BlockClosure);
  1694. smalltalk.addMethod(
  1695. '_appendToJQuery_',
  1696. smalltalk.method({
  1697. selector: 'appendToJQuery:',
  1698. category: '*JQuery',
  1699. fn: function (aJQuery) {
  1700. var self = this;
  1701. var canvas = nil;
  1702. canvas = smalltalk.send(smalltalk.HTMLCanvas, "_new", []);
  1703. smalltalk.send(self, "_value_", [canvas]);
  1704. smalltalk.send(aJQuery, "_append_", [canvas]);
  1705. return self;
  1706. },
  1707. 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')}),
  1708. smalltalk.BlockClosure);
  1709. smalltalk.addMethod(
  1710. '_appendToBrush_',
  1711. smalltalk.method({
  1712. selector: 'appendToBrush:',
  1713. category: '*Canvas',
  1714. fn: function (aTagBrush) {
  1715. var self = this;
  1716. smalltalk.send(aTagBrush, "_appendBlock_", [self]);
  1717. return self;
  1718. },
  1719. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20aTagBrush%20appendBlock%3A%20self%0A')}),
  1720. smalltalk.BlockClosure);
  1721. smalltalk.addMethod(
  1722. '_valueWithTimeout_',
  1723. smalltalk.method({
  1724. selector: 'valueWithTimeout:',
  1725. category: 'timeout/interval',
  1726. fn: function (aNumber) {
  1727. var self = this;
  1728. setTimeout(self, aNumber);
  1729. return self;
  1730. },
  1731. source: unescape('valueWithTimeout%3A%20aNumber%0A%09%7B%27setTimeout%28self%2C%20aNumber%29%27%7D')}),
  1732. smalltalk.BlockClosure);
  1733. smalltalk.addMethod(
  1734. '_valueWithInterval_',
  1735. smalltalk.method({
  1736. selector: 'valueWithInterval:',
  1737. category: 'timeout/interval',
  1738. fn: function (aNumber) {
  1739. var self = this;
  1740. return setInterval(self, aNumber);
  1741. return self;
  1742. },
  1743. source: unescape('valueWithInterval%3A%20aNumber%0A%09%7B%27return%20setInterval%28self%2C%20aNumber%29%27%7D')}),
  1744. smalltalk.BlockClosure);
  1745. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel');
  1746. smalltalk.addMethod(
  1747. '__eq',
  1748. smalltalk.method({
  1749. selector: '=',
  1750. category: 'comparing',
  1751. fn: function (aBoolean) {
  1752. var self = this;
  1753. return Boolean(self == true) == aBoolean;
  1754. return self;
  1755. },
  1756. source: unescape('%3D%20aBoolean%0A%09%7B%27return%20Boolean%28self%20%3D%3D%20true%29%20%3D%3D%20aBoolean%27%7D')}),
  1757. smalltalk.Boolean);
  1758. smalltalk.addMethod(
  1759. '_shallowCopy',
  1760. smalltalk.method({
  1761. selector: 'shallowCopy',
  1762. category: 'copying',
  1763. fn: function () {
  1764. var self = this;
  1765. return self;
  1766. return self;
  1767. },
  1768. source: unescape('shallowCopy%0A%09%5Eself%0A')}),
  1769. smalltalk.Boolean);
  1770. smalltalk.addMethod(
  1771. '_deepCopy',
  1772. smalltalk.method({
  1773. selector: 'deepCopy',
  1774. category: 'copying',
  1775. fn: function () {
  1776. var self = this;
  1777. return self;
  1778. return self;
  1779. },
  1780. source: unescape('deepCopy%0A%09%5Eself%0A')}),
  1781. smalltalk.Boolean);
  1782. smalltalk.addMethod(
  1783. '_ifTrue_',
  1784. smalltalk.method({
  1785. selector: 'ifTrue:',
  1786. category: 'controlling',
  1787. fn: function (aBlock) {
  1788. var self = this;
  1789. return smalltalk.send(self, "_ifTrue_ifFalse_", [aBlock, function () {return nil;}]);
  1790. return self;
  1791. },
  1792. source: unescape('ifTrue%3A%20aBlock%0A%09%5Eself%20ifTrue%3A%20aBlock%20ifFalse%3A%20%5B%5D%0A')}),
  1793. smalltalk.Boolean);
  1794. smalltalk.addMethod(
  1795. '_ifFalse_',
  1796. smalltalk.method({
  1797. selector: 'ifFalse:',
  1798. category: 'controlling',
  1799. fn: function (aBlock) {
  1800. var self = this;
  1801. return smalltalk.send(self, "_ifTrue_ifFalse_", [function () {return nil;}, aBlock]);
  1802. return self;
  1803. },
  1804. source: unescape('ifFalse%3A%20aBlock%0A%09%5Eself%20ifTrue%3A%20%5B%5D%20ifFalse%3A%20aBlock%0A')}),
  1805. smalltalk.Boolean);
  1806. smalltalk.addMethod(
  1807. '_ifFalse_ifTrue_',
  1808. smalltalk.method({
  1809. selector: 'ifFalse:ifTrue:',
  1810. category: 'controlling',
  1811. fn: function (aBlock, anotherBlock) {
  1812. var self = this;
  1813. return smalltalk.send(self, "_ifTrue_ifFalse_", [anotherBlock, aBlock]);
  1814. return self;
  1815. },
  1816. source: unescape('ifFalse%3A%20aBlock%20ifTrue%3A%20anotherBlock%0A%09%5Eself%20ifTrue%3A%20anotherBlock%20ifFalse%3A%20aBlock%0A')}),
  1817. smalltalk.Boolean);
  1818. smalltalk.addMethod(
  1819. '_ifTrue_ifFalse_',
  1820. smalltalk.method({
  1821. selector: 'ifTrue:ifFalse:',
  1822. category: 'controlling',
  1823. fn: function (aBlock, anotherBlock) {
  1824. var self = this;
  1825. if (self == true) {
  1826. return aBlock();
  1827. } else {
  1828. return anotherBlock();
  1829. }
  1830. return self;
  1831. },
  1832. source: unescape('ifTrue%3A%20aBlock%20ifFalse%3A%20anotherBlock%0A%09%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')}),
  1833. smalltalk.Boolean);
  1834. smalltalk.addMethod(
  1835. '_and_',
  1836. smalltalk.method({
  1837. selector: 'and:',
  1838. category: 'controlling',
  1839. fn: function (aBlock) {
  1840. var self = this;
  1841. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [aBlock, function () {return false;}]);
  1842. return self;
  1843. },
  1844. 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')}),
  1845. smalltalk.Boolean);
  1846. smalltalk.addMethod(
  1847. '_or_',
  1848. smalltalk.method({
  1849. selector: 'or:',
  1850. category: 'controlling',
  1851. fn: function (aBlock) {
  1852. var self = this;
  1853. return smalltalk.send(smalltalk.send(self, "__eq", [true]), "_ifTrue_ifFalse_", [function () {return true;}, aBlock]);
  1854. return self;
  1855. },
  1856. 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')}),
  1857. smalltalk.Boolean);
  1858. smalltalk.addMethod(
  1859. '_not',
  1860. smalltalk.method({
  1861. selector: 'not',
  1862. category: 'controlling',
  1863. fn: function () {
  1864. var self = this;
  1865. return smalltalk.send(self, "__eq", [false]);
  1866. return self;
  1867. },
  1868. source: unescape('not%0A%09%5Eself%20%3D%20false%0A')}),
  1869. smalltalk.Boolean);
  1870. smalltalk.addMethod(
  1871. '_printString',
  1872. smalltalk.method({
  1873. selector: 'printString',
  1874. category: 'printing',
  1875. fn: function () {
  1876. var self = this;
  1877. return self.toString();
  1878. return self;
  1879. },
  1880. source: unescape('printString%0A%09%7B%27return%20self.toString%28%29%27%7D')}),
  1881. smalltalk.Boolean);
  1882. smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel');
  1883. smalltalk.Date.comment=unescape('The%20Date%20class%20is%20used%20to%20work%20with%20dates%20and%20times.')
  1884. smalltalk.addMethod(
  1885. '_year',
  1886. smalltalk.method({
  1887. selector: 'year',
  1888. category: 'accessing',
  1889. fn: function () {
  1890. var self = this;
  1891. return self.getFullYear();
  1892. return self;
  1893. },
  1894. source: unescape('year%0A%09%7B%27return%20self.getFullYear%28%29%27%7D')}),
  1895. smalltalk.Date);
  1896. smalltalk.addMethod(
  1897. '_month',
  1898. smalltalk.method({
  1899. selector: 'month',
  1900. category: 'accessing',
  1901. fn: function () {
  1902. var self = this;
  1903. return self.getMonth() + 1;
  1904. return self;
  1905. },
  1906. source: unescape('month%0A%09%7B%27return%20self.getMonth%28%29%20+%201%27%7D')}),
  1907. smalltalk.Date);
  1908. smalltalk.addMethod(
  1909. '_month_',
  1910. smalltalk.method({
  1911. selector: 'month:',
  1912. category: 'accessing',
  1913. fn: function (aNumber) {
  1914. var self = this;
  1915. self.setMonth(aNumber - 1);
  1916. return self;
  1917. },
  1918. source: unescape('month%3A%20aNumber%0A%09%7B%27self.setMonth%28aNumber%20-%201%29%27%7D')}),
  1919. smalltalk.Date);
  1920. smalltalk.addMethod(
  1921. '_day',
  1922. smalltalk.method({
  1923. selector: 'day',
  1924. category: 'accessing',
  1925. fn: function () {
  1926. var self = this;
  1927. return smalltalk.send(self, "_dayOfWeek", []);
  1928. return self;
  1929. },
  1930. source: unescape('day%0A%09%5Eself%20dayOfWeek')}),
  1931. smalltalk.Date);
  1932. smalltalk.addMethod(
  1933. '_dayOfWeek',
  1934. smalltalk.method({
  1935. selector: 'dayOfWeek',
  1936. category: 'accessing',
  1937. fn: function () {
  1938. var self = this;
  1939. return self.getDay() + 1;
  1940. return self;
  1941. },
  1942. source: unescape('dayOfWeek%0A%09%7B%27return%20self.getDay%28%29%20+%201%27%7D')}),
  1943. smalltalk.Date);
  1944. smalltalk.addMethod(
  1945. '_dayOfWeek_',
  1946. smalltalk.method({
  1947. selector: 'dayOfWeek:',
  1948. category: 'accessing',
  1949. fn: function (aNumber) {
  1950. var self = this;
  1951. return self.setDay(aNumber - 1);
  1952. return self;
  1953. },
  1954. source: unescape('dayOfWeek%3A%20aNumber%0A%09%7B%27return%20self.setDay%28aNumber%20-%201%29%27%7D')}),
  1955. smalltalk.Date);
  1956. smalltalk.addMethod(
  1957. '_day_',
  1958. smalltalk.method({
  1959. selector: 'day:',
  1960. category: 'accessing',
  1961. fn: function (aNumber) {
  1962. var self = this;
  1963. smalltalk.send(self, "_day_", [aNumber]);
  1964. return self;
  1965. },
  1966. source: unescape('day%3A%20aNumber%0A%09self%20day%3A%20aNumber')}),
  1967. smalltalk.Date);
  1968. smalltalk.addMethod(
  1969. '_year_',
  1970. smalltalk.method({
  1971. selector: 'year:',
  1972. category: 'accessing',
  1973. fn: function (aNumber) {
  1974. var self = this;
  1975. self.setFullYear(aNumber);
  1976. return self;
  1977. },
  1978. source: unescape('year%3A%20aNumber%0A%09%7B%27self.setFullYear%28aNumber%29%27%7D')}),
  1979. smalltalk.Date);
  1980. smalltalk.addMethod(
  1981. '_dayOfMonth',
  1982. smalltalk.method({
  1983. selector: 'dayOfMonth',
  1984. category: 'accessing',
  1985. fn: function () {
  1986. var self = this;
  1987. return self.getDate();
  1988. return self;
  1989. },
  1990. source: unescape('dayOfMonth%0A%09%7B%27return%20self.getDate%28%29%27%7D')}),
  1991. smalltalk.Date);
  1992. smalltalk.addMethod(
  1993. '_dayOfMonth_',
  1994. smalltalk.method({
  1995. selector: 'dayOfMonth:',
  1996. category: 'accessing',
  1997. fn: function (aNumber) {
  1998. var self = this;
  1999. self.setDate(aNumber);
  2000. return self;
  2001. },
  2002. source: unescape('dayOfMonth%3A%20aNumber%0A%09%7B%27self.setDate%28aNumber%29%27%7D')}),
  2003. smalltalk.Date);
  2004. smalltalk.addMethod(
  2005. '_asString',
  2006. smalltalk.method({
  2007. selector: 'asString',
  2008. category: 'converting',
  2009. fn: function () {
  2010. var self = this;
  2011. return self.toString();
  2012. return self;
  2013. },
  2014. source: unescape('asString%0A%09%7B%27return%20self.toString%28%29%27%7D')}),
  2015. smalltalk.Date);
  2016. smalltalk.addMethod(
  2017. '_printString',
  2018. smalltalk.method({
  2019. selector: 'printString',
  2020. category: 'printing',
  2021. fn: function () {
  2022. var self = this;
  2023. return smalltalk.send(self, "_asString", []);
  2024. return self;
  2025. },
  2026. source: unescape('printString%0A%09%5Eself%20asString')}),
  2027. smalltalk.Date);
  2028. smalltalk.addMethod(
  2029. '_asMilliseconds',
  2030. smalltalk.method({
  2031. selector: 'asMilliseconds',
  2032. category: 'converting',
  2033. fn: function () {
  2034. var self = this;
  2035. return smalltalk.send(self, "_time", []);
  2036. return self;
  2037. },
  2038. source: unescape('asMilliseconds%0A%09%5Eself%20time')}),
  2039. smalltalk.Date);
  2040. smalltalk.addMethod(
  2041. '_time',
  2042. smalltalk.method({
  2043. selector: 'time',
  2044. category: 'accessing',
  2045. fn: function () {
  2046. var self = this;
  2047. return self.getTime();
  2048. return self;
  2049. },
  2050. source: unescape('time%0A%09%7B%27return%20self.getTime%28%29%27%7D')}),
  2051. smalltalk.Date);
  2052. smalltalk.addMethod(
  2053. '_time_',
  2054. smalltalk.method({
  2055. selector: 'time:',
  2056. category: 'accessing',
  2057. fn: function (aNumber) {
  2058. var self = this;
  2059. self.setTime(aNumber);
  2060. return self;
  2061. },
  2062. source: unescape('time%3A%20aNumber%0A%09%7B%27self.setTime%28aNumber%29%27%7D')}),
  2063. smalltalk.Date);
  2064. smalltalk.addMethod(
  2065. '_asDateString',
  2066. smalltalk.method({
  2067. selector: 'asDateString',
  2068. category: 'converting',
  2069. fn: function () {
  2070. var self = this;
  2071. return self.toDateString();
  2072. return self;
  2073. },
  2074. source: unescape('asDateString%0A%09%7B%27return%20self.toDateString%28%29%27%7D')}),
  2075. smalltalk.Date);
  2076. smalltalk.addMethod(
  2077. '_asTimeString',
  2078. smalltalk.method({
  2079. selector: 'asTimeString',
  2080. category: 'converting',
  2081. fn: function () {
  2082. var self = this;
  2083. return self.toTimeString();
  2084. return self;
  2085. },
  2086. source: unescape('asTimeString%0A%09%7B%27return%20self.toTimeString%28%29%27%7D')}),
  2087. smalltalk.Date);
  2088. smalltalk.addMethod(
  2089. '_asLocaleString',
  2090. smalltalk.method({
  2091. selector: 'asLocaleString',
  2092. category: 'converting',
  2093. fn: function () {
  2094. var self = this;
  2095. return self.toLocaleString();
  2096. return self;
  2097. },
  2098. source: unescape('asLocaleString%0A%09%7B%27return%20self.toLocaleString%28%29%27%7D')}),
  2099. smalltalk.Date);
  2100. smalltalk.addMethod(
  2101. '_asNumber',
  2102. smalltalk.method({
  2103. selector: 'asNumber',
  2104. category: 'converting',
  2105. fn: function () {
  2106. var self = this;
  2107. return smalltalk.send(self, "_asMilliseconds", []);
  2108. return self;
  2109. },
  2110. source: unescape('asNumber%0A%09%5Eself%20asMilliseconds')}),
  2111. smalltalk.Date);
  2112. smalltalk.addMethod(
  2113. '_hours_',
  2114. smalltalk.method({
  2115. selector: 'hours:',
  2116. category: 'accessing',
  2117. fn: function (aNumber) {
  2118. var self = this;
  2119. self.setHours(aNumber);
  2120. return self;
  2121. },
  2122. source: unescape('hours%3A%20aNumber%0A%09%7B%27self.setHours%28aNumber%29%27%7D')}),
  2123. smalltalk.Date);
  2124. smalltalk.addMethod(
  2125. '_minutes_',
  2126. smalltalk.method({
  2127. selector: 'minutes:',
  2128. category: 'accessing',
  2129. fn: function (aNumber) {
  2130. var self = this;
  2131. self.setMinutes(aNumber);
  2132. return self;
  2133. },
  2134. source: unescape('minutes%3A%20aNumber%0A%09%7B%27self.setMinutes%28aNumber%29%27%7D')}),
  2135. smalltalk.Date);
  2136. smalltalk.addMethod(
  2137. '_seconds_',
  2138. smalltalk.method({
  2139. selector: 'seconds:',
  2140. category: 'accessing',
  2141. fn: function (aNumber) {
  2142. var self = this;
  2143. self.setSeconds(aNumber);
  2144. return self;
  2145. },
  2146. source: unescape('seconds%3A%20aNumber%0A%09%7B%27self.setSeconds%28aNumber%29%27%7D')}),
  2147. smalltalk.Date);
  2148. smalltalk.addMethod(
  2149. '_milliseconds_',
  2150. smalltalk.method({
  2151. selector: 'milliseconds:',
  2152. category: 'accessing',
  2153. fn: function (aNumber) {
  2154. var self = this;
  2155. self.setMilliseconds(aNumber);
  2156. return self;
  2157. },
  2158. source: unescape('milliseconds%3A%20aNumber%0A%09%7B%27self.setMilliseconds%28aNumber%29%27%7D')}),
  2159. smalltalk.Date);
  2160. smalltalk.addMethod(
  2161. '_hours',
  2162. smalltalk.method({
  2163. selector: 'hours',
  2164. category: 'accessing',
  2165. fn: function () {
  2166. var self = this;
  2167. return self.getHours();
  2168. return self;
  2169. },
  2170. source: unescape('hours%0A%09%7B%27return%20self.getHours%28%29%27%7D')}),
  2171. smalltalk.Date);
  2172. smalltalk.addMethod(
  2173. '_minutes',
  2174. smalltalk.method({
  2175. selector: 'minutes',
  2176. category: 'accessing',
  2177. fn: function () {
  2178. var self = this;
  2179. return self.getMinutes();
  2180. return self;
  2181. },
  2182. source: unescape('minutes%0A%09%7B%27return%20self.getMinutes%28%29%27%7D')}),
  2183. smalltalk.Date);
  2184. smalltalk.addMethod(
  2185. '_seconds',
  2186. smalltalk.method({
  2187. selector: 'seconds',
  2188. category: 'accessing',
  2189. fn: function () {
  2190. var self = this;
  2191. return self.getSeconds();
  2192. return self;
  2193. },
  2194. source: unescape('seconds%0A%09%7B%27return%20self.getSeconds%28%29%27%7D')}),
  2195. smalltalk.Date);
  2196. smalltalk.addMethod(
  2197. '_milliseconds',
  2198. smalltalk.method({
  2199. selector: 'milliseconds',
  2200. category: 'accessing',
  2201. fn: function () {
  2202. var self = this;
  2203. return self.getMilliseconds();
  2204. return self;
  2205. },
  2206. source: unescape('milliseconds%0A%09%7B%27return%20self.getMilliseconds%28%29%27%7D')}),
  2207. smalltalk.Date);
  2208. smalltalk.addMethod(
  2209. '_inspectOn_',
  2210. smalltalk.method({
  2211. selector: 'inspectOn:',
  2212. category: '*IDE',
  2213. fn: function (anInspector) {
  2214. var self = this;
  2215. var variables = nil;
  2216. variables = smalltalk.send(smalltalk.Dictionary, "_new", []);
  2217. smalltalk.send(variables, "_at_put_", [unescape("%23self"), self]);
  2218. smalltalk.send(variables, "_at_put_", [unescape("%23year"), smalltalk.send(self, "_year", [])]);
  2219. smalltalk.send(variables, "_at_put_", [unescape("%23month"), smalltalk.send(self, "_month", [])]);
  2220. smalltalk.send(variables, "_at_put_", [unescape("%23day"), smalltalk.send(self, "_day", [])]);
  2221. smalltalk.send(variables, "_at_put_", [unescape("%23hours"), smalltalk.send(self, "_hours", [])]);
  2222. smalltalk.send(variables, "_at_put_", [unescape("%23minutes"), smalltalk.send(self, "_minutes", [])]);
  2223. smalltalk.send(variables, "_at_put_", [unescape("%23seconds"), smalltalk.send(self, "_seconds", [])]);
  2224. smalltalk.send(variables, "_at_put_", [unescape("%23milliseconds"), smalltalk.send(self, "_milliseconds", [])]);
  2225. (function ($rec) {smalltalk.send($rec, "_setLabel_", [smalltalk.send(self, "_printString", [])]);return smalltalk.send($rec, "_setVariables_", [variables]);}(anInspector));
  2226. return self;
  2227. },
  2228. 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%09variables%20at%3A%20%27%23year%27%20put%3A%20self%20year.%0A%09variables%20at%3A%20%27%23month%27%20put%3A%20self%20month.%0A%09variables%20at%3A%20%27%23day%27%20put%3A%20self%20day.%0A%09variables%20at%3A%20%27%23hours%27%20put%3A%20self%20hours.%0A%09variables%20at%3A%20%27%23minutes%27%20put%3A%20self%20minutes.%0A%09variables%20at%3A%20%27%23seconds%27%20put%3A%20self%20seconds.%0A%09variables%20at%3A%20%27%23milliseconds%27%20put%3A%20self%20milliseconds.%0A%09anInspector%20%0A%09%09setLabel%3A%20self%20printString%3B%0A%09%09setVariables%3A%20variables%0A%09%0A%09')}),
  2229. smalltalk.Date);
  2230. smalltalk.addMethod(
  2231. '__lt',
  2232. smalltalk.method({
  2233. selector: '<',
  2234. category: 'comparing',
  2235. fn: function (aDate) {
  2236. var self = this;
  2237. return self < aDate;
  2238. return self;
  2239. },
  2240. source: unescape('%3C%20aDate%0A%09%7B%27return%20self%20%3C%20aDate%27%7D')}),
  2241. smalltalk.Date);
  2242. smalltalk.addMethod(
  2243. '__gt',
  2244. smalltalk.method({
  2245. selector: '>',
  2246. category: 'comparing',
  2247. fn: function (aDate) {
  2248. var self = this;
  2249. return self > aDate;
  2250. return self;
  2251. },
  2252. source: unescape('%3E%20aDate%0A%09%7B%27return%20self%20%3E%20aDate%27%7D')}),
  2253. smalltalk.Date);
  2254. smalltalk.addMethod(
  2255. '__lt_eq',
  2256. smalltalk.method({
  2257. selector: '<=',
  2258. category: 'comparing',
  2259. fn: function (aDate) {
  2260. var self = this;
  2261. self <= aDate;
  2262. return self;
  2263. },
  2264. source: unescape('%3C%3D%20aDate%0A%09%7B%27self%20%3C%3D%20aDate%27%7D')}),
  2265. smalltalk.Date);
  2266. smalltalk.addMethod(
  2267. '__gt_eq',
  2268. smalltalk.method({
  2269. selector: '>=',
  2270. category: 'comparing',
  2271. fn: function (aDate) {
  2272. var self = this;
  2273. self >= aDate;
  2274. return self;
  2275. },
  2276. source: unescape('%3E%3D%20aDate%0A%09%7B%27self%20%3E%3D%20aDate%27%7D')}),
  2277. smalltalk.Date);
  2278. smalltalk.addMethod(
  2279. '__minus',
  2280. smalltalk.method({
  2281. selector: '-',
  2282. category: 'arithmetic',
  2283. fn: function (aDate) {
  2284. var self = this;
  2285. return self - aDate;
  2286. return self;
  2287. },
  2288. source: unescape('-%20aDate%0A%09%7B%27return%20self%20-%20aDate%27%7D')}),
  2289. smalltalk.Date);
  2290. smalltalk.addMethod(
  2291. '__plus',
  2292. smalltalk.method({
  2293. selector: '+',
  2294. category: 'arithmetic',
  2295. fn: function (aDate) {
  2296. var self = this;
  2297. return self + aDate;
  2298. return self;
  2299. },
  2300. source: unescape('+%20aDate%0A%09%7B%27return%20self%20+%20aDate%27%7D')}),
  2301. smalltalk.Date);
  2302. smalltalk.addMethod(
  2303. '_new_',
  2304. smalltalk.method({
  2305. selector: 'new:',
  2306. category: 'instance creation',
  2307. fn: function (anObject) {
  2308. var self = this;
  2309. return new Date(anObject);
  2310. return self;
  2311. },
  2312. source: unescape('new%3A%20anObject%0A%09%7B%27return%20new%20Date%28anObject%29%27%7D')}),
  2313. smalltalk.Date.klass);
  2314. smalltalk.addMethod(
  2315. '_fromString_',
  2316. smalltalk.method({
  2317. selector: 'fromString:',
  2318. category: 'instance creation',
  2319. fn: function (aString) {
  2320. var self = this;
  2321. return smalltalk.send(self, "_new_", [aString]);
  2322. return self;
  2323. },
  2324. source: unescape('fromString%3A%20aString%0A%09%22Example%3A%20Date%20fromString%28%272011/04/15%2000%3A00%3A00%27%29%22%0A%09%5Eself%20new%3A%20aString')}),
  2325. smalltalk.Date.klass);
  2326. smalltalk.addMethod(
  2327. '_fromSeconds_',
  2328. smalltalk.method({
  2329. selector: 'fromSeconds:',
  2330. category: 'instance creation',
  2331. fn: function (aNumber) {
  2332. var self = this;
  2333. return smalltalk.send(self, "_fromMilliseconds_", [smalltalk.send(aNumber, "__star", [1000])]);
  2334. return self;
  2335. },
  2336. source: unescape('fromSeconds%3A%20aNumber%0A%09%5Eself%20fromMilliseconds%3A%20aNumber%20*%201000')}),
  2337. smalltalk.Date.klass);
  2338. smalltalk.addMethod(
  2339. '_fromMilliseconds_',
  2340. smalltalk.method({
  2341. selector: 'fromMilliseconds:',
  2342. category: 'instance creation',
  2343. fn: function (aNumber) {
  2344. var self = this;
  2345. return smalltalk.send(self, "_new_", [aNumber]);
  2346. return self;
  2347. },
  2348. source: unescape('fromMilliseconds%3A%20aNumber%0A%09%5Eself%20new%3A%20aNumber')}),
  2349. smalltalk.Date.klass);
  2350. smalltalk.addMethod(
  2351. '_today',
  2352. smalltalk.method({
  2353. selector: 'today',
  2354. category: 'instance creation',
  2355. fn: function () {
  2356. var self = this;
  2357. return smalltalk.send(self, "_new", []);
  2358. return self;
  2359. },
  2360. source: unescape('today%0A%09%5Eself%20new')}),
  2361. smalltalk.Date.klass);
  2362. smalltalk.addMethod(
  2363. '_now',
  2364. smalltalk.method({
  2365. selector: 'now',
  2366. category: 'instance creation',
  2367. fn: function () {
  2368. var self = this;
  2369. return smalltalk.send(self, "_today", []);
  2370. return self;
  2371. },
  2372. source: unescape('now%0A%09%5Eself%20today')}),
  2373. smalltalk.Date.klass);
  2374. smalltalk.addMethod(
  2375. '_millisecondsToRun_',
  2376. smalltalk.method({
  2377. selector: 'millisecondsToRun:',
  2378. category: 'instance creation',
  2379. fn: function (aBlock) {
  2380. var self = this;
  2381. var t = nil;
  2382. t = smalltalk.send(smalltalk.Date, "_now", []);
  2383. smalltalk.send(aBlock, "_value", []);
  2384. return smalltalk.send(smalltalk.send(smalltalk.Date, "_now", []), "__minus", [t]);
  2385. return self;
  2386. },
  2387. source: unescape('millisecondsToRun%3A%20aBlock%0A%09%7C%20t%20%7C%0A%09t%20%3A%3D%20Date%20now.%0A%09aBlock%20value.%0A%09%5EDate%20now%20-%20t')}),
  2388. smalltalk.Date.klass);
  2389. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel');
  2390. smalltalk.addMethod(
  2391. '_subclass_instanceVariableNames_',
  2392. smalltalk.method({
  2393. selector: 'subclass:instanceVariableNames:',
  2394. category: 'class creation',
  2395. fn: function (aString, anotherString) {
  2396. var self = this;
  2397. return smalltalk.send(self, "_subclass_instanceVariableNames_category_", [aString, anotherString, nil]);
  2398. return self;
  2399. },
  2400. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%0A%09%5Eself%20subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%20category%3A%20nil%0A')}),
  2401. smalltalk.UndefinedObject);
  2402. smalltalk.addMethod(
  2403. '_subclass_instanceVariableNames_category_',
  2404. smalltalk.method({
  2405. selector: 'subclass:instanceVariableNames:category:',
  2406. category: 'class creation',
  2407. fn: function (aString, aString2, aString3) {
  2408. var self = this;
  2409. return smalltalk.send(smalltalk.send(smalltalk.ClassBuilder, "_new", []), "_superclass_subclass_instanceVariableNames_category_", [self, aString, aString2, aString3]);
  2410. return self;
  2411. },
  2412. 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')}),
  2413. smalltalk.UndefinedObject);
  2414. smalltalk.addMethod(
  2415. '_shallowCopy',
  2416. smalltalk.method({
  2417. selector: 'shallowCopy',
  2418. category: 'copying',
  2419. fn: function () {
  2420. var self = this;
  2421. return self;
  2422. return self;
  2423. },
  2424. source: unescape('shallowCopy%0A%09%5Eself%0A')}),
  2425. smalltalk.UndefinedObject);
  2426. smalltalk.addMethod(
  2427. '_deepCopy',
  2428. smalltalk.method({
  2429. selector: 'deepCopy',
  2430. category: 'copying',
  2431. fn: function () {
  2432. var self = this;
  2433. return self;
  2434. return self;
  2435. },
  2436. source: unescape('deepCopy%0A%09%5Eself%0A')}),
  2437. smalltalk.UndefinedObject);
  2438. smalltalk.addMethod(
  2439. '_ifNil_',
  2440. smalltalk.method({
  2441. selector: 'ifNil:',
  2442. category: 'testing',
  2443. fn: function (aBlock) {
  2444. var self = this;
  2445. return smalltalk.send(self, "_ifNil_ifNotNil_", [aBlock, function () {return nil;}]);
  2446. return self;
  2447. },
  2448. source: unescape('ifNil%3A%20aBlock%0A%09%5Eself%20ifNil%3A%20aBlock%20ifNotNil%3A%20%5B%5D%0A')}),
  2449. smalltalk.UndefinedObject);
  2450. smalltalk.addMethod(
  2451. '_ifNotNil_',
  2452. smalltalk.method({
  2453. selector: 'ifNotNil:',
  2454. category: 'testing',
  2455. fn: function (aBlock) {
  2456. var self = this;
  2457. return self;
  2458. return self;
  2459. },
  2460. source: unescape('ifNotNil%3A%20aBlock%0A%09%5Eself%0A')}),
  2461. smalltalk.UndefinedObject);
  2462. smalltalk.addMethod(
  2463. '_ifNil_ifNotNil_',
  2464. smalltalk.method({
  2465. selector: 'ifNil:ifNotNil:',
  2466. category: 'testing',
  2467. fn: function (aBlock, anotherBlock) {
  2468. var self = this;
  2469. return smalltalk.send(aBlock, "_value", []);
  2470. return self;
  2471. },
  2472. source: unescape('ifNil%3A%20aBlock%20ifNotNil%3A%20anotherBlock%0A%09%5EaBlock%20value%0A')}),
  2473. smalltalk.UndefinedObject);
  2474. smalltalk.addMethod(
  2475. '_ifNotNil_ifNil_',
  2476. smalltalk.method({
  2477. selector: 'ifNotNil:ifNil:',
  2478. category: 'testing',
  2479. fn: function (aBlock, anotherBlock) {
  2480. var self = this;
  2481. return smalltalk.send(anotherBlock, "_value", []);
  2482. return self;
  2483. },
  2484. source: unescape('ifNotNil%3A%20aBlock%20ifNil%3A%20anotherBlock%0A%09%5EanotherBlock%20value%0A')}),
  2485. smalltalk.UndefinedObject);
  2486. smalltalk.addMethod(
  2487. '_isNil',
  2488. smalltalk.method({
  2489. selector: 'isNil',
  2490. category: 'testing',
  2491. fn: function () {
  2492. var self = this;
  2493. return true;
  2494. return self;
  2495. },
  2496. source: unescape('isNil%0A%09%5Etrue%0A')}),
  2497. smalltalk.UndefinedObject);
  2498. smalltalk.addMethod(
  2499. '_notNil',
  2500. smalltalk.method({
  2501. selector: 'notNil',
  2502. category: 'testing',
  2503. fn: function () {
  2504. var self = this;
  2505. return false;
  2506. return self;
  2507. },
  2508. source: unescape('notNil%0A%09%5Efalse%0A')}),
  2509. smalltalk.UndefinedObject);
  2510. smalltalk.addMethod(
  2511. '_printString',
  2512. smalltalk.method({
  2513. selector: 'printString',
  2514. category: 'printing',
  2515. fn: function () {
  2516. var self = this;
  2517. return "nil";
  2518. return self;
  2519. },
  2520. source: unescape('printString%0A%20%20%20%20%5E%27nil%27%0A')}),
  2521. smalltalk.UndefinedObject);
  2522. smalltalk.addMethod(
  2523. '_new',
  2524. smalltalk.method({
  2525. selector: 'new',
  2526. category: 'instance creation',
  2527. fn: function () {
  2528. var self = this;
  2529. smalltalk.send(self, "_error_", ["You cannot create new instances of UndefinedObject. Use nil"]);
  2530. return self;
  2531. },
  2532. source: unescape('new%0A%09%20%20%20%20self%20error%3A%20%27You%20cannot%20create%20new%20instances%20of%20UndefinedObject.%20Use%20nil%27%0A')}),
  2533. smalltalk.UndefinedObject.klass);
  2534. smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel');
  2535. smalltalk.addMethod(
  2536. '_size',
  2537. smalltalk.method({
  2538. selector: 'size',
  2539. category: 'accessing',
  2540. fn: function () {
  2541. var self = this;
  2542. smalltalk.send(self, "_subclassResponsibility", []);
  2543. return self;
  2544. },
  2545. source: unescape('size%0A%09self%20subclassResponsibility%0A')}),
  2546. smalltalk.Collection);
  2547. smalltalk.addMethod(
  2548. '_at_',
  2549. smalltalk.method({
  2550. selector: 'at:',
  2551. category: 'accessing',
  2552. fn: function (anIndex) {
  2553. var self = this;
  2554. return smalltalk.send(self, "_at_ifAbsent_", [anIndex, function () {return smalltalk.send(self, "_errorNotFound", []);}]);
  2555. return self;
  2556. },
  2557. source: unescape('at%3A%20anIndex%0A%09%5Eself%20at%3A%20anIndex%20ifAbsent%3A%20%5B%0A%09%20%20%20%20self%20errorNotFound%5D%0A')}),
  2558. smalltalk.Collection);
  2559. smalltalk.addMethod(
  2560. '_at_put_',
  2561. smalltalk.method({
  2562. selector: 'at:put:',
  2563. category: 'accessing',
  2564. fn: function (anIndex, anObject) {
  2565. var self = this;
  2566. smalltalk.send(self, "_subclassResponsibility", []);
  2567. return self;
  2568. },
  2569. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09self%20subclassResponsibility%0A')}),
  2570. smalltalk.Collection);
  2571. smalltalk.addMethod(
  2572. '_at_ifAbsent_',
  2573. smalltalk.method({
  2574. selector: 'at:ifAbsent:',
  2575. category: 'accessing',
  2576. fn: function (anIndex, aBlock) {
  2577. var self = this;
  2578. smalltalk.send(self, "_subclassResponsibility", []);
  2579. return self;
  2580. },
  2581. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09self%20subclassResponsibility%0A')}),
  2582. smalltalk.Collection);
  2583. smalltalk.addMethod(
  2584. '_first',
  2585. smalltalk.method({
  2586. selector: 'first',
  2587. category: 'accessing',
  2588. fn: function () {
  2589. var self = this;
  2590. return smalltalk.send(self, "_at_", [1]);
  2591. return self;
  2592. },
  2593. source: unescape('first%0A%09%5Eself%20at%3A%201%0A')}),
  2594. smalltalk.Collection);
  2595. smalltalk.addMethod(
  2596. '_second',
  2597. smalltalk.method({
  2598. selector: 'second',
  2599. category: 'accessing',
  2600. fn: function () {
  2601. var self = this;
  2602. return smalltalk.send(self, "_at_", [2]);
  2603. return self;
  2604. },
  2605. source: unescape('second%0A%09%5Eself%20at%3A%202%0A')}),
  2606. smalltalk.Collection);
  2607. smalltalk.addMethod(
  2608. '_third',
  2609. smalltalk.method({
  2610. selector: 'third',
  2611. category: 'accessing',
  2612. fn: function () {
  2613. var self = this;
  2614. return smalltalk.send(self, "_at_", [3]);
  2615. return self;
  2616. },
  2617. source: unescape('third%0A%09%5Eself%20at%3A%203%0A')}),
  2618. smalltalk.Collection);
  2619. smalltalk.addMethod(
  2620. '_fourth',
  2621. smalltalk.method({
  2622. selector: 'fourth',
  2623. category: 'accessing',
  2624. fn: function () {
  2625. var self = this;
  2626. return smalltalk.send(self, "_at_", [4]);
  2627. return self;
  2628. },
  2629. source: unescape('fourth%0A%09%5Eself%20at%3A%204%0A')}),
  2630. smalltalk.Collection);
  2631. smalltalk.addMethod(
  2632. '_last',
  2633. smalltalk.method({
  2634. selector: 'last',
  2635. category: 'accessing',
  2636. fn: function () {
  2637. var self = this;
  2638. return smalltalk.send(self, "_at_", [smalltalk.send(self, "_size", [])]);
  2639. return self;
  2640. },
  2641. source: unescape('last%0A%09%5Eself%20at%3A%20self%20size%0A')}),
  2642. smalltalk.Collection);
  2643. smalltalk.addMethod(
  2644. '_readStream',
  2645. smalltalk.method({
  2646. selector: 'readStream',
  2647. category: 'accessing',
  2648. fn: function () {
  2649. var self = this;
  2650. return smalltalk.send(self, "_stream", []);
  2651. return self;
  2652. },
  2653. source: unescape('readStream%0A%09%5Eself%20stream%0A')}),
  2654. smalltalk.Collection);
  2655. smalltalk.addMethod(
  2656. '_writeStream',
  2657. smalltalk.method({
  2658. selector: 'writeStream',
  2659. category: 'accessing',
  2660. fn: function () {
  2661. var self = this;
  2662. return smalltalk.send(self, "_stream", []);
  2663. return self;
  2664. },
  2665. source: unescape('writeStream%0A%09%5Eself%20stream%0A')}),
  2666. smalltalk.Collection);
  2667. smalltalk.addMethod(
  2668. '_stream',
  2669. smalltalk.method({
  2670. selector: 'stream',
  2671. category: 'accessing',
  2672. fn: function () {
  2673. var self = this;
  2674. return smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [self]);
  2675. return self;
  2676. },
  2677. source: unescape('stream%0A%09%5Eself%20streamClass%20on%3A%20self%0A')}),
  2678. smalltalk.Collection);
  2679. smalltalk.addMethod(
  2680. '_streamClass',
  2681. smalltalk.method({
  2682. selector: 'streamClass',
  2683. category: 'accessing',
  2684. fn: function () {
  2685. var self = this;
  2686. return smalltalk.send(smalltalk.send(self, "_class", []), "_streamClass", []);
  2687. return self;
  2688. },
  2689. source: unescape('streamClass%0A%09%5Eself%20class%20streamClass%0A')}),
  2690. smalltalk.Collection);
  2691. smalltalk.addMethod(
  2692. '_add_',
  2693. smalltalk.method({
  2694. selector: 'add:',
  2695. category: 'adding/removing',
  2696. fn: function (anObject) {
  2697. var self = this;
  2698. smalltalk.send(self, "_subclassResponsibility", []);
  2699. return self;
  2700. },
  2701. source: unescape('add%3A%20anObject%0A%09self%20subclassResponsibility%0A')}),
  2702. smalltalk.Collection);
  2703. smalltalk.addMethod(
  2704. '_addAll_',
  2705. smalltalk.method({
  2706. selector: 'addAll:',
  2707. category: 'adding/removing',
  2708. fn: function (aCollection) {
  2709. var self = this;
  2710. smalltalk.send(aCollection, "_do_", [function (each) {return smalltalk.send(self, "_add_", [each]);}]);
  2711. return aCollection;
  2712. return self;
  2713. },
  2714. 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')}),
  2715. smalltalk.Collection);
  2716. smalltalk.addMethod(
  2717. '__comma',
  2718. smalltalk.method({
  2719. selector: ',',
  2720. category: 'copying',
  2721. fn: function (aCollection) {
  2722. var self = this;
  2723. return function ($rec) {smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_copy", []));
  2724. return self;
  2725. },
  2726. 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')}),
  2727. smalltalk.Collection);
  2728. smalltalk.addMethod(
  2729. '_copyFrom_to_',
  2730. smalltalk.method({
  2731. selector: 'copyFrom:to:',
  2732. category: 'copying',
  2733. fn: function (anIndex, anotherIndex) {
  2734. var self = this;
  2735. smalltalk.send(self, "_subclassResponsibility", []);
  2736. return self;
  2737. },
  2738. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09self%20subclassResponsibility%0A')}),
  2739. smalltalk.Collection);
  2740. smalltalk.addMethod(
  2741. '_copyWith_',
  2742. smalltalk.method({
  2743. selector: 'copyWith:',
  2744. category: 'copying',
  2745. fn: function (anObject) {
  2746. var self = this;
  2747. return function ($rec) {smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_copy", []));
  2748. return self;
  2749. },
  2750. source: unescape('copyWith%3A%20anObject%0A%09%5Eself%20copy%20add%3A%20anObject%3B%20yourself%0A')}),
  2751. smalltalk.Collection);
  2752. smalltalk.addMethod(
  2753. '_copyWithAll_',
  2754. smalltalk.method({
  2755. selector: 'copyWithAll:',
  2756. category: 'copying',
  2757. fn: function (aCollection) {
  2758. var self = this;
  2759. return function ($rec) {smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_copy", []));
  2760. return self;
  2761. },
  2762. source: unescape('copyWithAll%3A%20aCollection%0A%09%5Eself%20copy%20addAll%3A%20aCollection%3B%20yourself%0A')}),
  2763. smalltalk.Collection);
  2764. smalltalk.addMethod(
  2765. '_asArray',
  2766. smalltalk.method({
  2767. selector: 'asArray',
  2768. category: 'converting',
  2769. fn: function () {
  2770. var self = this;
  2771. var array = nil;
  2772. var index = nil;
  2773. array = smalltalk.send(smalltalk.Array, "_new", []);
  2774. index = 0;
  2775. smalltalk.send(self, "_do_", [function (each) {index = smalltalk.send(index, "__plus", [1]);return smalltalk.send(array, "_at_put_", [index, each]);}]);
  2776. return array;
  2777. return self;
  2778. },
  2779. 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')}),
  2780. smalltalk.Collection);
  2781. smalltalk.addMethod(
  2782. '_do_',
  2783. smalltalk.method({
  2784. selector: 'do:',
  2785. category: 'enumerating',
  2786. fn: function (aBlock) {
  2787. var self = this;
  2788. for (var i = 0; i < self.length; i++) {
  2789. aBlock(self[i]);
  2790. }
  2791. return self;
  2792. },
  2793. 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')}),
  2794. smalltalk.Collection);
  2795. smalltalk.addMethod(
  2796. '_collect_',
  2797. smalltalk.method({
  2798. selector: 'collect:',
  2799. category: 'enumerating',
  2800. fn: function (aBlock) {
  2801. var self = this;
  2802. var stream = nil;
  2803. stream = smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_new", []), "_writeStream", []);
  2804. smalltalk.send(self, "_do_", [function (each) {return smalltalk.send(stream, "_nextPut_", [smalltalk.send(aBlock, "_value_", [each])]);}]);
  2805. return smalltalk.send(stream, "_contents", []);
  2806. return self;
  2807. },
  2808. 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')}),
  2809. smalltalk.Collection);
  2810. smalltalk.addMethod(
  2811. '_detect_',
  2812. smalltalk.method({
  2813. selector: 'detect:',
  2814. category: 'enumerating',
  2815. fn: function (aBlock) {
  2816. var self = this;
  2817. return smalltalk.send(self, "_detect_ifNone_", [aBlock, function () {return smalltalk.send(self, "_errorNotFound", []);}]);
  2818. return self;
  2819. },
  2820. source: unescape('detect%3A%20aBlock%0A%09%5Eself%20detect%3A%20aBlock%20ifNone%3A%20%5Bself%20errorNotFound%5D%0A')}),
  2821. smalltalk.Collection);
  2822. smalltalk.addMethod(
  2823. '_detect_ifNone_',
  2824. smalltalk.method({
  2825. selector: 'detect:ifNone:',
  2826. category: 'enumerating',
  2827. fn: function (aBlock, anotherBlock) {
  2828. var self = this;
  2829. for (var i = 0; i < self.length; i++) {
  2830. if (aBlock(self[i])) {
  2831. return self[i];
  2832. }
  2833. }
  2834. return anotherBlock();
  2835. return self;
  2836. },
  2837. source: unescape('detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A%09%7B%27%0A%09%09for%28var%20i%20%3D%200%3B%20i%20%3C%20self.length%3B%20i++%29%0A%09%09%09if%28aBlock%28self%5Bi%5D%29%29%0A%09%09%09%09return%20self%5Bi%5D%3B%0A%09%09return%20anotherBlock%28%29%3B%0A%09%27%7D')}),
  2838. smalltalk.Collection);
  2839. smalltalk.addMethod(
  2840. '_do_separatedBy_',
  2841. smalltalk.method({
  2842. selector: 'do:separatedBy:',
  2843. category: 'enumerating',
  2844. fn: function (aBlock, anotherBlock) {
  2845. var self = this;
  2846. var first = nil;
  2847. first = true;
  2848. smalltalk.send(self, "_do_", [function (each) {smalltalk.send(first, "_ifTrue_ifFalse_", [function () {return first = false;}, function () {return smalltalk.send(anotherBlock, "_value", []);}]);return smalltalk.send(aBlock, "_value_", [each]);}]);
  2849. return self;
  2850. },
  2851. 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')}),
  2852. smalltalk.Collection);
  2853. smalltalk.addMethod(
  2854. '_inject_into_',
  2855. smalltalk.method({
  2856. selector: 'inject:into:',
  2857. category: 'enumerating',
  2858. fn: function (anObject, aBlock) {
  2859. var self = this;
  2860. var result = nil;
  2861. result = anObject;
  2862. smalltalk.send(self, "_do_", [function (each) {return result = smalltalk.send(aBlock, "_value_value_", [result, each]);}]);
  2863. return result;
  2864. return self;
  2865. },
  2866. 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')}),
  2867. smalltalk.Collection);
  2868. smalltalk.addMethod(
  2869. '_reject_',
  2870. smalltalk.method({
  2871. selector: 'reject:',
  2872. category: 'enumerating',
  2873. fn: function (aBlock) {
  2874. var self = this;
  2875. return smalltalk.send(self, "_select_", [function (each) {return smalltalk.send(smalltalk.send(aBlock, "_value_", [each]), "__eq", [false]);}]);
  2876. return self;
  2877. },
  2878. 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')}),
  2879. smalltalk.Collection);
  2880. smalltalk.addMethod(
  2881. '_select_',
  2882. smalltalk.method({
  2883. selector: 'select:',
  2884. category: 'enumerating',
  2885. fn: function (aBlock) {
  2886. var self = this;
  2887. var stream = nil;
  2888. stream = smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_new", []), "_writeStream", []);
  2889. smalltalk.send(self, "_do_", [function (each) {return smalltalk.send(smalltalk.send(aBlock, "_value_", [each]), "_ifTrue_", [function () {return smalltalk.send(stream, "_nextPut_", [each]);}]);}]);
  2890. return smalltalk.send(stream, "_contents", []);
  2891. return self;
  2892. },
  2893. 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')}),
  2894. smalltalk.Collection);
  2895. smalltalk.addMethod(
  2896. '_errorNotFound',
  2897. smalltalk.method({
  2898. selector: 'errorNotFound',
  2899. category: 'error handling',
  2900. fn: function () {
  2901. var self = this;
  2902. smalltalk.send(self, "_error_", ["Object is not in the collection"]);
  2903. return self;
  2904. },
  2905. source: unescape('errorNotFound%0A%09self%20error%3A%20%27Object%20is%20not%20in%20the%20collection%27%0A')}),
  2906. smalltalk.Collection);
  2907. smalltalk.addMethod(
  2908. '_includes_',
  2909. smalltalk.method({
  2910. selector: 'includes:',
  2911. category: 'testing',
  2912. fn: function (anObject) {
  2913. var self = this;
  2914. var i = self.length;
  2915. while (i--) {
  2916. if (self[i].__eq(anObject)) {
  2917. return true;
  2918. }
  2919. }
  2920. return false;
  2921. return self;
  2922. },
  2923. source: unescape('includes%3A%20anObject%0A%09%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%7Breturn%20true%3B%7D%09%0A%09%09%7D%0A%09%09return%20false%0A%09%27%7D%0A')}),
  2924. smalltalk.Collection);
  2925. smalltalk.addMethod(
  2926. '_notEmpty',
  2927. smalltalk.method({
  2928. selector: 'notEmpty',
  2929. category: 'testing',
  2930. fn: function () {
  2931. var self = this;
  2932. return smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_not", []);
  2933. return self;
  2934. },
  2935. source: unescape('notEmpty%0A%09%5Eself%20isEmpty%20not%0A')}),
  2936. smalltalk.Collection);
  2937. smalltalk.addMethod(
  2938. '_isEmpty',
  2939. smalltalk.method({
  2940. selector: 'isEmpty',
  2941. category: 'testing',
  2942. fn: function () {
  2943. var self = this;
  2944. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [0]);
  2945. return self;
  2946. },
  2947. source: unescape('isEmpty%0A%09%5Eself%20size%20%3D%200%0A')}),
  2948. smalltalk.Collection);
  2949. smalltalk.addMethod(
  2950. '_remove_',
  2951. smalltalk.method({
  2952. selector: 'remove:',
  2953. category: 'adding/removing',
  2954. fn: function (anObject) {
  2955. var self = this;
  2956. smalltalk.send(self, "_subclassResponsibility", []);
  2957. return self;
  2958. },
  2959. source: unescape('remove%3A%20anObject%0A%20%20%20%20self%20subclassResponsibility%0A')}),
  2960. smalltalk.Collection);
  2961. smalltalk.addMethod(
  2962. '_removeLast',
  2963. smalltalk.method({
  2964. selector: 'removeLast',
  2965. category: 'adding/removing',
  2966. fn: function () {
  2967. var self = this;
  2968. smalltalk.send(self, "_remove_", [smalltalk.send(self, "_last", [])]);
  2969. return self;
  2970. },
  2971. source: unescape('removeLast%0A%09self%20remove%3A%20self%20last')}),
  2972. smalltalk.Collection);
  2973. smalltalk.addMethod(
  2974. '_inspectOn_',
  2975. smalltalk.method({
  2976. selector: 'inspectOn:',
  2977. category: '*IDE',
  2978. fn: function (anInspector) {
  2979. var self = this;
  2980. var variables = nil;
  2981. variables = smalltalk.send(smalltalk.Dictionary, "_new", []);
  2982. smalltalk.send(variables, "_at_put_", [unescape("%23self"), self]);
  2983. smalltalk.send(self, "_withIndexDo_", [function (each, i) {return smalltalk.send(variables, "_at_put_", [i, each]);}]);
  2984. (function ($rec) {smalltalk.send($rec, "_setLabel_", [smalltalk.send(self, "_printString", [])]);return smalltalk.send($rec, "_setVariables_", [variables]);}(anInspector));
  2985. return self;
  2986. },
  2987. 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%20withIndexDo%3A%20%5B%3Aeach%20%3Ai%20%7C%0A%09%09variables%20at%3A%20i%20put%3A%20each%5D.%0A%09anInspector%20%0A%09%09setLabel%3A%20self%20printString%3B%0A%09%09setVariables%3A%20variables')}),
  2988. smalltalk.Collection);
  2989. smalltalk.addMethod(
  2990. '_withIndexDo_',
  2991. smalltalk.method({
  2992. selector: 'withIndexDo:',
  2993. category: 'enumerating',
  2994. fn: function (aBlock) {
  2995. var self = this;
  2996. for (var i = 0; i < self.length; i++) {
  2997. aBlock(self[i], i + 1);
  2998. }
  2999. return self;
  3000. },
  3001. source: unescape('withIndexDo%3A%20aBlock%0A%09%7B%27for%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%7BaBlock%28self%5Bi%5D%2C%20i+1%29%3B%7D%27%7D%0A')}),
  3002. smalltalk.Collection);
  3003. smalltalk.addMethod(
  3004. '_streamClass',
  3005. smalltalk.method({
  3006. selector: 'streamClass',
  3007. category: 'accessing',
  3008. fn: function () {
  3009. var self = this;
  3010. return smalltalk.Stream;
  3011. return self;
  3012. },
  3013. source: unescape('streamClass%0A%09%20%20%20%20%5EStream%0A')}),
  3014. smalltalk.Collection.klass);
  3015. smalltalk.addMethod(
  3016. '_with_',
  3017. smalltalk.method({
  3018. selector: 'with:',
  3019. category: 'instance creation',
  3020. fn: function (anObject) {
  3021. var self = this;
  3022. return function ($rec) {smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_new", []));
  3023. return self;
  3024. },
  3025. source: unescape('with%3A%20anObject%0A%09%20%20%20%20%5Eself%20new%0A%09%09add%3A%20anObject%3B%0A%09%09yourself%0A')}),
  3026. smalltalk.Collection.klass);
  3027. smalltalk.addMethod(
  3028. '_with_with_',
  3029. smalltalk.method({
  3030. selector: 'with:with:',
  3031. category: 'instance creation',
  3032. fn: function (anObject, anotherObject) {
  3033. var self = this;
  3034. return function ($rec) {smalltalk.send($rec, "_add_", [anObject]);smalltalk.send($rec, "_add_", [anotherObject]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_new", []));
  3035. return self;
  3036. },
  3037. 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')}),
  3038. smalltalk.Collection.klass);
  3039. smalltalk.addMethod(
  3040. '_with_with_with_',
  3041. smalltalk.method({
  3042. selector: 'with:with:with:',
  3043. category: 'instance creation',
  3044. fn: function (firstObject, secondObject, thirdObject) {
  3045. var self = this;
  3046. return function ($rec) {smalltalk.send($rec, "_add_", [firstObject]);smalltalk.send($rec, "_add_", [secondObject]);smalltalk.send($rec, "_add_", [thirdObject]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_new", []));
  3047. return self;
  3048. },
  3049. 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')}),
  3050. smalltalk.Collection.klass);
  3051. smalltalk.addMethod(
  3052. '_withAll_',
  3053. smalltalk.method({
  3054. selector: 'withAll:',
  3055. category: 'instance creation',
  3056. fn: function (aCollection) {
  3057. var self = this;
  3058. return function ($rec) {smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_new", []));
  3059. return self;
  3060. },
  3061. source: unescape('withAll%3A%20aCollection%0A%09%20%20%20%20%5Eself%20new%0A%09%09addAll%3A%20aCollection%3B%0A%09%09yourself%0A')}),
  3062. smalltalk.Collection.klass);
  3063. smalltalk.addClass('String', smalltalk.Collection, [], 'Kernel');
  3064. smalltalk.addMethod(
  3065. '__eq',
  3066. smalltalk.method({
  3067. selector: '=',
  3068. category: 'comparing',
  3069. fn: function (aString) {
  3070. var self = this;
  3071. return String(self) == aString;
  3072. return self;
  3073. },
  3074. source: unescape('%3D%20aString%0A%09%7B%27return%20String%28self%29%20%3D%3D%20aString%27%7D')}),
  3075. smalltalk.String);
  3076. smalltalk.addMethod(
  3077. '_size',
  3078. smalltalk.method({
  3079. selector: 'size',
  3080. category: 'accessing',
  3081. fn: function () {
  3082. var self = this;
  3083. return self.length;
  3084. return self;
  3085. },
  3086. source: unescape('size%0A%09%7B%27return%20self.length%27%7D%0A')}),
  3087. smalltalk.String);
  3088. smalltalk.addMethod(
  3089. '_at_',
  3090. smalltalk.method({
  3091. selector: 'at:',
  3092. category: 'accessing',
  3093. fn: function (anIndex) {
  3094. var self = this;
  3095. return self[anIndex - 1] || nil;
  3096. return self;
  3097. },
  3098. source: unescape('at%3A%20anIndex%0A%09%7B%27return%20self%5BanIndex%20-%201%5D%20%7C%7C%20nil%3B%27%7D')}),
  3099. smalltalk.String);
  3100. smalltalk.addMethod(
  3101. '_at_put_',
  3102. smalltalk.method({
  3103. selector: 'at:put:',
  3104. category: 'accessing',
  3105. fn: function (anIndex, anObject) {
  3106. var self = this;
  3107. smalltalk.send(self, "_errorReadOnly", []);
  3108. return self;
  3109. },
  3110. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%20%20%20%20%09self%20errorReadOnly%0A')}),
  3111. smalltalk.String);
  3112. smalltalk.addMethod(
  3113. '_at_ifAbsent_',
  3114. smalltalk.method({
  3115. selector: 'at:ifAbsent:',
  3116. category: 'accessing',
  3117. fn: function (anIndex, aBlock) {
  3118. var self = this;
  3119. smalltalk.send(smalltalk.send(self, "_at_", [anIndex]), "_ifNil_", [function () {return aBlock;}]);
  3120. return self;
  3121. },
  3122. 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')}),
  3123. smalltalk.String);
  3124. smalltalk.addMethod(
  3125. '_escaped',
  3126. smalltalk.method({
  3127. selector: 'escaped',
  3128. category: 'accessing',
  3129. fn: function () {
  3130. var self = this;
  3131. return escape(self);
  3132. return self;
  3133. },
  3134. source: unescape('escaped%0A%09%7B%27return%20escape%28self%29%27%7D%0A')}),
  3135. smalltalk.String);
  3136. smalltalk.addMethod(
  3137. '_unescaped',
  3138. smalltalk.method({
  3139. selector: 'unescaped',
  3140. category: 'accessing',
  3141. fn: function () {
  3142. var self = this;
  3143. return unescape(self);
  3144. return self;
  3145. },
  3146. source: unescape('unescaped%0A%09%7B%27return%20unescape%28self%29%27%7D')}),
  3147. smalltalk.String);
  3148. smalltalk.addMethod(
  3149. '_add_',
  3150. smalltalk.method({
  3151. selector: 'add:',
  3152. category: 'adding',
  3153. fn: function (anObject) {
  3154. var self = this;
  3155. smalltalk.send(self, "_errorReadOnly", []);
  3156. return self;
  3157. },
  3158. source: unescape('add%3A%20anObject%0A%20%20%20%20%09self%20errorReadOnly%0A')}),
  3159. smalltalk.String);
  3160. smalltalk.addMethod(
  3161. '__comma',
  3162. smalltalk.method({
  3163. selector: ',',
  3164. category: 'copying',
  3165. fn: function (aString) {
  3166. var self = this;
  3167. return self + aString;
  3168. return self;
  3169. },
  3170. source: unescape('%2C%20aString%0A%09%7B%27return%20self%20+%20aString%27%7D')}),
  3171. smalltalk.String);
  3172. smalltalk.addMethod(
  3173. '_copyFrom_to_',
  3174. smalltalk.method({
  3175. selector: 'copyFrom:to:',
  3176. category: 'copying',
  3177. fn: function (anIndex, anotherIndex) {
  3178. var self = this;
  3179. return self.substring(anIndex - 1, anotherIndex);
  3180. return self;
  3181. },
  3182. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09%7B%27return%20self.substring%28anIndex%20-%201%2C%20anotherIndex%29%3B%27%7D%0A')}),
  3183. smalltalk.String);
  3184. smalltalk.addMethod(
  3185. '_shallowCopy',
  3186. smalltalk.method({
  3187. selector: 'shallowCopy',
  3188. category: 'copying',
  3189. fn: function () {
  3190. var self = this;
  3191. return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [self]);
  3192. return self;
  3193. },
  3194. source: unescape('shallowCopy%0A%20%20%20%20%09%5Eself%20class%20fromString%3A%20self%0A')}),
  3195. smalltalk.String);
  3196. smalltalk.addMethod(
  3197. '_deepCopy',
  3198. smalltalk.method({
  3199. selector: 'deepCopy',
  3200. category: 'copying',
  3201. fn: function () {
  3202. var self = this;
  3203. return smalltalk.send(self, "_shallowCopy", []);
  3204. return self;
  3205. },
  3206. source: unescape('deepCopy%0A%20%20%20%20%09%5Eself%20shallowCopy%0A')}),
  3207. smalltalk.String);
  3208. smalltalk.addMethod(
  3209. '_asSelector',
  3210. smalltalk.method({
  3211. selector: 'asSelector',
  3212. category: 'converting',
  3213. fn: function () {
  3214. var self = this;
  3215. var selector = nil;
  3216. selector = smalltalk.send("_", "__comma", [self]);
  3217. selector = smalltalk.send(selector, "_replace_with_", [":", "_"]);
  3218. selector = smalltalk.send(selector, "_replace_with_", [unescape("%5B+%5D"), "_plus"]);
  3219. selector = smalltalk.send(selector, "_replace_with_", [unescape("-"), "_minus"]);
  3220. selector = smalltalk.send(selector, "_replace_with_", [unescape("%5B*%5D"), "_star"]);
  3221. selector = smalltalk.send(selector, "_replace_with_", [unescape("%5B/%5D"), "_slash"]);
  3222. selector = smalltalk.send(selector, "_replace_with_", [unescape("%3E"), "_gt"]);
  3223. selector = smalltalk.send(selector, "_replace_with_", [unescape("%3C"), "_lt"]);
  3224. selector = smalltalk.send(selector, "_replace_with_", [unescape("%3D"), "_eq"]);
  3225. selector = smalltalk.send(selector, "_replace_with_", [unescape("%2C"), "_comma"]);
  3226. selector = smalltalk.send(selector, "_replace_with_", [unescape("%5B@%5D"), "_at"]);
  3227. return selector;
  3228. return self;
  3229. },
  3230. source: unescape('asSelector%0A%09%22If%20you%20change%20this%20method%2C%20change%20smalltalk.convertSelector%20too%20%28see%20js/boot.js%20file%29%22%0A%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')}),
  3231. smalltalk.String);
  3232. smalltalk.addMethod(
  3233. '_asJavascript',
  3234. smalltalk.method({
  3235. selector: 'asJavascript',
  3236. category: 'converting',
  3237. fn: function () {
  3238. var self = this;
  3239. if (self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1) {
  3240. return "unescape(\"" + escape(self) + "\")";
  3241. } else {
  3242. return "\"" + self + "\"";
  3243. }
  3244. return self;
  3245. },
  3246. source: unescape('asJavascript%0A%09%7B%27%0A%09%09if%28self.search%28/%5E%5Ba-zA-Z0-9_%3A.%24%20%5D*%24/%29%20%3D%3D%20-1%29%0A%09%09%09return%20%22unescape%28%5C%22%22%20+%20escape%28self%29%20+%20%22%5C%22%29%22%3B%0A%09%09else%0A%09%09%09return%20%22%5C%22%22%20+%20self%20+%20%22%5C%22%22%3B%0A%09%27%7D')}),
  3247. smalltalk.String);
  3248. smalltalk.addMethod(
  3249. '_replace_with_',
  3250. smalltalk.method({
  3251. selector: 'replace:with:',
  3252. category: 'regular expressions',
  3253. fn: function (aString, anotherString) {
  3254. var self = this;
  3255. return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send(smalltalk.RegularExpression, "_fromString_flag_", [aString, "g"]), anotherString]);
  3256. return self;
  3257. },
  3258. 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')}),
  3259. smalltalk.String);
  3260. smalltalk.addMethod(
  3261. '_replaceRegexp_with_',
  3262. smalltalk.method({
  3263. selector: 'replaceRegexp:with:',
  3264. category: 'regular expressions',
  3265. fn: function (aRegexp, aString) {
  3266. var self = this;
  3267. return self.replace(aRegexp, aString);
  3268. return self;
  3269. },
  3270. source: unescape('replaceRegexp%3A%20aRegexp%20with%3A%20aString%0A%09%7B%27return%20self.replace%28aRegexp%2C%20aString%29%3B%27%7D%0A')}),
  3271. smalltalk.String);
  3272. smalltalk.addMethod(
  3273. '_tokenize_',
  3274. smalltalk.method({
  3275. selector: 'tokenize:',
  3276. category: 'converting',
  3277. fn: function (aString) {
  3278. var self = this;
  3279. return self.split(aString);
  3280. return self;
  3281. },
  3282. source: unescape('tokenize%3A%20aString%0A%09%7B%27return%20self.split%28aString%29%27%7D')}),
  3283. smalltalk.String);
  3284. smalltalk.addMethod(
  3285. '_match_',
  3286. smalltalk.method({
  3287. selector: 'match:',
  3288. category: 'regular expressions',
  3289. fn: function (aRegexp) {
  3290. var self = this;
  3291. return self.search(aRegexp) != -1;
  3292. return self;
  3293. },
  3294. source: unescape('match%3A%20aRegexp%0A%09%7B%27return%20self.search%28aRegexp%29%20%21%3D%20-1%27%7D%0A')}),
  3295. smalltalk.String);
  3296. smalltalk.addMethod(
  3297. '_asString',
  3298. smalltalk.method({
  3299. selector: 'asString',
  3300. category: 'converting',
  3301. fn: function () {
  3302. var self = this;
  3303. return self;
  3304. return self;
  3305. },
  3306. source: unescape('asString%0A%20%20%20%20%09%5Eself%0A')}),
  3307. smalltalk.String);
  3308. smalltalk.addMethod(
  3309. '_asNumber',
  3310. smalltalk.method({
  3311. selector: 'asNumber',
  3312. category: 'converting',
  3313. fn: function () {
  3314. var self = this;
  3315. return Number(self);
  3316. return self;
  3317. },
  3318. source: unescape('asNumber%0A%09%7B%27return%20Number%28self%29%3B%27%7D')}),
  3319. smalltalk.String);
  3320. smalltalk.addMethod(
  3321. '_asParser',
  3322. smalltalk.method({
  3323. selector: 'asParser',
  3324. category: 'converting',
  3325. fn: function () {
  3326. var self = this;
  3327. return smalltalk.send(smalltalk.send(smalltalk.PPStringParser, "_new", []), "_string_", [self]);
  3328. return self;
  3329. },
  3330. source: unescape('asParser%0A%20%20%20%20%09%5EPPStringParser%20new%20string%3A%20self%0A')}),
  3331. smalltalk.String);
  3332. smalltalk.addMethod(
  3333. '_asChoiceParser',
  3334. smalltalk.method({
  3335. selector: 'asChoiceParser',
  3336. category: 'converting',
  3337. fn: function () {
  3338. var self = this;
  3339. return smalltalk.send(smalltalk.PPChoiceParser, "_withAll_", [smalltalk.send(smalltalk.send(self, "_asArray", []), "_collect_", [function (each) {return smalltalk.send(each, "_asParser", []);}])]);
  3340. return self;
  3341. },
  3342. 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')}),
  3343. smalltalk.String);
  3344. smalltalk.addMethod(
  3345. '_asCharacterParser',
  3346. smalltalk.method({
  3347. selector: 'asCharacterParser',
  3348. category: 'converting',
  3349. fn: function () {
  3350. var self = this;
  3351. return smalltalk.send(smalltalk.send(smalltalk.PPCharacterParser, "_new", []), "_string_", [self]);
  3352. return self;
  3353. },
  3354. source: unescape('asCharacterParser%0A%20%20%20%20%09%5EPPCharacterParser%20new%20string%3A%20self%0A')}),
  3355. smalltalk.String);
  3356. smalltalk.addMethod(
  3357. '_errorReadOnly',
  3358. smalltalk.method({
  3359. selector: 'errorReadOnly',
  3360. category: 'error handling',
  3361. fn: function () {
  3362. var self = this;
  3363. smalltalk.send(self, "_error_", [unescape("Object%20is%20read-only")]);
  3364. return self;
  3365. },
  3366. source: unescape('errorReadOnly%0A%20%20%20%20%09self%20error%3A%20%27Object%20is%20read-only%27%0A')}),
  3367. smalltalk.String);
  3368. smalltalk.addMethod(
  3369. '_printString',
  3370. smalltalk.method({
  3371. selector: 'printString',
  3372. category: 'printing',
  3373. fn: function () {
  3374. var self = this;
  3375. return smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [self]), "__comma", [unescape("%27")]);
  3376. return self;
  3377. },
  3378. source: unescape('printString%0A%20%20%20%20%09%5E%27%27%27%27%2C%20self%2C%20%27%27%27%27%0A')}),
  3379. smalltalk.String);
  3380. smalltalk.addMethod(
  3381. '_printNl',
  3382. smalltalk.method({
  3383. selector: 'printNl',
  3384. category: 'printing',
  3385. fn: function () {
  3386. var self = this;
  3387. console.log(self);
  3388. return self;
  3389. },
  3390. source: unescape('printNl%0A%09%7B%27console.log%28self%29%27%7D%0A')}),
  3391. smalltalk.String);
  3392. smalltalk.addMethod(
  3393. '_isString',
  3394. smalltalk.method({
  3395. selector: 'isString',
  3396. category: 'testing',
  3397. fn: function () {
  3398. var self = this;
  3399. return true;
  3400. return self;
  3401. },
  3402. source: unescape('isString%0A%20%20%20%20%09%5Etrue%0A')}),
  3403. smalltalk.String);
  3404. smalltalk.addMethod(
  3405. '_asJQuery',
  3406. smalltalk.method({
  3407. selector: 'asJQuery',
  3408. category: '*JQuery',
  3409. fn: function () {
  3410. var self = this;
  3411. return smalltalk.send(smalltalk.JQuery, "_fromString_", [self]);
  3412. return self;
  3413. },
  3414. source: unescape('asJQuery%0A%20%20%20%20%5EJQuery%20fromString%3A%20self%0A')}),
  3415. smalltalk.String);
  3416. smalltalk.addMethod(
  3417. '_appendToJQuery_',
  3418. smalltalk.method({
  3419. selector: 'appendToJQuery:',
  3420. category: '*JQuery',
  3421. fn: function (aJQuery) {
  3422. var self = this;
  3423. aJQuery._appendElement_(String(self));
  3424. return self;
  3425. },
  3426. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20%7B%27aJQuery._appendElement_%28String%28self%29%29%27%7D%0A')}),
  3427. smalltalk.String);
  3428. smalltalk.addMethod(
  3429. '_appendToBrush_',
  3430. smalltalk.method({
  3431. selector: 'appendToBrush:',
  3432. category: '*Canvas',
  3433. fn: function (aTagBrush) {
  3434. var self = this;
  3435. smalltalk.send(aTagBrush, "_appendString_", [self]);
  3436. return self;
  3437. },
  3438. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20aTagBrush%20appendString%3A%20self%0A')}),
  3439. smalltalk.String);
  3440. smalltalk.addMethod(
  3441. '__gt',
  3442. smalltalk.method({
  3443. selector: '>',
  3444. category: 'comparing',
  3445. fn: function (aString) {
  3446. var self = this;
  3447. return String(self) > aString;
  3448. return self;
  3449. },
  3450. source: unescape('%3E%20aString%0A%09%7B%27return%20String%28self%29%20%3E%20aString%27%7D%0A')}),
  3451. smalltalk.String);
  3452. smalltalk.addMethod(
  3453. '__lt',
  3454. smalltalk.method({
  3455. selector: '<',
  3456. category: 'comparing',
  3457. fn: function (aString) {
  3458. var self = this;
  3459. return String(self) < aString;
  3460. return self;
  3461. },
  3462. source: unescape('%3C%20aString%0A%09%7B%27return%20String%28self%29%20%3C%20aString%27%7D%0A')}),
  3463. smalltalk.String);
  3464. smalltalk.addMethod(
  3465. '__gt_eq',
  3466. smalltalk.method({
  3467. selector: '>=',
  3468. category: 'comparing',
  3469. fn: function (aString) {
  3470. var self = this;
  3471. return String(self) >= aString;
  3472. return self;
  3473. },
  3474. source: unescape('%3E%3D%20aString%0A%09%7B%27return%20String%28self%29%20%3E%3D%20aString%27%7D%0A')}),
  3475. smalltalk.String);
  3476. smalltalk.addMethod(
  3477. '__lt_eq',
  3478. smalltalk.method({
  3479. selector: '<=',
  3480. category: 'comparing',
  3481. fn: function (aString) {
  3482. var self = this;
  3483. return String(self) <= aString;
  3484. return self;
  3485. },
  3486. source: unescape('%3C%3D%20aString%0A%09%7B%27return%20String%28self%29%20%3C%3D%20aString%27%7D')}),
  3487. smalltalk.String);
  3488. smalltalk.addMethod(
  3489. '_remove_',
  3490. smalltalk.method({
  3491. selector: 'remove:',
  3492. category: 'adding',
  3493. fn: function (anObject) {
  3494. var self = this;
  3495. smalltalk.send(self, "_errorReadOnly", []);
  3496. return self;
  3497. },
  3498. source: unescape('remove%3A%20anObject%0A%20%20%20%20self%20errorReadOnly%0A')}),
  3499. smalltalk.String);
  3500. smalltalk.addMethod(
  3501. '_inspectOn_',
  3502. smalltalk.method({
  3503. selector: 'inspectOn:',
  3504. category: '*IDE',
  3505. fn: function (anInspector) {
  3506. var self = this;
  3507. var label = nil;
  3508. self.klass.superclass.fn.prototype._inspectOn_.apply(self, [anInspector]);
  3509. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_printString", []), "_size", []), "__gt", [30]), "_ifTrue_ifFalse_", [function () {return label = smalltalk.send(smalltalk.send(smalltalk.send(self, "_printString", []), "_copyFrom_to_", [1, 30]), "__comma", [unescape("...%27")]);}, function () {return label = smalltalk.send(self, "_printString", []);}]);
  3510. smalltalk.send(anInspector, "_setLabel_", [label]);
  3511. return self;
  3512. },
  3513. source: unescape('inspectOn%3A%20anInspector%0A%09%7C%20label%20%7C%0A%09super%20inspectOn%3A%20anInspector.%0A%09self%20printString%20size%20%3E%2030%20%0A%09%09ifTrue%3A%20%5Blabel%20%3A%3D%20%28self%20printString%20copyFrom%3A%201%20to%3A%2030%29%2C%20%27...%27%27%27%5D%0A%09%09ifFalse%3A%20%5Blabel%20%3A%3D%20self%20printString%5D.%20%0A%09anInspector%20setLabel%3A%20label')}),
  3514. smalltalk.String);
  3515. smalltalk.addMethod(
  3516. '_streamClass',
  3517. smalltalk.method({
  3518. selector: 'streamClass',
  3519. category: 'accessing',
  3520. fn: function () {
  3521. var self = this;
  3522. return smalltalk.StringStream;
  3523. return self;
  3524. },
  3525. source: unescape('streamClass%0A%09%20%20%20%20%5EStringStream%0A')}),
  3526. smalltalk.String.klass);
  3527. smalltalk.addMethod(
  3528. '_fromString_',
  3529. smalltalk.method({
  3530. selector: 'fromString:',
  3531. category: 'instance creation',
  3532. fn: function (aString) {
  3533. var self = this;
  3534. return new self.fn(aString);
  3535. return self;
  3536. },
  3537. source: unescape('fromString%3A%20aString%0A%09%20%20%20%20%7B%27return%20new%20self.fn%28aString%29%3B%27%7D%0A')}),
  3538. smalltalk.String.klass);
  3539. smalltalk.addMethod(
  3540. '_cr',
  3541. smalltalk.method({
  3542. selector: 'cr',
  3543. category: 'accessing',
  3544. fn: function () {
  3545. var self = this;
  3546. return "\n";
  3547. return self;
  3548. },
  3549. source: unescape('cr%0A%09%7B%27return%20%27%27%5Cn%27%27%3B%27%7D')}),
  3550. smalltalk.String.klass);
  3551. smalltalk.addMethod(
  3552. '_lf',
  3553. smalltalk.method({
  3554. selector: 'lf',
  3555. category: 'accessing',
  3556. fn: function () {
  3557. var self = this;
  3558. return "\r";
  3559. return self;
  3560. },
  3561. source: unescape('lf%0A%09%7B%27return%20%27%27%5Cr%27%27%3B%27%7D%0A')}),
  3562. smalltalk.String.klass);
  3563. smalltalk.addMethod(
  3564. '_space',
  3565. smalltalk.method({
  3566. selector: 'space',
  3567. category: 'accessing',
  3568. fn: function () {
  3569. var self = this;
  3570. return " ";
  3571. return self;
  3572. },
  3573. source: unescape('space%0A%09%7B%27return%20%27%27%20%27%27%3B%27%7D%0A')}),
  3574. smalltalk.String.klass);
  3575. smalltalk.addMethod(
  3576. '_tab',
  3577. smalltalk.method({
  3578. selector: 'tab',
  3579. category: 'accessing',
  3580. fn: function () {
  3581. var self = this;
  3582. return "\t";
  3583. return self;
  3584. },
  3585. source: unescape('tab%0A%09%7B%27return%20%27%27%5Ct%27%27%3B%27%7D')}),
  3586. smalltalk.String.klass);
  3587. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel');
  3588. smalltalk.addMethod(
  3589. '_compile_',
  3590. smalltalk.method({
  3591. selector: 'compile:',
  3592. category: 'evaluating',
  3593. fn: function (aString) {
  3594. var self = this;
  3595. return self.compile(aString);
  3596. return self;
  3597. },
  3598. source: unescape('compile%3A%20aString%0A%09%7B%27return%20self.compile%28aString%29%3B%27%7D')}),
  3599. smalltalk.RegularExpression);
  3600. smalltalk.addMethod(
  3601. '_exec_',
  3602. smalltalk.method({
  3603. selector: 'exec:',
  3604. category: 'evaluating',
  3605. fn: function (aString) {
  3606. var self = this;
  3607. return self.exec(aString);
  3608. return self;
  3609. },
  3610. source: unescape('exec%3A%20aString%0A%09%7B%27return%20self.exec%28aString%29%3B%27%7D')}),
  3611. smalltalk.RegularExpression);
  3612. smalltalk.addMethod(
  3613. '_test_',
  3614. smalltalk.method({
  3615. selector: 'test:',
  3616. category: 'evaluating',
  3617. fn: function (aString) {
  3618. var self = this;
  3619. return self.test(aString);
  3620. return self;
  3621. },
  3622. source: unescape('test%3A%20aString%0A%09%7B%27return%20self.test%28aString%29%3B%27%7D')}),
  3623. smalltalk.RegularExpression);
  3624. smalltalk.addMethod(
  3625. '_fromString_flag_',
  3626. smalltalk.method({
  3627. selector: 'fromString:flag:',
  3628. category: 'instance creation',
  3629. fn: function (aString, anotherString) {
  3630. var self = this;
  3631. return new RegExp(aString, anotherString);
  3632. return self;
  3633. },
  3634. source: unescape('fromString%3A%20aString%20flag%3A%20anotherString%0A%09%7B%27return%20new%20RegExp%28aString%2C%20anotherString%29%3B%27%7D%0A')}),
  3635. smalltalk.RegularExpression.klass);
  3636. smalltalk.addMethod(
  3637. '_fromString_',
  3638. smalltalk.method({
  3639. selector: 'fromString:',
  3640. category: 'instance creation',
  3641. fn: function (aString) {
  3642. var self = this;
  3643. return smalltalk.send(self, "_fromString_flag_", [aString, ""]);
  3644. return self;
  3645. },
  3646. source: unescape('fromString%3A%20aString%0A%09%20%20%20%20%5Eself%20fromString%3A%20aString%20flag%3A%20%27%27%0A')}),
  3647. smalltalk.RegularExpression.klass);
  3648. smalltalk.addClass('Array', smalltalk.Collection, [], 'Kernel');
  3649. smalltalk.addMethod(
  3650. '_size',
  3651. smalltalk.method({
  3652. selector: 'size',
  3653. category: 'accessing',
  3654. fn: function () {
  3655. var self = this;
  3656. return self.length;
  3657. return self;
  3658. },
  3659. source: unescape('size%0A%09%7B%27return%20self.length%27%7D')}),
  3660. smalltalk.Array);
  3661. smalltalk.addMethod(
  3662. '_at_put_',
  3663. smalltalk.method({
  3664. selector: 'at:put:',
  3665. category: 'accessing',
  3666. fn: function (anIndex, anObject) {
  3667. var self = this;
  3668. return self[anIndex - 1] = anObject;
  3669. return self;
  3670. },
  3671. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09%7B%27return%20self%5BanIndex%20-%201%5D%20%3D%20anObject%27%7D%0A')}),
  3672. smalltalk.Array);
  3673. smalltalk.addMethod(
  3674. '_at_ifAbsent_',
  3675. smalltalk.method({
  3676. selector: 'at:ifAbsent:',
  3677. category: 'accessing',
  3678. fn: function (anIndex, aBlock) {
  3679. var self = this;
  3680. var value = self[anIndex - 1];
  3681. if (value === undefined) {
  3682. return aBlock();
  3683. } else {
  3684. return value;
  3685. }
  3686. return self;
  3687. },
  3688. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09%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')}),
  3689. smalltalk.Array);
  3690. smalltalk.addMethod(
  3691. '_add_',
  3692. smalltalk.method({
  3693. selector: 'add:',
  3694. category: 'adding',
  3695. fn: function (anObject) {
  3696. var self = this;
  3697. self.push(anObject);
  3698. return anObject;
  3699. return self;
  3700. },
  3701. source: unescape('add%3A%20anObject%0A%09%7B%27self.push%28anObject%29%3B%20return%20anObject%3B%27%7D%0A')}),
  3702. smalltalk.Array);
  3703. smalltalk.addMethod(
  3704. '_addLast_',
  3705. smalltalk.method({
  3706. selector: 'addLast:',
  3707. category: 'adding',
  3708. fn: function (anObject) {
  3709. var self = this;
  3710. return smalltalk.send(self, "_add_", [anObject]);
  3711. return self;
  3712. },
  3713. source: unescape('addLast%3A%20anObject%0A%09%5Eself%20add%3A%20anObject%0A')}),
  3714. smalltalk.Array);
  3715. smalltalk.addMethod(
  3716. '_shallowCopy',
  3717. smalltalk.method({
  3718. selector: 'shallowCopy',
  3719. category: 'copying',
  3720. fn: function () {
  3721. var self = this;
  3722. var newCollection = nil;
  3723. newCollection = smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3724. smalltalk.send(self, "_do_", [function (each) {return smalltalk.send(newCollection, "_add_", [each]);}]);
  3725. return newCollection;
  3726. return self;
  3727. },
  3728. 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')}),
  3729. smalltalk.Array);
  3730. smalltalk.addMethod(
  3731. '_deepCopy',
  3732. smalltalk.method({
  3733. selector: 'deepCopy',
  3734. category: 'copying',
  3735. fn: function () {
  3736. var self = this;
  3737. var newCollection = nil;
  3738. newCollection = smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3739. smalltalk.send(self, "_do_", [function (each) {return smalltalk.send(newCollection, "_add_", [smalltalk.send(each, "_deepCopy", [])]);}]);
  3740. return newCollection;
  3741. return self;
  3742. },
  3743. 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')}),
  3744. smalltalk.Array);
  3745. smalltalk.addMethod(
  3746. '_copyFrom_to_',
  3747. smalltalk.method({
  3748. selector: 'copyFrom:to:',
  3749. category: 'copying',
  3750. fn: function (anIndex, anotherIndex) {
  3751. var self = this;
  3752. var array = nil;
  3753. array = smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  3754. smalltalk.send(anIndex, "_to_do_", [anotherIndex, function (each) {return smalltalk.send(array, "_add_", [smalltalk.send(self, "_at_", [each])]);}]);
  3755. return array;
  3756. return self;
  3757. },
  3758. 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')}),
  3759. smalltalk.Array);
  3760. smalltalk.addMethod(
  3761. '_join_',
  3762. smalltalk.method({
  3763. selector: 'join:',
  3764. category: 'enumerating',
  3765. fn: function (aString) {
  3766. var self = this;
  3767. return self.join(aString);
  3768. return self;
  3769. },
  3770. source: unescape('join%3A%20aString%0A%09%7B%27return%20self.join%28aString%29%3B%27%7D')}),
  3771. smalltalk.Array);
  3772. smalltalk.addMethod(
  3773. '_asJavascript',
  3774. smalltalk.method({
  3775. selector: 'asJavascript',
  3776. category: 'converting',
  3777. fn: function () {
  3778. var self = this;
  3779. return smalltalk.send(smalltalk.send(unescape("%5B"), "__comma", [smalltalk.send(smalltalk.send(self, "_collect_", [function (each) {return smalltalk.send(each, "_asJavascript", []);}]), "_join_", [unescape("%2C%20")])]), "__comma", [unescape("%5D")]);
  3780. return self;
  3781. },
  3782. 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')}),
  3783. smalltalk.Array);
  3784. smalltalk.addMethod(
  3785. '_sort',
  3786. smalltalk.method({
  3787. selector: 'sort',
  3788. category: 'enumerating',
  3789. fn: function () {
  3790. var self = this;
  3791. return smalltalk.send(self, "_basicPerform_", ["sort"]);
  3792. return self;
  3793. },
  3794. source: unescape('sort%0A%20%20%20%20%5Eself%20basicPerform%3A%20%27sort%27%0A')}),
  3795. smalltalk.Array);
  3796. smalltalk.addMethod(
  3797. '_sort_',
  3798. smalltalk.method({
  3799. selector: 'sort:',
  3800. category: 'enumerating',
  3801. fn: function (aBlock) {
  3802. var self = this;
  3803. return self.sort(function (a, b) {if (aBlock(a, b)) {return 1;} else {return -1;}});
  3804. return self;
  3805. },
  3806. source: unescape('sort%3A%20aBlock%0A%09%7B%27%0A%09%09return%20self.sort%28function%28a%2C%20b%29%20%7B%0A%09%09%09if%28aBlock%28a%2Cb%29%29%20%7Breturn%201%7D%20else%20%7Breturn%20-1%7D%0A%09%09%7D%29%0A%09%27%7D')}),
  3807. smalltalk.Array);
  3808. smalltalk.addMethod(
  3809. '_remove_',
  3810. smalltalk.method({
  3811. selector: 'remove:',
  3812. category: 'adding',
  3813. fn: function (anObject) {
  3814. var self = this;
  3815. for (var i = 0; i < self.length; i++) {
  3816. if (self[i] == anObject) {
  3817. self.splice(i, 1);
  3818. break;
  3819. }
  3820. }
  3821. return self;
  3822. },
  3823. source: unescape('remove%3A%20anObject%0A%09%7B%27%0A%09%09for%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%20%7B%0A%09%09%09if%28self%5Bi%5D%20%3D%3D%20anObject%29%20%7B%0A%09%09%09%09self.splice%28i%2C1%29%3B%0A%09%09%09%09break%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%27%7D%0A')}),
  3824. smalltalk.Array);
  3825. smalltalk.addMethod(
  3826. '_sorted',
  3827. smalltalk.method({
  3828. selector: 'sorted',
  3829. category: 'enumerating',
  3830. fn: function () {
  3831. var self = this;
  3832. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort", []);
  3833. return self;
  3834. },
  3835. source: unescape('sorted%0A%09%5Eself%20copy%20sort')}),
  3836. smalltalk.Array);
  3837. smalltalk.addMethod(
  3838. '_sorted_',
  3839. smalltalk.method({
  3840. selector: 'sorted:',
  3841. category: 'enumerating',
  3842. fn: function (aBlock) {
  3843. var self = this;
  3844. return smalltalk.send(smalltalk.send(self, "_copy", []), "_sorted_", [aBlock]);
  3845. return self;
  3846. },
  3847. source: unescape('sorted%3A%20aBlock%0A%09%5Eself%20copy%20sorted%3A%20aBlock')}),
  3848. smalltalk.Array);
  3849. smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel');
  3850. smalltalk.addMethod(
  3851. '_messageText',
  3852. smalltalk.method({
  3853. selector: 'messageText',
  3854. category: 'accessing',
  3855. fn: function () {
  3856. var self = this;
  3857. return self['@messageText'];
  3858. return self;
  3859. },
  3860. source: unescape('messageText%0A%09%5EmessageText%0A')}),
  3861. smalltalk.Error);
  3862. smalltalk.addMethod(
  3863. '_messageText_',
  3864. smalltalk.method({
  3865. selector: 'messageText:',
  3866. category: 'accessing',
  3867. fn: function (aString) {
  3868. var self = this;
  3869. self['@messageText'] = aString;
  3870. return self;
  3871. },
  3872. source: unescape('messageText%3A%20aString%0A%09messageText%20%3A%3D%20aString%0A')}),
  3873. smalltalk.Error);
  3874. smalltalk.addMethod(
  3875. '_signal',
  3876. smalltalk.method({
  3877. selector: 'signal',
  3878. category: 'signaling',
  3879. fn: function () {
  3880. var self = this;
  3881. throw new Error(self._messageText());
  3882. return self;
  3883. },
  3884. source: unescape('signal%0A%09%7B%27throw%28new%20Error%28self._messageText%28%29%29%29%27%7D')}),
  3885. smalltalk.Error);
  3886. smalltalk.addMethod(
  3887. '_signal_',
  3888. smalltalk.method({
  3889. selector: 'signal:',
  3890. category: 'instance creation',
  3891. fn: function (aString) {
  3892. var self = this;
  3893. return function ($rec) {smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);}(smalltalk.send(self, "_new", []));
  3894. return self;
  3895. },
  3896. source: unescape('signal%3A%20aString%0A%09%20%20%20%20%5Eself%20new%0A%09%09messageText%3A%20aString%3B%0A%09%09signal%0A')}),
  3897. smalltalk.Error.klass);
  3898. smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel');
  3899. smalltalk.addMethod(
  3900. '__eq',
  3901. smalltalk.method({
  3902. selector: '=',
  3903. category: 'comparing',
  3904. fn: function (anAssociation) {
  3905. var self = this;
  3906. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(anAssociation, "_class", [])]), "_and_", [function () {return smalltalk.send(smalltalk.send(smalltalk.send(self, "_key", []), "__eq", [smalltalk.send(anAssociation, "_key", [])]), "_and_", [function () {return smalltalk.send(smalltalk.send(self, "_value", []), "__eq", [smalltalk.send(anAssociation, "_value", [])]);}]);}]);
  3907. return self;
  3908. },
  3909. 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')}),
  3910. smalltalk.Association);
  3911. smalltalk.addMethod(
  3912. '_key_',
  3913. smalltalk.method({
  3914. selector: 'key:',
  3915. category: 'accessing',
  3916. fn: function (aKey) {
  3917. var self = this;
  3918. self['@key'] = aKey;
  3919. return self;
  3920. },
  3921. source: unescape('key%3A%20aKey%0A%09key%20%3A%3D%20aKey%0A')}),
  3922. smalltalk.Association);
  3923. smalltalk.addMethod(
  3924. '_key',
  3925. smalltalk.method({
  3926. selector: 'key',
  3927. category: 'accessing',
  3928. fn: function () {
  3929. var self = this;
  3930. return self['@key'];
  3931. return self;
  3932. },
  3933. source: unescape('key%0A%09%5Ekey%0A')}),
  3934. smalltalk.Association);
  3935. smalltalk.addMethod(
  3936. '_value_',
  3937. smalltalk.method({
  3938. selector: 'value:',
  3939. category: 'accessing',
  3940. fn: function (aValue) {
  3941. var self = this;
  3942. self['@value'] = aValue;
  3943. return self;
  3944. },
  3945. source: unescape('value%3A%20aValue%0A%09value%20%3A%3D%20aValue%0A')}),
  3946. smalltalk.Association);
  3947. smalltalk.addMethod(
  3948. '_value',
  3949. smalltalk.method({
  3950. selector: 'value',
  3951. category: 'accessing',
  3952. fn: function () {
  3953. var self = this;
  3954. return self['@value'];
  3955. return self;
  3956. },
  3957. source: unescape('value%0A%09%5Evalue%0A')}),
  3958. smalltalk.Association);
  3959. smalltalk.addMethod(
  3960. '_key_value_',
  3961. smalltalk.method({
  3962. selector: 'key:value:',
  3963. category: 'instance creation',
  3964. fn: function (aKey, aValue) {
  3965. var self = this;
  3966. return function ($rec) {smalltalk.send($rec, "_key_", [aKey]);smalltalk.send($rec, "_value_", [aValue]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_new", []));
  3967. return self;
  3968. },
  3969. 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')}),
  3970. smalltalk.Association.klass);
  3971. smalltalk.addClass('Dictionary', smalltalk.Collection, ['keys'], 'Kernel');
  3972. smalltalk.addMethod(
  3973. '__eq',
  3974. smalltalk.method({
  3975. selector: '=',
  3976. category: 'comparing',
  3977. fn: function (aDictionary) {
  3978. var self = this;
  3979. try {
  3980. smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aDictionary, "_class", [])]), "_ifFalse_", [function () {return function () {throw {name: "stReturn", selector: "__eq", fn: function () {return false;}};}();}]);
  3981. smalltalk.send(self, "_associationsDo_", [function (assoc) {return smalltalk.send(smalltalk.send(smalltalk.send(aDictionary, "_at_ifAbsent_", [smalltalk.send(assoc, "_key", []), function () {return function () {throw {name: "stReturn", selector: "__eq", fn: function () {return false;}};}();}]), "__eq", [smalltalk.send(assoc, "_value", [])]), "_ifFalse_", [function () {return function () {throw {name: "stReturn", selector: "__eq", fn: function () {return false;}};}();}]);}]);
  3982. (function () {throw {name: "stReturn", selector: "__eq", fn: function () {return true;}};}());
  3983. return self;
  3984. } catch (e) {
  3985. if (e.name === "stReturn" && e.selector === "__eq") {
  3986. return e.fn();
  3987. }
  3988. throw e;
  3989. }
  3990. },
  3991. 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')}),
  3992. smalltalk.Dictionary);
  3993. smalltalk.addMethod(
  3994. '_shallowCopy',
  3995. smalltalk.method({
  3996. selector: 'shallowCopy',
  3997. category: 'copying',
  3998. fn: function () {
  3999. var self = this;
  4000. var copy = nil;
  4001. copy = smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4002. smalltalk.send(self, "_associationsDo_", [function (each) {return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);}]);
  4003. return copy;
  4004. return self;
  4005. },
  4006. 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')}),
  4007. smalltalk.Dictionary);
  4008. smalltalk.addMethod(
  4009. '_initialize',
  4010. smalltalk.method({
  4011. selector: 'initialize',
  4012. category: 'initialization',
  4013. fn: function () {
  4014. var self = this;
  4015. self.klass.superclass.fn.prototype._initialize.apply(self, []);
  4016. self['@keys'] = [];
  4017. return self;
  4018. },
  4019. source: unescape('initialize%0A%20%20%20%20%09super%20initialize.%0A%20%20%20%20%09keys%20%3A%3D%20%23%28%29%0A')}),
  4020. smalltalk.Dictionary);
  4021. smalltalk.addMethod(
  4022. '_size',
  4023. smalltalk.method({
  4024. selector: 'size',
  4025. category: 'accessing',
  4026. fn: function () {
  4027. var self = this;
  4028. return smalltalk.send(self['@keys'], "_size", []);
  4029. return self;
  4030. },
  4031. source: unescape('size%0A%09%5Ekeys%20size%0A')}),
  4032. smalltalk.Dictionary);
  4033. smalltalk.addMethod(
  4034. '_associations',
  4035. smalltalk.method({
  4036. selector: 'associations',
  4037. category: 'accessing',
  4038. fn: function () {
  4039. var self = this;
  4040. var associations = nil;
  4041. associations = [];
  4042. smalltalk.send(self['@keys'], "_do_", [function (each) {return smalltalk.send(associations, "_add_", [smalltalk.send(smalltalk.Association, "_key_value_", [each, smalltalk.send(self, "_at_", [each])])]);}]);
  4043. return associations;
  4044. return self;
  4045. },
  4046. 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')}),
  4047. smalltalk.Dictionary);
  4048. smalltalk.addMethod(
  4049. '_keys',
  4050. smalltalk.method({
  4051. selector: 'keys',
  4052. category: 'accessing',
  4053. fn: function () {
  4054. var self = this;
  4055. return smalltalk.send(self['@keys'], "_copy", []);
  4056. return self;
  4057. },
  4058. source: unescape('keys%0A%09%5Ekeys%20copy%0A')}),
  4059. smalltalk.Dictionary);
  4060. smalltalk.addMethod(
  4061. '_values',
  4062. smalltalk.method({
  4063. selector: 'values',
  4064. category: 'accessing',
  4065. fn: function () {
  4066. var self = this;
  4067. return smalltalk.send(self['@keys'], "_collect_", [function (each) {return smalltalk.send(self, "_at_", [each]);}]);
  4068. return self;
  4069. },
  4070. source: unescape('values%0A%20%20%20%20%09%5Ekeys%20collect%3A%20%5B%3Aeach%20%7C%20self%20at%3A%20each%5D%0A')}),
  4071. smalltalk.Dictionary);
  4072. smalltalk.addMethod(
  4073. '_at_put_',
  4074. smalltalk.method({
  4075. selector: 'at:put:',
  4076. category: 'accessing',
  4077. fn: function (aKey, aValue) {
  4078. var self = this;
  4079. smalltalk.send(smalltalk.send(self['@keys'], "_includes_", [aKey]), "_ifFalse_", [function () {return smalltalk.send(self['@keys'], "_add_", [aKey]);}]);
  4080. return smalltalk.send(self, "_basicAt_put_", [aKey, aValue]);
  4081. return self;
  4082. },
  4083. 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')}),
  4084. smalltalk.Dictionary);
  4085. smalltalk.addMethod(
  4086. '_at_ifAbsent_',
  4087. smalltalk.method({
  4088. selector: 'at:ifAbsent:',
  4089. category: 'accessing',
  4090. fn: function (aKey, aBlock) {
  4091. var self = this;
  4092. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_keys", []), "_includes_", [aKey]), "_ifTrue_ifFalse_", [function () {return smalltalk.send(self, "_basicAt_", [aKey]);}, aBlock]);
  4093. return self;
  4094. },
  4095. source: unescape('at%3A%20aKey%20ifAbsent%3A%20aBlock%0A%09%5E%28self%20keys%20includes%3A%20aKey%29%0A%09%09ifTrue%3A%20%5Bself%20basicAt%3A%20aKey%5D%0A%09%09ifFalse%3A%20aBlock')}),
  4096. smalltalk.Dictionary);
  4097. smalltalk.addMethod(
  4098. '_at_ifAbsentPut_',
  4099. smalltalk.method({
  4100. selector: 'at:ifAbsentPut:',
  4101. category: 'accessing',
  4102. fn: function (aKey, aBlock) {
  4103. var self = this;
  4104. return smalltalk.send(self, "_at_ifAbsent_", [aKey, function () {return smalltalk.send(self, "_at_put_", [aKey, smalltalk.send(aBlock, "_value", [])]);}]);
  4105. return self;
  4106. },
  4107. 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')}),
  4108. smalltalk.Dictionary);
  4109. smalltalk.addMethod(
  4110. '_at_ifPresent_',
  4111. smalltalk.method({
  4112. selector: 'at:ifPresent:',
  4113. category: 'accessing',
  4114. fn: function (aKey, aBlock) {
  4115. var self = this;
  4116. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNotNil_", [function () {return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);}]);
  4117. return self;
  4118. },
  4119. 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')}),
  4120. smalltalk.Dictionary);
  4121. smalltalk.addMethod(
  4122. '_at_ifPresent_ifAbsent_',
  4123. smalltalk.method({
  4124. selector: 'at:ifPresent:ifAbsent:',
  4125. category: 'accessing',
  4126. fn: function (aKey, aBlock, anotherBlock) {
  4127. var self = this;
  4128. return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNil_ifNotNil_", [anotherBlock, function () {return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);}]);
  4129. return self;
  4130. },
  4131. 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')}),
  4132. smalltalk.Dictionary);
  4133. smalltalk.addMethod(
  4134. '_add_',
  4135. smalltalk.method({
  4136. selector: 'add:',
  4137. category: 'adding/removing',
  4138. fn: function (anAssociation) {
  4139. var self = this;
  4140. smalltalk.send(self, "_at_put_", [smalltalk.send(anAssociation, "_key", []), smalltalk.send(anAssociation, "_value", [])]);
  4141. return self;
  4142. },
  4143. source: unescape('add%3A%20anAssociation%0A%20%20%20%20%09self%20at%3A%20anAssociation%20key%20put%3A%20anAssociation%20value%0A')}),
  4144. smalltalk.Dictionary);
  4145. smalltalk.addMethod(
  4146. '_addAll_',
  4147. smalltalk.method({
  4148. selector: 'addAll:',
  4149. category: 'adding/removing',
  4150. fn: function (aDictionary) {
  4151. var self = this;
  4152. self.klass.superclass.fn.prototype._addAll_.apply(self, [smalltalk.send(aDictionary, "_associations", [])]);
  4153. return aDictionary;
  4154. return self;
  4155. },
  4156. source: unescape('addAll%3A%20aDictionary%0A%20%20%20%20%09super%20addAll%3A%20aDictionary%20associations.%0A%20%20%20%20%09%5EaDictionary%0A')}),
  4157. smalltalk.Dictionary);
  4158. smalltalk.addMethod(
  4159. '__comma',
  4160. smalltalk.method({
  4161. selector: ',',
  4162. category: 'copying',
  4163. fn: function (aCollection) {
  4164. var self = this;
  4165. smalltalk.send(self, "_shouldNotImplement", []);
  4166. return self;
  4167. },
  4168. source: unescape('%2C%20aCollection%0A%09self%20shouldNotImplement%0A')}),
  4169. smalltalk.Dictionary);
  4170. smalltalk.addMethod(
  4171. '_copyFrom_to_',
  4172. smalltalk.method({
  4173. selector: 'copyFrom:to:',
  4174. category: 'copying',
  4175. fn: function (anIndex, anotherIndex) {
  4176. var self = this;
  4177. smalltalk.send(self, "_shouldNotImplement", []);
  4178. return self;
  4179. },
  4180. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09self%20shouldNotImplement%0A')}),
  4181. smalltalk.Dictionary);
  4182. smalltalk.addMethod(
  4183. '_associationsDo_',
  4184. smalltalk.method({
  4185. selector: 'associationsDo:',
  4186. category: 'enumerating',
  4187. fn: function (aBlock) {
  4188. var self = this;
  4189. smalltalk.send(smalltalk.send(self, "_associations", []), "_do_", [aBlock]);
  4190. return self;
  4191. },
  4192. source: unescape('associationsDo%3A%20aBlock%0A%20%20%20%20%09self%20associations%20do%3A%20aBlock%0A')}),
  4193. smalltalk.Dictionary);
  4194. smalltalk.addMethod(
  4195. '_keysAndValuesDo_',
  4196. smalltalk.method({
  4197. selector: 'keysAndValuesDo:',
  4198. category: 'enumerating',
  4199. fn: function (aBlock) {
  4200. var self = this;
  4201. smalltalk.send(self, "_associationsDo_", [function (each) {return smalltalk.send(aBlock, "_value_value_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);}]);
  4202. return self;
  4203. },
  4204. 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')}),
  4205. smalltalk.Dictionary);
  4206. smalltalk.addMethod(
  4207. '_do_',
  4208. smalltalk.method({
  4209. selector: 'do:',
  4210. category: 'enumerating',
  4211. fn: function (aBlock) {
  4212. var self = this;
  4213. smalltalk.send(smalltalk.send(self, "_values", []), "_do_", [aBlock]);
  4214. return self;
  4215. },
  4216. source: unescape('do%3A%20aBlock%0A%20%20%20%20%09self%20values%20do%3A%20aBlock%0A')}),
  4217. smalltalk.Dictionary);
  4218. smalltalk.addMethod(
  4219. '_select_',
  4220. smalltalk.method({
  4221. selector: 'select:',
  4222. category: 'enumerating',
  4223. fn: function (aBlock) {
  4224. var self = this;
  4225. var newDict = nil;
  4226. newDict = smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4227. smalltalk.send(self, "_keysAndValuesDo_", [function (key, value) {return smalltalk.send(smalltalk.send(aBlock, "_value_", [value]), "_ifTrue_", [function () {return smalltalk.send(newDict, "_at_put_", [key, value]);}]);}]);
  4228. return newDict;
  4229. return self;
  4230. },
  4231. 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')}),
  4232. smalltalk.Dictionary);
  4233. smalltalk.addMethod(
  4234. '_collect_',
  4235. smalltalk.method({
  4236. selector: 'collect:',
  4237. category: 'enumerating',
  4238. fn: function (aBlock) {
  4239. var self = this;
  4240. var newDict = nil;
  4241. newDict = smalltalk.send(smalltalk.send(self, "_class", []), "_new", []);
  4242. smalltalk.send(self, "_keysAndValuesDo_", [function (key, value) {return smalltalk.send(smalltalk.send(aBlock, "_value_", [value]), "_ifTrue_", [function () {return smalltalk.send(newDict, "_at_put_", [key, value]);}]);}]);
  4243. return newDict;
  4244. return self;
  4245. },
  4246. 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')}),
  4247. smalltalk.Dictionary);
  4248. smalltalk.addMethod(
  4249. '_detect_ifNone_',
  4250. smalltalk.method({
  4251. selector: 'detect:ifNone:',
  4252. category: 'enumerating',
  4253. fn: function (aBlock, anotherBlock) {
  4254. var self = this;
  4255. return smalltalk.send(smalltalk.send(self, "_values", []), "_detect_ifNone_", [aBlock, anotherBlock]);
  4256. return self;
  4257. },
  4258. source: unescape('detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A%09%5Eself%20values%20detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A')}),
  4259. smalltalk.Dictionary);
  4260. smalltalk.addMethod(
  4261. '_includes_',
  4262. smalltalk.method({
  4263. selector: 'includes:',
  4264. category: 'enumerating',
  4265. fn: function (anObject) {
  4266. var self = this;
  4267. return smalltalk.send(smalltalk.send(self, "_values", []), "_includes_", [anObject]);
  4268. return self;
  4269. },
  4270. source: unescape('includes%3A%20anObject%0A%09%5Eself%20values%20includes%3A%20anObject%0A')}),
  4271. smalltalk.Dictionary);
  4272. smalltalk.addMethod(
  4273. '_remove_',
  4274. smalltalk.method({
  4275. selector: 'remove:',
  4276. category: 'adding/removing',
  4277. fn: function (aKey) {
  4278. var self = this;
  4279. smalltalk.send(self, "_removeKey_", [aKey]);
  4280. return self;
  4281. },
  4282. source: unescape('remove%3A%20aKey%0A%20%20%20%20self%20removeKey%3A%20aKey%0A')}),
  4283. smalltalk.Dictionary);
  4284. smalltalk.addMethod(
  4285. '_removeKey_',
  4286. smalltalk.method({
  4287. selector: 'removeKey:',
  4288. category: 'adding/removing',
  4289. fn: function (aKey) {
  4290. var self = this;
  4291. smalltalk.send(self['@keys'], "_remove_", [aKey]);
  4292. return self;
  4293. },
  4294. source: unescape('removeKey%3A%20aKey%0A%20%20%20%20keys%20remove%3A%20aKey%0A')}),
  4295. smalltalk.Dictionary);
  4296. smalltalk.addMethod(
  4297. '_inspectOn_',
  4298. smalltalk.method({
  4299. selector: 'inspectOn:',
  4300. category: '*IDE',
  4301. fn: function (anInspector) {
  4302. var self = this;
  4303. var variables = nil;
  4304. variables = smalltalk.send(smalltalk.Dictionary, "_new", []);
  4305. smalltalk.send(variables, "_at_put_", [unescape("%23self"), self]);
  4306. smalltalk.send(variables, "_at_put_", [unescape("%23keys"), smalltalk.send(self, "_keys", [])]);
  4307. smalltalk.send(self, "_keysAndValuesDo_", [function (key, value) {return smalltalk.send(variables, "_at_put_", [key, value]);}]);
  4308. (function ($rec) {smalltalk.send($rec, "_setLabel_", [smalltalk.send(self, "_printString", [])]);return smalltalk.send($rec, "_setVariables_", [variables]);}(anInspector));
  4309. return self;
  4310. },
  4311. 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%09variables%20at%3A%20%27%23keys%27%20put%3A%20self%20keys.%0A%09self%20keysAndValuesDo%3A%20%5B%3Akey%20%3Avalue%20%7C%0A%09%09variables%20at%3A%20key%20put%3A%20value%5D.%0A%09anInspector%20%0A%09%09setLabel%3A%20self%20printString%3B%0A%09%09setVariables%3A%20variables')}),
  4312. smalltalk.Dictionary);
  4313. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel');
  4314. smalltalk.addMethod(
  4315. '_superclass_subclass_',
  4316. smalltalk.method({
  4317. selector: 'superclass:subclass:',
  4318. category: 'class creation',
  4319. fn: function (aClass, aString) {
  4320. var self = this;
  4321. smalltalk.send(self, "_superclass_subclass_instanceVariableNames_category_", [aClass, aString, "", nil]);
  4322. return self;
  4323. },
  4324. 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')}),
  4325. smalltalk.ClassBuilder);
  4326. smalltalk.addMethod(
  4327. '_superclass_subclass_instanceVariableNames_category_',
  4328. smalltalk.method({
  4329. selector: 'superclass:subclass:instanceVariableNames:category:',
  4330. category: 'class creation',
  4331. fn: function (aClass, aString, aString2, aString3) {
  4332. var self = this;
  4333. var newClass = nil;
  4334. newClass = smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_", [aClass, aString, smalltalk.send(self, "_instanceVariableNamesFor_", [aString2])]);
  4335. smalltalk.send(self, "_setupClass_", [newClass]);
  4336. smalltalk.send(newClass, "_category_", [smalltalk.send(aString3, "_ifNil_", [function () {return "unclassified";}])]);
  4337. return self;
  4338. },
  4339. 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')}),
  4340. smalltalk.ClassBuilder);
  4341. smalltalk.addMethod(
  4342. '_class_instanceVariableNames_',
  4343. smalltalk.method({
  4344. selector: 'class:instanceVariableNames:',
  4345. category: 'class creation',
  4346. fn: function (aClass, aString) {
  4347. var self = this;
  4348. smalltalk.send(smalltalk.send(aClass, "_isMetaclass", []), "_ifFalse_", [function () {return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_name", []), "__comma", [" is not a metaclass"])]);}]);
  4349. smalltalk.send(aClass, "_basicAt_put_", ["iVarNames", smalltalk.send(self, "_instanceVariableNamesFor_", [aString])]);
  4350. smalltalk.send(self, "_setupClass_", [aClass]);
  4351. return self;
  4352. },
  4353. 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')}),
  4354. smalltalk.ClassBuilder);
  4355. smalltalk.addMethod(
  4356. '_instanceVariableNamesFor_',
  4357. smalltalk.method({
  4358. selector: 'instanceVariableNamesFor:',
  4359. category: 'private',
  4360. fn: function (aString) {
  4361. var self = this;
  4362. return smalltalk.send(smalltalk.send(aString, "_tokenize_", [" "]), "_reject_", [function (each) {return smalltalk.send(each, "_isEmpty", []);}]);
  4363. return self;
  4364. },
  4365. 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')}),
  4366. smalltalk.ClassBuilder);
  4367. smalltalk.addMethod(
  4368. '_addSubclassOf_named_instanceVariableNames_',
  4369. smalltalk.method({
  4370. selector: 'addSubclassOf:named:instanceVariableNames:',
  4371. category: 'private',
  4372. fn: function (aClass, aString, aCollection) {
  4373. var self = this;
  4374. smalltalk.addClass(aString, aClass, aCollection);
  4375. return smalltalk[aString];
  4376. return self;
  4377. },
  4378. source: unescape('addSubclassOf%3A%20aClass%20named%3A%20aString%20instanceVariableNames%3A%20aCollection%0A%09%7B%27smalltalk.addClass%28aString%2C%20aClass%2C%20aCollection%29%3B%0A%09%20%20%20%20return%20smalltalk%5BaString%5D%27%7D')}),
  4379. smalltalk.ClassBuilder);
  4380. smalltalk.addMethod(
  4381. '_setupClass_',
  4382. smalltalk.method({
  4383. selector: 'setupClass:',
  4384. category: 'private',
  4385. fn: function (aClass) {
  4386. var self = this;
  4387. smalltalk.init(aClass);
  4388. return self;
  4389. },
  4390. source: unescape('setupClass%3A%20aClass%0A%09%7B%27smalltalk.init%28aClass%29%3B%27%7D%0A')}),
  4391. smalltalk.ClassBuilder);
  4392. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category', 'chunkParser'], 'Kernel');
  4393. smalltalk.addMethod(
  4394. '_initialize',
  4395. smalltalk.method({
  4396. selector: 'initialize',
  4397. category: 'initialization',
  4398. fn: function () {
  4399. var self = this;
  4400. self.klass.superclass.fn.prototype._initialize.apply(self, []);
  4401. self['@chunkParser'] = smalltalk.send(smalltalk.ChunkParser, "_new", []);
  4402. return self;
  4403. },
  4404. source: unescape('initialize%0A%09super%20initialize.%0A%09chunkParser%20%3A%3D%20ChunkParser%20new.%0A')}),
  4405. smalltalk.ClassCategoryReader);
  4406. smalltalk.addMethod(
  4407. '_class_category_',
  4408. smalltalk.method({
  4409. selector: 'class:category:',
  4410. category: 'accessing',
  4411. fn: function (aClass, aString) {
  4412. var self = this;
  4413. self['@class'] = aClass;
  4414. self['@category'] = aString;
  4415. return self;
  4416. },
  4417. source: unescape('class%3A%20aClass%20category%3A%20aString%0A%09class%20%3A%3D%20aClass.%0A%09category%20%3A%3D%20aString%0A')}),
  4418. smalltalk.ClassCategoryReader);
  4419. smalltalk.addMethod(
  4420. '_scanFrom_',
  4421. smalltalk.method({
  4422. selector: 'scanFrom:',
  4423. category: 'fileIn',
  4424. fn: function (aStream) {
  4425. var self = this;
  4426. var nextChunk = nil;
  4427. nextChunk = smalltalk.send(smalltalk.send(smalltalk.send(self['@chunkParser'], "_emptyChunk", []), "__slash", [smalltalk.send(self['@chunkParser'], "_chunk", [])]), "_parse_", [aStream]);
  4428. smalltalk.send(smalltalk.send(nextChunk, "_isEmptyChunk", []), "_ifFalse_", [function () {smalltalk.send(self, "_compileMethod_", [smalltalk.send(nextChunk, "_contents", [])]);return smalltalk.send(self, "_scanFrom_", [aStream]);}]);
  4429. return self;
  4430. },
  4431. 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')}),
  4432. smalltalk.ClassCategoryReader);
  4433. smalltalk.addMethod(
  4434. '_compileMethod_',
  4435. smalltalk.method({
  4436. selector: 'compileMethod:',
  4437. category: 'private',
  4438. fn: function (aString) {
  4439. var self = this;
  4440. var method = nil;
  4441. method = smalltalk.send(smalltalk.send(smalltalk.Compiler, "_new", []), "_load_forClass_", [aString, self['@class']]);
  4442. smalltalk.send(method, "_category_", [self['@category']]);
  4443. smalltalk.send(self['@class'], "_addCompiledMethod_", [method]);
  4444. return self;
  4445. },
  4446. 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')}),
  4447. smalltalk.ClassCategoryReader);
  4448. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel');
  4449. smalltalk.addMethod(
  4450. '_collection',
  4451. smalltalk.method({
  4452. selector: 'collection',
  4453. category: 'accessing',
  4454. fn: function () {
  4455. var self = this;
  4456. return self['@collection'];
  4457. return self;
  4458. },
  4459. source: unescape('collection%0A%09%5Ecollection%0A')}),
  4460. smalltalk.Stream);
  4461. smalltalk.addMethod(
  4462. '_setCollection_',
  4463. smalltalk.method({
  4464. selector: 'setCollection:',
  4465. category: 'accessing',
  4466. fn: function (aCollection) {
  4467. var self = this;
  4468. self['@collection'] = aCollection;
  4469. return self;
  4470. },
  4471. source: unescape('setCollection%3A%20aCollection%0A%09collection%20%3A%3D%20aCollection%0A')}),
  4472. smalltalk.Stream);
  4473. smalltalk.addMethod(
  4474. '_position',
  4475. smalltalk.method({
  4476. selector: 'position',
  4477. category: 'accessing',
  4478. fn: function () {
  4479. var self = this;
  4480. return smalltalk.send(self['@position'], "_ifNil_", [function () {return self['@position'] = 0;}]);
  4481. return self;
  4482. },
  4483. source: unescape('position%0A%09%5Eposition%20ifNil%3A%20%5Bposition%20%3A%3D%200%5D%0A')}),
  4484. smalltalk.Stream);
  4485. smalltalk.addMethod(
  4486. '_position_',
  4487. smalltalk.method({
  4488. selector: 'position:',
  4489. category: 'accessing',
  4490. fn: function (anInteger) {
  4491. var self = this;
  4492. self['@position'] = anInteger;
  4493. return self;
  4494. },
  4495. source: unescape('position%3A%20anInteger%0A%09position%20%3A%3D%20anInteger%0A')}),
  4496. smalltalk.Stream);
  4497. smalltalk.addMethod(
  4498. '_streamSize',
  4499. smalltalk.method({
  4500. selector: 'streamSize',
  4501. category: 'accessing',
  4502. fn: function () {
  4503. var self = this;
  4504. return self['@streamSize'];
  4505. return self;
  4506. },
  4507. source: unescape('streamSize%0A%09%5EstreamSize%0A')}),
  4508. smalltalk.Stream);
  4509. smalltalk.addMethod(
  4510. '_setStreamSize_',
  4511. smalltalk.method({
  4512. selector: 'setStreamSize:',
  4513. category: 'accessing',
  4514. fn: function (anInteger) {
  4515. var self = this;
  4516. self['@streamSize'] = anInteger;
  4517. return self;
  4518. },
  4519. source: unescape('setStreamSize%3A%20anInteger%0A%09streamSize%20%3A%3D%20anInteger%0A')}),
  4520. smalltalk.Stream);
  4521. smalltalk.addMethod(
  4522. '_contents',
  4523. smalltalk.method({
  4524. selector: 'contents',
  4525. category: 'accessing',
  4526. fn: function () {
  4527. var self = this;
  4528. return smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [1, smalltalk.send(self, "_streamSize", [])]);
  4529. return self;
  4530. },
  4531. 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')}),
  4532. smalltalk.Stream);
  4533. smalltalk.addMethod(
  4534. '_size',
  4535. smalltalk.method({
  4536. selector: 'size',
  4537. category: 'accessing',
  4538. fn: function () {
  4539. var self = this;
  4540. return smalltalk.send(self, "_streamSize", []);
  4541. return self;
  4542. },
  4543. source: unescape('size%0A%09%5Eself%20streamSize%0A')}),
  4544. smalltalk.Stream);
  4545. smalltalk.addMethod(
  4546. '_reset',
  4547. smalltalk.method({
  4548. selector: 'reset',
  4549. category: 'actions',
  4550. fn: function () {
  4551. var self = this;
  4552. smalltalk.send(self, "_position_", [0]);
  4553. return self;
  4554. },
  4555. source: unescape('reset%0A%09self%20position%3A%200%0A')}),
  4556. smalltalk.Stream);
  4557. smalltalk.addMethod(
  4558. '_close',
  4559. smalltalk.method({
  4560. selector: 'close',
  4561. category: 'actions',
  4562. fn: function () {
  4563. var self = this;
  4564. return self;
  4565. },
  4566. source: unescape('close%0A')}),
  4567. smalltalk.Stream);
  4568. smalltalk.addMethod(
  4569. '_flush',
  4570. smalltalk.method({
  4571. selector: 'flush',
  4572. category: 'actions',
  4573. fn: function () {
  4574. var self = this;
  4575. return self;
  4576. },
  4577. source: unescape('flush%0A')}),
  4578. smalltalk.Stream);
  4579. smalltalk.addMethod(
  4580. '_resetContents',
  4581. smalltalk.method({
  4582. selector: 'resetContents',
  4583. category: 'actions',
  4584. fn: function () {
  4585. var self = this;
  4586. smalltalk.send(self, "_reset", []);
  4587. smalltalk.send(self, "_setStreamSize_", [0]);
  4588. return self;
  4589. },
  4590. source: unescape('resetContents%0A%09self%20reset.%0A%09self%20setStreamSize%3A%200%0A')}),
  4591. smalltalk.Stream);
  4592. smalltalk.addMethod(
  4593. '_do_',
  4594. smalltalk.method({
  4595. selector: 'do:',
  4596. category: 'enumerating',
  4597. fn: function (aBlock) {
  4598. var self = this;
  4599. smalltalk.send(function () {return smalltalk.send(self, "_atEnd", []);}, "_whileFalse_", [function () {return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_next", [])]);}]);
  4600. return self;
  4601. },
  4602. source: unescape('do%3A%20aBlock%0A%09%5Bself%20atEnd%5D%20whileFalse%3A%20%5BaBlock%20value%3A%20self%20next%5D%0A')}),
  4603. smalltalk.Stream);
  4604. smalltalk.addMethod(
  4605. '_setToEnd',
  4606. smalltalk.method({
  4607. selector: 'setToEnd',
  4608. category: 'positioning',
  4609. fn: function () {
  4610. var self = this;
  4611. smalltalk.send(self, "_position_", [smalltalk.send(self, "_size", [])]);
  4612. return self;
  4613. },
  4614. source: unescape('setToEnd%0A%09self%20position%3A%20self%20size%0A')}),
  4615. smalltalk.Stream);
  4616. smalltalk.addMethod(
  4617. '_skip_',
  4618. smalltalk.method({
  4619. selector: 'skip:',
  4620. category: 'positioning',
  4621. fn: function (anInteger) {
  4622. var self = this;
  4623. smalltalk.send(self, "_position_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [anInteger]), "_min_max_", [smalltalk.send(self, "_size", []), 0])]);
  4624. return self;
  4625. },
  4626. 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')}),
  4627. smalltalk.Stream);
  4628. smalltalk.addMethod(
  4629. '_next',
  4630. smalltalk.method({
  4631. selector: 'next',
  4632. category: 'reading',
  4633. fn: function () {
  4634. var self = this;
  4635. smalltalk.send(self, "_position_", [smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [1])]);
  4636. return smalltalk.send(self['@collection'], "_at_", [smalltalk.send(self, "_position", [])]);
  4637. return self;
  4638. },
  4639. source: unescape('next%0A%09self%20position%3A%20self%20position%20+%201.%20%0A%09%5Ecollection%20at%3A%20self%20position%0A')}),
  4640. smalltalk.Stream);
  4641. smalltalk.addMethod(
  4642. '_next_',
  4643. smalltalk.method({
  4644. selector: 'next:',
  4645. category: 'reading',
  4646. fn: function (anInteger) {
  4647. var self = this;
  4648. var tempCollection = nil;
  4649. tempCollection = smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  4650. smalltalk.send(anInteger, "_timesRepeat_", [function () {return smalltalk.send(smalltalk.send(self, "_atEnd", []), "_ifFalse_", [function () {return smalltalk.send(tempCollection, "_add_", [smalltalk.send(self, "_next", [])]);}]);}]);
  4651. return tempCollection;
  4652. return self;
  4653. },
  4654. 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')}),
  4655. smalltalk.Stream);
  4656. smalltalk.addMethod(
  4657. '_nextPut_',
  4658. smalltalk.method({
  4659. selector: 'nextPut:',
  4660. category: 'writing',
  4661. fn: function (anObject) {
  4662. var self = this;
  4663. smalltalk.send(self, "_position_", [smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [1])]);
  4664. smalltalk.send(smalltalk.send(self, "_collection", []), "_at_put_", [smalltalk.send(self, "_position", []), anObject]);
  4665. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  4666. return self;
  4667. },
  4668. 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')}),
  4669. smalltalk.Stream);
  4670. smalltalk.addMethod(
  4671. '_nextPutAll_',
  4672. smalltalk.method({
  4673. selector: 'nextPutAll:',
  4674. category: 'writing',
  4675. fn: function (aCollection) {
  4676. var self = this;
  4677. smalltalk.send(aCollection, "_do_", [function (each) {return smalltalk.send(self, "_nextPut_", [each]);}]);
  4678. return self;
  4679. },
  4680. 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')}),
  4681. smalltalk.Stream);
  4682. smalltalk.addMethod(
  4683. '_peek',
  4684. smalltalk.method({
  4685. selector: 'peek',
  4686. category: 'reading',
  4687. fn: function () {
  4688. var self = this;
  4689. return smalltalk.send(smalltalk.send(self, "_atEnd", []), "_ifFalse_", [function () {return smalltalk.send(smalltalk.send(self, "_collection", []), "_at_", [smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [1])]);}]);
  4690. return self;
  4691. },
  4692. 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')}),
  4693. smalltalk.Stream);
  4694. smalltalk.addMethod(
  4695. '_atEnd',
  4696. smalltalk.method({
  4697. selector: 'atEnd',
  4698. category: 'testing',
  4699. fn: function () {
  4700. var self = this;
  4701. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [smalltalk.send(self, "_size", [])]);
  4702. return self;
  4703. },
  4704. source: unescape('atEnd%0A%09%5Eself%20position%20%3D%20self%20size%0A')}),
  4705. smalltalk.Stream);
  4706. smalltalk.addMethod(
  4707. '_atStart',
  4708. smalltalk.method({
  4709. selector: 'atStart',
  4710. category: 'testing',
  4711. fn: function () {
  4712. var self = this;
  4713. return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [0]);
  4714. return self;
  4715. },
  4716. source: unescape('atStart%0A%09%5Eself%20position%20%3D%200%0A')}),
  4717. smalltalk.Stream);
  4718. smalltalk.addMethod(
  4719. '_isEmpty',
  4720. smalltalk.method({
  4721. selector: 'isEmpty',
  4722. category: 'testing',
  4723. fn: function () {
  4724. var self = this;
  4725. return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [0]);
  4726. return self;
  4727. },
  4728. source: unescape('isEmpty%0A%09%5Eself%20size%20%3D%200%0A')}),
  4729. smalltalk.Stream);
  4730. smalltalk.addMethod(
  4731. '_on_',
  4732. smalltalk.method({
  4733. selector: 'on:',
  4734. category: 'instance creation',
  4735. fn: function (aCollection) {
  4736. var self = this;
  4737. return function ($rec) {smalltalk.send($rec, "_setCollection_", [aCollection]);smalltalk.send($rec, "_setStreamSize_", [smalltalk.send(aCollection, "_size", [])]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_new", []));
  4738. return self;
  4739. },
  4740. 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')}),
  4741. smalltalk.Stream.klass);
  4742. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel');
  4743. smalltalk.addMethod(
  4744. '_next_',
  4745. smalltalk.method({
  4746. selector: 'next:',
  4747. category: 'reading',
  4748. fn: function (anInteger) {
  4749. var self = this;
  4750. var tempCollection = nil;
  4751. tempCollection = smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []);
  4752. smalltalk.send(anInteger, "_timesRepeat_", [function () {return smalltalk.send(smalltalk.send(self, "_atEnd", []), "_ifFalse_", [function () {return tempCollection = smalltalk.send(tempCollection, "__comma", [smalltalk.send(self, "_next", [])]);}]);}]);
  4753. return tempCollection;
  4754. return self;
  4755. },
  4756. 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')}),
  4757. smalltalk.StringStream);
  4758. smalltalk.addMethod(
  4759. '_nextPut_',
  4760. smalltalk.method({
  4761. selector: 'nextPut:',
  4762. category: 'writing',
  4763. fn: function (aString) {
  4764. var self = this;
  4765. smalltalk.send(self, "_nextPutAll_", [aString]);
  4766. return self;
  4767. },
  4768. source: unescape('nextPut%3A%20aString%0A%09self%20nextPutAll%3A%20aString%0A')}),
  4769. smalltalk.StringStream);
  4770. smalltalk.addMethod(
  4771. '_nextPutAll_',
  4772. smalltalk.method({
  4773. selector: 'nextPutAll:',
  4774. category: 'writing',
  4775. fn: function (aString) {
  4776. var self = this;
  4777. smalltalk.send(self, "_setCollection_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [1, smalltalk.send(self, "_position", [])]), "__comma", [aString]), "__comma", [smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [1]), "__plus", [smalltalk.send(aString, "_size", [])]), smalltalk.send(smalltalk.send(self, "_collection", []), "_size", [])])])]);
  4778. smalltalk.send(self, "_position_", [smalltalk.send(smalltalk.send(self, "_position", []), "__plus", [smalltalk.send(aString, "_size", [])])]);
  4779. smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
  4780. return self;
  4781. },
  4782. 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')}),
  4783. smalltalk.StringStream);
  4784. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class', 'chunkParser'], 'Kernel');
  4785. smalltalk.addMethod(
  4786. '_class_',
  4787. smalltalk.method({
  4788. selector: 'class:',
  4789. category: 'accessing',
  4790. fn: function (aClass) {
  4791. var self = this;
  4792. self['@class'] = aClass;
  4793. return self;
  4794. },
  4795. source: unescape('class%3A%20aClass%0A%09class%20%3A%3D%20aClass%0A')}),
  4796. smalltalk.ClassCommentReader);
  4797. smalltalk.addMethod(
  4798. '_scanFrom_',
  4799. smalltalk.method({
  4800. selector: 'scanFrom:',
  4801. category: 'fileIn',
  4802. fn: function (aStream) {
  4803. var self = this;
  4804. var nextChunk = nil;
  4805. nextChunk = smalltalk.send(smalltalk.send(smalltalk.send(self['@chunkParser'], "_emptyChunk", []), "__slash", [smalltalk.send(self['@chunkParser'], "_chunk", [])]), "_parse_", [aStream]);
  4806. smalltalk.send(smalltalk.send(nextChunk, "_isEmptyChunk", []), "_ifFalse_", [function () {return smalltalk.send(self, "_setComment_", [smalltalk.send(nextChunk, "_contents", [])]);}]);
  4807. return self;
  4808. },
  4809. 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')}),
  4810. smalltalk.ClassCommentReader);
  4811. smalltalk.addMethod(
  4812. '_initialize',
  4813. smalltalk.method({
  4814. selector: 'initialize',
  4815. category: 'initialization',
  4816. fn: function () {
  4817. var self = this;
  4818. self.klass.superclass.fn.prototype._initialize.apply(self, []);
  4819. self['@chunkParser'] = smalltalk.send(smalltalk.ChunkParser, "_new", []);
  4820. return self;
  4821. },
  4822. source: unescape('initialize%0A%09super%20initialize.%0A%09chunkParser%20%3A%3D%20ChunkParser%20new.%0A')}),
  4823. smalltalk.ClassCommentReader);
  4824. smalltalk.addMethod(
  4825. '_setComment_',
  4826. smalltalk.method({
  4827. selector: 'setComment:',
  4828. category: 'private',
  4829. fn: function (aString) {
  4830. var self = this;
  4831. smalltalk.send(self['@class'], "_comment_", [aString]);
  4832. return self;
  4833. },
  4834. source: unescape('setComment%3A%20aString%0A%20%20%20%20class%20comment%3A%20aString%0A')}),
  4835. smalltalk.ClassCommentReader);
  4836. smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel');
  4837. smalltalk.addMethod(
  4838. '_next',
  4839. smalltalk.method({
  4840. selector: 'next',
  4841. category: 'accessing',
  4842. fn: function () {
  4843. var self = this;
  4844. return Math.random();
  4845. return self;
  4846. },
  4847. source: unescape('next%0A%09%7B%27return%20Math.random%28%29%27%7D%0A')}),
  4848. smalltalk.Random);
  4849. smalltalk.addMethod(
  4850. '_next_',
  4851. smalltalk.method({
  4852. selector: 'next:',
  4853. category: 'accessing',
  4854. fn: function (anInteger) {
  4855. var self = this;
  4856. return smalltalk.send(1, "_to_collect_", [anInteger, function (each) {return smalltalk.send(self, "_next", []);}]);
  4857. return self;
  4858. },
  4859. 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')}),
  4860. smalltalk.Random);
  4861. smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel');
  4862. smalltalk.addMethod(
  4863. '_x',
  4864. smalltalk.method({
  4865. selector: 'x',
  4866. category: 'accessing',
  4867. fn: function () {
  4868. var self = this;
  4869. return self['@x'];
  4870. return self;
  4871. },
  4872. source: unescape('x%0A%09%5Ex')}),
  4873. smalltalk.Point);
  4874. smalltalk.addMethod(
  4875. '_y',
  4876. smalltalk.method({
  4877. selector: 'y',
  4878. category: 'accessing',
  4879. fn: function () {
  4880. var self = this;
  4881. return self['@y'];
  4882. return self;
  4883. },
  4884. source: unescape('y%0A%09%5Ey')}),
  4885. smalltalk.Point);
  4886. smalltalk.addMethod(
  4887. '_y_',
  4888. smalltalk.method({
  4889. selector: 'y:',
  4890. category: 'accessing',
  4891. fn: function (aNumber) {
  4892. var self = this;
  4893. self['@y'] = aNumber;
  4894. return self;
  4895. },
  4896. source: unescape('y%3A%20aNumber%0A%09y%20%3A%3D%20aNumber')}),
  4897. smalltalk.Point);
  4898. smalltalk.addMethod(
  4899. '_x_',
  4900. smalltalk.method({
  4901. selector: 'x:',
  4902. category: 'accessing',
  4903. fn: function (aNumber) {
  4904. var self = this;
  4905. self['@x'] = aNumber;
  4906. return self;
  4907. },
  4908. source: unescape('x%3A%20aNumber%0A%09x%20%3A%3D%20aNumber')}),
  4909. smalltalk.Point);
  4910. smalltalk.addMethod(
  4911. '__star',
  4912. smalltalk.method({
  4913. selector: '*',
  4914. category: 'arithmetic',
  4915. fn: function (aPoint) {
  4916. var self = this;
  4917. return smalltalk.send(smalltalk.Point, "_x_y_", [smalltalk.send(smalltalk.send(self, "_x", []), "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), smalltalk.send(smalltalk.send(self, "_y", []), "__star", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  4918. return self;
  4919. },
  4920. source: unescape('*%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20*%20aPoint%20asPoint%20x%20y%3A%20self%20y%20*%20aPoint%20asPoint%20y')}),
  4921. smalltalk.Point);
  4922. smalltalk.addMethod(
  4923. '__plus',
  4924. smalltalk.method({
  4925. selector: '+',
  4926. category: 'arithmetic',
  4927. fn: function (aPoint) {
  4928. var self = this;
  4929. return smalltalk.send(smalltalk.Point, "_x_y_", [smalltalk.send(smalltalk.send(self, "_x", []), "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), smalltalk.send(smalltalk.send(self, "_y", []), "__plus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  4930. return self;
  4931. },
  4932. source: unescape('+%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20+%20aPoint%20asPoint%20x%20y%3A%20self%20y%20+%20aPoint%20asPoint%20y')}),
  4933. smalltalk.Point);
  4934. smalltalk.addMethod(
  4935. '__minus',
  4936. smalltalk.method({
  4937. selector: '-',
  4938. category: 'arithmetic',
  4939. fn: function (aPoint) {
  4940. var self = this;
  4941. return smalltalk.send(smalltalk.Point, "_x_y_", [smalltalk.send(smalltalk.send(self, "_x", []), "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), smalltalk.send(smalltalk.send(self, "_y", []), "__minus", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  4942. return self;
  4943. },
  4944. source: unescape('-%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20-%20aPoint%20asPoint%20x%20y%3A%20self%20y%20-%20aPoint%20asPoint%20y')}),
  4945. smalltalk.Point);
  4946. smalltalk.addMethod(
  4947. '__slash',
  4948. smalltalk.method({
  4949. selector: '/',
  4950. category: 'arithmetic',
  4951. fn: function (aPoint) {
  4952. var self = this;
  4953. return smalltalk.send(smalltalk.Point, "_x_y_", [smalltalk.send(smalltalk.send(self, "_x", []), "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_x", [])]), smalltalk.send(smalltalk.send(self, "_y", []), "__slash", [smalltalk.send(smalltalk.send(aPoint, "_asPoint", []), "_y", [])])]);
  4954. return self;
  4955. },
  4956. source: unescape('/%20aPoint%0A%09%5EPoint%20x%3A%20self%20x%20/%20aPoint%20asPoint%20x%20y%3A%20self%20y%20/%20aPoint%20asPoint%20y')}),
  4957. smalltalk.Point);
  4958. smalltalk.addMethod(
  4959. '_asPoint',
  4960. smalltalk.method({
  4961. selector: 'asPoint',
  4962. category: 'converting',
  4963. fn: function () {
  4964. var self = this;
  4965. return self;
  4966. return self;
  4967. },
  4968. source: unescape('asPoint%0A%09%5Eself')}),
  4969. smalltalk.Point);
  4970. smalltalk.addMethod(
  4971. '_x_y_',
  4972. smalltalk.method({
  4973. selector: 'x:y:',
  4974. category: 'instance creation',
  4975. fn: function (aNumber, anotherNumber) {
  4976. var self = this;
  4977. return function ($rec) {smalltalk.send($rec, "_x_", [aNumber]);smalltalk.send($rec, "_y_", [anotherNumber]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_new", []));
  4978. return self;
  4979. },
  4980. 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')}),
  4981. smalltalk.Point.klass);
  4982. smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel');
  4983. smalltalk.addMethod(
  4984. '_selector',
  4985. smalltalk.method({
  4986. selector: 'selector',
  4987. category: 'accessing',
  4988. fn: function () {
  4989. var self = this;
  4990. return self['@selector'];
  4991. return self;
  4992. },
  4993. source: unescape('selector%0A%09%5Eselector')}),
  4994. smalltalk.Message);
  4995. smalltalk.addMethod(
  4996. '_selector_',
  4997. smalltalk.method({
  4998. selector: 'selector:',
  4999. category: 'accessing',
  5000. fn: function (aString) {
  5001. var self = this;
  5002. self['@selector'] = aString;
  5003. return self;
  5004. },
  5005. source: unescape('selector%3A%20aString%0A%09selector%20%3A%3D%20aString')}),
  5006. smalltalk.Message);
  5007. smalltalk.addMethod(
  5008. '_arguments_',
  5009. smalltalk.method({
  5010. selector: 'arguments:',
  5011. category: 'accessing',
  5012. fn: function (anArray) {
  5013. var self = this;
  5014. self['@arguments'] = anArray;
  5015. return self;
  5016. },
  5017. source: unescape('arguments%3A%20anArray%0A%09arguments%20%3A%3D%20anArray')}),
  5018. smalltalk.Message);
  5019. smalltalk.addMethod(
  5020. '_arguments',
  5021. smalltalk.method({
  5022. selector: 'arguments',
  5023. category: 'accessing',
  5024. fn: function () {
  5025. var self = this;
  5026. return self['@arguments'];
  5027. return self;
  5028. },
  5029. source: unescape('arguments%0A%09%5Earguments')}),
  5030. smalltalk.Message);
  5031. smalltalk.addMethod(
  5032. '_selector_arguments_',
  5033. smalltalk.method({
  5034. selector: 'selector:arguments:',
  5035. category: 'instance creation',
  5036. fn: function (aString, anArray) {
  5037. var self = this;
  5038. return function ($rec) {smalltalk.send($rec, "_selector_", [aString]);smalltalk.send($rec, "_arguments_", [anArray]);return smalltalk.send($rec, "_yourself", []);}(smalltalk.send(self, "_new", []));
  5039. return self;
  5040. },
  5041. source: unescape('selector%3A%20aString%20arguments%3A%20anArray%0A%09%5Eself%20new%0A%09%09selector%3A%20aString%3B%0A%09%09arguments%3A%20anArray%3B%0A%09%09yourself')}),
  5042. smalltalk.Message.klass);
  5043. smalltalk.addClass('MessageNotUnderstood', smalltalk.Error, ['message', 'receiver'], 'Kernel');
  5044. smalltalk.addMethod(
  5045. '_message',
  5046. smalltalk.method({
  5047. selector: 'message',
  5048. category: 'accessing',
  5049. fn: function () {
  5050. var self = this;
  5051. return self['@message'];
  5052. return self;
  5053. },
  5054. source: unescape('message%0A%09%5Emessage')}),
  5055. smalltalk.MessageNotUnderstood);
  5056. smalltalk.addMethod(
  5057. '_message_',
  5058. smalltalk.method({
  5059. selector: 'message:',
  5060. category: 'accessing',
  5061. fn: function (aMessage) {
  5062. var self = this;
  5063. self['@message'] = aMessage;
  5064. return self;
  5065. },
  5066. source: unescape('message%3A%20aMessage%0A%09message%20%3A%3D%20aMessage')}),
  5067. smalltalk.MessageNotUnderstood);
  5068. smalltalk.addMethod(
  5069. '_receiver',
  5070. smalltalk.method({
  5071. selector: 'receiver',
  5072. category: 'accessing',
  5073. fn: function () {
  5074. var self = this;
  5075. return self['@receiver'];
  5076. return self;
  5077. },
  5078. source: unescape('receiver%0A%09%5Ereceiver')}),
  5079. smalltalk.MessageNotUnderstood);
  5080. smalltalk.addMethod(
  5081. '_receiver_',
  5082. smalltalk.method({
  5083. selector: 'receiver:',
  5084. category: 'accessing',
  5085. fn: function (anObject) {
  5086. var self = this;
  5087. self['@receiver'] = anObject;
  5088. return self;
  5089. },
  5090. source: unescape('receiver%3A%20anObject%0A%09receiver%20%3A%3D%20anObject')}),
  5091. smalltalk.MessageNotUnderstood);
  5092. smalltalk.addMethod(
  5093. '_messageText',
  5094. smalltalk.method({
  5095. selector: 'messageText',
  5096. category: 'accessing',
  5097. fn: function () {
  5098. var self = this;
  5099. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_receiver", []), "_asString", []), "__comma", [unescape("%20does%20not%20understand%20%23")]), "__comma", [smalltalk.send(smalltalk.send(self, "_message", []), "_selector", [])]);
  5100. return self;
  5101. },
  5102. source: unescape('messageText%0A%09%5Eself%20receiver%20asString%2C%20%27%20does%20not%20understand%20%23%27%2C%20self%20message%20selector')}),
  5103. smalltalk.MessageNotUnderstood);
  5104. smalltalk.addClass('PPParser', smalltalk.Object, ['memo'], 'Parser');
  5105. smalltalk.addMethod(
  5106. '_initialize',
  5107. smalltalk.method({
  5108. selector: 'initialize',
  5109. category: 'initialization',
  5110. fn: function (){
  5111. var self=this;
  5112. self['@memo']=smalltalk.send(smalltalk.Dictionary, "_new", []);
  5113. return self;},
  5114. source: unescape('initialize%0A%09memo%20%3A%3D%20Dictionary%20new%0A')}),
  5115. smalltalk.PPParser);
  5116. smalltalk.addMethod(
  5117. '_memo',
  5118. smalltalk.method({
  5119. selector: 'memo',
  5120. category: 'accessing',
  5121. fn: function (){
  5122. var self=this;
  5123. return self['@memo'];
  5124. return self;},
  5125. source: unescape('memo%0A%09%5Ememo%0A')}),
  5126. smalltalk.PPParser);
  5127. smalltalk.addMethod(
  5128. '_onFailure_',
  5129. smalltalk.method({
  5130. selector: 'onFailure:',
  5131. category: 'error handling',
  5132. fn: function (aBlock){
  5133. var self=this;
  5134. return smalltalk.send(smalltalk.PPFailureActionParser, "_on_block_", [self, aBlock]);
  5135. return self;},
  5136. source: unescape('onFailure%3A%20aBlock%0A%09%5EPPFailureActionParser%20on%3A%20self%20block%3A%20aBlock%0A')}),
  5137. smalltalk.PPParser);
  5138. smalltalk.addMethod(
  5139. '_flatten',
  5140. smalltalk.method({
  5141. selector: 'flatten',
  5142. category: 'operations',
  5143. fn: function (){
  5144. var self=this;
  5145. return smalltalk.send(smalltalk.PPFlattenParser, "_on_", [self]);
  5146. return self;},
  5147. source: unescape('flatten%0A%09%5EPPFlattenParser%20on%3A%20self%0A')}),
  5148. smalltalk.PPParser);
  5149. smalltalk.addMethod(
  5150. '_withSource',
  5151. smalltalk.method({
  5152. selector: 'withSource',
  5153. category: 'operations',
  5154. fn: function (){
  5155. var self=this;
  5156. return smalltalk.send(smalltalk.PPSourceParser, "_on_", [self]);
  5157. return self;},
  5158. source: unescape('withSource%0A%09%5EPPSourceParser%20on%3A%20self%0A')}),
  5159. smalltalk.PPParser);
  5160. smalltalk.addMethod(
  5161. '__eq_eq_gt',
  5162. smalltalk.method({
  5163. selector: '==>',
  5164. category: 'operations',
  5165. fn: function (aBlock){
  5166. var self=this;
  5167. return smalltalk.send(smalltalk.PPActionParser, "_on_block_", [self, aBlock]);
  5168. return self;},
  5169. source: unescape('%3D%3D%3E%20aBlock%0A%09%5EPPActionParser%20on%3A%20self%20block%3A%20aBlock%0A')}),
  5170. smalltalk.PPParser);
  5171. smalltalk.addMethod(
  5172. '__comma',
  5173. smalltalk.method({
  5174. selector: ',',
  5175. category: 'operations',
  5176. fn: function (aParser){
  5177. var self=this;
  5178. return smalltalk.send(smalltalk.PPSequenceParser, "_with_with_", [self, aParser]);
  5179. return self;},
  5180. source: unescape('%2C%20aParser%0A%09%5EPPSequenceParser%20with%3A%20self%20with%3A%20aParser%0A')}),
  5181. smalltalk.PPParser);
  5182. smalltalk.addMethod(
  5183. '__slash',
  5184. smalltalk.method({
  5185. selector: '/',
  5186. category: 'operations',
  5187. fn: function (aParser){
  5188. var self=this;
  5189. return smalltalk.send(smalltalk.PPChoiceParser, "_with_with_", [self, aParser]);
  5190. return self;},
  5191. source: unescape('/%20aParser%0A%09%5EPPChoiceParser%20with%3A%20self%20with%3A%20aParser%0A')}),
  5192. smalltalk.PPParser);
  5193. smalltalk.addMethod(
  5194. '_plus',
  5195. smalltalk.method({
  5196. selector: 'plus',
  5197. category: 'operations',
  5198. fn: function (){
  5199. var self=this;
  5200. return smalltalk.send(smalltalk.PPRepeatingParser, "_on_min_", [self, (1)]);
  5201. return self;},
  5202. source: unescape('plus%0A%09%5EPPRepeatingParser%20on%3A%20self%20min%3A%201%0A')}),
  5203. smalltalk.PPParser);
  5204. smalltalk.addMethod(
  5205. '_star',
  5206. smalltalk.method({
  5207. selector: 'star',
  5208. category: 'operations',
  5209. fn: function (){
  5210. var self=this;
  5211. return smalltalk.send(smalltalk.PPRepeatingParser, "_on_min_", [self, (0)]);
  5212. return self;},
  5213. source: unescape('star%0A%09%5EPPRepeatingParser%20on%3A%20self%20min%3A%200%0A')}),
  5214. smalltalk.PPParser);
  5215. smalltalk.addMethod(
  5216. '_not',
  5217. smalltalk.method({
  5218. selector: 'not',
  5219. category: 'operations',
  5220. fn: function (){
  5221. var self=this;
  5222. return smalltalk.send(smalltalk.PPNotParser, "_on_", [self]);
  5223. return self;},
  5224. source: unescape('not%0A%09%5EPPNotParser%20on%3A%20self%0A')}),
  5225. smalltalk.PPParser);
  5226. smalltalk.addMethod(
  5227. '_optional',
  5228. smalltalk.method({
  5229. selector: 'optional',
  5230. category: 'operations',
  5231. fn: function (){
  5232. var self=this;
  5233. return smalltalk.send(self, "__slash", [smalltalk.send(smalltalk.PPEpsilonParser, "_new", [])]);
  5234. return self;},
  5235. source: unescape('optional%0A%09%5Eself%20/%20PPEpsilonParser%20new%0A')}),
  5236. smalltalk.PPParser);
  5237. smalltalk.addMethod(
  5238. '_memoizedParse_',
  5239. smalltalk.method({
  5240. selector: 'memoizedParse:',
  5241. category: 'operations',
  5242. fn: function (aStream){
  5243. var self=this;
  5244. var start=nil;
  5245. var end=nil;
  5246. var node=nil;
  5247. start=smalltalk.send(aStream, "_position", []);
  5248. return smalltalk.send(smalltalk.send(self, "_memo", []), "_at_ifPresent_ifAbsent_", [start, (function(value){smalltalk.send(aStream, "_position_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_memo", []), "_at_", [start]), "_second", [])]);return smalltalk.send(value, "_first", []);}), (function(){node=smalltalk.send(self, "_parse_", [aStream]);end=smalltalk.send(aStream, "_position", []);smalltalk.send(smalltalk.send(self, "_memo", []), "_at_put_", [start, smalltalk.send(smalltalk.Array, "_with_with_", [node, end])]);return node;})]);
  5249. return self;},
  5250. 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')}),
  5251. smalltalk.PPParser);
  5252. smalltalk.addMethod(
  5253. '_parse_',
  5254. smalltalk.method({
  5255. selector: 'parse:',
  5256. category: 'parsing',
  5257. fn: function (aStream){
  5258. var self=this;
  5259. smalltalk.send(self, "_subclassResponsibility", []);
  5260. return self;},
  5261. source: unescape('parse%3A%20aStream%0A%09self%20subclassResponsibility%0A')}),
  5262. smalltalk.PPParser);
  5263. smalltalk.addMethod(
  5264. '_parseAll_',
  5265. smalltalk.method({
  5266. selector: 'parseAll:',
  5267. category: 'parsing',
  5268. fn: function (aStream){
  5269. var self=this;
  5270. var result=nil;
  5271. result=smalltalk.send(smalltalk.send(smalltalk.PPSequenceParser, "_with_with_", [self, smalltalk.send(smalltalk.PPEOFParser, "_new", [])]), "_memoizedParse_", [aStream]);
  5272. return smalltalk.send(smalltalk.send(result, "_isParseFailure", []), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_error_", [smalltalk.send(result, "_messageFor_", [smalltalk.send(aStream, "_contents", [])])]);}), (function(){return smalltalk.send(result, "_first", []);})]);
  5273. return self;},
  5274. 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')}),
  5275. smalltalk.PPParser);
  5276. smalltalk.addClass('PPEOFParser', smalltalk.PPParser, [], 'Parser');
  5277. smalltalk.addMethod(
  5278. '_parse_',
  5279. smalltalk.method({
  5280. selector: 'parse:',
  5281. category: 'parsing',
  5282. fn: function (aStream){
  5283. var self=this;
  5284. return smalltalk.send(smalltalk.send(aStream, "_atEnd", []), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.PPFailure, "_new", []), "_reason_at_", ["EOF expected", smalltalk.send(aStream, "_position", [])]);}), (function(){return nil;})]);
  5285. return self;},
  5286. 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')}),
  5287. smalltalk.PPEOFParser);
  5288. smalltalk.addClass('PPAnyParser', smalltalk.PPParser, [], 'Parser');
  5289. smalltalk.addMethod(
  5290. '_parse_',
  5291. smalltalk.method({
  5292. selector: 'parse:',
  5293. category: 'parsing',
  5294. fn: function (aStream){
  5295. var self=this;
  5296. return smalltalk.send(smalltalk.send(aStream, "_atEnd", []), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.PPFailure, "_new", []), "_reason_at_", ["did not expect EOF", smalltalk.send(aStream, "_position", [])]);}), (function(){return smalltalk.send(aStream, "_next", []);})]);
  5297. return self;},
  5298. 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')}),
  5299. smalltalk.PPAnyParser);
  5300. smalltalk.addClass('PPEpsilonParser', smalltalk.PPParser, [], 'Parser');
  5301. smalltalk.addMethod(
  5302. '_parse_',
  5303. smalltalk.method({
  5304. selector: 'parse:',
  5305. category: 'parsing',
  5306. fn: function (aStream){
  5307. var self=this;
  5308. return nil;
  5309. return self;},
  5310. source: unescape('parse%3A%20aStream%0A%09%5Enil%0A')}),
  5311. smalltalk.PPEpsilonParser);
  5312. smalltalk.addClass('PPStringParser', smalltalk.PPParser, ['string'], 'Parser');
  5313. smalltalk.addMethod(
  5314. '_string',
  5315. smalltalk.method({
  5316. selector: 'string',
  5317. category: 'accessing',
  5318. fn: function (){
  5319. var self=this;
  5320. return self['@string'];
  5321. return self;},
  5322. source: unescape('string%0A%09%5Estring%0A')}),
  5323. smalltalk.PPStringParser);
  5324. smalltalk.addMethod(
  5325. '_string_',
  5326. smalltalk.method({
  5327. selector: 'string:',
  5328. category: 'accessing',
  5329. fn: function (aString){
  5330. var self=this;
  5331. self['@string']=aString;
  5332. return self;},
  5333. source: unescape('string%3A%20aString%0A%09string%20%3A%3D%20aString%0A')}),
  5334. smalltalk.PPStringParser);
  5335. smalltalk.addMethod(
  5336. '_parse_',
  5337. smalltalk.method({
  5338. selector: 'parse:',
  5339. category: 'parsing',
  5340. fn: function (aStream){
  5341. var self=this;
  5342. var position=nil;
  5343. var result=nil;
  5344. position=smalltalk.send(aStream, "_position", []);
  5345. result=smalltalk.send(aStream, "_next_", [smalltalk.send(smalltalk.send(self, "_string", []), "_size", [])]);
  5346. return smalltalk.send(smalltalk.send(result, "__eq", [smalltalk.send(self, "_string", [])]), "_ifTrue_ifFalse_", [(function(){return result;}), (function(){smalltalk.send(aStream, "_position_", [position]);return (function($rec){smalltalk.send($rec, "_reason_", [smalltalk.send(smalltalk.send(smalltalk.send("Expected ", "__comma", [smalltalk.send(self, "_string", [])]), "__comma", [" but got "]), "__comma", [smalltalk.send(smalltalk.send(result, "_at_", [position]), "_printString", [])])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.PPFailure, "_new", []));})]);
  5347. return self;},
  5348. 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')}),
  5349. smalltalk.PPStringParser);
  5350. smalltalk.addClass('PPCharacterParser', smalltalk.PPParser, ['regexp'], 'Parser');
  5351. smalltalk.addMethod(
  5352. '_string_',
  5353. smalltalk.method({
  5354. selector: 'string:',
  5355. category: 'accessing',
  5356. fn: function (aString){
  5357. var self=this;
  5358. self['@regexp']=smalltalk.send(smalltalk.RegularExpression, "_fromString_", [smalltalk.send(smalltalk.send(unescape("%5B"), "__comma", [aString]), "__comma", [unescape("%5D")])]);
  5359. return self;},
  5360. 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')}),
  5361. smalltalk.PPCharacterParser);
  5362. smalltalk.addMethod(
  5363. '_parse_',
  5364. smalltalk.method({
  5365. selector: 'parse:',
  5366. category: 'parsing',
  5367. fn: function (aStream){
  5368. var self=this;
  5369. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aStream, "_peek", []), "_notNil", []), "_and_", [(function(){return smalltalk.send(self, "_match_", [smalltalk.send(aStream, "_peek", [])]);})]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aStream, "_next", []);}), (function(){return smalltalk.send(smalltalk.send(smalltalk.PPFailure, "_new", []), "_reason_at_", ["Could not match", smalltalk.send(aStream, "_position", [])]);})]);
  5370. return self;},
  5371. 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')}),
  5372. smalltalk.PPCharacterParser);
  5373. smalltalk.addMethod(
  5374. '_match_',
  5375. smalltalk.method({
  5376. selector: 'match:',
  5377. category: 'private',
  5378. fn: function (aString){
  5379. var self=this;
  5380. return smalltalk.send(aString, "_match_", [self['@regexp']]);
  5381. return self;},
  5382. source: unescape('match%3A%20aString%0A%09%5EaString%20match%3A%20regexp%0A')}),
  5383. smalltalk.PPCharacterParser);
  5384. smalltalk.addClass('PPListParser', smalltalk.PPParser, ['parsers'], 'Parser');
  5385. smalltalk.addMethod(
  5386. '_parsers',
  5387. smalltalk.method({
  5388. selector: 'parsers',
  5389. category: 'accessing',
  5390. fn: function (){
  5391. var self=this;
  5392. return smalltalk.send(self['@parsers'], "_ifNil_", [(function(){return [];})]);
  5393. return self;},
  5394. source: unescape('parsers%0A%09%5Eparsers%20ifNil%3A%20%5B%23%28%29%5D%0A')}),
  5395. smalltalk.PPListParser);
  5396. smalltalk.addMethod(
  5397. '_parsers_',
  5398. smalltalk.method({
  5399. selector: 'parsers:',
  5400. category: 'accessing',
  5401. fn: function (aCollection){
  5402. var self=this;
  5403. self['@parsers']=aCollection;
  5404. return self;},
  5405. source: unescape('parsers%3A%20aCollection%0A%09parsers%20%3A%3D%20aCollection%0A')}),
  5406. smalltalk.PPListParser);
  5407. smalltalk.addMethod(
  5408. '_copyWith_',
  5409. smalltalk.method({
  5410. selector: 'copyWith:',
  5411. category: 'copying',
  5412. fn: function (aParser){
  5413. var self=this;
  5414. return smalltalk.send(smalltalk.send(self, "_class", []), "_withAll_", [smalltalk.send(smalltalk.send(self, "_parsers", []), "_copyWith_", [aParser])]);
  5415. return self;},
  5416. source: unescape('copyWith%3A%20aParser%0A%09%5Eself%20class%20withAll%3A%20%28self%20parsers%20copyWith%3A%20aParser%29%0A')}),
  5417. smalltalk.PPListParser);
  5418. smalltalk.addMethod(
  5419. '_withAll_',
  5420. smalltalk.method({
  5421. selector: 'withAll:',
  5422. category: 'instance creation',
  5423. fn: function (aCollection){
  5424. var self=this;
  5425. return (function($rec){smalltalk.send($rec, "_parsers_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5426. return self;},
  5427. source: unescape('withAll%3A%20aCollection%0A%09%20%20%20%20%5Eself%20new%0A%09%09parsers%3A%20aCollection%3B%0A%09%09yourself%0A')}),
  5428. smalltalk.PPListParser.klass);
  5429. smalltalk.addMethod(
  5430. '_with_with_',
  5431. smalltalk.method({
  5432. selector: 'with:with:',
  5433. category: 'instance creation',
  5434. fn: function (aParser, anotherParser){
  5435. var self=this;
  5436. return smalltalk.send(self, "_withAll_", [smalltalk.send(smalltalk.Array, "_with_with_", [aParser, anotherParser])]);
  5437. return self;},
  5438. 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')}),
  5439. smalltalk.PPListParser.klass);
  5440. smalltalk.addClass('PPSequenceParser', smalltalk.PPListParser, [], 'Parser');
  5441. smalltalk.addMethod(
  5442. '__comma',
  5443. smalltalk.method({
  5444. selector: ',',
  5445. category: 'copying',
  5446. fn: function (aRule){
  5447. var self=this;
  5448. return smalltalk.send(self, "_copyWith_", [aRule]);
  5449. return self;},
  5450. source: unescape('%2C%20aRule%0A%09%5Eself%20copyWith%3A%20aRule%0A')}),
  5451. smalltalk.PPSequenceParser);
  5452. smalltalk.addMethod(
  5453. '_parse_',
  5454. smalltalk.method({
  5455. selector: 'parse:',
  5456. category: 'parsing',
  5457. fn: function (aStream){
  5458. var self=this;
  5459. var start=nil;
  5460. var elements=nil;
  5461. var element=nil;
  5462. start=smalltalk.send(aStream, "_position", []);
  5463. elements=[];
  5464. smalltalk.send(smalltalk.send(self, "_parsers", []), "_detect_ifNone_", [(function(each){element=smalltalk.send(each, "_memoizedParse_", [aStream]);smalltalk.send(elements, "_add_", [element]);return smalltalk.send(element, "_isParseFailure", []);}), (function(){return nil;})]);
  5465. return smalltalk.send(smalltalk.send(element, "_isParseFailure", []), "_ifFalse_ifTrue_", [(function(){return elements;}), (function(){smalltalk.send(aStream, "_position_", [start]);return element;})]);
  5466. return self;},
  5467. 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')}),
  5468. smalltalk.PPSequenceParser);
  5469. smalltalk.addClass('PPChoiceParser', smalltalk.PPListParser, [], 'Parser');
  5470. smalltalk.addMethod(
  5471. '__slash',
  5472. smalltalk.method({
  5473. selector: '/',
  5474. category: 'copying',
  5475. fn: function (aRule){
  5476. var self=this;
  5477. return smalltalk.send(self, "_copyWith_", [aRule]);
  5478. return self;},
  5479. source: unescape('/%20aRule%0A%09%5Eself%20copyWith%3A%20aRule%0A')}),
  5480. smalltalk.PPChoiceParser);
  5481. smalltalk.addMethod(
  5482. '_parse_',
  5483. smalltalk.method({
  5484. selector: 'parse:',
  5485. category: 'parsing',
  5486. fn: function (aStream){
  5487. var self=this;
  5488. var result=nil;
  5489. smalltalk.send(smalltalk.send(self, "_parsers", []), "_detect_ifNone_", [(function(each){result=smalltalk.send(each, "_memoizedParse_", [aStream]);return smalltalk.send(smalltalk.send(result, "_isParseFailure", []), "_not", []);}), (function(){return nil;})]);
  5490. return result;
  5491. return self;},
  5492. 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')}),
  5493. smalltalk.PPChoiceParser);
  5494. smalltalk.addClass('PPDelegateParser', smalltalk.PPParser, ['parser'], 'Parser');
  5495. smalltalk.addMethod(
  5496. '_parser',
  5497. smalltalk.method({
  5498. selector: 'parser',
  5499. category: 'accessing',
  5500. fn: function (){
  5501. var self=this;
  5502. return self['@parser'];
  5503. return self;},
  5504. source: unescape('parser%0A%09%5Eparser%0A')}),
  5505. smalltalk.PPDelegateParser);
  5506. smalltalk.addMethod(
  5507. '_parser_',
  5508. smalltalk.method({
  5509. selector: 'parser:',
  5510. category: 'accessing',
  5511. fn: function (aParser){
  5512. var self=this;
  5513. self['@parser']=aParser;
  5514. return self;},
  5515. source: unescape('parser%3A%20aParser%0A%09parser%20%3A%3D%20aParser%0A')}),
  5516. smalltalk.PPDelegateParser);
  5517. smalltalk.addMethod(
  5518. '_parse_',
  5519. smalltalk.method({
  5520. selector: 'parse:',
  5521. category: 'parsing',
  5522. fn: function (aStream){
  5523. var self=this;
  5524. return smalltalk.send(smalltalk.send(self, "_parser", []), "_memoizedParse_", [aStream]);
  5525. return self;},
  5526. source: unescape('parse%3A%20aStream%0A%09%5Eself%20parser%20memoizedParse%3A%20aStream%0A')}),
  5527. smalltalk.PPDelegateParser);
  5528. smalltalk.addMethod(
  5529. '_on_',
  5530. smalltalk.method({
  5531. selector: 'on:',
  5532. category: 'instance creation',
  5533. fn: function (aParser){
  5534. var self=this;
  5535. return (function($rec){smalltalk.send($rec, "_parser_", [aParser]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5536. return self;},
  5537. source: unescape('on%3A%20aParser%0A%09%20%20%20%20%5Eself%20new%0A%09%09parser%3A%20aParser%3B%0A%09%09yourself%0A')}),
  5538. smalltalk.PPDelegateParser.klass);
  5539. smalltalk.addClass('PPAndParser', smalltalk.PPDelegateParser, [], 'Parser');
  5540. smalltalk.addMethod(
  5541. '_parse_',
  5542. smalltalk.method({
  5543. selector: 'parse:',
  5544. category: 'parsing',
  5545. fn: function (aStream){
  5546. var self=this;
  5547. return smalltalk.send(self, "_basicParse_", [aStream]);
  5548. return self;},
  5549. source: unescape('parse%3A%20aStream%0A%09%5Eself%20basicParse%3A%20aStream%0A')}),
  5550. smalltalk.PPAndParser);
  5551. smalltalk.addMethod(
  5552. '_basicParse_',
  5553. smalltalk.method({
  5554. selector: 'basicParse:',
  5555. category: 'parsing',
  5556. fn: function (aStream){
  5557. var self=this;
  5558. var element=nil;
  5559. var position=nil;
  5560. position=smalltalk.send(aStream, "_position", []);
  5561. element=smalltalk.send(smalltalk.send(self, "_parser", []), "_memoizedParse_", [aStream]);
  5562. smalltalk.send(aStream, "_position_", [position]);
  5563. return element;
  5564. return self;},
  5565. 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')}),
  5566. smalltalk.PPAndParser);
  5567. smalltalk.addClass('PPNotParser', smalltalk.PPAndParser, [], 'Parser');
  5568. smalltalk.addMethod(
  5569. '_parse_',
  5570. smalltalk.method({
  5571. selector: 'parse:',
  5572. category: 'parsing',
  5573. fn: function (aStream){
  5574. var self=this;
  5575. var element=nil;
  5576. element=smalltalk.send(self, "_basicParse_", [aStream]);
  5577. return smalltalk.send(smalltalk.send(element, "_isParseFailure", []), "_ifTrue_ifFalse_", [(function(){return nil;}), (function(){return smalltalk.send(smalltalk.PPFailure, "_reason_at_", [element, smalltalk.send(aStream, "_position", [])]);})]);
  5578. return self;},
  5579. 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')}),
  5580. smalltalk.PPNotParser);
  5581. smalltalk.addClass('PPActionParser', smalltalk.PPDelegateParser, ['block'], 'Parser');
  5582. smalltalk.addMethod(
  5583. '_block',
  5584. smalltalk.method({
  5585. selector: 'block',
  5586. category: 'accessing',
  5587. fn: function (){
  5588. var self=this;
  5589. return self['@block'];
  5590. return self;},
  5591. source: unescape('block%0A%09%5Eblock%0A')}),
  5592. smalltalk.PPActionParser);
  5593. smalltalk.addMethod(
  5594. '_block_',
  5595. smalltalk.method({
  5596. selector: 'block:',
  5597. category: 'accessing',
  5598. fn: function (aBlock){
  5599. var self=this;
  5600. self['@block']=aBlock;
  5601. return self;},
  5602. source: unescape('block%3A%20aBlock%0A%09block%20%3A%3D%20aBlock%0A')}),
  5603. smalltalk.PPActionParser);
  5604. smalltalk.addMethod(
  5605. '_parse_',
  5606. smalltalk.method({
  5607. selector: 'parse:',
  5608. category: 'parsing',
  5609. fn: function (aStream){
  5610. var self=this;
  5611. var element=nil;
  5612. element=smalltalk.send(smalltalk.send(self, "_parser", []), "_memoizedParse_", [aStream]);
  5613. return smalltalk.send(smalltalk.send(element, "_isParseFailure", []), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(smalltalk.send(self, "_block", []), "_value_", [element]);}), (function(){return element;})]);
  5614. return self;},
  5615. 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')}),
  5616. smalltalk.PPActionParser);
  5617. smalltalk.addMethod(
  5618. '_on_block_',
  5619. smalltalk.method({
  5620. selector: 'on:block:',
  5621. category: 'instance creation',
  5622. fn: function (aParser, aBlock){
  5623. var self=this;
  5624. return (function($rec){smalltalk.send($rec, "_parser_", [aParser]);smalltalk.send($rec, "_block_", [aBlock]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5625. return self;},
  5626. 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')}),
  5627. smalltalk.PPActionParser.klass);
  5628. smalltalk.addClass('PPFlattenParser', smalltalk.PPDelegateParser, [], 'Parser');
  5629. smalltalk.addMethod(
  5630. '_parse_',
  5631. smalltalk.method({
  5632. selector: 'parse:',
  5633. category: 'parsing',
  5634. fn: function (aStream){
  5635. var self=this;
  5636. var start=nil;
  5637. var element=nil;
  5638. var stop=nil;
  5639. start=smalltalk.send(aStream, "_position", []);
  5640. element=smalltalk.send(smalltalk.send(self, "_parser", []), "_memoizedParse_", [aStream]);
  5641. return smalltalk.send(smalltalk.send(element, "_isParseFailure", []), "_ifTrue_ifFalse_", [(function(){return element;}), (function(){return smalltalk.send(smalltalk.send(aStream, "_collection", []), "_copyFrom_to_", [smalltalk.send(start, "__plus", [(1)]), smalltalk.send(aStream, "_position", [])]);})]);
  5642. return self;},
  5643. 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')}),
  5644. smalltalk.PPFlattenParser);
  5645. smalltalk.addClass('PPSourceParser', smalltalk.PPDelegateParser, [], 'Parser');
  5646. smalltalk.addMethod(
  5647. '_parse_',
  5648. smalltalk.method({
  5649. selector: 'parse:',
  5650. category: 'parsing',
  5651. fn: function (aStream){
  5652. var self=this;
  5653. var start=nil;
  5654. var element=nil;
  5655. var stop=nil;
  5656. var result=nil;
  5657. start=smalltalk.send(aStream, "_position", []);
  5658. element=smalltalk.send(smalltalk.send(self, "_parser", []), "_memoizedParse_", [aStream]);
  5659. return smalltalk.send(smalltalk.send(element, "_isParseFailure", []), "_ifTrue_ifFalse_", [(function(){return element;}), (function(){result=smalltalk.send(smalltalk.send(aStream, "_collection", []), "_copyFrom_to_", [smalltalk.send(start, "__plus", [(1)]), smalltalk.send(aStream, "_position", [])]);return smalltalk.send(smalltalk.Array, "_with_with_", [element, result]);})]);
  5660. return self;},
  5661. 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')}),
  5662. smalltalk.PPSourceParser);
  5663. smalltalk.addClass('PPRepeatingParser', smalltalk.PPDelegateParser, ['min'], 'Parser');
  5664. smalltalk.addMethod(
  5665. '_min',
  5666. smalltalk.method({
  5667. selector: 'min',
  5668. category: 'accessing',
  5669. fn: function (){
  5670. var self=this;
  5671. return self['@min'];
  5672. return self;},
  5673. source: unescape('min%0A%09%5Emin%0A')}),
  5674. smalltalk.PPRepeatingParser);
  5675. smalltalk.addMethod(
  5676. '_min_',
  5677. smalltalk.method({
  5678. selector: 'min:',
  5679. category: 'accessing',
  5680. fn: function (aNumber){
  5681. var self=this;
  5682. self['@min']=aNumber;
  5683. return self;},
  5684. source: unescape('min%3A%20aNumber%0A%09min%20%3A%3D%20aNumber%0A')}),
  5685. smalltalk.PPRepeatingParser);
  5686. smalltalk.addMethod(
  5687. '_parse_',
  5688. smalltalk.method({
  5689. selector: 'parse:',
  5690. category: 'parsing',
  5691. fn: function (aStream){
  5692. var self=this;
  5693. var start=nil;
  5694. var element=nil;
  5695. var elements=nil;
  5696. var failure=nil;
  5697. start=smalltalk.send(aStream, "_position", []);
  5698. elements=smalltalk.send(smalltalk.Array, "_new", []);
  5699. smalltalk.send((function(){return smalltalk.send(smalltalk.send(smalltalk.send(elements, "_size", []), "__lt", [smalltalk.send(self, "_min", [])]), "_and_", [(function(){return smalltalk.send(failure, "_isNil", []);})]);}), "_whileTrue_", [(function(){element=smalltalk.send(smalltalk.send(self, "_parser", []), "_memoizedParse_", [aStream]);return smalltalk.send(smalltalk.send(element, "_isParseFailure", []), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(elements, "_addLast_", [element]);}), (function(){smalltalk.send(aStream, "_position_", [start]);return failure=element;})]);})]);
  5700. return smalltalk.send(failure, "_ifNil_ifNotNil_", [(function(){smalltalk.send((function(){return smalltalk.send(failure, "_isNil", []);}), "_whileTrue_", [(function(){element=smalltalk.send(smalltalk.send(self, "_parser", []), "_memoizedParse_", [aStream]);return smalltalk.send(smalltalk.send(element, "_isParseFailure", []), "_ifTrue_ifFalse_", [(function(){return failure=element;}), (function(){return smalltalk.send(elements, "_addLast_", [element]);})]);})]);return elements;}), (function(){return failure;})]);
  5701. return self;},
  5702. 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')}),
  5703. smalltalk.PPRepeatingParser);
  5704. smalltalk.addMethod(
  5705. '_on_min_',
  5706. smalltalk.method({
  5707. selector: 'on:min:',
  5708. category: 'instance creation',
  5709. fn: function (aParser, aNumber){
  5710. var self=this;
  5711. return (function($rec){smalltalk.send($rec, "_parser_", [aParser]);smalltalk.send($rec, "_min_", [aNumber]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5712. return self;},
  5713. 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')}),
  5714. smalltalk.PPRepeatingParser.klass);
  5715. smalltalk.addClass('PPFailure', smalltalk.Object, ['position', 'reason'], 'Parser');
  5716. smalltalk.addMethod(
  5717. '_position',
  5718. smalltalk.method({
  5719. selector: 'position',
  5720. category: 'accessing',
  5721. fn: function (){
  5722. var self=this;
  5723. return smalltalk.send(self['@position'], "_ifNil_", [(function(){return (0);})]);
  5724. return self;},
  5725. source: unescape('position%0A%09%5Eposition%20ifNil%3A%20%5B0%5D%0A')}),
  5726. smalltalk.PPFailure);
  5727. smalltalk.addMethod(
  5728. '_position_',
  5729. smalltalk.method({
  5730. selector: 'position:',
  5731. category: 'accessing',
  5732. fn: function (aNumber){
  5733. var self=this;
  5734. self['@position']=aNumber;
  5735. return self;},
  5736. source: unescape('position%3A%20aNumber%0A%09position%20%3A%3D%20aNumber%0A')}),
  5737. smalltalk.PPFailure);
  5738. smalltalk.addMethod(
  5739. '_reason',
  5740. smalltalk.method({
  5741. selector: 'reason',
  5742. category: 'accessing',
  5743. fn: function (){
  5744. var self=this;
  5745. return smalltalk.send(self['@reason'], "_ifNil_", [(function(){return "";})]);
  5746. return self;},
  5747. source: unescape('reason%0A%09%5Ereason%20ifNil%3A%20%5B%27%27%5D%0A')}),
  5748. smalltalk.PPFailure);
  5749. smalltalk.addMethod(
  5750. '_reason_',
  5751. smalltalk.method({
  5752. selector: 'reason:',
  5753. category: 'accessing',
  5754. fn: function (aString){
  5755. var self=this;
  5756. self['@reason']=aString;
  5757. return self;},
  5758. source: unescape('reason%3A%20aString%0A%09reason%20%3A%3D%20aString%0A')}),
  5759. smalltalk.PPFailure);
  5760. smalltalk.addMethod(
  5761. '_reason_at_',
  5762. smalltalk.method({
  5763. selector: 'reason:at:',
  5764. category: 'accessing',
  5765. fn: function (aString, anInteger){
  5766. var self=this;
  5767. (function($rec){smalltalk.send($rec, "_reason_", [aString]);return smalltalk.send($rec, "_position_", [anInteger]);})(self);
  5768. return self;},
  5769. 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')}),
  5770. smalltalk.PPFailure);
  5771. smalltalk.addMethod(
  5772. '_isParseFailure',
  5773. smalltalk.method({
  5774. selector: 'isParseFailure',
  5775. category: 'testing',
  5776. fn: function (){
  5777. var self=this;
  5778. return true;
  5779. return self;},
  5780. source: unescape('isParseFailure%0A%09%5Etrue%0A')}),
  5781. smalltalk.PPFailure);
  5782. smalltalk.addMethod(
  5783. '_reason_at_',
  5784. smalltalk.method({
  5785. selector: 'reason:at:',
  5786. category: 'instance creation',
  5787. fn: function (aString, anInteger){
  5788. var self=this;
  5789. return (function($rec){smalltalk.send($rec, "_reason_at_", [aString, anInteger]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  5790. return self;},
  5791. 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')}),
  5792. smalltalk.PPFailure.klass);
  5793. smalltalk.addClass('SmalltalkParser', smalltalk.Object, [], 'Parser');
  5794. smalltalk.addMethod(
  5795. '_parse_',
  5796. smalltalk.method({
  5797. selector: 'parse:',
  5798. category: 'parsing',
  5799. fn: function (aStream){
  5800. var self=this;
  5801. return smalltalk.send(smalltalk.send(self, "_parser", []), "_parse_", [aStream]);
  5802. return self;},
  5803. source: unescape('parse%3A%20aStream%0A%09%5Eself%20parser%20parse%3A%20aStream%0A')}),
  5804. smalltalk.SmalltalkParser);
  5805. smalltalk.addMethod(
  5806. '_parser',
  5807. smalltalk.method({
  5808. selector: 'parser',
  5809. category: 'grammar',
  5810. fn: function (){
  5811. var self=this;
  5812. var method=nil;
  5813. var expression=nil;
  5814. var separator=nil;
  5815. var comment=nil;
  5816. var ws=nil;
  5817. var identifier=nil;
  5818. var keyword=nil;
  5819. var className=nil;
  5820. var string=nil;
  5821. var symbol=nil;
  5822. var number=nil;
  5823. var literalArray=nil;
  5824. var variable=nil;
  5825. var reference=nil;
  5826. var classReference=nil;
  5827. var literal=nil;
  5828. var ret=nil;
  5829. var methodParser=nil;
  5830. var expressionParser=nil;
  5831. var keyword=nil;
  5832. var unarySelector=nil;
  5833. var binarySelector=nil;
  5834. var keywordPattern=nil;
  5835. var unaryPattern=nil;
  5836. var binaryPattern=nil;
  5837. var assignment=nil;
  5838. var temps=nil;
  5839. var blockParamList=nil;
  5840. var block=nil;
  5841. var expression=nil;
  5842. var expressions=nil;
  5843. var subexpression=nil;
  5844. var statements=nil;
  5845. var sequence=nil;
  5846. var operand=nil;
  5847. var unaryMessage=nil;
  5848. var unarySend=nil;
  5849. var unaryTail=nil;
  5850. var binaryMessage=nil;
  5851. var binarySend=nil;
  5852. var binaryTail=nil;
  5853. var keywordMessage=nil;
  5854. var keywordSend=nil;
  5855. var keywordPair=nil;
  5856. var cascade=nil;
  5857. var message=nil;
  5858. var jsStatement=nil;
  5859. separator=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.String, "_cr", []), "__comma", [smalltalk.send(smalltalk.String, "_space", [])]), "__comma", [smalltalk.send(smalltalk.String, "_lf", [])]), "__comma", [smalltalk.send(smalltalk.String, "_tab", [])]), "_asChoiceParser", []);
  5860. comment=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%22"), "_asCharacterParser", []), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%22"), "_asParser", []), "_not", []), "__comma", [smalltalk.send(smalltalk.PPAnyParser, "_new", [])]), "_star", [])]), "__comma", [smalltalk.send(unescape("%22"), "_asCharacterParser", [])]), "_flatten", []);
  5861. ws=smalltalk.send(smalltalk.send(separator, "__slash", [comment]), "_star", []);
  5862. identifier=smalltalk.send(smalltalk.send(smalltalk.send(unescape("a-z"), "_asCharacterParser", []), "__comma", [smalltalk.send(smalltalk.send(unescape("a-zA-Z0-9"), "_asCharacterParser", []), "_star", [])]), "_flatten", []);
  5863. keyword=smalltalk.send(smalltalk.send(identifier, "__comma", [smalltalk.send(":", "_asParser", [])]), "_flatten", []);
  5864. className=smalltalk.send(smalltalk.send(smalltalk.send(unescape("A-Z"), "_asCharacterParser", []), "__comma", [smalltalk.send(smalltalk.send(unescape("a-zA-Z0-9"), "_asCharacterParser", []), "_star", [])]), "_flatten", []);
  5865. string=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%27"), "_asParser", []), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%27%27"), "_asParser", []), "__slash", [smalltalk.send(smalltalk.send(smalltalk.send(unescape("%27"), "_asParser", []), "_not", []), "__comma", [smalltalk.send(smalltalk.PPAnyParser, "_new", [])])]), "_star", []), "_flatten", [])]), "__comma", [smalltalk.send(unescape("%27"), "_asParser", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(smalltalk.ValueNode, "_new", []), "_value_", [smalltalk.send(smalltalk.send(node, "_at_", [(2)]), "_replace_with_", [unescape("%27%27"), unescape("%27")])]);})]);
  5866. symbol=smalltalk.send(smalltalk.send(smalltalk.send(unescape("%23"), "_asParser", []), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(unescape("a-zA-Z0-9"), "_asCharacterParser", []), "_plus", []), "_flatten", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(smalltalk.ValueNode, "_new", []), "_value_", [smalltalk.send(node, "_second", [])]);})]);
  5867. number=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("0-9"), "_asCharacterParser", []), "_plus", []), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(".", "_asParser", []), "__comma", [smalltalk.send(smalltalk.send(unescape("0-9"), "_asCharacterParser", []), "_plus", [])]), "_optional", [])]), "_flatten", []), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(smalltalk.ValueNode, "_new", []), "_value_", [smalltalk.send(node, "_asNumber", [])]);})]);
  5868. literal=smalltalk.send(smalltalk.PPDelegateParser, "_new", []);
  5869. literalArray=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%23%28"), "_asParser", []), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(ws, "__comma", [literal]), "__comma", [ws]), "_star", [])]), "__comma", [smalltalk.send(unescape("%29"), "_asParser", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(smalltalk.ValueNode, "_new", []), "_value_", [smalltalk.send(smalltalk.Array, "_withAll_", [smalltalk.send(smalltalk.send(node, "_second", []), "_collect_", [(function(each){return smalltalk.send(smalltalk.send(each, "_second", []), "_value", []);})])])]);})]);
  5870. variable=smalltalk.send(identifier, "__eq_eq_gt", [(function(token){return smalltalk.send(smalltalk.send(smalltalk.VariableNode, "_new", []), "_value_", [token]);})]);
  5871. classReference=smalltalk.send(className, "__eq_eq_gt", [(function(token){return smalltalk.send(smalltalk.send(smalltalk.ClassReferenceNode, "_new", []), "_value_", [token]);})]);
  5872. reference=smalltalk.send(variable, "__slash", [classReference]);
  5873. binarySelector=smalltalk.send(smalltalk.send(smalltalk.send(unescape("+*/%3D%3E%3C%2C@%25%7E-"), "_asCharacterParser", []), "_plus", []), "_flatten", []);
  5874. unarySelector=identifier;
  5875. keywordPattern=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(ws, "__comma", [keyword]), "__comma", [ws]), "__comma", [identifier]), "_plus", []), "__eq_eq_gt", [(function(nodes){return smalltalk.send(smalltalk.Array, "_with_with_", [smalltalk.send(smalltalk.send(nodes, "_collect_", [(function(each){return smalltalk.send(each, "_at_", [(2)]);})]), "_join_", [""]), smalltalk.send(nodes, "_collect_", [(function(each){return smalltalk.send(each, "_at_", [(4)]);})])]);})]);
  5876. binaryPattern=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(ws, "__comma", [binarySelector]), "__comma", [ws]), "__comma", [identifier]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.Array, "_with_with_", [smalltalk.send(node, "_second", []), smalltalk.send(smalltalk.Array, "_with_", [smalltalk.send(node, "_fourth", [])])]);})]);
  5877. unaryPattern=smalltalk.send(smalltalk.send(ws, "__comma", [unarySelector]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.Array, "_with_with_", [smalltalk.send(node, "_second", []), smalltalk.send(smalltalk.Array, "_new", [])]);})]);
  5878. expression=smalltalk.send(smalltalk.PPDelegateParser, "_new", []);
  5879. expressions=smalltalk.send(smalltalk.send(expression, "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(ws, "__comma", [smalltalk.send(".", "_asParser", [])]), "__comma", [ws]), "__comma", [expression]), "__eq_eq_gt", [(function(node){return smalltalk.send(node, "_fourth", []);})]), "_star", [])]), "__eq_eq_gt", [(function(node){var result=nil;
  5880. result=smalltalk.send(smalltalk.Array, "_with_", [smalltalk.send(node, "_first", [])]);smalltalk.send(smalltalk.send(node, "_second", []), "_do_", [(function(each){return smalltalk.send(result, "_add_", [each]);})]);return result;})]);
  5881. assignment=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(reference, "__comma", [ws]), "__comma", [smalltalk.send(unescape("%3A%3D"), "_asParser", [])]), "__comma", [ws]), "__comma", [expression]), "__eq_eq_gt", [(function(node){return (function($rec){smalltalk.send($rec, "_left_", [smalltalk.send(node, "_first", [])]);return smalltalk.send($rec, "_right_", [smalltalk.send(node, "_at_", [(5)])]);})(smalltalk.send(smalltalk.AssignmentNode, "_new", []));})]);
  5882. ret=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%5E"), "_asParser", []), "__comma", [ws]), "__comma", [expression]), "__comma", [ws]), "__comma", [smalltalk.send(smalltalk.send(".", "_asParser", []), "_optional", [])]), "__eq_eq_gt", [(function(node){return (function($rec){smalltalk.send($rec, "_addNode_", [smalltalk.send(node, "_third", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.ReturnNode, "_new", []));})]);
  5883. temps=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%7C"), "_asParser", []), "__comma", [smalltalk.send(smalltalk.send(ws, "__comma", [identifier]), "_star", [])]), "__comma", [ws]), "__comma", [smalltalk.send(unescape("%7C"), "_asParser", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(node, "_second", []), "_collect_", [(function(each){return smalltalk.send(each, "_second", []);})]);})]);
  5884. blockParamList=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(":", "_asParser", []), "__comma", [identifier]), "__comma", [ws]), "_plus", []), "__comma", [smalltalk.send(unescape("%7C"), "_asParser", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(node, "_first", []), "_collect_", [(function(each){return smalltalk.send(each, "_second", []);})]);})]);
  5885. subexpression=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%28"), "_asParser", []), "__comma", [ws]), "__comma", [expression]), "__comma", [ws]), "__comma", [smalltalk.send(unescape("%29"), "_asParser", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(node, "_third", []);})]);
  5886. statements=smalltalk.send(smalltalk.send(smalltalk.send(ret, "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.Array, "_with_", [node]);})]), "__slash", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(expressions, "__comma", [ws]), "__comma", [smalltalk.send(".", "_asParser", [])]), "__comma", [ws]), "__comma", [ret]), "__eq_eq_gt", [(function(node){return (function($rec){smalltalk.send($rec, "_add_", [smalltalk.send(node, "_at_", [(5)])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(node, "_first", []));})])]), "__slash", [smalltalk.send(smalltalk.send(expressions, "__comma", [smalltalk.send(smalltalk.send(".", "_asParser", []), "_optional", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(node, "_first", []);})])]);
  5887. sequence=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(temps, "_optional", []), "__comma", [ws]), "__comma", [smalltalk.send(statements, "_optional", [])]), "__comma", [ws]), "__eq_eq_gt", [(function(node){return (function($rec){smalltalk.send($rec, "_temps_", [smalltalk.send(node, "_first", [])]);smalltalk.send($rec, "_nodes_", [smalltalk.send(node, "_third", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.SequenceNode, "_new", []));})]);
  5888. block=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%5B"), "_asParser", []), "__comma", [ws]), "__comma", [smalltalk.send(blockParamList, "_optional", [])]), "__comma", [ws]), "__comma", [smalltalk.send(sequence, "_optional", [])]), "__comma", [ws]), "__comma", [smalltalk.send(unescape("%5D"), "_asParser", [])]), "__eq_eq_gt", [(function(node){return (function($rec){smalltalk.send($rec, "_parameters_", [smalltalk.send(node, "_third", [])]);return smalltalk.send($rec, "_addNode_", [smalltalk.send(smalltalk.send(node, "_at_", [(5)]), "_asBlockSequenceNode", [])]);})(smalltalk.send(smalltalk.BlockNode, "_new", []));})]);
  5889. operand=smalltalk.send(smalltalk.send(literal, "__slash", [reference]), "__slash", [subexpression]);
  5890. smalltalk.send(literal, "_parser_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(number, "__slash", [string]), "__slash", [literalArray]), "__slash", [symbol]), "__slash", [block])]);
  5891. unaryMessage=smalltalk.send(smalltalk.send(smalltalk.send(ws, "__comma", [unarySelector]), "__comma", [smalltalk.send(smalltalk.send(":", "_asParser", []), "_not", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(smalltalk.SendNode, "_new", []), "_selector_", [smalltalk.send(node, "_second", [])]);})]);
  5892. unaryTail=smalltalk.send(smalltalk.PPDelegateParser, "_new", []);
  5893. smalltalk.send(unaryTail, "_parser_", [smalltalk.send(smalltalk.send(unaryMessage, "__comma", [smalltalk.send(unaryTail, "_optional", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(node, "_second", []), "_ifNil_ifNotNil_", [(function(){return smalltalk.send(node, "_first", []);}), (function(){return smalltalk.send(smalltalk.send(node, "_second", []), "_valueForReceiver_", [smalltalk.send(node, "_first", [])]);})]);})])]);
  5894. unarySend=smalltalk.send(smalltalk.send(operand, "__comma", [smalltalk.send(unaryTail, "_optional", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(node, "_second", []), "_ifNil_ifNotNil_", [(function(){return smalltalk.send(node, "_first", []);}), (function(){return smalltalk.send(smalltalk.send(node, "_second", []), "_valueForReceiver_", [smalltalk.send(node, "_first", [])]);})]);})]);
  5895. binaryMessage=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(ws, "__comma", [binarySelector]), "__comma", [ws]), "__comma", [smalltalk.send(unarySend, "__slash", [operand])]), "__eq_eq_gt", [(function(node){return (function($rec){smalltalk.send($rec, "_selector_", [smalltalk.send(node, "_second", [])]);return smalltalk.send($rec, "_arguments_", [smalltalk.send(smalltalk.Array, "_with_", [smalltalk.send(node, "_fourth", [])])]);})(smalltalk.send(smalltalk.SendNode, "_new", []));})]);
  5896. binaryTail=smalltalk.send(smalltalk.PPDelegateParser, "_new", []);
  5897. smalltalk.send(binaryTail, "_parser_", [smalltalk.send(smalltalk.send(binaryMessage, "__comma", [smalltalk.send(binaryTail, "_optional", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(node, "_second", []), "_ifNil_ifNotNil_", [(function(){return smalltalk.send(node, "_first", []);}), (function(){return smalltalk.send(smalltalk.send(node, "_second", []), "_valueForReceiver_", [smalltalk.send(node, "_first", [])]);})]);})])]);
  5898. binarySend=smalltalk.send(smalltalk.send(unarySend, "__comma", [smalltalk.send(binaryTail, "_optional", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(node, "_second", []), "_ifNil_ifNotNil_", [(function(){return smalltalk.send(node, "_first", []);}), (function(){return smalltalk.send(smalltalk.send(node, "_second", []), "_valueForReceiver_", [smalltalk.send(node, "_first", [])]);})]);})]);
  5899. keywordPair=smalltalk.send(smalltalk.send(keyword, "__comma", [ws]), "__comma", [binarySend]);
  5900. keywordMessage=smalltalk.send(smalltalk.send(smalltalk.send(ws, "__comma", [keywordPair]), "_plus", []), "__eq_eq_gt", [(function(nodes){return (function($rec){smalltalk.send($rec, "_selector_", [smalltalk.send(smalltalk.send(nodes, "_collect_", [(function(each){return smalltalk.send(smalltalk.send(each, "_second", []), "_first", []);})]), "_join_", [""])]);return smalltalk.send($rec, "_arguments_", [smalltalk.send(nodes, "_collect_", [(function(each){return smalltalk.send(smalltalk.send(each, "_second", []), "_third", []);})])]);})(smalltalk.send(smalltalk.SendNode, "_new", []));})]);
  5901. keywordSend=smalltalk.send(smalltalk.send(binarySend, "__comma", [keywordMessage]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(node, "_second", []), "_valueForReceiver_", [smalltalk.send(node, "_first", [])]);})]);
  5902. message=smalltalk.send(smalltalk.send(binaryMessage, "__slash", [unaryMessage]), "__slash", [keywordMessage]);
  5903. cascade=smalltalk.send(smalltalk.send(smalltalk.send(keywordSend, "__slash", [binarySend]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(ws, "__comma", [smalltalk.send(unescape("%3B"), "_asParser", [])]), "__comma", [message]), "_plus", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(node, "_first", []), "_cascadeNodeWithMessages_", [smalltalk.send(smalltalk.send(node, "_second", []), "_collect_", [(function(each){return smalltalk.send(each, "_third", []);})])]);})]);
  5904. jsStatement=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%7B"), "_asParser", []), "__comma", [ws]), "__comma", [string]), "__comma", [ws]), "__comma", [smalltalk.send(unescape("%7D"), "_asParser", [])]), "__eq_eq_gt", [(function(node){return (function($rec){smalltalk.send($rec, "_source_", [smalltalk.send(node, "_third", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.JSStatementNode, "_new", []));})]);
  5905. smalltalk.send(expression, "_parser_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(assignment, "__slash", [cascade]), "__slash", [keywordSend]), "__slash", [binarySend]), "__slash", [jsStatement])]);
  5906. method=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(ws, "__comma", [smalltalk.send(smalltalk.send(keywordPattern, "__slash", [binaryPattern]), "__slash", [unaryPattern])]), "__comma", [ws]), "__comma", [smalltalk.send(sequence, "_optional", [])]), "__comma", [ws]), "_withSource", []), "__eq_eq_gt", [(function(node){return (function($rec){smalltalk.send($rec, "_selector_", [smalltalk.send(smalltalk.send(smalltalk.send(node, "_first", []), "_second", []), "_first", [])]);smalltalk.send($rec, "_arguments_", [smalltalk.send(smalltalk.send(smalltalk.send(node, "_first", []), "_second", []), "_second", [])]);smalltalk.send($rec, "_addNode_", [smalltalk.send(smalltalk.send(node, "_first", []), "_fourth", [])]);smalltalk.send($rec, "_source_", [smalltalk.send(node, "_second", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.MethodNode, "_new", []));})]);
  5907. return smalltalk.send(smalltalk.send(method, "__comma", [smalltalk.send(smalltalk.PPEOFParser, "_new", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(node, "_first", []);})]);
  5908. return self;},
  5909. 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')}),
  5910. smalltalk.SmalltalkParser);
  5911. smalltalk.addMethod(
  5912. '_parse_',
  5913. smalltalk.method({
  5914. selector: 'parse:',
  5915. category: 'instance creation',
  5916. fn: function (aStream){
  5917. var self=this;
  5918. return smalltalk.send(smalltalk.send(self, "_new", []), "_parse_", [aStream]);
  5919. return self;},
  5920. source: unescape('parse%3A%20aStream%0A%09%20%20%20%20%5Eself%20new%0A%09%09parse%3A%20aStream%0A')}),
  5921. smalltalk.SmalltalkParser.klass);
  5922. smalltalk.addClass('Chunk', smalltalk.Object, ['contents'], 'Parser');
  5923. smalltalk.addMethod(
  5924. '_contents',
  5925. smalltalk.method({
  5926. selector: 'contents',
  5927. category: 'accessing',
  5928. fn: function (){
  5929. var self=this;
  5930. return smalltalk.send(self['@contents'], "_ifNil_", [(function(){return "";})]);
  5931. return self;},
  5932. source: unescape('contents%0A%09%5Econtents%20ifNil%3A%20%5B%27%27%5D%0A')}),
  5933. smalltalk.Chunk);
  5934. smalltalk.addMethod(
  5935. '_contents_',
  5936. smalltalk.method({
  5937. selector: 'contents:',
  5938. category: 'accessing',
  5939. fn: function (aString){
  5940. var self=this;
  5941. self['@contents']=aString;
  5942. return self;},
  5943. source: unescape('contents%3A%20aString%0A%09contents%20%3A%3D%20aString%0A')}),
  5944. smalltalk.Chunk);
  5945. smalltalk.addMethod(
  5946. '_isEmptyChunk',
  5947. smalltalk.method({
  5948. selector: 'isEmptyChunk',
  5949. category: 'testing',
  5950. fn: function (){
  5951. var self=this;
  5952. return false;
  5953. return self;},
  5954. source: unescape('isEmptyChunk%0A%09%5Efalse%0A')}),
  5955. smalltalk.Chunk);
  5956. smalltalk.addMethod(
  5957. '_isInstructionChunk',
  5958. smalltalk.method({
  5959. selector: 'isInstructionChunk',
  5960. category: 'testing',
  5961. fn: function (){
  5962. var self=this;
  5963. return false;
  5964. return self;},
  5965. source: unescape('isInstructionChunk%0A%09%5Efalse%0A')}),
  5966. smalltalk.Chunk);
  5967. smalltalk.addClass('InstructionChunk', smalltalk.Chunk, [], 'Parser');
  5968. smalltalk.addMethod(
  5969. '_isInstructionChunk',
  5970. smalltalk.method({
  5971. selector: 'isInstructionChunk',
  5972. category: 'testing',
  5973. fn: function (){
  5974. var self=this;
  5975. return true;
  5976. return self;},
  5977. source: unescape('isInstructionChunk%0A%09%5Etrue%0A')}),
  5978. smalltalk.InstructionChunk);
  5979. smalltalk.addClass('EmptyChunk', smalltalk.Chunk, [], 'Parser');
  5980. smalltalk.addMethod(
  5981. '_isEmptyChunk',
  5982. smalltalk.method({
  5983. selector: 'isEmptyChunk',
  5984. category: 'testing',
  5985. fn: function (){
  5986. var self=this;
  5987. return true;
  5988. return self;},
  5989. source: unescape('isEmptyChunk%0A%09%5Etrue%0A')}),
  5990. smalltalk.EmptyChunk);
  5991. smalltalk.addClass('ChunkParser', smalltalk.Object, ['parser', 'separator', 'eof', 'ws', 'chunk', 'emptyChunk', 'instructionChunk'], 'Parser');
  5992. smalltalk.addMethod(
  5993. '_parser',
  5994. smalltalk.method({
  5995. selector: 'parser',
  5996. category: 'accessing',
  5997. fn: function (){
  5998. var self=this;
  5999. return smalltalk.send(self['@parser'], "_ifNil_", [(function(){return self['@parser']=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_instructionChunk", []), "__slash", [smalltalk.send(self, "_emptyChunk", [])]), "__slash", [smalltalk.send(self, "_chunk", [])]), "__slash", [smalltalk.send(self, "_eof", [])]);})]);
  6000. return self;},
  6001. 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')}),
  6002. smalltalk.ChunkParser);
  6003. smalltalk.addMethod(
  6004. '_eof',
  6005. smalltalk.method({
  6006. selector: 'eof',
  6007. category: 'accessing',
  6008. fn: function (){
  6009. var self=this;
  6010. return smalltalk.send(self['@eof'], "_ifNil_", [(function(){return self['@eof']=smalltalk.send(smalltalk.send(smalltalk.send(self, "_ws", []), "__comma", [smalltalk.send(smalltalk.PPEOFParser, "_new", [])]), "__eq_eq_gt", [(function(node){return nil;})]);})]);
  6011. return self;},
  6012. 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')}),
  6013. smalltalk.ChunkParser);
  6014. smalltalk.addMethod(
  6015. '_separator',
  6016. smalltalk.method({
  6017. selector: 'separator',
  6018. category: 'accessing',
  6019. fn: function (){
  6020. var self=this;
  6021. return smalltalk.send(self['@separator'], "_ifNil_", [(function(){return self['@separator']=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.String, "_cr", []), "__comma", [smalltalk.send(smalltalk.String, "_space", [])]), "__comma", [smalltalk.send(smalltalk.String, "_lf", [])]), "__comma", [smalltalk.send(smalltalk.String, "_tab", [])]), "_asChoiceParser", []);})]);
  6022. return self;},
  6023. 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')}),
  6024. smalltalk.ChunkParser);
  6025. smalltalk.addMethod(
  6026. '_ws',
  6027. smalltalk.method({
  6028. selector: 'ws',
  6029. category: 'accessing',
  6030. fn: function (){
  6031. var self=this;
  6032. return smalltalk.send(self['@ws'], "_ifNil_", [(function(){return self['@ws']=smalltalk.send(smalltalk.send(self, "_separator", []), "_star", []);})]);
  6033. return self;},
  6034. source: unescape('ws%0A%09%5Ews%20ifNil%3A%20%5Bws%20%3A%3D%20self%20separator%20star%5D%0A')}),
  6035. smalltalk.ChunkParser);
  6036. smalltalk.addMethod(
  6037. '_chunk',
  6038. smalltalk.method({
  6039. selector: 'chunk',
  6040. category: 'accessing',
  6041. fn: function (){
  6042. var self=this;
  6043. return smalltalk.send(self['@chunk'], "_ifNil_", [(function(){return self['@chunk']=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_ws", []), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%21%21"), "_asParser", []), "__slash", [smalltalk.send(smalltalk.send(smalltalk.send(unescape("%21"), "_asParser", []), "_not", []), "__comma", [smalltalk.send(smalltalk.PPAnyParser, "_new", [])])]), "_plus", []), "_flatten", [])]), "__comma", [smalltalk.send(unescape("%21"), "_asParser", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(smalltalk.Chunk, "_new", []), "_contents_", [smalltalk.send(smalltalk.send(node, "_second", []), "_replace_with_", [unescape("%21%21"), unescape("%21")])]);})]);})]);
  6044. return self;},
  6045. 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')}),
  6046. smalltalk.ChunkParser);
  6047. smalltalk.addMethod(
  6048. '_emptyChunk',
  6049. smalltalk.method({
  6050. selector: 'emptyChunk',
  6051. category: 'accessing',
  6052. fn: function (){
  6053. var self=this;
  6054. return smalltalk.send(self['@emptyChunk'], "_ifNil_", [(function(){return self['@emptyChunk']=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_separator", []), "_plus", []), "__comma", [smalltalk.send(unescape("%21"), "_asParser", [])]), "__comma", [smalltalk.send(self, "_ws", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.EmptyChunk, "_new", []);})]);})]);
  6055. return self;},
  6056. 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')}),
  6057. smalltalk.ChunkParser);
  6058. smalltalk.addMethod(
  6059. '_instructionChunk',
  6060. smalltalk.method({
  6061. selector: 'instructionChunk',
  6062. category: '',
  6063. fn: function (){
  6064. var self=this;
  6065. return smalltalk.send(self['@instructionChunk'], "_ifNil_", [(function(){return self['@instructionChunk']=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_ws", []), "__comma", [smalltalk.send(unescape("%21"), "_asParser", [])]), "__comma", [smalltalk.send(self, "_chunk", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(smalltalk.InstructionChunk, "_new", []), "_contents_", [smalltalk.send(smalltalk.send(node, "_last", []), "_contents", [])]);})]);})]);
  6066. return self;},
  6067. 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')}),
  6068. smalltalk.ChunkParser);
  6069. smalltalk.addClass('Importer', smalltalk.Object, ['chunkParser'], 'Parser');
  6070. smalltalk.addMethod(
  6071. '_chunkParser',
  6072. smalltalk.method({
  6073. selector: 'chunkParser',
  6074. category: 'accessing',
  6075. fn: function (){
  6076. var self=this;
  6077. return smalltalk.send(self['@chunkParser'], "_ifNil_", [(function(){return self['@chunkParser']=smalltalk.send(smalltalk.send(smalltalk.ChunkParser, "_new", []), "_parser", []);})]);
  6078. return self;},
  6079. source: unescape('chunkParser%0A%09%5EchunkParser%20ifNil%3A%20%5BchunkParser%20%3A%3D%20ChunkParser%20new%20parser%5D%0A')}),
  6080. smalltalk.Importer);
  6081. smalltalk.addMethod(
  6082. '_import_',
  6083. smalltalk.method({
  6084. selector: 'import:',
  6085. category: 'fileIn',
  6086. fn: function (aStream){
  6087. var self=this;
  6088. smalltalk.send(smalltalk.send(aStream, "_atEnd", []), "_ifFalse_", [(function(){var nextChunk=nil;
  6089. nextChunk=smalltalk.send(smalltalk.send(self, "_chunkParser", []), "_parse_", [aStream]);return smalltalk.send(nextChunk, "_ifNotNil_", [(function(){smalltalk.send(smalltalk.send(nextChunk, "_isInstructionChunk", []), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Compiler, "_new", []), "_loadExpression_", [smalltalk.send(nextChunk, "_contents", [])]), "_scanFrom_", [aStream]);}), (function(){return smalltalk.send(smalltalk.send(smalltalk.Compiler, "_new", []), "_loadExpression_", [smalltalk.send(nextChunk, "_contents", [])]);})]);return smalltalk.send(self, "_import_", [aStream]);})]);})]);
  6090. return self;},
  6091. 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')}),
  6092. smalltalk.Importer);
  6093. smalltalk.addClass('Exporter', smalltalk.Object, [], 'Parser');
  6094. smalltalk.addMethod(
  6095. '_exportCategory_',
  6096. smalltalk.method({
  6097. selector: 'exportCategory:',
  6098. category: 'fileOut',
  6099. fn: function (aString){
  6100. var self=this;
  6101. var stream=nil;
  6102. stream=smalltalk.send("", "_writeStream", []);
  6103. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Smalltalk, "_current", []), "_classes", []), "_select_", [(function(each){return smalltalk.send(smalltalk.send(each, "_category", []), "__eq", [aString]);})]), "_do_", [(function(each){return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(self, "_export_", [each])]);})]);
  6104. return smalltalk.send(stream, "_contents", []);
  6105. return self;},
  6106. 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')}),
  6107. smalltalk.Exporter);
  6108. smalltalk.addMethod(
  6109. '_export_',
  6110. smalltalk.method({
  6111. selector: 'export:',
  6112. category: 'fileOut',
  6113. fn: function (aClass){
  6114. var self=this;
  6115. var stream=nil;
  6116. stream=smalltalk.send("", "_writeStream", []);
  6117. smalltalk.send(self, "_exportDefinitionOf_on_", [aClass, stream]);
  6118. smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(smalltalk.String, "_cr", [])]);
  6119. smalltalk.send(self, "_exportMethodsOf_on_", [aClass, stream]);
  6120. smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(smalltalk.String, "_cr", [])]);
  6121. smalltalk.send(self, "_exportMetaDefinitionOf_on_", [aClass, stream]);
  6122. smalltalk.send(self, "_exportMethodsOf_on_", [smalltalk.send(aClass, "_class", []), stream]);
  6123. smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(smalltalk.String, "_cr", [])]);
  6124. return smalltalk.send(stream, "_contents", []);
  6125. return self;},
  6126. 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')}),
  6127. smalltalk.Exporter);
  6128. smalltalk.addMethod(
  6129. '_exportDefinitionOf_on_',
  6130. smalltalk.method({
  6131. selector: 'exportDefinitionOf:on:',
  6132. category: 'private',
  6133. fn: function (aClass, aStream){
  6134. var self=this;
  6135. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("smalltalk.addClass%28")]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])]), "__comma", [unescape("%27%2C%20")])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_superclass", [])])])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%2C%20%5B")]);})(aStream);
  6136. smalltalk.send(smalltalk.send(aClass, "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [each]), "__comma", [unescape("%27")])]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [unescape("%2C%20")]);})]);
  6137. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("%5D%2C%20%27")]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(aClass, "_category", []), "__comma", [unescape("%27")])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%29%3B")]);})(aStream);
  6138. smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_comment", []), "_notEmpty", []), "_ifTrue_", [(function(){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.String, "_cr", [])]);smalltalk.send($rec, "_nextPutAll_", ["smalltalk."]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_classNameFor_", [aClass])]);smalltalk.send($rec, "_nextPutAll_", [unescape(".comment%3D")]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("unescape%28%27"), "__comma", [smalltalk.send(smalltalk.send(aClass, "_comment", []), "_escaped", [])]), "__comma", [unescape("%27%29")])]);})(aStream);})]);
  6139. return self;},
  6140. 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%20instanceVariableNames%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')}),
  6141. smalltalk.Exporter);
  6142. smalltalk.addMethod(
  6143. '_exportMetaDefinitionOf_on_',
  6144. smalltalk.method({
  6145. selector: 'exportMetaDefinitionOf:on:',
  6146. category: 'private',
  6147. fn: function (aClass, aStream){
  6148. var self=this;
  6149. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_isEmpty", []), "_ifFalse_", [(function(){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_class", [])])])]);return smalltalk.send($rec, "_nextPutAll_", [unescape(".iVarNames%20%3D%20%5B")]);})(aStream);smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [each]), "__comma", [unescape("%27")])]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [unescape("%2C")]);})]);return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(unescape("%5D%3B"), "__comma", [smalltalk.send(smalltalk.String, "_cr", [])])]);})]);
  6150. return self;},
  6151. source: unescape('exportMetaDefinitionOf%3A%20aClass%20on%3A%20aStream%0A%09aClass%20class%20instanceVariableNames%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%20instanceVariableNames%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')}),
  6152. smalltalk.Exporter);
  6153. smalltalk.addMethod(
  6154. '_exportMethodsOf_on_',
  6155. smalltalk.method({
  6156. selector: 'exportMethodsOf:on:',
  6157. category: 'private',
  6158. fn: function (aClass, aStream){
  6159. var self=this;
  6160. smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_keysAndValuesDo_", [(function(key, value){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(unescape("smalltalk.addMethod%28"), "__comma", [smalltalk.send(smalltalk.String, "_cr", [])])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [smalltalk.send(smalltalk.send(value, "_selector", []), "_asSelector", [])]), "__comma", [unescape("%27%2C")]), "__comma", [smalltalk.send(smalltalk.String, "_cr", [])])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(unescape("smalltalk.method%28%7B"), "__comma", [smalltalk.send(smalltalk.String, "_cr", [])])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(unescape("selector%3A%20%27"), "__comma", [smalltalk.send(value, "_selector", [])]), "__comma", [unescape("%27%2C")]), "__comma", [smalltalk.send(smalltalk.String, "_cr", [])])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(unescape("category%3A%20%27"), "__comma", [smalltalk.send(value, "_category", [])]), "__comma", [unescape("%27%2C")]), "__comma", [smalltalk.send(smalltalk.String, "_cr", [])])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send("fn: ", "__comma", [smalltalk.send(smalltalk.send(value, "_fn", []), "_compiledSource", [])]), "__comma", [unescape("%2C")]), "__comma", [smalltalk.send(smalltalk.String, "_cr", [])])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("source%3A%20unescape%28%27"), "__comma", [smalltalk.send(smalltalk.send(value, "_source", []), "_escaped", [])]), "__comma", [unescape("%27%29")])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(unescape("%7D%29%2C"), "__comma", [smalltalk.send(smalltalk.String, "_cr", [])])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])])]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%29%3B"), "__comma", [smalltalk.send(smalltalk.String, "_cr", [])]), "__comma", [smalltalk.send(smalltalk.String, "_cr", [])])]);})(aStream);})]);
  6161. return self;},
  6162. 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')}),
  6163. smalltalk.Exporter);
  6164. smalltalk.addMethod(
  6165. '_classNameFor_',
  6166. smalltalk.method({
  6167. selector: 'classNameFor:',
  6168. category: 'private',
  6169. fn: function (aClass){
  6170. var self=this;
  6171. return smalltalk.send(smalltalk.send(aClass, "_isMetaclass", []), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [".klass"]);}), (function(){return smalltalk.send(smalltalk.send(aClass, "_isNil", []), "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]);})]);
  6172. return self;},
  6173. 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')}),
  6174. smalltalk.Exporter);
  6175. smalltalk.addMethod(
  6176. '_exportAll',
  6177. smalltalk.method({
  6178. selector: 'exportAll',
  6179. category: 'fileOut',
  6180. fn: function (){
  6181. var self=this;
  6182. var categories=nil;
  6183. categories=smalltalk.send(smalltalk.Array, "_new", []);
  6184. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Smalltalk, "_current", []), "_classes", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(categories, "_includes_", [smalltalk.send(each, "_category", [])]), "_ifFalse_", [(function(){return smalltalk.send(categories, "_add_", [smalltalk.send(each, "_category", [])]);})]);})]);
  6185. smalltalk.send(categories, "_do_", [(function(each){return smalltalk.send(self, "_exportCategory_", [each]);})]);
  6186. return self;},
  6187. source: unescape('exportAll%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%09categories%20do%3A%20%5B%3Aeach%20%7C%0A%09%09self%20exportCategory%3A%20each%5D')}),
  6188. smalltalk.Exporter);
  6189. smalltalk.addClass('Node', smalltalk.Object, ['nodes'], 'Compiler');
  6190. smalltalk.addMethod(
  6191. '_nodes',
  6192. smalltalk.method({
  6193. selector: 'nodes',
  6194. category: 'accessing',
  6195. fn: function (){
  6196. var self=this;
  6197. return smalltalk.send(self['@nodes'], "_ifNil_", [(function(){return self['@nodes']=smalltalk.send(smalltalk.Array, "_new", []);})]);
  6198. return self;},
  6199. source: unescape('nodes%0A%09%5Enodes%20ifNil%3A%20%5Bnodes%20%3A%3D%20Array%20new%5D%0A')}),
  6200. smalltalk.Node);
  6201. smalltalk.addMethod(
  6202. '_nodes_',
  6203. smalltalk.method({
  6204. selector: 'nodes:',
  6205. category: 'building',
  6206. fn: function (aCollection){
  6207. var self=this;
  6208. self['@nodes']=aCollection;
  6209. return self;},
  6210. source: unescape('nodes%3A%20aCollection%0A%09nodes%20%3A%3D%20aCollection%0A')}),
  6211. smalltalk.Node);
  6212. smalltalk.addMethod(
  6213. '_addNode_',
  6214. smalltalk.method({
  6215. selector: 'addNode:',
  6216. category: 'accessing',
  6217. fn: function (aNode){
  6218. var self=this;
  6219. smalltalk.send(smalltalk.send(self, "_nodes", []), "_add_", [aNode]);
  6220. return self;},
  6221. source: unescape('addNode%3A%20aNode%0A%09self%20nodes%20add%3A%20aNode%0A')}),
  6222. smalltalk.Node);
  6223. smalltalk.addMethod(
  6224. '_accept_',
  6225. smalltalk.method({
  6226. selector: 'accept:',
  6227. category: 'visiting',
  6228. fn: function (aVisitor){
  6229. var self=this;
  6230. smalltalk.send(aVisitor, "_visitNode_", [self]);
  6231. return self;},
  6232. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitNode%3A%20self%0A')}),
  6233. smalltalk.Node);
  6234. smalltalk.addClass('MethodNode', smalltalk.Node, ['selector', 'arguments', 'source'], 'Compiler');
  6235. smalltalk.addMethod(
  6236. '_selector',
  6237. smalltalk.method({
  6238. selector: 'selector',
  6239. category: 'accessing',
  6240. fn: function (){
  6241. var self=this;
  6242. return self['@selector'];
  6243. return self;},
  6244. source: unescape('selector%0A%09%5Eselector%0A')}),
  6245. smalltalk.MethodNode);
  6246. smalltalk.addMethod(
  6247. '_selector_',
  6248. smalltalk.method({
  6249. selector: 'selector:',
  6250. category: 'accessing',
  6251. fn: function (aString){
  6252. var self=this;
  6253. self['@selector']=aString;
  6254. return self;},
  6255. source: unescape('selector%3A%20aString%0A%09selector%20%3A%3D%20aString%0A')}),
  6256. smalltalk.MethodNode);
  6257. smalltalk.addMethod(
  6258. '_arguments',
  6259. smalltalk.method({
  6260. selector: 'arguments',
  6261. category: 'accessing',
  6262. fn: function (){
  6263. var self=this;
  6264. return smalltalk.send(self['@arguments'], "_ifNil_", [(function(){return [];})]);
  6265. return self;},
  6266. source: unescape('arguments%0A%09%5Earguments%20ifNil%3A%20%5B%23%28%29%5D%0A')}),
  6267. smalltalk.MethodNode);
  6268. smalltalk.addMethod(
  6269. '_arguments_',
  6270. smalltalk.method({
  6271. selector: 'arguments:',
  6272. category: 'accessing',
  6273. fn: function (aCollection){
  6274. var self=this;
  6275. self['@arguments']=aCollection;
  6276. return self;},
  6277. source: unescape('arguments%3A%20aCollection%0A%09arguments%20%3A%3D%20aCollection%0A')}),
  6278. smalltalk.MethodNode);
  6279. smalltalk.addMethod(
  6280. '_source',
  6281. smalltalk.method({
  6282. selector: 'source',
  6283. category: 'accessing',
  6284. fn: function (){
  6285. var self=this;
  6286. return self['@source'];
  6287. return self;},
  6288. source: unescape('source%0A%09%5Esource%0A')}),
  6289. smalltalk.MethodNode);
  6290. smalltalk.addMethod(
  6291. '_source_',
  6292. smalltalk.method({
  6293. selector: 'source:',
  6294. category: 'accessing',
  6295. fn: function (aString){
  6296. var self=this;
  6297. self['@source']=aString;
  6298. return self;},
  6299. source: unescape('source%3A%20aString%0A%09source%20%3A%3D%20aString%0A')}),
  6300. smalltalk.MethodNode);
  6301. smalltalk.addMethod(
  6302. '_accept_',
  6303. smalltalk.method({
  6304. selector: 'accept:',
  6305. category: 'visiting',
  6306. fn: function (aVisitor){
  6307. var self=this;
  6308. smalltalk.send(aVisitor, "_visitMethodNode_", [self]);
  6309. return self;},
  6310. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitMethodNode%3A%20self%0A')}),
  6311. smalltalk.MethodNode);
  6312. smalltalk.addClass('SendNode', smalltalk.Node, ['selector', 'arguments', 'receiver'], 'Compiler');
  6313. smalltalk.addMethod(
  6314. '_selector',
  6315. smalltalk.method({
  6316. selector: 'selector',
  6317. category: 'accessing',
  6318. fn: function (){
  6319. var self=this;
  6320. return self['@selector'];
  6321. return self;},
  6322. source: unescape('selector%0A%09%5Eselector%0A')}),
  6323. smalltalk.SendNode);
  6324. smalltalk.addMethod(
  6325. '_selector_',
  6326. smalltalk.method({
  6327. selector: 'selector:',
  6328. category: 'accessing',
  6329. fn: function (aString){
  6330. var self=this;
  6331. self['@selector']=aString;
  6332. return self;},
  6333. source: unescape('selector%3A%20aString%0A%09selector%20%3A%3D%20aString%0A')}),
  6334. smalltalk.SendNode);
  6335. smalltalk.addMethod(
  6336. '_arguments',
  6337. smalltalk.method({
  6338. selector: 'arguments',
  6339. category: 'accessing',
  6340. fn: function (){
  6341. var self=this;
  6342. return smalltalk.send(self['@arguments'], "_ifNil_", [(function(){return self['@arguments']=[];})]);
  6343. return self;},
  6344. source: unescape('arguments%0A%09%5Earguments%20ifNil%3A%20%5Barguments%20%3A%3D%20%23%28%29%5D%0A')}),
  6345. smalltalk.SendNode);
  6346. smalltalk.addMethod(
  6347. '_arguments_',
  6348. smalltalk.method({
  6349. selector: 'arguments:',
  6350. category: 'accessing',
  6351. fn: function (aCollection){
  6352. var self=this;
  6353. self['@arguments']=aCollection;
  6354. return self;},
  6355. source: unescape('arguments%3A%20aCollection%0A%09arguments%20%3A%3D%20aCollection%0A')}),
  6356. smalltalk.SendNode);
  6357. smalltalk.addMethod(
  6358. '_receiver',
  6359. smalltalk.method({
  6360. selector: 'receiver',
  6361. category: 'accessing',
  6362. fn: function (){
  6363. var self=this;
  6364. return self['@receiver'];
  6365. return self;},
  6366. source: unescape('receiver%0A%09%5Ereceiver%0A')}),
  6367. smalltalk.SendNode);
  6368. smalltalk.addMethod(
  6369. '_receiver_',
  6370. smalltalk.method({
  6371. selector: 'receiver:',
  6372. category: 'accessing',
  6373. fn: function (aNode){
  6374. var self=this;
  6375. self['@receiver']=aNode;
  6376. return self;},
  6377. source: unescape('receiver%3A%20aNode%0A%09receiver%20%3A%3D%20aNode%0A')}),
  6378. smalltalk.SendNode);
  6379. smalltalk.addMethod(
  6380. '_valueForReceiver_',
  6381. smalltalk.method({
  6382. selector: 'valueForReceiver:',
  6383. category: 'accessing',
  6384. fn: function (anObject){
  6385. var self=this;
  6386. return (function($rec){smalltalk.send($rec, "_receiver_", [smalltalk.send(smalltalk.send(self, "_receiver", []), "_ifNil_ifNotNil_", [(function(){return anObject;}), (function(){return smalltalk.send(smalltalk.send(self, "_receiver", []), "_valueForReceiver_", [anObject]);})])]);smalltalk.send($rec, "_selector_", [smalltalk.send(self, "_selector", [])]);smalltalk.send($rec, "_arguments_", [smalltalk.send(self, "_arguments", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.SendNode, "_new", []));
  6387. return self;},
  6388. 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')}),
  6389. smalltalk.SendNode);
  6390. smalltalk.addMethod(
  6391. '_cascadeNodeWithMessages_',
  6392. smalltalk.method({
  6393. selector: 'cascadeNodeWithMessages:',
  6394. category: 'accessing',
  6395. fn: function (aCollection){
  6396. var self=this;
  6397. var first=nil;
  6398. first=(function($rec){smalltalk.send($rec, "_selector_", [smalltalk.send(self, "_selector", [])]);smalltalk.send($rec, "_arguments_", [smalltalk.send(self, "_arguments", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.SendNode, "_new", []));
  6399. return (function($rec){smalltalk.send($rec, "_receiver_", [smalltalk.send(self, "_receiver", [])]);smalltalk.send($rec, "_nodes_", [smalltalk.send(smalltalk.send(smalltalk.Array, "_with_", [first]), "__comma", [aCollection])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.CascadeNode, "_new", []));
  6400. return self;},
  6401. 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')}),
  6402. smalltalk.SendNode);
  6403. smalltalk.addMethod(
  6404. '_accept_',
  6405. smalltalk.method({
  6406. selector: 'accept:',
  6407. category: 'visiting',
  6408. fn: function (aVisitor){
  6409. var self=this;
  6410. smalltalk.send(aVisitor, "_visitSendNode_", [self]);
  6411. return self;},
  6412. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitSendNode%3A%20self%0A')}),
  6413. smalltalk.SendNode);
  6414. smalltalk.addClass('CascadeNode', smalltalk.Node, ['receiver'], 'Compiler');
  6415. smalltalk.addMethod(
  6416. '_receiver',
  6417. smalltalk.method({
  6418. selector: 'receiver',
  6419. category: 'accessing',
  6420. fn: function (){
  6421. var self=this;
  6422. return self['@receiver'];
  6423. return self;},
  6424. source: unescape('receiver%0A%09%5Ereceiver%0A')}),
  6425. smalltalk.CascadeNode);
  6426. smalltalk.addMethod(
  6427. '_receiver_',
  6428. smalltalk.method({
  6429. selector: 'receiver:',
  6430. category: 'accessing',
  6431. fn: function (aNode){
  6432. var self=this;
  6433. self['@receiver']=aNode;
  6434. return self;},
  6435. source: unescape('receiver%3A%20aNode%0A%09receiver%20%3A%3D%20aNode%0A')}),
  6436. smalltalk.CascadeNode);
  6437. smalltalk.addMethod(
  6438. '_accept_',
  6439. smalltalk.method({
  6440. selector: 'accept:',
  6441. category: 'visiting',
  6442. fn: function (aVisitor){
  6443. var self=this;
  6444. smalltalk.send(aVisitor, "_visitCascadeNode_", [self]);
  6445. return self;},
  6446. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitCascadeNode%3A%20self%0A')}),
  6447. smalltalk.CascadeNode);
  6448. smalltalk.addClass('AssignmentNode', smalltalk.Node, ['left', 'right'], 'Compiler');
  6449. smalltalk.addMethod(
  6450. '_left',
  6451. smalltalk.method({
  6452. selector: 'left',
  6453. category: 'accessing',
  6454. fn: function (){
  6455. var self=this;
  6456. return self['@left'];
  6457. return self;},
  6458. source: unescape('left%0A%09%5Eleft%0A')}),
  6459. smalltalk.AssignmentNode);
  6460. smalltalk.addMethod(
  6461. '_left_',
  6462. smalltalk.method({
  6463. selector: 'left:',
  6464. category: 'accessing',
  6465. fn: function (aNode){
  6466. var self=this;
  6467. self['@left']=aNode;
  6468. return self;},
  6469. source: unescape('left%3A%20aNode%0A%09left%20%3A%3D%20aNode%0A')}),
  6470. smalltalk.AssignmentNode);
  6471. smalltalk.addMethod(
  6472. '_right',
  6473. smalltalk.method({
  6474. selector: 'right',
  6475. category: 'accessing',
  6476. fn: function (){
  6477. var self=this;
  6478. return self['@right'];
  6479. return self;},
  6480. source: unescape('right%0A%09%5Eright%0A')}),
  6481. smalltalk.AssignmentNode);
  6482. smalltalk.addMethod(
  6483. '_right_',
  6484. smalltalk.method({
  6485. selector: 'right:',
  6486. category: 'accessing',
  6487. fn: function (aNode){
  6488. var self=this;
  6489. self['@right']=aNode;
  6490. return self;},
  6491. source: unescape('right%3A%20aNode%0A%09right%20%3A%3D%20aNode%0A')}),
  6492. smalltalk.AssignmentNode);
  6493. smalltalk.addMethod(
  6494. '_accept_',
  6495. smalltalk.method({
  6496. selector: 'accept:',
  6497. category: 'visiting',
  6498. fn: function (aVisitor){
  6499. var self=this;
  6500. smalltalk.send(aVisitor, "_visitAssignmentNode_", [self]);
  6501. return self;},
  6502. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitAssignmentNode%3A%20self%0A')}),
  6503. smalltalk.AssignmentNode);
  6504. smalltalk.addClass('BlockNode', smalltalk.Node, ['parameters'], 'Compiler');
  6505. smalltalk.addMethod(
  6506. '_parameters',
  6507. smalltalk.method({
  6508. selector: 'parameters',
  6509. category: 'accessing',
  6510. fn: function (){
  6511. var self=this;
  6512. return smalltalk.send(self['@parameters'], "_ifNil_", [(function(){return self['@parameters']=smalltalk.send(smalltalk.Array, "_new", []);})]);
  6513. return self;},
  6514. source: unescape('parameters%0A%09%5Eparameters%20ifNil%3A%20%5Bparameters%20%3A%3D%20Array%20new%5D%0A')}),
  6515. smalltalk.BlockNode);
  6516. smalltalk.addMethod(
  6517. '_parameters_',
  6518. smalltalk.method({
  6519. selector: 'parameters:',
  6520. category: 'accessing',
  6521. fn: function (aCollection){
  6522. var self=this;
  6523. self['@parameters']=aCollection;
  6524. return self;},
  6525. source: unescape('parameters%3A%20aCollection%0A%09parameters%20%3A%3D%20aCollection%0A')}),
  6526. smalltalk.BlockNode);
  6527. smalltalk.addMethod(
  6528. '_accept_',
  6529. smalltalk.method({
  6530. selector: 'accept:',
  6531. category: 'visiting',
  6532. fn: function (aVisitor){
  6533. var self=this;
  6534. smalltalk.send(aVisitor, "_visitBlockNode_", [self]);
  6535. return self;},
  6536. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitBlockNode%3A%20self%0A')}),
  6537. smalltalk.BlockNode);
  6538. smalltalk.addClass('SequenceNode', smalltalk.Node, ['temps'], 'Compiler');
  6539. smalltalk.addMethod(
  6540. '_temps',
  6541. smalltalk.method({
  6542. selector: 'temps',
  6543. category: 'accessing',
  6544. fn: function (){
  6545. var self=this;
  6546. return smalltalk.send(self['@temps'], "_ifNil_", [(function(){return [];})]);
  6547. return self;},
  6548. source: unescape('temps%0A%09%5Etemps%20ifNil%3A%20%5B%23%28%29%5D%0A')}),
  6549. smalltalk.SequenceNode);
  6550. smalltalk.addMethod(
  6551. '_temps_',
  6552. smalltalk.method({
  6553. selector: 'temps:',
  6554. category: 'accessing',
  6555. fn: function (aCollection){
  6556. var self=this;
  6557. self['@temps']=aCollection;
  6558. return self;},
  6559. source: unescape('temps%3A%20aCollection%0A%09temps%20%3A%3D%20aCollection%0A')}),
  6560. smalltalk.SequenceNode);
  6561. smalltalk.addMethod(
  6562. '_asBlockSequenceNode',
  6563. smalltalk.method({
  6564. selector: 'asBlockSequenceNode',
  6565. category: 'testing',
  6566. fn: function (){
  6567. var self=this;
  6568. return (function($rec){smalltalk.send($rec, "_nodes_", [smalltalk.send(self, "_nodes", [])]);smalltalk.send($rec, "_temps_", [smalltalk.send(self, "_temps", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.BlockSequenceNode, "_new", []));
  6569. return self;},
  6570. 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')}),
  6571. smalltalk.SequenceNode);
  6572. smalltalk.addMethod(
  6573. '_accept_',
  6574. smalltalk.method({
  6575. selector: 'accept:',
  6576. category: 'visiting',
  6577. fn: function (aVisitor){
  6578. var self=this;
  6579. smalltalk.send(aVisitor, "_visitSequenceNode_", [self]);
  6580. return self;},
  6581. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitSequenceNode%3A%20self%0A')}),
  6582. smalltalk.SequenceNode);
  6583. smalltalk.addClass('BlockSequenceNode', smalltalk.SequenceNode, [], 'Compiler');
  6584. smalltalk.addMethod(
  6585. '_accept_',
  6586. smalltalk.method({
  6587. selector: 'accept:',
  6588. category: 'visiting',
  6589. fn: function (aVisitor){
  6590. var self=this;
  6591. smalltalk.send(aVisitor, "_visitBlockSequenceNode_", [self]);
  6592. return self;},
  6593. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitBlockSequenceNode%3A%20self%0A')}),
  6594. smalltalk.BlockSequenceNode);
  6595. smalltalk.addClass('ReturnNode', smalltalk.Node, [], 'Compiler');
  6596. smalltalk.addMethod(
  6597. '_accept_',
  6598. smalltalk.method({
  6599. selector: 'accept:',
  6600. category: 'visiting',
  6601. fn: function (aVisitor){
  6602. var self=this;
  6603. smalltalk.send(aVisitor, "_visitReturnNode_", [self]);
  6604. return self;},
  6605. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitReturnNode%3A%20self%0A')}),
  6606. smalltalk.ReturnNode);
  6607. smalltalk.addClass('ValueNode', smalltalk.Node, ['value'], 'Compiler');
  6608. smalltalk.addMethod(
  6609. '_value',
  6610. smalltalk.method({
  6611. selector: 'value',
  6612. category: 'accessing',
  6613. fn: function (){
  6614. var self=this;
  6615. return self['@value'];
  6616. return self;},
  6617. source: unescape('value%0A%09%5Evalue%0A')}),
  6618. smalltalk.ValueNode);
  6619. smalltalk.addMethod(
  6620. '_value_',
  6621. smalltalk.method({
  6622. selector: 'value:',
  6623. category: 'accessing',
  6624. fn: function (anObject){
  6625. var self=this;
  6626. self['@value']=anObject;
  6627. return self;},
  6628. source: unescape('value%3A%20anObject%0A%09value%20%3A%3D%20anObject%0A')}),
  6629. smalltalk.ValueNode);
  6630. smalltalk.addMethod(
  6631. '_accept_',
  6632. smalltalk.method({
  6633. selector: 'accept:',
  6634. category: 'visiting',
  6635. fn: function (aVisitor){
  6636. var self=this;
  6637. smalltalk.send(aVisitor, "_visitValueNode_", [self]);
  6638. return self;},
  6639. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitValueNode%3A%20self%0A')}),
  6640. smalltalk.ValueNode);
  6641. smalltalk.addClass('VariableNode', smalltalk.ValueNode, [], 'Compiler');
  6642. smalltalk.addMethod(
  6643. '_accept_',
  6644. smalltalk.method({
  6645. selector: 'accept:',
  6646. category: 'visiting',
  6647. fn: function (aVisitor){
  6648. var self=this;
  6649. smalltalk.send(aVisitor, "_visitVariableNode_", [self]);
  6650. return self;},
  6651. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitVariableNode%3A%20self%0A')}),
  6652. smalltalk.VariableNode);
  6653. smalltalk.addClass('ClassReferenceNode', smalltalk.VariableNode, [], 'Compiler');
  6654. smalltalk.addMethod(
  6655. '_accept_',
  6656. smalltalk.method({
  6657. selector: 'accept:',
  6658. category: 'visiting',
  6659. fn: function (aVisitor){
  6660. var self=this;
  6661. smalltalk.send(aVisitor, "_visitClassReferenceNode_", [self]);
  6662. return self;},
  6663. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitClassReferenceNode%3A%20self%0A')}),
  6664. smalltalk.ClassReferenceNode);
  6665. smalltalk.addClass('JSStatementNode', smalltalk.Node, ['source'], 'Compiler');
  6666. smalltalk.addMethod(
  6667. '_source',
  6668. smalltalk.method({
  6669. selector: 'source',
  6670. category: 'accessing',
  6671. fn: function (){
  6672. var self=this;
  6673. return smalltalk.send(self['@source'], "_ifNil_", [(function(){return "";})]);
  6674. return self;},
  6675. source: unescape('source%0A%09%5Esource%20ifNil%3A%20%5B%27%27%5D%0A')}),
  6676. smalltalk.JSStatementNode);
  6677. smalltalk.addMethod(
  6678. '_source_',
  6679. smalltalk.method({
  6680. selector: 'source:',
  6681. category: 'accessing',
  6682. fn: function (aString){
  6683. var self=this;
  6684. self['@source']=aString;
  6685. return self;},
  6686. source: unescape('source%3A%20aString%0A%09source%20%3A%3D%20aString%0A')}),
  6687. smalltalk.JSStatementNode);
  6688. smalltalk.addMethod(
  6689. '_accept_',
  6690. smalltalk.method({
  6691. selector: 'accept:',
  6692. category: 'visiting',
  6693. fn: function (aVisitor){
  6694. var self=this;
  6695. smalltalk.send(aVisitor, "_visitJSStatementNode_", [self]);
  6696. return self;},
  6697. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitJSStatementNode%3A%20self%0A')}),
  6698. smalltalk.JSStatementNode);
  6699. smalltalk.addClass('NodeVisitor', smalltalk.Object, [], 'Compiler');
  6700. smalltalk.addMethod(
  6701. '_visit_',
  6702. smalltalk.method({
  6703. selector: 'visit:',
  6704. category: 'visiting',
  6705. fn: function (aNode){
  6706. var self=this;
  6707. smalltalk.send(aNode, "_accept_", [self]);
  6708. return self;},
  6709. source: unescape('visit%3A%20aNode%0A%09aNode%20accept%3A%20self%0A')}),
  6710. smalltalk.NodeVisitor);
  6711. smalltalk.addMethod(
  6712. '_visitNode_',
  6713. smalltalk.method({
  6714. selector: 'visitNode:',
  6715. category: 'visiting',
  6716. fn: function (aNode){
  6717. var self=this;
  6718. return self;},
  6719. source: unescape('visitNode%3A%20aNode%0A')}),
  6720. smalltalk.NodeVisitor);
  6721. smalltalk.addMethod(
  6722. '_visitMethodNode_',
  6723. smalltalk.method({
  6724. selector: 'visitMethodNode:',
  6725. category: 'visiting',
  6726. fn: function (aNode){
  6727. var self=this;
  6728. smalltalk.send(self, "_visitNode_", [aNode]);
  6729. return self;},
  6730. source: unescape('visitMethodNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  6731. smalltalk.NodeVisitor);
  6732. smalltalk.addMethod(
  6733. '_visitSequenceNode_',
  6734. smalltalk.method({
  6735. selector: 'visitSequenceNode:',
  6736. category: 'visiting',
  6737. fn: function (aNode){
  6738. var self=this;
  6739. smalltalk.send(self, "_visitNode_", [aNode]);
  6740. return self;},
  6741. source: unescape('visitSequenceNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  6742. smalltalk.NodeVisitor);
  6743. smalltalk.addMethod(
  6744. '_visitBlockSequenceNode_',
  6745. smalltalk.method({
  6746. selector: 'visitBlockSequenceNode:',
  6747. category: 'visiting',
  6748. fn: function (aNode){
  6749. var self=this;
  6750. smalltalk.send(self, "_visitSequenceNode_", [aNode]);
  6751. return self;},
  6752. source: unescape('visitBlockSequenceNode%3A%20aNode%0A%09self%20visitSequenceNode%3A%20aNode%0A')}),
  6753. smalltalk.NodeVisitor);
  6754. smalltalk.addMethod(
  6755. '_visitBlockNode_',
  6756. smalltalk.method({
  6757. selector: 'visitBlockNode:',
  6758. category: 'visiting',
  6759. fn: function (aNode){
  6760. var self=this;
  6761. smalltalk.send(self, "_visitNode_", [aNode]);
  6762. return self;},
  6763. source: unescape('visitBlockNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  6764. smalltalk.NodeVisitor);
  6765. smalltalk.addMethod(
  6766. '_visitReturnNode_',
  6767. smalltalk.method({
  6768. selector: 'visitReturnNode:',
  6769. category: 'visiting',
  6770. fn: function (aNode){
  6771. var self=this;
  6772. smalltalk.send(self, "_visitNode_", [aNode]);
  6773. return self;},
  6774. source: unescape('visitReturnNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  6775. smalltalk.NodeVisitor);
  6776. smalltalk.addMethod(
  6777. '_visitSendNode_',
  6778. smalltalk.method({
  6779. selector: 'visitSendNode:',
  6780. category: 'visiting',
  6781. fn: function (aNode){
  6782. var self=this;
  6783. smalltalk.send(self, "_visitNode_", [aNode]);
  6784. return self;},
  6785. source: unescape('visitSendNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  6786. smalltalk.NodeVisitor);
  6787. smalltalk.addMethod(
  6788. '_visitCascadeNode_',
  6789. smalltalk.method({
  6790. selector: 'visitCascadeNode:',
  6791. category: 'visiting',
  6792. fn: function (aNode){
  6793. var self=this;
  6794. smalltalk.send(self, "_visitNode_", [aNode]);
  6795. return self;},
  6796. source: unescape('visitCascadeNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  6797. smalltalk.NodeVisitor);
  6798. smalltalk.addMethod(
  6799. '_visitValueNode_',
  6800. smalltalk.method({
  6801. selector: 'visitValueNode:',
  6802. category: 'visiting',
  6803. fn: function (aNode){
  6804. var self=this;
  6805. smalltalk.send(self, "_visitNode_", [aNode]);
  6806. return self;},
  6807. source: unescape('visitValueNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  6808. smalltalk.NodeVisitor);
  6809. smalltalk.addMethod(
  6810. '_visitVariableNode_',
  6811. smalltalk.method({
  6812. selector: 'visitVariableNode:',
  6813. category: 'visiting',
  6814. fn: function (aNode){
  6815. var self=this;
  6816. return self;},
  6817. source: unescape('visitVariableNode%3A%20aNode%0A')}),
  6818. smalltalk.NodeVisitor);
  6819. smalltalk.addMethod(
  6820. '_visitAssignmentNode_',
  6821. smalltalk.method({
  6822. selector: 'visitAssignmentNode:',
  6823. category: 'visiting',
  6824. fn: function (aNode){
  6825. var self=this;
  6826. smalltalk.send(self, "_visitNode_", [aNode]);
  6827. return self;},
  6828. source: unescape('visitAssignmentNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  6829. smalltalk.NodeVisitor);
  6830. smalltalk.addMethod(
  6831. '_visitClassReferenceNode_',
  6832. smalltalk.method({
  6833. selector: 'visitClassReferenceNode:',
  6834. category: 'visiting',
  6835. fn: function (aNode){
  6836. var self=this;
  6837. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["smalltalk."]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(aNode, "_value", [])]);})(self);
  6838. return self;},
  6839. 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')}),
  6840. smalltalk.NodeVisitor);
  6841. smalltalk.addMethod(
  6842. '_visitJSStatementNode_',
  6843. smalltalk.method({
  6844. selector: 'visitJSStatementNode:',
  6845. category: 'visiting',
  6846. fn: function (aNode){
  6847. var self=this;
  6848. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("function%28%29%7B")]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(aNode, "_source", [])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%7D%29%28%29")]);})(self);
  6849. return self;},
  6850. 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')}),
  6851. smalltalk.NodeVisitor);
  6852. smalltalk.addClass('Compiler', smalltalk.NodeVisitor, ['stream', 'nestedBlocks', 'earlyReturn', 'currentClass', 'currentSelector', 'unknownVariables', 'tempVariables'], 'Compiler');
  6853. smalltalk.addMethod(
  6854. '_initialize',
  6855. smalltalk.method({
  6856. selector: 'initialize',
  6857. category: 'initialization',
  6858. fn: function (){
  6859. var self=this;
  6860. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  6861. self['@stream']=smalltalk.send("", "_writeStream", []);
  6862. self['@unknownVariables']=[];
  6863. self['@tempVariables']=[];
  6864. return self;},
  6865. source: unescape('initialize%0A%09super%20initialize.%0A%09stream%20%3A%3D%20%27%27%20writeStream.%0A%09unknownVariables%20%3A%3D%20%23%28%29.%0A%09tempVariables%20%3A%3D%20%23%28%29%0A')}),
  6866. smalltalk.Compiler);
  6867. smalltalk.addMethod(
  6868. '_parser',
  6869. smalltalk.method({
  6870. selector: 'parser',
  6871. category: 'accessing',
  6872. fn: function (){
  6873. var self=this;
  6874. return smalltalk.send(smalltalk.SmalltalkParser, "_new", []);
  6875. return self;},
  6876. source: unescape('parser%0A%09%5ESmalltalkParser%20new%0A')}),
  6877. smalltalk.Compiler);
  6878. smalltalk.addMethod(
  6879. '_currentClass',
  6880. smalltalk.method({
  6881. selector: 'currentClass',
  6882. category: 'accessing',
  6883. fn: function (){
  6884. var self=this;
  6885. return self['@currentClass'];
  6886. return self;},
  6887. source: unescape('currentClass%0A%09%5EcurrentClass%0A')}),
  6888. smalltalk.Compiler);
  6889. smalltalk.addMethod(
  6890. '_currentClass_',
  6891. smalltalk.method({
  6892. selector: 'currentClass:',
  6893. category: 'accessing',
  6894. fn: function (aClass){
  6895. var self=this;
  6896. self['@currentClass']=aClass;
  6897. return self;},
  6898. source: unescape('currentClass%3A%20aClass%0A%09currentClass%20%3A%3D%20aClass%0A')}),
  6899. smalltalk.Compiler);
  6900. smalltalk.addMethod(
  6901. '_loadExpression_',
  6902. smalltalk.method({
  6903. selector: 'loadExpression:',
  6904. category: 'compiling',
  6905. fn: function (aString){
  6906. var self=this;
  6907. smalltalk.send(smalltalk.DoIt, "_addCompiledMethod_", [smalltalk.send(self, "_eval_", [smalltalk.send(self, "_compileExpression_", [aString])])]);
  6908. return smalltalk.send(smalltalk.send(smalltalk.DoIt, "_new", []), "_doIt", []);
  6909. return self;},
  6910. 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')}),
  6911. smalltalk.Compiler);
  6912. smalltalk.addMethod(
  6913. '_load_forClass_',
  6914. smalltalk.method({
  6915. selector: 'load:forClass:',
  6916. category: 'compiling',
  6917. fn: function (aString, aClass){
  6918. var self=this;
  6919. return smalltalk.send(self, "_eval_", [smalltalk.send(self, "_compile_forClass_", [aString, aClass])]);
  6920. return self;},
  6921. source: unescape('load%3A%20aString%20forClass%3A%20aClass%0A%09%5Eself%20eval%3A%20%28self%20compile%3A%20aString%20forClass%3A%20aClass%29%0A')}),
  6922. smalltalk.Compiler);
  6923. smalltalk.addMethod(
  6924. '_compile_forClass_',
  6925. smalltalk.method({
  6926. selector: 'compile:forClass:',
  6927. category: 'compiling',
  6928. fn: function (aString, aClass){
  6929. var self=this;
  6930. smalltalk.send(self, "_currentClass_", [aClass]);
  6931. return smalltalk.send(self, "_compile_", [aString]);
  6932. return self;},
  6933. source: unescape('compile%3A%20aString%20forClass%3A%20aClass%0A%09self%20currentClass%3A%20aClass.%0A%09%5Eself%20compile%3A%20aString%0A')}),
  6934. smalltalk.Compiler);
  6935. smalltalk.addMethod(
  6936. '_compileExpression_',
  6937. smalltalk.method({
  6938. selector: 'compileExpression:',
  6939. category: 'compiling',
  6940. fn: function (aString){
  6941. var self=this;
  6942. smalltalk.send(self, "_currentClass_", [smalltalk.DoIt]);
  6943. return smalltalk.send(self, "_compileNode_", [smalltalk.send(self, "_parseExpression_", [aString])]);
  6944. return self;},
  6945. source: unescape('compileExpression%3A%20aString%0A%09self%20currentClass%3A%20DoIt.%0A%09%5Eself%20compileNode%3A%20%28self%20parseExpression%3A%20aString%29%0A')}),
  6946. smalltalk.Compiler);
  6947. smalltalk.addMethod(
  6948. '_eval_',
  6949. smalltalk.method({
  6950. selector: 'eval:',
  6951. category: 'compiling',
  6952. fn: function (aString){
  6953. var self=this;
  6954. return eval(aString);
  6955. return self;},
  6956. source: unescape('eval%3A%20aString%0A%09%7B%27return%20eval%28aString%29%27%7D')}),
  6957. smalltalk.Compiler);
  6958. smalltalk.addMethod(
  6959. '_compile_',
  6960. smalltalk.method({
  6961. selector: 'compile:',
  6962. category: 'compiling',
  6963. fn: function (aString){
  6964. var self=this;
  6965. return smalltalk.send(self, "_compileNode_", [smalltalk.send(self, "_parse_", [aString])]);
  6966. return self;},
  6967. source: unescape('compile%3A%20aString%0A%09%5Eself%20compileNode%3A%20%28self%20parse%3A%20aString%29%0A')}),
  6968. smalltalk.Compiler);
  6969. smalltalk.addMethod(
  6970. '_compileNode_',
  6971. smalltalk.method({
  6972. selector: 'compileNode:',
  6973. category: 'compiling',
  6974. fn: function (aNode){
  6975. var self=this;
  6976. self['@stream']=smalltalk.send("", "_writeStream", []);
  6977. smalltalk.send(self, "_visit_", [aNode]);
  6978. return smalltalk.send(self['@stream'], "_contents", []);
  6979. return self;},
  6980. source: unescape('compileNode%3A%20aNode%0A%09stream%20%3A%3D%20%27%27%20writeStream.%0A%09self%20visit%3A%20aNode.%0A%09%5Estream%20contents%0A')}),
  6981. smalltalk.Compiler);
  6982. smalltalk.addMethod(
  6983. '_visit_',
  6984. smalltalk.method({
  6985. selector: 'visit:',
  6986. category: 'visiting',
  6987. fn: function (aNode){
  6988. var self=this;
  6989. smalltalk.send(aNode, "_accept_", [self]);
  6990. return self;},
  6991. source: unescape('visit%3A%20aNode%0A%09aNode%20accept%3A%20self%0A')}),
  6992. smalltalk.Compiler);
  6993. smalltalk.addMethod(
  6994. '_visitMethodNode_',
  6995. smalltalk.method({
  6996. selector: 'visitMethodNode:',
  6997. category: 'visiting',
  6998. fn: function (aNode){
  6999. var self=this;
  7000. var str=nil;
  7001. var currentSelector=nil;
  7002. self['@currentSelector']=smalltalk.send(smalltalk.send(aNode, "_selector", []), "_asSelector", []);
  7003. self['@nestedBlocks']=(0);
  7004. self['@earlyReturn']=false;
  7005. self['@unknownVariables']=[];
  7006. self['@tempVariables']=[];
  7007. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(unescape("smalltalk.method%28%7B"), "__comma", [smalltalk.send(smalltalk.String, "_cr", [])])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(unescape("selector%3A%20%22"), "__comma", [smalltalk.send(aNode, "_selector", [])]), "__comma", [unescape("%22%2C")]), "__comma", [smalltalk.send(smalltalk.String, "_cr", [])])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(unescape("source%3A%20unescape%28%22"), "__comma", [smalltalk.send(smalltalk.send(aNode, "_source", []), "_escaped", [])]), "__comma", [unescape("%22%29%2C")]), "__comma", [smalltalk.send(smalltalk.String, "_cr", [])])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("fn%3A%20function%28")]);})(self['@stream']);
  7008. smalltalk.send(smalltalk.send(aNode, "_arguments", []), "_do_separatedBy_", [(function(each){smalltalk.send(self['@tempVariables'], "_add_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%2C%20")]);})]);
  7009. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(unescape("%29%7B"), "__comma", [smalltalk.send(smalltalk.String, "_cr", [])])]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(unescape("var%20self%3Dthis%3B"), "__comma", [smalltalk.send(smalltalk.String, "_cr", [])])]);})(self['@stream']);
  7010. str=self['@stream'];
  7011. self['@stream']=smalltalk.send("", "_writeStream", []);
  7012. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
  7013. smalltalk.send(self['@earlyReturn'], "_ifTrue_", [(function(){return smalltalk.send(str, "_nextPutAll_", [unescape("try%7B")]);})]);
  7014. smalltalk.send(str, "_nextPutAll_", [smalltalk.send(self['@stream'], "_contents", [])]);
  7015. self['@stream']=str;
  7016. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.String, "_cr", [])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("return%20self%3B")]);})(self['@stream']);
  7017. smalltalk.send(self['@earlyReturn'], "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(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", [smalltalk.send(self['@currentSelector'], "_printString", [])]), "__comma", [unescape("%29%7Breturn%20e.fn%28%29%7D%20throw%28e%29%7D")])]);})]);
  7018. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(unescape("%7D"), "__comma", [smalltalk.send(smalltalk.String, "_cr", [])])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%7D%29")]);})(self['@stream']);
  7019. return self;},
  7020. 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%09unknownVariables%20%3A%3D%20%23%28%29.%0A%09tempVariables%20%3A%3D%20%23%28%29.%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%20%0A%09%09tempVariables%20add%3A%20each.%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%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')}),
  7021. smalltalk.Compiler);
  7022. smalltalk.addMethod(
  7023. '_visitBlockNode_',
  7024. smalltalk.method({
  7025. selector: 'visitBlockNode:',
  7026. category: 'visiting',
  7027. fn: function (aNode){
  7028. var self=this;
  7029. smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28function%28")]);
  7030. smalltalk.send(smalltalk.send(aNode, "_parameters", []), "_do_separatedBy_", [(function(each){smalltalk.send(self['@tempVariables'], "_add_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%2C%20")]);})]);
  7031. smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29%7B")]);
  7032. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
  7033. smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%7D%29")]);
  7034. return self;},
  7035. 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%09tempVariables%20add%3A%20each.%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')}),
  7036. smalltalk.Compiler);
  7037. smalltalk.addMethod(
  7038. '_visitSequenceNode_',
  7039. smalltalk.method({
  7040. selector: 'visitSequenceNode:',
  7041. category: 'visiting',
  7042. fn: function (aNode){
  7043. var self=this;
  7044. smalltalk.send(smalltalk.send(aNode, "_temps", []), "_do_", [(function(each){smalltalk.send(self['@tempVariables'], "_add_", [each]);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send("var ", "__comma", [each]), "__comma", [unescape("%3Dnil%3B")])]);return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.String, "_cr", [])]);})]);
  7045. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_separatedBy_", [(function(each){smalltalk.send(self, "_visit_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%3B")]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.String, "_cr", [])]);})]);
  7046. return self;},
  7047. source: unescape('visitSequenceNode%3A%20aNode%0A%09aNode%20temps%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20tempVariables%20add%3A%20each.%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')}),
  7048. smalltalk.Compiler);
  7049. smalltalk.addMethod(
  7050. '_visitBlockSequenceNode_',
  7051. smalltalk.method({
  7052. selector: 'visitBlockSequenceNode:',
  7053. category: 'visiting',
  7054. fn: function (aNode){
  7055. var self=this;
  7056. var index=nil;
  7057. self['@nestedBlocks']=smalltalk.send(self['@nestedBlocks'], "__plus", [(1)]);
  7058. smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_isEmpty", []), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("return%20nil%3B")]);}), (function(){smalltalk.send(smalltalk.send(aNode, "_temps", []), "_do_", [(function(each){smalltalk.send(self['@tempVariables'], "_add_", [each]);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send("var ", "__comma", [each]), "__comma", [unescape("%3Dnil%3B")])]);return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.String, "_cr", [])]);})]);index=(0);return smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){index=smalltalk.send(index, "__plus", [(1)]);smalltalk.send(smalltalk.send(index, "__eq", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_size", [])]), "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})]);smalltalk.send(self, "_visit_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%3B")]);})]);})]);
  7059. self['@nestedBlocks']=smalltalk.send(self['@nestedBlocks'], "__minus", [(1)]);
  7060. return self;},
  7061. 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%20tempVariables%20add%3A%20each.%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')}),
  7062. smalltalk.Compiler);
  7063. smalltalk.addMethod(
  7064. '_visitReturnNode_',
  7065. smalltalk.method({
  7066. selector: 'visitReturnNode:',
  7067. category: 'visiting',
  7068. fn: function (aNode){
  7069. var self=this;
  7070. smalltalk.send(smalltalk.send(self['@nestedBlocks'], "__gt", [(0)]), "_ifTrue_", [(function(){return self['@earlyReturn']=true;})]);
  7071. smalltalk.send(self['@earlyReturn'], "_ifTrue_ifFalse_", [(function(){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("%28function%28%29%7Bthrow%28")]);smalltalk.send($rec, "_nextPutAll_", [unescape("%7Bname%3A%20%27stReturn%27%2C%20selector%3A%20")]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self['@currentSelector'], "_printString", [])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%2C%20fn%3A%20function%28%29%7Breturn%20")]);})(self['@stream']);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})]);
  7072. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
  7073. smalltalk.send(self['@earlyReturn'], "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%7D%7D%29%7D%29%28%29")]);})]);
  7074. return self;},
  7075. 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')}),
  7076. smalltalk.Compiler);
  7077. smalltalk.addMethod(
  7078. '_visitSendNode_',
  7079. smalltalk.method({
  7080. selector: 'visitSendNode:',
  7081. category: 'visiting',
  7082. fn: function (aNode){
  7083. var self=this;
  7084. var str=nil;
  7085. str=self['@stream'];
  7086. self['@stream']=smalltalk.send("", "_writeStream", []);
  7087. smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_receiver", [])]);
  7088. smalltalk.send(smalltalk.send(smalltalk.send(self['@stream'], "_contents", []), "__eq", ["super"]), "_ifTrue_ifFalse_", [(function(){self['@stream']=str;(function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("self.klass.superclass.fn.prototype%5B%27")]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(aNode, "_selector", []), "_asSelector", [])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%27%5D.apply%28self%2C%20%5B")]);})(self['@stream']);smalltalk.send(smalltalk.send(aNode, "_arguments", []), "_do_separatedBy_", [(function(each){return smalltalk.send(self, "_visit_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%2C")]);})]);return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%5D%29")]);}), (function(){smalltalk.send(str, "_nextPutAll_", [unescape("smalltalk.send%28")]);smalltalk.send(str, "_nextPutAll_", [smalltalk.send(self['@stream'], "_contents", [])]);self['@stream']=str;smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%2C%20%22"), "__comma", [smalltalk.send(smalltalk.send(aNode, "_selector", []), "_asSelector", [])]), "__comma", [unescape("%22%2C%20%5B")])]);smalltalk.send(smalltalk.send(aNode, "_arguments", []), "_do_separatedBy_", [(function(each){return smalltalk.send(self, "_visit_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%2C%20")]);})]);return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%5D%29")]);})]);
  7089. return self;},
  7090. 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%20%27smalltalk.send%28%27.%0A%09%09str%20nextPutAll%3A%20stream%20contents.%0A%09%09stream%20%3A%3D%20str.%0A%09%09stream%20nextPutAll%3A%20%27%2C%20%22%27%2C%20aNode%20selector%20asSelector%2C%20%27%22%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%20%27%5D.%0A%09%09stream%20nextPutAll%3A%20%27%5D%29%27%5D')}),
  7091. smalltalk.Compiler);
  7092. smalltalk.addMethod(
  7093. '_visitCascadeNode_',
  7094. smalltalk.method({
  7095. selector: 'visitCascadeNode:',
  7096. category: 'visiting',
  7097. fn: function (aNode){
  7098. var self=this;
  7099. var index=nil;
  7100. index=(0);
  7101. smalltalk.send(smalltalk.send(self['@tempVariables'], "_includes_", ["$rec"]), "_ifFalse_", [(function(){return smalltalk.send(self['@tempVariables'], "_add_", ["$rec"]);})]);
  7102. smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%28function%28%24rec%29%7B")]);
  7103. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){index=smalltalk.send(index, "__plus", [(1)]);smalltalk.send(smalltalk.send(index, "__eq", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_size", [])]), "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})]);smalltalk.send(each, "_receiver_", [smalltalk.send(smalltalk.send(smalltalk.VariableNode, "_new", []), "_value_", ["$rec"])]);smalltalk.send(self, "_visit_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%3B")]);})]);
  7104. smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%7D%29%28")]);
  7105. smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_receiver", [])]);
  7106. smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%29")]);
  7107. return self;},
  7108. source: unescape('visitCascadeNode%3A%20aNode%0A%09%7C%20index%20%7C%0A%09index%20%3A%3D%200.%0A%09%28tempVariables%20includes%3A%20%27%24rec%27%29%20ifFalse%3A%20%5B%0A%09%09tempVariables%20add%3A%20%27%24rec%27%5D.%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')}),
  7109. smalltalk.Compiler);
  7110. smalltalk.addMethod(
  7111. '_visitValueNode_',
  7112. smalltalk.method({
  7113. selector: 'visitValueNode:',
  7114. category: 'visiting',
  7115. fn: function (aNode){
  7116. var self=this;
  7117. smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(aNode, "_value", []), "_asJavascript", [])]);
  7118. return self;},
  7119. source: unescape('visitValueNode%3A%20aNode%0A%09stream%20nextPutAll%3A%20aNode%20value%20asJavascript%0A')}),
  7120. smalltalk.Compiler);
  7121. smalltalk.addMethod(
  7122. '_visitAssignmentNode_',
  7123. smalltalk.method({
  7124. selector: 'visitAssignmentNode:',
  7125. category: 'visiting',
  7126. fn: function (aNode){
  7127. var self=this;
  7128. smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_left", [])]);
  7129. smalltalk.send(self['@stream'], "_nextPutAll_", [unescape("%3D")]);
  7130. smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_right", [])]);
  7131. return self;},
  7132. 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')}),
  7133. smalltalk.Compiler);
  7134. smalltalk.addMethod(
  7135. '_visitClassReferenceNode_',
  7136. smalltalk.method({
  7137. selector: 'visitClassReferenceNode:',
  7138. category: 'visiting',
  7139. fn: function (aNode){
  7140. var self=this;
  7141. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["smalltalk."]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(aNode, "_value", [])]);})(self['@stream']);
  7142. return self;},
  7143. 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')}),
  7144. smalltalk.Compiler);
  7145. smalltalk.addMethod(
  7146. '_visitVariableNode_',
  7147. smalltalk.method({
  7148. selector: 'visitVariableNode:',
  7149. category: 'visiting',
  7150. fn: function (aNode){
  7151. var self=this;
  7152. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_currentClass", []), "_instanceVariableNames", []), "_includes_", [smalltalk.send(aNode, "_value", [])]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("self%5B%27@"), "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", [unescape("%27%5D")])]);}), (function(){smalltalk.send(smalltalk.send(smalltalk.send(self, "_knownVariables", []), "_includes_", [smalltalk.send(aNode, "_value", [])]), "_ifFalse_", [(function(){return smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);})]);return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(aNode, "_value", [])]);})]);
  7153. return self;},
  7154. source: unescape('visitVariableNode%3A%20aNode%0A%09%28self%20currentClass%20instanceVariableNames%20includes%3A%20aNode%20value%29%20%0A%09%09ifTrue%3A%20%5Bstream%20nextPutAll%3A%20%27self%5B%27%27@%27%2C%20aNode%20value%2C%20%27%27%27%5D%27%5D%0A%09%09ifFalse%3A%20%5B%0A%09%09%09%28self%20knownVariables%20includes%3A%20aNode%20value%29%20ifFalse%3A%20%5B%0A%09%09%09%09unknownVariables%20add%3A%20aNode%20value%5D.%0A%09%09%09stream%20nextPutAll%3A%20aNode%20value%5D%0A')}),
  7155. smalltalk.Compiler);
  7156. smalltalk.addMethod(
  7157. '_visitJSStatementNode_',
  7158. smalltalk.method({
  7159. selector: 'visitJSStatementNode:',
  7160. category: 'visiting',
  7161. fn: function (aNode){
  7162. var self=this;
  7163. smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_source", []), "_value", []), "_replace_with_", [unescape("%27%27"), unescape("%27")])]);
  7164. return self;},
  7165. source: unescape('visitJSStatementNode%3A%20aNode%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')}),
  7166. smalltalk.Compiler);
  7167. smalltalk.addMethod(
  7168. '_parse_',
  7169. smalltalk.method({
  7170. selector: 'parse:',
  7171. category: 'compiling',
  7172. fn: function (aString){
  7173. var self=this;
  7174. return smalltalk.send(smalltalk.send(self, "_parser", []), "_parse_", [smalltalk.send(aString, "_readStream", [])]);
  7175. return self;},
  7176. source: unescape('parse%3A%20aString%0A%20%20%20%20%5Eself%20parser%20parse%3A%20aString%20readStream%0A')}),
  7177. smalltalk.Compiler);
  7178. smalltalk.addMethod(
  7179. '_parseExpression_',
  7180. smalltalk.method({
  7181. selector: 'parseExpression:',
  7182. category: 'compiling',
  7183. fn: function (aString){
  7184. var self=this;
  7185. return smalltalk.send(self, "_parse_", [smalltalk.send(smalltalk.send(unescape("doIt%20%5E%5B"), "__comma", [aString]), "__comma", [unescape("%5D%20value")])]);
  7186. return self;},
  7187. 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')}),
  7188. smalltalk.Compiler);
  7189. smalltalk.addMethod(
  7190. '_unknownVariables',
  7191. smalltalk.method({
  7192. selector: 'unknownVariables',
  7193. category: 'accessing',
  7194. fn: function (){
  7195. var self=this;
  7196. return smalltalk.send(self['@unknownVariables'], "_copy", []);
  7197. return self;},
  7198. source: unescape('unknownVariables%0A%09%5EunknownVariables%20copy')}),
  7199. smalltalk.Compiler);
  7200. smalltalk.addMethod(
  7201. '_pseudoVariables',
  7202. smalltalk.method({
  7203. selector: 'pseudoVariables',
  7204. category: 'accessing',
  7205. fn: function (){
  7206. var self=this;
  7207. return ["self", "super", "true", "false", "nil", "thisContext"];
  7208. return self;},
  7209. source: unescape('pseudoVariables%0A%09%5E%23%28%27self%27%20%27super%27%20%27true%27%20%27false%27%20%27nil%27%20%27thisContext%27%29')}),
  7210. smalltalk.Compiler);
  7211. smalltalk.addMethod(
  7212. '_tempVariables',
  7213. smalltalk.method({
  7214. selector: 'tempVariables',
  7215. category: 'accessing',
  7216. fn: function (){
  7217. var self=this;
  7218. return smalltalk.send(self['@tempVariables'], "_copy", []);
  7219. return self;},
  7220. source: unescape('tempVariables%0A%09%5EtempVariables%20copy')}),
  7221. smalltalk.Compiler);
  7222. smalltalk.addMethod(
  7223. '_knownVariables',
  7224. smalltalk.method({
  7225. selector: 'knownVariables',
  7226. category: 'accessing',
  7227. fn: function (){
  7228. var self=this;
  7229. return (function($rec){smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_tempVariables", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_pseudoVariables", []));
  7230. return self;},
  7231. source: unescape('knownVariables%0A%09%5Eself%20pseudoVariables%20%0A%09%09addAll%3A%20self%20tempVariables%3B%0A%09%09yourself')}),
  7232. smalltalk.Compiler);
  7233. smalltalk.addMethod(
  7234. '_recompile_',
  7235. smalltalk.method({
  7236. selector: 'recompile:',
  7237. category: 'compiling',
  7238. fn: function (aClass){
  7239. var self=this;
  7240. smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_do_", [(function(each){var method=nil;
  7241. method=smalltalk.send(self, "_load_forClass_", [smalltalk.send(each, "_source", []), aClass]);smalltalk.send(method, "_category_", [smalltalk.send(each, "_category", [])]);return smalltalk.send(aClass, "_addCompiledMethod_", [method]);})]);
  7242. smalltalk.send(smalltalk.send(aClass, "_isMetaclass", []), "_ifFalse_", [(function(){return smalltalk.send(self, "_recompile_", [smalltalk.send(aClass, "_class", [])]);})]);
  7243. return self;},
  7244. source: unescape('recompile%3A%20aClass%0A%09aClass%20methodDictionary%20do%3A%20%5B%3Aeach%20%7C%7C%20method%20%7C%0A%09%09method%20%3A%3D%20self%20load%3A%20each%20source%20forClass%3A%20aClass.%0A%09%09method%20category%3A%20each%20category.%0A%09%09aClass%20addCompiledMethod%3A%20method%5D.%0A%09aClass%20isMetaclass%20ifFalse%3A%20%5Bself%20recompile%3A%20aClass%20class%5D')}),
  7245. smalltalk.Compiler);
  7246. smalltalk.addMethod(
  7247. '_recompileAll',
  7248. smalltalk.method({
  7249. selector: 'recompileAll',
  7250. category: 'compiling',
  7251. fn: function (){
  7252. var self=this;
  7253. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Smalltalk, "_current", []), "_classes", []), "_do_", [(function(each){return smalltalk.send(self, "_recompile_", [each]);})]);
  7254. return self;},
  7255. source: unescape('recompileAll%0A%09Smalltalk%20current%20classes%20do%3A%20%5B%3Aeach%20%7C%0A%09%09self%20recompile%3A%20each%5D')}),
  7256. smalltalk.Compiler);
  7257. smalltalk.addClass('DoIt', smalltalk.Object, [], 'Compiler');
  7258. smalltalk.addMethod(
  7259. '_doIt',
  7260. smalltalk.method({
  7261. selector: 'doIt',
  7262. category: '',
  7263. fn: function (){
  7264. var self=this;
  7265. return smalltalk.send((function(){return smalltalk.send(smalltalk.send(smalltalk.Compiler, "_new", []), "_recompileAll", []);}), "_value", []);
  7266. return self;},
  7267. source: unescape('doIt%20%5E%5BCompiler%20new%20recompileAll%5D%20value')}),
  7268. smalltalk.DoIt);
  7269. smalltalk.addClass('JQuery', smalltalk.Object, ['jquery'], 'JQuery');
  7270. smalltalk.addMethod(
  7271. '_removeAttribute_',
  7272. smalltalk.method({
  7273. selector: 'removeAttribute:',
  7274. category: 'attributes',
  7275. fn: function (aString){
  7276. var self=this;
  7277. return smalltalk.send(self, "_call_withArgument_", ["removeAttribute", aString]);
  7278. return self;},
  7279. 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')}),
  7280. smalltalk.JQuery);
  7281. smalltalk.addMethod(
  7282. '_attr_',
  7283. smalltalk.method({
  7284. selector: 'attr:',
  7285. category: 'attributes',
  7286. fn: function (aString){
  7287. var self=this;
  7288. return smalltalk.send(self, "_call_withArgument_", ["attr", aString]);
  7289. return self;},
  7290. 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')}),
  7291. smalltalk.JQuery);
  7292. smalltalk.addMethod(
  7293. '_val',
  7294. smalltalk.method({
  7295. selector: 'val',
  7296. category: 'attributes',
  7297. fn: function (){
  7298. var self=this;
  7299. return smalltalk.send(self, "_call_", ["val"]);
  7300. return self;},
  7301. 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')}),
  7302. smalltalk.JQuery);
  7303. smalltalk.addMethod(
  7304. '_val_',
  7305. smalltalk.method({
  7306. selector: 'val:',
  7307. category: 'attributes',
  7308. fn: function (aString){
  7309. var self=this;
  7310. smalltalk.send(self, "_call_withArgument_", ["val", aString]);
  7311. return self;},
  7312. source: unescape('val%3A%20aString%0A%20%20%20%20self%20call%3A%20%27val%27%20withArgument%3A%20aString%0A')}),
  7313. smalltalk.JQuery);
  7314. smalltalk.addMethod(
  7315. '_cssAt_',
  7316. smalltalk.method({
  7317. selector: 'cssAt:',
  7318. category: 'css',
  7319. fn: function (aString){
  7320. var self=this;
  7321. return self['@jquery'].css(aString);
  7322. return self;},
  7323. source: unescape('cssAt%3A%20aString%0A%09%7B%27return%20self%5B%27%27@jquery%27%27%5D.css%28aString%29%27%7D')}),
  7324. smalltalk.JQuery);
  7325. smalltalk.addMethod(
  7326. '_cssAt_put_',
  7327. smalltalk.method({
  7328. selector: 'cssAt:put:',
  7329. category: 'css',
  7330. fn: function (aString, anotherString){
  7331. var self=this;
  7332. self['@jquery'].css(aString, anotherString);
  7333. return self;},
  7334. 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')}),
  7335. smalltalk.JQuery);
  7336. smalltalk.addMethod(
  7337. '_addClass_',
  7338. smalltalk.method({
  7339. selector: 'addClass:',
  7340. category: 'css',
  7341. fn: function (aString){
  7342. var self=this;
  7343. smalltalk.send(self, "_call_withArgument_", ["addClass", aString]);
  7344. return self;},
  7345. 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')}),
  7346. smalltalk.JQuery);
  7347. smalltalk.addMethod(
  7348. '_removeClass_',
  7349. smalltalk.method({
  7350. selector: 'removeClass:',
  7351. category: 'css',
  7352. fn: function (aString){
  7353. var self=this;
  7354. smalltalk.send(self, "_call_withArgument_", ["removeClass", aString]);
  7355. return self;},
  7356. 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')}),
  7357. smalltalk.JQuery);
  7358. smalltalk.addMethod(
  7359. '_toggleClass_',
  7360. smalltalk.method({
  7361. selector: 'toggleClass:',
  7362. category: 'css',
  7363. fn: function (aString){
  7364. var self=this;
  7365. smalltalk.send(self, "_call_withArgument_", ["toggleClass", aString]);
  7366. return self;},
  7367. 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')}),
  7368. smalltalk.JQuery);
  7369. smalltalk.addMethod(
  7370. '_height',
  7371. smalltalk.method({
  7372. selector: 'height',
  7373. category: 'css',
  7374. fn: function (){
  7375. var self=this;
  7376. return smalltalk.send(self, "_call_", ["height"]);
  7377. return self;},
  7378. 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')}),
  7379. smalltalk.JQuery);
  7380. smalltalk.addMethod(
  7381. '_height_',
  7382. smalltalk.method({
  7383. selector: 'height:',
  7384. category: 'css',
  7385. fn: function (anInteger){
  7386. var self=this;
  7387. smalltalk.send(self, "_call_withArgument_", ["height", anInteger]);
  7388. return self;},
  7389. source: unescape('height%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27height%27%20withArgument%3A%20anInteger%0A')}),
  7390. smalltalk.JQuery);
  7391. smalltalk.addMethod(
  7392. '_width_',
  7393. smalltalk.method({
  7394. selector: 'width:',
  7395. category: 'css',
  7396. fn: function (anInteger){
  7397. var self=this;
  7398. smalltalk.send(self, "_call_withArgument_", ["width", anInteger]);
  7399. return self;},
  7400. source: unescape('width%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27width%27%20withArgument%3A%20anInteger%0A')}),
  7401. smalltalk.JQuery);
  7402. smalltalk.addMethod(
  7403. '_width',
  7404. smalltalk.method({
  7405. selector: 'width',
  7406. category: 'css',
  7407. fn: function (){
  7408. var self=this;
  7409. return smalltalk.send(self, "_call_", ["width"]);
  7410. return self;},
  7411. 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')}),
  7412. smalltalk.JQuery);
  7413. smalltalk.addMethod(
  7414. '_innerHeight',
  7415. smalltalk.method({
  7416. selector: 'innerHeight',
  7417. category: 'css',
  7418. fn: function (){
  7419. var self=this;
  7420. return smalltalk.send(self, "_call_", ["innerHeight"]);
  7421. return self;},
  7422. 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')}),
  7423. smalltalk.JQuery);
  7424. smalltalk.addMethod(
  7425. '_innerWidth',
  7426. smalltalk.method({
  7427. selector: 'innerWidth',
  7428. category: 'css',
  7429. fn: function (){
  7430. var self=this;
  7431. return smalltalk.send(self, "_call_", ["innerWidth"]);
  7432. return self;},
  7433. 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')}),
  7434. smalltalk.JQuery);
  7435. smalltalk.addMethod(
  7436. '_outerHeight',
  7437. smalltalk.method({
  7438. selector: 'outerHeight',
  7439. category: 'css',
  7440. fn: function (){
  7441. var self=this;
  7442. return smalltalk.send(self, "_call_", ["outerHeight"]);
  7443. return self;},
  7444. 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')}),
  7445. smalltalk.JQuery);
  7446. smalltalk.addMethod(
  7447. '_outerWidth',
  7448. smalltalk.method({
  7449. selector: 'outerWidth',
  7450. category: 'css',
  7451. fn: function (){
  7452. var self=this;
  7453. return smalltalk.send(self, "_call_", ["outerWidth"]);
  7454. return self;},
  7455. 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')}),
  7456. smalltalk.JQuery);
  7457. smalltalk.addMethod(
  7458. '_top',
  7459. smalltalk.method({
  7460. selector: 'top',
  7461. category: 'css',
  7462. fn: function (){
  7463. var self=this;
  7464. return smalltalk.send(smalltalk.send(self, "_call_", ["position"]), "_basicAt_", ["top"]);
  7465. return self;},
  7466. 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')}),
  7467. smalltalk.JQuery);
  7468. smalltalk.addMethod(
  7469. '_left',
  7470. smalltalk.method({
  7471. selector: 'left',
  7472. category: 'css',
  7473. fn: function (){
  7474. var self=this;
  7475. return smalltalk.send(smalltalk.send(self, "_call_", ["position"]), "_basicAt_", ["left"]);
  7476. return self;},
  7477. 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')}),
  7478. smalltalk.JQuery);
  7479. smalltalk.addMethod(
  7480. '_offsetLeft',
  7481. smalltalk.method({
  7482. selector: 'offsetLeft',
  7483. category: 'css',
  7484. fn: function (){
  7485. var self=this;
  7486. return smalltalk.send(smalltalk.send(self, "_call_", ["offset"]), "_basicAt_", ["left"]);
  7487. return self;},
  7488. 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')}),
  7489. smalltalk.JQuery);
  7490. smalltalk.addMethod(
  7491. '_offsetTop',
  7492. smalltalk.method({
  7493. selector: 'offsetTop',
  7494. category: 'css',
  7495. fn: function (){
  7496. var self=this;
  7497. return smalltalk.send(smalltalk.send(self, "_call_", ["offset"]), "_basicAt_", ["top"]);
  7498. return self;},
  7499. 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')}),
  7500. smalltalk.JQuery);
  7501. smalltalk.addMethod(
  7502. '_scrollLeft',
  7503. smalltalk.method({
  7504. selector: 'scrollLeft',
  7505. category: 'css',
  7506. fn: function (){
  7507. var self=this;
  7508. return smalltalk.send(self, "_call_", ["scrollLeft"]);
  7509. return self;},
  7510. 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')}),
  7511. smalltalk.JQuery);
  7512. smalltalk.addMethod(
  7513. '_scrollTop',
  7514. smalltalk.method({
  7515. selector: 'scrollTop',
  7516. category: 'css',
  7517. fn: function (){
  7518. var self=this;
  7519. return smalltalk.send(self, "_call_", ["scrollTop"]);
  7520. return self;},
  7521. 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')}),
  7522. smalltalk.JQuery);
  7523. smalltalk.addMethod(
  7524. '_scrollLeft_',
  7525. smalltalk.method({
  7526. selector: 'scrollLeft:',
  7527. category: 'css',
  7528. fn: function (anInteger){
  7529. var self=this;
  7530. smalltalk.send(self, "_call_withArgument_", ["scrollLeft", anInteger]);
  7531. return self;},
  7532. source: unescape('scrollLeft%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27scrollLeft%27%20withArgument%3A%20anInteger%0A')}),
  7533. smalltalk.JQuery);
  7534. smalltalk.addMethod(
  7535. '_scrollTop_',
  7536. smalltalk.method({
  7537. selector: 'scrollTop:',
  7538. category: 'css',
  7539. fn: function (anInteger){
  7540. var self=this;
  7541. smalltalk.send(self, "_call_withArgument_", ["scrollTop", anInteger]);
  7542. return self;},
  7543. source: unescape('scrollTop%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27scrollTop%27%20withArgument%3A%20anInteger%0A')}),
  7544. smalltalk.JQuery);
  7545. smalltalk.addMethod(
  7546. '_focus',
  7547. smalltalk.method({
  7548. selector: 'focus',
  7549. category: 'events',
  7550. fn: function (){
  7551. var self=this;
  7552. smalltalk.send(self, "_call_", ["focus"]);
  7553. return self;},
  7554. source: unescape('focus%0A%20%20%20%20self%20call%3A%20%27focus%27%0A')}),
  7555. smalltalk.JQuery);
  7556. smalltalk.addMethod(
  7557. '_show',
  7558. smalltalk.method({
  7559. selector: 'show',
  7560. category: 'events',
  7561. fn: function (){
  7562. var self=this;
  7563. smalltalk.send(self, "_call_", ["show"]);
  7564. return self;},
  7565. source: unescape('show%0A%20%20%20%20self%20call%3A%20%27show%27%0A')}),
  7566. smalltalk.JQuery);
  7567. smalltalk.addMethod(
  7568. '_hide',
  7569. smalltalk.method({
  7570. selector: 'hide',
  7571. category: 'events',
  7572. fn: function (){
  7573. var self=this;
  7574. smalltalk.send(self, "_call_", ["hide"]);
  7575. return self;},
  7576. source: unescape('hide%0A%20%20%20%20self%20call%3A%20%27hide%27%0A')}),
  7577. smalltalk.JQuery);
  7578. smalltalk.addMethod(
  7579. '_remove',
  7580. smalltalk.method({
  7581. selector: 'remove',
  7582. category: 'events',
  7583. fn: function (){
  7584. var self=this;
  7585. smalltalk.send(self, "_call_", ["remove"]);
  7586. return self;},
  7587. source: unescape('remove%0A%20%20%20%20self%20call%3A%20%27remove%27%0A')}),
  7588. smalltalk.JQuery);
  7589. smalltalk.addMethod(
  7590. '_on_do_',
  7591. smalltalk.method({
  7592. selector: 'on:do:',
  7593. category: 'events',
  7594. fn: function (anEventString, aBlock){
  7595. var self=this;
  7596. self['@jquery'].bind(anEventString, function(e){aBlock(e, self)});
  7597. return self;},
  7598. 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%28e%2C%20self%29%7D%29%27%7D%0A')}),
  7599. smalltalk.JQuery);
  7600. smalltalk.addMethod(
  7601. '_removeEvents_',
  7602. smalltalk.method({
  7603. selector: 'removeEvents:',
  7604. category: 'events',
  7605. fn: function (aString){
  7606. var self=this;
  7607. smalltalk.send(self, "_call_withArgument_", ["unbind", aString]);
  7608. return self;},
  7609. 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')}),
  7610. smalltalk.JQuery);
  7611. smalltalk.addMethod(
  7612. '_append_',
  7613. smalltalk.method({
  7614. selector: 'append:',
  7615. category: 'DOM insertion',
  7616. fn: function (anObject){
  7617. var self=this;
  7618. smalltalk.send(anObject, "_appendToJQuery_", [self]);
  7619. return self;},
  7620. 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')}),
  7621. smalltalk.JQuery);
  7622. smalltalk.addMethod(
  7623. '_appendElement_',
  7624. smalltalk.method({
  7625. selector: 'appendElement:',
  7626. category: 'DOM insertion',
  7627. fn: function (anElement){
  7628. var self=this;
  7629. smalltalk.send(self, "_call_withArgument_", ["append", anElement]);
  7630. return self;},
  7631. 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')}),
  7632. smalltalk.JQuery);
  7633. smalltalk.addMethod(
  7634. '_appendToJQuery_',
  7635. smalltalk.method({
  7636. selector: 'appendToJQuery:',
  7637. category: 'DOM insertion',
  7638. fn: function (aJQuery){
  7639. var self=this;
  7640. smalltalk.send(aJQuery, "_appendElement_", [self['@jquery']]);
  7641. return self;},
  7642. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20aJQuery%20appendElement%3A%20jquery%0A')}),
  7643. smalltalk.JQuery);
  7644. smalltalk.addMethod(
  7645. '_contents_',
  7646. smalltalk.method({
  7647. selector: 'contents:',
  7648. category: 'DOM insertion',
  7649. fn: function (anObject){
  7650. var self=this;
  7651. smalltalk.send(self, "_empty", []);
  7652. smalltalk.send(self, "_append_", [anObject]);
  7653. return self;},
  7654. source: unescape('contents%3A%20anObject%0A%20%20%20%20self%20empty.%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  7655. smalltalk.JQuery);
  7656. smalltalk.addMethod(
  7657. '_empty',
  7658. smalltalk.method({
  7659. selector: 'empty',
  7660. category: 'DOM insertion',
  7661. fn: function (){
  7662. var self=this;
  7663. smalltalk.send(self, "_call_", ["empty"]);
  7664. return self;},
  7665. source: unescape('empty%0A%20%20%20%20self%20call%3A%20%27empty%27%0A')}),
  7666. smalltalk.JQuery);
  7667. smalltalk.addMethod(
  7668. '_initializeWithJQueryObject_',
  7669. smalltalk.method({
  7670. selector: 'initializeWithJQueryObject:',
  7671. category: 'initialization',
  7672. fn: function (anObject){
  7673. var self=this;
  7674. self['@jquery']=anObject;
  7675. return self;},
  7676. source: unescape('initializeWithJQueryObject%3A%20anObject%0A%20%20%20%20jquery%20%3A%3D%20anObject%0A')}),
  7677. smalltalk.JQuery);
  7678. smalltalk.addMethod(
  7679. '_call_',
  7680. smalltalk.method({
  7681. selector: 'call:',
  7682. category: 'private',
  7683. fn: function (aString){
  7684. var self=this;
  7685. return self['@jquery'][aString]();
  7686. return self;},
  7687. source: unescape('call%3A%20aString%0A%09%7B%27return%20self%5B%27%27@jquery%27%27%5D%5BaString%5D%28%29%27%7D')}),
  7688. smalltalk.JQuery);
  7689. smalltalk.addMethod(
  7690. '_call_withArgument_',
  7691. smalltalk.method({
  7692. selector: 'call:withArgument:',
  7693. category: 'private',
  7694. fn: function (aString, anObject){
  7695. var self=this;
  7696. return self['@jquery'][aString](anObject);
  7697. return self;},
  7698. source: unescape('call%3A%20aString%20withArgument%3A%20anObject%0A%20%20%20%20%7B%27return%20self%5B%27%27@jquery%27%27%5D%5BaString%5D%28anObject%29%27%7D')}),
  7699. smalltalk.JQuery);
  7700. smalltalk.addMethod(
  7701. '_hasClass_',
  7702. smalltalk.method({
  7703. selector: 'hasClass:',
  7704. category: 'testing',
  7705. fn: function (aString){
  7706. var self=this;
  7707. return smalltalk.send(self, "_call_withArgument_", ["hasClass", aString]);
  7708. return self;},
  7709. 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')}),
  7710. smalltalk.JQuery);
  7711. smalltalk.addMethod(
  7712. '_fromString_',
  7713. smalltalk.method({
  7714. selector: 'fromString:',
  7715. category: 'instance creation',
  7716. fn: function (aString){
  7717. var self=this;
  7718. var newJQuery=nil;
  7719. newJQuery = jQuery(String(aString));
  7720. return smalltalk.send(self, "_from_", [newJQuery]);
  7721. return self;},
  7722. 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')}),
  7723. smalltalk.JQuery.klass);
  7724. smalltalk.addMethod(
  7725. '_from_',
  7726. smalltalk.method({
  7727. selector: 'from:',
  7728. category: 'instance creation',
  7729. fn: function (anObject){
  7730. var self=this;
  7731. return (function($rec){smalltalk.send($rec, "_initializeWithJQueryObject_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  7732. return self;},
  7733. source: unescape('from%3A%20anObject%0A%20%20%20%20%5Eself%20new%0A%09initializeWithJQueryObject%3A%20anObject%3B%0A%09yourself%0A')}),
  7734. smalltalk.JQuery.klass);
  7735. smalltalk.addClass('Ajax', smalltalk.Object, ['settings'], 'JQuery');
  7736. 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')
  7737. smalltalk.addMethod(
  7738. '_initialize',
  7739. smalltalk.method({
  7740. selector: 'initialize',
  7741. category: 'initialization',
  7742. fn: function (){
  7743. var self=this;
  7744. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  7745. self['@settings']=smalltalk.send(smalltalk.Dictionary, "_new", []);
  7746. return self;},
  7747. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20settings%20%3A%3D%20Dictionary%20new%0A')}),
  7748. smalltalk.Ajax);
  7749. smalltalk.addMethod(
  7750. '_at_',
  7751. smalltalk.method({
  7752. selector: 'at:',
  7753. category: 'accessing',
  7754. fn: function (aKey){
  7755. var self=this;
  7756. return smalltalk.send(self['@settings'], "_at_ifAbsent_", [aKey, (function(){return nil;})]);
  7757. return self;},
  7758. source: unescape('at%3A%20aKey%0A%20%20%20%20%5Esettings%20at%3A%20aKey%20ifAbsent%3A%20%5Bnil%5D%0A')}),
  7759. smalltalk.Ajax);
  7760. smalltalk.addMethod(
  7761. '_at_put_',
  7762. smalltalk.method({
  7763. selector: 'at:put:',
  7764. category: 'accessing',
  7765. fn: function (aKey, aValue){
  7766. var self=this;
  7767. smalltalk.send(self['@settings'], "_at_put_", [aKey, aValue]);
  7768. return self;},
  7769. source: unescape('at%3A%20aKey%20put%3A%20aValue%0A%20%20%20%20settings%20at%3A%20aKey%20put%3A%20aValue%0A')}),
  7770. smalltalk.Ajax);
  7771. smalltalk.addMethod(
  7772. '_url',
  7773. smalltalk.method({
  7774. selector: 'url',
  7775. category: 'accessing',
  7776. fn: function (){
  7777. var self=this;
  7778. return smalltalk.send(self, "_at_", ["url"]);
  7779. return self;},
  7780. source: unescape('url%0A%20%20%20%20%5Eself%20at%3A%20%27url%27%0A')}),
  7781. smalltalk.Ajax);
  7782. smalltalk.addMethod(
  7783. '_url_',
  7784. smalltalk.method({
  7785. selector: 'url:',
  7786. category: 'accessing',
  7787. fn: function (aString){
  7788. var self=this;
  7789. smalltalk.send(self, "_at_put_", ["url", aString]);
  7790. return self;},
  7791. source: unescape('url%3A%20aString%0A%20%20%20%20self%20at%3A%20%27url%27%20put%3A%20aString%0A')}),
  7792. smalltalk.Ajax);
  7793. smalltalk.addMethod(
  7794. '_send',
  7795. smalltalk.method({
  7796. selector: 'send',
  7797. category: 'actions',
  7798. fn: function (){
  7799. var self=this;
  7800. jQuery.ajax(self['@settings']);
  7801. return self;},
  7802. source: unescape('send%0A%20%20%20%20%7B%27jQuery.ajax%28self%5B%27%27@settings%27%27%5D%29%27%7D%0A')}),
  7803. smalltalk.Ajax);
  7804. smalltalk.addMethod(
  7805. '_url_',
  7806. smalltalk.method({
  7807. selector: 'url:',
  7808. category: 'instance creation',
  7809. fn: function (aString){
  7810. var self=this;
  7811. return (function($rec){smalltalk.send($rec, "_url_", [aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  7812. return self;},
  7813. source: unescape('url%3A%20aString%0A%20%20%20%20%5Eself%20new%0A%09url%3A%20aString%3B%0A%09yourself%0A')}),
  7814. smalltalk.Ajax.klass);
  7815. smalltalk.addClass('CanvasRenderingContext', smalltalk.Object, [], 'Canvas');
  7816. smalltalk.addMethod(
  7817. '_fillStyle_',
  7818. smalltalk.method({
  7819. selector: 'fillStyle:',
  7820. category: 'drawing paths',
  7821. fn: function (aString){
  7822. var self=this;
  7823. self.fillStyle = String(aString);
  7824. return self;},
  7825. source: unescape('fillStyle%3A%20aString%0A%09%7B%27self.fillStyle%20%3D%20String%28aString%29%27%7D')}),
  7826. smalltalk.CanvasRenderingContext);
  7827. smalltalk.addMethod(
  7828. '_beginPath',
  7829. smalltalk.method({
  7830. selector: 'beginPath',
  7831. category: 'drawing paths',
  7832. fn: function (){
  7833. var self=this;
  7834. self.beginPath();
  7835. return self;},
  7836. source: unescape('beginPath%0A%09%7B%27self.beginPath%28%29%27%7D')}),
  7837. smalltalk.CanvasRenderingContext);
  7838. smalltalk.addMethod(
  7839. '_closePath',
  7840. smalltalk.method({
  7841. selector: 'closePath',
  7842. category: 'drawing paths',
  7843. fn: function (){
  7844. var self=this;
  7845. self.closePath();
  7846. return self;},
  7847. source: unescape('closePath%0A%09%7B%27self.closePath%28%29%27%7D')}),
  7848. smalltalk.CanvasRenderingContext);
  7849. smalltalk.addMethod(
  7850. '_fill',
  7851. smalltalk.method({
  7852. selector: 'fill',
  7853. category: 'drawing paths',
  7854. fn: function (){
  7855. var self=this;
  7856. self.fill();
  7857. return self;},
  7858. source: unescape('fill%0A%09%7B%27self.fill%28%29%27%7D')}),
  7859. smalltalk.CanvasRenderingContext);
  7860. smalltalk.addMethod(
  7861. '_stroke',
  7862. smalltalk.method({
  7863. selector: 'stroke',
  7864. category: 'drawing paths',
  7865. fn: function (){
  7866. var self=this;
  7867. self.stroke();
  7868. return self;},
  7869. source: unescape('stroke%0A%09%7B%27self.stroke%28%29%27%7D')}),
  7870. smalltalk.CanvasRenderingContext);
  7871. smalltalk.addMethod(
  7872. '_moveTo_',
  7873. smalltalk.method({
  7874. selector: 'moveTo:',
  7875. category: 'drawing paths',
  7876. fn: function (aPoint){
  7877. var self=this;
  7878. self.moveTo(aPoint._x(), aPoint._y());
  7879. return self;},
  7880. source: unescape('moveTo%3A%20aPoint%0A%09%7B%27self.moveTo%28aPoint._x%28%29%2C%20aPoint._y%28%29%29%27%7D')}),
  7881. smalltalk.CanvasRenderingContext);
  7882. smalltalk.addMethod(
  7883. '_lineTo_',
  7884. smalltalk.method({
  7885. selector: 'lineTo:',
  7886. category: 'drawing paths',
  7887. fn: function (aPoint){
  7888. var self=this;
  7889. self.lineTo(aPoint._x(), aPoint._y());
  7890. return self;},
  7891. source: unescape('lineTo%3A%20aPoint%0A%09%7B%27self.lineTo%28aPoint._x%28%29%2C%20aPoint._y%28%29%29%27%7D')}),
  7892. smalltalk.CanvasRenderingContext);
  7893. smalltalk.addMethod(
  7894. '_arcTo_radius_startAngle_endAngle_anticlockwise_',
  7895. smalltalk.method({
  7896. selector: 'arcTo:radius:startAngle:endAngle:anticlockwise:',
  7897. category: 'drawing arcs',
  7898. fn: function (aPoint, aNumber, aNumber2, aNumber3, aBoolean){
  7899. var self=this;
  7900. self.arc(aPoint._x(), aPoint._y(), aNumber, aNumber2, aNumber3, aBoolean);
  7901. return self;},
  7902. 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')}),
  7903. smalltalk.CanvasRenderingContext);
  7904. smalltalk.addMethod(
  7905. '_arcTo_radius_',
  7906. smalltalk.method({
  7907. selector: 'arcTo:radius:',
  7908. category: 'drawing arcs',
  7909. fn: function (aPoint, aNumber){
  7910. var self=this;
  7911. smalltalk.send(self, "_arcTo_radius_startAngle_endAngle_anticlockwise_", [aPoint, aNumber, (0), smalltalk.send(smalltalk.send(smalltalk.Number, "_pi", []), "__star", [(2)]), false]);
  7912. return self;},
  7913. 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')}),
  7914. smalltalk.CanvasRenderingContext);
  7915. smalltalk.addMethod(
  7916. '_fillRectFrom_to_',
  7917. smalltalk.method({
  7918. selector: 'fillRectFrom:to:',
  7919. category: 'drawing rectangles',
  7920. fn: function (aPoint, anotherPoint){
  7921. var self=this;
  7922. self.fillRect(aPoint._x(), aPoint._y(), anotherPoint._x(), anotherPoint._y());
  7923. return self;},
  7924. 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')}),
  7925. smalltalk.CanvasRenderingContext);
  7926. smalltalk.addMethod(
  7927. '_strokeRectFrom_to_',
  7928. smalltalk.method({
  7929. selector: 'strokeRectFrom:to:',
  7930. category: 'drawing rectangles',
  7931. fn: function (aPoint, anotherPoint){
  7932. var self=this;
  7933. self.strokeRect(aPoint._x(), aPoint._y(), anotherPoint._x(), anotherPoint._y());
  7934. return self;},
  7935. 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')}),
  7936. smalltalk.CanvasRenderingContext);
  7937. smalltalk.addMethod(
  7938. '_clearRectFrom_to_',
  7939. smalltalk.method({
  7940. selector: 'clearRectFrom:to:',
  7941. category: 'drawing rectangles',
  7942. fn: function (aPoint, anotherPoint){
  7943. var self=this;
  7944. self.fillRect(aPoint._x(), aPoint._y(), anotherPoint._x(), anotherPoint._y());
  7945. return self;},
  7946. 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')}),
  7947. smalltalk.CanvasRenderingContext);
  7948. smalltalk.addMethod(
  7949. '_strokeStyle_',
  7950. smalltalk.method({
  7951. selector: 'strokeStyle:',
  7952. category: 'drawing paths',
  7953. fn: function (aString){
  7954. var self=this;
  7955. self.strokeStyle = String(aString);
  7956. return self;},
  7957. source: unescape('strokeStyle%3A%20aString%0A%09%7B%27self.strokeStyle%20%3D%20String%28aString%29%27%7D')}),
  7958. smalltalk.CanvasRenderingContext);
  7959. smalltalk.addMethod(
  7960. '_lineWidth_',
  7961. smalltalk.method({
  7962. selector: 'lineWidth:',
  7963. category: 'drawing paths',
  7964. fn: function (aNumber){
  7965. var self=this;
  7966. self.lineWidth = aNumber;
  7967. return self;},
  7968. source: unescape('lineWidth%3A%20aNumber%0A%09%7B%27self.lineWidth%20%3D%20aNumber%27%7D')}),
  7969. smalltalk.CanvasRenderingContext);
  7970. smalltalk.addMethod(
  7971. '_tagBrush_',
  7972. smalltalk.method({
  7973. selector: 'tagBrush:',
  7974. category: 'instance creation',
  7975. fn: function (aTagBrush){
  7976. var self=this;
  7977. return aTagBrush._element().getContext('2d');
  7978. return self;},
  7979. source: unescape('tagBrush%3A%20aTagBrush%0A%09%7B%27return%20aTagBrush._element%28%29.getContext%28%27%272d%27%27%29%27%7D')}),
  7980. smalltalk.CanvasRenderingContext.klass);
  7981. smalltalk.addClass('HTMLCanvas', smalltalk.Object, ['root'], 'Canvas');
  7982. smalltalk.addMethod(
  7983. '_root_',
  7984. smalltalk.method({
  7985. selector: 'root:',
  7986. category: 'accessing',
  7987. fn: function (aTagBrush){
  7988. var self=this;
  7989. self['@root']=aTagBrush;
  7990. return self;},
  7991. source: unescape('root%3A%20aTagBrush%0A%20%20%20%20root%20%3A%3D%20aTagBrush%0A')}),
  7992. smalltalk.HTMLCanvas);
  7993. smalltalk.addMethod(
  7994. '_root',
  7995. smalltalk.method({
  7996. selector: 'root',
  7997. category: 'accessing',
  7998. fn: function (){
  7999. var self=this;
  8000. return self['@root'];
  8001. return self;},
  8002. source: unescape('root%0A%20%20%20%20%5Eroot%0A')}),
  8003. smalltalk.HTMLCanvas);
  8004. smalltalk.addMethod(
  8005. '_initialize',
  8006. smalltalk.method({
  8007. selector: 'initialize',
  8008. category: 'initialization',
  8009. fn: function (){
  8010. var self=this;
  8011. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  8012. self['@root']=smalltalk.send(smalltalk.TagBrush, "_fromString_canvas_", ["div", self]);
  8013. return self;},
  8014. 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')}),
  8015. smalltalk.HTMLCanvas);
  8016. smalltalk.addMethod(
  8017. '_with_',
  8018. smalltalk.method({
  8019. selector: 'with:',
  8020. category: 'adding',
  8021. fn: function (anObject){
  8022. var self=this;
  8023. return smalltalk.send(smalltalk.send(self, "_root", []), "_with_", [anObject]);
  8024. return self;},
  8025. source: unescape('with%3A%20anObject%0A%20%20%20%20%5Eself%20root%20with%3A%20anObject%0A')}),
  8026. smalltalk.HTMLCanvas);
  8027. smalltalk.addMethod(
  8028. '_newTag_',
  8029. smalltalk.method({
  8030. selector: 'newTag:',
  8031. category: 'tags',
  8032. fn: function (aString){
  8033. var self=this;
  8034. return smalltalk.send(smalltalk.TagBrush, "_fromString_canvas_", [aString, self]);
  8035. return self;},
  8036. source: unescape('newTag%3A%20aString%0A%20%20%20%20%5ETagBrush%20fromString%3A%20aString%20canvas%3A%20self%0A')}),
  8037. smalltalk.HTMLCanvas);
  8038. smalltalk.addMethod(
  8039. '_tag_',
  8040. smalltalk.method({
  8041. selector: 'tag:',
  8042. category: 'tags',
  8043. fn: function (aString){
  8044. var self=this;
  8045. return smalltalk.send(self['@root'], "_addBrush_", [smalltalk.send(self, "_newTag_", [aString])]);
  8046. return self;},
  8047. source: unescape('tag%3A%20aString%0A%20%20%20%20%5Eroot%20addBrush%3A%20%28self%20newTag%3A%20aString%29%0A')}),
  8048. smalltalk.HTMLCanvas);
  8049. smalltalk.addMethod(
  8050. '_h1',
  8051. smalltalk.method({
  8052. selector: 'h1',
  8053. category: 'tags',
  8054. fn: function (){
  8055. var self=this;
  8056. return smalltalk.send(self, "_tag_", ["h1"]);
  8057. return self;},
  8058. source: unescape('h1%0A%20%20%20%20%5Eself%20tag%3A%20%27h1%27%0A')}),
  8059. smalltalk.HTMLCanvas);
  8060. smalltalk.addMethod(
  8061. '_h2',
  8062. smalltalk.method({
  8063. selector: 'h2',
  8064. category: 'tags',
  8065. fn: function (){
  8066. var self=this;
  8067. return smalltalk.send(self, "_tag_", ["h2"]);
  8068. return self;},
  8069. source: unescape('h2%0A%20%20%20%20%5Eself%20tag%3A%20%27h2%27%0A')}),
  8070. smalltalk.HTMLCanvas);
  8071. smalltalk.addMethod(
  8072. '_h3',
  8073. smalltalk.method({
  8074. selector: 'h3',
  8075. category: 'tags',
  8076. fn: function (){
  8077. var self=this;
  8078. return smalltalk.send(self, "_tag_", ["h3"]);
  8079. return self;},
  8080. source: unescape('h3%0A%20%20%20%20%5Eself%20tag%3A%20%27h3%27%0A')}),
  8081. smalltalk.HTMLCanvas);
  8082. smalltalk.addMethod(
  8083. '_h4',
  8084. smalltalk.method({
  8085. selector: 'h4',
  8086. category: 'tags',
  8087. fn: function (){
  8088. var self=this;
  8089. return smalltalk.send(self, "_tag_", ["h4"]);
  8090. return self;},
  8091. source: unescape('h4%0A%20%20%20%20%5Eself%20tag%3A%20%27h4%27%0A')}),
  8092. smalltalk.HTMLCanvas);
  8093. smalltalk.addMethod(
  8094. '_h5',
  8095. smalltalk.method({
  8096. selector: 'h5',
  8097. category: 'tags',
  8098. fn: function (){
  8099. var self=this;
  8100. return smalltalk.send(self, "_tag_", ["h5"]);
  8101. return self;},
  8102. source: unescape('h5%0A%20%20%20%20%5Eself%20tag%3A%20%27h5%27%0A')}),
  8103. smalltalk.HTMLCanvas);
  8104. smalltalk.addMethod(
  8105. '_h6',
  8106. smalltalk.method({
  8107. selector: 'h6',
  8108. category: 'tags',
  8109. fn: function (){
  8110. var self=this;
  8111. return smalltalk.send(self, "_tag_", ["h6"]);
  8112. return self;},
  8113. source: unescape('h6%0A%20%20%20%20%5Eself%20tag%3A%20%27h6%27%0A')}),
  8114. smalltalk.HTMLCanvas);
  8115. smalltalk.addMethod(
  8116. '_p',
  8117. smalltalk.method({
  8118. selector: 'p',
  8119. category: 'tags',
  8120. fn: function (){
  8121. var self=this;
  8122. return smalltalk.send(self, "_tag_", ["p"]);
  8123. return self;},
  8124. source: unescape('p%0A%20%20%20%20%5Eself%20tag%3A%20%27p%27%0A')}),
  8125. smalltalk.HTMLCanvas);
  8126. smalltalk.addMethod(
  8127. '_div',
  8128. smalltalk.method({
  8129. selector: 'div',
  8130. category: 'tags',
  8131. fn: function (){
  8132. var self=this;
  8133. return smalltalk.send(self, "_tag_", ["div"]);
  8134. return self;},
  8135. source: unescape('div%0A%20%20%20%20%5Eself%20tag%3A%20%27div%27%0A')}),
  8136. smalltalk.HTMLCanvas);
  8137. smalltalk.addMethod(
  8138. '_span',
  8139. smalltalk.method({
  8140. selector: 'span',
  8141. category: 'tags',
  8142. fn: function (){
  8143. var self=this;
  8144. return smalltalk.send(self, "_tag_", ["span"]);
  8145. return self;},
  8146. source: unescape('span%0A%20%20%20%20%5Eself%20tag%3A%20%27span%27%0A')}),
  8147. smalltalk.HTMLCanvas);
  8148. smalltalk.addMethod(
  8149. '_img',
  8150. smalltalk.method({
  8151. selector: 'img',
  8152. category: 'tags',
  8153. fn: function (){
  8154. var self=this;
  8155. return smalltalk.send(self, "_tag_", ["img"]);
  8156. return self;},
  8157. source: unescape('img%0A%20%20%20%20%5Eself%20tag%3A%20%27img%27%0A')}),
  8158. smalltalk.HTMLCanvas);
  8159. smalltalk.addMethod(
  8160. '_ul',
  8161. smalltalk.method({
  8162. selector: 'ul',
  8163. category: 'tags',
  8164. fn: function (){
  8165. var self=this;
  8166. return smalltalk.send(self, "_tag_", ["ul"]);
  8167. return self;},
  8168. source: unescape('ul%0A%20%20%20%20%5Eself%20tag%3A%20%27ul%27%0A')}),
  8169. smalltalk.HTMLCanvas);
  8170. smalltalk.addMethod(
  8171. '_ol',
  8172. smalltalk.method({
  8173. selector: 'ol',
  8174. category: 'tags',
  8175. fn: function (){
  8176. var self=this;
  8177. return smalltalk.send(self, "_tag_", ["ol"]);
  8178. return self;},
  8179. source: unescape('ol%0A%20%20%20%20%5Eself%20tag%3A%20%27ol%27%0A')}),
  8180. smalltalk.HTMLCanvas);
  8181. smalltalk.addMethod(
  8182. '_li',
  8183. smalltalk.method({
  8184. selector: 'li',
  8185. category: 'tags',
  8186. fn: function (){
  8187. var self=this;
  8188. return smalltalk.send(self, "_tag_", ["li"]);
  8189. return self;},
  8190. source: unescape('li%0A%20%20%20%20%5Eself%20tag%3A%20%27li%27%0A')}),
  8191. smalltalk.HTMLCanvas);
  8192. smalltalk.addMethod(
  8193. '_table',
  8194. smalltalk.method({
  8195. selector: 'table',
  8196. category: 'tags',
  8197. fn: function (){
  8198. var self=this;
  8199. return smalltalk.send(self, "_tag_", ["table"]);
  8200. return self;},
  8201. source: unescape('table%0A%20%20%20%20%5Eself%20tag%3A%20%27table%27%0A')}),
  8202. smalltalk.HTMLCanvas);
  8203. smalltalk.addMethod(
  8204. '_tr',
  8205. smalltalk.method({
  8206. selector: 'tr',
  8207. category: 'tags',
  8208. fn: function (){
  8209. var self=this;
  8210. return smalltalk.send(self, "_tag_", ["tr"]);
  8211. return self;},
  8212. source: unescape('tr%0A%20%20%20%20%5Eself%20tag%3A%20%27tr%27%0A')}),
  8213. smalltalk.HTMLCanvas);
  8214. smalltalk.addMethod(
  8215. '_td',
  8216. smalltalk.method({
  8217. selector: 'td',
  8218. category: 'tags',
  8219. fn: function (){
  8220. var self=this;
  8221. return smalltalk.send(self, "_tag_", ["td"]);
  8222. return self;},
  8223. source: unescape('td%20%0A%20%20%20%20%5Eself%20tag%3A%20%27td%27%0A')}),
  8224. smalltalk.HTMLCanvas);
  8225. smalltalk.addMethod(
  8226. '_th',
  8227. smalltalk.method({
  8228. selector: 'th',
  8229. category: 'tags',
  8230. fn: function (){
  8231. var self=this;
  8232. return smalltalk.send(self, "_tag_", ["th"]);
  8233. return self;},
  8234. source: unescape('th%0A%20%20%20%20%5Eself%20tag%3A%20%27th%27%0A')}),
  8235. smalltalk.HTMLCanvas);
  8236. smalltalk.addMethod(
  8237. '_form',
  8238. smalltalk.method({
  8239. selector: 'form',
  8240. category: 'tags',
  8241. fn: function (){
  8242. var self=this;
  8243. return smalltalk.send(self, "_tag_", ["form"]);
  8244. return self;},
  8245. source: unescape('form%0A%20%20%20%20%5Eself%20tag%3A%20%27form%27%0A')}),
  8246. smalltalk.HTMLCanvas);
  8247. smalltalk.addMethod(
  8248. '_input',
  8249. smalltalk.method({
  8250. selector: 'input',
  8251. category: 'tags',
  8252. fn: function (){
  8253. var self=this;
  8254. return smalltalk.send(self, "_tag_", ["input"]);
  8255. return self;},
  8256. source: unescape('input%0A%20%20%20%20%5Eself%20tag%3A%20%27input%27%0A')}),
  8257. smalltalk.HTMLCanvas);
  8258. smalltalk.addMethod(
  8259. '_button',
  8260. smalltalk.method({
  8261. selector: 'button',
  8262. category: 'tags',
  8263. fn: function (){
  8264. var self=this;
  8265. return smalltalk.send(self, "_tag_", ["button"]);
  8266. return self;},
  8267. source: unescape('button%0A%20%20%20%20%5Eself%20tag%3A%20%27button%27%0A')}),
  8268. smalltalk.HTMLCanvas);
  8269. smalltalk.addMethod(
  8270. '_select',
  8271. smalltalk.method({
  8272. selector: 'select',
  8273. category: 'tags',
  8274. fn: function (){
  8275. var self=this;
  8276. return smalltalk.send(self, "_tag_", ["select"]);
  8277. return self;},
  8278. source: unescape('select%0A%20%20%20%20%5Eself%20tag%3A%20%27select%27%0A')}),
  8279. smalltalk.HTMLCanvas);
  8280. smalltalk.addMethod(
  8281. '_option',
  8282. smalltalk.method({
  8283. selector: 'option',
  8284. category: 'tags',
  8285. fn: function (){
  8286. var self=this;
  8287. return smalltalk.send(self, "_tag_", ["option"]);
  8288. return self;},
  8289. source: unescape('option%0A%20%20%20%20%5Eself%20tag%3A%20%27option%27%0A')}),
  8290. smalltalk.HTMLCanvas);
  8291. smalltalk.addMethod(
  8292. '_textarea',
  8293. smalltalk.method({
  8294. selector: 'textarea',
  8295. category: 'tags',
  8296. fn: function (){
  8297. var self=this;
  8298. return smalltalk.send(self, "_tag_", ["textarea"]);
  8299. return self;},
  8300. source: unescape('textarea%0A%20%20%20%20%5Eself%20tag%3A%20%27textarea%27%0A')}),
  8301. smalltalk.HTMLCanvas);
  8302. smalltalk.addMethod(
  8303. '_a',
  8304. smalltalk.method({
  8305. selector: 'a',
  8306. category: 'tags',
  8307. fn: function (){
  8308. var self=this;
  8309. return smalltalk.send(self, "_tag_", ["a"]);
  8310. return self;},
  8311. source: unescape('a%0A%20%20%20%20%5Eself%20tag%3A%20%27a%27%0A')}),
  8312. smalltalk.HTMLCanvas);
  8313. smalltalk.addMethod(
  8314. '_appendToJQuery_',
  8315. smalltalk.method({
  8316. selector: 'appendToJQuery:',
  8317. category: '*JQuery',
  8318. fn: function (aJQuery){
  8319. var self=this;
  8320. smalltalk.send(aJQuery, "_appendElement_", [smalltalk.send(self['@root'], "_element", [])]);
  8321. return self;},
  8322. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20aJQuery%20appendElement%3A%20root%20element%0A')}),
  8323. smalltalk.HTMLCanvas);
  8324. smalltalk.addMethod(
  8325. '_canvas',
  8326. smalltalk.method({
  8327. selector: 'canvas',
  8328. category: 'tags',
  8329. fn: function (){
  8330. var self=this;
  8331. return smalltalk.send(self, "_tag_", ["canvas"]);
  8332. return self;},
  8333. source: unescape('canvas%0A%09%5Eself%20tag%3A%20%27canvas%27%0A')}),
  8334. smalltalk.HTMLCanvas);
  8335. smalltalk.addClass('TagBrush', smalltalk.Object, ['canvas', 'element'], 'Canvas');
  8336. smalltalk.addMethod(
  8337. '_contents_',
  8338. smalltalk.method({
  8339. selector: 'contents:',
  8340. category: 'adding',
  8341. fn: function (anObject){
  8342. var self=this;
  8343. smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_empty", []);
  8344. smalltalk.send(self, "_append_", [anObject]);
  8345. return self;},
  8346. source: unescape('contents%3A%20anObject%0A%20%20%20%20self%20asJQuery%20empty.%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  8347. smalltalk.TagBrush);
  8348. smalltalk.addMethod(
  8349. '_addBrush_',
  8350. smalltalk.method({
  8351. selector: 'addBrush:',
  8352. category: 'adding',
  8353. fn: function (aTagBrush){
  8354. var self=this;
  8355. smalltalk.send(self, "_appendChild_", [smalltalk.send(aTagBrush, "_element", [])]);
  8356. return aTagBrush;
  8357. return self;},
  8358. source: unescape('addBrush%3A%20aTagBrush%0A%20%20%20%20self%20appendChild%3A%20aTagBrush%20element.%0A%20%20%20%20%5EaTagBrush%0A')}),
  8359. smalltalk.TagBrush);
  8360. smalltalk.addMethod(
  8361. '_with_',
  8362. smalltalk.method({
  8363. selector: 'with:',
  8364. category: 'adding',
  8365. fn: function (anObject){
  8366. var self=this;
  8367. smalltalk.send(self, "_append_", [anObject]);
  8368. return self;},
  8369. source: unescape('with%3A%20anObject%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  8370. smalltalk.TagBrush);
  8371. smalltalk.addMethod(
  8372. '_append_',
  8373. smalltalk.method({
  8374. selector: 'append:',
  8375. category: 'adding',
  8376. fn: function (anObject){
  8377. var self=this;
  8378. smalltalk.send(anObject, "_appendToBrush_", [self]);
  8379. return self;},
  8380. source: unescape('append%3A%20anObject%0A%20%20%20%20anObject%20appendToBrush%3A%20self%0A')}),
  8381. smalltalk.TagBrush);
  8382. smalltalk.addMethod(
  8383. '_appendToBrush_',
  8384. smalltalk.method({
  8385. selector: 'appendToBrush:',
  8386. category: 'adding',
  8387. fn: function (aTagBrush){
  8388. var self=this;
  8389. smalltalk.send(aTagBrush, "_addBrush_", [self]);
  8390. return self;},
  8391. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20aTagBrush%20addBrush%3A%20self%0A')}),
  8392. smalltalk.TagBrush);
  8393. smalltalk.addMethod(
  8394. '_appendBlock_',
  8395. smalltalk.method({
  8396. selector: 'appendBlock:',
  8397. category: 'adding',
  8398. fn: function (aBlock){
  8399. var self=this;
  8400. var root=nil;
  8401. root=smalltalk.send(self['@canvas'], "_root", []);
  8402. smalltalk.send(self['@canvas'], "_root_", [self]);
  8403. smalltalk.send(aBlock, "_value_", [self['@canvas']]);
  8404. smalltalk.send(self['@canvas'], "_root_", [root]);
  8405. return self;},
  8406. 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')}),
  8407. smalltalk.TagBrush);
  8408. smalltalk.addMethod(
  8409. '_appendChild_',
  8410. smalltalk.method({
  8411. selector: 'appendChild:',
  8412. category: 'adding',
  8413. fn: function (anElement){
  8414. var self=this;
  8415. self['@element'].appendChild(anElement);
  8416. return self;},
  8417. 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')}),
  8418. smalltalk.TagBrush);
  8419. smalltalk.addMethod(
  8420. '_appendString_',
  8421. smalltalk.method({
  8422. selector: 'appendString:',
  8423. category: 'adding',
  8424. fn: function (aString){
  8425. var self=this;
  8426. smalltalk.send(self, "_appendChild_", [smalltalk.send(self, "_createTextNodeFor_", [aString])]);
  8427. return self;},
  8428. source: unescape('appendString%3A%20aString%0A%20%20%20%20self%20appendChild%3A%20%28self%20createTextNodeFor%3A%20aString%29%0A')}),
  8429. smalltalk.TagBrush);
  8430. smalltalk.addMethod(
  8431. '_at_put_',
  8432. smalltalk.method({
  8433. selector: 'at:put:',
  8434. category: 'attributes',
  8435. fn: function (aString, aValue){
  8436. var self=this;
  8437. self['@element'].setAttribute(aString, aValue);
  8438. return self;},
  8439. 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')}),
  8440. smalltalk.TagBrush);
  8441. smalltalk.addMethod(
  8442. '_removeAt_',
  8443. smalltalk.method({
  8444. selector: 'removeAt:',
  8445. category: 'attributes',
  8446. fn: function (aString){
  8447. var self=this;
  8448. self['@element'].removeAttribute(aString);
  8449. return self;},
  8450. 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')}),
  8451. smalltalk.TagBrush);
  8452. smalltalk.addMethod(
  8453. '_class_',
  8454. smalltalk.method({
  8455. selector: 'class:',
  8456. category: 'attributes',
  8457. fn: function (aString){
  8458. var self=this;
  8459. smalltalk.send(self, "_at_put_", ["class", aString]);
  8460. return self;},
  8461. source: unescape('class%3A%20aString%0A%20%20%20%20self%20at%3A%20%27class%27%20put%3A%20aString%0A')}),
  8462. smalltalk.TagBrush);
  8463. smalltalk.addMethod(
  8464. '_id_',
  8465. smalltalk.method({
  8466. selector: 'id:',
  8467. category: 'attributes',
  8468. fn: function (aString){
  8469. var self=this;
  8470. smalltalk.send(self, "_at_put_", ["id", aString]);
  8471. return self;},
  8472. source: unescape('id%3A%20aString%0A%20%20%20%20self%20at%3A%20%27id%27%20put%3A%20aString%0A')}),
  8473. smalltalk.TagBrush);
  8474. smalltalk.addMethod(
  8475. '_src_',
  8476. smalltalk.method({
  8477. selector: 'src:',
  8478. category: 'attributes',
  8479. fn: function (aString){
  8480. var self=this;
  8481. smalltalk.send(self, "_at_put_", ["src", aString]);
  8482. return self;},
  8483. source: unescape('src%3A%20aString%0A%20%20%20%20self%20%20at%3A%20%27src%27%20put%3A%20aString%0A')}),
  8484. smalltalk.TagBrush);
  8485. smalltalk.addMethod(
  8486. '_href_',
  8487. smalltalk.method({
  8488. selector: 'href:',
  8489. category: 'attributes',
  8490. fn: function (aString){
  8491. var self=this;
  8492. smalltalk.send(self, "_at_put_", ["href", aString]);
  8493. return self;},
  8494. source: unescape('href%3A%20aString%0A%20%20%20%20self%20at%3A%20%27href%27%20put%3A%20aString%0A')}),
  8495. smalltalk.TagBrush);
  8496. smalltalk.addMethod(
  8497. '_title_',
  8498. smalltalk.method({
  8499. selector: 'title:',
  8500. category: 'attributes',
  8501. fn: function (aString){
  8502. var self=this;
  8503. smalltalk.send(self, "_at_put_", ["title", aString]);
  8504. return self;},
  8505. source: unescape('title%3A%20aString%0A%20%20%20%20self%20at%3A%20%27title%27%20put%3A%20aString%0A')}),
  8506. smalltalk.TagBrush);
  8507. smalltalk.addMethod(
  8508. '_style_',
  8509. smalltalk.method({
  8510. selector: 'style:',
  8511. category: 'attributes',
  8512. fn: function (aString){
  8513. var self=this;
  8514. smalltalk.send(self, "_at_put_", ["style", aString]);
  8515. return self;},
  8516. source: unescape('style%3A%20aString%0A%20%20%20%20self%20at%3A%20%27style%27%20put%3A%20aString%0A')}),
  8517. smalltalk.TagBrush);
  8518. smalltalk.addMethod(
  8519. '_initializeFromString_canvas_',
  8520. smalltalk.method({
  8521. selector: 'initializeFromString:canvas:',
  8522. category: 'initialization',
  8523. fn: function (aString, aCanvas){
  8524. var self=this;
  8525. self['@element']=smalltalk.send(self, "_createElementFor_", [aString]);
  8526. self['@canvas']=aCanvas;
  8527. return self;},
  8528. 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')}),
  8529. smalltalk.TagBrush);
  8530. smalltalk.addMethod(
  8531. '_element',
  8532. smalltalk.method({
  8533. selector: 'element',
  8534. category: 'accessing',
  8535. fn: function (){
  8536. var self=this;
  8537. return self['@element'];
  8538. return self;},
  8539. source: unescape('element%0A%20%20%20%20%5Eelement%0A')}),
  8540. smalltalk.TagBrush);
  8541. smalltalk.addMethod(
  8542. '_asJQuery',
  8543. smalltalk.method({
  8544. selector: 'asJQuery',
  8545. category: 'converting',
  8546. fn: function (){
  8547. var self=this;
  8548. return smalltalk.JQuery._from_(jQuery(self['@element']));
  8549. return self;},
  8550. source: unescape('asJQuery%0A%09%7B%27return%20smalltalk.JQuery._from_%28jQuery%28self%5B%27%27@element%27%27%5D%29%29%27%7D%0A')}),
  8551. smalltalk.TagBrush);
  8552. smalltalk.addMethod(
  8553. '_asJQueryDo_',
  8554. smalltalk.method({
  8555. selector: 'asJQueryDo:',
  8556. category: 'converting',
  8557. fn: function (aBlock){
  8558. var self=this;
  8559. smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_asJQuery", [])]);
  8560. return self;},
  8561. source: unescape('asJQueryDo%3A%20aBlock%0A%20%20%20%20aBlock%20value%3A%20self%20asJQuery%0A')}),
  8562. smalltalk.TagBrush);
  8563. smalltalk.addMethod(
  8564. '_onKeyDown_',
  8565. smalltalk.method({
  8566. selector: 'onKeyDown:',
  8567. category: 'events',
  8568. fn: function (aBlock){
  8569. var self=this;
  8570. smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["keydown", aBlock]);
  8571. return self;},
  8572. source: unescape('onKeyDown%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keydown%27%20do%3A%20aBlock%0A')}),
  8573. smalltalk.TagBrush);
  8574. smalltalk.addMethod(
  8575. '_onKeyPress_',
  8576. smalltalk.method({
  8577. selector: 'onKeyPress:',
  8578. category: 'events',
  8579. fn: function (aBlock){
  8580. var self=this;
  8581. smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["keypress", aBlock]);
  8582. return self;},
  8583. source: unescape('onKeyPress%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keypress%27%20do%3A%20aBlock%0A')}),
  8584. smalltalk.TagBrush);
  8585. smalltalk.addMethod(
  8586. '_onKeyUp_',
  8587. smalltalk.method({
  8588. selector: 'onKeyUp:',
  8589. category: 'events',
  8590. fn: function (aBlock){
  8591. var self=this;
  8592. smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["keyup", aBlock]);
  8593. return self;},
  8594. source: unescape('onKeyUp%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keyup%27%20do%3A%20aBlock%0A')}),
  8595. smalltalk.TagBrush);
  8596. smalltalk.addMethod(
  8597. '_onFocus_',
  8598. smalltalk.method({
  8599. selector: 'onFocus:',
  8600. category: 'events',
  8601. fn: function (aBlock){
  8602. var self=this;
  8603. smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["focus", aBlock]);
  8604. return self;},
  8605. source: unescape('onFocus%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27focus%27%20do%3A%20aBlock%0A')}),
  8606. smalltalk.TagBrush);
  8607. smalltalk.addMethod(
  8608. '_onBlur_',
  8609. smalltalk.method({
  8610. selector: 'onBlur:',
  8611. category: 'events',
  8612. fn: function (aBlock){
  8613. var self=this;
  8614. smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["blur", aBlock]);
  8615. return self;},
  8616. source: unescape('onBlur%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27blur%27%20do%3A%20aBlock%0A')}),
  8617. smalltalk.TagBrush);
  8618. smalltalk.addMethod(
  8619. '_onChange_',
  8620. smalltalk.method({
  8621. selector: 'onChange:',
  8622. category: 'events',
  8623. fn: function (aBlock){
  8624. var self=this;
  8625. smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["change", aBlock]);
  8626. return self;},
  8627. source: unescape('onChange%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27change%27%20do%3A%20aBlock%0A')}),
  8628. smalltalk.TagBrush);
  8629. smalltalk.addMethod(
  8630. '_onClick_',
  8631. smalltalk.method({
  8632. selector: 'onClick:',
  8633. category: 'events',
  8634. fn: function (aBlock){
  8635. var self=this;
  8636. smalltalk.send(smalltalk.send(self, "_asJQuery", []), "_on_do_", ["click", aBlock]);
  8637. return self;},
  8638. source: unescape('onClick%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27click%27%20do%3A%20aBlock%0A')}),
  8639. smalltalk.TagBrush);
  8640. smalltalk.addMethod(
  8641. '_createElementFor_',
  8642. smalltalk.method({
  8643. selector: 'createElementFor:',
  8644. category: 'private',
  8645. fn: function (aString){
  8646. var self=this;
  8647. return document.createElement(String(aString));
  8648. return self;},
  8649. source: unescape('createElementFor%3A%20aString%0A%09%7B%27return%20document.createElement%28String%28aString%29%29%27%7D%0A')}),
  8650. smalltalk.TagBrush);
  8651. smalltalk.addMethod(
  8652. '_createTextNodeFor_',
  8653. smalltalk.method({
  8654. selector: 'createTextNodeFor:',
  8655. category: 'private',
  8656. fn: function (aString){
  8657. var self=this;
  8658. return document.createTextNode(String(aString));
  8659. return self;},
  8660. source: unescape('createTextNodeFor%3A%20aString%0A%09%7B%27return%20document.createTextNode%28String%28aString%29%29%27%7D%0A')}),
  8661. smalltalk.TagBrush);
  8662. smalltalk.addMethod(
  8663. '_fromString_canvas_',
  8664. smalltalk.method({
  8665. selector: 'fromString:canvas:',
  8666. category: 'instance creation',
  8667. fn: function (aString, aCanvas){
  8668. var self=this;
  8669. return (function($rec){smalltalk.send($rec, "_initializeFromString_canvas_", [aString, aCanvas]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  8670. return self;},
  8671. 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')}),
  8672. smalltalk.TagBrush.klass);
  8673. smalltalk.addClass('Widget', smalltalk.Object, ['root'], 'Canvas');
  8674. smalltalk.addMethod(
  8675. '_root',
  8676. smalltalk.method({
  8677. selector: 'root',
  8678. category: 'accessing',
  8679. fn: function (){
  8680. var self=this;
  8681. return self['@root'];
  8682. return self;},
  8683. source: unescape('root%0A%20%20%20%20%5Eroot%0A')}),
  8684. smalltalk.Widget);
  8685. smalltalk.addMethod(
  8686. '_appendToBrush_',
  8687. smalltalk.method({
  8688. selector: 'appendToBrush:',
  8689. category: 'adding',
  8690. fn: function (aTagBrush){
  8691. var self=this;
  8692. smalltalk.send(self, "_appendToJQuery_", [smalltalk.send(aTagBrush, "_asJQuery", [])]);
  8693. return self;},
  8694. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20self%20appendToJQuery%3A%20aTagBrush%20asJQuery%0A')}),
  8695. smalltalk.Widget);
  8696. smalltalk.addMethod(
  8697. '_appendToJQuery_',
  8698. smalltalk.method({
  8699. selector: 'appendToJQuery:',
  8700. category: 'adding',
  8701. fn: function (aJQuery){
  8702. var self=this;
  8703. smalltalk.send(self, "_render", []);
  8704. smalltalk.send(aJQuery, "_append_", [smalltalk.send(smalltalk.send(self, "_root", []), "_asJQuery", [])]);
  8705. return self;},
  8706. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20self%20render.%0A%20%20%20%20aJQuery%20append%3A%20self%20root%20asJQuery%0A')}),
  8707. smalltalk.Widget);
  8708. smalltalk.addMethod(
  8709. '_alert_',
  8710. smalltalk.method({
  8711. selector: 'alert:',
  8712. category: 'actions',
  8713. fn: function (aString){
  8714. var self=this;
  8715. alert(aString);
  8716. return self;},
  8717. source: unescape('alert%3A%20aString%0A%20%20%20%20%7B%27alert%28aString%29%27%7D%0A')}),
  8718. smalltalk.Widget);
  8719. smalltalk.addMethod(
  8720. '_confirm_',
  8721. smalltalk.method({
  8722. selector: 'confirm:',
  8723. category: 'actions',
  8724. fn: function (aString){
  8725. var self=this;
  8726. return window.confirm(aString);
  8727. return self;},
  8728. source: unescape('confirm%3A%20aString%0A%20%20%20%20%7B%27return%20window.confirm%28aString%29%27%7D%0A')}),
  8729. smalltalk.Widget);
  8730. smalltalk.addMethod(
  8731. '_prompt_',
  8732. smalltalk.method({
  8733. selector: 'prompt:',
  8734. category: 'actions',
  8735. fn: function (aString){
  8736. var self=this;
  8737. return smalltalk.send(self, "_prompt_default_", [aString, ""]);
  8738. return self;},
  8739. source: unescape('prompt%3A%20aString%0A%20%20%20%20%5Eself%20prompt%3A%20aString%20default%3A%20%27%27%0A')}),
  8740. smalltalk.Widget);
  8741. smalltalk.addMethod(
  8742. '_prompt_default_',
  8743. smalltalk.method({
  8744. selector: 'prompt:default:',
  8745. category: 'actions',
  8746. fn: function (aString, anotherString){
  8747. var self=this;
  8748. return window.prompt(aString, anotherString);
  8749. return self;},
  8750. source: unescape('prompt%3A%20aString%20default%3A%20anotherString%0A%20%20%20%20%7B%27return%20window.prompt%28aString%2C%20anotherString%29%27%7D%0A')}),
  8751. smalltalk.Widget);
  8752. smalltalk.addMethod(
  8753. '_update',
  8754. smalltalk.method({
  8755. selector: 'update',
  8756. category: 'actions',
  8757. fn: function (){
  8758. var self=this;
  8759. var canvas=nil;
  8760. canvas=smalltalk.send(smalltalk.HTMLCanvas, "_new", []);
  8761. smalltalk.send(canvas, "_root_", [smalltalk.send(self, "_root", [])]);
  8762. smalltalk.send(smalltalk.send(smalltalk.send(self, "_root", []), "_asJQuery", []), "_empty", []);
  8763. smalltalk.send(self, "_renderOn_", [canvas]);
  8764. return self;},
  8765. 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')}),
  8766. smalltalk.Widget);
  8767. smalltalk.addMethod(
  8768. '_render',
  8769. smalltalk.method({
  8770. selector: 'render',
  8771. category: 'rendering',
  8772. fn: function (){
  8773. var self=this;
  8774. var canvas=nil;
  8775. canvas=smalltalk.send(smalltalk.HTMLCanvas, "_new", []);
  8776. self['@root']=smalltalk.send(canvas, "_root", []);
  8777. smalltalk.send(self, "_renderOn_", [canvas]);
  8778. return self;},
  8779. 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')}),
  8780. smalltalk.Widget);
  8781. smalltalk.addMethod(
  8782. '_renderOn_',
  8783. smalltalk.method({
  8784. selector: 'renderOn:',
  8785. category: 'rendering',
  8786. fn: function (html){
  8787. var self=this;
  8788. self;
  8789. return self;},
  8790. source: unescape('renderOn%3A%20html%0A%20%20%20%20self%0A')}),
  8791. smalltalk.Widget);
  8792. smalltalk.addClass('CanvasBrush', smalltalk.TagBrush, [], 'Canvas');
  8793. smalltalk.addMethod(
  8794. '_createElement',
  8795. smalltalk.method({
  8796. selector: 'createElement',
  8797. category: 'private',
  8798. fn: function (){
  8799. var self=this;
  8800. return document.createElement('canvas');
  8801. return self;},
  8802. source: unescape('createElement%0A%09%7B%27return%20document.createElement%28%27%27canvas%27%27%29%27%7D')}),
  8803. smalltalk.CanvasBrush);
  8804. smalltalk.addMethod(
  8805. '_initializeWithCanvas_',
  8806. smalltalk.method({
  8807. selector: 'initializeWithCanvas:',
  8808. category: 'initialization',
  8809. fn: function (aCanvas){
  8810. var self=this;
  8811. canvas=aCanvas;
  8812. return self;},
  8813. source: unescape('initializeWithCanvas%3A%20aCanvas%0A%09canvas%20%3A%3D%20aCanvas')}),
  8814. smalltalk.CanvasBrush);
  8815. smalltalk.addMethod(
  8816. '_canvas_',
  8817. smalltalk.method({
  8818. selector: 'canvas:',
  8819. category: 'instance creation',
  8820. fn: function (aCanvas){
  8821. var self=this;
  8822. return (function($rec){smalltalk.send($rec, "_initializeWithCanvas_", [aCanvas]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  8823. return self;},
  8824. source: unescape('canvas%3A%20aCanvas%0A%09%5Eself%20new%0A%09%09initializeWithCanvas%3A%20aCanvas%3B%0A%09%09yourself')}),
  8825. smalltalk.CanvasBrush.klass);
  8826. smalltalk.addClass('TabManager', smalltalk.Widget, ['selectedTab', 'tabs', 'opened'], 'IDE');
  8827. smalltalk.addMethod(
  8828. '_initialize',
  8829. smalltalk.method({
  8830. selector: 'initialize',
  8831. category: 'initialization',
  8832. fn: function (){
  8833. var self=this;
  8834. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  8835. self['@opened']=true;
  8836. (function($rec){smalltalk.send($rec, "_append_", [self]);smalltalk.send($rec, "_append_", [(function(html){return smalltalk.send(smalltalk.send(html, "_div", []), "_id_", ["jtalk"]);})]);return smalltalk.send($rec, "_addClass_", ["jtalkBody"]);})(smalltalk.send("body", "_asJQuery", []));
  8837. (function($rec){smalltalk.send($rec, "_addTab_", [smalltalk.send(smalltalk.Transcript, "_current", [])]);return smalltalk.send($rec, "_addTab_", [smalltalk.send(smalltalk.Workspace, "_new", [])]);})(self);
  8838. smalltalk.send(self, "_selectTab_", [smalltalk.send(smalltalk.send(self, "_tabs", []), "_last", [])]);
  8839. (function($rec){smalltalk.send($rec, "_onResize_", [(function(){return (function($rec){smalltalk.send($rec, "_updateBodyMargin", []);return smalltalk.send($rec, "_updatePosition", []);})(self);})]);return smalltalk.send($rec, "_onWindowResize_", [(function(){return smalltalk.send(self, "_updatePosition", []);})]);})(self);
  8840. return self;},
  8841. 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')}),
  8842. smalltalk.TabManager);
  8843. smalltalk.addMethod(
  8844. '_tabs',
  8845. smalltalk.method({
  8846. selector: 'tabs',
  8847. category: 'accessing',
  8848. fn: function (){
  8849. var self=this;
  8850. return smalltalk.send(self['@tabs'], "_ifNil_", [(function(){return self['@tabs']=smalltalk.send(smalltalk.Array, "_new", []);})]);
  8851. return self;},
  8852. source: unescape('tabs%0A%20%20%20%20%5Etabs%20ifNil%3A%20%5Btabs%20%3A%3D%20Array%20new%5D%0A')}),
  8853. smalltalk.TabManager);
  8854. smalltalk.addMethod(
  8855. '_addTab_',
  8856. smalltalk.method({
  8857. selector: 'addTab:',
  8858. category: 'adding/Removing',
  8859. fn: function (aWidget){
  8860. var self=this;
  8861. smalltalk.send(smalltalk.send(self, "_tabs", []), "_add_", [aWidget]);
  8862. smalltalk.send(smalltalk.send(unescape("%23jtalk"), "_asJQuery", []), "_append_", [aWidget]);
  8863. smalltalk.send(smalltalk.send(smalltalk.send(aWidget, "_root", []), "_asJQuery", []), "_hide", []);
  8864. return self;},
  8865. 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')}),
  8866. smalltalk.TabManager);
  8867. smalltalk.addMethod(
  8868. '_removeTab_',
  8869. smalltalk.method({
  8870. selector: 'removeTab:',
  8871. category: 'adding/Removing',
  8872. fn: function (aWidget){
  8873. var self=this;
  8874. smalltalk.send(smalltalk.send(self, "_tabs", []), "_remove_", [aWidget]);
  8875. smalltalk.send(self, "_update", []);
  8876. return self;},
  8877. source: unescape('removeTab%3A%20aWidget%0A%20%20%20%20self%20tabs%20remove%3A%20aWidget.%0A%20%20%20%20self%20update%0A')}),
  8878. smalltalk.TabManager);
  8879. smalltalk.addMethod(
  8880. '_updateBodyMargin',
  8881. smalltalk.method({
  8882. selector: 'updateBodyMargin',
  8883. category: 'actions',
  8884. fn: function (){
  8885. var self=this;
  8886. smalltalk.send(self, "_setBodyMargin_", [smalltalk.send(smalltalk.send(smalltalk.send(unescape("%23jtalk"), "_asJQuery", []), "_height", []), "__plus", [(27)])]);
  8887. return self;},
  8888. source: unescape('updateBodyMargin%0A%20%20%20%20self%20setBodyMargin%3A%20%27%23jtalk%27%20asJQuery%20height%20+%2027%0A')}),
  8889. smalltalk.TabManager);
  8890. smalltalk.addMethod(
  8891. '_updatePosition',
  8892. smalltalk.method({
  8893. selector: 'updatePosition',
  8894. category: 'actions',
  8895. fn: function (){
  8896. var self=this;
  8897. jQuery('#jtalk').css('top', '').css('bottom', '27px');;
  8898. return self;},
  8899. 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')}),
  8900. smalltalk.TabManager);
  8901. smalltalk.addMethod(
  8902. '_removeBodyMargin',
  8903. smalltalk.method({
  8904. selector: 'removeBodyMargin',
  8905. category: 'actions',
  8906. fn: function (){
  8907. var self=this;
  8908. smalltalk.send(self, "_setBodyMargin_", [(0)]);
  8909. return self;},
  8910. source: unescape('removeBodyMargin%0A%20%20%20%20self%20setBodyMargin%3A%200%0A')}),
  8911. smalltalk.TabManager);
  8912. smalltalk.addMethod(
  8913. '_setBodyMargin_',
  8914. smalltalk.method({
  8915. selector: 'setBodyMargin:',
  8916. category: 'actions',
  8917. fn: function (anInteger){
  8918. var self=this;
  8919. smalltalk.send(smalltalk.send(".jtalkBody", "_asJQuery", []), "_cssAt_put_", [unescape("margin-bottom"), smalltalk.send(smalltalk.send(anInteger, "_asString", []), "__comma", ["px"])]);
  8920. return self;},
  8921. 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')}),
  8922. smalltalk.TabManager);
  8923. smalltalk.addMethod(
  8924. '_onResize_',
  8925. smalltalk.method({
  8926. selector: 'onResize:',
  8927. category: 'actions',
  8928. fn: function (aBlock){
  8929. var self=this;
  8930. jQuery('#jtalk').resizable({
  8931. handles: 'n',
  8932. resize: aBlock,
  8933. minHeight: 230
  8934. });;
  8935. return self;},
  8936. 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')}),
  8937. smalltalk.TabManager);
  8938. smalltalk.addMethod(
  8939. '_onWindowResize_',
  8940. smalltalk.method({
  8941. selector: 'onWindowResize:',
  8942. category: 'actions',
  8943. fn: function (aBlock){
  8944. var self=this;
  8945. jQuery(window).resize(aBlock);
  8946. return self;},
  8947. source: unescape('onWindowResize%3A%20aBlock%0A%20%20%20%20%7B%27jQuery%28window%29.resize%28aBlock%29%27%7D%0A')}),
  8948. smalltalk.TabManager);
  8949. smalltalk.addMethod(
  8950. '_open',
  8951. smalltalk.method({
  8952. selector: 'open',
  8953. category: 'actions',
  8954. fn: function (){
  8955. var self=this;
  8956. smalltalk.send(self['@opened'], "_ifFalse_", [(function(){smalltalk.send(smalltalk.send(smalltalk.send(self, "_root", []), "_asJQuery", []), "_show", []);smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_addClass_", ["jtalkBody"]);smalltalk.send(smalltalk.send(unescape("%23jtalk"), "_asJQuery", []), "_show", []);smalltalk.send(self, "_updateBodyMargin", []);smalltalk.send(smalltalk.send(smalltalk.send(self['@selectedTab'], "_root", []), "_asJQuery", []), "_show", []);return self['@opened']=true;})]);
  8957. return self;},
  8958. 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')}),
  8959. smalltalk.TabManager);
  8960. smalltalk.addMethod(
  8961. '_close',
  8962. smalltalk.method({
  8963. selector: 'close',
  8964. category: 'actions',
  8965. fn: function (){
  8966. var self=this;
  8967. smalltalk.send(self['@opened'], "_ifTrue_", [(function(){smalltalk.send(smalltalk.send(smalltalk.send(self, "_root", []), "_asJQuery", []), "_hide", []);smalltalk.send(smalltalk.send(unescape("%23jtalk"), "_asJQuery", []), "_hide", []);smalltalk.send(self, "_removeBodyMargin", []);smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_removeClass_", ["jtalkBody"]);return self['@opened']=false;})]);
  8968. return self;},
  8969. 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')}),
  8970. smalltalk.TabManager);
  8971. smalltalk.addMethod(
  8972. '_newBrowserTab',
  8973. smalltalk.method({
  8974. selector: 'newBrowserTab',
  8975. category: 'actions',
  8976. fn: function (){
  8977. var self=this;
  8978. smalltalk.send(smalltalk.Browser, "_open", []);
  8979. return self;},
  8980. source: unescape('newBrowserTab%0A%20%20%20%20Browser%20open%0A')}),
  8981. smalltalk.TabManager);
  8982. smalltalk.addMethod(
  8983. '_selectTab_',
  8984. smalltalk.method({
  8985. selector: 'selectTab:',
  8986. category: 'actions',
  8987. fn: function (aWidget){
  8988. var self=this;
  8989. smalltalk.send(self, "_open", []);
  8990. self['@selectedTab']=aWidget;
  8991. smalltalk.send(smalltalk.send(self, "_tabs", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(smalltalk.send(each, "_root", []), "_asJQuery", []), "_hide", []);})]);
  8992. smalltalk.send(smalltalk.send(smalltalk.send(aWidget, "_root", []), "_asJQuery", []), "_show", []);
  8993. smalltalk.send(self, "_update", []);
  8994. return self;},
  8995. 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')}),
  8996. smalltalk.TabManager);
  8997. smalltalk.addMethod(
  8998. '_closeTab_',
  8999. smalltalk.method({
  9000. selector: 'closeTab:',
  9001. category: 'actions',
  9002. fn: function (aWidget){
  9003. var self=this;
  9004. smalltalk.send(self, "_removeTab_", [aWidget]);
  9005. smalltalk.send(self, "_selectTab_", [smalltalk.send(smalltalk.send(self, "_tabs", []), "_last", [])]);
  9006. smalltalk.send(smalltalk.send(smalltalk.send(aWidget, "_root", []), "_asJQuery", []), "_remove", []);
  9007. smalltalk.send(self, "_update", []);
  9008. return self;},
  9009. 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')}),
  9010. smalltalk.TabManager);
  9011. smalltalk.addMethod(
  9012. '_renderOn_',
  9013. smalltalk.method({
  9014. selector: 'renderOn:',
  9015. category: 'rendering',
  9016. fn: function (html){
  9017. var self=this;
  9018. (function($rec){smalltalk.send($rec, "_id_", ["jtalkTabs"]);return smalltalk.send($rec, "_with_", [(function(){(function($rec){smalltalk.send($rec, "_class_", ["closeAll"]);smalltalk.send($rec, "_with_", ["x"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_close", []);})]);})(smalltalk.send(html, "_li", []));smalltalk.send(smalltalk.send(self, "_tabs", []), "_do_", [(function(each){return smalltalk.send(self, "_renderTabFor_on_", [each, html]);})]);return (function($rec){smalltalk.send($rec, "_class_", ["newtab"]);smalltalk.send($rec, "_with_", [unescape("%20+%20")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_newBrowserTab", []);})]);})(smalltalk.send(html, "_li", []));})]);})(smalltalk.send(html, "_ul", []));
  9019. return self;},
  9020. 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')}),
  9021. smalltalk.TabManager);
  9022. smalltalk.addMethod(
  9023. '_renderTabFor_on_',
  9024. smalltalk.method({
  9025. selector: 'renderTabFor:on:',
  9026. category: 'rendering',
  9027. fn: function (aWidget, html){
  9028. var self=this;
  9029. var li=nil;
  9030. li=smalltalk.send(html, "_li", []);
  9031. smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", [aWidget]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);
  9032. smalltalk.send(li, "_with_", [(function(){(function($rec){smalltalk.send($rec, "_with_", [smalltalk.send(aWidget, "_label", [])]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectTab_", [aWidget]);})]);})(smalltalk.send(html, "_span", []));return smalltalk.send(smalltalk.send(aWidget, "_canBeClosed", []), "_ifTrue_", [(function(){return (function($rec){smalltalk.send($rec, "_class_", ["close"]);smalltalk.send($rec, "_with_", ["x"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_closeTab_", [aWidget]);})]);})(smalltalk.send(html, "_span", []));})]);})]);
  9033. return self;},
  9034. 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')}),
  9035. smalltalk.TabManager);
  9036. smalltalk.TabManager.klass.iVarNames = ['current'];
  9037. smalltalk.addMethod(
  9038. '_current',
  9039. smalltalk.method({
  9040. selector: 'current',
  9041. category: 'instance creation',
  9042. fn: function (){
  9043. var self=this;
  9044. return smalltalk.send(self['@current'], "_ifNil_", [(function(){return self['@current']=self.klass.superclass.fn.prototype['_new'].apply(self, []);})]);
  9045. return self;},
  9046. source: unescape('current%0A%20%20%20%20%5Ecurrent%20ifNil%3A%20%5Bcurrent%20%3A%3D%20super%20new%5D%0A')}),
  9047. smalltalk.TabManager.klass);
  9048. smalltalk.addMethod(
  9049. '_new',
  9050. smalltalk.method({
  9051. selector: 'new',
  9052. category: 'instance creation',
  9053. fn: function (){
  9054. var self=this;
  9055. smalltalk.send(self, "_shouldNotImplement", []);
  9056. return self;},
  9057. source: unescape('new%0A%20%20%20%20self%20shouldNotImplement%0A')}),
  9058. smalltalk.TabManager.klass);
  9059. smalltalk.addClass('TabWidget', smalltalk.Widget, [], 'IDE');
  9060. smalltalk.addMethod(
  9061. '_label',
  9062. smalltalk.method({
  9063. selector: 'label',
  9064. category: 'accessing',
  9065. fn: function (){
  9066. var self=this;
  9067. smalltalk.send(self, "_subclassResponsibility", []);
  9068. return self;},
  9069. source: unescape('label%0A%20%20%20%20self%20subclassResponsibility%0A')}),
  9070. smalltalk.TabWidget);
  9071. smalltalk.addMethod(
  9072. '_open',
  9073. smalltalk.method({
  9074. selector: 'open',
  9075. category: 'actions',
  9076. fn: function (){
  9077. var self=this;
  9078. (function($rec){smalltalk.send($rec, "_addTab_", [self]);return smalltalk.send($rec, "_selectTab_", [self]);})(smalltalk.send(smalltalk.TabManager, "_current", []));
  9079. return self;},
  9080. source: unescape('open%0A%20%20%20%20TabManager%20current%0A%09addTab%3A%20self%3B%0A%09selectTab%3A%20self%0A')}),
  9081. smalltalk.TabWidget);
  9082. smalltalk.addMethod(
  9083. '_canBeClosed',
  9084. smalltalk.method({
  9085. selector: 'canBeClosed',
  9086. category: 'testing',
  9087. fn: function (){
  9088. var self=this;
  9089. return false;
  9090. return self;},
  9091. source: unescape('canBeClosed%0A%20%20%20%20%5Efalse%0A')}),
  9092. smalltalk.TabWidget);
  9093. smalltalk.addMethod(
  9094. '_renderOn_',
  9095. smalltalk.method({
  9096. selector: 'renderOn:',
  9097. category: 'rendering',
  9098. fn: function (html){
  9099. var self=this;
  9100. (function($rec){smalltalk.send($rec, "_class_", ["jtalkTool"]);return smalltalk.send($rec, "_with_", [(function(){(function($rec){smalltalk.send($rec, "_class_", ["jt_box"]);return smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(self, "_renderBoxOn_", [html]);})]);})(smalltalk.send(html, "_div", []));return (function($rec){smalltalk.send($rec, "_class_", ["jt_buttons"]);return smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(self, "_renderButtonsOn_", [html]);})]);})(smalltalk.send(html, "_div", []));})]);})(smalltalk.send(html, "_root", []));
  9101. return self;},
  9102. 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')}),
  9103. smalltalk.TabWidget);
  9104. smalltalk.addMethod(
  9105. '_renderBoxOn_',
  9106. smalltalk.method({
  9107. selector: 'renderBoxOn:',
  9108. category: 'rendering',
  9109. fn: function (html){
  9110. var self=this;
  9111. return self;},
  9112. source: unescape('renderBoxOn%3A%20html%0A')}),
  9113. smalltalk.TabWidget);
  9114. smalltalk.addMethod(
  9115. '_renderButtonsOn_',
  9116. smalltalk.method({
  9117. selector: 'renderButtonsOn:',
  9118. category: 'rendering',
  9119. fn: function (html){
  9120. var self=this;
  9121. return self;},
  9122. source: unescape('renderButtonsOn%3A%20html%0A')}),
  9123. smalltalk.TabWidget);
  9124. smalltalk.addMethod(
  9125. '_open',
  9126. smalltalk.method({
  9127. selector: 'open',
  9128. category: 'instance creation',
  9129. fn: function (){
  9130. var self=this;
  9131. return smalltalk.send(smalltalk.send(self, "_new", []), "_open", []);
  9132. return self;},
  9133. source: unescape('open%0A%20%20%20%20%5Eself%20new%20open%0A')}),
  9134. smalltalk.TabWidget.klass);
  9135. smalltalk.addClass('Workspace', smalltalk.TabWidget, ['textarea'], 'IDE');
  9136. smalltalk.addMethod(
  9137. '_label',
  9138. smalltalk.method({
  9139. selector: 'label',
  9140. category: 'accessing',
  9141. fn: function (){
  9142. var self=this;
  9143. return unescape("%5BWorkspace%5D");
  9144. return self;},
  9145. source: unescape('label%0A%20%20%20%20%5E%27%5BWorkspace%5D%27%0A')}),
  9146. smalltalk.Workspace);
  9147. smalltalk.addMethod(
  9148. '_selection',
  9149. smalltalk.method({
  9150. selector: 'selection',
  9151. category: 'accessing',
  9152. fn: function (){
  9153. var self=this;
  9154. return document.selection;
  9155. return self;},
  9156. source: unescape('selection%0A%20%20%20%20%7B%27return%20document.selection%27%7D%0A')}),
  9157. smalltalk.Workspace);
  9158. smalltalk.addMethod(
  9159. '_selectionStart',
  9160. smalltalk.method({
  9161. selector: 'selectionStart',
  9162. category: 'accessing',
  9163. fn: function (){
  9164. var self=this;
  9165. return jQuery('.jt_workspace')[0].selectionStart;
  9166. return self;},
  9167. source: unescape('selectionStart%0A%20%20%20%20%7B%27return%20jQuery%28%27%27.jt_workspace%27%27%29%5B0%5D.selectionStart%27%7D%0A')}),
  9168. smalltalk.Workspace);
  9169. smalltalk.addMethod(
  9170. '_selectionEnd',
  9171. smalltalk.method({
  9172. selector: 'selectionEnd',
  9173. category: 'accessing',
  9174. fn: function (){
  9175. var self=this;
  9176. return jQuery('.jt_workspace')[0].selectionEnd;
  9177. return self;},
  9178. source: unescape('selectionEnd%0A%20%20%20%20%7B%27return%20jQuery%28%27%27.jt_workspace%27%27%29%5B0%5D.selectionEnd%27%7D%0A')}),
  9179. smalltalk.Workspace);
  9180. smalltalk.addMethod(
  9181. '_selectionStart_',
  9182. smalltalk.method({
  9183. selector: 'selectionStart:',
  9184. category: 'accessing',
  9185. fn: function (anInteger){
  9186. var self=this;
  9187. jQuery('.jt_workspace')[0].selectionStart = anInteger;
  9188. return self;},
  9189. 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')}),
  9190. smalltalk.Workspace);
  9191. smalltalk.addMethod(
  9192. '_selectionEnd_',
  9193. smalltalk.method({
  9194. selector: 'selectionEnd:',
  9195. category: 'accessing',
  9196. fn: function (anInteger){
  9197. var self=this;
  9198. jQuery('.jt_workspace')[0].selectionEnd = anInteger;
  9199. return self;},
  9200. 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')}),
  9201. smalltalk.Workspace);
  9202. smalltalk.addMethod(
  9203. '_currentLine',
  9204. smalltalk.method({
  9205. selector: 'currentLine',
  9206. category: 'accessing',
  9207. fn: function (){
  9208. var self=this;
  9209. try{var lines=nil;
  9210. var startLine=nil;
  9211. var endLine=nil;
  9212. lines=smalltalk.send(smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val", []), "_tokenize_", [smalltalk.send(smalltalk.String, "_cr", [])]);
  9213. startLine=endLine=(0);
  9214. smalltalk.send(lines, "_do_", [(function(each){endLine=smalltalk.send(startLine, "__plus", [smalltalk.send(each, "_size", [])]);startLine=smalltalk.send(endLine, "__plus", [(1)]);return smalltalk.send(smalltalk.send(endLine, "__gt_eq", [smalltalk.send(self, "_selectionStart", [])]), "_ifTrue_", [(function(){smalltalk.send(self, "_selectionEnd_", [endLine]);return (function(){throw({name: 'stReturn', selector: '_currentLine', fn: function(){return each}})})();})]);})]);
  9215. return self;
  9216. } catch(e) {if(e.name === 'stReturn' && e.selector === '_currentLine'){return e.fn()} throw(e)}},
  9217. 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')}),
  9218. smalltalk.Workspace);
  9219. smalltalk.addMethod(
  9220. '_handleKeyDown_',
  9221. smalltalk.method({
  9222. selector: 'handleKeyDown:',
  9223. category: 'actions',
  9224. fn: function (anEvent){
  9225. var self=this;
  9226. if(anEvent.ctrlKey) {
  9227. if(anEvent.keyCode === 80) { //ctrl+p
  9228. self._printIt();
  9229. anEvent.preventDefault();
  9230. return false;
  9231. }
  9232. if(anEvent.keyCode === 68) { //ctrl+d
  9233. self._doIt();
  9234. anEvent.preventDefault();
  9235. return false;
  9236. }
  9237. if(anEvent.keyCode === 73) { //ctrl+i
  9238. self._inspectIt();
  9239. anEvent.preventDefault();
  9240. return false;
  9241. }
  9242. };
  9243. return self;},
  9244. source: unescape('handleKeyDown%3A%20anEvent%0A%20%20%20%20%7B%27if%28anEvent.ctrlKey%29%20%7B%0A%09%09if%28anEvent.keyCode%20%3D%3D%3D%2080%29%20%7B%20//ctrl+p%0A%09%09%09self._printIt%28%29%3B%0A%09%09%09anEvent.preventDefault%28%29%3B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%09%09if%28anEvent.keyCode%20%3D%3D%3D%2068%29%20%7B%20//ctrl+d%0A%09%09%09self._doIt%28%29%3B%0A%09%09%09anEvent.preventDefault%28%29%3B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%09%09if%28anEvent.keyCode%20%3D%3D%3D%2073%29%20%7B%20//ctrl+i%0A%09%09%09self._inspectIt%28%29%3B%0A%09%09%09anEvent.preventDefault%28%29%3B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%09%7D%27%7D%0A')}),
  9245. smalltalk.Workspace);
  9246. smalltalk.addMethod(
  9247. '_clearWorkspace',
  9248. smalltalk.method({
  9249. selector: 'clearWorkspace',
  9250. category: 'actions',
  9251. fn: function (){
  9252. var self=this;
  9253. smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val_", [""]);
  9254. return self;},
  9255. source: unescape('clearWorkspace%0A%20%20%20%20textarea%20asJQuery%20val%3A%20%27%27%0A')}),
  9256. smalltalk.Workspace);
  9257. smalltalk.addMethod(
  9258. '_doIt',
  9259. smalltalk.method({
  9260. selector: 'doIt',
  9261. category: 'actions',
  9262. fn: function (){
  9263. var self=this;
  9264. var selection=nil;
  9265. smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_focus", []);
  9266. smalltalk.send(smalltalk.send(smalltalk.send(self, "_selectionStart", []), "__eq", [smalltalk.send(self, "_selectionEnd", [])]), "_ifTrue_ifFalse_", [(function(){return selection=smalltalk.send(self, "_currentLine", []);}), (function(){return selection=smalltalk.send(smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val", []), "_copyFrom_to_", [smalltalk.send(smalltalk.send(self, "_selectionStart", []), "__plus", [(1)]), smalltalk.send(smalltalk.send(self, "_selectionEnd", []), "__plus", [(1)])]);})]);
  9267. return smalltalk.send(self, "_eval_", [selection]);
  9268. return self;},
  9269. 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')}),
  9270. smalltalk.Workspace);
  9271. smalltalk.addMethod(
  9272. '_printIt',
  9273. smalltalk.method({
  9274. selector: 'printIt',
  9275. category: 'actions',
  9276. fn: function (){
  9277. var self=this;
  9278. smalltalk.send(self, "_print_", [smalltalk.send(smalltalk.send(self, "_doIt", []), "_printString", [])]);
  9279. return self;},
  9280. source: unescape('printIt%0A%20%20%20%20self%20print%3A%20self%20doIt%20printString%0A')}),
  9281. smalltalk.Workspace);
  9282. smalltalk.addMethod(
  9283. '_print_',
  9284. smalltalk.method({
  9285. selector: 'print:',
  9286. category: 'actions',
  9287. fn: function (aString){
  9288. var self=this;
  9289. var start=nil;
  9290. start=smalltalk.send(self, "_selectionEnd", []);
  9291. smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val", []), "_copyFrom_to_", [(1), start]), "__comma", [" "]), "__comma", [aString]), "__comma", [" "]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val", []), "_copyFrom_to_", [smalltalk.send(start, "__plus", [(1)]), smalltalk.send(smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val", []), "_size", [])])])]);
  9292. smalltalk.send(self, "_selectionStart_", [start]);
  9293. smalltalk.send(self, "_selectionEnd_", [smalltalk.send(smalltalk.send(start, "__plus", [smalltalk.send(aString, "_size", [])]), "__plus", [(2)])]);
  9294. return self;},
  9295. 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')}),
  9296. smalltalk.Workspace);
  9297. smalltalk.addMethod(
  9298. '_eval_',
  9299. smalltalk.method({
  9300. selector: 'eval:',
  9301. category: 'actions',
  9302. fn: function (aString){
  9303. var self=this;
  9304. try{var compiler=nil;
  9305. var node=nil;
  9306. compiler=smalltalk.send(smalltalk.Compiler, "_new", []);
  9307. node=smalltalk.send(compiler, "_parseExpression_", [aString]);
  9308. smalltalk.send(smalltalk.send(node, "_isParseFailure", []), "_ifTrue_", [(function(){return (function(){throw({name: 'stReturn', selector: '_eval_', fn: function(){return smalltalk.send(self, "_alert_", [smalltalk.send(smalltalk.send(smalltalk.send(node, "_reason", []), "__comma", [unescape("%2C%20position%3A%20")]), "__comma", [smalltalk.send(node, "_position", [])])])}})})();})]);
  9309. (function(){throw({name: 'stReturn', selector: '_eval_', fn: function(){return smalltalk.send(compiler, "_loadExpression_", [aString])}})})();
  9310. return self;
  9311. } catch(e) {if(e.name === 'stReturn' && e.selector === '_eval_'){return e.fn()} throw(e)}},
  9312. 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')}),
  9313. smalltalk.Workspace);
  9314. smalltalk.addMethod(
  9315. '_renderBoxOn_',
  9316. smalltalk.method({
  9317. selector: 'renderBoxOn:',
  9318. category: 'rendering',
  9319. fn: function (html){
  9320. var self=this;
  9321. self['@textarea']=smalltalk.send(html, "_textarea", []);
  9322. smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_call_", ["tabby"]);
  9323. smalltalk.send(self['@textarea'], "_onKeyDown_", [(function(e){return smalltalk.send(self, "_handleKeyDown_", [e]);})]);
  9324. (function($rec){smalltalk.send($rec, "_class_", ["jt_workspace"]);return smalltalk.send($rec, "_at_put_", ["spellcheck", "false"]);})(self['@textarea']);
  9325. return self;},
  9326. 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')}),
  9327. smalltalk.Workspace);
  9328. smalltalk.addMethod(
  9329. '_renderButtonsOn_',
  9330. smalltalk.method({
  9331. selector: 'renderButtonsOn:',
  9332. category: 'rendering',
  9333. fn: function (html){
  9334. var self=this;
  9335. (function($rec){smalltalk.send($rec, "_with_", ["DoIt"]);smalltalk.send($rec, "_title_", [unescape("ctrl+d")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_doIt", []);})]);})(smalltalk.send(html, "_button", []));
  9336. (function($rec){smalltalk.send($rec, "_with_", ["PrintIt"]);smalltalk.send($rec, "_title_", [unescape("ctrl+p")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_printIt", []);})]);})(smalltalk.send(html, "_button", []));
  9337. (function($rec){smalltalk.send($rec, "_with_", ["InspectIt"]);smalltalk.send($rec, "_title_", [unescape("ctrl+i")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_inspectIt", []);})]);})(smalltalk.send(html, "_button", []));
  9338. (function($rec){smalltalk.send($rec, "_with_", ["Clear workspace"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_clearWorkspace", []);})]);})(smalltalk.send(html, "_button", []));
  9339. return self;},
  9340. 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')}),
  9341. smalltalk.Workspace);
  9342. smalltalk.addMethod(
  9343. '_inspectIt',
  9344. smalltalk.method({
  9345. selector: 'inspectIt',
  9346. category: 'actions',
  9347. fn: function (){
  9348. var self=this;
  9349. smalltalk.send(smalltalk.send(self, "_doIt", []), "_inspect", []);
  9350. return self;},
  9351. source: unescape('inspectIt%0A%20%20%20%20self%20doIt%20inspect%0A')}),
  9352. smalltalk.Workspace);
  9353. smalltalk.addClass('Transcript', smalltalk.TabWidget, ['textarea'], 'IDE');
  9354. smalltalk.addMethod(
  9355. '_label',
  9356. smalltalk.method({
  9357. selector: 'label',
  9358. category: 'accessing',
  9359. fn: function (){
  9360. var self=this;
  9361. return unescape("%5BTranscript%5D");
  9362. return self;},
  9363. source: unescape('label%0A%20%20%20%20%5E%27%5BTranscript%5D%27%0A')}),
  9364. smalltalk.Transcript);
  9365. smalltalk.addMethod(
  9366. '_show_',
  9367. smalltalk.method({
  9368. selector: 'show:',
  9369. category: 'actions',
  9370. fn: function (anObject){
  9371. var self=this;
  9372. smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val_", [smalltalk.send(smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val", []), "__comma", [smalltalk.send(anObject, "_asString", [])])]);
  9373. return self;},
  9374. source: unescape('show%3A%20anObject%0A%20%20%20%20textarea%20asJQuery%20val%3A%20textarea%20asJQuery%20val%2C%20anObject%20asString.%0A%0A')}),
  9375. smalltalk.Transcript);
  9376. smalltalk.addMethod(
  9377. '_cr',
  9378. smalltalk.method({
  9379. selector: 'cr',
  9380. category: 'actions',
  9381. fn: function (){
  9382. var self=this;
  9383. smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val_", [smalltalk.send(smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val", []), "__comma", [smalltalk.send(smalltalk.String, "_cr", [])])]);
  9384. return self;},
  9385. source: unescape('cr%0A%20%20%20%20textarea%20asJQuery%20val%3A%20textarea%20asJQuery%20val%2C%20String%20cr.%0A')}),
  9386. smalltalk.Transcript);
  9387. smalltalk.addMethod(
  9388. '_clear',
  9389. smalltalk.method({
  9390. selector: 'clear',
  9391. category: 'actions',
  9392. fn: function (){
  9393. var self=this;
  9394. smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_val_", [""]);
  9395. return self;},
  9396. source: unescape('clear%0A%20%20%20%20textarea%20asJQuery%20val%3A%20%27%27%0A')}),
  9397. smalltalk.Transcript);
  9398. smalltalk.addMethod(
  9399. '_renderBoxOn_',
  9400. smalltalk.method({
  9401. selector: 'renderBoxOn:',
  9402. category: 'rendering',
  9403. fn: function (html){
  9404. var self=this;
  9405. self['@textarea']=smalltalk.send(html, "_textarea", []);
  9406. smalltalk.send(smalltalk.send(self['@textarea'], "_asJQuery", []), "_call_", ["tabby"]);
  9407. (function($rec){smalltalk.send($rec, "_class_", ["jt_transcript"]);return smalltalk.send($rec, "_at_put_", ["spellcheck", "false"]);})(self['@textarea']);
  9408. return self;},
  9409. 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')}),
  9410. smalltalk.Transcript);
  9411. smalltalk.addMethod(
  9412. '_renderButtonsOn_',
  9413. smalltalk.method({
  9414. selector: 'renderButtonsOn:',
  9415. category: 'rendering',
  9416. fn: function (html){
  9417. var self=this;
  9418. (function($rec){smalltalk.send($rec, "_with_", ["Clear transcript"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_clear", []);})]);})(smalltalk.send(html, "_button", []));
  9419. return self;},
  9420. 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')}),
  9421. smalltalk.Transcript);
  9422. smalltalk.Transcript.klass.iVarNames = ['current'];
  9423. smalltalk.addMethod(
  9424. '_open',
  9425. smalltalk.method({
  9426. selector: 'open',
  9427. category: 'instance creation',
  9428. fn: function (){
  9429. var self=this;
  9430. smalltalk.send(smalltalk.send(self, "_current", []), "_open", []);
  9431. return self;},
  9432. source: unescape('open%0A%20%20%20%20self%20current%20open%0A')}),
  9433. smalltalk.Transcript.klass);
  9434. smalltalk.addMethod(
  9435. '_new',
  9436. smalltalk.method({
  9437. selector: 'new',
  9438. category: 'instance creation',
  9439. fn: function (){
  9440. var self=this;
  9441. smalltalk.send(self, "_shouldNotImplement", []);
  9442. return self;},
  9443. source: unescape('new%0A%20%20%20%20self%20shouldNotImplement%0A')}),
  9444. smalltalk.Transcript.klass);
  9445. smalltalk.addMethod(
  9446. '_current',
  9447. smalltalk.method({
  9448. selector: 'current',
  9449. category: 'instance creation',
  9450. fn: function (){
  9451. var self=this;
  9452. return smalltalk.send(self['@current'], "_ifNil_", [(function(){return self['@current']=self.klass.superclass.fn.prototype['_new'].apply(self, []);})]);
  9453. return self;},
  9454. source: unescape('current%0A%20%20%20%20%5Ecurrent%20ifNil%3A%20%5Bcurrent%20%3A%3D%20super%20new%5D%0A')}),
  9455. smalltalk.Transcript.klass);
  9456. smalltalk.addMethod(
  9457. '_show_',
  9458. smalltalk.method({
  9459. selector: 'show:',
  9460. category: 'printing',
  9461. fn: function (anObject){
  9462. var self=this;
  9463. smalltalk.send(smalltalk.send(self, "_current", []), "_show_", [anObject]);
  9464. return self;},
  9465. source: unescape('show%3A%20anObject%0A%20%20%20%20self%20current%20show%3A%20anObject%0A')}),
  9466. smalltalk.Transcript.klass);
  9467. smalltalk.addMethod(
  9468. '_cr',
  9469. smalltalk.method({
  9470. selector: 'cr',
  9471. category: 'printing',
  9472. fn: function (){
  9473. var self=this;
  9474. smalltalk.send(smalltalk.send(self, "_current", []), "_show_", [smalltalk.send(smalltalk.String, "_cr", [])]);
  9475. return self;},
  9476. source: unescape('cr%0A%20%20%20%20self%20current%20show%3A%20String%20cr%0A')}),
  9477. smalltalk.Transcript.klass);
  9478. smalltalk.addMethod(
  9479. '_clear',
  9480. smalltalk.method({
  9481. selector: 'clear',
  9482. category: 'printing',
  9483. fn: function (){
  9484. var self=this;
  9485. smalltalk.send(smalltalk.send(self, "_current", []), "_clear", []);
  9486. return self;},
  9487. source: unescape('clear%0A%20%20%20%20self%20current%20clear%0A')}),
  9488. smalltalk.Transcript.klass);
  9489. smalltalk.addClass('Browser', smalltalk.TabWidget, ['selectedCategory', 'selectedClass', 'selectedProtocol', 'selectedMethod', 'commitButton', 'categoriesList', 'classesList', 'protocolsList', 'methodsList', 'sourceTextarea', 'tabsList', 'selectedTab', 'saveButton', 'classButtons', 'methodButtons', 'unsavedChanges'], 'IDE');
  9490. smalltalk.addMethod(
  9491. '_initialize',
  9492. smalltalk.method({
  9493. selector: 'initialize',
  9494. category: 'initialization',
  9495. fn: function (){
  9496. var self=this;
  9497. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  9498. self['@selectedTab']="instance";
  9499. self['@unsavedChanges']=false;
  9500. return self;},
  9501. 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')}),
  9502. smalltalk.Browser);
  9503. smalltalk.addMethod(
  9504. '_label',
  9505. smalltalk.method({
  9506. selector: 'label',
  9507. category: 'accessing',
  9508. fn: function (){
  9509. var self=this;
  9510. return smalltalk.send(self['@selectedClass'], "_ifNil_ifNotNil_", [(function(){return unescape("Browser%20%28nil%29");}), (function(){return smalltalk.send(self['@selectedClass'], "_name", []);})]);
  9511. return self;},
  9512. 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')}),
  9513. smalltalk.Browser);
  9514. smalltalk.addMethod(
  9515. '_categories',
  9516. smalltalk.method({
  9517. selector: 'categories',
  9518. category: 'accessing',
  9519. fn: function (){
  9520. var self=this;
  9521. var categories=nil;
  9522. categories=smalltalk.send(smalltalk.Array, "_new", []);
  9523. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Smalltalk, "_current", []), "_classes", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(categories, "_includes_", [smalltalk.send(each, "_category", [])]), "_ifFalse_", [(function(){return smalltalk.send(categories, "_add_", [smalltalk.send(each, "_category", [])]);})]);})]);
  9524. return smalltalk.send(categories, "_sort", []);
  9525. return self;},
  9526. 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')}),
  9527. smalltalk.Browser);
  9528. smalltalk.addMethod(
  9529. '_classes',
  9530. smalltalk.method({
  9531. selector: 'classes',
  9532. category: 'accessing',
  9533. fn: function (){
  9534. var self=this;
  9535. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Smalltalk, "_current", []), "_classes", []), "_select_", [(function(each){return smalltalk.send(smalltalk.send(each, "_category", []), "__eq", [self['@selectedCategory']]);})]), "_sort_", [(function(a, b){return smalltalk.send(smalltalk.send(a, "_name", []), "__gt", [smalltalk.send(b, "_name", [])]);})]);
  9536. return self;},
  9537. 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')}),
  9538. smalltalk.Browser);
  9539. smalltalk.addMethod(
  9540. '_protocols',
  9541. smalltalk.method({
  9542. selector: 'protocols',
  9543. category: 'accessing',
  9544. fn: function (){
  9545. var self=this;
  9546. try{var klass=nil;
  9547. var protocols=nil;
  9548. protocols=smalltalk.send(smalltalk.Array, "_new", []);
  9549. smalltalk.send(self['@selectedClass'], "_ifNotNil_", [(function(){smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["comment"]), "_ifTrue_", [(function(){return (function(){throw({name: 'stReturn', selector: '_protocols', fn: function(){return []}})})();})]);klass=smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["instance"]), "_ifTrue_ifFalse_", [(function(){return self['@selectedClass'];}), (function(){return smalltalk.send(self['@selectedClass'], "_class", []);})]);smalltalk.send(smalltalk.send(smalltalk.send(klass, "_methodDictionary", []), "_isEmpty", []), "_ifTrue_", [(function(){return smalltalk.send(protocols, "_add_", ["not yet classified"]);})]);return smalltalk.send(smalltalk.send(klass, "_methodDictionary", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(protocols, "_includes_", [smalltalk.send(each, "_category", [])]), "_ifFalse_", [(function(){return smalltalk.send(protocols, "_add_", [smalltalk.send(each, "_category", [])]);})]);})]);})]);
  9550. (function(){throw({name: 'stReturn', selector: '_protocols', fn: function(){return smalltalk.send(protocols, "_sort", [])}})})();
  9551. return self;
  9552. } catch(e) {if(e.name === 'stReturn' && e.selector === '_protocols'){return e.fn()} throw(e)}},
  9553. 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')}),
  9554. smalltalk.Browser);
  9555. smalltalk.addMethod(
  9556. '_methods',
  9557. smalltalk.method({
  9558. selector: 'methods',
  9559. category: 'accessing',
  9560. fn: function (){
  9561. var self=this;
  9562. try{var klass=nil;
  9563. smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["comment"]), "_ifTrue_", [(function(){return (function(){throw({name: 'stReturn', selector: '_methods', fn: function(){return []}})})();})]);
  9564. smalltalk.send(self['@selectedClass'], "_ifNotNil_", [(function(){return klass=smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["instance"]), "_ifTrue_ifFalse_", [(function(){return self['@selectedClass'];}), (function(){return smalltalk.send(self['@selectedClass'], "_class", []);})]);})]);
  9565. (function(){throw({name: 'stReturn', selector: '_methods', fn: function(){return smalltalk.send(smalltalk.send(self['@selectedProtocol'], "_ifNil_ifNotNil_", [(function(){return smalltalk.send(klass, "_ifNil_ifNotNil_", [(function(){return [];}), (function(){return smalltalk.send(smalltalk.send(klass, "_methodDictionary", []), "_values", []);})]);}), (function(){return smalltalk.send(smalltalk.send(smalltalk.send(klass, "_methodDictionary", []), "_values", []), "_select_", [(function(each){return smalltalk.send(smalltalk.send(each, "_category", []), "__eq", [self['@selectedProtocol']]);})]);})]), "_sort_", [(function(a, b){return smalltalk.send(smalltalk.send(a, "_selector", []), "__gt", [smalltalk.send(b, "_selector", [])]);})])}})})();
  9566. return self;
  9567. } catch(e) {if(e.name === 'stReturn' && e.selector === '_methods'){return e.fn()} throw(e)}},
  9568. 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')}),
  9569. smalltalk.Browser);
  9570. smalltalk.addMethod(
  9571. '_source',
  9572. smalltalk.method({
  9573. selector: 'source',
  9574. category: 'accessing',
  9575. fn: function (){
  9576. var self=this;
  9577. try{smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["comment"]), "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '_source', fn: function(){return smalltalk.send(smalltalk.send(smalltalk.send(self['@selectedProtocol'], "_notNil", []), "_or_", [(function(){return smalltalk.send(self['@selectedMethod'], "_notNil", []);})]), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(self, "_declarationSource", []);}), (function(){return smalltalk.send(self, "_methodSource", []);})])}})})();})]);
  9578. (function(){throw({name: 'stReturn', selector: '_source', fn: function(){return smalltalk.send(self['@selectedClass'], "_ifNil_ifNotNil_", [(function(){return "";}), (function(){return smalltalk.send(self, "_classCommentSource", []);})])}})})();
  9579. return self;
  9580. } catch(e) {if(e.name === 'stReturn' && e.selector === '_source'){return e.fn()} throw(e)}},
  9581. 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')}),
  9582. smalltalk.Browser);
  9583. smalltalk.addMethod(
  9584. '_methodSource',
  9585. smalltalk.method({
  9586. selector: 'methodSource',
  9587. category: 'accessing',
  9588. fn: function (){
  9589. var self=this;
  9590. return smalltalk.send(self['@selectedMethod'], "_ifNil_ifNotNil_", [(function(){return smalltalk.send(self, "_dummyMethodSource", []);}), (function(){return smalltalk.send(self['@selectedMethod'], "_source", []);})]);
  9591. return self;},
  9592. source: unescape('methodSource%0A%20%20%20%20%5EselectedMethod%0A%09ifNil%3A%20%5Bself%20dummyMethodSource%5D%0A%09ifNotNil%3A%20%5BselectedMethod%20source%5D%0A')}),
  9593. smalltalk.Browser);
  9594. smalltalk.addMethod(
  9595. '_dummyMethodSource',
  9596. smalltalk.method({
  9597. selector: 'dummyMethodSource',
  9598. category: 'accessing',
  9599. fn: function (){
  9600. var self=this;
  9601. return unescape("messageSelectorAndArgumentNames%0A%09%22comment%20stating%20purpose%20of%20message%22%0A%0A%09%7C%20temporary%20variable%20names%20%7C%0A%09statements");
  9602. return self;},
  9603. 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')}),
  9604. smalltalk.Browser);
  9605. smalltalk.addMethod(
  9606. '_declarationSource',
  9607. smalltalk.method({
  9608. selector: 'declarationSource',
  9609. category: 'accessing',
  9610. fn: function (){
  9611. var self=this;
  9612. return smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["instance"]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_classDeclarationSource", []);}), (function(){return smalltalk.send(self, "_metaclassDeclarationSource", []);})]);
  9613. return self;},
  9614. 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')}),
  9615. smalltalk.Browser);
  9616. smalltalk.addMethod(
  9617. '_classDeclarationSource',
  9618. smalltalk.method({
  9619. selector: 'classDeclarationSource',
  9620. category: 'accessing',
  9621. fn: function (){
  9622. var self=this;
  9623. var stream=nil;
  9624. stream=smalltalk.send("", "_writeStream", []);
  9625. smalltalk.send(self['@selectedClass'], "_ifNotNil_", [(function(){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(self['@selectedClass'], "_superclass", []), "_asString", [])]);smalltalk.send($rec, "_nextPutAll_", [unescape("%20subclass%3A%20%23")]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self['@selectedClass'], "_name", [])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.String, "_cr", []), "__comma", [smalltalk.send(smalltalk.String, "_tab", [])])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("instanceVariableNames%3A%20%27")]);})(stream);smalltalk.send(smalltalk.send(self['@selectedClass'], "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(stream, "_nextPutAll_", [each]);}), (function(){return smalltalk.send(stream, "_nextPutAll_", [" "]);})]);return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [smalltalk.send(smalltalk.String, "_cr", [])]), "__comma", [smalltalk.send(smalltalk.String, "_tab", [])])]);smalltalk.send($rec, "_nextPutAll_", [unescape("category%3A%20%27")]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self['@selectedClass'], "_category", [])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%27")]);})(stream);})]);
  9626. return smalltalk.send(stream, "_contents", []);
  9627. return self;},
  9628. 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')}),
  9629. smalltalk.Browser);
  9630. smalltalk.addMethod(
  9631. '_metaclassDeclarationSource',
  9632. smalltalk.method({
  9633. selector: 'metaclassDeclarationSource',
  9634. category: 'accessing',
  9635. fn: function (){
  9636. var self=this;
  9637. var stream=nil;
  9638. stream=smalltalk.send("", "_writeStream", []);
  9639. smalltalk.send(self['@selectedClass'], "_ifNotNil_", [(function(){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self['@selectedClass'], "_asString", [])]);smalltalk.send($rec, "_nextPutAll_", [" class "]);return smalltalk.send($rec, "_nextPutAll_", [unescape("instanceVariableNames%3A%20%27")]);})(stream);smalltalk.send(smalltalk.send(smalltalk.send(self['@selectedClass'], "_class", []), "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(stream, "_nextPutAll_", [each]);}), (function(){return smalltalk.send(stream, "_nextPutAll_", [" "]);})]);return smalltalk.send(stream, "_nextPutAll_", [unescape("%27")]);})]);
  9640. return smalltalk.send(stream, "_contents", []);
  9641. return self;},
  9642. 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')}),
  9643. smalltalk.Browser);
  9644. smalltalk.addMethod(
  9645. '_classCommentSource',
  9646. smalltalk.method({
  9647. selector: 'classCommentSource',
  9648. category: 'accessing',
  9649. fn: function (){
  9650. var self=this;
  9651. return smalltalk.send(self['@selectedClass'], "_comment", []);
  9652. return self;},
  9653. source: unescape('classCommentSource%0A%20%20%20%20%5EselectedClass%20comment%0A')}),
  9654. smalltalk.Browser);
  9655. smalltalk.addMethod(
  9656. '_enableSaveButton',
  9657. smalltalk.method({
  9658. selector: 'enableSaveButton',
  9659. category: 'actions',
  9660. fn: function (){
  9661. var self=this;
  9662. smalltalk.send(self['@saveButton'], "_removeAt_", ["disabled"]);
  9663. self['@unsavedChanges']=true;
  9664. return self;},
  9665. source: unescape('enableSaveButton%0A%20%20%20%20saveButton%20removeAt%3A%20%27disabled%27.%0A%20%20%20%20unsavedChanges%20%3A%3D%20true%0A')}),
  9666. smalltalk.Browser);
  9667. smalltalk.addMethod(
  9668. '_disableSaveButton',
  9669. smalltalk.method({
  9670. selector: 'disableSaveButton',
  9671. category: 'actions',
  9672. fn: function (){
  9673. var self=this;
  9674. smalltalk.send(self['@saveButton'], "_ifNotNil_", [(function(){return smalltalk.send(self['@saveButton'], "_at_put_", ["disabled", true]);})]);
  9675. self['@unsavedChanges']=false;
  9676. return self;},
  9677. 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')}),
  9678. smalltalk.Browser);
  9679. smalltalk.addMethod(
  9680. '_hideClassButtons',
  9681. smalltalk.method({
  9682. selector: 'hideClassButtons',
  9683. category: 'actions',
  9684. fn: function (){
  9685. var self=this;
  9686. smalltalk.send(smalltalk.send(self['@classButtons'], "_asJQuery", []), "_hide", []);
  9687. return self;},
  9688. source: unescape('hideClassButtons%0A%20%20%20%20classButtons%20asJQuery%20hide%0A')}),
  9689. smalltalk.Browser);
  9690. smalltalk.addMethod(
  9691. '_showClassButtons',
  9692. smalltalk.method({
  9693. selector: 'showClassButtons',
  9694. category: 'actions',
  9695. fn: function (){
  9696. var self=this;
  9697. smalltalk.send(smalltalk.send(self['@classButtons'], "_asJQuery", []), "_show", []);
  9698. return self;},
  9699. source: unescape('showClassButtons%0A%20%20%20%20classButtons%20asJQuery%20show%0A')}),
  9700. smalltalk.Browser);
  9701. smalltalk.addMethod(
  9702. '_hideMethodButtons',
  9703. smalltalk.method({
  9704. selector: 'hideMethodButtons',
  9705. category: 'actions',
  9706. fn: function (){
  9707. var self=this;
  9708. smalltalk.send(smalltalk.send(self['@methodButtons'], "_asJQuery", []), "_hide", []);
  9709. return self;},
  9710. source: unescape('hideMethodButtons%0A%20%20%20%20methodButtons%20asJQuery%20hide%0A')}),
  9711. smalltalk.Browser);
  9712. smalltalk.addMethod(
  9713. '_showMethodButtons',
  9714. smalltalk.method({
  9715. selector: 'showMethodButtons',
  9716. category: 'actions',
  9717. fn: function (){
  9718. var self=this;
  9719. smalltalk.send(smalltalk.send(self['@methodButtons'], "_asJQuery", []), "_show", []);
  9720. return self;},
  9721. source: unescape('showMethodButtons%0A%20%20%20%20methodButtons%20asJQuery%20show%0A')}),
  9722. smalltalk.Browser);
  9723. smalltalk.addMethod(
  9724. '_compile',
  9725. smalltalk.method({
  9726. selector: 'compile',
  9727. category: 'actions',
  9728. fn: function (){
  9729. var self=this;
  9730. smalltalk.send(self, "_disableSaveButton", []);
  9731. smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["comment"]), "_ifTrue_", [(function(){return smalltalk.send(self['@selectedClass'], "_ifNotNil_", [(function(){return smalltalk.send(self, "_compileClassComment", []);})]);})]);
  9732. smalltalk.send(smalltalk.send(smalltalk.send(self['@selectedProtocol'], "_notNil", []), "_or_", [(function(){return smalltalk.send(self['@selectedMethod'], "_notNil", []);})]), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(self, "_compileDefinition", []);}), (function(){return smalltalk.send(self, "_compileMethodDefinition", []);})]);
  9733. return self;},
  9734. 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')}),
  9735. smalltalk.Browser);
  9736. smalltalk.addMethod(
  9737. '_compileClassComment',
  9738. smalltalk.method({
  9739. selector: 'compileClassComment',
  9740. category: 'actions',
  9741. fn: function (){
  9742. var self=this;
  9743. smalltalk.send(self['@selectedClass'], "_comment_", [smalltalk.send(smalltalk.send(self['@sourceTextarea'], "_asJQuery", []), "_val", [])]);
  9744. return self;},
  9745. source: unescape('compileClassComment%0A%20%20%20%20selectedClass%20comment%3A%20sourceTextarea%20asJQuery%20val%0A')}),
  9746. smalltalk.Browser);
  9747. smalltalk.addMethod(
  9748. '_compileMethodDefinition',
  9749. smalltalk.method({
  9750. selector: 'compileMethodDefinition',
  9751. category: 'actions',
  9752. fn: function (){
  9753. var self=this;
  9754. smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["instance"]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_compileMethodDefinitionFor_", [self['@selectedClass']]);}), (function(){return smalltalk.send(self, "_compileMethodDefinitionFor_", [smalltalk.send(self['@selectedClass'], "_class", [])]);})]);
  9755. return self;},
  9756. 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')}),
  9757. smalltalk.Browser);
  9758. smalltalk.addMethod(
  9759. '_compileMethodDefinitionFor_',
  9760. smalltalk.method({
  9761. selector: 'compileMethodDefinitionFor:',
  9762. category: 'actions',
  9763. fn: function (aClass){
  9764. var self=this;
  9765. try{var compiler=nil;
  9766. var method=nil;
  9767. var source=nil;
  9768. var node=nil;
  9769. source=smalltalk.send(smalltalk.send(self['@sourceTextarea'], "_asJQuery", []), "_val", []);
  9770. smalltalk.send(self['@selectedProtocol'], "_ifNil_", [(function(){return self['@selectedProtocol']=smalltalk.send(self['@selectedMethod'], "_category", []);})]);
  9771. compiler=smalltalk.send(smalltalk.Compiler, "_new", []);
  9772. node=smalltalk.send(compiler, "_parse_", [source]);
  9773. smalltalk.send(smalltalk.send(node, "_isParseFailure", []), "_ifTrue_", [(function(){return (function(){throw({name: 'stReturn', selector: '_compileMethodDefinitionFor_', fn: function(){return smalltalk.send(self, "_alert_", [smalltalk.send(smalltalk.send(smalltalk.send("PARSE ERROR: ", "__comma", [smalltalk.send(node, "_reason", [])]), "__comma", [unescape("%2C%20position%3A%20")]), "__comma", [smalltalk.send(smalltalk.send(node, "_position", []), "_asString", [])])])}})})();})]);
  9774. smalltalk.send(compiler, "_currentClass_", [self['@selectedClass']]);
  9775. method=smalltalk.send(compiler, "_eval_", [smalltalk.send(compiler, "_compileNode_", [node])]);
  9776. smalltalk.send(method, "_category_", [self['@selectedProtocol']]);
  9777. smalltalk.send(smalltalk.send(compiler, "_unknownVariables", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(self, "_confirm_", [smalltalk.send(smalltalk.send(unescape("Declare%20%27"), "__comma", [each]), "__comma", [unescape("%27%20as%20instance%20variable%3F")])]), "_ifTrue_", [(function(){smalltalk.send(self, "_addInstanceVariableNamed_toClass_", [each, aClass]);return (function(){throw({name: 'stReturn', selector: '_compileMethodDefinitionFor_', fn: function(){return smalltalk.send(self, "_compileMethodDefinitionFor_", [aClass])}})})();})]);})]);
  9778. smalltalk.send(aClass, "_addCompiledMethod_", [method]);
  9779. smalltalk.send(self, "_updateMethodsList", []);
  9780. smalltalk.send(self, "_selectMethod_", [method]);
  9781. return self;
  9782. } catch(e) {if(e.name === 'stReturn' && e.selector === '_compileMethodDefinitionFor_'){return e.fn()} throw(e)}},
  9783. 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%20compiler%20unknownVariables%20do%3A%20%5B%3Aeach%20%7C%0A%09%28self%20confirm%3A%20%27Declare%20%27%27%27%2C%20each%2C%20%27%27%27%20as%20instance%20variable%3F%27%29%20ifTrue%3A%20%5B%0A%09%09self%20addInstanceVariableNamed%3A%20each%20toClass%3A%20aClass.%0A%09%09%5Eself%20compileMethodDefinitionFor%3A%20aClass%5D%5D.%0A%20%20%20%20aClass%20addCompiledMethod%3A%20method.%0A%20%20%20%20self%20updateMethodsList.%0A%20%20%20%20self%20selectMethod%3A%20method%0A')}),
  9784. smalltalk.Browser);
  9785. smalltalk.addMethod(
  9786. '_compileDefinition',
  9787. smalltalk.method({
  9788. selector: 'compileDefinition',
  9789. category: 'actions',
  9790. fn: function (){
  9791. var self=this;
  9792. var newClass=nil;
  9793. newClass=smalltalk.send(smalltalk.send(smalltalk.Compiler, "_new", []), "_loadExpression_", [smalltalk.send(smalltalk.send(self['@sourceTextarea'], "_asJQuery", []), "_val", [])]);
  9794. (function($rec){smalltalk.send($rec, "_updateCategoriesList", []);return smalltalk.send($rec, "_updateClassesList", []);})(self);
  9795. return self;},
  9796. 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')}),
  9797. smalltalk.Browser);
  9798. smalltalk.addMethod(
  9799. '_commitCategory',
  9800. smalltalk.method({
  9801. selector: 'commitCategory',
  9802. category: 'actions',
  9803. fn: function (){
  9804. var self=this;
  9805. smalltalk.send(self['@selectedCategory'], "_ifNotNil_", [(function(){return (function($rec){smalltalk.send($rec, "_at_put_", ["type", "PUT"]);smalltalk.send($rec, "_at_put_", ["data", smalltalk.send(smalltalk.send(smalltalk.Exporter, "_new", []), "_exportCategory_", [self['@selectedCategory']])]);smalltalk.send($rec, "_at_put_", ["error", (function(){return smalltalk.send(self, "_alert_", [unescape("Commit%20failed%21")]);})]);return smalltalk.send($rec, "_send", []);})(smalltalk.send(smalltalk.Ajax, "_url_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_commitPath", []), "__comma", [unescape("/")]), "__comma", [self['@selectedCategory']]), "__comma", [".js"])]));})]);
  9806. return self;},
  9807. 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')}),
  9808. smalltalk.Browser);
  9809. smalltalk.addMethod(
  9810. '_cancelChanges',
  9811. smalltalk.method({
  9812. selector: 'cancelChanges',
  9813. category: 'actions',
  9814. fn: function (){
  9815. var self=this;
  9816. return smalltalk.send(self['@unsavedChanges'], "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_confirm_", [unescape("Cancel%20changes%3F")]);}), (function(){return true;})]);
  9817. return self;},
  9818. 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')}),
  9819. smalltalk.Browser);
  9820. smalltalk.addMethod(
  9821. '_removeClass',
  9822. smalltalk.method({
  9823. selector: 'removeClass',
  9824. category: 'actions',
  9825. fn: function (){
  9826. var self=this;
  9827. smalltalk.send(smalltalk.send(self, "_confirm_", [smalltalk.send(smalltalk.send("Do you really want to remove ", "__comma", [smalltalk.send(self['@selectedClass'], "_name", [])]), "__comma", [unescape("%3F")])]), "_ifTrue_", [(function(){smalltalk.send(smalltalk.send(smalltalk.Smalltalk, "_current", []), "_basicDelete_", [smalltalk.send(self['@selectedClass'], "_name", [])]);return smalltalk.send(self, "_selectClass_", [nil]);})]);
  9828. return self;},
  9829. 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')}),
  9830. smalltalk.Browser);
  9831. smalltalk.addMethod(
  9832. '_removeMethod',
  9833. smalltalk.method({
  9834. selector: 'removeMethod',
  9835. category: 'actions',
  9836. fn: function (){
  9837. var self=this;
  9838. smalltalk.send(smalltalk.send(self, "_cancelChanges", []), "_ifTrue_", [(function(){return smalltalk.send(smalltalk.send(self, "_confirm_", [smalltalk.send(smalltalk.send(unescape("Do%20you%20really%20want%20to%20remove%20%23"), "__comma", [smalltalk.send(self['@selectedMethod'], "_selector", [])]), "__comma", [unescape("%3F")])]), "_ifTrue_", [(function(){smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["instance"]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@selectedClass'], "_removeCompiledMethod_", [self['@selectedMethod']]);}), (function(){return smalltalk.send(smalltalk.send(self['@selectedClass'], "_class", []), "_removeCompiledMethod_", [self['@selectedMethod']]);})]);return smalltalk.send(self, "_selectMethod_", [nil]);})]);})]);
  9839. return self;},
  9840. 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')}),
  9841. smalltalk.Browser);
  9842. smalltalk.addMethod(
  9843. '_setMethodProtocol_',
  9844. smalltalk.method({
  9845. selector: 'setMethodProtocol:',
  9846. category: 'actions',
  9847. fn: function (aString){
  9848. var self=this;
  9849. smalltalk.send(smalltalk.send(self, "_cancelChanges", []), "_ifTrue_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_protocols", []), "_includes_", [aString]), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(self, "_addNewProtocol", []);}), (function(){smalltalk.send(self['@selectedMethod'], "_category_", [aString]);self['@selectedProtocol']=aString;self['@selectedMethod']=self['@selectedMethod'];return (function($rec){smalltalk.send($rec, "_updateProtocolsList", []);smalltalk.send($rec, "_updateMethodsList", []);return smalltalk.send($rec, "_updateSourceAndButtons", []);})(self);})]);})]);
  9850. return self;},
  9851. 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')}),
  9852. smalltalk.Browser);
  9853. smalltalk.addMethod(
  9854. '_addNewProtocol',
  9855. smalltalk.method({
  9856. selector: 'addNewProtocol',
  9857. category: 'actions',
  9858. fn: function (){
  9859. var self=this;
  9860. var newProtocol=nil;
  9861. newProtocol=smalltalk.send(self, "_prompt_", ["New method protocol"]);
  9862. smalltalk.send(smalltalk.send(newProtocol, "_notEmpty", []), "_ifTrue_", [(function(){smalltalk.send(self['@selectedMethod'], "_category_", [newProtocol]);return smalltalk.send(self, "_setMethodProtocol_", [newProtocol]);})]);
  9863. return self;},
  9864. 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')}),
  9865. smalltalk.Browser);
  9866. smalltalk.addMethod(
  9867. '_selectCategory_',
  9868. smalltalk.method({
  9869. selector: 'selectCategory:',
  9870. category: 'actions',
  9871. fn: function (aCategory){
  9872. var self=this;
  9873. smalltalk.send(smalltalk.send(self, "_cancelChanges", []), "_ifTrue_", [(function(){self['@selectedCategory']=aCategory;self['@selectedClass']=self['@selectedProtocol']=self['@selectedMethod']=nil;return (function($rec){smalltalk.send($rec, "_updateCategoriesList", []);smalltalk.send($rec, "_updateClassesList", []);smalltalk.send($rec, "_updateProtocolsList", []);smalltalk.send($rec, "_updateMethodsList", []);return smalltalk.send($rec, "_updateSourceAndButtons", []);})(self);})]);
  9874. return self;},
  9875. 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')}),
  9876. smalltalk.Browser);
  9877. smalltalk.addMethod(
  9878. '_selectClass_',
  9879. smalltalk.method({
  9880. selector: 'selectClass:',
  9881. category: 'actions',
  9882. fn: function (aClass){
  9883. var self=this;
  9884. smalltalk.send(smalltalk.send(self, "_cancelChanges", []), "_ifTrue_", [(function(){self['@selectedClass']=aClass;self['@selectedProtocol']=self['@selectedMethod']=nil;return (function($rec){smalltalk.send($rec, "_updateClassesList", []);smalltalk.send($rec, "_updateProtocolsList", []);smalltalk.send($rec, "_updateMethodsList", []);return smalltalk.send($rec, "_updateSourceAndButtons", []);})(self);})]);
  9885. return self;},
  9886. 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')}),
  9887. smalltalk.Browser);
  9888. smalltalk.addMethod(
  9889. '_selectProtocol_',
  9890. smalltalk.method({
  9891. selector: 'selectProtocol:',
  9892. category: 'actions',
  9893. fn: function (aString){
  9894. var self=this;
  9895. smalltalk.send(smalltalk.send(self, "_cancelChanges", []), "_ifTrue_", [(function(){self['@selectedProtocol']=aString;self['@selectedMethod']=nil;return (function($rec){smalltalk.send($rec, "_updateProtocolsList", []);smalltalk.send($rec, "_updateMethodsList", []);return smalltalk.send($rec, "_updateSourceAndButtons", []);})(self);})]);
  9896. return self;},
  9897. 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')}),
  9898. smalltalk.Browser);
  9899. smalltalk.addMethod(
  9900. '_selectMethod_',
  9901. smalltalk.method({
  9902. selector: 'selectMethod:',
  9903. category: 'actions',
  9904. fn: function (aMethod){
  9905. var self=this;
  9906. smalltalk.send(smalltalk.send(self, "_cancelChanges", []), "_ifTrue_", [(function(){self['@selectedMethod']=aMethod;return (function($rec){smalltalk.send($rec, "_updateProtocolsList", []);smalltalk.send($rec, "_updateMethodsList", []);return smalltalk.send($rec, "_updateSourceAndButtons", []);})(self);})]);
  9907. return self;},
  9908. 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')}),
  9909. smalltalk.Browser);
  9910. smalltalk.addMethod(
  9911. '_selectTab_',
  9912. smalltalk.method({
  9913. selector: 'selectTab:',
  9914. category: 'actions',
  9915. fn: function (aString){
  9916. var self=this;
  9917. smalltalk.send(smalltalk.send(self, "_cancelChanges", []), "_ifTrue_", [(function(){self['@selectedTab']=aString;smalltalk.send(self, "_selectProtocol_", [nil]);return smalltalk.send(self, "_updateTabsList", []);})]);
  9918. return self;},
  9919. 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')}),
  9920. smalltalk.Browser);
  9921. smalltalk.addMethod(
  9922. '_renderBoxOn_',
  9923. smalltalk.method({
  9924. selector: 'renderBoxOn:',
  9925. category: 'rendering',
  9926. fn: function (html){
  9927. var self=this;
  9928. (function($rec){smalltalk.send($rec, "_renderTopPanelOn_", [html]);smalltalk.send($rec, "_renderTabsOn_", [html]);return smalltalk.send($rec, "_renderBottomPanelOn_", [html]);})(self);
  9929. return self;},
  9930. 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')}),
  9931. smalltalk.Browser);
  9932. smalltalk.addMethod(
  9933. '_renderTopPanelOn_',
  9934. smalltalk.method({
  9935. selector: 'renderTopPanelOn:',
  9936. category: 'rendering',
  9937. fn: function (html){
  9938. var self=this;
  9939. (function($rec){smalltalk.send($rec, "_class_", ["top"]);return smalltalk.send($rec, "_with_", [(function(){self['@categoriesList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_column categories"]);self['@commitButton']=(function($rec){smalltalk.send($rec, "_class_", ["jt_commit"]);smalltalk.send($rec, "_title_", ["Commit classes in this category to disk"]);smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_commitCategory", []);})]);return smalltalk.send($rec, "_with_", ["Commit category"]);})(smalltalk.send(html, "_button", []));self['@classesList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_column classes"]);self['@protocolsList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_column protocols"]);self['@methodsList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_column methods"]);(function($rec){smalltalk.send($rec, "_updateCategoriesList", []);smalltalk.send($rec, "_updateClassesList", []);smalltalk.send($rec, "_updateProtocolsList", []);return smalltalk.send($rec, "_updateMethodsList", []);})(self);return smalltalk.send(smalltalk.send(html, "_div", []), "_class_", ["jt_clear"]);})]);})(smalltalk.send(html, "_div", []));
  9940. return self;},
  9941. 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')}),
  9942. smalltalk.Browser);
  9943. smalltalk.addMethod(
  9944. '_renderTabsOn_',
  9945. smalltalk.method({
  9946. selector: 'renderTabsOn:',
  9947. category: 'rendering',
  9948. fn: function (html){
  9949. var self=this;
  9950. self['@tabsList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_tabs"]);
  9951. smalltalk.send(self, "_updateTabsList", []);
  9952. return self;},
  9953. 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')}),
  9954. smalltalk.Browser);
  9955. smalltalk.addMethod(
  9956. '_renderBottomPanelOn_',
  9957. smalltalk.method({
  9958. selector: 'renderBottomPanelOn:',
  9959. category: 'rendering',
  9960. fn: function (html){
  9961. var self=this;
  9962. (function($rec){smalltalk.send($rec, "_class_", ["jt_sourceCode"]);return smalltalk.send($rec, "_with_", [(function(){self['@sourceTextarea']=(function($rec){smalltalk.send($rec, "_onKeyPress_", [(function(){return smalltalk.send(self, "_enableSaveButton", []);})]);smalltalk.send($rec, "_class_", ["source"]);return smalltalk.send($rec, "_at_put_", ["spellcheck", "false"]);})(smalltalk.send(html, "_textarea", []));return smalltalk.send(smalltalk.send(self['@sourceTextarea'], "_asJQuery", []), "_call_", ["tabby"]);})]);})(smalltalk.send(html, "_div", []));
  9963. return self;},
  9964. 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')}),
  9965. smalltalk.Browser);
  9966. smalltalk.addMethod(
  9967. '_renderButtonsOn_',
  9968. smalltalk.method({
  9969. selector: 'renderButtonsOn:',
  9970. category: 'rendering',
  9971. fn: function (html){
  9972. var self=this;
  9973. self['@saveButton']=smalltalk.send(html, "_button", []);
  9974. (function($rec){smalltalk.send($rec, "_with_", ["Save"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_compile", []);})]);})(self['@saveButton']);
  9975. self['@methodButtons']=smalltalk.send(html, "_span", []);
  9976. self['@classButtons']=smalltalk.send(html, "_span", []);
  9977. smalltalk.send(self, "_updateSourceAndButtons", []);
  9978. return self;},
  9979. 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')}),
  9980. smalltalk.Browser);
  9981. smalltalk.addMethod(
  9982. '_updateCategoriesList',
  9983. smalltalk.method({
  9984. selector: 'updateCategoriesList',
  9985. category: 'updating',
  9986. fn: function (){
  9987. var self=this;
  9988. smalltalk.send(self['@categoriesList'], "_contents_", [(function(html){return smalltalk.send(smalltalk.send(self, "_categories", []), "_do_", [(function(each){var li=nil;
  9989. var label=nil;
  9990. smalltalk.send(smalltalk.send(each, "_isEmpty", []), "_ifTrue_ifFalse_", [(function(){return label="Unclassified";}), (function(){return label=each;})]);li=smalltalk.send(html, "_li", []);smalltalk.send(smalltalk.send(self['@selectedCategory'], "__eq", [each]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);return (function($rec){smalltalk.send($rec, "_with_", [label]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectCategory_", [each]);})]);})(li);})]);})]);
  9991. return self;},
  9992. 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%20label%20%7C%0A%09%20%20%20%20each%20isEmpty%20%0A%09%09ifTrue%3A%20%5Blabel%20%3A%3D%20%27Unclassified%27%5D%0A%09%09ifFalse%3A%20%5Blabel%20%3A%3D%20each%5D.%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%20label%3B%0A%09%09onClick%3A%20%5Bself%20selectCategory%3A%20each%5D%5D%5D%0A')}),
  9993. smalltalk.Browser);
  9994. smalltalk.addMethod(
  9995. '_updateClassesList',
  9996. smalltalk.method({
  9997. selector: 'updateClassesList',
  9998. category: 'updating',
  9999. fn: function (){
  10000. var self=this;
  10001. smalltalk.send(smalltalk.send(smalltalk.TabManager, "_current", []), "_update", []);
  10002. smalltalk.send(self['@classesList'], "_contents_", [(function(html){return smalltalk.send(smalltalk.send(self, "_classes", []), "_do_", [(function(each){var li=nil;
  10003. li=smalltalk.send(html, "_li", []);smalltalk.send(smalltalk.send(self['@selectedClass'], "__eq", [each]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);return (function($rec){smalltalk.send($rec, "_with_", [smalltalk.send(each, "_name", [])]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectClass_", [each]);})]);})(li);})]);})]);
  10004. return self;},
  10005. 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')}),
  10006. smalltalk.Browser);
  10007. smalltalk.addMethod(
  10008. '_updateProtocolsList',
  10009. smalltalk.method({
  10010. selector: 'updateProtocolsList',
  10011. category: 'updating',
  10012. fn: function (){
  10013. var self=this;
  10014. smalltalk.send(self['@protocolsList'], "_contents_", [(function(html){return smalltalk.send(smalltalk.send(self, "_protocols", []), "_do_", [(function(each){var li=nil;
  10015. li=smalltalk.send(html, "_li", []);smalltalk.send(smalltalk.send(self['@selectedProtocol'], "__eq", [each]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);return (function($rec){smalltalk.send($rec, "_with_", [each]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectProtocol_", [each]);})]);})(li);})]);})]);
  10016. return self;},
  10017. 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')}),
  10018. smalltalk.Browser);
  10019. smalltalk.addMethod(
  10020. '_updateMethodsList',
  10021. smalltalk.method({
  10022. selector: 'updateMethodsList',
  10023. category: 'updating',
  10024. fn: function (){
  10025. var self=this;
  10026. smalltalk.send(self['@methodsList'], "_contents_", [(function(html){return smalltalk.send(smalltalk.send(self, "_methods", []), "_do_", [(function(each){var li=nil;
  10027. li=smalltalk.send(html, "_li", []);smalltalk.send(smalltalk.send(self['@selectedMethod'], "__eq", [each]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);return (function($rec){smalltalk.send($rec, "_with_", [smalltalk.send(each, "_selector", [])]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectMethod_", [each]);})]);})(li);})]);})]);
  10028. return self;},
  10029. 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')}),
  10030. smalltalk.Browser);
  10031. smalltalk.addMethod(
  10032. '_updateTabsList',
  10033. smalltalk.method({
  10034. selector: 'updateTabsList',
  10035. category: 'updating',
  10036. fn: function (){
  10037. var self=this;
  10038. smalltalk.send(self['@tabsList'], "_contents_", [(function(html){var li=nil;
  10039. li=smalltalk.send(html, "_li", []);smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["instance"]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);(function($rec){smalltalk.send($rec, "_with_", ["Instance"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectTab_", ["instance"]);})]);})(li);li=smalltalk.send(html, "_li", []);smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["class"]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);(function($rec){smalltalk.send($rec, "_with_", ["Class"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectTab_", ["class"]);})]);})(li);li=smalltalk.send(html, "_li", []);smalltalk.send(smalltalk.send(self['@selectedTab'], "__eq", ["comment"]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);return (function($rec){smalltalk.send($rec, "_with_", ["Comment"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectTab_", ["comment"]);})]);})(li);})]);
  10040. return self;},
  10041. 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')}),
  10042. smalltalk.Browser);
  10043. smalltalk.addMethod(
  10044. '_updateSourceAndButtons',
  10045. smalltalk.method({
  10046. selector: 'updateSourceAndButtons',
  10047. category: 'updating',
  10048. fn: function (){
  10049. var self=this;
  10050. smalltalk.send(self, "_disableSaveButton", []);
  10051. smalltalk.send(self['@classButtons'], "_contents_", [(function(html){(function($rec){smalltalk.send($rec, "_with_", ["Rename class"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_renameClass", []);})]);})(smalltalk.send(html, "_button", []));return (function($rec){smalltalk.send($rec, "_with_", ["Remove class"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_removeClass", []);})]);})(smalltalk.send(html, "_button", []));})]);
  10052. smalltalk.send(self['@methodButtons'], "_contents_", [(function(html){(function($rec){smalltalk.send($rec, "_with_", ["Remove method"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_removeMethod", []);})]);})(smalltalk.send(html, "_button", []));return (function($rec){smalltalk.send($rec, "_onChange_", [(function(e, select){return smalltalk.send(self, "_setMethodProtocol_", [smalltalk.send(select, "_val", [])]);})]);return smalltalk.send($rec, "_with_", [(function(){(function($rec){smalltalk.send($rec, "_with_", ["Method protocol"]);return smalltalk.send($rec, "_at_put_", ["disabled", "disabled"]);})(smalltalk.send(html, "_option", []));(function($rec){smalltalk.send($rec, "_class_", ["important"]);return smalltalk.send($rec, "_with_", ["New..."]);})(smalltalk.send(html, "_option", []));return smalltalk.send(smalltalk.send(self, "_protocols", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(html, "_option", []), "_with_", [each]);})]);})]);})(smalltalk.send(html, "_select", []));})]);
  10053. smalltalk.send(smalltalk.send(self['@selectedMethod'], "_isNil", []), "_ifTrue_ifFalse_", [(function(){smalltalk.send(self, "_hideMethodButtons", []);return smalltalk.send(smalltalk.send(smalltalk.send(self['@selectedClass'], "_isNil", []), "_or_", [(function(){return smalltalk.send(self['@selectedProtocol'], "_notNil", []);})]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_hideClassButtons", []);}), (function(){return smalltalk.send(self, "_showClassButtons", []);})]);}), (function(){smalltalk.send(self, "_hideClassButtons", []);return smalltalk.send(self, "_showMethodButtons", []);})]);
  10054. smalltalk.send(smalltalk.send(self['@sourceTextarea'], "_asJQuery", []), "_val_", [smalltalk.send(self, "_source", [])]);
  10055. return self;},
  10056. 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%09%09with%3A%20%27Remove%20class%27%3B%0A%09%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%3Ae%20%3Aselect%20%7C%20self%20setMethodProtocol%3A%20select%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%20isNil%0A%09%09ifTrue%3A%20%5B%0A%09%20%20%20%20%09%09self%20hideMethodButtons.%0A%09%20%20%20%20%09%09%09%28selectedClass%20isNil%20or%3A%20%5BselectedProtocol%20notNil%5D%29%0A%09%09%09%09%09ifTrue%3A%20%5Bself%20hideClassButtons%5D%0A%09%20%20%20%20%09%09%09%09ifFalse%3A%20%5Bself%20showClassButtons%5D%5D%0A%09%09ifFalse%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')}),
  10057. smalltalk.Browser);
  10058. smalltalk.addMethod(
  10059. '_canBeClosed',
  10060. smalltalk.method({
  10061. selector: 'canBeClosed',
  10062. category: 'testing',
  10063. fn: function (){
  10064. var self=this;
  10065. return true;
  10066. return self;},
  10067. source: unescape('canBeClosed%0A%20%20%20%20%5Etrue%0A')}),
  10068. smalltalk.Browser);
  10069. smalltalk.addMethod(
  10070. '_renameClass',
  10071. smalltalk.method({
  10072. selector: 'renameClass',
  10073. category: 'actions',
  10074. fn: function (){
  10075. var self=this;
  10076. var newName=nil;
  10077. newName=smalltalk.send(self, "_prompt_", [smalltalk.send("Rename class ", "__comma", [smalltalk.send(self['@selectedClass'], "_name", [])])]);
  10078. smalltalk.send(smalltalk.send(newName, "_notEmpty", []), "_ifTrue_", [(function(){smalltalk.send(self['@selectedClass'], "_rename_", [newName]);return (function($rec){smalltalk.send($rec, "_updateClassesList", []);return smalltalk.send($rec, "_updateSourceAndButtons", []);})(self);})]);
  10079. return self;},
  10080. 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')}),
  10081. smalltalk.Browser);
  10082. smalltalk.addMethod(
  10083. '_addInstanceVariableNamed_toClass_',
  10084. smalltalk.method({
  10085. selector: 'addInstanceVariableNamed:toClass:',
  10086. category: 'actions',
  10087. fn: function (aString, aClass){
  10088. var self=this;
  10089. smalltalk.send(smalltalk.send(smalltalk.ClassBuilder, "_new", []), "_addSubclassOf_named_instanceVariableNames_", [smalltalk.send(aClass, "_superclass", []), smalltalk.send(aClass, "_name", []), (function($rec){smalltalk.send($rec, "_add_", [aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.send(aClass, "_instanceVariableNames", []), "_copy", []))]);
  10090. return self;},
  10091. source: unescape('addInstanceVariableNamed%3A%20aString%20toClass%3A%20aClass%0A%09ClassBuilder%20new%0A%09%09addSubclassOf%3A%20aClass%20superclass%20named%3A%20aClass%20name%20instanceVariableNames%3A%20%28aClass%20instanceVariableNames%20copy%20add%3A%20aString%3B%20yourself%29')}),
  10092. smalltalk.Browser);
  10093. smalltalk.addMethod(
  10094. '_openOn_',
  10095. smalltalk.method({
  10096. selector: 'openOn:',
  10097. category: 'convenience',
  10098. fn: function (aClass){
  10099. var self=this;
  10100. (function($rec){smalltalk.send($rec, "_open", []);smalltalk.send($rec, "_selectCategory_", [smalltalk.send(aClass, "_category", [])]);return smalltalk.send($rec, "_selectClass_", [aClass]);})(smalltalk.send(self, "_new", []));
  10101. return self;},
  10102. 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')}),
  10103. smalltalk.Browser.klass);
  10104. smalltalk.addMethod(
  10105. '_open',
  10106. smalltalk.method({
  10107. selector: 'open',
  10108. category: 'convenience',
  10109. fn: function (){
  10110. var self=this;
  10111. smalltalk.send(smalltalk.send(self, "_new", []), "_open", []);
  10112. return self;},
  10113. source: unescape('open%0A%20%20%20%20self%20new%20open%0A')}),
  10114. smalltalk.Browser.klass);
  10115. smalltalk.addMethod(
  10116. '_commitPath',
  10117. smalltalk.method({
  10118. selector: 'commitPath',
  10119. category: 'accessing',
  10120. fn: function (){
  10121. var self=this;
  10122. return "js";
  10123. return self;},
  10124. source: unescape('commitPath%0A%09%5E%27js%27')}),
  10125. smalltalk.Browser.klass);
  10126. smalltalk.addClass('Inspector', smalltalk.TabWidget, ['label', 'variables', 'object', 'selectedVariable', 'variablesList', 'valueTextarea', 'workspaceTextarea', 'diveButton'], 'IDE');
  10127. smalltalk.addMethod(
  10128. '_label',
  10129. smalltalk.method({
  10130. selector: 'label',
  10131. category: 'accessing',
  10132. fn: function (){
  10133. var self=this;
  10134. return smalltalk.send(self['@label'], "_ifNil_", [(function(){return unescape("Inspector%20%28nil%29");})]);
  10135. return self;},
  10136. source: unescape('label%0A%09%5Elabel%20ifNil%3A%20%5B%27Inspector%20%28nil%29%27%5D')}),
  10137. smalltalk.Inspector);
  10138. smalltalk.addMethod(
  10139. '_canBeClosed',
  10140. smalltalk.method({
  10141. selector: 'canBeClosed',
  10142. category: 'testing',
  10143. fn: function (){
  10144. var self=this;
  10145. return true;
  10146. return self;},
  10147. source: unescape('canBeClosed%0A%09%5Etrue')}),
  10148. smalltalk.Inspector);
  10149. smalltalk.addMethod(
  10150. '_inspect_',
  10151. smalltalk.method({
  10152. selector: 'inspect:',
  10153. category: 'actions',
  10154. fn: function (anObject){
  10155. var self=this;
  10156. self['@object']=anObject;
  10157. self['@variables']=[];
  10158. smalltalk.send(self['@object'], "_inspectOn_", [self]);
  10159. return self;},
  10160. source: unescape('inspect%3A%20anObject%0A%09object%20%3A%3D%20anObject.%0A%09variables%20%3A%3D%20%23%28%29.%0A%09object%20inspectOn%3A%20self')}),
  10161. smalltalk.Inspector);
  10162. smalltalk.addMethod(
  10163. '_variables',
  10164. smalltalk.method({
  10165. selector: 'variables',
  10166. category: 'accessing',
  10167. fn: function (){
  10168. var self=this;
  10169. return self['@variables'];
  10170. return self;},
  10171. source: unescape('variables%0A%09%5Evariables')}),
  10172. smalltalk.Inspector);
  10173. smalltalk.addMethod(
  10174. '_setVariables_',
  10175. smalltalk.method({
  10176. selector: 'setVariables:',
  10177. category: 'accessing',
  10178. fn: function (aCollection){
  10179. var self=this;
  10180. self['@variables']=aCollection;
  10181. return self;},
  10182. source: unescape('setVariables%3A%20aCollection%0A%09variables%20%3A%3D%20aCollection')}),
  10183. smalltalk.Inspector);
  10184. smalltalk.addMethod(
  10185. '_setLabel_',
  10186. smalltalk.method({
  10187. selector: 'setLabel:',
  10188. category: 'accessing',
  10189. fn: function (aString){
  10190. var self=this;
  10191. self['@label']=aString;
  10192. return self;},
  10193. source: unescape('setLabel%3A%20aString%0A%09label%20%3A%3D%20aString')}),
  10194. smalltalk.Inspector);
  10195. smalltalk.addMethod(
  10196. '_renderBoxOn_',
  10197. smalltalk.method({
  10198. selector: 'renderBoxOn:',
  10199. category: 'rendering',
  10200. fn: function (html){
  10201. var self=this;
  10202. (function($rec){smalltalk.send($rec, "_renderTopPanelOn_", [html]);return smalltalk.send($rec, "_renderBottomPanelOn_", [html]);})(self);
  10203. return self;},
  10204. source: unescape('renderBoxOn%3A%20html%0A%09self%20%0A%09%09renderTopPanelOn%3A%20html%3B%0A%09%09renderBottomPanelOn%3A%20html')}),
  10205. smalltalk.Inspector);
  10206. smalltalk.addMethod(
  10207. '_renderTopPanelOn_',
  10208. smalltalk.method({
  10209. selector: 'renderTopPanelOn:',
  10210. category: 'rendering',
  10211. fn: function (html){
  10212. var self=this;
  10213. (function($rec){smalltalk.send($rec, "_class_", ["top"]);return smalltalk.send($rec, "_with_", [(function(){self['@variablesList']=smalltalk.send(smalltalk.send(html, "_ul", []), "_class_", ["jt_column variables"]);self['@valueTextarea']=(function($rec){smalltalk.send($rec, "_class_", ["jt_column value"]);return smalltalk.send($rec, "_at_put_", ["readonly", "readonly"]);})(smalltalk.send(html, "_textarea", []));(function($rec){smalltalk.send($rec, "_updateVariablesList", []);return smalltalk.send($rec, "_updateValueTextarea", []);})(self);return smalltalk.send(smalltalk.send(html, "_div", []), "_class_", ["jt_clear"]);})]);})(smalltalk.send(html, "_div", []));
  10214. return self;},
  10215. 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')}),
  10216. smalltalk.Inspector);
  10217. smalltalk.addMethod(
  10218. '_renderBottomPanelOn_',
  10219. smalltalk.method({
  10220. selector: 'renderBottomPanelOn:',
  10221. category: 'rendering',
  10222. fn: function (html){
  10223. var self=this;
  10224. (function($rec){smalltalk.send($rec, "_class_", ["jt_sourceCode"]);return smalltalk.send($rec, "_with_", [(function(){self['@workspaceTextarea']=(function($rec){smalltalk.send($rec, "_class_", ["source"]);return smalltalk.send($rec, "_at_put_", ["spellcheck", "false"]);})(smalltalk.send(html, "_textarea", []));return smalltalk.send(smalltalk.send(self['@workspaceTextarea'], "_asJQuery", []), "_call_", ["tabby"]);})]);})(smalltalk.send(html, "_div", []));
  10225. return self;},
  10226. 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')}),
  10227. smalltalk.Inspector);
  10228. smalltalk.addMethod(
  10229. '_updateVariablesList',
  10230. smalltalk.method({
  10231. selector: 'updateVariablesList',
  10232. category: 'updating',
  10233. fn: function (){
  10234. var self=this;
  10235. smalltalk.send(self['@variablesList'], "_contents_", [(function(html){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_variables", []), "_keys", []), "_do_", [(function(each){var li=nil;
  10236. li=smalltalk.send(html, "_li", []);(function($rec){smalltalk.send($rec, "_with_", [each]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectVariable_", [each]);})]);})(li);return smalltalk.send(smalltalk.send(smalltalk.send(self, "_selectedVariable", []), "__eq", [each]), "_ifTrue_", [(function(){return smalltalk.send(li, "_class_", ["selected"]);})]);})]);})]);
  10237. return self;},
  10238. 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')}),
  10239. smalltalk.Inspector);
  10240. smalltalk.addMethod(
  10241. '_selectedVariable',
  10242. smalltalk.method({
  10243. selector: 'selectedVariable',
  10244. category: 'accessing',
  10245. fn: function (){
  10246. var self=this;
  10247. return self['@selectedVariable'];
  10248. return self;},
  10249. source: unescape('selectedVariable%0A%09%5EselectedVariable')}),
  10250. smalltalk.Inspector);
  10251. smalltalk.addMethod(
  10252. '_selectedVariable_',
  10253. smalltalk.method({
  10254. selector: 'selectedVariable:',
  10255. category: 'accessing',
  10256. fn: function (aString){
  10257. var self=this;
  10258. self['@selectedVariable']=aString;
  10259. return self;},
  10260. source: unescape('selectedVariable%3A%20aString%0A%09selectedVariable%20%3A%3D%20aString')}),
  10261. smalltalk.Inspector);
  10262. smalltalk.addMethod(
  10263. '_selectVariable_',
  10264. smalltalk.method({
  10265. selector: 'selectVariable:',
  10266. category: 'updating',
  10267. fn: function (aString){
  10268. var self=this;
  10269. smalltalk.send(self, "_selectedVariable_", [aString]);
  10270. (function($rec){smalltalk.send($rec, "_updateVariablesList", []);smalltalk.send($rec, "_updateValueTextarea", []);return smalltalk.send($rec, "_updateButtons", []);})(self);
  10271. return self;},
  10272. source: unescape('selectVariable%3A%20aString%0A%09self%20selectedVariable%3A%20aString.%0A%09self%20%0A%09%09updateVariablesList%3B%0A%09%09updateValueTextarea%3B%0A%09%09updateButtons')}),
  10273. smalltalk.Inspector);
  10274. smalltalk.addMethod(
  10275. '_updateValueTextarea',
  10276. smalltalk.method({
  10277. selector: 'updateValueTextarea',
  10278. category: 'updating',
  10279. fn: function (){
  10280. var self=this;
  10281. smalltalk.send(smalltalk.send(self['@valueTextarea'], "_asJQuery", []), "_val_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_selectedVariable", []), "_isNil", []), "_ifTrue_ifFalse_", [(function(){return "";}), (function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_variables", []), "_at_", [smalltalk.send(self, "_selectedVariable", [])]), "_printString", []);})])]);
  10282. return self;},
  10283. 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')}),
  10284. smalltalk.Inspector);
  10285. smalltalk.addMethod(
  10286. '_renderButtonsOn_',
  10287. smalltalk.method({
  10288. selector: 'renderButtonsOn:',
  10289. category: 'rendering',
  10290. fn: function (html){
  10291. var self=this;
  10292. (function($rec){smalltalk.send($rec, "_with_", ["Refresh"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_refresh", []);})]);})(smalltalk.send(html, "_button", []));
  10293. self['@diveButton']=(function($rec){smalltalk.send($rec, "_with_", ["Dive"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_dive", []);})]);})(smalltalk.send(html, "_button", []));
  10294. smalltalk.send(self, "_updateButtons", []);
  10295. return self;},
  10296. source: unescape('renderButtonsOn%3A%20html%0A%09html%20button%0A%09%09with%3A%20%27Refresh%27%3B%0A%09%09onClick%3A%20%5Bself%20refresh%5D.%0A%09diveButton%20%3A%3D%20html%20button%20%0A%09%09with%3A%20%27Dive%27%3B%20%0A%09%09onClick%3A%20%5Bself%20dive%5D.%0A%09self%20updateButtons%0A%09')}),
  10297. smalltalk.Inspector);
  10298. smalltalk.addMethod(
  10299. '_dive',
  10300. smalltalk.method({
  10301. selector: 'dive',
  10302. category: 'actions',
  10303. fn: function (){
  10304. var self=this;
  10305. smalltalk.send(smalltalk.send(smalltalk.send(self, "_variables", []), "_at_", [smalltalk.send(self, "_selectedVariable", [])]), "_inspect", []);
  10306. return self;},
  10307. source: unescape('dive%0A%09%28self%20variables%20at%3A%20self%20selectedVariable%29%20inspect')}),
  10308. smalltalk.Inspector);
  10309. smalltalk.addMethod(
  10310. '_updateButtons',
  10311. smalltalk.method({
  10312. selector: 'updateButtons',
  10313. category: 'updating',
  10314. fn: function (){
  10315. var self=this;
  10316. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_selectedVariable", []), "_notNil", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_variables", []), "_at_", [smalltalk.send(self, "_selectedVariable", [])]), "_notNil", []);})]), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(self['@diveButton'], "_at_put_", ["disabled", true]);}), (function(){return smalltalk.send(self['@diveButton'], "_removeAt_", ["disabled"]);})]);
  10317. return self;},
  10318. source: unescape('updateButtons%0A%09%28self%20selectedVariable%20notNil%20and%3A%20%5B%28self%20variables%20at%3A%20self%20selectedVariable%29%20notNil%5D%29%0A%09%09ifFalse%3A%20%5BdiveButton%20at%3A%20%27disabled%27%20put%3A%20true%5D%20%0A%09%09ifTrue%3A%20%5BdiveButton%20removeAt%3A%20%27disabled%27%5D%0A%09%09')}),
  10319. smalltalk.Inspector);
  10320. smalltalk.addMethod(
  10321. '_refresh',
  10322. smalltalk.method({
  10323. selector: 'refresh',
  10324. category: 'actions',
  10325. fn: function (){
  10326. var self=this;
  10327. (function($rec){smalltalk.send($rec, "_inspect_", [self['@object']]);smalltalk.send($rec, "_updateVariablesList", []);return smalltalk.send($rec, "_updateValueTextarea", []);})(self);
  10328. return self;},
  10329. source: unescape('refresh%0A%09self%20%0A%09%09inspect%3A%20object%3B%20%0A%09%09updateVariablesList%3B%0A%09%09updateValueTextarea')}),
  10330. smalltalk.Inspector);
  10331. smalltalk.addMethod(
  10332. '_on_',
  10333. smalltalk.method({
  10334. selector: 'on:',
  10335. category: 'instance creation',
  10336. fn: function (anObject){
  10337. var self=this;
  10338. return (function($rec){smalltalk.send($rec, "_inspect_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  10339. return self;},
  10340. source: unescape('on%3A%20anObject%0A%09%5Eself%20new%0A%09%09inspect%3A%20anObject%3B%0A%09%09yourself')}),
  10341. smalltalk.Inspector.klass);
  10342. smalltalk.addClass('Counter', smalltalk.Widget, ['count'], 'Examples');
  10343. smalltalk.addMethod(
  10344. '_initialize',
  10345. smalltalk.method({
  10346. selector: 'initialize',
  10347. category: 'initialization',
  10348. fn: function (){
  10349. var self=this;
  10350. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  10351. self['@count']=(0);
  10352. return self;},
  10353. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20count%20%3A%3D%200%0A')}),
  10354. smalltalk.Counter);
  10355. smalltalk.addMethod(
  10356. '_renderOn_',
  10357. smalltalk.method({
  10358. selector: 'renderOn:',
  10359. category: 'rendering',
  10360. fn: function (html){
  10361. var self=this;
  10362. smalltalk.send(smalltalk.send(html, "_h1", []), "_with_", [smalltalk.send(self['@count'], "_asString", [])]);
  10363. (function($rec){smalltalk.send($rec, "_with_", [unescape("++")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_increase", []);})]);})(smalltalk.send(html, "_button", []));
  10364. (function($rec){smalltalk.send($rec, "_with_", [unescape("--")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_decrease", []);})]);})(smalltalk.send(html, "_button", []));
  10365. return self;},
  10366. 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')}),
  10367. smalltalk.Counter);
  10368. smalltalk.addMethod(
  10369. '_increase',
  10370. smalltalk.method({
  10371. selector: 'increase',
  10372. category: 'actions',
  10373. fn: function (){
  10374. var self=this;
  10375. self['@count']=smalltalk.send(self['@count'], "__plus", [(1)]);
  10376. smalltalk.send(self, "_update", []);
  10377. return self;},
  10378. source: unescape('increase%0A%20%20%20%20count%20%3A%3D%20count%20+%201.%0A%20%20%20%20self%20update%0A')}),
  10379. smalltalk.Counter);
  10380. smalltalk.addMethod(
  10381. '_decrease',
  10382. smalltalk.method({
  10383. selector: 'decrease',
  10384. category: 'actions',
  10385. fn: function (){
  10386. var self=this;
  10387. self['@count']=smalltalk.send(self['@count'], "__minus", [(1)]);
  10388. smalltalk.send(self, "_update", []);
  10389. return self;},
  10390. source: unescape('decrease%0A%20%20%20%20count%20%3A%3D%20count%20-%201.%0A%20%20%20%20self%20update%0A')}),
  10391. smalltalk.Counter);
  10392. smalltalk.addClass('Tetris', smalltalk.Widget, ['renderingContext', 'timer', 'speed', 'score', 'rows', 'movingPiece'], 'Examples');
  10393. smalltalk.addMethod(
  10394. '_renderOn_',
  10395. smalltalk.method({
  10396. selector: 'renderOn:',
  10397. category: 'rendering',
  10398. fn: function (html){
  10399. var self=this;
  10400. (function($rec){smalltalk.send($rec, "_class_", ["tetris"]);return smalltalk.send($rec, "_with_", [(function(){smalltalk.send(smalltalk.send(html, "_h3", []), "_with_", ["Tetris"]);smalltalk.send(self, "_renderCanvasOn_", [html]);return smalltalk.send(self, "_renderButtonsOn_", [html]);})]);})(smalltalk.send(html, "_div", []));
  10401. return self;},
  10402. 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')}),
  10403. smalltalk.Tetris);
  10404. smalltalk.addMethod(
  10405. '_renderCanvasOn_',
  10406. smalltalk.method({
  10407. selector: 'renderCanvasOn:',
  10408. category: 'rendering',
  10409. fn: function (html){
  10410. var self=this;
  10411. var canvas=nil;
  10412. canvas=smalltalk.send(html, "_canvas", []);
  10413. smalltalk.send(canvas, "_at_put_", ["width", smalltalk.send(smalltalk.send(self, "_width", []), "_asString", [])]);
  10414. smalltalk.send(canvas, "_at_put_", ["height", smalltalk.send(smalltalk.send(self, "_height", []), "_asString", [])]);
  10415. self['@renderingContext']=smalltalk.send(smalltalk.CanvasRenderingContext, "_tagBrush_", [canvas]);
  10416. smalltalk.send(self, "_redraw", []);
  10417. return self;},
  10418. 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')}),
  10419. smalltalk.Tetris);
  10420. smalltalk.addMethod(
  10421. '_renderButtonsOn_',
  10422. smalltalk.method({
  10423. selector: 'renderButtonsOn:',
  10424. category: 'rendering',
  10425. fn: function (html){
  10426. var self=this;
  10427. (function($rec){smalltalk.send($rec, "_class_", ["tetris_buttons"]);return smalltalk.send($rec, "_with_", [(function(){(function($rec){smalltalk.send($rec, "_with_", ["New game"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_startNewGame", []);})]);})(smalltalk.send(html, "_button", []));return (function($rec){smalltalk.send($rec, "_with_", [unescape("play/pause")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_update", []);})]);})(smalltalk.send(html, "_button", []));})]);})(smalltalk.send(html, "_div", []));
  10428. return self;},
  10429. 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')}),
  10430. smalltalk.Tetris);
  10431. smalltalk.addMethod(
  10432. '_initialize',
  10433. smalltalk.method({
  10434. selector: 'initialize',
  10435. category: 'initialization',
  10436. fn: function (){
  10437. var self=this;
  10438. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  10439. smalltalk.send(self, "_newGame", []);
  10440. return self;},
  10441. source: unescape('initialize%0A%09super%20initialize.%0A%09self%20newGame')}),
  10442. smalltalk.Tetris);
  10443. smalltalk.addMethod(
  10444. '_startNewGame',
  10445. smalltalk.method({
  10446. selector: 'startNewGame',
  10447. category: 'actions',
  10448. fn: function (){
  10449. var self=this;
  10450. smalltalk.send(self, "_newGame", []);
  10451. smalltalk.send(self['@timer'], "_ifNotNil_", [(function(){return smalltalk.send(self['@timer'], "_clearInterval", []);})]);
  10452. self['@timer']=smalltalk.send((function(){return smalltalk.send(self, "_nextStep", []);}), "_valueWithInterval_", [self['@speed']]);
  10453. return self;},
  10454. 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')}),
  10455. smalltalk.Tetris);
  10456. smalltalk.addMethod(
  10457. '_width',
  10458. smalltalk.method({
  10459. selector: 'width',
  10460. category: 'accessing',
  10461. fn: function (){
  10462. var self=this;
  10463. return smalltalk.send(smalltalk.send(self, "_class", []), "_width", []);
  10464. return self;},
  10465. source: unescape('width%0A%09%5Eself%20class%20width')}),
  10466. smalltalk.Tetris);
  10467. smalltalk.addMethod(
  10468. '_height',
  10469. smalltalk.method({
  10470. selector: 'height',
  10471. category: 'accessing',
  10472. fn: function (){
  10473. var self=this;
  10474. return smalltalk.send(smalltalk.send(self, "_class", []), "_height", []);
  10475. return self;},
  10476. source: unescape('height%0A%09%5Eself%20class%20height')}),
  10477. smalltalk.Tetris);
  10478. smalltalk.addMethod(
  10479. '_nextStep',
  10480. smalltalk.method({
  10481. selector: 'nextStep',
  10482. category: 'actions',
  10483. fn: function (){
  10484. var self=this;
  10485. smalltalk.send(self['@movingPiece'], "_ifNil_", [(function(){return smalltalk.send(self, "_newPiece", []);})]);
  10486. smalltalk.send(smalltalk.send(self['@movingPiece'], "_canMoveIn_", [self]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@movingPiece'], "_position_", [smalltalk.send(smalltalk.send(self['@movingPiece'], "_position", []), "__plus", [smalltalk.send((0), "__at", [(1)])])]);}), (function(){return smalltalk.send(self, "_newPiece", []);})]);
  10487. smalltalk.send(self, "_redraw", []);
  10488. return self;},
  10489. 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')}),
  10490. smalltalk.Tetris);
  10491. smalltalk.addMethod(
  10492. '_redraw',
  10493. smalltalk.method({
  10494. selector: 'redraw',
  10495. category: 'actions',
  10496. fn: function (){
  10497. var self=this;
  10498. smalltalk.send(self['@renderingContext'], "_clearRectFrom_to_", [smalltalk.send((0), "__at", [smalltalk.send(self, "_width", [])]), smalltalk.send((0), "__at", [smalltalk.send(self, "_height", [])])]);
  10499. (function($rec){smalltalk.send($rec, "_drawMap", []);return smalltalk.send($rec, "_drawPiece", []);})(self);
  10500. return self;},
  10501. 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')}),
  10502. smalltalk.Tetris);
  10503. smalltalk.addMethod(
  10504. '_drawMap',
  10505. smalltalk.method({
  10506. selector: 'drawMap',
  10507. category: 'actions',
  10508. fn: function (){
  10509. var self=this;
  10510. (function($rec){smalltalk.send($rec, "_fillStyle_", [unescape("%23fafafa")]);return smalltalk.send($rec, "_fillRectFrom_to_", [smalltalk.send((0), "__at", [(0)]), smalltalk.send(smalltalk.send(self, "_width", []), "__at", [smalltalk.send(self, "_height", [])])]);})(self['@renderingContext']);
  10511. (function($rec){smalltalk.send($rec, "_lineWidth_", [(0.5)]);return smalltalk.send($rec, "_strokeStyle_", [unescape("%23999")]);})(self['@renderingContext']);
  10512. smalltalk.send((0), "_to_do_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_squares", []), "_x", []), (function(each){var x=nil;
  10513. x=smalltalk.send(each, "__star", [smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", [])]);return smalltalk.send(self, "_drawLineFrom_to_", [smalltalk.send(x, "__at", [(0)]), smalltalk.send(x, "__at", [smalltalk.send(self, "_height", [])])]);})]);
  10514. smalltalk.send((0), "_to_do_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_squares", []), "_y", []), (function(each){var y=nil;
  10515. y=smalltalk.send(each, "__star", [smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", [])]);return smalltalk.send(self, "_drawLineFrom_to_", [smalltalk.send((0), "__at", [y]), smalltalk.send(smalltalk.send(self, "_width", []), "__at", [y])]);})]);
  10516. return self;},
  10517. 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.')}),
  10518. smalltalk.Tetris);
  10519. smalltalk.addMethod(
  10520. '_drawLineFrom_to_',
  10521. smalltalk.method({
  10522. selector: 'drawLineFrom:to:',
  10523. category: 'actions',
  10524. fn: function (aPoint, anotherPoint){
  10525. var self=this;
  10526. (function($rec){smalltalk.send($rec, "_beginPath", []);smalltalk.send($rec, "_moveTo_", [aPoint]);smalltalk.send($rec, "_lineTo_", [anotherPoint]);return smalltalk.send($rec, "_stroke", []);})(self['@renderingContext']);
  10527. return self;},
  10528. 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')}),
  10529. smalltalk.Tetris);
  10530. smalltalk.addMethod(
  10531. '_newGame',
  10532. smalltalk.method({
  10533. selector: 'newGame',
  10534. category: 'actions',
  10535. fn: function (){
  10536. var self=this;
  10537. self['@rows']=[];
  10538. self['@movingPiece']=nil;
  10539. self['@speed']=(200);
  10540. self['@score']=(0);
  10541. return self;},
  10542. 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')}),
  10543. smalltalk.Tetris);
  10544. smalltalk.addMethod(
  10545. '_newPiece',
  10546. smalltalk.method({
  10547. selector: 'newPiece',
  10548. category: 'actions',
  10549. fn: function (){
  10550. var self=this;
  10551. self['@movingPiece']=smalltalk.send(smalltalk.TetrisPiece, "_atRandom", []);
  10552. return self;},
  10553. source: unescape('newPiece%0A%09movingPiece%20%3A%3D%20TetrisPiece%20atRandom')}),
  10554. smalltalk.Tetris);
  10555. smalltalk.addMethod(
  10556. '_squares',
  10557. smalltalk.method({
  10558. selector: 'squares',
  10559. category: 'accessing',
  10560. fn: function (){
  10561. var self=this;
  10562. return smalltalk.send(smalltalk.send(self, "_class", []), "_squares", []);
  10563. return self;},
  10564. source: unescape('squares%0A%09%5Eself%20class%20squares')}),
  10565. smalltalk.Tetris);
  10566. smalltalk.addMethod(
  10567. '_gluePiece_',
  10568. smalltalk.method({
  10569. selector: 'gluePiece:',
  10570. category: 'accessing',
  10571. fn: function (aPiece){
  10572. var self=this;
  10573. smalltalk.send(aPiece, "_glueOn_", [self]);
  10574. return self;},
  10575. source: unescape('gluePiece%3A%20aPiece%0A%09aPiece%20glueOn%3A%20self%0A%09')}),
  10576. smalltalk.Tetris);
  10577. smalltalk.addMethod(
  10578. '_drawRows',
  10579. smalltalk.method({
  10580. selector: 'drawRows',
  10581. category: 'actions',
  10582. fn: function (){
  10583. var self=this;
  10584. smalltalk.send(smalltalk.send(self, "_rows", []), "_do_", [(function(each){return nil;})]);
  10585. smalltalk.send(self['@movingPiece'], "_ifNotNil_", [(function(){return smalltalk.send(self['@movingPiece'], "_drawOn_", [self['@renderingContext']]);})]);
  10586. return self;},
  10587. source: unescape('drawRows%0A%09self%20rows%20do%3A%20%5B%3Aeach%20%7C%5D.%0A%09movingPiece%20ifNotNil%3A%20%5BmovingPiece%20drawOn%3A%20renderingContext%5D')}),
  10588. smalltalk.Tetris);
  10589. smalltalk.addMethod(
  10590. '_drawPiece',
  10591. smalltalk.method({
  10592. selector: 'drawPiece',
  10593. category: 'actions',
  10594. fn: function (){
  10595. var self=this;
  10596. smalltalk.send(self['@movingPiece'], "_ifNotNil_", [(function(){return smalltalk.send(self['@movingPiece'], "_drawOn_", [self['@renderingContext']]);})]);
  10597. return self;},
  10598. source: unescape('drawPiece%0A%09movingPiece%20ifNotNil%3A%20%5B%0A%09%09movingPiece%20drawOn%3A%20renderingContext%5D')}),
  10599. smalltalk.Tetris);
  10600. smalltalk.addMethod(
  10601. '_rows',
  10602. smalltalk.method({
  10603. selector: 'rows',
  10604. category: 'accessing',
  10605. fn: function (){
  10606. var self=this;
  10607. return self['@rows'];
  10608. return self;},
  10609. source: unescape('rows%0A%09%22An%20array%20of%20rows.%20Each%20row%20is%20a%20collection%20of%20points.%22%0A%09%5Erows')}),
  10610. smalltalk.Tetris);
  10611. smalltalk.addMethod(
  10612. '_addRow_',
  10613. smalltalk.method({
  10614. selector: 'addRow:',
  10615. category: 'accessing',
  10616. fn: function (aCollection){
  10617. var self=this;
  10618. smalltalk.send(smalltalk.send(self, "_rows", []), "_add_", [aCollection]);
  10619. return self;},
  10620. source: unescape('addRow%3A%20aCollection%0A%09self%20rows%20add%3A%20aCollection')}),
  10621. smalltalk.Tetris);
  10622. smalltalk.addMethod(
  10623. '_squareSize',
  10624. smalltalk.method({
  10625. selector: 'squareSize',
  10626. category: 'accessing',
  10627. fn: function (){
  10628. var self=this;
  10629. return (22);
  10630. return self;},
  10631. source: unescape('squareSize%0A%09%5E22')}),
  10632. smalltalk.Tetris.klass);
  10633. smalltalk.addMethod(
  10634. '_width',
  10635. smalltalk.method({
  10636. selector: 'width',
  10637. category: 'accessing',
  10638. fn: function (){
  10639. var self=this;
  10640. return smalltalk.send(smalltalk.send(self, "_squareSize", []), "__star", [smalltalk.send(smalltalk.send(self, "_squares", []), "_x", [])]);
  10641. return self;},
  10642. source: unescape('width%0A%09%5Eself%20squareSize%20*%20%28self%20squares%20x%29')}),
  10643. smalltalk.Tetris.klass);
  10644. smalltalk.addMethod(
  10645. '_height',
  10646. smalltalk.method({
  10647. selector: 'height',
  10648. category: 'accessing',
  10649. fn: function (){
  10650. var self=this;
  10651. return smalltalk.send(smalltalk.send(self, "_squareSize", []), "__star", [smalltalk.send(smalltalk.send(self, "_squares", []), "_y", [])]);
  10652. return self;},
  10653. source: unescape('height%0A%09%5Eself%20squareSize%20*%20%28self%20squares%20y%29')}),
  10654. smalltalk.Tetris.klass);
  10655. smalltalk.addMethod(
  10656. '_squares',
  10657. smalltalk.method({
  10658. selector: 'squares',
  10659. category: 'accessing',
  10660. fn: function (){
  10661. var self=this;
  10662. return smalltalk.send((10), "__at", [(15)]);
  10663. return self;},
  10664. source: unescape('squares%0A%09%5E10@15')}),
  10665. smalltalk.Tetris.klass);
  10666. smalltalk.addClass('TetrisPiece', smalltalk.Widget, ['rotation', 'position'], 'Examples');
  10667. smalltalk.addMethod(
  10668. '_drawOn_',
  10669. smalltalk.method({
  10670. selector: 'drawOn:',
  10671. category: 'drawing',
  10672. fn: function (aRenderingContext){
  10673. var self=this;
  10674. smalltalk.send(aRenderingContext, "_fillStyle_", [smalltalk.send(self, "_color", [])]);
  10675. smalltalk.send(smalltalk.send(self, "_bounds", []), "_do_", [(function(each){return (function($rec){smalltalk.send($rec, "_fillRectFrom_to_", [smalltalk.send(smalltalk.send(each, "__plus", [smalltalk.send(self, "_position", [])]), "__star", [smalltalk.send(smalltalk.Tetris, "_squareSize", [])]), smalltalk.send(smalltalk.send((1), "__at", [(1)]), "__star", [smalltalk.send(smalltalk.Tetris, "_squareSize", [])])]);smalltalk.send($rec, "_strokeStyle_", [unescape("%23999")]);smalltalk.send($rec, "_lineWidth_", [(2)]);return smalltalk.send($rec, "_strokeRectFrom_to_", [smalltalk.send(smalltalk.send(each, "__plus", [smalltalk.send(self, "_position", [])]), "__star", [smalltalk.send(smalltalk.Tetris, "_squareSize", [])]), smalltalk.send(smalltalk.send((1), "__at", [(1)]), "__star", [smalltalk.send(smalltalk.Tetris, "_squareSize", [])])]);})(aRenderingContext);})]);
  10676. return self;},
  10677. 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')}),
  10678. smalltalk.TetrisPiece);
  10679. smalltalk.addMethod(
  10680. '_rotation',
  10681. smalltalk.method({
  10682. selector: 'rotation',
  10683. category: 'accessing',
  10684. fn: function (){
  10685. var self=this;
  10686. return smalltalk.send(self['@rotation'], "_ifNil_", [(function(){return self['@rotation']=(1);})]);
  10687. return self;},
  10688. source: unescape('rotation%0A%09%5Erotation%20ifNil%3A%20%5Brotation%20%3A%3D%201%5D')}),
  10689. smalltalk.TetrisPiece);
  10690. smalltalk.addMethod(
  10691. '_rotation_',
  10692. smalltalk.method({
  10693. selector: 'rotation:',
  10694. category: 'accessing',
  10695. fn: function (aNumber){
  10696. var self=this;
  10697. self['@rotation']=aNumber;
  10698. return self;},
  10699. source: unescape('rotation%3A%20aNumber%0A%09rotation%20%3A%3D%20aNumber')}),
  10700. smalltalk.TetrisPiece);
  10701. smalltalk.addMethod(
  10702. '_position',
  10703. smalltalk.method({
  10704. selector: 'position',
  10705. category: 'accessing',
  10706. fn: function (){
  10707. var self=this;
  10708. return smalltalk.send(self['@position'], "_ifNil_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Tetris, "_squares", []), "_x", []), "__slash", [(2)]), "__minus", [(1)]), "__at", [(0)]);})]);
  10709. return self;},
  10710. source: unescape('position%0A%09%5Eposition%20ifNil%3A%20%5B%28Tetris%20squares%20x%20/%202%29%20-1%20@%200%5D')}),
  10711. smalltalk.TetrisPiece);
  10712. smalltalk.addMethod(
  10713. '_position_',
  10714. smalltalk.method({
  10715. selector: 'position:',
  10716. category: 'accessing',
  10717. fn: function (aPoint){
  10718. var self=this;
  10719. return self['@position']=aPoint;
  10720. return self;},
  10721. source: unescape('position%3A%20aPoint%0A%09%5Eposition%20%3A%3D%20aPoint')}),
  10722. smalltalk.TetrisPiece);
  10723. smalltalk.addMethod(
  10724. '_bounds',
  10725. smalltalk.method({
  10726. selector: 'bounds',
  10727. category: 'accessing',
  10728. fn: function (){
  10729. var self=this;
  10730. smalltalk.send(self, "_subclassResponsibility", []);
  10731. return self;},
  10732. source: unescape('bounds%0A%09self%20subclassResponsibility')}),
  10733. smalltalk.TetrisPiece);
  10734. smalltalk.addMethod(
  10735. '_color',
  10736. smalltalk.method({
  10737. selector: 'color',
  10738. category: 'accessing',
  10739. fn: function (){
  10740. var self=this;
  10741. return unescape("%23afa");
  10742. return self;},
  10743. source: unescape('color%0A%09%5E%27%23afa%27')}),
  10744. smalltalk.TetrisPiece);
  10745. smalltalk.addMethod(
  10746. '_canMove',
  10747. smalltalk.method({
  10748. selector: 'canMove',
  10749. category: 'testing',
  10750. fn: function (){
  10751. var self=this;
  10752. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_position", []), "_y", []), "__lt", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Tetris, "_squares", []), "_y", []), "__minus", [smalltalk.send(self, "_height", [])])]);
  10753. return self;},
  10754. source: unescape('canMove%0A%09%5Eself%20position%20y%20%3C%20%28Tetris%20squares%20y%20-%20self%20height%29')}),
  10755. smalltalk.TetrisPiece);
  10756. smalltalk.addMethod(
  10757. '_height',
  10758. smalltalk.method({
  10759. selector: 'height',
  10760. category: 'accessing',
  10761. fn: function (){
  10762. var self=this;
  10763. return (2);
  10764. return self;},
  10765. source: unescape('height%0A%09%5E2')}),
  10766. smalltalk.TetrisPiece);
  10767. smalltalk.addMethod(
  10768. '_canMoveIn_',
  10769. smalltalk.method({
  10770. selector: 'canMoveIn:',
  10771. category: 'testing',
  10772. fn: function (aTetris){
  10773. var self=this;
  10774. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_position", []), "_y", []), "__lt", [smalltalk.send(smalltalk.send(smalltalk.send(aTetris, "_squares", []), "_y", []), "__minus", [smalltalk.send(self, "_height", [])])]);
  10775. return self;},
  10776. source: unescape('canMoveIn%3A%20aTetris%0A%09%5Eself%20position%20y%20%3C%20%28aTetris%20squares%20y%20-%20self%20height%29')}),
  10777. smalltalk.TetrisPiece);
  10778. smalltalk.addMethod(
  10779. '_atRandom',
  10780. smalltalk.method({
  10781. selector: 'atRandom',
  10782. category: 'instance creation',
  10783. fn: function (){
  10784. var self=this;
  10785. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_subclasses", []), "_at_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_subclasses", []), "_size", []), "_atRandom", [])]), "_new", []);
  10786. return self;},
  10787. source: unescape('atRandom%0A%09%5E%28self%20subclasses%20at%3A%20self%20subclasses%20size%20atRandom%29%20new')}),
  10788. smalltalk.TetrisPiece.klass);
  10789. smalltalk.addClass('TetrisPieceO', smalltalk.TetrisPiece, [], 'Examples');
  10790. smalltalk.addMethod(
  10791. '_bounds',
  10792. smalltalk.method({
  10793. selector: 'bounds',
  10794. category: 'accessing',
  10795. fn: function (){
  10796. var self=this;
  10797. return (function($rec){smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(0)])]);smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(1)])]);smalltalk.send($rec, "_add_", [smalltalk.send((1), "__at", [(0)])]);smalltalk.send($rec, "_add_", [smalltalk.send((1), "__at", [(1)])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.Array, "_new", []));
  10798. return self;},
  10799. 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')}),
  10800. smalltalk.TetrisPieceO);
  10801. smalltalk.addClass('TetrisPieceL', smalltalk.TetrisPiece, [], 'Examples');
  10802. smalltalk.addMethod(
  10803. '_bounds',
  10804. smalltalk.method({
  10805. selector: 'bounds',
  10806. category: 'accessing',
  10807. fn: function (){
  10808. var self=this;
  10809. return (function($rec){smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(0)])]);smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(1)])]);smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(2)])]);smalltalk.send($rec, "_add_", [smalltalk.send((1), "__at", [(2)])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.Array, "_new", []));
  10810. return self;},
  10811. 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')}),
  10812. smalltalk.TetrisPieceL);
  10813. smalltalk.addMethod(
  10814. '_color',
  10815. smalltalk.method({
  10816. selector: 'color',
  10817. category: 'accessing',
  10818. fn: function (){
  10819. var self=this;
  10820. return unescape("%23ffa");
  10821. return self;},
  10822. source: unescape('color%0A%09%5E%27%23ffa%27')}),
  10823. smalltalk.TetrisPieceL);
  10824. smalltalk.addMethod(
  10825. '_height',
  10826. smalltalk.method({
  10827. selector: 'height',
  10828. category: 'accessing',
  10829. fn: function (){
  10830. var self=this;
  10831. return (3);
  10832. return self;},
  10833. source: unescape('height%0A%09%5E3')}),
  10834. smalltalk.TetrisPieceL);
  10835. smalltalk.addClass('TetrisPieceJ', smalltalk.TetrisPiece, [], 'Examples');
  10836. smalltalk.addMethod(
  10837. '_color',
  10838. smalltalk.method({
  10839. selector: 'color',
  10840. category: 'accessing',
  10841. fn: function (){
  10842. var self=this;
  10843. return unescape("%23aaf");
  10844. return self;},
  10845. source: unescape('color%0A%09%5E%27%23aaf%27')}),
  10846. smalltalk.TetrisPieceJ);
  10847. smalltalk.addMethod(
  10848. '_bounds',
  10849. smalltalk.method({
  10850. selector: 'bounds',
  10851. category: 'accessing',
  10852. fn: function (){
  10853. var self=this;
  10854. return (function($rec){smalltalk.send($rec, "_add_", [smalltalk.send((1), "__at", [(0)])]);smalltalk.send($rec, "_add_", [smalltalk.send((1), "__at", [(1)])]);smalltalk.send($rec, "_add_", [smalltalk.send((1), "__at", [(2)])]);smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(2)])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.Array, "_new", []));
  10855. return self;},
  10856. 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')}),
  10857. smalltalk.TetrisPieceJ);
  10858. smalltalk.addMethod(
  10859. '_height',
  10860. smalltalk.method({
  10861. selector: 'height',
  10862. category: 'accessing',
  10863. fn: function (){
  10864. var self=this;
  10865. return (3);
  10866. return self;},
  10867. source: unescape('height%0A%09%5E3')}),
  10868. smalltalk.TetrisPieceJ);
  10869. smalltalk.addClass('TetrisPieceI', smalltalk.TetrisPiece, [], 'Examples');
  10870. smalltalk.addMethod(
  10871. '_color',
  10872. smalltalk.method({
  10873. selector: 'color',
  10874. category: 'accessing',
  10875. fn: function (){
  10876. var self=this;
  10877. return unescape("%23faa");
  10878. return self;},
  10879. source: unescape('color%0A%09%5E%27%23faa%27')}),
  10880. smalltalk.TetrisPieceI);
  10881. smalltalk.addMethod(
  10882. '_bounds',
  10883. smalltalk.method({
  10884. selector: 'bounds',
  10885. category: 'accessing',
  10886. fn: function (){
  10887. var self=this;
  10888. return (function($rec){smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(0)])]);smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(1)])]);smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(2)])]);smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(3)])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.Array, "_new", []));
  10889. return self;},
  10890. 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')}),
  10891. smalltalk.TetrisPieceI);
  10892. smalltalk.addMethod(
  10893. '_height',
  10894. smalltalk.method({
  10895. selector: 'height',
  10896. category: 'accessing',
  10897. fn: function (){
  10898. var self=this;
  10899. return (4);
  10900. return self;},
  10901. source: unescape('height%0A%09%5E4')}),
  10902. smalltalk.TetrisPieceI);
  10903. smalltalk.addClass('TetrisPieceT', smalltalk.TetrisPiece, [], 'Examples');
  10904. smalltalk.addMethod(
  10905. '_bounds',
  10906. smalltalk.method({
  10907. selector: 'bounds',
  10908. category: 'accessing',
  10909. fn: function (){
  10910. var self=this;
  10911. return (function($rec){smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(0)])]);smalltalk.send($rec, "_add_", [smalltalk.send((1), "__at", [(0)])]);smalltalk.send($rec, "_add_", [smalltalk.send((2), "__at", [(0)])]);smalltalk.send($rec, "_add_", [smalltalk.send((1), "__at", [(1)])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.Array, "_new", []));
  10912. return self;},
  10913. 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')}),
  10914. smalltalk.TetrisPieceT);
  10915. smalltalk.addMethod(
  10916. '_color',
  10917. smalltalk.method({
  10918. selector: 'color',
  10919. category: 'accessing',
  10920. fn: function (){
  10921. var self=this;
  10922. return unescape("%23aaf");
  10923. return self;},
  10924. source: unescape('color%0A%09%5E%27%23aaf%27')}),
  10925. smalltalk.TetrisPieceT);