1
0

jtalk.js 333 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172
  1. function Smalltalk(){};
  2. function SmalltalkObject(){};
  3. function SmalltalkBehavior(){};
  4. function SmalltalkClass(){};
  5. function SmalltalkMetaclass(){
  6. this.meta = true;
  7. };
  8. function SmalltalkMethod(){};
  9. function SmalltalkNil(){};
  10. var nil = new SmalltalkNil();
  11. var smalltalk = new Smalltalk();
  12. smalltalk.klass = function(spec) {
  13. var spec = spec || {};
  14. var that;
  15. if(spec.meta) {
  16. that = new SmalltalkMetaclass();
  17. } else {
  18. that = new (smalltalk.klass({meta: true})).fn;
  19. that.klass.instanceClass = that;
  20. that.className = spec.className;
  21. that.klass.className = that.className + ' class';
  22. }
  23. that.fn = spec.fn || function(){};
  24. that.superclass = spec.superclass;
  25. that.iVarNames = spec.iVarNames || [];
  26. if(that.superclass) {
  27. that.klass.superclass = that.superclass.klass;
  28. }
  29. that.category = spec.category || "";
  30. that.fn.prototype.methods = {};
  31. that.fn.prototype.klass = that;
  32. return that;
  33. };
  34. smalltalk.method = function(spec) {
  35. var that = new SmalltalkMethod();
  36. that.selector = spec.selector;
  37. that.category = spec.category;
  38. that.source = spec.source;
  39. that.fn = spec.fn;
  40. return that
  41. };
  42. smalltalk.init = function(klass) {
  43. var subclasses = smalltalk.subclasses(klass);
  44. for(var i=0;i<klass.iVarNames.length;i++) {
  45. klass.fn.prototype["@"+klass.iVarNames[i]] = nil;
  46. }
  47. if(klass.superclass && klass.superclass !== nil) {
  48. klass.fn.prototype.__proto__ = klass.superclass.fn.prototype;
  49. for(var i=0;i<klass.superclass.iVarNames.length;i++) {
  50. if(!klass["@"+klass.superclass.iVarNames[i]]) {
  51. klass.fn.prototype["@"+klass.superclass.iVarNames[i]] = nil;
  52. }
  53. }
  54. }
  55. for(var i=0;i<subclasses.length;i++) {
  56. smalltalk.init(subclasses[i]);
  57. }
  58. if(klass.klass && !klass.meta) {
  59. smalltalk.init(klass.klass);
  60. }
  61. };
  62. smalltalk.classes = function() {
  63. var classes = [];
  64. for(var i in smalltalk) {
  65. if(i.search(/^[A-Z]/g) != -1) {
  66. classes.push(smalltalk[i]);
  67. }
  68. }
  69. return classes
  70. };
  71. smalltalk.subclasses = function(klass) {
  72. var subclasses = [];
  73. var classes = smalltalk.classes();
  74. for(var i in classes) {
  75. if(classes[i].fn) {
  76. //Metaclasses
  77. if(classes[i].klass && classes[i].klass.superclass === klass) {
  78. subclasses.push(classes[i].klass);
  79. }
  80. //Classes
  81. if(classes[i].superclass === klass) {
  82. subclasses.push(classes[i]);
  83. }
  84. }
  85. }
  86. return subclasses;
  87. };
  88. smalltalk.mapClassName = function(className, category, fn, superclass) {
  89. smalltalk[className] = smalltalk.klass({
  90. className: className,
  91. category: category,
  92. superclass: superclass,
  93. fn: fn
  94. });
  95. };
  96. smalltalk.addClass = function(className, superclass, iVarNames, category) {
  97. if(smalltalk[className]) {
  98. smalltalk[className].superclass = superclass;
  99. smalltalk[className].iVarNames = iVarNames;
  100. } else {
  101. smalltalk[className] = smalltalk.klass({
  102. className: className,
  103. iVarNames: iVarNames,
  104. superclass: superclass
  105. });
  106. }
  107. smalltalk[className].category = category || '';
  108. };
  109. smalltalk.addMethod = function(jsSelector, method, klass) {
  110. klass.fn.prototype[jsSelector] = method.fn;
  111. klass.fn.prototype.methods[method.selector] = method;
  112. };
  113. smalltalk.mapClassName("Object", "Kernel", SmalltalkObject);
  114. smalltalk.mapClassName("Smalltalk", "Kernel", Smalltalk, smalltalk.Object);
  115. smalltalk.mapClassName("Behavior", "Kernel", SmalltalkBehavior, smalltalk.Object);
  116. smalltalk.mapClassName("Class", "Kernel", SmalltalkClass, smalltalk.Behavior);
  117. smalltalk.mapClassName("Metaclass", "Kernel", SmalltalkMetaclass, smalltalk.Behavior);
  118. smalltalk.mapClassName("CompiledMethod", "Kernel", SmalltalkMethod, smalltalk.Object);
  119. smalltalk.Object.klass.superclass = smalltalk.Class
  120. smalltalk.mapClassName("Number", "Kernel", Number, smalltalk.Object);
  121. smalltalk.mapClassName("BlockClosure", "Kernel", Function, smalltalk.Object);
  122. smalltalk.mapClassName("Boolean", "Kernel", Boolean, smalltalk.Object);
  123. smalltalk.mapClassName("UndefinedObject", "Kernel", SmalltalkNil, smalltalk.Object);
  124. smalltalk.mapClassName("Collection", "Kernel", null, smalltalk.Object);
  125. smalltalk.mapClassName("String", "Kernel", String, smalltalk.Collection);
  126. smalltalk.mapClassName("RegularExpression", "Kernel", RegExp, smalltalk.String);
  127. smalltalk.mapClassName("Array", "Kernel", Array, smalltalk.Collection);
  128. smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel');
  129. smalltalk.addMethod(
  130. '__eq',
  131. smalltalk.method({
  132. selector: '=',
  133. category: 'comparing',
  134. fn: function (anObject){
  135. var self=this;
  136. return (function(){return self == anObject})();
  137. return self;},
  138. source: unescape('%3D%20anObject%0A%09%5E%7B%27return%20self%20%3D%3D%20anObject%27%7D%0A')}),
  139. smalltalk.Object);
  140. smalltalk.addMethod(
  141. '_~_eq',
  142. smalltalk.method({
  143. selector: '~=',
  144. category: 'comparing',
  145. fn: function (anObject){
  146. var self=this;
  147. return self.__eq(anObject).__eq_eq(false);
  148. return self;},
  149. source: unescape('%7E%3D%20anObject%0A%09%5E%28self%20%3D%20anObject%29%20%3D%3D%20false%0A')}),
  150. smalltalk.Object);
  151. smalltalk.addMethod(
  152. '_initialize',
  153. smalltalk.method({
  154. selector: 'initialize',
  155. category: 'initialization',
  156. fn: function (){
  157. var self=this;
  158. return self;},
  159. source: unescape('initialize%0A')}),
  160. smalltalk.Object);
  161. smalltalk.addMethod(
  162. '_yourself',
  163. smalltalk.method({
  164. selector: 'yourself',
  165. category: 'accessing',
  166. fn: function (){
  167. var self=this;
  168. return self;
  169. return self;},
  170. source: unescape('yourself%0A%09%5Eself%0A')}),
  171. smalltalk.Object);
  172. smalltalk.addMethod(
  173. '_class',
  174. smalltalk.method({
  175. selector: 'class',
  176. category: 'accessing',
  177. fn: function (){
  178. var self=this;
  179. return (function(){return self.klass})();
  180. return self;},
  181. source: unescape('class%0A%09%5E%7B%27return%20self.klass%27%7D%0A')}),
  182. smalltalk.Object);
  183. smalltalk.addMethod(
  184. '_size',
  185. smalltalk.method({
  186. selector: 'size',
  187. category: 'accessing',
  188. fn: function (){
  189. var self=this;
  190. self._error_("Object not indexable");
  191. return self;},
  192. source: unescape('size%0A%09self%20error%3A%20%27Object%20not%20indexable%27%0A')}),
  193. smalltalk.Object);
  194. smalltalk.addMethod(
  195. '_copy',
  196. smalltalk.method({
  197. selector: 'copy',
  198. category: 'copying',
  199. fn: function (){
  200. var self=this;
  201. return self._shallowCopy()._postCopy();
  202. return self;},
  203. source: unescape('copy%0A%09%5Eself%20shallowCopy%20postCopy%0A')}),
  204. smalltalk.Object);
  205. smalltalk.addMethod(
  206. '_shallowCopy',
  207. smalltalk.method({
  208. selector: 'shallowCopy',
  209. category: 'copying',
  210. fn: function (){
  211. var self=this;
  212. return (function(){
  213. var copy = self.klass._new();
  214. for(var i in self) {
  215. if(/^@.+/.test(i)) {
  216. copy[i] = self[i];
  217. }
  218. }
  219. return copy;
  220. })();
  221. return self;},
  222. source: unescape('shallowCopy%0A%09%5E%7B%27%0A%09%20%20%20%20var%20copy%20%3D%20self.klass._new%28%29%3B%0A%09%20%20%20%20for%28var%20i%20in%20self%29%20%7B%0A%09%09if%28/%5E@.+/.test%28i%29%29%20%7B%0A%09%09%20%20%20%20copy%5Bi%5D%20%3D%20self%5Bi%5D%3B%0A%09%09%7D%0A%09%20%20%20%20%7D%0A%09%20%20%20%20return%20copy%3B%0A%09%27%7D%0A')}),
  223. smalltalk.Object);
  224. smalltalk.addMethod(
  225. '_deepCopy',
  226. smalltalk.method({
  227. selector: 'deepCopy',
  228. category: 'copying',
  229. fn: function (){
  230. var self=this;
  231. (function(){
  232. var copy = self.klass._new();
  233. for(var i in self) {
  234. if(/^@.+/.test(i)) {
  235. copy[i] = self[i]._deepCopy();
  236. }
  237. }
  238. return copy;
  239. })();
  240. return self;},
  241. 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')}),
  242. smalltalk.Object);
  243. smalltalk.addMethod(
  244. '_postCopy',
  245. smalltalk.method({
  246. selector: 'postCopy',
  247. category: 'copying',
  248. fn: function (){
  249. var self=this;
  250. return self;},
  251. source: unescape('postCopy%0A')}),
  252. smalltalk.Object);
  253. smalltalk.addMethod(
  254. '__minus_gt',
  255. smalltalk.method({
  256. selector: '->',
  257. category: 'converting',
  258. fn: function (anObject){
  259. var self=this;
  260. return smalltalk.Association._key_value_(self,anObject);
  261. return self;},
  262. source: unescape('-%3E%20anObject%0A%09%5EAssociation%20key%3A%20self%20value%3A%20anObject%0A')}),
  263. smalltalk.Object);
  264. smalltalk.addMethod(
  265. '_asString',
  266. smalltalk.method({
  267. selector: 'asString',
  268. category: 'converting',
  269. fn: function (){
  270. var self=this;
  271. return self._printString();
  272. return self;},
  273. source: unescape('asString%0A%09%5Eself%20printString%0A')}),
  274. smalltalk.Object);
  275. smalltalk.addMethod(
  276. '_asJavascript',
  277. smalltalk.method({
  278. selector: 'asJavascript',
  279. category: 'converting',
  280. fn: function (){
  281. var self=this;
  282. return self._asString();
  283. return self;},
  284. source: unescape('asJavascript%0A%09%5Eself%20asString%0A')}),
  285. smalltalk.Object);
  286. smalltalk.addMethod(
  287. '_perform_',
  288. smalltalk.method({
  289. selector: 'perform:',
  290. category: 'message handling',
  291. fn: function (aSymbol){
  292. var self=this;
  293. return self._perform_withArguments_(aSymbol,[]);
  294. return self;},
  295. source: unescape('perform%3A%20aSymbol%0A%09%5Eself%20perform%3A%20aSymbol%20withArguments%3A%20%23%28%29%0A')}),
  296. smalltalk.Object);
  297. smalltalk.addMethod(
  298. '_perform_withArguments_',
  299. smalltalk.method({
  300. selector: 'perform:withArguments:',
  301. category: 'error handling',
  302. fn: function (aSymbol, aCollection){
  303. var self=this;
  304. return self._basicPerform_withArguments_(aSymbol._asSelector(),aCollection);
  305. return self;},
  306. source: unescape('perform%3A%20aSymbol%20withArguments%3A%20aCollection%0A%09%5Eself%20basicPerform%3A%20aSymbol%20asSelector%20withArguments%3A%20aCollection%0A')}),
  307. smalltalk.Object);
  308. smalltalk.addMethod(
  309. '_instVarAt_',
  310. smalltalk.method({
  311. selector: 'instVarAt:',
  312. category: 'accessing',
  313. fn: function (aString){
  314. var self=this;
  315. return (function(){
  316. var value = self['@'+aString];
  317. if(typeof(value) == 'undefined') {
  318. return nil;
  319. } else {
  320. return value;
  321. }
  322. })();
  323. return self;},
  324. source: unescape('instVarAt%3A%20aString%0A%09%5E%7B%27%0A%09%20%20%20%20var%20value%20%3D%20self%5B%27%27@%27%27+aString%5D%3B%0A%09%20%20%20%20if%28typeof%28value%29%20%3D%3D%20%27%27undefined%27%27%29%20%7B%0A%09%09return%20nil%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20value%3B%0A%09%20%20%20%20%7D%0A%09%27%7D%0A')}),
  325. smalltalk.Object);
  326. smalltalk.addMethod(
  327. '_instVarAt_put_',
  328. smalltalk.method({
  329. selector: 'instVarAt:put:',
  330. category: 'accessing',
  331. fn: function (aString, anObject){
  332. var self=this;
  333. return (function(){self['@' + aString] = anObject})();
  334. return self;},
  335. source: unescape('instVarAt%3A%20aString%20put%3A%20anObject%0A%09%5E%7B%27self%5B%27%27@%27%27%20+%20aString%5D%20%3D%20anObject%27%7D%0A')}),
  336. smalltalk.Object);
  337. smalltalk.addMethod(
  338. '_basicAt_',
  339. smalltalk.method({
  340. selector: 'basicAt:',
  341. category: 'accessing',
  342. fn: function (aString){
  343. var self=this;
  344. return (function(){
  345. var value = self[aString];
  346. if(typeof(value) == 'undefined') {
  347. return nil;
  348. } else {
  349. return value;
  350. }
  351. })();
  352. return self;},
  353. source: unescape('basicAt%3A%20aString%0A%09%5E%7B%27%0A%09%20%20%20%20var%20value%20%3D%20self%5BaString%5D%3B%0A%09%20%20%20%20if%28typeof%28value%29%20%3D%3D%20%27%27undefined%27%27%29%20%7B%0A%09%09return%20nil%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20value%3B%0A%09%20%20%20%20%7D%0A%09%27%7D%0A')}),
  354. smalltalk.Object);
  355. smalltalk.addMethod(
  356. '_basicAt_put_',
  357. smalltalk.method({
  358. selector: 'basicAt:put:',
  359. category: 'accessing',
  360. fn: function (aString, anObject){
  361. var self=this;
  362. return (function(){return self[aString] = anObject})();
  363. return self;},
  364. source: unescape('basicAt%3A%20aString%20put%3A%20anObject%0A%09%5E%7B%27return%20self%5BaString%5D%20%3D%20anObject%27%7D%0A')}),
  365. smalltalk.Object);
  366. smalltalk.addMethod(
  367. '_error_',
  368. smalltalk.method({
  369. selector: 'error:',
  370. category: 'error handling',
  371. fn: function (aString){
  372. var self=this;
  373. smalltalk.Error._signal_(aString);
  374. return self;},
  375. source: unescape('error%3A%20aString%0A%09Error%20signal%3A%20aString%0A')}),
  376. smalltalk.Object);
  377. smalltalk.addMethod(
  378. '_subclassResponsibility',
  379. smalltalk.method({
  380. selector: 'subclassResponsibility',
  381. category: 'error handling',
  382. fn: function (){
  383. var self=this;
  384. self._error_("This method is a responsibility of a subclass");
  385. return self;},
  386. source: unescape('subclassResponsibility%0A%09self%20error%3A%20%27This%20method%20is%20a%20responsibility%20of%20a%20subclass%27%0A')}),
  387. smalltalk.Object);
  388. smalltalk.addMethod(
  389. '_shouldNotImplement',
  390. smalltalk.method({
  391. selector: 'shouldNotImplement',
  392. category: 'error handling',
  393. fn: function (){
  394. var self=this;
  395. self._error_("This method should not be implemented in ".__comma(self._class()._name()));
  396. return self;},
  397. source: unescape('shouldNotImplement%0A%09self%20error%3A%20%27This%20method%20should%20not%20be%20implemented%20in%20%27%2C%20self%20class%20name%0A')}),
  398. smalltalk.Object);
  399. smalltalk.addMethod(
  400. '_try_catch_',
  401. smalltalk.method({
  402. selector: 'try:catch:',
  403. category: 'error handling',
  404. fn: function (aBlock, anotherBlock){
  405. var self=this;
  406. (function(){try{aBlock()} catch(e) {anotherBlock(e)}})();
  407. return self;},
  408. 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')}),
  409. smalltalk.Object);
  410. smalltalk.addMethod(
  411. '_printString',
  412. smalltalk.method({
  413. selector: 'printString',
  414. category: 'printing',
  415. fn: function (){
  416. var self=this;
  417. return "a ".__comma(self._class()._name());
  418. return self;},
  419. source: unescape('printString%0A%09%5E%27a%20%27%2C%20self%20class%20name%0A')}),
  420. smalltalk.Object);
  421. smalltalk.addMethod(
  422. '_printNl',
  423. smalltalk.method({
  424. selector: 'printNl',
  425. category: 'printing',
  426. fn: function (){
  427. var self=this;
  428. (function(){console.log(self)})();
  429. return self;},
  430. source: unescape('printNl%0A%09%7B%27console.log%28self%29%27%7D%0A')}),
  431. smalltalk.Object);
  432. smalltalk.addMethod(
  433. '_isKindOf_',
  434. smalltalk.method({
  435. selector: 'isKindOf:',
  436. category: 'testing',
  437. fn: function (aClass){
  438. var self=this;
  439. return self._isMemberOf_(aClass)._ifTrue_ifFalse_((function(){return true;}),(function(){return self._class()._inheritsFrom_(aClass);}));
  440. return self;},
  441. 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')}),
  442. smalltalk.Object);
  443. smalltalk.addMethod(
  444. '_isMemberOf_',
  445. smalltalk.method({
  446. selector: 'isMemberOf:',
  447. category: 'testing',
  448. fn: function (aClass){
  449. var self=this;
  450. return self._class().__eq(aClass);
  451. return self;},
  452. source: unescape('isMemberOf%3A%20aClass%0A%09%5Eself%20class%20%3D%20aClass%0A')}),
  453. smalltalk.Object);
  454. smalltalk.addMethod(
  455. '_ifNil_',
  456. smalltalk.method({
  457. selector: 'ifNil:',
  458. category: 'testing',
  459. fn: function (aBlock){
  460. var self=this;
  461. return self;
  462. return self;},
  463. source: unescape('ifNil%3A%20aBlock%0A%09%5Eself%0A')}),
  464. smalltalk.Object);
  465. smalltalk.addMethod(
  466. '_ifNil_ifNotNil_',
  467. smalltalk.method({
  468. selector: 'ifNil:ifNotNil:',
  469. category: 'testing',
  470. fn: function (aBlock, anotherBlock){
  471. var self=this;
  472. return anotherBlock._value();
  473. return self;},
  474. source: unescape('ifNil%3A%20aBlock%20ifNotNil%3A%20anotherBlock%0A%09%5EanotherBlock%20value%0A')}),
  475. smalltalk.Object);
  476. smalltalk.addMethod(
  477. '_ifNotNil_',
  478. smalltalk.method({
  479. selector: 'ifNotNil:',
  480. category: 'testing',
  481. fn: function (aBlock){
  482. var self=this;
  483. return aBlock._value();
  484. return self;},
  485. source: unescape('ifNotNil%3A%20aBlock%0A%09%5EaBlock%20value%0A')}),
  486. smalltalk.Object);
  487. smalltalk.addMethod(
  488. '_ifNotNil_ifNil_',
  489. smalltalk.method({
  490. selector: 'ifNotNil:ifNil:',
  491. category: 'testing',
  492. fn: function (aBlock, anotherBlock){
  493. var self=this;
  494. return aBlock._value();
  495. return self;},
  496. source: unescape('ifNotNil%3A%20aBlock%20ifNil%3A%20anotherBlock%0A%09%5EaBlock%20value%0A')}),
  497. smalltalk.Object);
  498. smalltalk.addMethod(
  499. '_isNil',
  500. smalltalk.method({
  501. selector: 'isNil',
  502. category: 'testing',
  503. fn: function (){
  504. var self=this;
  505. return false;
  506. return self;},
  507. source: unescape('isNil%0A%09%5Efalse%0A')}),
  508. smalltalk.Object);
  509. smalltalk.addMethod(
  510. '_notNil',
  511. smalltalk.method({
  512. selector: 'notNil',
  513. category: 'testing',
  514. fn: function (){
  515. var self=this;
  516. return self._isNil()._not();
  517. return self;},
  518. source: unescape('notNil%0A%09%5Eself%20isNil%20not%0A')}),
  519. smalltalk.Object);
  520. smalltalk.addMethod(
  521. '_isClass',
  522. smalltalk.method({
  523. selector: 'isClass',
  524. category: 'testing',
  525. fn: function (){
  526. var self=this;
  527. return false;
  528. return self;},
  529. source: unescape('isClass%0A%09%5Efalse%0A')}),
  530. smalltalk.Object);
  531. smalltalk.addMethod(
  532. '_isMetaclass',
  533. smalltalk.method({
  534. selector: 'isMetaclass',
  535. category: 'testing',
  536. fn: function (){
  537. var self=this;
  538. return false;
  539. return self;},
  540. source: unescape('isMetaclass%0A%09%5Efalse%0A')}),
  541. smalltalk.Object);
  542. smalltalk.addMethod(
  543. '_isNumber',
  544. smalltalk.method({
  545. selector: 'isNumber',
  546. category: 'testing',
  547. fn: function (){
  548. var self=this;
  549. return false;
  550. return self;},
  551. source: unescape('isNumber%0A%09%5Efalse%0A')}),
  552. smalltalk.Object);
  553. smalltalk.addMethod(
  554. '_isString',
  555. smalltalk.method({
  556. selector: 'isString',
  557. category: 'testing',
  558. fn: function (){
  559. var self=this;
  560. return false;
  561. return self;},
  562. source: unescape('isString%0A%09%5Efalse%0A')}),
  563. smalltalk.Object);
  564. smalltalk.addMethod(
  565. '_isParseFailure',
  566. smalltalk.method({
  567. selector: 'isParseFailure',
  568. category: 'testing',
  569. fn: function (){
  570. var self=this;
  571. return false;
  572. return self;},
  573. source: unescape('isParseFailure%0A%09%5Efalse%0A')}),
  574. smalltalk.Object);
  575. smalltalk.addMethod(
  576. '_basicPerform_',
  577. smalltalk.method({
  578. selector: 'basicPerform:',
  579. category: 'error handling',
  580. fn: function (aSymbol){
  581. var self=this;
  582. return self._basicPerform_withArguments_(aSymbol,[]);
  583. return self;},
  584. source: unescape('basicPerform%3A%20aSymbol%20%0A%20%20%20%20%5Eself%20basicPerform%3A%20aSymbol%20withArguments%3A%20%23%28%29%0A')}),
  585. smalltalk.Object);
  586. smalltalk.addMethod(
  587. '_basicPerform_withArguments_',
  588. smalltalk.method({
  589. selector: 'basicPerform:withArguments:',
  590. category: 'error handling',
  591. fn: function (aSymbol, aCollection){
  592. var self=this;
  593. return (function(){return self[aSymbol].apply(self, aCollection);})();
  594. return self;},
  595. source: unescape('basicPerform%3A%20aSymbol%20withArguments%3A%20aCollection%0A%09%5E%7B%27return%20self%5BaSymbol%5D.apply%28self%2C%20aCollection%29%3B%27%7D%0A')}),
  596. smalltalk.Object);
  597. smalltalk.addMethod(
  598. '_appendToBrush_',
  599. smalltalk.method({
  600. selector: 'appendToBrush:',
  601. category: '*Canvas',
  602. fn: function (aTagBrush){
  603. var self=this;
  604. aTagBrush._append_(self._asString());
  605. return self;},
  606. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20aTagBrush%20append%3A%20self%20asString%0A')}),
  607. smalltalk.Object);
  608. smalltalk.addMethod(
  609. '_basicDelete_',
  610. smalltalk.method({
  611. selector: 'basicDelete:',
  612. category: 'accessing',
  613. fn: function (aString){
  614. var self=this;
  615. (function(){delete self[aString]})();
  616. return self;},
  617. source: unescape('basicDelete%3A%20aString%0A%20%20%20%20%7B%27delete%20self%5BaString%5D%27%7D%0A')}),
  618. smalltalk.Object);
  619. smalltalk.addClass('Smalltalk', smalltalk.Object, [], 'Kernel');
  620. smalltalk.addMethod(
  621. '_classes',
  622. smalltalk.method({
  623. selector: 'classes',
  624. category: 'accessing',
  625. fn: function (){
  626. var self=this;
  627. return (function(){return self.classes()})();
  628. return self;},
  629. source: unescape('classes%0A%09%5E%7B%27return%20self.classes%28%29%27%7D%0A')}),
  630. smalltalk.Smalltalk);
  631. smalltalk.Smalltalk.klass.iVarNames = ['current'];
  632. smalltalk.addMethod(
  633. '_current',
  634. smalltalk.method({
  635. selector: 'current',
  636. category: 'accessing',
  637. fn: function (){
  638. var self=this;
  639. return (function(){return smalltalk})();
  640. return self;},
  641. source: unescape('current%0A%09%20%20%20%20%5E%7B%27return%20smalltalk%27%7D%0A')}),
  642. smalltalk.Smalltalk.klass);
  643. smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel');
  644. smalltalk.addMethod(
  645. '_new',
  646. smalltalk.method({
  647. selector: 'new',
  648. category: 'instance creation',
  649. fn: function (){
  650. var self=this;
  651. return (function($rec){$rec._initialize();return $rec._yourself();})(self._basicNew());
  652. return self;},
  653. source: unescape('new%0A%09%5Eself%20basicNew%20%0A%09%20%20%20%20initialize%3B%0A%09%20%20%20%20yourself%0A')}),
  654. smalltalk.Behavior);
  655. smalltalk.addMethod(
  656. '_basicNew',
  657. smalltalk.method({
  658. selector: 'basicNew',
  659. category: 'instance creation',
  660. fn: function (){
  661. var self=this;
  662. return (function(){return new self.fn();})();
  663. return self;},
  664. source: unescape('basicNew%0A%09%5E%7B%27return%20new%20self.fn%28%29%3B%27%7D%0A')}),
  665. smalltalk.Behavior);
  666. smalltalk.addMethod(
  667. '_name',
  668. smalltalk.method({
  669. selector: 'name',
  670. category: 'accessing',
  671. fn: function (){
  672. var self=this;
  673. return (function(){return self.className || nil})();
  674. return self;},
  675. source: unescape('name%0A%09%5E%7B%27return%20self.className%20%7C%7C%20nil%27%7D%0A')}),
  676. smalltalk.Behavior);
  677. smalltalk.addMethod(
  678. '_superclass',
  679. smalltalk.method({
  680. selector: 'superclass',
  681. category: 'accessing',
  682. fn: function (){
  683. var self=this;
  684. return (function(){return self.superclass || nil})();
  685. return self;},
  686. source: unescape('superclass%0A%09%5E%7B%27return%20self.superclass%20%7C%7C%20nil%27%7D%0A')}),
  687. smalltalk.Behavior);
  688. smalltalk.addMethod(
  689. '_subclasses',
  690. smalltalk.method({
  691. selector: 'subclasses',
  692. category: 'accessing',
  693. fn: function (){
  694. var self=this;
  695. return (function(){return smalltalk.subclasses(self)})();
  696. return self;},
  697. source: unescape('subclasses%0A%09%5E%7B%27return%20smalltalk.subclasses%28self%29%27%7D%0A')}),
  698. smalltalk.Behavior);
  699. smalltalk.addMethod(
  700. '_allSubclasses',
  701. smalltalk.method({
  702. selector: 'allSubclasses',
  703. category: 'accessing',
  704. fn: function (){
  705. var self=this;
  706. var result=nil;
  707. result=self._subclasses();
  708. self._subclasses()._do_((function(each){return result._addAll_(each._allSubclasses());}));
  709. return result;
  710. return self;},
  711. 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')}),
  712. smalltalk.Behavior);
  713. smalltalk.addMethod(
  714. '_withAllSubclasses',
  715. smalltalk.method({
  716. selector: 'withAllSubclasses',
  717. category: 'accessing',
  718. fn: function (){
  719. var self=this;
  720. return (function($rec){$rec._addAll_(self._allSubclasses());return $rec._yourself();})(smalltalk.Array._with_(self));
  721. return self;},
  722. source: unescape('withAllSubclasses%0A%09%5E%28Array%20with%3A%20self%29%20addAll%3A%20self%20allSubclasses%3B%20yourself%0A')}),
  723. smalltalk.Behavior);
  724. smalltalk.addMethod(
  725. '_prototype',
  726. smalltalk.method({
  727. selector: 'prototype',
  728. category: 'accessing',
  729. fn: function (){
  730. var self=this;
  731. return (function(){return self.fn.prototype})();
  732. return self;},
  733. source: unescape('prototype%0A%09%5E%7B%27return%20self.fn.prototype%27%7D%0A')}),
  734. smalltalk.Behavior);
  735. smalltalk.addMethod(
  736. '_methodDictionary',
  737. smalltalk.method({
  738. selector: 'methodDictionary',
  739. category: 'accessing',
  740. fn: function (){
  741. var self=this;
  742. return (function(){var dict = smalltalk.Dictionary._new();
  743. var methods = self.fn.prototype.methods;
  744. for(var i in methods) {
  745. if(methods[i].selector) {
  746. dict._at_put_(methods[i].selector, methods[i]);
  747. }
  748. };
  749. return dict})();
  750. return self;},
  751. source: unescape('methodDictionary%0A%09%5E%7B%27var%20dict%20%3D%20smalltalk.Dictionary._new%28%29%3B%0A%09var%20methods%20%3D%20self.fn.prototype.methods%3B%0A%09for%28var%20i%20in%20methods%29%20%7B%0A%09%09if%28methods%5Bi%5D.selector%29%20%7B%0A%09%09%09dict._at_put_%28methods%5Bi%5D.selector%2C%20methods%5Bi%5D%29%3B%0A%09%09%7D%0A%09%7D%3B%0A%09return%20dict%27%7D%0A')}),
  752. smalltalk.Behavior);
  753. smalltalk.addMethod(
  754. '_instVarNames',
  755. smalltalk.method({
  756. selector: 'instVarNames',
  757. category: '',
  758. fn: function () { var self = this; return function () {return self.iVarNames;}(); return self; },
  759. source: unescape('')}),
  760. smalltalk.Behavior);
  761. smalltalk.addMethod(
  762. '_methodsFor_',
  763. smalltalk.method({
  764. selector: 'methodsFor:',
  765. category: 'accessing',
  766. fn: function (aString){
  767. var self=this;
  768. return (function($rec){$rec._class_category_(self,aString);return $rec._yourself();})(smalltalk.ClassCategoryReader._new());
  769. return self;},
  770. 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')}),
  771. smalltalk.Behavior);
  772. smalltalk.addMethod(
  773. '_addCompiledMethod_',
  774. smalltalk.method({
  775. selector: 'addCompiledMethod:',
  776. category: 'accessing',
  777. fn: function (aMethod){
  778. var self=this;
  779. (function(){self.fn.prototype[aMethod.selector._asSelector()] = aMethod.fn;
  780. self.fn.prototype.methods[aMethod.selector] = aMethod})();
  781. return self;},
  782. 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')}),
  783. smalltalk.Behavior);
  784. smalltalk.addMethod(
  785. '_instanceVariableNames',
  786. smalltalk.method({
  787. selector: 'instanceVariableNames',
  788. category: 'accessing',
  789. fn: function (){
  790. var self=this;
  791. return (function(){return self.iVarNames})();
  792. return self;},
  793. source: unescape('instanceVariableNames%0A%09%5E%7B%27return%20self.iVarNames%27%7D%0A')}),
  794. smalltalk.Behavior);
  795. smalltalk.addMethod(
  796. '_comment',
  797. smalltalk.method({
  798. selector: 'comment',
  799. category: 'accessing',
  800. fn: function (){
  801. var self=this;
  802. return self._basicAt_("comment")._ifNil_((function(){return "";}));
  803. return self;},
  804. source: unescape('comment%0A%20%20%20%20%5E%28self%20basicAt%3A%20%27comment%27%29%20ifNil%3A%20%5B%27%27%5D%0A')}),
  805. smalltalk.Behavior);
  806. smalltalk.addMethod(
  807. '_comment_',
  808. smalltalk.method({
  809. selector: 'comment:',
  810. category: 'accessing',
  811. fn: function (aString){
  812. var self=this;
  813. self._basicAt_put_("comment",aString);
  814. return self;},
  815. source: unescape('comment%3A%20aString%0A%20%20%20%20self%20basicAt%3A%20%27comment%27%20put%3A%20aString%0A')}),
  816. smalltalk.Behavior);
  817. smalltalk.addMethod(
  818. '_commentStamp',
  819. smalltalk.method({
  820. selector: 'commentStamp',
  821. category: 'accessing',
  822. fn: function (){
  823. var self=this;
  824. return (function($rec){$rec._class_(self);return $rec._yourself();})(smalltalk.ClassCommentReader._new());
  825. return self;},
  826. source: unescape('commentStamp%0A%20%20%20%20%5EClassCommentReader%20new%0A%09class%3A%20self%3B%0A%09yourself%0A')}),
  827. smalltalk.Behavior);
  828. smalltalk.addMethod(
  829. '_removeCompiledMethod_',
  830. smalltalk.method({
  831. selector: 'removeCompiledMethod:',
  832. category: 'accessing',
  833. fn: function (aMethod){
  834. var self=this;
  835. (function(){delete self.fn.prototype[aMethod.selector._asSelector()];
  836. delete self.fn.prototype.methods[aMethod.selector]})();
  837. return self;},
  838. 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')}),
  839. smalltalk.Behavior);
  840. smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel');
  841. smalltalk.addMethod(
  842. '_category',
  843. smalltalk.method({
  844. selector: 'category',
  845. category: 'accessing',
  846. fn: function (){
  847. var self=this;
  848. return (function(){return self.category})();
  849. return self;},
  850. source: unescape('category%0A%09%5E%7B%27return%20self.category%27%7D%0A')}),
  851. smalltalk.Class);
  852. smalltalk.addMethod(
  853. '_category_',
  854. smalltalk.method({
  855. selector: 'category:',
  856. category: 'accessing',
  857. fn: function (aString){
  858. var self=this;
  859. (function(){self.category = aString})();
  860. return self;},
  861. source: unescape('category%3A%20aString%0A%09%7B%27self.category%20%3D%20aString%27%7D%0A')}),
  862. smalltalk.Class);
  863. smalltalk.addMethod(
  864. '_subclass_instanceVariableNames_',
  865. smalltalk.method({
  866. selector: 'subclass:instanceVariableNames:',
  867. category: 'class creation',
  868. fn: function (aString, anotherString){
  869. var self=this;
  870. return self._subclass_instanceVariableNames_category_(aString,anotherString,nil);
  871. return self;},
  872. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%0A%09%5Eself%20subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%20category%3A%20nil%0A')}),
  873. smalltalk.Class);
  874. smalltalk.addMethod(
  875. '_subclass_instanceVariableNames_category_',
  876. smalltalk.method({
  877. selector: 'subclass:instanceVariableNames:category:',
  878. category: 'class creation',
  879. fn: function (aString, aString2, aString3){
  880. var self=this;
  881. return smalltalk.ClassBuilder._new()._superclass_subclass_instanceVariableNames_category_(self,aString,aString2,aString3);
  882. return self;},
  883. 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')}),
  884. smalltalk.Class);
  885. smalltalk.addMethod(
  886. '_isClass',
  887. smalltalk.method({
  888. selector: 'isClass',
  889. category: 'testing',
  890. fn: function (){
  891. var self=this;
  892. return true;
  893. return self;},
  894. source: unescape('isClass%0A%09%5Etrue%0A')}),
  895. smalltalk.Class);
  896. smalltalk.addMethod(
  897. '_printString',
  898. smalltalk.method({
  899. selector: 'printString',
  900. category: 'printing',
  901. fn: function (){
  902. var self=this;
  903. return self._name();
  904. return self;},
  905. source: unescape('printString%0A%09%5Eself%20name%0A')}),
  906. smalltalk.Class);
  907. smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel');
  908. smalltalk.addMethod(
  909. '_instanceClass',
  910. smalltalk.method({
  911. selector: 'instanceClass',
  912. category: 'accessing',
  913. fn: function (){
  914. var self=this;
  915. return (function(){return self.instanceClass})();
  916. return self;},
  917. source: unescape('instanceClass%0A%09%5E%7B%27return%20self.instanceClass%27%7D%0A')}),
  918. smalltalk.Metaclass);
  919. smalltalk.addMethod(
  920. '_instanceVariableNames_',
  921. smalltalk.method({
  922. selector: 'instanceVariableNames:',
  923. category: 'accessing',
  924. fn: function (aCollection){
  925. var self=this;
  926. smalltalk.ClassBuilder._new()._class_instanceVariableNames_(self,aCollection);
  927. return self;},
  928. source: unescape('instanceVariableNames%3A%20aCollection%0A%09ClassBuilder%20new%0A%09%20%20%20%20class%3A%20self%20instanceVariableNames%3A%20aCollection%0A')}),
  929. smalltalk.Metaclass);
  930. smalltalk.addMethod(
  931. '_isMetaclass',
  932. smalltalk.method({
  933. selector: 'isMetaclass',
  934. category: 'testing',
  935. fn: function (){
  936. var self=this;
  937. return true;
  938. return self;},
  939. source: unescape('isMetaclass%0A%09%5Etrue%0A')}),
  940. smalltalk.Metaclass);
  941. smalltalk.addMethod(
  942. '_printString',
  943. smalltalk.method({
  944. selector: 'printString',
  945. category: 'printing',
  946. fn: function (){
  947. var self=this;
  948. return self._instanceClass()._name().__comma(" class");
  949. return self;},
  950. source: unescape('printString%0A%09%5Eself%20instanceClass%20name%2C%20%27%20class%27%0A')}),
  951. smalltalk.Metaclass);
  952. smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel');
  953. smalltalk.addMethod(
  954. '_source',
  955. smalltalk.method({
  956. selector: 'source',
  957. category: 'accessing',
  958. fn: function (){
  959. var self=this;
  960. return self._basicAt_("source")._ifNil_((function(){return "";}));
  961. return self;},
  962. source: unescape('source%0A%09%5E%28self%20basicAt%3A%20%27source%27%29%20ifNil%3A%20%5B%27%27%5D%0A')}),
  963. smalltalk.CompiledMethod);
  964. smalltalk.addMethod(
  965. '_source_',
  966. smalltalk.method({
  967. selector: 'source:',
  968. category: 'accessing',
  969. fn: function (aString){
  970. var self=this;
  971. self._basicAt_put_("source",aString);
  972. return self;},
  973. source: unescape('source%3A%20aString%0A%09self%20basicAt%3A%20%27source%27%20put%3A%20aString%0A')}),
  974. smalltalk.CompiledMethod);
  975. smalltalk.addMethod(
  976. '_category',
  977. smalltalk.method({
  978. selector: 'category',
  979. category: 'accessing',
  980. fn: function (){
  981. var self=this;
  982. return self._basicAt_("category")._ifNil_((function(){return "";}));
  983. return self;},
  984. source: unescape('category%0A%09%5E%28self%20basicAt%3A%20%27category%27%29%20ifNil%3A%20%5B%27%27%5D%0A')}),
  985. smalltalk.CompiledMethod);
  986. smalltalk.addMethod(
  987. '_category_',
  988. smalltalk.method({
  989. selector: 'category:',
  990. category: 'accessing',
  991. fn: function (aString){
  992. var self=this;
  993. self._basicAt_put_("category",aString);
  994. return self;},
  995. source: unescape('category%3A%20aString%0A%09self%20basicAt%3A%20%27category%27%20put%3A%20aString%0A')}),
  996. smalltalk.CompiledMethod);
  997. smalltalk.addMethod(
  998. '_selector',
  999. smalltalk.method({
  1000. selector: 'selector',
  1001. category: 'accessing',
  1002. fn: function (){
  1003. var self=this;
  1004. return self._basicAt_("selector");
  1005. return self;},
  1006. source: unescape('selector%0A%09%5Eself%20basicAt%3A%20%27selector%27%0A')}),
  1007. smalltalk.CompiledMethod);
  1008. smalltalk.addMethod(
  1009. '_selector_',
  1010. smalltalk.method({
  1011. selector: 'selector:',
  1012. category: 'accessing',
  1013. fn: function (aString){
  1014. var self=this;
  1015. self._basicAt_put_("selector",aString);
  1016. return self;},
  1017. source: unescape('selector%3A%20aString%0A%09self%20basicAt%3A%20%27selector%27%20put%3A%20aString%0A')}),
  1018. smalltalk.CompiledMethod);
  1019. smalltalk.addMethod(
  1020. '_fn',
  1021. smalltalk.method({
  1022. selector: 'fn',
  1023. category: 'accessing',
  1024. fn: function (){
  1025. var self=this;
  1026. return self._basicAt_("fn");
  1027. return self;},
  1028. source: unescape('fn%0A%09%5Eself%20basicAt%3A%20%27fn%27%0A')}),
  1029. smalltalk.CompiledMethod);
  1030. smalltalk.addMethod(
  1031. '_fn_',
  1032. smalltalk.method({
  1033. selector: 'fn:',
  1034. category: 'accessing',
  1035. fn: function (aBlock){
  1036. var self=this;
  1037. self._basicAt_put_("fn",aBlock);
  1038. return self;},
  1039. source: unescape('fn%3A%20aBlock%0A%09self%20basicAt%3A%20%27fn%27%20put%3A%20aBlock%0A')}),
  1040. smalltalk.CompiledMethod);
  1041. smalltalk.addClass('Number', smalltalk.Object, [], 'Kernel');
  1042. smalltalk.addMethod(
  1043. '__eq',
  1044. smalltalk.method({
  1045. selector: '=',
  1046. category: 'comparing',
  1047. fn: function (aNumber){
  1048. var self=this;
  1049. return (function(){return Number(self) == aNumber})();
  1050. return self;},
  1051. source: unescape('%3D%20aNumber%0A%09%5E%7B%27return%20Number%28self%29%20%3D%3D%20aNumber%27%7D%0A')}),
  1052. smalltalk.Number);
  1053. smalltalk.addMethod(
  1054. '__gt',
  1055. smalltalk.method({
  1056. selector: '>',
  1057. category: 'comparing',
  1058. fn: function (aNumber){
  1059. var self=this;
  1060. return (function(){return self > aNumber})();
  1061. return self;},
  1062. source: unescape('%3E%20aNumber%0A%09%5E%7B%27return%20self%20%3E%20aNumber%27%7D%0A')}),
  1063. smalltalk.Number);
  1064. smalltalk.addMethod(
  1065. '__lt',
  1066. smalltalk.method({
  1067. selector: '<',
  1068. category: 'comparing',
  1069. fn: function (aNumber){
  1070. var self=this;
  1071. return (function(){return self < aNumber})();
  1072. return self;},
  1073. source: unescape('%3C%20aNumber%0A%09%5E%7B%27return%20self%20%3C%20aNumber%27%7D%0A')}),
  1074. smalltalk.Number);
  1075. smalltalk.addMethod(
  1076. '__gt_eq',
  1077. smalltalk.method({
  1078. selector: '>=',
  1079. category: 'comparing',
  1080. fn: function (aNumber){
  1081. var self=this;
  1082. return (function(){return self >= aNumber})();
  1083. return self;},
  1084. source: unescape('%3E%3D%20aNumber%0A%09%5E%7B%27return%20self%20%3E%3D%20aNumber%27%7D%0A')}),
  1085. smalltalk.Number);
  1086. smalltalk.addMethod(
  1087. '__lt_eq',
  1088. smalltalk.method({
  1089. selector: '<=',
  1090. category: 'comparing',
  1091. fn: function (aNumber){
  1092. var self=this;
  1093. return (function(){return self <= aNumber})();
  1094. return self;},
  1095. source: unescape('%3C%3D%20aNumber%0A%09%5E%7B%27return%20self%20%3C%3D%20aNumber%27%7D%0A')}),
  1096. smalltalk.Number);
  1097. smalltalk.addMethod(
  1098. '__plus',
  1099. smalltalk.method({
  1100. selector: '+',
  1101. category: 'arithmetic',
  1102. fn: function (aNumber){
  1103. var self=this;
  1104. return (function(){return self + aNumber})();
  1105. return self;},
  1106. source: unescape('+%20aNumber%0A%09%5E%7B%27return%20self%20+%20aNumber%27%7D%0A')}),
  1107. smalltalk.Number);
  1108. smalltalk.addMethod(
  1109. '__minus',
  1110. smalltalk.method({
  1111. selector: '-',
  1112. category: 'arithmetic',
  1113. fn: function (aNumber){
  1114. var self=this;
  1115. return (function(){return self - aNumber})();
  1116. return self;},
  1117. source: unescape('-%20aNumber%0A%09%5E%7B%27return%20self%20-%20aNumber%27%7D%0A')}),
  1118. smalltalk.Number);
  1119. smalltalk.addMethod(
  1120. '__star',
  1121. smalltalk.method({
  1122. selector: '*',
  1123. category: 'arithmetic',
  1124. fn: function (aNumber){
  1125. var self=this;
  1126. return (function(){return self * aNumber})();
  1127. return self;},
  1128. source: unescape('*%20aNumber%0A%09%5E%7B%27return%20self%20*%20aNumber%27%7D%0A')}),
  1129. smalltalk.Number);
  1130. smalltalk.addMethod(
  1131. '__slash',
  1132. smalltalk.method({
  1133. selector: '/',
  1134. category: 'arithmetic',
  1135. fn: function (aNumber){
  1136. var self=this;
  1137. return (function(){return self / aNumber})();
  1138. return self;},
  1139. source: unescape('/%20aNumber%0A%09%5E%7B%27return%20self%20/%20aNumber%27%7D%0A')}),
  1140. smalltalk.Number);
  1141. smalltalk.addMethod(
  1142. '_max_',
  1143. smalltalk.method({
  1144. selector: 'max:',
  1145. category: 'arithmetic',
  1146. fn: function (aNumber){
  1147. var self=this;
  1148. return (function(){return Math.max(self, aNumber);})();
  1149. return self;},
  1150. source: unescape('max%3A%20aNumber%0A%09%5E%7B%27return%20Math.max%28self%2C%20aNumber%29%3B%27%7D%0A')}),
  1151. smalltalk.Number);
  1152. smalltalk.addMethod(
  1153. '_min_',
  1154. smalltalk.method({
  1155. selector: 'min:',
  1156. category: 'arithmetic',
  1157. fn: function (aNumber){
  1158. var self=this;
  1159. return (function(){return Math.min(self, aNumber);})();
  1160. return self;},
  1161. source: unescape('min%3A%20aNumber%0A%09%5E%7B%27return%20Math.min%28self%2C%20aNumber%29%3B%27%7D%0A')}),
  1162. smalltalk.Number);
  1163. smalltalk.addMethod(
  1164. '_rounded',
  1165. smalltalk.method({
  1166. selector: 'rounded',
  1167. category: 'converting',
  1168. fn: function (){
  1169. var self=this;
  1170. return (function(){return Math.round(self);})();
  1171. return self;},
  1172. source: unescape('rounded%0A%09%5E%7B%27return%20Math.round%28self%29%3B%27%7D%0A')}),
  1173. smalltalk.Number);
  1174. smalltalk.addMethod(
  1175. '_truncated',
  1176. smalltalk.method({
  1177. selector: 'truncated',
  1178. category: 'converting',
  1179. fn: function (){
  1180. var self=this;
  1181. return (function(){return Math.floor(self);})();
  1182. return self;},
  1183. source: unescape('truncated%0A%09%5E%7B%27return%20Math.floor%28self%29%3B%27%7D%0A')}),
  1184. smalltalk.Number);
  1185. smalltalk.addMethod(
  1186. '_to_',
  1187. smalltalk.method({
  1188. selector: 'to:',
  1189. category: 'converting',
  1190. fn: function (aNumber){
  1191. var self=this;
  1192. var array=nil;
  1193. var first=nil;
  1194. var last=nil;
  1195. var count=nil;
  1196. first=self._truncated();
  1197. last=aNumber._truncated().__plus((1));
  1198. count=(1);
  1199. first.__lt_eq(last)._ifFalse_((function(){return self._error_("Wrong interval");}));
  1200. array=smalltalk.Array._new();
  1201. last.__minus(first)._timesRepeat_((function(){array._at_put_(count,first);count=count.__plus((1));return first=first.__plus((1));}));
  1202. return array;
  1203. return self;},
  1204. 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')}),
  1205. smalltalk.Number);
  1206. smalltalk.addMethod(
  1207. '_timesRepeat_',
  1208. smalltalk.method({
  1209. selector: 'timesRepeat:',
  1210. category: 'enumerating',
  1211. fn: function (aBlock){
  1212. var self=this;
  1213. var integer=nil;
  1214. var count=nil;
  1215. integer=self._truncated();
  1216. count=(1);
  1217. (function(){return count.__gt(self);})._whileFalse_((function(){aBlock._value();return count=count.__plus((1));}));
  1218. return self;},
  1219. 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')}),
  1220. smalltalk.Number);
  1221. smalltalk.addMethod(
  1222. '_to_do_',
  1223. smalltalk.method({
  1224. selector: 'to:do:',
  1225. category: 'enumerating',
  1226. fn: function (aNumber, aBlock){
  1227. var self=this;
  1228. return self._to_(aNumber)._do_(aBlock);
  1229. return self;},
  1230. source: unescape('to%3A%20aNumber%20do%3A%20aBlock%0A%09%5E%28self%20to%3A%20aNumber%29%20do%3A%20aBlock%0A')}),
  1231. smalltalk.Number);
  1232. smalltalk.addMethod(
  1233. '_asString',
  1234. smalltalk.method({
  1235. selector: 'asString',
  1236. category: 'converting',
  1237. fn: function (){
  1238. var self=this;
  1239. return self._printString();
  1240. return self;},
  1241. source: unescape('asString%0A%09%5Eself%20printString%0A')}),
  1242. smalltalk.Number);
  1243. smalltalk.addMethod(
  1244. '_asJavascript',
  1245. smalltalk.method({
  1246. selector: 'asJavascript',
  1247. category: 'converting',
  1248. fn: function (){
  1249. var self=this;
  1250. return unescape("%28").__comma(self._printString()).__comma(unescape("%29"));
  1251. return self;},
  1252. source: unescape('asJavascript%0A%09%5E%27%28%27%2C%20self%20printString%2C%20%27%29%27%0A')}),
  1253. smalltalk.Number);
  1254. smalltalk.addMethod(
  1255. '_printString',
  1256. smalltalk.method({
  1257. selector: 'printString',
  1258. category: 'printing',
  1259. fn: function (){
  1260. var self=this;
  1261. return (function(){return String(self)})();
  1262. return self;},
  1263. source: unescape('printString%0A%09%5E%7B%27return%20String%28self%29%27%7D%0A')}),
  1264. smalltalk.Number);
  1265. smalltalk.addMethod(
  1266. '_isNumber',
  1267. smalltalk.method({
  1268. selector: 'isNumber',
  1269. category: 'testing',
  1270. fn: function (){
  1271. var self=this;
  1272. return true;
  1273. return self;},
  1274. source: unescape('isNumber%0A%09%5Etrue%0A')}),
  1275. smalltalk.Number);
  1276. smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel');
  1277. smalltalk.addMethod(
  1278. '_compiledSource',
  1279. smalltalk.method({
  1280. selector: 'compiledSource',
  1281. category: 'accessing',
  1282. fn: function (){
  1283. var self=this;
  1284. return (function(){return self.toString()})();
  1285. return self;},
  1286. source: unescape('compiledSource%0A%09%5E%7B%27return%20self.toString%28%29%27%7D%0A')}),
  1287. smalltalk.BlockClosure);
  1288. smalltalk.addMethod(
  1289. '_whileTrue_',
  1290. smalltalk.method({
  1291. selector: 'whileTrue:',
  1292. category: 'controlling',
  1293. fn: function (aBlock){
  1294. var self=this;
  1295. (function(){while(self()) {aBlock()}})();
  1296. return self;},
  1297. source: unescape('whileTrue%3A%20aBlock%0A%09%7B%27while%28self%28%29%29%20%7BaBlock%28%29%7D%27%7D%0A')}),
  1298. smalltalk.BlockClosure);
  1299. smalltalk.addMethod(
  1300. '_whileFalse_',
  1301. smalltalk.method({
  1302. selector: 'whileFalse:',
  1303. category: 'controlling',
  1304. fn: function (aBlock){
  1305. var self=this;
  1306. (function(){while(!self()) {aBlock()}})();
  1307. return self;},
  1308. source: unescape('whileFalse%3A%20aBlock%0A%09%7B%27while%28%21self%28%29%29%20%7BaBlock%28%29%7D%27%7D%0A')}),
  1309. smalltalk.BlockClosure);
  1310. smalltalk.addMethod(
  1311. '_value',
  1312. smalltalk.method({
  1313. selector: 'value',
  1314. category: 'evaluating',
  1315. fn: function (){
  1316. var self=this;
  1317. return (function(){return self();})();
  1318. return self;},
  1319. source: unescape('value%0A%09%5E%7B%27return%20self%28%29%3B%27%7D%0A')}),
  1320. smalltalk.BlockClosure);
  1321. smalltalk.addMethod(
  1322. '_value_',
  1323. smalltalk.method({
  1324. selector: 'value:',
  1325. category: 'evaluating',
  1326. fn: function (anArg){
  1327. var self=this;
  1328. return (function(){return self(anArg);})();
  1329. return self;},
  1330. source: unescape('value%3A%20anArg%0A%09%5E%7B%27return%20self%28anArg%29%3B%27%7D%0A')}),
  1331. smalltalk.BlockClosure);
  1332. smalltalk.addMethod(
  1333. '_value_value_',
  1334. smalltalk.method({
  1335. selector: 'value:value:',
  1336. category: 'evaluating',
  1337. fn: function (firstArg, secondArg){
  1338. var self=this;
  1339. return (function(){return self(firstArg, secondArg);})();
  1340. return self;},
  1341. source: unescape('value%3A%20firstArg%20value%3A%20secondArg%0A%09%5E%7B%27return%20self%28firstArg%2C%20secondArg%29%3B%27%7D%0A')}),
  1342. smalltalk.BlockClosure);
  1343. smalltalk.addMethod(
  1344. '_value_value_value_',
  1345. smalltalk.method({
  1346. selector: 'value:value:value:',
  1347. category: 'evaluating',
  1348. fn: function (firstArg, secondArg, thirdArg){
  1349. var self=this;
  1350. return (function(){return self(firstArg, secondArg, thirdArg);})();
  1351. return self;},
  1352. source: unescape('value%3A%20firstArg%20value%3A%20secondArg%20value%3A%20thirdArg%0A%09%5E%7B%27return%20self%28firstArg%2C%20secondArg%2C%20thirdArg%29%3B%27%7D%0A')}),
  1353. smalltalk.BlockClosure);
  1354. smalltalk.addMethod(
  1355. '_valueWithPossibleArguments_',
  1356. smalltalk.method({
  1357. selector: 'valueWithPossibleArguments:',
  1358. category: 'evaluating',
  1359. fn: function (aCollection){
  1360. var self=this;
  1361. return (function(){return self.apply(null, aCollection);})();
  1362. return self;},
  1363. source: unescape('valueWithPossibleArguments%3A%20aCollection%0A%09%5E%7B%27return%20self.apply%28null%2C%20aCollection%29%3B%27%7D%0A')}),
  1364. smalltalk.BlockClosure);
  1365. smalltalk.addMethod(
  1366. '_on_do_',
  1367. smalltalk.method({
  1368. selector: 'on:do:',
  1369. category: 'error handling',
  1370. fn: function (anErrorClass, aBlock){
  1371. var self=this;
  1372. self._try_catch_(self,(function(error){return error._isKindOf_(anErrorClass)._ifTrue_ifFalse_((function(){return aBlock._value();}),(function(){return error._signal();}));}));
  1373. return self;},
  1374. 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')}),
  1375. smalltalk.BlockClosure);
  1376. smalltalk.addMethod(
  1377. '_appendToJQuery_',
  1378. smalltalk.method({
  1379. selector: 'appendToJQuery:',
  1380. category: '*JQuery',
  1381. fn: function (aJQuery){
  1382. var self=this;
  1383. var canvas=nil;
  1384. canvas=smalltalk.HTMLCanvas._new();
  1385. self._value_(canvas);
  1386. aJQuery._append_(canvas);
  1387. return self;},
  1388. 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')}),
  1389. smalltalk.BlockClosure);
  1390. smalltalk.addMethod(
  1391. '_appendToBrush_',
  1392. smalltalk.method({
  1393. selector: 'appendToBrush:',
  1394. category: '*Canvas',
  1395. fn: function (aTagBrush){
  1396. var self=this;
  1397. aTagBrush._appendBlock_(self);
  1398. return self;},
  1399. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20aTagBrush%20appendBlock%3A%20self%0A')}),
  1400. smalltalk.BlockClosure);
  1401. smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel');
  1402. smalltalk.addMethod(
  1403. '__eq',
  1404. smalltalk.method({
  1405. selector: '=',
  1406. category: 'comparing',
  1407. fn: function (aBoolean){
  1408. var self=this;
  1409. return (function(){return Boolean(self == true) == aBoolean})();
  1410. return self;},
  1411. source: unescape('%3D%20aBoolean%0A%20%20%20%20%09%5E%7B%27return%20Boolean%28self%20%3D%3D%20true%29%20%3D%3D%20aBoolean%27%7D%0A')}),
  1412. smalltalk.Boolean);
  1413. smalltalk.addMethod(
  1414. '_shallowCopy',
  1415. smalltalk.method({
  1416. selector: 'shallowCopy',
  1417. category: 'copying',
  1418. fn: function (){
  1419. var self=this;
  1420. return self;
  1421. return self;},
  1422. source: unescape('shallowCopy%0A%09%5Eself%0A')}),
  1423. smalltalk.Boolean);
  1424. smalltalk.addMethod(
  1425. '_deepCopy',
  1426. smalltalk.method({
  1427. selector: 'deepCopy',
  1428. category: 'copying',
  1429. fn: function (){
  1430. var self=this;
  1431. return self;
  1432. return self;},
  1433. source: unescape('deepCopy%0A%09%5Eself%0A')}),
  1434. smalltalk.Boolean);
  1435. smalltalk.addMethod(
  1436. '_ifTrue_',
  1437. smalltalk.method({
  1438. selector: 'ifTrue:',
  1439. category: 'controlling',
  1440. fn: function (aBlock){
  1441. var self=this;
  1442. return self._ifTrue_ifFalse_(aBlock,(function(){return nil;}));
  1443. return self;},
  1444. source: unescape('ifTrue%3A%20aBlock%0A%09%5Eself%20ifTrue%3A%20aBlock%20ifFalse%3A%20%5B%5D%0A')}),
  1445. smalltalk.Boolean);
  1446. smalltalk.addMethod(
  1447. '_ifFalse_',
  1448. smalltalk.method({
  1449. selector: 'ifFalse:',
  1450. category: 'controlling',
  1451. fn: function (aBlock){
  1452. var self=this;
  1453. return self._ifTrue_ifFalse_((function(){return nil;}),aBlock);
  1454. return self;},
  1455. source: unescape('ifFalse%3A%20aBlock%0A%09%5Eself%20ifTrue%3A%20%5B%5D%20ifFalse%3A%20aBlock%0A')}),
  1456. smalltalk.Boolean);
  1457. smalltalk.addMethod(
  1458. '_ifFalse_ifTrue_',
  1459. smalltalk.method({
  1460. selector: 'ifFalse:ifTrue:',
  1461. category: 'controlling',
  1462. fn: function (aBlock, anotherBlock){
  1463. var self=this;
  1464. return self._ifTrue_ifFalse_(anotherBlock,aBlock);
  1465. return self;},
  1466. source: unescape('ifFalse%3A%20aBlock%20ifTrue%3A%20anotherBlock%0A%09%5Eself%20ifTrue%3A%20anotherBlock%20ifFalse%3A%20aBlock%0A')}),
  1467. smalltalk.Boolean);
  1468. smalltalk.addMethod(
  1469. '_ifTrue_ifFalse_',
  1470. smalltalk.method({
  1471. selector: 'ifTrue:ifFalse:',
  1472. category: 'controlling',
  1473. fn: function (aBlock, anotherBlock){
  1474. var self=this;
  1475. return (function(){
  1476. if(self == true) {
  1477. return aBlock();
  1478. } else {
  1479. return anotherBlock();
  1480. }
  1481. })();
  1482. return self;},
  1483. source: unescape('ifTrue%3A%20aBlock%20ifFalse%3A%20anotherBlock%0A%09%5E%7B%27%0A%09%20%20%20%20if%28self%20%3D%3D%20true%29%20%7B%0A%09%09return%20aBlock%28%29%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20anotherBlock%28%29%3B%0A%09%20%20%20%20%7D%0A%09%27%7D%0A')}),
  1484. smalltalk.Boolean);
  1485. smalltalk.addMethod(
  1486. '_and_',
  1487. smalltalk.method({
  1488. selector: 'and:',
  1489. category: 'controlling',
  1490. fn: function (aBlock){
  1491. var self=this;
  1492. return self.__eq(true)._ifTrue_ifFalse_(aBlock,(function(){return false;}));
  1493. return self;},
  1494. 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')}),
  1495. smalltalk.Boolean);
  1496. smalltalk.addMethod(
  1497. '_or_',
  1498. smalltalk.method({
  1499. selector: 'or:',
  1500. category: 'controlling',
  1501. fn: function (aBlock){
  1502. var self=this;
  1503. return self.__eq(true)._ifTrue_ifFalse_((function(){return true;}),aBlock);
  1504. return self;},
  1505. 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')}),
  1506. smalltalk.Boolean);
  1507. smalltalk.addMethod(
  1508. '_not',
  1509. smalltalk.method({
  1510. selector: 'not',
  1511. category: 'controlling',
  1512. fn: function (){
  1513. var self=this;
  1514. return self.__eq(false);
  1515. return self;},
  1516. source: unescape('not%0A%09%5Eself%20%3D%20false%0A')}),
  1517. smalltalk.Boolean);
  1518. smalltalk.addMethod(
  1519. '_printString',
  1520. smalltalk.method({
  1521. selector: 'printString',
  1522. category: 'printing',
  1523. fn: function (){
  1524. var self=this;
  1525. return (function(){return self.toString()})();
  1526. return self;},
  1527. source: unescape('printString%0A%09%5E%7B%27return%20self.toString%28%29%27%7D%0A')}),
  1528. smalltalk.Boolean);
  1529. smalltalk.addClass('UndefinedObject', smalltalk.Object, [], 'Kernel');
  1530. smalltalk.addMethod(
  1531. '_subclass_instanceVariableNames_',
  1532. smalltalk.method({
  1533. selector: 'subclass:instanceVariableNames:',
  1534. category: 'class creation',
  1535. fn: function (aString, anotherString){
  1536. var self=this;
  1537. return self._subclass_instanceVariableNames_category_(aString,anotherString,nil);
  1538. return self;},
  1539. source: unescape('subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%0A%09%5Eself%20subclass%3A%20aString%20instanceVariableNames%3A%20anotherString%20category%3A%20nil%0A')}),
  1540. smalltalk.UndefinedObject);
  1541. smalltalk.addMethod(
  1542. '_subclass_instanceVariableNames_category_',
  1543. smalltalk.method({
  1544. selector: 'subclass:instanceVariableNames:category:',
  1545. category: 'class creation',
  1546. fn: function (aString, aString2, aString3){
  1547. var self=this;
  1548. return smalltalk.ClassBuilder._new()._superclass_subclass_instanceVariableNames_category_(self,aString,aString2,aString3);
  1549. return self;},
  1550. 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')}),
  1551. smalltalk.UndefinedObject);
  1552. smalltalk.addMethod(
  1553. '_shallowCopy',
  1554. smalltalk.method({
  1555. selector: 'shallowCopy',
  1556. category: 'copying',
  1557. fn: function (){
  1558. var self=this;
  1559. return self;
  1560. return self;},
  1561. source: unescape('shallowCopy%0A%09%5Eself%0A')}),
  1562. smalltalk.UndefinedObject);
  1563. smalltalk.addMethod(
  1564. '_deepCopy',
  1565. smalltalk.method({
  1566. selector: 'deepCopy',
  1567. category: 'copying',
  1568. fn: function (){
  1569. var self=this;
  1570. return self;
  1571. return self;},
  1572. source: unescape('deepCopy%0A%09%5Eself%0A')}),
  1573. smalltalk.UndefinedObject);
  1574. smalltalk.addMethod(
  1575. '_ifNil_',
  1576. smalltalk.method({
  1577. selector: 'ifNil:',
  1578. category: 'testing',
  1579. fn: function (aBlock){
  1580. var self=this;
  1581. return self._ifNil_ifNotNil_(aBlock,(function(){return nil;}));
  1582. return self;},
  1583. source: unescape('ifNil%3A%20aBlock%0A%09%5Eself%20ifNil%3A%20aBlock%20ifNotNil%3A%20%5B%5D%0A')}),
  1584. smalltalk.UndefinedObject);
  1585. smalltalk.addMethod(
  1586. '_ifNotNil_',
  1587. smalltalk.method({
  1588. selector: 'ifNotNil:',
  1589. category: 'testing',
  1590. fn: function (aBlock){
  1591. var self=this;
  1592. return self;
  1593. return self;},
  1594. source: unescape('ifNotNil%3A%20aBlock%0A%09%5Eself%0A')}),
  1595. smalltalk.UndefinedObject);
  1596. smalltalk.addMethod(
  1597. '_ifNil_ifNotNil_',
  1598. smalltalk.method({
  1599. selector: 'ifNil:ifNotNil:',
  1600. category: 'testing',
  1601. fn: function (aBlock, anotherBlock){
  1602. var self=this;
  1603. return aBlock._value();
  1604. return self;},
  1605. source: unescape('ifNil%3A%20aBlock%20ifNotNil%3A%20anotherBlock%0A%09%5EaBlock%20value%0A')}),
  1606. smalltalk.UndefinedObject);
  1607. smalltalk.addMethod(
  1608. '_ifNotNil_ifNil_',
  1609. smalltalk.method({
  1610. selector: 'ifNotNil:ifNil:',
  1611. category: 'testing',
  1612. fn: function (aBlock, anotherBlock){
  1613. var self=this;
  1614. return anotherBlock._value();
  1615. return self;},
  1616. source: unescape('ifNotNil%3A%20aBlock%20ifNil%3A%20anotherBlock%0A%09%5EanotherBlock%20value%0A')}),
  1617. smalltalk.UndefinedObject);
  1618. smalltalk.addMethod(
  1619. '_isNil',
  1620. smalltalk.method({
  1621. selector: 'isNil',
  1622. category: 'testing',
  1623. fn: function (){
  1624. var self=this;
  1625. return true;
  1626. return self;},
  1627. source: unescape('isNil%0A%09%5Etrue%0A')}),
  1628. smalltalk.UndefinedObject);
  1629. smalltalk.addMethod(
  1630. '_notNil',
  1631. smalltalk.method({
  1632. selector: 'notNil',
  1633. category: 'testing',
  1634. fn: function (){
  1635. var self=this;
  1636. return false;
  1637. return self;},
  1638. source: unescape('notNil%0A%09%5Efalse%0A')}),
  1639. smalltalk.UndefinedObject);
  1640. smalltalk.addMethod(
  1641. '_printString',
  1642. smalltalk.method({
  1643. selector: 'printString',
  1644. category: 'printing',
  1645. fn: function (){
  1646. var self=this;
  1647. return "nil";
  1648. return self;},
  1649. source: unescape('printString%0A%20%20%20%20%5E%27nil%27%0A')}),
  1650. smalltalk.UndefinedObject);
  1651. smalltalk.addMethod(
  1652. '_new',
  1653. smalltalk.method({
  1654. selector: 'new',
  1655. category: 'instance creation',
  1656. fn: function (){
  1657. var self=this;
  1658. self._error_("You cannot create new instances of UndefinedObject. Use nil");
  1659. return self;},
  1660. source: unescape('new%0A%09%20%20%20%20self%20error%3A%20%27You%20cannot%20create%20new%20instances%20of%20UndefinedObject.%20Use%20nil%27%0A')}),
  1661. smalltalk.UndefinedObject.klass);
  1662. smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel');
  1663. smalltalk.addMethod(
  1664. '_size',
  1665. smalltalk.method({
  1666. selector: 'size',
  1667. category: 'accessing',
  1668. fn: function (){
  1669. var self=this;
  1670. self._subclassResponsibility();
  1671. return self;},
  1672. source: unescape('size%0A%09self%20subclassResponsibility%0A')}),
  1673. smalltalk.Collection);
  1674. smalltalk.addMethod(
  1675. '_at_',
  1676. smalltalk.method({
  1677. selector: 'at:',
  1678. category: 'accessing',
  1679. fn: function (anIndex){
  1680. var self=this;
  1681. return self._at_ifAbsent_(anIndex,(function(){return self._errorNotFound();}));
  1682. return self;},
  1683. source: unescape('at%3A%20anIndex%0A%09%5Eself%20at%3A%20anIndex%20ifAbsent%3A%20%5B%0A%09%20%20%20%20self%20errorNotFound%5D%0A')}),
  1684. smalltalk.Collection);
  1685. smalltalk.addMethod(
  1686. '_at_put_',
  1687. smalltalk.method({
  1688. selector: 'at:put:',
  1689. category: 'accessing',
  1690. fn: function (anIndex, anObject){
  1691. var self=this;
  1692. self._subclassResponsibility();
  1693. return self;},
  1694. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09self%20subclassResponsibility%0A')}),
  1695. smalltalk.Collection);
  1696. smalltalk.addMethod(
  1697. '_at_ifAbsent_',
  1698. smalltalk.method({
  1699. selector: 'at:ifAbsent:',
  1700. category: 'accessing',
  1701. fn: function (anIndex, aBlock){
  1702. var self=this;
  1703. self._subclassResponsibility();
  1704. return self;},
  1705. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09self%20subclassResponsibility%0A')}),
  1706. smalltalk.Collection);
  1707. smalltalk.addMethod(
  1708. '_first',
  1709. smalltalk.method({
  1710. selector: 'first',
  1711. category: 'accessing',
  1712. fn: function (){
  1713. var self=this;
  1714. return self._at_((1));
  1715. return self;},
  1716. source: unescape('first%0A%09%5Eself%20at%3A%201%0A')}),
  1717. smalltalk.Collection);
  1718. smalltalk.addMethod(
  1719. '_second',
  1720. smalltalk.method({
  1721. selector: 'second',
  1722. category: 'accessing',
  1723. fn: function (){
  1724. var self=this;
  1725. return self._at_((2));
  1726. return self;},
  1727. source: unescape('second%0A%09%5Eself%20at%3A%202%0A')}),
  1728. smalltalk.Collection);
  1729. smalltalk.addMethod(
  1730. '_third',
  1731. smalltalk.method({
  1732. selector: 'third',
  1733. category: 'accessing',
  1734. fn: function (){
  1735. var self=this;
  1736. return self._at_((3));
  1737. return self;},
  1738. source: unescape('third%0A%09%5Eself%20at%3A%203%0A')}),
  1739. smalltalk.Collection);
  1740. smalltalk.addMethod(
  1741. '_fourth',
  1742. smalltalk.method({
  1743. selector: 'fourth',
  1744. category: 'accessing',
  1745. fn: function (){
  1746. var self=this;
  1747. return self._at_((4));
  1748. return self;},
  1749. source: unescape('fourth%0A%09%5Eself%20at%3A%204%0A')}),
  1750. smalltalk.Collection);
  1751. smalltalk.addMethod(
  1752. '_last',
  1753. smalltalk.method({
  1754. selector: 'last',
  1755. category: 'accessing',
  1756. fn: function (){
  1757. var self=this;
  1758. return self._at_(self._size());
  1759. return self;},
  1760. source: unescape('last%0A%09%5Eself%20at%3A%20self%20size%0A')}),
  1761. smalltalk.Collection);
  1762. smalltalk.addMethod(
  1763. '_readStream',
  1764. smalltalk.method({
  1765. selector: 'readStream',
  1766. category: 'accessing',
  1767. fn: function (){
  1768. var self=this;
  1769. return self._stream();
  1770. return self;},
  1771. source: unescape('readStream%0A%09%5Eself%20stream%0A')}),
  1772. smalltalk.Collection);
  1773. smalltalk.addMethod(
  1774. '_writeStream',
  1775. smalltalk.method({
  1776. selector: 'writeStream',
  1777. category: 'accessing',
  1778. fn: function (){
  1779. var self=this;
  1780. return self._stream();
  1781. return self;},
  1782. source: unescape('writeStream%0A%09%5Eself%20stream%0A')}),
  1783. smalltalk.Collection);
  1784. smalltalk.addMethod(
  1785. '_stream',
  1786. smalltalk.method({
  1787. selector: 'stream',
  1788. category: 'accessing',
  1789. fn: function (){
  1790. var self=this;
  1791. return self._streamClass()._on_(self);
  1792. return self;},
  1793. source: unescape('stream%0A%09%5Eself%20streamClass%20on%3A%20self%0A')}),
  1794. smalltalk.Collection);
  1795. smalltalk.addMethod(
  1796. '_streamClass',
  1797. smalltalk.method({
  1798. selector: 'streamClass',
  1799. category: 'accessing',
  1800. fn: function (){
  1801. var self=this;
  1802. return self._class()._streamClass();
  1803. return self;},
  1804. source: unescape('streamClass%0A%09%5Eself%20class%20streamClass%0A')}),
  1805. smalltalk.Collection);
  1806. smalltalk.addMethod(
  1807. '_add_',
  1808. smalltalk.method({
  1809. selector: 'add:',
  1810. category: 'adding/removing',
  1811. fn: function (anObject){
  1812. var self=this;
  1813. self._subclassResponsibility();
  1814. return self;},
  1815. source: unescape('add%3A%20anObject%0A%09self%20subclassResponsibility%0A')}),
  1816. smalltalk.Collection);
  1817. smalltalk.addMethod(
  1818. '_addAll_',
  1819. smalltalk.method({
  1820. selector: 'addAll:',
  1821. category: 'adding/removing',
  1822. fn: function (aCollection){
  1823. var self=this;
  1824. aCollection._do_((function(each){return self._add_(each);}));
  1825. return aCollection;
  1826. return self;},
  1827. 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')}),
  1828. smalltalk.Collection);
  1829. smalltalk.addMethod(
  1830. '__comma',
  1831. smalltalk.method({
  1832. selector: ',',
  1833. category: 'copying',
  1834. fn: function (aCollection){
  1835. var self=this;
  1836. return (function($rec){$rec._addAll_(aCollection);return $rec._yourself();})(self._copy());
  1837. return self;},
  1838. 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')}),
  1839. smalltalk.Collection);
  1840. smalltalk.addMethod(
  1841. '_copyFrom_to_',
  1842. smalltalk.method({
  1843. selector: 'copyFrom:to:',
  1844. category: 'copying',
  1845. fn: function (anIndex, anotherIndex){
  1846. var self=this;
  1847. self._subclassResponsibility();
  1848. return self;},
  1849. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09self%20subclassResponsibility%0A')}),
  1850. smalltalk.Collection);
  1851. smalltalk.addMethod(
  1852. '_copyWith_',
  1853. smalltalk.method({
  1854. selector: 'copyWith:',
  1855. category: 'copying',
  1856. fn: function (anObject){
  1857. var self=this;
  1858. return (function($rec){$rec._add_(anObject);return $rec._yourself();})(self._copy());
  1859. return self;},
  1860. source: unescape('copyWith%3A%20anObject%0A%09%5Eself%20copy%20add%3A%20anObject%3B%20yourself%0A')}),
  1861. smalltalk.Collection);
  1862. smalltalk.addMethod(
  1863. '_copyWithAll_',
  1864. smalltalk.method({
  1865. selector: 'copyWithAll:',
  1866. category: 'copying',
  1867. fn: function (aCollection){
  1868. var self=this;
  1869. return (function($rec){$rec._addAll_(aCollection);return $rec._yourself();})(self._copy());
  1870. return self;},
  1871. source: unescape('copyWithAll%3A%20aCollection%0A%09%5Eself%20copy%20addAll%3A%20aCollection%3B%20yourself%0A')}),
  1872. smalltalk.Collection);
  1873. smalltalk.addMethod(
  1874. '_asArray',
  1875. smalltalk.method({
  1876. selector: 'asArray',
  1877. category: 'converting',
  1878. fn: function (){
  1879. var self=this;
  1880. var array=nil;
  1881. var index=nil;
  1882. array=smalltalk.Array._new();
  1883. index=(0);
  1884. self._do_((function(each){index=index.__plus((1));return array._at_put_(index,each);}));
  1885. return array;
  1886. return self;},
  1887. 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')}),
  1888. smalltalk.Collection);
  1889. smalltalk.addMethod(
  1890. '_do_',
  1891. smalltalk.method({
  1892. selector: 'do:',
  1893. category: 'enumerating',
  1894. fn: function (aBlock){
  1895. var self=this;
  1896. (function(){for(var i=0;i<self.length;i++){aBlock(self[i]);}})();
  1897. return self;},
  1898. 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')}),
  1899. smalltalk.Collection);
  1900. smalltalk.addMethod(
  1901. '_collect_',
  1902. smalltalk.method({
  1903. selector: 'collect:',
  1904. category: 'enumerating',
  1905. fn: function (aBlock){
  1906. var self=this;
  1907. var stream=nil;
  1908. stream=self._class()._new()._writeStream();
  1909. self._do_((function(each){return stream._nextPut_(aBlock._value_(each));}));
  1910. return stream._contents();
  1911. return self;},
  1912. 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')}),
  1913. smalltalk.Collection);
  1914. smalltalk.addMethod(
  1915. '_detect_',
  1916. smalltalk.method({
  1917. selector: 'detect:',
  1918. category: 'enumerating',
  1919. fn: function (aBlock){
  1920. var self=this;
  1921. return self._detect_ifNone_(aBlock,(function(){return self._errorNotFound();}));
  1922. return self;},
  1923. source: unescape('detect%3A%20aBlock%0A%09%5Eself%20detect%3A%20aBlock%20ifNone%3A%20%5Bself%20errorNotFound%5D%0A')}),
  1924. smalltalk.Collection);
  1925. smalltalk.addMethod(
  1926. '_detect_ifNone_',
  1927. smalltalk.method({
  1928. selector: 'detect:ifNone:',
  1929. category: 'enumerating',
  1930. fn: function (aBlock, anotherBlock){
  1931. var self=this;
  1932. return (function(){
  1933. for(var i = 0; i < self.length; i++)
  1934. if(aBlock(self[i]))
  1935. return self[i];
  1936. return anotherBlock();
  1937. })();
  1938. return self;},
  1939. source: unescape('detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A%09%5E%7B%27%0A%09for%28var%20i%20%3D%200%3B%20i%20%3C%20self.length%3B%20i++%29%0A%09%09if%28aBlock%28self%5Bi%5D%29%29%0A%09%09%09return%20self%5Bi%5D%3B%0A%09return%20anotherBlock%28%29%3B%0A%09%27%7D%0A')}),
  1940. smalltalk.Collection);
  1941. smalltalk.addMethod(
  1942. '_do_separatedBy_',
  1943. smalltalk.method({
  1944. selector: 'do:separatedBy:',
  1945. category: 'enumerating',
  1946. fn: function (aBlock, anotherBlock){
  1947. var self=this;
  1948. var first=nil;
  1949. first=true;
  1950. self._do_((function(each){first._ifTrue_ifFalse_((function(){return first=false;}),(function(){return anotherBlock._value();}));return aBlock._value_(each);}));
  1951. return self;},
  1952. 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')}),
  1953. smalltalk.Collection);
  1954. smalltalk.addMethod(
  1955. '_inject_into_',
  1956. smalltalk.method({
  1957. selector: 'inject:into:',
  1958. category: 'enumerating',
  1959. fn: function (anObject, aBlock){
  1960. var self=this;
  1961. var result=nil;
  1962. result=anObject;
  1963. self._do_((function(each){return result=aBlock._value_value_(result,each);}));
  1964. return result;
  1965. return self;},
  1966. 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')}),
  1967. smalltalk.Collection);
  1968. smalltalk.addMethod(
  1969. '_reject_',
  1970. smalltalk.method({
  1971. selector: 'reject:',
  1972. category: 'enumerating',
  1973. fn: function (aBlock){
  1974. var self=this;
  1975. return self._select_((function(each){return aBlock._value_(each).__eq(false);}));
  1976. return self;},
  1977. 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')}),
  1978. smalltalk.Collection);
  1979. smalltalk.addMethod(
  1980. '_select_',
  1981. smalltalk.method({
  1982. selector: 'select:',
  1983. category: 'enumerating',
  1984. fn: function (aBlock){
  1985. var self=this;
  1986. var stream=nil;
  1987. stream=self._class()._new()._writeStream();
  1988. self._do_((function(each){return aBlock._value_(each)._ifTrue_((function(){return stream._nextPut_(each);}));}));
  1989. return stream._contents();
  1990. return self;},
  1991. 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')}),
  1992. smalltalk.Collection);
  1993. smalltalk.addMethod(
  1994. '_errorNotFound',
  1995. smalltalk.method({
  1996. selector: 'errorNotFound',
  1997. category: 'error handling',
  1998. fn: function (){
  1999. var self=this;
  2000. self._error_("Object is not in the collection");
  2001. return self;},
  2002. source: unescape('errorNotFound%0A%09self%20error%3A%20%27Object%20is%20not%20in%20the%20collection%27%0A')}),
  2003. smalltalk.Collection);
  2004. smalltalk.addMethod(
  2005. '_includes_',
  2006. smalltalk.method({
  2007. selector: 'includes:',
  2008. category: 'testing',
  2009. fn: function (anObject){
  2010. var self=this;
  2011. return (function(){
  2012. var i = self.length;
  2013. while (i--) {
  2014. if (self[i].__eq(anObject)) {
  2015. return true;
  2016. }
  2017. }
  2018. return false;
  2019. })();
  2020. return self;},
  2021. source: unescape('includes%3A%20anObject%0A%09%5E%7B%27%0A%09%09var%20i%20%3D%20self.length%3B%0A%09%09while%20%28i--%29%20%7B%0A%09%09%09if%20%28self%5Bi%5D.__eq%28anObject%29%29%20%7B%0A%09%09%09%09return%20true%3B%0A%09%09%09%7D%09%0A%09%09%7D%0A%09%09return%20false%3B%0A%0A%09%27%7D%0A')}),
  2022. smalltalk.Collection);
  2023. smalltalk.addMethod(
  2024. '_notEmpty',
  2025. smalltalk.method({
  2026. selector: 'notEmpty',
  2027. category: 'testing',
  2028. fn: function (){
  2029. var self=this;
  2030. return self._isEmpty()._not();
  2031. return self;},
  2032. source: unescape('notEmpty%0A%09%5Eself%20isEmpty%20not%0A')}),
  2033. smalltalk.Collection);
  2034. smalltalk.addMethod(
  2035. '_isEmpty',
  2036. smalltalk.method({
  2037. selector: 'isEmpty',
  2038. category: 'testing',
  2039. fn: function (){
  2040. var self=this;
  2041. return self._size().__eq((0));
  2042. return self;},
  2043. source: unescape('isEmpty%0A%09%5Eself%20size%20%3D%200%0A')}),
  2044. smalltalk.Collection);
  2045. smalltalk.addMethod(
  2046. '_remove_',
  2047. smalltalk.method({
  2048. selector: 'remove:',
  2049. category: 'adding/removing',
  2050. fn: function (anObject){
  2051. var self=this;
  2052. self._subclassResponsibility();
  2053. return self;},
  2054. source: unescape('remove%3A%20anObject%0A%20%20%20%20self%20subclassResponsibility%0A')}),
  2055. smalltalk.Collection);
  2056. smalltalk.addMethod(
  2057. '_streamClass',
  2058. smalltalk.method({
  2059. selector: 'streamClass',
  2060. category: 'accessing',
  2061. fn: function (){
  2062. var self=this;
  2063. return smalltalk.Stream;
  2064. return self;},
  2065. source: unescape('streamClass%0A%09%20%20%20%20%5EStream%0A')}),
  2066. smalltalk.Collection.klass);
  2067. smalltalk.addMethod(
  2068. '_with_',
  2069. smalltalk.method({
  2070. selector: 'with:',
  2071. category: 'instance creation',
  2072. fn: function (anObject){
  2073. var self=this;
  2074. return (function($rec){$rec._add_(anObject);return $rec._yourself();})(self._new());
  2075. return self;},
  2076. source: unescape('with%3A%20anObject%0A%09%20%20%20%20%5Eself%20new%0A%09%09add%3A%20anObject%3B%0A%09%09yourself%0A')}),
  2077. smalltalk.Collection.klass);
  2078. smalltalk.addMethod(
  2079. '_with_with_',
  2080. smalltalk.method({
  2081. selector: 'with:with:',
  2082. category: 'instance creation',
  2083. fn: function (anObject, anotherObject){
  2084. var self=this;
  2085. return (function($rec){$rec._add_(anObject);$rec._add_(anotherObject);return $rec._yourself();})(self._new());
  2086. return self;},
  2087. 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')}),
  2088. smalltalk.Collection.klass);
  2089. smalltalk.addMethod(
  2090. '_with_with_with_',
  2091. smalltalk.method({
  2092. selector: 'with:with:with:',
  2093. category: 'instance creation',
  2094. fn: function (firstObject, secondObject, thirdObject){
  2095. var self=this;
  2096. return (function($rec){$rec._add_(firstObject);$rec._add_(secondObject);$rec._add_(thirdObject);return $rec._yourself();})(self._new());
  2097. return self;},
  2098. 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')}),
  2099. smalltalk.Collection.klass);
  2100. smalltalk.addMethod(
  2101. '_withAll_',
  2102. smalltalk.method({
  2103. selector: 'withAll:',
  2104. category: 'instance creation',
  2105. fn: function (aCollection){
  2106. var self=this;
  2107. return (function($rec){$rec._addAll_(aCollection);return $rec._yourself();})(self._new());
  2108. return self;},
  2109. source: unescape('withAll%3A%20aCollection%0A%09%20%20%20%20%5Eself%20new%0A%09%09addAll%3A%20aCollection%3B%0A%09%09yourself%0A')}),
  2110. smalltalk.Collection.klass);
  2111. smalltalk.addClass('String', smalltalk.Collection, [], 'Kernel');
  2112. smalltalk.addMethod(
  2113. '__eq',
  2114. smalltalk.method({
  2115. selector: '=',
  2116. category: 'comparing',
  2117. fn: function (aString){
  2118. var self=this;
  2119. return (function(){return String(self) == aString})();
  2120. return self;},
  2121. source: unescape('%3D%20aString%0A%09%5E%7B%27return%20String%28self%29%20%3D%3D%20aString%27%7D%0A')}),
  2122. smalltalk.String);
  2123. smalltalk.addMethod(
  2124. '_size',
  2125. smalltalk.method({
  2126. selector: 'size',
  2127. category: 'accessing',
  2128. fn: function (){
  2129. var self=this;
  2130. return (function(){return self.length})();
  2131. return self;},
  2132. source: unescape('size%0A%09%5E%7B%27return%20self.length%27%7D%0A')}),
  2133. smalltalk.String);
  2134. smalltalk.addMethod(
  2135. '_at_',
  2136. smalltalk.method({
  2137. selector: 'at:',
  2138. category: 'accessing',
  2139. fn: function (anIndex){
  2140. var self=this;
  2141. return (function(){return self[anIndex - 1] || nil;})();
  2142. return self;},
  2143. source: unescape('at%3A%20anIndex%0A%20%20%20%20%09%5E%7B%27return%20self%5BanIndex%20-%201%5D%20%7C%7C%20nil%3B%27%7D%0A')}),
  2144. smalltalk.String);
  2145. smalltalk.addMethod(
  2146. '_at_put_',
  2147. smalltalk.method({
  2148. selector: 'at:put:',
  2149. category: 'accessing',
  2150. fn: function (anIndex, anObject){
  2151. var self=this;
  2152. self._errorReadOnly();
  2153. return self;},
  2154. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%20%20%20%20%09self%20errorReadOnly%0A')}),
  2155. smalltalk.String);
  2156. smalltalk.addMethod(
  2157. '_at_ifAbsent_',
  2158. smalltalk.method({
  2159. selector: 'at:ifAbsent:',
  2160. category: 'accessing',
  2161. fn: function (anIndex, aBlock){
  2162. var self=this;
  2163. self._at_(anIndex)._ifNil_((function(){return aBlock;}));
  2164. return self;},
  2165. 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')}),
  2166. smalltalk.String);
  2167. smalltalk.addMethod(
  2168. '_escaped',
  2169. smalltalk.method({
  2170. selector: 'escaped',
  2171. category: 'accessing',
  2172. fn: function (){
  2173. var self=this;
  2174. return (function(){return escape(self)})();
  2175. return self;},
  2176. source: unescape('escaped%0A%09%5E%7B%27return%20escape%28self%29%27%7D%0A')}),
  2177. smalltalk.String);
  2178. smalltalk.addMethod(
  2179. '_unescaped',
  2180. smalltalk.method({
  2181. selector: 'unescaped',
  2182. category: 'accessing',
  2183. fn: function (){
  2184. var self=this;
  2185. return (function(){return unescape(self)})();
  2186. return self;},
  2187. source: unescape('unescaped%0A%09%5E%7B%27return%20unescape%28self%29%27%7D%0A')}),
  2188. smalltalk.String);
  2189. smalltalk.addMethod(
  2190. '_add_',
  2191. smalltalk.method({
  2192. selector: 'add:',
  2193. category: 'adding',
  2194. fn: function (anObject){
  2195. var self=this;
  2196. self._errorReadOnly();
  2197. return self;},
  2198. source: unescape('add%3A%20anObject%0A%20%20%20%20%09self%20errorReadOnly%0A')}),
  2199. smalltalk.String);
  2200. smalltalk.addMethod(
  2201. '__comma',
  2202. smalltalk.method({
  2203. selector: ',',
  2204. category: 'copying',
  2205. fn: function (aString){
  2206. var self=this;
  2207. return (function(){return self + aString})();
  2208. return self;},
  2209. source: unescape('%2C%20aString%0A%20%20%20%20%09%5E%7B%27return%20self%20+%20aString%27%7D%0A')}),
  2210. smalltalk.String);
  2211. smalltalk.addMethod(
  2212. '_copyFrom_to_',
  2213. smalltalk.method({
  2214. selector: 'copyFrom:to:',
  2215. category: 'copying',
  2216. fn: function (anIndex, anotherIndex){
  2217. var self=this;
  2218. return (function(){return self.substring(anIndex - 1, anotherIndex);})();
  2219. return self;},
  2220. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%20%20%20%20%09%5E%7B%27return%20self.substring%28anIndex%20-%201%2C%20anotherIndex%29%3B%27%7D%0A')}),
  2221. smalltalk.String);
  2222. smalltalk.addMethod(
  2223. '_shallowCopy',
  2224. smalltalk.method({
  2225. selector: 'shallowCopy',
  2226. category: 'copying',
  2227. fn: function (){
  2228. var self=this;
  2229. return self._class()._fromString_(self);
  2230. return self;},
  2231. source: unescape('shallowCopy%0A%20%20%20%20%09%5Eself%20class%20fromString%3A%20self%0A')}),
  2232. smalltalk.String);
  2233. smalltalk.addMethod(
  2234. '_deepCopy',
  2235. smalltalk.method({
  2236. selector: 'deepCopy',
  2237. category: 'copying',
  2238. fn: function (){
  2239. var self=this;
  2240. return self._shallowCopy();
  2241. return self;},
  2242. source: unescape('deepCopy%0A%20%20%20%20%09%5Eself%20shallowCopy%0A')}),
  2243. smalltalk.String);
  2244. smalltalk.addMethod(
  2245. '_asSelector',
  2246. smalltalk.method({
  2247. selector: 'asSelector',
  2248. category: 'converting',
  2249. fn: function (){
  2250. var self=this;
  2251. var selector=nil;
  2252. selector="_".__comma(self);
  2253. selector=selector._replace_with_(":","_");
  2254. selector=selector._replace_with_(unescape("%5B+%5D"),"_plus");
  2255. selector=selector._replace_with_(unescape("-"),"_minus");
  2256. selector=selector._replace_with_(unescape("%5B*%5D"),"_star");
  2257. selector=selector._replace_with_(unescape("%5B/%5D"),"_slash");
  2258. selector=selector._replace_with_(unescape("%3E"),"_gt");
  2259. selector=selector._replace_with_(unescape("%3C"),"_lt");
  2260. selector=selector._replace_with_(unescape("%3D"),"_eq");
  2261. selector=selector._replace_with_(unescape("%2C"),"_comma");
  2262. selector=selector._replace_with_(unescape("%5B@%5D"),"_at");
  2263. return selector;
  2264. return self;},
  2265. source: unescape('asSelector%0A%09%7C%20selector%20%7C%0A%09selector%20%3A%3D%20%27_%27%2C%20self.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3A%27%20with%3A%20%27_%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B+%5D%27%20with%3A%20%27_plus%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27-%27%20with%3A%20%27_minus%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B*%5D%27%20with%3A%20%27_star%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B/%5D%27%20with%3A%20%27_slash%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3E%27%20with%3A%20%27_gt%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3C%27%20with%3A%20%27_lt%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%3D%27%20with%3A%20%27_eq%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%2C%27%20with%3A%20%27_comma%27.%0A%20%20%20%20%09selector%20%3A%3D%20selector%20replace%3A%20%27%5B@%5D%27%20with%3A%20%27_at%27.%0A%09%5Eselector%0A')}),
  2266. smalltalk.String);
  2267. smalltalk.addMethod(
  2268. '_asJavascript',
  2269. smalltalk.method({
  2270. selector: 'asJavascript',
  2271. category: 'converting',
  2272. fn: function (){
  2273. var self=this;
  2274. return (function(){
  2275. if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
  2276. return "unescape(\"" + escape(self) + "\")";
  2277. else
  2278. return "\"" + self + "\"";
  2279. })();
  2280. return self;},
  2281. source: unescape('asJavascript%0A%09%5E%7B%27%0A%09if%28self.search%28/%5E%5Ba-zA-Z0-9_%3A.%24%20%5D*%24/%29%20%3D%3D%20-1%29%0A%09%09return%20%22unescape%28%5C%22%22%20+%20escape%28self%29%20+%20%22%5C%22%29%22%3B%0A%09else%0A%09%09return%20%22%5C%22%22%20+%20self%20+%20%22%5C%22%22%3B%0A%09%27%7D%0A')}),
  2282. smalltalk.String);
  2283. smalltalk.addMethod(
  2284. '_replace_with_',
  2285. smalltalk.method({
  2286. selector: 'replace:with:',
  2287. category: 'regular expressions',
  2288. fn: function (aString, anotherString){
  2289. var self=this;
  2290. return self._replaceRegexp_with_(smalltalk.RegularExpression._fromString_flag_(aString,"g"),anotherString);
  2291. return self;},
  2292. 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')}),
  2293. smalltalk.String);
  2294. smalltalk.addMethod(
  2295. '_replaceRegexp_with_',
  2296. smalltalk.method({
  2297. selector: 'replaceRegexp:with:',
  2298. category: 'regular expressions',
  2299. fn: function (aRegexp, aString){
  2300. var self=this;
  2301. return (function(){return self.replace(aRegexp, aString);})();
  2302. return self;},
  2303. source: unescape('replaceRegexp%3A%20aRegexp%20with%3A%20aString%0A%20%20%20%20%09%5E%7B%27return%20self.replace%28aRegexp%2C%20aString%29%3B%27%7D%0A')}),
  2304. smalltalk.String);
  2305. smalltalk.addMethod(
  2306. '_tokenize_',
  2307. smalltalk.method({
  2308. selector: 'tokenize:',
  2309. category: 'converting',
  2310. fn: function (aString){
  2311. var self=this;
  2312. return (function(){return self.split(aString)})();
  2313. return self;},
  2314. source: unescape('tokenize%3A%20aString%0A%09%5E%7B%27return%20self.split%28aString%29%27%7D%0A')}),
  2315. smalltalk.String);
  2316. smalltalk.addMethod(
  2317. '_match_',
  2318. smalltalk.method({
  2319. selector: 'match:',
  2320. category: 'regular expressions',
  2321. fn: function (aRegexp){
  2322. var self=this;
  2323. return (function(){return self.search(aRegexp) != -1})();
  2324. return self;},
  2325. source: unescape('match%3A%20aRegexp%0A%20%20%20%20%09%5E%7B%27return%20self.search%28aRegexp%29%20%21%3D%20-1%27%7D%0A')}),
  2326. smalltalk.String);
  2327. smalltalk.addMethod(
  2328. '_asString',
  2329. smalltalk.method({
  2330. selector: 'asString',
  2331. category: 'converting',
  2332. fn: function (){
  2333. var self=this;
  2334. return self;
  2335. return self;},
  2336. source: unescape('asString%0A%20%20%20%20%09%5Eself%0A')}),
  2337. smalltalk.String);
  2338. smalltalk.addMethod(
  2339. '_asNumber',
  2340. smalltalk.method({
  2341. selector: 'asNumber',
  2342. category: 'converting',
  2343. fn: function (){
  2344. var self=this;
  2345. return (function(){return Number(self);})();
  2346. return self;},
  2347. source: unescape('asNumber%0A%09%5E%7B%27return%20Number%28self%29%3B%27%7D%0A')}),
  2348. smalltalk.String);
  2349. smalltalk.addMethod(
  2350. '_asParser',
  2351. smalltalk.method({
  2352. selector: 'asParser',
  2353. category: 'converting',
  2354. fn: function (){
  2355. var self=this;
  2356. return smalltalk.PPStringParser._new()._string_(self);
  2357. return self;},
  2358. source: unescape('asParser%0A%20%20%20%20%09%5EPPStringParser%20new%20string%3A%20self%0A')}),
  2359. smalltalk.String);
  2360. smalltalk.addMethod(
  2361. '_asChoiceParser',
  2362. smalltalk.method({
  2363. selector: 'asChoiceParser',
  2364. category: 'converting',
  2365. fn: function (){
  2366. var self=this;
  2367. return smalltalk.PPChoiceParser._withAll_(self._asArray()._collect_((function(each){return each._asParser();})));
  2368. return self;},
  2369. 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')}),
  2370. smalltalk.String);
  2371. smalltalk.addMethod(
  2372. '_asCharacterParser',
  2373. smalltalk.method({
  2374. selector: 'asCharacterParser',
  2375. category: 'converting',
  2376. fn: function (){
  2377. var self=this;
  2378. return smalltalk.PPCharacterParser._new()._string_(self);
  2379. return self;},
  2380. source: unescape('asCharacterParser%0A%20%20%20%20%09%5EPPCharacterParser%20new%20string%3A%20self%0A')}),
  2381. smalltalk.String);
  2382. smalltalk.addMethod(
  2383. '_errorReadOnly',
  2384. smalltalk.method({
  2385. selector: 'errorReadOnly',
  2386. category: 'error handling',
  2387. fn: function (){
  2388. var self=this;
  2389. self._error_(unescape("Object%20is%20read-only"));
  2390. return self;},
  2391. source: unescape('errorReadOnly%0A%20%20%20%20%09self%20error%3A%20%27Object%20is%20read-only%27%0A')}),
  2392. smalltalk.String);
  2393. smalltalk.addMethod(
  2394. '_printString',
  2395. smalltalk.method({
  2396. selector: 'printString',
  2397. category: 'printing',
  2398. fn: function (){
  2399. var self=this;
  2400. return unescape("%27").__comma(self).__comma(unescape("%27"));
  2401. return self;},
  2402. source: unescape('printString%0A%20%20%20%20%09%5E%27%27%27%27%2C%20self%2C%20%27%27%27%27%0A')}),
  2403. smalltalk.String);
  2404. smalltalk.addMethod(
  2405. '_printNl',
  2406. smalltalk.method({
  2407. selector: 'printNl',
  2408. category: 'printing',
  2409. fn: function (){
  2410. var self=this;
  2411. (function(){console.log(self)})();
  2412. return self;},
  2413. source: unescape('printNl%0A%09%7B%27console.log%28self%29%27%7D%0A')}),
  2414. smalltalk.String);
  2415. smalltalk.addMethod(
  2416. '_isString',
  2417. smalltalk.method({
  2418. selector: 'isString',
  2419. category: 'testing',
  2420. fn: function (){
  2421. var self=this;
  2422. return true;
  2423. return self;},
  2424. source: unescape('isString%0A%20%20%20%20%09%5Etrue%0A')}),
  2425. smalltalk.String);
  2426. smalltalk.addMethod(
  2427. '_asJQuery',
  2428. smalltalk.method({
  2429. selector: 'asJQuery',
  2430. category: '*JQuery',
  2431. fn: function (){
  2432. var self=this;
  2433. return smalltalk.JQuery._fromString_(self);
  2434. return self;},
  2435. source: unescape('asJQuery%0A%20%20%20%20%5EJQuery%20fromString%3A%20self%0A')}),
  2436. smalltalk.String);
  2437. smalltalk.addMethod(
  2438. '_appendToJQuery_',
  2439. smalltalk.method({
  2440. selector: 'appendToJQuery:',
  2441. category: '*JQuery',
  2442. fn: function (aJQuery){
  2443. var self=this;
  2444. (function(){aJQuery._appendElement_(String(self))})();
  2445. return self;},
  2446. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20%7B%27aJQuery._appendElement_%28String%28self%29%29%27%7D%0A')}),
  2447. smalltalk.String);
  2448. smalltalk.addMethod(
  2449. '_appendToBrush_',
  2450. smalltalk.method({
  2451. selector: 'appendToBrush:',
  2452. category: '*Canvas',
  2453. fn: function (aTagBrush){
  2454. var self=this;
  2455. aTagBrush._appendString_(self);
  2456. return self;},
  2457. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20aTagBrush%20appendString%3A%20self%0A')}),
  2458. smalltalk.String);
  2459. smalltalk.addMethod(
  2460. '__gt',
  2461. smalltalk.method({
  2462. selector: '>',
  2463. category: 'comparing',
  2464. fn: function (aString){
  2465. var self=this;
  2466. return (function(){return String(self) > aString})();
  2467. return self;},
  2468. source: unescape('%3E%20aString%0A%09%5E%7B%27return%20String%28self%29%20%3E%20aString%27%7D%0A')}),
  2469. smalltalk.String);
  2470. smalltalk.addMethod(
  2471. '__lt',
  2472. smalltalk.method({
  2473. selector: '<',
  2474. category: 'comparing',
  2475. fn: function (aString){
  2476. var self=this;
  2477. return (function(){return String(self) < aString})();
  2478. return self;},
  2479. source: unescape('%3C%20aString%0A%09%5E%7B%27return%20String%28self%29%20%3C%20aString%27%7D%0A')}),
  2480. smalltalk.String);
  2481. smalltalk.addMethod(
  2482. '__gt_eq',
  2483. smalltalk.method({
  2484. selector: '>=',
  2485. category: 'comparing',
  2486. fn: function (aString){
  2487. var self=this;
  2488. return (function(){return String(self) >= aString})();
  2489. return self;},
  2490. source: unescape('%3E%3D%20aString%0A%09%5E%7B%27return%20String%28self%29%20%3E%3D%20aString%27%7D%0A')}),
  2491. smalltalk.String);
  2492. smalltalk.addMethod(
  2493. '__lt_eq',
  2494. smalltalk.method({
  2495. selector: '<=',
  2496. category: 'comparing',
  2497. fn: function (aString){
  2498. var self=this;
  2499. return (function(){return String(self) <= aString})();
  2500. return self;},
  2501. source: unescape('%3C%3D%20aString%0A%09%5E%7B%27return%20String%28self%29%20%3C%3D%20aString%27%7D%0A')}),
  2502. smalltalk.String);
  2503. smalltalk.addMethod(
  2504. '_remove_',
  2505. smalltalk.method({
  2506. selector: 'remove:',
  2507. category: 'adding',
  2508. fn: function (anObject){
  2509. var self=this;
  2510. self._errorReadOnly();
  2511. return self;},
  2512. source: unescape('remove%3A%20anObject%0A%20%20%20%20self%20errorReadOnly%0A')}),
  2513. smalltalk.String);
  2514. smalltalk.addMethod(
  2515. '_streamClass',
  2516. smalltalk.method({
  2517. selector: 'streamClass',
  2518. category: 'accessing',
  2519. fn: function (){
  2520. var self=this;
  2521. return smalltalk.StringStream;
  2522. return self;},
  2523. source: unescape('streamClass%0A%09%20%20%20%20%5EStringStream%0A')}),
  2524. smalltalk.String.klass);
  2525. smalltalk.addMethod(
  2526. '_fromString_',
  2527. smalltalk.method({
  2528. selector: 'fromString:',
  2529. category: 'instance creation',
  2530. fn: function (aString){
  2531. var self=this;
  2532. return (function(){return new self.fn(aString);})();
  2533. return self;},
  2534. source: unescape('fromString%3A%20aString%0A%09%20%20%20%20%5E%7B%27return%20new%20self.fn%28aString%29%3B%27%7D%0A')}),
  2535. smalltalk.String.klass);
  2536. smalltalk.addMethod(
  2537. '_cr',
  2538. smalltalk.method({
  2539. selector: 'cr',
  2540. category: 'accessing',
  2541. fn: function (){
  2542. var self=this;
  2543. return (function(){{return '\n'};})();
  2544. return self;},
  2545. source: unescape('cr%0A%09%20%20%20%20%5E%7B%27%7Breturn%20%27%27%5Cn%27%27%7D%3B%27%7D%0A')}),
  2546. smalltalk.String.klass);
  2547. smalltalk.addMethod(
  2548. '_lf',
  2549. smalltalk.method({
  2550. selector: 'lf',
  2551. category: 'accessing',
  2552. fn: function (){
  2553. var self=this;
  2554. return (function(){return '\r';})();
  2555. return self;},
  2556. source: unescape('lf%0A%09%20%20%20%20%5E%7B%27return%20%27%27%5Cr%27%27%3B%27%7D%0A')}),
  2557. smalltalk.String.klass);
  2558. smalltalk.addMethod(
  2559. '_space',
  2560. smalltalk.method({
  2561. selector: 'space',
  2562. category: 'accessing',
  2563. fn: function (){
  2564. var self=this;
  2565. return (function(){return ' ';})();
  2566. return self;},
  2567. source: unescape('space%0A%09%20%20%20%20%5E%7B%27return%20%27%27%20%27%27%3B%27%7D%0A')}),
  2568. smalltalk.String.klass);
  2569. smalltalk.addMethod(
  2570. '_tab',
  2571. smalltalk.method({
  2572. selector: 'tab',
  2573. category: 'accessing',
  2574. fn: function (){
  2575. var self=this;
  2576. return (function(){return '\t';})();
  2577. return self;},
  2578. source: unescape('tab%0A%09%20%20%20%20%5E%7B%27return%20%27%27%5Ct%27%27%3B%27%7D%0A')}),
  2579. smalltalk.String.klass);
  2580. smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel');
  2581. smalltalk.addMethod(
  2582. '_compile_',
  2583. smalltalk.method({
  2584. selector: 'compile:',
  2585. category: 'evaluating',
  2586. fn: function (aString){
  2587. var self=this;
  2588. return (function(){return self.compile(aString);})();
  2589. return self;},
  2590. source: unescape('compile%3A%20aString%0A%09%5E%7B%27return%20self.compile%28aString%29%3B%27%7D%0A')}),
  2591. smalltalk.RegularExpression);
  2592. smalltalk.addMethod(
  2593. '_exec_',
  2594. smalltalk.method({
  2595. selector: 'exec:',
  2596. category: 'evaluating',
  2597. fn: function (aString){
  2598. var self=this;
  2599. return (function(){return self.exec(aString);})();
  2600. return self;},
  2601. source: unescape('exec%3A%20aString%0A%09%5E%7B%27return%20self.exec%28aString%29%3B%27%7D%0A')}),
  2602. smalltalk.RegularExpression);
  2603. smalltalk.addMethod(
  2604. '_test_',
  2605. smalltalk.method({
  2606. selector: 'test:',
  2607. category: 'evaluating',
  2608. fn: function (aString){
  2609. var self=this;
  2610. return (function(){return self.test(aString);})();
  2611. return self;},
  2612. source: unescape('test%3A%20aString%0A%09%5E%7B%27return%20self.test%28aString%29%3B%27%7D%0A')}),
  2613. smalltalk.RegularExpression);
  2614. smalltalk.addMethod(
  2615. '_fromString_flag_',
  2616. smalltalk.method({
  2617. selector: 'fromString:flag:',
  2618. category: 'instance creation',
  2619. fn: function (aString, anotherString){
  2620. var self=this;
  2621. return (function(){return new RegExp(aString, anotherString);})();
  2622. return self;},
  2623. source: unescape('fromString%3A%20aString%20flag%3A%20anotherString%0A%09%20%20%20%20%5E%7B%27return%20new%20RegExp%28aString%2C%20anotherString%29%3B%27%7D%0A')}),
  2624. smalltalk.RegularExpression.klass);
  2625. smalltalk.addMethod(
  2626. '_fromString_',
  2627. smalltalk.method({
  2628. selector: 'fromString:',
  2629. category: 'instance creation',
  2630. fn: function (aString){
  2631. var self=this;
  2632. return self._fromString_flag_(aString,"");
  2633. return self;},
  2634. source: unescape('fromString%3A%20aString%0A%09%20%20%20%20%5Eself%20fromString%3A%20aString%20flag%3A%20%27%27%0A')}),
  2635. smalltalk.RegularExpression.klass);
  2636. smalltalk.addClass('Array', smalltalk.Collection, [], 'Kernel');
  2637. smalltalk.addMethod(
  2638. '_size',
  2639. smalltalk.method({
  2640. selector: 'size',
  2641. category: 'accessing',
  2642. fn: function (){
  2643. var self=this;
  2644. return (function(){return self.length})();
  2645. return self;},
  2646. source: unescape('size%0A%09%5E%7B%27return%20self.length%27%7D%0A')}),
  2647. smalltalk.Array);
  2648. smalltalk.addMethod(
  2649. '_at_put_',
  2650. smalltalk.method({
  2651. selector: 'at:put:',
  2652. category: 'accessing',
  2653. fn: function (anIndex, anObject){
  2654. var self=this;
  2655. return (function(){return self[anIndex - 1] = anObject})();
  2656. return self;},
  2657. source: unescape('at%3A%20anIndex%20put%3A%20anObject%0A%09%5E%7B%27return%20self%5BanIndex%20-%201%5D%20%3D%20anObject%27%7D%0A')}),
  2658. smalltalk.Array);
  2659. smalltalk.addMethod(
  2660. '_at_ifAbsent_',
  2661. smalltalk.method({
  2662. selector: 'at:ifAbsent:',
  2663. category: 'accessing',
  2664. fn: function (anIndex, aBlock){
  2665. var self=this;
  2666. return (function(){
  2667. var value = self[anIndex - 1];
  2668. if(value === undefined) {
  2669. return aBlock();
  2670. } else {
  2671. return value;
  2672. }
  2673. })();
  2674. return self;},
  2675. source: unescape('at%3A%20anIndex%20ifAbsent%3A%20aBlock%0A%09%5E%7B%27%0A%09%20%20%20%20var%20value%20%3D%20self%5BanIndex%20-%201%5D%3B%0A%09%20%20%20%20if%28value%20%3D%3D%3D%20undefined%29%20%7B%0A%09%09return%20aBlock%28%29%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20value%3B%0A%09%20%20%20%20%7D%0A%09%27%7D%0A')}),
  2676. smalltalk.Array);
  2677. smalltalk.addMethod(
  2678. '_add_',
  2679. smalltalk.method({
  2680. selector: 'add:',
  2681. category: 'adding',
  2682. fn: function (anObject){
  2683. var self=this;
  2684. return (function(){self.push(anObject); return anObject;})();
  2685. return self;},
  2686. source: unescape('add%3A%20anObject%0A%09%5E%7B%27self.push%28anObject%29%3B%20return%20anObject%3B%27%7D%0A')}),
  2687. smalltalk.Array);
  2688. smalltalk.addMethod(
  2689. '_addLast_',
  2690. smalltalk.method({
  2691. selector: 'addLast:',
  2692. category: 'adding',
  2693. fn: function (anObject){
  2694. var self=this;
  2695. return self._add_(anObject);
  2696. return self;},
  2697. source: unescape('addLast%3A%20anObject%0A%09%5Eself%20add%3A%20anObject%0A')}),
  2698. smalltalk.Array);
  2699. smalltalk.addMethod(
  2700. '_shallowCopy',
  2701. smalltalk.method({
  2702. selector: 'shallowCopy',
  2703. category: 'copying',
  2704. fn: function (){
  2705. var self=this;
  2706. var newCollection=nil;
  2707. newCollection=self._class()._new();
  2708. self._do_((function(each){return newCollection._add_(each);}));
  2709. return newCollection;
  2710. return self;},
  2711. 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')}),
  2712. smalltalk.Array);
  2713. smalltalk.addMethod(
  2714. '_deepCopy',
  2715. smalltalk.method({
  2716. selector: 'deepCopy',
  2717. category: 'copying',
  2718. fn: function (){
  2719. var self=this;
  2720. var newCollection=nil;
  2721. newCollection=self._class()._new();
  2722. self._do_((function(each){return newCollection._add_(each._deepCopy());}));
  2723. return newCollection;
  2724. return self;},
  2725. 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')}),
  2726. smalltalk.Array);
  2727. smalltalk.addMethod(
  2728. '_copyFrom_to_',
  2729. smalltalk.method({
  2730. selector: 'copyFrom:to:',
  2731. category: 'copying',
  2732. fn: function (anIndex, anotherIndex){
  2733. var self=this;
  2734. var array=nil;
  2735. array=self._class()._new();
  2736. anIndex._to_do_(anotherIndex,(function(each){return array._add_(self._at_(each));}));
  2737. return array;
  2738. return self;},
  2739. 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')}),
  2740. smalltalk.Array);
  2741. smalltalk.addMethod(
  2742. '_join_',
  2743. smalltalk.method({
  2744. selector: 'join:',
  2745. category: 'enumerating',
  2746. fn: function (aString){
  2747. var self=this;
  2748. return (function(){return self.join(aString);})();
  2749. return self;},
  2750. source: unescape('join%3A%20aString%0A%09%5E%7B%27return%20self.join%28aString%29%3B%27%7D%0A')}),
  2751. smalltalk.Array);
  2752. smalltalk.addMethod(
  2753. '_asJavascript',
  2754. smalltalk.method({
  2755. selector: 'asJavascript',
  2756. category: 'converting',
  2757. fn: function (){
  2758. var self=this;
  2759. return unescape("%5B").__comma(self._collect_((function(each){return each._asJavascript();}))._join_(unescape("%2C%20"))).__comma(unescape("%5D"));
  2760. return self;},
  2761. 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')}),
  2762. smalltalk.Array);
  2763. smalltalk.addMethod(
  2764. '_sort',
  2765. smalltalk.method({
  2766. selector: 'sort',
  2767. category: 'enumerating',
  2768. fn: function (){
  2769. var self=this;
  2770. return self._copy()._basicPerform_("sort");
  2771. return self;},
  2772. source: unescape('sort%0A%20%20%20%20%5Eself%20copy%20basicPerform%3A%20%27sort%27%0A')}),
  2773. smalltalk.Array);
  2774. smalltalk.addMethod(
  2775. '_sort_',
  2776. smalltalk.method({
  2777. selector: 'sort:',
  2778. category: 'enumerating',
  2779. fn: function (aBlock){
  2780. var self=this;
  2781. return self._copy()._basicPerform_withArguments_("sort",smalltalk.Array._with_(aBlock));
  2782. return self;},
  2783. source: unescape('sort%3A%20aBlock%0A%20%20%20%20%5Eself%20copy%20basicPerform%3A%20%27sort%27%20withArguments%3A%20%28Array%20with%3A%20aBlock%29%0A')}),
  2784. smalltalk.Array);
  2785. smalltalk.addMethod(
  2786. '_remove_',
  2787. smalltalk.method({
  2788. selector: 'remove:',
  2789. category: 'adding',
  2790. fn: function (anObject){
  2791. var self=this;
  2792. (function(){for(var i=0;i<self.length;i++) {
  2793. if(self[i] == anObject) {
  2794. self.splice(i,1);
  2795. break;
  2796. }
  2797. }})();
  2798. return self;},
  2799. source: unescape('remove%3A%20anObject%0A%20%20%20%20%7B%27for%28var%20i%3D0%3Bi%3Cself.length%3Bi++%29%20%7B%0A%09if%28self%5Bi%5D%20%3D%3D%20anObject%29%20%7B%0A%09%09self.splice%28i%2C1%29%3B%0A%09%09break%3B%0A%09%7D%0A%20%20%20%20%7D%27%7D%0A')}),
  2800. smalltalk.Array);
  2801. smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel');
  2802. smalltalk.addMethod(
  2803. '_messageText',
  2804. smalltalk.method({
  2805. selector: 'messageText',
  2806. category: 'accessing',
  2807. fn: function (){
  2808. var self=this;
  2809. return self['@messageText'];
  2810. return self;},
  2811. source: unescape('messageText%0A%09%5EmessageText%0A')}),
  2812. smalltalk.Error);
  2813. smalltalk.addMethod(
  2814. '_messageText_',
  2815. smalltalk.method({
  2816. selector: 'messageText:',
  2817. category: 'accessing',
  2818. fn: function (aString){
  2819. var self=this;
  2820. self['@messageText']=aString;
  2821. return self;},
  2822. source: unescape('messageText%3A%20aString%0A%09messageText%20%3A%3D%20aString%0A')}),
  2823. smalltalk.Error);
  2824. smalltalk.addMethod(
  2825. '_signal',
  2826. smalltalk.method({
  2827. selector: 'signal',
  2828. category: 'signaling',
  2829. fn: function (){
  2830. var self=this;
  2831. return (function(){throw({smalltalkError: self})})();
  2832. return self;},
  2833. source: unescape('signal%0A%09%5E%7B%27throw%28%7BsmalltalkError%3A%20self%7D%29%27%7D%0A')}),
  2834. smalltalk.Error);
  2835. smalltalk.addMethod(
  2836. '_signal_',
  2837. smalltalk.method({
  2838. selector: 'signal:',
  2839. category: 'instance creation',
  2840. fn: function (aString){
  2841. var self=this;
  2842. return (function($rec){$rec._messageText_(aString);return $rec._signal();})(self._new());
  2843. return self;},
  2844. source: unescape('signal%3A%20aString%0A%09%20%20%20%20%5Eself%20new%0A%09%09messageText%3A%20aString%3B%0A%09%09signal%0A')}),
  2845. smalltalk.Error.klass);
  2846. smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel');
  2847. smalltalk.addMethod(
  2848. '__eq',
  2849. smalltalk.method({
  2850. selector: '=',
  2851. category: 'comparing',
  2852. fn: function (anAssociation){
  2853. var self=this;
  2854. return self._class().__eq(anAssociation._class())._and_((function(){return self._key().__eq(anAssociation._key())._and_((function(){return self._value().__eq(anAssociation._value());}));}));
  2855. return self;},
  2856. 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')}),
  2857. smalltalk.Association);
  2858. smalltalk.addMethod(
  2859. '_key_',
  2860. smalltalk.method({
  2861. selector: 'key:',
  2862. category: 'accessing',
  2863. fn: function (aKey){
  2864. var self=this;
  2865. self['@key']=aKey;
  2866. return self;},
  2867. source: unescape('key%3A%20aKey%0A%09key%20%3A%3D%20aKey%0A')}),
  2868. smalltalk.Association);
  2869. smalltalk.addMethod(
  2870. '_key',
  2871. smalltalk.method({
  2872. selector: 'key',
  2873. category: 'accessing',
  2874. fn: function (){
  2875. var self=this;
  2876. return self['@key'];
  2877. return self;},
  2878. source: unescape('key%0A%09%5Ekey%0A')}),
  2879. smalltalk.Association);
  2880. smalltalk.addMethod(
  2881. '_value_',
  2882. smalltalk.method({
  2883. selector: 'value:',
  2884. category: 'accessing',
  2885. fn: function (aValue){
  2886. var self=this;
  2887. self['@value']=aValue;
  2888. return self;},
  2889. source: unescape('value%3A%20aValue%0A%09value%20%3A%3D%20aValue%0A')}),
  2890. smalltalk.Association);
  2891. smalltalk.addMethod(
  2892. '_value',
  2893. smalltalk.method({
  2894. selector: 'value',
  2895. category: 'accessing',
  2896. fn: function (){
  2897. var self=this;
  2898. return self['@value'];
  2899. return self;},
  2900. source: unescape('value%0A%09%5Evalue%0A')}),
  2901. smalltalk.Association);
  2902. smalltalk.addMethod(
  2903. '_key_value_',
  2904. smalltalk.method({
  2905. selector: 'key:value:',
  2906. category: 'instance creation',
  2907. fn: function (aKey, aValue){
  2908. var self=this;
  2909. return (function($rec){$rec._key_(aKey);$rec._value_(aValue);return $rec._yourself();})(self._new());
  2910. return self;},
  2911. 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')}),
  2912. smalltalk.Association.klass);
  2913. smalltalk.addClass('Dictionary', smalltalk.Collection, ['keys'], 'Kernel');
  2914. smalltalk.addMethod(
  2915. '__eq',
  2916. smalltalk.method({
  2917. selector: '=',
  2918. category: 'comparing',
  2919. fn: function (aDictionary){
  2920. var self=this;
  2921. try{self._class().__eq(aDictionary._class())._ifFalse_((function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();}));
  2922. self._associationsDo_((function(assoc){return aDictionary._at_ifAbsent_(assoc._key(),(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})).__eq(assoc._value())._ifFalse_((function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();}));}));
  2923. (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return true}})})();
  2924. return self;
  2925. } catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}},
  2926. 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')}),
  2927. smalltalk.Dictionary);
  2928. smalltalk.addMethod(
  2929. '_shallowCopy',
  2930. smalltalk.method({
  2931. selector: 'shallowCopy',
  2932. category: 'copying',
  2933. fn: function (){
  2934. var self=this;
  2935. var copy=nil;
  2936. copy=self._class()._new();
  2937. self._associationsDo_((function(each){return copy._at_put_(each._key(),each._value());}));
  2938. return copy;
  2939. return self;},
  2940. 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')}),
  2941. smalltalk.Dictionary);
  2942. smalltalk.addMethod(
  2943. '_initialize',
  2944. smalltalk.method({
  2945. selector: 'initialize',
  2946. category: 'initialization',
  2947. fn: function (){
  2948. var self=this;
  2949. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  2950. self['@keys']=[];
  2951. return self;},
  2952. source: unescape('initialize%0A%20%20%20%20%09super%20initialize.%0A%20%20%20%20%09keys%20%3A%3D%20%23%28%29%0A')}),
  2953. smalltalk.Dictionary);
  2954. smalltalk.addMethod(
  2955. '_size',
  2956. smalltalk.method({
  2957. selector: 'size',
  2958. category: 'accessing',
  2959. fn: function (){
  2960. var self=this;
  2961. return self['@keys']._size();
  2962. return self;},
  2963. source: unescape('size%0A%09%5Ekeys%20size%0A')}),
  2964. smalltalk.Dictionary);
  2965. smalltalk.addMethod(
  2966. '_associations',
  2967. smalltalk.method({
  2968. selector: 'associations',
  2969. category: 'accessing',
  2970. fn: function (){
  2971. var self=this;
  2972. var associations=nil;
  2973. associations=[];
  2974. self['@keys']._do_((function(each){return associations._add_(smalltalk.Association._key_value_(each,self._at_(each)));}));
  2975. return associations;
  2976. return self;},
  2977. 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')}),
  2978. smalltalk.Dictionary);
  2979. smalltalk.addMethod(
  2980. '_keys',
  2981. smalltalk.method({
  2982. selector: 'keys',
  2983. category: 'accessing',
  2984. fn: function (){
  2985. var self=this;
  2986. return self['@keys']._copy();
  2987. return self;},
  2988. source: unescape('keys%0A%09%5Ekeys%20copy%0A')}),
  2989. smalltalk.Dictionary);
  2990. smalltalk.addMethod(
  2991. '_values',
  2992. smalltalk.method({
  2993. selector: 'values',
  2994. category: 'accessing',
  2995. fn: function (){
  2996. var self=this;
  2997. return self['@keys']._collect_((function(each){return self._at_(each);}));
  2998. return self;},
  2999. source: unescape('values%0A%20%20%20%20%09%5Ekeys%20collect%3A%20%5B%3Aeach%20%7C%20self%20at%3A%20each%5D%0A')}),
  3000. smalltalk.Dictionary);
  3001. smalltalk.addMethod(
  3002. '_at_put_',
  3003. smalltalk.method({
  3004. selector: 'at:put:',
  3005. category: 'accessing',
  3006. fn: function (aKey, aValue){
  3007. var self=this;
  3008. self['@keys']._includes_(aKey)._ifFalse_((function(){return self['@keys']._add_(aKey);}));
  3009. return self._basicAt_put_(aKey,aValue);
  3010. return self;},
  3011. 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')}),
  3012. smalltalk.Dictionary);
  3013. smalltalk.addMethod(
  3014. '_at_ifAbsent_',
  3015. smalltalk.method({
  3016. selector: 'at:ifAbsent:',
  3017. category: 'accessing',
  3018. fn: function (aKey, aBlock){
  3019. var self=this;
  3020. return self._basicAt_(aKey)._ifNil_(aBlock);
  3021. return self;},
  3022. source: unescape('at%3A%20aKey%20ifAbsent%3A%20aBlock%0A%09%5E%28self%20basicAt%3A%20aKey%29%20ifNil%3A%20aBlock%0A')}),
  3023. smalltalk.Dictionary);
  3024. smalltalk.addMethod(
  3025. '_at_ifAbsentPut_',
  3026. smalltalk.method({
  3027. selector: 'at:ifAbsentPut:',
  3028. category: 'accessing',
  3029. fn: function (aKey, aBlock){
  3030. var self=this;
  3031. return self._at_ifAbsent_(aKey,(function(){return self._at_put_(aKey,aBlock._value());}));
  3032. return self;},
  3033. 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')}),
  3034. smalltalk.Dictionary);
  3035. smalltalk.addMethod(
  3036. '_at_ifPresent_',
  3037. smalltalk.method({
  3038. selector: 'at:ifPresent:',
  3039. category: 'accessing',
  3040. fn: function (aKey, aBlock){
  3041. var self=this;
  3042. return self._basicAt_(aKey)._ifNotNil_((function(){return aBlock._value_(self._at_(aKey));}));
  3043. return self;},
  3044. 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')}),
  3045. smalltalk.Dictionary);
  3046. smalltalk.addMethod(
  3047. '_at_ifPresent_ifAbsent_',
  3048. smalltalk.method({
  3049. selector: 'at:ifPresent:ifAbsent:',
  3050. category: 'accessing',
  3051. fn: function (aKey, aBlock, anotherBlock){
  3052. var self=this;
  3053. return self._basicAt_(aKey)._ifNil_ifNotNil_(anotherBlock,(function(){return aBlock._value_(self._at_(aKey));}));
  3054. return self;},
  3055. 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')}),
  3056. smalltalk.Dictionary);
  3057. smalltalk.addMethod(
  3058. '_add_',
  3059. smalltalk.method({
  3060. selector: 'add:',
  3061. category: 'adding/removing',
  3062. fn: function (anAssociation){
  3063. var self=this;
  3064. self._at_put_(anAssociation._key(),anAssociation._value());
  3065. return self;},
  3066. source: unescape('add%3A%20anAssociation%0A%20%20%20%20%09self%20at%3A%20anAssociation%20key%20put%3A%20anAssociation%20value%0A')}),
  3067. smalltalk.Dictionary);
  3068. smalltalk.addMethod(
  3069. '_addAll_',
  3070. smalltalk.method({
  3071. selector: 'addAll:',
  3072. category: 'adding/removing',
  3073. fn: function (aDictionary){
  3074. var self=this;
  3075. self.klass.superclass.fn.prototype['_addAll_'].apply(self, [aDictionary._associations()]);
  3076. return aDictionary;
  3077. return self;},
  3078. source: unescape('addAll%3A%20aDictionary%0A%20%20%20%20%09super%20addAll%3A%20aDictionary%20associations.%0A%20%20%20%20%09%5EaDictionary%0A')}),
  3079. smalltalk.Dictionary);
  3080. smalltalk.addMethod(
  3081. '__comma',
  3082. smalltalk.method({
  3083. selector: ',',
  3084. category: 'copying',
  3085. fn: function (aCollection){
  3086. var self=this;
  3087. self._shouldNotImplement();
  3088. return self;},
  3089. source: unescape('%2C%20aCollection%0A%09self%20shouldNotImplement%0A')}),
  3090. smalltalk.Dictionary);
  3091. smalltalk.addMethod(
  3092. '_copyFrom_to_',
  3093. smalltalk.method({
  3094. selector: 'copyFrom:to:',
  3095. category: 'copying',
  3096. fn: function (anIndex, anotherIndex){
  3097. var self=this;
  3098. self._shouldNotImplement();
  3099. return self;},
  3100. source: unescape('copyFrom%3A%20anIndex%20to%3A%20anotherIndex%0A%09self%20shouldNotImplement%0A')}),
  3101. smalltalk.Dictionary);
  3102. smalltalk.addMethod(
  3103. '_associationsDo_',
  3104. smalltalk.method({
  3105. selector: 'associationsDo:',
  3106. category: 'enumerating',
  3107. fn: function (aBlock){
  3108. var self=this;
  3109. self._associations()._do_(aBlock);
  3110. return self;},
  3111. source: unescape('associationsDo%3A%20aBlock%0A%20%20%20%20%09self%20associations%20do%3A%20aBlock%0A')}),
  3112. smalltalk.Dictionary);
  3113. smalltalk.addMethod(
  3114. '_keysAndValuesDo_',
  3115. smalltalk.method({
  3116. selector: 'keysAndValuesDo:',
  3117. category: 'enumerating',
  3118. fn: function (aBlock){
  3119. var self=this;
  3120. self._associationsDo_((function(each){return aBlock._value_value_(each._key(),each._value());}));
  3121. return self;},
  3122. 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')}),
  3123. smalltalk.Dictionary);
  3124. smalltalk.addMethod(
  3125. '_do_',
  3126. smalltalk.method({
  3127. selector: 'do:',
  3128. category: 'enumerating',
  3129. fn: function (aBlock){
  3130. var self=this;
  3131. self._values()._do_(aBlock);
  3132. return self;},
  3133. source: unescape('do%3A%20aBlock%0A%20%20%20%20%09self%20values%20do%3A%20aBlock%0A')}),
  3134. smalltalk.Dictionary);
  3135. smalltalk.addMethod(
  3136. '_select_',
  3137. smalltalk.method({
  3138. selector: 'select:',
  3139. category: 'enumerating',
  3140. fn: function (aBlock){
  3141. var self=this;
  3142. var newDict=nil;
  3143. newDict=self._class()._new();
  3144. self._keysAndValuesDo_((function(key, value){return aBlock._value_(value)._ifTrue_((function(){return newDict._at_put_(key,value);}));}));
  3145. return newDict;
  3146. return self;},
  3147. 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')}),
  3148. smalltalk.Dictionary);
  3149. smalltalk.addMethod(
  3150. '_collect_',
  3151. smalltalk.method({
  3152. selector: 'collect:',
  3153. category: 'enumerating',
  3154. fn: function (aBlock){
  3155. var self=this;
  3156. var newDict=nil;
  3157. newDict=self._class()._new();
  3158. self._keysAndValuesDo_((function(key, value){return aBlock._value_(value)._ifTrue_((function(){return newDict._at_put_(key,value);}));}));
  3159. return newDict;
  3160. return self;},
  3161. 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')}),
  3162. smalltalk.Dictionary);
  3163. smalltalk.addMethod(
  3164. '_detect_ifNone_',
  3165. smalltalk.method({
  3166. selector: 'detect:ifNone:',
  3167. category: 'enumerating',
  3168. fn: function (aBlock, anotherBlock){
  3169. var self=this;
  3170. return self._values()._detect_ifNone_(aBlock,anotherBlock);
  3171. return self;},
  3172. source: unescape('detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A%09%5Eself%20values%20detect%3A%20aBlock%20ifNone%3A%20anotherBlock%0A')}),
  3173. smalltalk.Dictionary);
  3174. smalltalk.addMethod(
  3175. '_includes_',
  3176. smalltalk.method({
  3177. selector: 'includes:',
  3178. category: 'enumerating',
  3179. fn: function (anObject){
  3180. var self=this;
  3181. return self._values()._includes_(anObject);
  3182. return self;},
  3183. source: unescape('includes%3A%20anObject%0A%09%5Eself%20values%20includes%3A%20anObject%0A')}),
  3184. smalltalk.Dictionary);
  3185. smalltalk.addMethod(
  3186. '_remove_',
  3187. smalltalk.method({
  3188. selector: 'remove:',
  3189. category: 'adding/removing',
  3190. fn: function (aKey){
  3191. var self=this;
  3192. self._removeKey_(aKey);
  3193. return self;},
  3194. source: unescape('remove%3A%20aKey%0A%20%20%20%20self%20removeKey%3A%20aKey%0A')}),
  3195. smalltalk.Dictionary);
  3196. smalltalk.addMethod(
  3197. '_removeKey_',
  3198. smalltalk.method({
  3199. selector: 'removeKey:',
  3200. category: 'adding/removing',
  3201. fn: function (aKey){
  3202. var self=this;
  3203. self['@keys']._remove_(aKey);
  3204. return self;},
  3205. source: unescape('removeKey%3A%20aKey%0A%20%20%20%20keys%20remove%3A%20aKey%0A')}),
  3206. smalltalk.Dictionary);
  3207. smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel');
  3208. smalltalk.addMethod(
  3209. '_superclass_subclass_',
  3210. smalltalk.method({
  3211. selector: 'superclass:subclass:',
  3212. category: 'class creation',
  3213. fn: function (aClass, aString){
  3214. var self=this;
  3215. self._superclass_subclass_instanceVariableNames_category_(aClass,aString,"",nil);
  3216. return self;},
  3217. 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')}),
  3218. smalltalk.ClassBuilder);
  3219. smalltalk.addMethod(
  3220. '_superclass_subclass_instanceVariableNames_category_',
  3221. smalltalk.method({
  3222. selector: 'superclass:subclass:instanceVariableNames:category:',
  3223. category: 'class creation',
  3224. fn: function (aClass, aString, aString2, aString3){
  3225. var self=this;
  3226. var newClass=nil;
  3227. newClass=self._addSubclassOf_named_instanceVariableNames_(aClass,aString,self._instanceVariableNamesFor_(aString2));
  3228. self._setupClass_(newClass);
  3229. newClass._category_(aString3._ifNil_((function(){return "unclassified";})));
  3230. return self;},
  3231. 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')}),
  3232. smalltalk.ClassBuilder);
  3233. smalltalk.addMethod(
  3234. '_class_instanceVariableNames_',
  3235. smalltalk.method({
  3236. selector: 'class:instanceVariableNames:',
  3237. category: 'class creation',
  3238. fn: function (aClass, aString){
  3239. var self=this;
  3240. aClass._isMetaclass()._ifFalse_((function(){return self._error_(aClass._name().__comma(" is not a metaclass"));}));
  3241. aClass._basicAt_put_("iVarNames",self._instanceVariableNamesFor_(aString));
  3242. self._setupClass_(aClass);
  3243. return self;},
  3244. 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')}),
  3245. smalltalk.ClassBuilder);
  3246. smalltalk.addMethod(
  3247. '_instanceVariableNamesFor_',
  3248. smalltalk.method({
  3249. selector: 'instanceVariableNamesFor:',
  3250. category: 'private',
  3251. fn: function (aString){
  3252. var self=this;
  3253. return aString._tokenize_(" ")._reject_((function(each){return each._isEmpty();}));
  3254. return self;},
  3255. 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')}),
  3256. smalltalk.ClassBuilder);
  3257. smalltalk.addMethod(
  3258. '_addSubclassOf_named_instanceVariableNames_',
  3259. smalltalk.method({
  3260. selector: 'addSubclassOf:named:instanceVariableNames:',
  3261. category: 'private',
  3262. fn: function (aClass, aString, aCollection){
  3263. var self=this;
  3264. return (function(){smalltalk.addClass(aString, aClass, aCollection);
  3265. return smalltalk[aString]})();
  3266. return self;},
  3267. source: unescape('addSubclassOf%3A%20aClass%20named%3A%20aString%20instanceVariableNames%3A%20aCollection%0A%09%5E%7B%27smalltalk.addClass%28aString%2C%20aClass%2C%20aCollection%29%3B%0A%09%20%20%20%20return%20smalltalk%5BaString%5D%27%7D%0A')}),
  3268. smalltalk.ClassBuilder);
  3269. smalltalk.addMethod(
  3270. '_setupClass_',
  3271. smalltalk.method({
  3272. selector: 'setupClass:',
  3273. category: 'private',
  3274. fn: function (aClass){
  3275. var self=this;
  3276. (function(){smalltalk.init(aClass);})();
  3277. return self;},
  3278. source: unescape('setupClass%3A%20aClass%0A%09%7B%27smalltalk.init%28aClass%29%3B%27%7D%0A')}),
  3279. smalltalk.ClassBuilder);
  3280. smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category', 'chunkParser'], 'Kernel');
  3281. smalltalk.addMethod(
  3282. '_initialize',
  3283. smalltalk.method({
  3284. selector: 'initialize',
  3285. category: 'initialization',
  3286. fn: function (){
  3287. var self=this;
  3288. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  3289. self['@chunkParser']=smalltalk.ChunkParser._new();
  3290. return self;},
  3291. source: unescape('initialize%0A%09super%20initialize.%0A%09chunkParser%20%3A%3D%20ChunkParser%20new.%0A')}),
  3292. smalltalk.ClassCategoryReader);
  3293. smalltalk.addMethod(
  3294. '_class_category_',
  3295. smalltalk.method({
  3296. selector: 'class:category:',
  3297. category: 'accessing',
  3298. fn: function (aClass, aString){
  3299. var self=this;
  3300. self['@class']=aClass;
  3301. self['@category']=aString;
  3302. return self;},
  3303. source: unescape('class%3A%20aClass%20category%3A%20aString%0A%09class%20%3A%3D%20aClass.%0A%09category%20%3A%3D%20aString%0A')}),
  3304. smalltalk.ClassCategoryReader);
  3305. smalltalk.addMethod(
  3306. '_scanFrom_',
  3307. smalltalk.method({
  3308. selector: 'scanFrom:',
  3309. category: 'fileIn',
  3310. fn: function (aStream){
  3311. var self=this;
  3312. var nextChunk=nil;
  3313. nextChunk=self['@chunkParser']._emptyChunk().__slash(self['@chunkParser']._chunk())._parse_(aStream);
  3314. nextChunk._isEmptyChunk()._ifFalse_((function(){self._compileMethod_(nextChunk._contents());return self._scanFrom_(aStream);}));
  3315. return self;},
  3316. 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')}),
  3317. smalltalk.ClassCategoryReader);
  3318. smalltalk.addMethod(
  3319. '_compileMethod_',
  3320. smalltalk.method({
  3321. selector: 'compileMethod:',
  3322. category: 'private',
  3323. fn: function (aString){
  3324. var self=this;
  3325. var method=nil;
  3326. method=smalltalk.Compiler._new()._load_forClass_(aString,self['@class']);
  3327. method._category_(self['@category']);
  3328. self['@class']._addCompiledMethod_(method);
  3329. return self;},
  3330. 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')}),
  3331. smalltalk.ClassCategoryReader);
  3332. smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel');
  3333. smalltalk.addMethod(
  3334. '_collection',
  3335. smalltalk.method({
  3336. selector: 'collection',
  3337. category: 'accessing',
  3338. fn: function (){
  3339. var self=this;
  3340. return self['@collection'];
  3341. return self;},
  3342. source: unescape('collection%0A%09%5Ecollection%0A')}),
  3343. smalltalk.Stream);
  3344. smalltalk.addMethod(
  3345. '_setCollection_',
  3346. smalltalk.method({
  3347. selector: 'setCollection:',
  3348. category: 'accessing',
  3349. fn: function (aCollection){
  3350. var self=this;
  3351. self['@collection']=aCollection;
  3352. return self;},
  3353. source: unescape('setCollection%3A%20aCollection%0A%09collection%20%3A%3D%20aCollection%0A')}),
  3354. smalltalk.Stream);
  3355. smalltalk.addMethod(
  3356. '_position',
  3357. smalltalk.method({
  3358. selector: 'position',
  3359. category: 'accessing',
  3360. fn: function (){
  3361. var self=this;
  3362. return self['@position']._ifNil_((function(){return self['@position']=(0);}));
  3363. return self;},
  3364. source: unescape('position%0A%09%5Eposition%20ifNil%3A%20%5Bposition%20%3A%3D%200%5D%0A')}),
  3365. smalltalk.Stream);
  3366. smalltalk.addMethod(
  3367. '_position_',
  3368. smalltalk.method({
  3369. selector: 'position:',
  3370. category: 'accessing',
  3371. fn: function (anInteger){
  3372. var self=this;
  3373. self['@position']=anInteger;
  3374. return self;},
  3375. source: unescape('position%3A%20anInteger%0A%09position%20%3A%3D%20anInteger%0A')}),
  3376. smalltalk.Stream);
  3377. smalltalk.addMethod(
  3378. '_streamSize',
  3379. smalltalk.method({
  3380. selector: 'streamSize',
  3381. category: 'accessing',
  3382. fn: function (){
  3383. var self=this;
  3384. return self['@streamSize'];
  3385. return self;},
  3386. source: unescape('streamSize%0A%09%5EstreamSize%0A')}),
  3387. smalltalk.Stream);
  3388. smalltalk.addMethod(
  3389. '_setStreamSize_',
  3390. smalltalk.method({
  3391. selector: 'setStreamSize:',
  3392. category: 'accessing',
  3393. fn: function (anInteger){
  3394. var self=this;
  3395. self['@streamSize']=anInteger;
  3396. return self;},
  3397. source: unescape('setStreamSize%3A%20anInteger%0A%09streamSize%20%3A%3D%20anInteger%0A')}),
  3398. smalltalk.Stream);
  3399. smalltalk.addMethod(
  3400. '_contents',
  3401. smalltalk.method({
  3402. selector: 'contents',
  3403. category: 'accessing',
  3404. fn: function (){
  3405. var self=this;
  3406. return self._collection()._copyFrom_to_((1),self._streamSize());
  3407. return self;},
  3408. 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')}),
  3409. smalltalk.Stream);
  3410. smalltalk.addMethod(
  3411. '_size',
  3412. smalltalk.method({
  3413. selector: 'size',
  3414. category: 'accessing',
  3415. fn: function (){
  3416. var self=this;
  3417. return self._streamSize();
  3418. return self;},
  3419. source: unescape('size%0A%09%5Eself%20streamSize%0A')}),
  3420. smalltalk.Stream);
  3421. smalltalk.addMethod(
  3422. '_reset',
  3423. smalltalk.method({
  3424. selector: 'reset',
  3425. category: 'actions',
  3426. fn: function (){
  3427. var self=this;
  3428. self._position_((0));
  3429. return self;},
  3430. source: unescape('reset%0A%09self%20position%3A%200%0A')}),
  3431. smalltalk.Stream);
  3432. smalltalk.addMethod(
  3433. '_close',
  3434. smalltalk.method({
  3435. selector: 'close',
  3436. category: 'actions',
  3437. fn: function (){
  3438. var self=this;
  3439. return self;},
  3440. source: unescape('close%0A')}),
  3441. smalltalk.Stream);
  3442. smalltalk.addMethod(
  3443. '_flush',
  3444. smalltalk.method({
  3445. selector: 'flush',
  3446. category: 'actions',
  3447. fn: function (){
  3448. var self=this;
  3449. return self;},
  3450. source: unescape('flush%0A')}),
  3451. smalltalk.Stream);
  3452. smalltalk.addMethod(
  3453. '_resetContents',
  3454. smalltalk.method({
  3455. selector: 'resetContents',
  3456. category: 'actions',
  3457. fn: function (){
  3458. var self=this;
  3459. self._reset();
  3460. self._setStreamSize_((0));
  3461. return self;},
  3462. source: unescape('resetContents%0A%09self%20reset.%0A%09self%20setStreamSize%3A%200%0A')}),
  3463. smalltalk.Stream);
  3464. smalltalk.addMethod(
  3465. '_do_',
  3466. smalltalk.method({
  3467. selector: 'do:',
  3468. category: 'enumerating',
  3469. fn: function (aBlock){
  3470. var self=this;
  3471. (function(){return self._atEnd();})._whileFalse_((function(){return aBlock._value_(self._next());}));
  3472. return self;},
  3473. source: unescape('do%3A%20aBlock%0A%09%5Bself%20atEnd%5D%20whileFalse%3A%20%5BaBlock%20value%3A%20self%20next%5D%0A')}),
  3474. smalltalk.Stream);
  3475. smalltalk.addMethod(
  3476. '_setToEnd',
  3477. smalltalk.method({
  3478. selector: 'setToEnd',
  3479. category: 'positioning',
  3480. fn: function (){
  3481. var self=this;
  3482. self._position_(self._size());
  3483. return self;},
  3484. source: unescape('setToEnd%0A%09self%20position%3A%20self%20size%0A')}),
  3485. smalltalk.Stream);
  3486. smalltalk.addMethod(
  3487. '_skip_',
  3488. smalltalk.method({
  3489. selector: 'skip:',
  3490. category: 'positioning',
  3491. fn: function (anInteger){
  3492. var self=this;
  3493. self._position_(self._position().__plus(anInteger)._min_max_(self._size(),(0)));
  3494. return self;},
  3495. 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')}),
  3496. smalltalk.Stream);
  3497. smalltalk.addMethod(
  3498. '_next',
  3499. smalltalk.method({
  3500. selector: 'next',
  3501. category: 'reading',
  3502. fn: function (){
  3503. var self=this;
  3504. self._position_(self._position().__plus((1)));
  3505. return self['@collection']._at_(self._position());
  3506. return self;},
  3507. source: unescape('next%0A%09self%20position%3A%20self%20position%20+%201.%20%0A%09%5Ecollection%20at%3A%20self%20position%0A')}),
  3508. smalltalk.Stream);
  3509. smalltalk.addMethod(
  3510. '_next_',
  3511. smalltalk.method({
  3512. selector: 'next:',
  3513. category: 'reading',
  3514. fn: function (anInteger){
  3515. var self=this;
  3516. var tempCollection=nil;
  3517. tempCollection=self._collection()._class()._new();
  3518. anInteger._timesRepeat_((function(){return self._atEnd()._ifFalse_((function(){return tempCollection._add_(self._next());}));}));
  3519. return tempCollection;
  3520. return self;},
  3521. 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')}),
  3522. smalltalk.Stream);
  3523. smalltalk.addMethod(
  3524. '_nextPut_',
  3525. smalltalk.method({
  3526. selector: 'nextPut:',
  3527. category: 'writing',
  3528. fn: function (anObject){
  3529. var self=this;
  3530. self._position_(self._position().__plus((1)));
  3531. self._collection()._at_put_(self._position(),anObject);
  3532. self._setStreamSize_(self._streamSize()._max_(self._position()));
  3533. return self;},
  3534. 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')}),
  3535. smalltalk.Stream);
  3536. smalltalk.addMethod(
  3537. '_nextPutAll_',
  3538. smalltalk.method({
  3539. selector: 'nextPutAll:',
  3540. category: 'writing',
  3541. fn: function (aCollection){
  3542. var self=this;
  3543. aCollection._do_((function(each){return self._nextPut_(each);}));
  3544. return self;},
  3545. 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')}),
  3546. smalltalk.Stream);
  3547. smalltalk.addMethod(
  3548. '_peek',
  3549. smalltalk.method({
  3550. selector: 'peek',
  3551. category: 'reading',
  3552. fn: function (){
  3553. var self=this;
  3554. return self._atEnd()._ifFalse_((function(){return self._collection()._at_(self._position().__plus((1)));}));
  3555. return self;},
  3556. 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')}),
  3557. smalltalk.Stream);
  3558. smalltalk.addMethod(
  3559. '_atEnd',
  3560. smalltalk.method({
  3561. selector: 'atEnd',
  3562. category: 'testing',
  3563. fn: function (){
  3564. var self=this;
  3565. return self._position().__eq(self._size());
  3566. return self;},
  3567. source: unescape('atEnd%0A%09%5Eself%20position%20%3D%20self%20size%0A')}),
  3568. smalltalk.Stream);
  3569. smalltalk.addMethod(
  3570. '_atStart',
  3571. smalltalk.method({
  3572. selector: 'atStart',
  3573. category: 'testing',
  3574. fn: function (){
  3575. var self=this;
  3576. return self._position().__eq((0));
  3577. return self;},
  3578. source: unescape('atStart%0A%09%5Eself%20position%20%3D%200%0A')}),
  3579. smalltalk.Stream);
  3580. smalltalk.addMethod(
  3581. '_isEmpty',
  3582. smalltalk.method({
  3583. selector: 'isEmpty',
  3584. category: 'testing',
  3585. fn: function (){
  3586. var self=this;
  3587. return self._size().__eq((0));
  3588. return self;},
  3589. source: unescape('isEmpty%0A%09%5Eself%20size%20%3D%200%0A')}),
  3590. smalltalk.Stream);
  3591. smalltalk.addMethod(
  3592. '_on_',
  3593. smalltalk.method({
  3594. selector: 'on:',
  3595. category: 'instance creation',
  3596. fn: function (aCollection){
  3597. var self=this;
  3598. return (function($rec){$rec._setCollection_(aCollection);$rec._setStreamSize_(aCollection._size());return $rec._yourself();})(self._new());
  3599. return self;},
  3600. 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')}),
  3601. smalltalk.Stream.klass);
  3602. smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel');
  3603. smalltalk.addMethod(
  3604. '_next_',
  3605. smalltalk.method({
  3606. selector: 'next:',
  3607. category: 'reading',
  3608. fn: function (anInteger){
  3609. var self=this;
  3610. var tempCollection=nil;
  3611. tempCollection=self._collection()._class()._new();
  3612. anInteger._timesRepeat_((function(){return self._atEnd()._ifFalse_((function(){return tempCollection=tempCollection.__comma(self._next());}));}));
  3613. return tempCollection;
  3614. return self;},
  3615. 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')}),
  3616. smalltalk.StringStream);
  3617. smalltalk.addMethod(
  3618. '_nextPut_',
  3619. smalltalk.method({
  3620. selector: 'nextPut:',
  3621. category: 'writing',
  3622. fn: function (aString){
  3623. var self=this;
  3624. self._nextPutAll_(aString);
  3625. return self;},
  3626. source: unescape('nextPut%3A%20aString%0A%09self%20nextPutAll%3A%20aString%0A')}),
  3627. smalltalk.StringStream);
  3628. smalltalk.addMethod(
  3629. '_nextPutAll_',
  3630. smalltalk.method({
  3631. selector: 'nextPutAll:',
  3632. category: 'writing',
  3633. fn: function (aString){
  3634. var self=this;
  3635. self._setCollection_(self._collection()._copyFrom_to_((1),self._position()).__comma(aString).__comma(self._collection()._copyFrom_to_(self._position().__plus((1)).__plus(aString._size()),self._collection()._size())));
  3636. self._position_(self._position().__plus(aString._size()));
  3637. self._setStreamSize_(self._streamSize()._max_(self._position()));
  3638. return self;},
  3639. 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')}),
  3640. smalltalk.StringStream);
  3641. smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class', 'chunkParser'], 'Kernel');
  3642. smalltalk.addMethod(
  3643. '_class_',
  3644. smalltalk.method({
  3645. selector: 'class:',
  3646. category: 'accessing',
  3647. fn: function (aClass){
  3648. var self=this;
  3649. self['@class']=aClass;
  3650. return self;},
  3651. source: unescape('class%3A%20aClass%0A%09class%20%3A%3D%20aClass%0A')}),
  3652. smalltalk.ClassCommentReader);
  3653. smalltalk.addMethod(
  3654. '_scanFrom_',
  3655. smalltalk.method({
  3656. selector: 'scanFrom:',
  3657. category: 'fileIn',
  3658. fn: function (aStream){
  3659. var self=this;
  3660. var nextChunk=nil;
  3661. nextChunk=self['@chunkParser']._emptyChunk().__slash(self['@chunkParser']._chunk())._parse_(aStream);
  3662. nextChunk._isEmptyChunk()._ifFalse_((function(){return self._setComment_(nextChunk._contents());}));
  3663. return self;},
  3664. 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')}),
  3665. smalltalk.ClassCommentReader);
  3666. smalltalk.addMethod(
  3667. '_initialize',
  3668. smalltalk.method({
  3669. selector: 'initialize',
  3670. category: 'initialization',
  3671. fn: function (){
  3672. var self=this;
  3673. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  3674. self['@chunkParser']=smalltalk.ChunkParser._new();
  3675. return self;},
  3676. source: unescape('initialize%0A%09super%20initialize.%0A%09chunkParser%20%3A%3D%20ChunkParser%20new.%0A')}),
  3677. smalltalk.ClassCommentReader);
  3678. smalltalk.addMethod(
  3679. '_setComment_',
  3680. smalltalk.method({
  3681. selector: 'setComment:',
  3682. category: 'private',
  3683. fn: function (aString){
  3684. var self=this;
  3685. self['@class']._comment_(aString);
  3686. return self;},
  3687. source: unescape('setComment%3A%20aString%0A%20%20%20%20class%20comment%3A%20aString%0A')}),
  3688. smalltalk.ClassCommentReader);
  3689. smalltalk.addClass('JQuery', smalltalk.Object, ['jquery'], 'JQuery');
  3690. smalltalk.addMethod(
  3691. '_removeAttribute_',
  3692. smalltalk.method({
  3693. selector: 'removeAttribute:',
  3694. category: 'attributes',
  3695. fn: function (aString){
  3696. var self=this;
  3697. return self._call_withArgument_("removeAttribute",aString);
  3698. return self;},
  3699. 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')}),
  3700. smalltalk.JQuery);
  3701. smalltalk.addMethod(
  3702. '_attr_',
  3703. smalltalk.method({
  3704. selector: 'attr:',
  3705. category: 'attributes',
  3706. fn: function (aString){
  3707. var self=this;
  3708. return self._call_withArgument_("attr",aString);
  3709. return self;},
  3710. 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')}),
  3711. smalltalk.JQuery);
  3712. smalltalk.addMethod(
  3713. '_val',
  3714. smalltalk.method({
  3715. selector: 'val',
  3716. category: 'attributes',
  3717. fn: function (){
  3718. var self=this;
  3719. return self._call_("val");
  3720. return self;},
  3721. 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')}),
  3722. smalltalk.JQuery);
  3723. smalltalk.addMethod(
  3724. '_val_',
  3725. smalltalk.method({
  3726. selector: 'val:',
  3727. category: 'attributes',
  3728. fn: function (aString){
  3729. var self=this;
  3730. self._call_withArgument_("val",aString);
  3731. return self;},
  3732. source: unescape('val%3A%20aString%0A%20%20%20%20self%20call%3A%20%27val%27%20withArgument%3A%20aString%0A')}),
  3733. smalltalk.JQuery);
  3734. smalltalk.addMethod(
  3735. '_cssAt_',
  3736. smalltalk.method({
  3737. selector: 'cssAt:',
  3738. category: 'css',
  3739. fn: function (aString){
  3740. var self=this;
  3741. return (function(){return self['@jquery'].css(aString)})();
  3742. return self;},
  3743. source: unescape('cssAt%3A%20aString%0A%20%20%20%20%5E%7B%27return%20self%5B%27%27@jquery%27%27%5D.css%28aString%29%27%7D%0A')}),
  3744. smalltalk.JQuery);
  3745. smalltalk.addMethod(
  3746. '_cssAt_put_',
  3747. smalltalk.method({
  3748. selector: 'cssAt:put:',
  3749. category: 'css',
  3750. fn: function (aString, anotherString){
  3751. var self=this;
  3752. (function(){self['@jquery'].css(aString, anotherString)})();
  3753. return self;},
  3754. 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')}),
  3755. smalltalk.JQuery);
  3756. smalltalk.addMethod(
  3757. '_addClass_',
  3758. smalltalk.method({
  3759. selector: 'addClass:',
  3760. category: 'css',
  3761. fn: function (aString){
  3762. var self=this;
  3763. self._call_withArgument_("addClass",aString);
  3764. return self;},
  3765. 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')}),
  3766. smalltalk.JQuery);
  3767. smalltalk.addMethod(
  3768. '_removeClass_',
  3769. smalltalk.method({
  3770. selector: 'removeClass:',
  3771. category: 'css',
  3772. fn: function (aString){
  3773. var self=this;
  3774. self._call_withArgument_("removeClass",aString);
  3775. return self;},
  3776. 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')}),
  3777. smalltalk.JQuery);
  3778. smalltalk.addMethod(
  3779. '_toggleClass_',
  3780. smalltalk.method({
  3781. selector: 'toggleClass:',
  3782. category: 'css',
  3783. fn: function (aString){
  3784. var self=this;
  3785. self._call_withArgument_("toggleClass",aString);
  3786. return self;},
  3787. 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')}),
  3788. smalltalk.JQuery);
  3789. smalltalk.addMethod(
  3790. '_height',
  3791. smalltalk.method({
  3792. selector: 'height',
  3793. category: 'css',
  3794. fn: function (){
  3795. var self=this;
  3796. return self._call_("height");
  3797. return self;},
  3798. 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')}),
  3799. smalltalk.JQuery);
  3800. smalltalk.addMethod(
  3801. '_height_',
  3802. smalltalk.method({
  3803. selector: 'height:',
  3804. category: 'css',
  3805. fn: function (anInteger){
  3806. var self=this;
  3807. self._call_withArgument_("height",anInteger);
  3808. return self;},
  3809. source: unescape('height%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27height%27%20withArgument%3A%20anInteger%0A')}),
  3810. smalltalk.JQuery);
  3811. smalltalk.addMethod(
  3812. '_width_',
  3813. smalltalk.method({
  3814. selector: 'width:',
  3815. category: 'css',
  3816. fn: function (anInteger){
  3817. var self=this;
  3818. self._call_withArgument_("width",anInteger);
  3819. return self;},
  3820. source: unescape('width%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27width%27%20withArgument%3A%20anInteger%0A')}),
  3821. smalltalk.JQuery);
  3822. smalltalk.addMethod(
  3823. '_width',
  3824. smalltalk.method({
  3825. selector: 'width',
  3826. category: 'css',
  3827. fn: function (){
  3828. var self=this;
  3829. return self._call_("width");
  3830. return self;},
  3831. 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')}),
  3832. smalltalk.JQuery);
  3833. smalltalk.addMethod(
  3834. '_innerHeight',
  3835. smalltalk.method({
  3836. selector: 'innerHeight',
  3837. category: 'css',
  3838. fn: function (){
  3839. var self=this;
  3840. return self._call_("innerHeight");
  3841. return self;},
  3842. 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')}),
  3843. smalltalk.JQuery);
  3844. smalltalk.addMethod(
  3845. '_innerWidth',
  3846. smalltalk.method({
  3847. selector: 'innerWidth',
  3848. category: 'css',
  3849. fn: function (){
  3850. var self=this;
  3851. return self._call_("innerWidth");
  3852. return self;},
  3853. 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')}),
  3854. smalltalk.JQuery);
  3855. smalltalk.addMethod(
  3856. '_outerHeight',
  3857. smalltalk.method({
  3858. selector: 'outerHeight',
  3859. category: 'css',
  3860. fn: function (){
  3861. var self=this;
  3862. return self._call_("outerHeight");
  3863. return self;},
  3864. 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')}),
  3865. smalltalk.JQuery);
  3866. smalltalk.addMethod(
  3867. '_outerWidth',
  3868. smalltalk.method({
  3869. selector: 'outerWidth',
  3870. category: 'css',
  3871. fn: function (){
  3872. var self=this;
  3873. return self._call_("outerWidth");
  3874. return self;},
  3875. 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')}),
  3876. smalltalk.JQuery);
  3877. smalltalk.addMethod(
  3878. '_top',
  3879. smalltalk.method({
  3880. selector: 'top',
  3881. category: 'css',
  3882. fn: function (){
  3883. var self=this;
  3884. return self._call_("position")._basicAt_("top");
  3885. return self;},
  3886. 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')}),
  3887. smalltalk.JQuery);
  3888. smalltalk.addMethod(
  3889. '_left',
  3890. smalltalk.method({
  3891. selector: 'left',
  3892. category: 'css',
  3893. fn: function (){
  3894. var self=this;
  3895. return self._call_("position")._basicAt_("left");
  3896. return self;},
  3897. 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')}),
  3898. smalltalk.JQuery);
  3899. smalltalk.addMethod(
  3900. '_offsetLeft',
  3901. smalltalk.method({
  3902. selector: 'offsetLeft',
  3903. category: 'css',
  3904. fn: function (){
  3905. var self=this;
  3906. return self._call_("offset")._basicAt_("left");
  3907. return self;},
  3908. 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')}),
  3909. smalltalk.JQuery);
  3910. smalltalk.addMethod(
  3911. '_offsetTop',
  3912. smalltalk.method({
  3913. selector: 'offsetTop',
  3914. category: 'css',
  3915. fn: function (){
  3916. var self=this;
  3917. return self._call_("offset")._basicAt_("top");
  3918. return self;},
  3919. 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')}),
  3920. smalltalk.JQuery);
  3921. smalltalk.addMethod(
  3922. '_scrollLeft',
  3923. smalltalk.method({
  3924. selector: 'scrollLeft',
  3925. category: 'css',
  3926. fn: function (){
  3927. var self=this;
  3928. return self._call_("scrollLeft");
  3929. return self;},
  3930. 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')}),
  3931. smalltalk.JQuery);
  3932. smalltalk.addMethod(
  3933. '_scrollTop',
  3934. smalltalk.method({
  3935. selector: 'scrollTop',
  3936. category: 'css',
  3937. fn: function (){
  3938. var self=this;
  3939. return self._call_("scrollTop");
  3940. return self;},
  3941. 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')}),
  3942. smalltalk.JQuery);
  3943. smalltalk.addMethod(
  3944. '_scrollLeft_',
  3945. smalltalk.method({
  3946. selector: 'scrollLeft:',
  3947. category: 'css',
  3948. fn: function (anInteger){
  3949. var self=this;
  3950. self._call_withArgument_("scrollLeft",anInteger);
  3951. return self;},
  3952. source: unescape('scrollLeft%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27scrollLeft%27%20withArgument%3A%20anInteger%0A')}),
  3953. smalltalk.JQuery);
  3954. smalltalk.addMethod(
  3955. '_scrollTop_',
  3956. smalltalk.method({
  3957. selector: 'scrollTop:',
  3958. category: 'css',
  3959. fn: function (anInteger){
  3960. var self=this;
  3961. self._call_withArgument_("scrollTop",anInteger);
  3962. return self;},
  3963. source: unescape('scrollTop%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27scrollTop%27%20withArgument%3A%20anInteger%0A')}),
  3964. smalltalk.JQuery);
  3965. smalltalk.addMethod(
  3966. '_focus',
  3967. smalltalk.method({
  3968. selector: 'focus',
  3969. category: 'events',
  3970. fn: function (){
  3971. var self=this;
  3972. self._call_("focus");
  3973. return self;},
  3974. source: unescape('focus%0A%20%20%20%20self%20call%3A%20%27focus%27%0A')}),
  3975. smalltalk.JQuery);
  3976. smalltalk.addMethod(
  3977. '_show',
  3978. smalltalk.method({
  3979. selector: 'show',
  3980. category: 'events',
  3981. fn: function (){
  3982. var self=this;
  3983. self._call_("show");
  3984. return self;},
  3985. source: unescape('show%0A%20%20%20%20self%20call%3A%20%27show%27%0A')}),
  3986. smalltalk.JQuery);
  3987. smalltalk.addMethod(
  3988. '_hide',
  3989. smalltalk.method({
  3990. selector: 'hide',
  3991. category: 'events',
  3992. fn: function (){
  3993. var self=this;
  3994. self._call_("hide");
  3995. return self;},
  3996. source: unescape('hide%0A%20%20%20%20self%20call%3A%20%27hide%27%0A')}),
  3997. smalltalk.JQuery);
  3998. smalltalk.addMethod(
  3999. '_remove',
  4000. smalltalk.method({
  4001. selector: 'remove',
  4002. category: 'events',
  4003. fn: function (){
  4004. var self=this;
  4005. self._call_("remove");
  4006. return self;},
  4007. source: unescape('remove%0A%20%20%20%20self%20call%3A%20%27remove%27%0A')}),
  4008. smalltalk.JQuery);
  4009. smalltalk.addMethod(
  4010. '_on_do_',
  4011. smalltalk.method({
  4012. selector: 'on:do:',
  4013. category: 'events',
  4014. fn: function (anEventString, aBlock){
  4015. var self=this;
  4016. (function(){self['@jquery'].bind(anEventString, aBlock)})();
  4017. return self;},
  4018. 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%20aBlock%29%27%7D%0A')}),
  4019. smalltalk.JQuery);
  4020. smalltalk.addMethod(
  4021. '_removeEvents_',
  4022. smalltalk.method({
  4023. selector: 'removeEvents:',
  4024. category: 'events',
  4025. fn: function (aString){
  4026. var self=this;
  4027. self._call_withArgument_("unbind",aString);
  4028. return self;},
  4029. 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')}),
  4030. smalltalk.JQuery);
  4031. smalltalk.addMethod(
  4032. '_append_',
  4033. smalltalk.method({
  4034. selector: 'append:',
  4035. category: 'DOM insertion',
  4036. fn: function (anObject){
  4037. var self=this;
  4038. anObject._appendToJQuery_(self);
  4039. return self;},
  4040. 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')}),
  4041. smalltalk.JQuery);
  4042. smalltalk.addMethod(
  4043. '_appendElement_',
  4044. smalltalk.method({
  4045. selector: 'appendElement:',
  4046. category: 'DOM insertion',
  4047. fn: function (anElement){
  4048. var self=this;
  4049. self._call_withArgument_("append",anElement);
  4050. return self;},
  4051. 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')}),
  4052. smalltalk.JQuery);
  4053. smalltalk.addMethod(
  4054. '_appendToJQuery_',
  4055. smalltalk.method({
  4056. selector: 'appendToJQuery:',
  4057. category: 'DOM insertion',
  4058. fn: function (aJQuery){
  4059. var self=this;
  4060. aJQuery._appendElement_(self['@jquery']);
  4061. return self;},
  4062. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20aJQuery%20appendElement%3A%20jquery%0A')}),
  4063. smalltalk.JQuery);
  4064. smalltalk.addMethod(
  4065. '_contents_',
  4066. smalltalk.method({
  4067. selector: 'contents:',
  4068. category: 'DOM insertion',
  4069. fn: function (anObject){
  4070. var self=this;
  4071. self._empty();
  4072. self._append_(anObject);
  4073. return self;},
  4074. source: unescape('contents%3A%20anObject%0A%20%20%20%20self%20empty.%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  4075. smalltalk.JQuery);
  4076. smalltalk.addMethod(
  4077. '_empty',
  4078. smalltalk.method({
  4079. selector: 'empty',
  4080. category: 'DOM insertion',
  4081. fn: function (){
  4082. var self=this;
  4083. self._call_("empty");
  4084. return self;},
  4085. source: unescape('empty%0A%20%20%20%20self%20call%3A%20%27empty%27%0A')}),
  4086. smalltalk.JQuery);
  4087. smalltalk.addMethod(
  4088. '_initializeWithJQueryObject_',
  4089. smalltalk.method({
  4090. selector: 'initializeWithJQueryObject:',
  4091. category: 'initialization',
  4092. fn: function (anObject){
  4093. var self=this;
  4094. self['@jquery']=anObject;
  4095. return self;},
  4096. source: unescape('initializeWithJQueryObject%3A%20anObject%0A%20%20%20%20jquery%20%3A%3D%20anObject%0A')}),
  4097. smalltalk.JQuery);
  4098. smalltalk.addMethod(
  4099. '_call_',
  4100. smalltalk.method({
  4101. selector: 'call:',
  4102. category: 'private',
  4103. fn: function (aString){
  4104. var self=this;
  4105. return (function(){return self['@jquery'][aString]()})();
  4106. return self;},
  4107. source: unescape('call%3A%20aString%0A%20%20%20%20%5E%7B%27return%20self%5B%27%27@jquery%27%27%5D%5BaString%5D%28%29%27%7D%0A')}),
  4108. smalltalk.JQuery);
  4109. smalltalk.addMethod(
  4110. '_call_withArgument_',
  4111. smalltalk.method({
  4112. selector: 'call:withArgument:',
  4113. category: 'private',
  4114. fn: function (aString, anObject){
  4115. var self=this;
  4116. return (function(){return self['@jquery'][aString](anObject)})();
  4117. return self;},
  4118. source: unescape('call%3A%20aString%20withArgument%3A%20anObject%0A%20%20%20%20%5E%7B%27return%20self%5B%27%27@jquery%27%27%5D%5BaString%5D%28anObject%29%27%7D%0A')}),
  4119. smalltalk.JQuery);
  4120. smalltalk.addMethod(
  4121. '_hasClass_',
  4122. smalltalk.method({
  4123. selector: 'hasClass:',
  4124. category: 'testing',
  4125. fn: function (aString){
  4126. var self=this;
  4127. return self._call_withArgument_("hasClass",aString);
  4128. return self;},
  4129. 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')}),
  4130. smalltalk.JQuery);
  4131. smalltalk.addMethod(
  4132. '_fromString_',
  4133. smalltalk.method({
  4134. selector: 'fromString:',
  4135. category: 'instance creation',
  4136. fn: function (aString){
  4137. var self=this;
  4138. var newJQuery=nil;
  4139. (function(){newJQuery = jQuery(String(aString))})();
  4140. return self._from_(newJQuery);
  4141. return self;},
  4142. 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')}),
  4143. smalltalk.JQuery.klass);
  4144. smalltalk.addMethod(
  4145. '_from_',
  4146. smalltalk.method({
  4147. selector: 'from:',
  4148. category: 'instance creation',
  4149. fn: function (anObject){
  4150. var self=this;
  4151. return (function($rec){$rec._initializeWithJQueryObject_(anObject);return $rec._yourself();})(self._new());
  4152. return self;},
  4153. source: unescape('from%3A%20anObject%0A%20%20%20%20%5Eself%20new%0A%09initializeWithJQueryObject%3A%20anObject%3B%0A%09yourself%0A')}),
  4154. smalltalk.JQuery.klass);
  4155. smalltalk.addClass('HTMLCanvas', smalltalk.Object, ['root'], 'Canvas');
  4156. smalltalk.addMethod(
  4157. '_root_',
  4158. smalltalk.method({
  4159. selector: 'root:',
  4160. category: 'accessing',
  4161. fn: function (aTagBrush){
  4162. var self=this;
  4163. self['@root']=aTagBrush;
  4164. return self;},
  4165. source: unescape('root%3A%20aTagBrush%0A%20%20%20%20root%20%3A%3D%20aTagBrush%0A')}),
  4166. smalltalk.HTMLCanvas);
  4167. smalltalk.addMethod(
  4168. '_root',
  4169. smalltalk.method({
  4170. selector: 'root',
  4171. category: 'accessing',
  4172. fn: function (){
  4173. var self=this;
  4174. return self['@root'];
  4175. return self;},
  4176. source: unescape('root%0A%20%20%20%20%5Eroot%0A')}),
  4177. smalltalk.HTMLCanvas);
  4178. smalltalk.addMethod(
  4179. '_initialize',
  4180. smalltalk.method({
  4181. selector: 'initialize',
  4182. category: 'initialization',
  4183. fn: function (){
  4184. var self=this;
  4185. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  4186. self['@root']=smalltalk.TagBrush._fromString_canvas_("div",self);
  4187. return self;},
  4188. 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')}),
  4189. smalltalk.HTMLCanvas);
  4190. smalltalk.addMethod(
  4191. '_with_',
  4192. smalltalk.method({
  4193. selector: 'with:',
  4194. category: 'adding',
  4195. fn: function (anObject){
  4196. var self=this;
  4197. return self._root()._with_(anObject);
  4198. return self;},
  4199. source: unescape('with%3A%20anObject%0A%20%20%20%20%5Eself%20root%20with%3A%20anObject%0A')}),
  4200. smalltalk.HTMLCanvas);
  4201. smalltalk.addMethod(
  4202. '_newTag_',
  4203. smalltalk.method({
  4204. selector: 'newTag:',
  4205. category: 'tags',
  4206. fn: function (aString){
  4207. var self=this;
  4208. return smalltalk.TagBrush._fromString_canvas_(aString,self);
  4209. return self;},
  4210. source: unescape('newTag%3A%20aString%0A%20%20%20%20%5ETagBrush%20fromString%3A%20aString%20canvas%3A%20self%0A')}),
  4211. smalltalk.HTMLCanvas);
  4212. smalltalk.addMethod(
  4213. '_tag_',
  4214. smalltalk.method({
  4215. selector: 'tag:',
  4216. category: 'tags',
  4217. fn: function (aString){
  4218. var self=this;
  4219. return self['@root']._addBrush_(self._newTag_(aString));
  4220. return self;},
  4221. source: unescape('tag%3A%20aString%0A%20%20%20%20%5Eroot%20addBrush%3A%20%28self%20newTag%3A%20aString%29%0A')}),
  4222. smalltalk.HTMLCanvas);
  4223. smalltalk.addMethod(
  4224. '_h1',
  4225. smalltalk.method({
  4226. selector: 'h1',
  4227. category: 'tags',
  4228. fn: function (){
  4229. var self=this;
  4230. return self._tag_("h1");
  4231. return self;},
  4232. source: unescape('h1%0A%20%20%20%20%5Eself%20tag%3A%20%27h1%27%0A')}),
  4233. smalltalk.HTMLCanvas);
  4234. smalltalk.addMethod(
  4235. '_h2',
  4236. smalltalk.method({
  4237. selector: 'h2',
  4238. category: 'tags',
  4239. fn: function (){
  4240. var self=this;
  4241. return self._tag_("h2");
  4242. return self;},
  4243. source: unescape('h2%0A%20%20%20%20%5Eself%20tag%3A%20%27h2%27%0A')}),
  4244. smalltalk.HTMLCanvas);
  4245. smalltalk.addMethod(
  4246. '_h3',
  4247. smalltalk.method({
  4248. selector: 'h3',
  4249. category: 'tags',
  4250. fn: function (){
  4251. var self=this;
  4252. return self._tag_("h3");
  4253. return self;},
  4254. source: unescape('h3%0A%20%20%20%20%5Eself%20tag%3A%20%27h3%27%0A')}),
  4255. smalltalk.HTMLCanvas);
  4256. smalltalk.addMethod(
  4257. '_h4',
  4258. smalltalk.method({
  4259. selector: 'h4',
  4260. category: 'tags',
  4261. fn: function (){
  4262. var self=this;
  4263. return self._tag_("h4");
  4264. return self;},
  4265. source: unescape('h4%0A%20%20%20%20%5Eself%20tag%3A%20%27h4%27%0A')}),
  4266. smalltalk.HTMLCanvas);
  4267. smalltalk.addMethod(
  4268. '_h5',
  4269. smalltalk.method({
  4270. selector: 'h5',
  4271. category: 'tags',
  4272. fn: function (){
  4273. var self=this;
  4274. return self._tag_("h5");
  4275. return self;},
  4276. source: unescape('h5%0A%20%20%20%20%5Eself%20tag%3A%20%27h5%27%0A')}),
  4277. smalltalk.HTMLCanvas);
  4278. smalltalk.addMethod(
  4279. '_h6',
  4280. smalltalk.method({
  4281. selector: 'h6',
  4282. category: 'tags',
  4283. fn: function (){
  4284. var self=this;
  4285. return self._tag_("h6");
  4286. return self;},
  4287. source: unescape('h6%0A%20%20%20%20%5Eself%20tag%3A%20%27h6%27%0A')}),
  4288. smalltalk.HTMLCanvas);
  4289. smalltalk.addMethod(
  4290. '_p',
  4291. smalltalk.method({
  4292. selector: 'p',
  4293. category: 'tags',
  4294. fn: function (){
  4295. var self=this;
  4296. return self._tag_("p");
  4297. return self;},
  4298. source: unescape('p%0A%20%20%20%20%5Eself%20tag%3A%20%27p%27%0A')}),
  4299. smalltalk.HTMLCanvas);
  4300. smalltalk.addMethod(
  4301. '_div',
  4302. smalltalk.method({
  4303. selector: 'div',
  4304. category: 'tags',
  4305. fn: function (){
  4306. var self=this;
  4307. return self._tag_("div");
  4308. return self;},
  4309. source: unescape('div%0A%20%20%20%20%5Eself%20tag%3A%20%27div%27%0A')}),
  4310. smalltalk.HTMLCanvas);
  4311. smalltalk.addMethod(
  4312. '_span',
  4313. smalltalk.method({
  4314. selector: 'span',
  4315. category: 'tags',
  4316. fn: function (){
  4317. var self=this;
  4318. return self._tag_("span");
  4319. return self;},
  4320. source: unescape('span%0A%20%20%20%20%5Eself%20tag%3A%20%27span%27%0A')}),
  4321. smalltalk.HTMLCanvas);
  4322. smalltalk.addMethod(
  4323. '_img',
  4324. smalltalk.method({
  4325. selector: 'img',
  4326. category: 'tags',
  4327. fn: function (){
  4328. var self=this;
  4329. return self._tag_("img");
  4330. return self;},
  4331. source: unescape('img%0A%20%20%20%20%5Eself%20tag%3A%20%27img%27%0A')}),
  4332. smalltalk.HTMLCanvas);
  4333. smalltalk.addMethod(
  4334. '_ul',
  4335. smalltalk.method({
  4336. selector: 'ul',
  4337. category: 'tags',
  4338. fn: function (){
  4339. var self=this;
  4340. return self._tag_("ul");
  4341. return self;},
  4342. source: unescape('ul%0A%20%20%20%20%5Eself%20tag%3A%20%27ul%27%0A')}),
  4343. smalltalk.HTMLCanvas);
  4344. smalltalk.addMethod(
  4345. '_ol',
  4346. smalltalk.method({
  4347. selector: 'ol',
  4348. category: 'tags',
  4349. fn: function (){
  4350. var self=this;
  4351. return self._tag_("ol");
  4352. return self;},
  4353. source: unescape('ol%0A%20%20%20%20%5Eself%20tag%3A%20%27ol%27%0A')}),
  4354. smalltalk.HTMLCanvas);
  4355. smalltalk.addMethod(
  4356. '_li',
  4357. smalltalk.method({
  4358. selector: 'li',
  4359. category: 'tags',
  4360. fn: function (){
  4361. var self=this;
  4362. return self._tag_("li");
  4363. return self;},
  4364. source: unescape('li%0A%20%20%20%20%5Eself%20tag%3A%20%27li%27%0A')}),
  4365. smalltalk.HTMLCanvas);
  4366. smalltalk.addMethod(
  4367. '_table',
  4368. smalltalk.method({
  4369. selector: 'table',
  4370. category: 'tags',
  4371. fn: function (){
  4372. var self=this;
  4373. return self._tag_("table");
  4374. return self;},
  4375. source: unescape('table%0A%20%20%20%20%5Eself%20tag%3A%20%27table%27%0A')}),
  4376. smalltalk.HTMLCanvas);
  4377. smalltalk.addMethod(
  4378. '_tr',
  4379. smalltalk.method({
  4380. selector: 'tr',
  4381. category: 'tags',
  4382. fn: function (){
  4383. var self=this;
  4384. return self._tag_("tr");
  4385. return self;},
  4386. source: unescape('tr%0A%20%20%20%20%5Eself%20tag%3A%20%27tr%27%0A')}),
  4387. smalltalk.HTMLCanvas);
  4388. smalltalk.addMethod(
  4389. '_td',
  4390. smalltalk.method({
  4391. selector: 'td',
  4392. category: 'tags',
  4393. fn: function (){
  4394. var self=this;
  4395. return self._tag_("td");
  4396. return self;},
  4397. source: unescape('td%20%0A%20%20%20%20%5Eself%20tag%3A%20%27td%27%0A')}),
  4398. smalltalk.HTMLCanvas);
  4399. smalltalk.addMethod(
  4400. '_th',
  4401. smalltalk.method({
  4402. selector: 'th',
  4403. category: 'tags',
  4404. fn: function (){
  4405. var self=this;
  4406. return self._tag_("th");
  4407. return self;},
  4408. source: unescape('th%0A%20%20%20%20%5Eself%20tag%3A%20%27th%27%0A')}),
  4409. smalltalk.HTMLCanvas);
  4410. smalltalk.addMethod(
  4411. '_form',
  4412. smalltalk.method({
  4413. selector: 'form',
  4414. category: 'tags',
  4415. fn: function (){
  4416. var self=this;
  4417. return self._tag_("form");
  4418. return self;},
  4419. source: unescape('form%0A%20%20%20%20%5Eself%20tag%3A%20%27form%27%0A')}),
  4420. smalltalk.HTMLCanvas);
  4421. smalltalk.addMethod(
  4422. '_input',
  4423. smalltalk.method({
  4424. selector: 'input',
  4425. category: 'tags',
  4426. fn: function (){
  4427. var self=this;
  4428. return self._tag_("input");
  4429. return self;},
  4430. source: unescape('input%0A%20%20%20%20%5Eself%20tag%3A%20%27input%27%0A')}),
  4431. smalltalk.HTMLCanvas);
  4432. smalltalk.addMethod(
  4433. '_button',
  4434. smalltalk.method({
  4435. selector: 'button',
  4436. category: 'tags',
  4437. fn: function (){
  4438. var self=this;
  4439. return self._tag_("button");
  4440. return self;},
  4441. source: unescape('button%0A%20%20%20%20%5Eself%20tag%3A%20%27button%27%0A')}),
  4442. smalltalk.HTMLCanvas);
  4443. smalltalk.addMethod(
  4444. '_select',
  4445. smalltalk.method({
  4446. selector: 'select',
  4447. category: 'tags',
  4448. fn: function (){
  4449. var self=this;
  4450. return self._tag_("select");
  4451. return self;},
  4452. source: unescape('select%0A%20%20%20%20%5Eself%20tag%3A%20%27select%27%0A')}),
  4453. smalltalk.HTMLCanvas);
  4454. smalltalk.addMethod(
  4455. '_option',
  4456. smalltalk.method({
  4457. selector: 'option',
  4458. category: 'tags',
  4459. fn: function (){
  4460. var self=this;
  4461. return self._tag_("option");
  4462. return self;},
  4463. source: unescape('option%0A%20%20%20%20%5Eself%20tag%3A%20%27option%27%0A')}),
  4464. smalltalk.HTMLCanvas);
  4465. smalltalk.addMethod(
  4466. '_textarea',
  4467. smalltalk.method({
  4468. selector: 'textarea',
  4469. category: 'tags',
  4470. fn: function (){
  4471. var self=this;
  4472. return self._tag_("textarea");
  4473. return self;},
  4474. source: unescape('textarea%0A%20%20%20%20%5Eself%20tag%3A%20%27textarea%27%0A')}),
  4475. smalltalk.HTMLCanvas);
  4476. smalltalk.addMethod(
  4477. '_a',
  4478. smalltalk.method({
  4479. selector: 'a',
  4480. category: 'tags',
  4481. fn: function (){
  4482. var self=this;
  4483. return self._tag_("a");
  4484. return self;},
  4485. source: unescape('a%0A%20%20%20%20%5Eself%20tag%3A%20%27a%27%0A')}),
  4486. smalltalk.HTMLCanvas);
  4487. smalltalk.addMethod(
  4488. '_appendToJQuery_',
  4489. smalltalk.method({
  4490. selector: 'appendToJQuery:',
  4491. category: '*JQuery',
  4492. fn: function (aJQuery){
  4493. var self=this;
  4494. aJQuery._appendElement_(self['@root']._element());
  4495. return self;},
  4496. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20aJQuery%20appendElement%3A%20root%20element%0A')}),
  4497. smalltalk.HTMLCanvas);
  4498. smalltalk.addClass('TagBrush', smalltalk.Object, ['element'], 'Canvas');
  4499. smalltalk.addMethod(
  4500. '_contents_',
  4501. smalltalk.method({
  4502. selector: 'contents:',
  4503. category: 'adding',
  4504. fn: function (anObject){
  4505. var self=this;
  4506. self._asJQuery()._empty();
  4507. self._append_(anObject);
  4508. return self;},
  4509. source: unescape('contents%3A%20anObject%0A%20%20%20%20self%20asJQuery%20empty.%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  4510. smalltalk.TagBrush);
  4511. smalltalk.addMethod(
  4512. '_addBrush_',
  4513. smalltalk.method({
  4514. selector: 'addBrush:',
  4515. category: 'adding',
  4516. fn: function (aTagBrush){
  4517. var self=this;
  4518. self._appendChild_(aTagBrush._element());
  4519. return aTagBrush;
  4520. return self;},
  4521. source: unescape('addBrush%3A%20aTagBrush%0A%20%20%20%20self%20appendChild%3A%20aTagBrush%20element.%0A%20%20%20%20%5EaTagBrush%0A')}),
  4522. smalltalk.TagBrush);
  4523. smalltalk.addMethod(
  4524. '_with_',
  4525. smalltalk.method({
  4526. selector: 'with:',
  4527. category: 'adding',
  4528. fn: function (anObject){
  4529. var self=this;
  4530. self._append_(anObject);
  4531. return self;},
  4532. source: unescape('with%3A%20anObject%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  4533. smalltalk.TagBrush);
  4534. smalltalk.addMethod(
  4535. '_append_',
  4536. smalltalk.method({
  4537. selector: 'append:',
  4538. category: 'adding',
  4539. fn: function (anObject){
  4540. var self=this;
  4541. anObject._appendToBrush_(self);
  4542. return self;},
  4543. source: unescape('append%3A%20anObject%0A%20%20%20%20anObject%20appendToBrush%3A%20self%0A')}),
  4544. smalltalk.TagBrush);
  4545. smalltalk.addMethod(
  4546. '_appendToBrush_',
  4547. smalltalk.method({
  4548. selector: 'appendToBrush:',
  4549. category: 'adding',
  4550. fn: function (aTagBrush){
  4551. var self=this;
  4552. aTagBrush._addBrush_(self);
  4553. return self;},
  4554. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20aTagBrush%20addBrush%3A%20self%0A')}),
  4555. smalltalk.TagBrush);
  4556. smalltalk.addMethod(
  4557. '_appendBlock_',
  4558. smalltalk.method({
  4559. selector: 'appendBlock:',
  4560. category: 'adding',
  4561. fn: function (aBlock){
  4562. var self=this;
  4563. var root=nil;
  4564. root=canvas._root();
  4565. canvas._root_(self);
  4566. aBlock._value_(canvas);
  4567. canvas._root_(root);
  4568. return self;},
  4569. 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')}),
  4570. smalltalk.TagBrush);
  4571. smalltalk.addMethod(
  4572. '_appendChild_',
  4573. smalltalk.method({
  4574. selector: 'appendChild:',
  4575. category: 'adding',
  4576. fn: function (anElement){
  4577. var self=this;
  4578. (function(){self['@element'].appendChild(anElement)})();
  4579. return self;},
  4580. 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')}),
  4581. smalltalk.TagBrush);
  4582. smalltalk.addMethod(
  4583. '_appendString_',
  4584. smalltalk.method({
  4585. selector: 'appendString:',
  4586. category: 'adding',
  4587. fn: function (aString){
  4588. var self=this;
  4589. self._appendChild_(self._createTextNodeFor_(aString));
  4590. return self;},
  4591. source: unescape('appendString%3A%20aString%0A%20%20%20%20self%20appendChild%3A%20%28self%20createTextNodeFor%3A%20aString%29%0A')}),
  4592. smalltalk.TagBrush);
  4593. smalltalk.addMethod(
  4594. '_at_put_',
  4595. smalltalk.method({
  4596. selector: 'at:put:',
  4597. category: 'attributes',
  4598. fn: function (aString, aValue){
  4599. var self=this;
  4600. (function(){self['@element'].setAttribute(aString, aValue)})();
  4601. return self;},
  4602. 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')}),
  4603. smalltalk.TagBrush);
  4604. smalltalk.addMethod(
  4605. '_removeAt_',
  4606. smalltalk.method({
  4607. selector: 'removeAt:',
  4608. category: 'attributes',
  4609. fn: function (aString){
  4610. var self=this;
  4611. (function(){self['@element'].removeAttribute(aString)})();
  4612. return self;},
  4613. 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')}),
  4614. smalltalk.TagBrush);
  4615. smalltalk.addMethod(
  4616. '_class_',
  4617. smalltalk.method({
  4618. selector: 'class:',
  4619. category: 'attributes',
  4620. fn: function (aString){
  4621. var self=this;
  4622. self._at_put_("class",aString);
  4623. return self;},
  4624. source: unescape('class%3A%20aString%0A%20%20%20%20self%20at%3A%20%27class%27%20put%3A%20aString%0A')}),
  4625. smalltalk.TagBrush);
  4626. smalltalk.addMethod(
  4627. '_id_',
  4628. smalltalk.method({
  4629. selector: 'id:',
  4630. category: 'attributes',
  4631. fn: function (aString){
  4632. var self=this;
  4633. self._at_put_("id",aString);
  4634. return self;},
  4635. source: unescape('id%3A%20aString%0A%20%20%20%20self%20at%3A%20%27id%27%20put%3A%20aString%0A')}),
  4636. smalltalk.TagBrush);
  4637. smalltalk.addMethod(
  4638. '_src_',
  4639. smalltalk.method({
  4640. selector: 'src:',
  4641. category: 'attributes',
  4642. fn: function (aString){
  4643. var self=this;
  4644. self._at_put_("src",aString);
  4645. return self;},
  4646. source: unescape('src%3A%20aString%0A%20%20%20%20self%20%20at%3A%20%27src%27%20put%3A%20aString%0A')}),
  4647. smalltalk.TagBrush);
  4648. smalltalk.addMethod(
  4649. '_href_',
  4650. smalltalk.method({
  4651. selector: 'href:',
  4652. category: 'attributes',
  4653. fn: function (aString){
  4654. var self=this;
  4655. self._at_put_("href",aString);
  4656. return self;},
  4657. source: unescape('href%3A%20aString%0A%20%20%20%20self%20at%3A%20%27href%27%20put%3A%20aString%0A')}),
  4658. smalltalk.TagBrush);
  4659. smalltalk.addMethod(
  4660. '_title_',
  4661. smalltalk.method({
  4662. selector: 'title:',
  4663. category: 'attributes',
  4664. fn: function (aString){
  4665. var self=this;
  4666. self._at_put_("title",aString);
  4667. return self;},
  4668. source: unescape('title%3A%20aString%0A%20%20%20%20self%20at%3A%20%27title%27%20put%3A%20aString%0A')}),
  4669. smalltalk.TagBrush);
  4670. smalltalk.addMethod(
  4671. '_style_',
  4672. smalltalk.method({
  4673. selector: 'style:',
  4674. category: 'attributes',
  4675. fn: function (aString){
  4676. var self=this;
  4677. self._at_put_("style",aString);
  4678. return self;},
  4679. source: unescape('style%3A%20aString%0A%20%20%20%20self%20at%3A%20%27style%27%20put%3A%20aString%0A')}),
  4680. smalltalk.TagBrush);
  4681. smalltalk.addMethod(
  4682. '_initializeFromString_canvas_',
  4683. smalltalk.method({
  4684. selector: 'initializeFromString:canvas:',
  4685. category: 'initialization',
  4686. fn: function (aString, aCanvas){
  4687. var self=this;
  4688. self['@element']=self._createElementFor_(aString);
  4689. canvas=aCanvas;
  4690. return self;},
  4691. 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')}),
  4692. smalltalk.TagBrush);
  4693. smalltalk.addMethod(
  4694. '_element',
  4695. smalltalk.method({
  4696. selector: 'element',
  4697. category: 'accessing',
  4698. fn: function (){
  4699. var self=this;
  4700. return self['@element'];
  4701. return self;},
  4702. source: unescape('element%0A%20%20%20%20%5Eelement%0A')}),
  4703. smalltalk.TagBrush);
  4704. smalltalk.addMethod(
  4705. '_asJQuery',
  4706. smalltalk.method({
  4707. selector: 'asJQuery',
  4708. category: 'converting',
  4709. fn: function (){
  4710. var self=this;
  4711. return (function(){return smalltalk.JQuery._from_(jQuery(self['@element']))})();
  4712. return self;},
  4713. source: unescape('asJQuery%0A%20%20%20%20%5E%7B%27return%20smalltalk.JQuery._from_%28jQuery%28self%5B%27%27@element%27%27%5D%29%29%27%7D%0A')}),
  4714. smalltalk.TagBrush);
  4715. smalltalk.addMethod(
  4716. '_onKeyDown_',
  4717. smalltalk.method({
  4718. selector: 'onKeyDown:',
  4719. category: 'events',
  4720. fn: function (aBlock){
  4721. var self=this;
  4722. self._asJQuery()._on_do_("keydown",aBlock);
  4723. return self;},
  4724. source: unescape('onKeyDown%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keydown%27%20do%3A%20aBlock%0A')}),
  4725. smalltalk.TagBrush);
  4726. smalltalk.addMethod(
  4727. '_onKeyPress_',
  4728. smalltalk.method({
  4729. selector: 'onKeyPress:',
  4730. category: 'events',
  4731. fn: function (aBlock){
  4732. var self=this;
  4733. self._asJQuery()._on_do_("keypress",aBlock);
  4734. return self;},
  4735. source: unescape('onKeyPress%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keypress%27%20do%3A%20aBlock%0A')}),
  4736. smalltalk.TagBrush);
  4737. smalltalk.addMethod(
  4738. '_onKeyUp_',
  4739. smalltalk.method({
  4740. selector: 'onKeyUp:',
  4741. category: 'events',
  4742. fn: function (aBlock){
  4743. var self=this;
  4744. self._asJQuery()._on_do_("keyup",aBlock);
  4745. return self;},
  4746. source: unescape('onKeyUp%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keyup%27%20do%3A%20aBlock%0A')}),
  4747. smalltalk.TagBrush);
  4748. smalltalk.addMethod(
  4749. '_onFocus_',
  4750. smalltalk.method({
  4751. selector: 'onFocus:',
  4752. category: 'events',
  4753. fn: function (aBlock){
  4754. var self=this;
  4755. self._asJQuery()._on_do_("focus",aBlock);
  4756. return self;},
  4757. source: unescape('onFocus%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27focus%27%20do%3A%20aBlock%0A')}),
  4758. smalltalk.TagBrush);
  4759. smalltalk.addMethod(
  4760. '_onBlur_',
  4761. smalltalk.method({
  4762. selector: 'onBlur:',
  4763. category: 'events',
  4764. fn: function (aBlock){
  4765. var self=this;
  4766. self._asJQuery()._on_do_("blur",aBlock);
  4767. return self;},
  4768. source: unescape('onBlur%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27blur%27%20do%3A%20aBlock%0A')}),
  4769. smalltalk.TagBrush);
  4770. smalltalk.addMethod(
  4771. '_onChange_',
  4772. smalltalk.method({
  4773. selector: 'onChange:',
  4774. category: 'events',
  4775. fn: function (aBlock){
  4776. var self=this;
  4777. self._asJQuery()._on_do_("change",aBlock);
  4778. return self;},
  4779. source: unescape('onChange%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27change%27%20do%3A%20aBlock%0A')}),
  4780. smalltalk.TagBrush);
  4781. smalltalk.addMethod(
  4782. '_onClick_',
  4783. smalltalk.method({
  4784. selector: 'onClick:',
  4785. category: 'events',
  4786. fn: function (aBlock){
  4787. var self=this;
  4788. self._asJQuery()._on_do_("click",aBlock);
  4789. return self;},
  4790. source: unescape('onClick%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27click%27%20do%3A%20aBlock%0A')}),
  4791. smalltalk.TagBrush);
  4792. smalltalk.addMethod(
  4793. '_createElementFor_',
  4794. smalltalk.method({
  4795. selector: 'createElementFor:',
  4796. category: 'private',
  4797. fn: function (aString){
  4798. var self=this;
  4799. return (function(){return document.createElement(String(aString))})();
  4800. return self;},
  4801. source: unescape('createElementFor%3A%20aString%0A%20%20%20%20%5E%7B%27return%20document.createElement%28String%28aString%29%29%27%7D%0A')}),
  4802. smalltalk.TagBrush);
  4803. smalltalk.addMethod(
  4804. '_createTextNodeFor_',
  4805. smalltalk.method({
  4806. selector: 'createTextNodeFor:',
  4807. category: 'private',
  4808. fn: function (aString){
  4809. var self=this;
  4810. return (function(){return document.createTextNode(String(aString))})();
  4811. return self;},
  4812. source: unescape('createTextNodeFor%3A%20aString%0A%20%20%20%20%5E%7B%27return%20document.createTextNode%28String%28aString%29%29%27%7D%0A')}),
  4813. smalltalk.TagBrush);
  4814. smalltalk.addMethod(
  4815. '_fromString_canvas_',
  4816. smalltalk.method({
  4817. selector: 'fromString:canvas:',
  4818. category: 'instance creation',
  4819. fn: function (aString, aCanvas){
  4820. var self=this;
  4821. return (function($rec){$rec._initializeFromString_canvas_(aString,aCanvas);return $rec._yourself();})(self._new());
  4822. return self;},
  4823. 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')}),
  4824. smalltalk.TagBrush.klass);
  4825. smalltalk.addClass('Widget', smalltalk.Object, ['root'], 'Canvas');
  4826. smalltalk.addMethod(
  4827. '_root',
  4828. smalltalk.method({
  4829. selector: 'root',
  4830. category: 'accessing',
  4831. fn: function (){
  4832. var self=this;
  4833. return self['@root'];
  4834. return self;},
  4835. source: unescape('root%0A%20%20%20%20%5Eroot%0A')}),
  4836. smalltalk.Widget);
  4837. smalltalk.addMethod(
  4838. '_appendToBrush_',
  4839. smalltalk.method({
  4840. selector: 'appendToBrush:',
  4841. category: 'adding',
  4842. fn: function (aTagBrush){
  4843. var self=this;
  4844. self._appendToJQuery_(aTagBrush._asJQuery());
  4845. return self;},
  4846. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20self%20appendToJQuery%3A%20aTagBrush%20asJQuery%0A')}),
  4847. smalltalk.Widget);
  4848. smalltalk.addMethod(
  4849. '_appendToJQuery_',
  4850. smalltalk.method({
  4851. selector: 'appendToJQuery:',
  4852. category: 'adding',
  4853. fn: function (aJQuery){
  4854. var self=this;
  4855. self._render();
  4856. aJQuery._append_(self._root()._asJQuery());
  4857. return self;},
  4858. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20self%20render.%0A%20%20%20%20aJQuery%20append%3A%20self%20root%20asJQuery%0A')}),
  4859. smalltalk.Widget);
  4860. smalltalk.addMethod(
  4861. '_alert_',
  4862. smalltalk.method({
  4863. selector: 'alert:',
  4864. category: 'actions',
  4865. fn: function (aString){
  4866. var self=this;
  4867. (function(){alert(aString)})();
  4868. return self;},
  4869. source: unescape('alert%3A%20aString%0A%20%20%20%20%7B%27alert%28aString%29%27%7D%0A')}),
  4870. smalltalk.Widget);
  4871. smalltalk.addMethod(
  4872. '_confirm_',
  4873. smalltalk.method({
  4874. selector: 'confirm:',
  4875. category: 'actions',
  4876. fn: function (aString){
  4877. var self=this;
  4878. return (function(){return window.confirm(aString)})();
  4879. return self;},
  4880. source: unescape('confirm%3A%20aString%0A%20%20%20%20%5E%7B%27return%20window.confirm%28aString%29%27%7D%0A')}),
  4881. smalltalk.Widget);
  4882. smalltalk.addMethod(
  4883. '_prompt_',
  4884. smalltalk.method({
  4885. selector: 'prompt:',
  4886. category: 'actions',
  4887. fn: function (aString){
  4888. var self=this;
  4889. return self._prompt_default_(aString,"");
  4890. return self;},
  4891. source: unescape('prompt%3A%20aString%0A%20%20%20%20%5Eself%20prompt%3A%20aString%20default%3A%20%27%27%0A')}),
  4892. smalltalk.Widget);
  4893. smalltalk.addMethod(
  4894. '_prompt_default_',
  4895. smalltalk.method({
  4896. selector: 'prompt:default:',
  4897. category: 'actions',
  4898. fn: function (aString, anotherString){
  4899. var self=this;
  4900. return (function(){return window.prompt(aString, anotherString)})();
  4901. return self;},
  4902. source: unescape('prompt%3A%20aString%20default%3A%20anotherString%0A%20%20%20%20%5E%7B%27return%20window.prompt%28aString%2C%20anotherString%29%27%7D%0A')}),
  4903. smalltalk.Widget);
  4904. smalltalk.addMethod(
  4905. '_update',
  4906. smalltalk.method({
  4907. selector: 'update',
  4908. category: 'actions',
  4909. fn: function (){
  4910. var self=this;
  4911. var canvas=nil;
  4912. canvas=smalltalk.HTMLCanvas._new();
  4913. canvas._root_(self._root());
  4914. self._root()._asJQuery()._empty();
  4915. self._renderOn_(canvas);
  4916. return self;},
  4917. 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')}),
  4918. smalltalk.Widget);
  4919. smalltalk.addMethod(
  4920. '_render',
  4921. smalltalk.method({
  4922. selector: 'render',
  4923. category: 'rendering',
  4924. fn: function (){
  4925. var self=this;
  4926. var canvas=nil;
  4927. canvas=smalltalk.HTMLCanvas._new();
  4928. self['@root']=canvas._root();
  4929. self._renderOn_(canvas);
  4930. return self;},
  4931. 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')}),
  4932. smalltalk.Widget);
  4933. smalltalk.addMethod(
  4934. '_renderOn_',
  4935. smalltalk.method({
  4936. selector: 'renderOn:',
  4937. category: 'rendering',
  4938. fn: function (html){
  4939. var self=this;
  4940. self;
  4941. return self;},
  4942. source: unescape('renderOn%3A%20html%0A%20%20%20%20self%0A')}),
  4943. smalltalk.Widget);
  4944. smalltalk.addClass('Counter', smalltalk.Widget, ['count'], 'Canvas');
  4945. smalltalk.addMethod(
  4946. '_initialize',
  4947. smalltalk.method({
  4948. selector: 'initialize',
  4949. category: 'initialization',
  4950. fn: function (){
  4951. var self=this;
  4952. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  4953. self['@count']=(0);
  4954. return self;},
  4955. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20count%20%3A%3D%200%0A')}),
  4956. smalltalk.Counter);
  4957. smalltalk.addMethod(
  4958. '_renderOn_',
  4959. smalltalk.method({
  4960. selector: 'renderOn:',
  4961. category: 'rendering',
  4962. fn: function (html){
  4963. var self=this;
  4964. html._h1()._with_(self['@count']._asString());
  4965. (function($rec){$rec._with_(unescape("++"));return $rec._onClick_((function(){return self._increase();}));})(html._button());
  4966. (function($rec){$rec._with_(unescape("--"));return $rec._onClick_((function(){return self._decrease();}));})(html._button());
  4967. return self;},
  4968. 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')}),
  4969. smalltalk.Counter);
  4970. smalltalk.addMethod(
  4971. '_increase',
  4972. smalltalk.method({
  4973. selector: 'increase',
  4974. category: 'actions',
  4975. fn: function (){
  4976. var self=this;
  4977. self['@count']=self['@count'].__plus((1));
  4978. self._update();
  4979. return self;},
  4980. source: unescape('increase%0A%20%20%20%20count%20%3A%3D%20count%20+%201.%0A%20%20%20%20self%20update%0A')}),
  4981. smalltalk.Counter);
  4982. smalltalk.addMethod(
  4983. '_decrease',
  4984. smalltalk.method({
  4985. selector: 'decrease',
  4986. category: 'actions',
  4987. fn: function (){
  4988. var self=this;
  4989. self['@count']=self['@count'].__minus((1));
  4990. self._update();
  4991. return self;},
  4992. source: unescape('decrease%0A%20%20%20%20count%20%3A%3D%20count%20-%201.%0A%20%20%20%20self%20update%0A')}),
  4993. smalltalk.Counter);
  4994. smalltalk.addClass('PPParser', smalltalk.Object, ['memo'], 'Parser');
  4995. smalltalk.addMethod(
  4996. '_initialize',
  4997. smalltalk.method({
  4998. selector: 'initialize',
  4999. category: 'initialization',
  5000. fn: function (){
  5001. var self=this;
  5002. self['@memo']=smalltalk.Dictionary._new();
  5003. return self;},
  5004. source: unescape('initialize%0A%09memo%20%3A%3D%20Dictionary%20new%0A')}),
  5005. smalltalk.PPParser);
  5006. smalltalk.addMethod(
  5007. '_memo',
  5008. smalltalk.method({
  5009. selector: 'memo',
  5010. category: 'accessing',
  5011. fn: function (){
  5012. var self=this;
  5013. return self['@memo'];
  5014. return self;},
  5015. source: unescape('memo%0A%09%5Ememo%0A')}),
  5016. smalltalk.PPParser);
  5017. smalltalk.addMethod(
  5018. '_onFailure_',
  5019. smalltalk.method({
  5020. selector: 'onFailure:',
  5021. category: 'error handling',
  5022. fn: function (aBlock){
  5023. var self=this;
  5024. return smalltalk.PPFailureActionParser._on_block_(self,aBlock);
  5025. return self;},
  5026. source: unescape('onFailure%3A%20aBlock%0A%09%5EPPFailureActionParser%20on%3A%20self%20block%3A%20aBlock%0A')}),
  5027. smalltalk.PPParser);
  5028. smalltalk.addMethod(
  5029. '_flatten',
  5030. smalltalk.method({
  5031. selector: 'flatten',
  5032. category: 'operations',
  5033. fn: function (){
  5034. var self=this;
  5035. return smalltalk.PPFlattenParser._on_(self);
  5036. return self;},
  5037. source: unescape('flatten%0A%09%5EPPFlattenParser%20on%3A%20self%0A')}),
  5038. smalltalk.PPParser);
  5039. smalltalk.addMethod(
  5040. '_withSource',
  5041. smalltalk.method({
  5042. selector: 'withSource',
  5043. category: 'operations',
  5044. fn: function (){
  5045. var self=this;
  5046. return smalltalk.PPSourceParser._on_(self);
  5047. return self;},
  5048. source: unescape('withSource%0A%09%5EPPSourceParser%20on%3A%20self%0A')}),
  5049. smalltalk.PPParser);
  5050. smalltalk.addMethod(
  5051. '__eq_eq_gt',
  5052. smalltalk.method({
  5053. selector: '==>',
  5054. category: 'operations',
  5055. fn: function (aBlock){
  5056. var self=this;
  5057. return smalltalk.PPActionParser._on_block_(self,aBlock);
  5058. return self;},
  5059. source: unescape('%3D%3D%3E%20aBlock%0A%09%5EPPActionParser%20on%3A%20self%20block%3A%20aBlock%0A')}),
  5060. smalltalk.PPParser);
  5061. smalltalk.addMethod(
  5062. '__comma',
  5063. smalltalk.method({
  5064. selector: ',',
  5065. category: 'operations',
  5066. fn: function (aParser){
  5067. var self=this;
  5068. return smalltalk.PPSequenceParser._with_with_(self,aParser);
  5069. return self;},
  5070. source: unescape('%2C%20aParser%0A%09%5EPPSequenceParser%20with%3A%20self%20with%3A%20aParser%0A')}),
  5071. smalltalk.PPParser);
  5072. smalltalk.addMethod(
  5073. '__slash',
  5074. smalltalk.method({
  5075. selector: '/',
  5076. category: 'operations',
  5077. fn: function (aParser){
  5078. var self=this;
  5079. return smalltalk.PPChoiceParser._with_with_(self,aParser);
  5080. return self;},
  5081. source: unescape('/%20aParser%0A%09%5EPPChoiceParser%20with%3A%20self%20with%3A%20aParser%0A')}),
  5082. smalltalk.PPParser);
  5083. smalltalk.addMethod(
  5084. '_plus',
  5085. smalltalk.method({
  5086. selector: 'plus',
  5087. category: 'operations',
  5088. fn: function (){
  5089. var self=this;
  5090. return smalltalk.PPRepeatingParser._on_min_(self,(1));
  5091. return self;},
  5092. source: unescape('plus%0A%09%5EPPRepeatingParser%20on%3A%20self%20min%3A%201%0A')}),
  5093. smalltalk.PPParser);
  5094. smalltalk.addMethod(
  5095. '_star',
  5096. smalltalk.method({
  5097. selector: 'star',
  5098. category: 'operations',
  5099. fn: function (){
  5100. var self=this;
  5101. return smalltalk.PPRepeatingParser._on_min_(self,(0));
  5102. return self;},
  5103. source: unescape('star%0A%09%5EPPRepeatingParser%20on%3A%20self%20min%3A%200%0A')}),
  5104. smalltalk.PPParser);
  5105. smalltalk.addMethod(
  5106. '_not',
  5107. smalltalk.method({
  5108. selector: 'not',
  5109. category: 'operations',
  5110. fn: function (){
  5111. var self=this;
  5112. return smalltalk.PPNotParser._on_(self);
  5113. return self;},
  5114. source: unescape('not%0A%09%5EPPNotParser%20on%3A%20self%0A')}),
  5115. smalltalk.PPParser);
  5116. smalltalk.addMethod(
  5117. '_optional',
  5118. smalltalk.method({
  5119. selector: 'optional',
  5120. category: 'operations',
  5121. fn: function (){
  5122. var self=this;
  5123. return self.__slash(smalltalk.PPEpsilonParser._new());
  5124. return self;},
  5125. source: unescape('optional%0A%09%5Eself%20/%20PPEpsilonParser%20new%0A')}),
  5126. smalltalk.PPParser);
  5127. smalltalk.addMethod(
  5128. '_memoizedParse_',
  5129. smalltalk.method({
  5130. selector: 'memoizedParse:',
  5131. category: 'operations',
  5132. fn: function (aStream){
  5133. var self=this;
  5134. var start=nil;
  5135. var end=nil;
  5136. var node=nil;
  5137. start=aStream._position();
  5138. return self._memo()._at_ifPresent_ifAbsent_(start,(function(value){aStream._position_(self._memo()._at_(start)._second());return value._first();}),(function(){node=self._parse_(aStream);end=aStream._position();self._memo()._at_put_(start,smalltalk.Array._with_with_(node,end));return node;}));
  5139. return self;},
  5140. 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')}),
  5141. smalltalk.PPParser);
  5142. smalltalk.addMethod(
  5143. '_parse_',
  5144. smalltalk.method({
  5145. selector: 'parse:',
  5146. category: 'parsing',
  5147. fn: function (aStream){
  5148. var self=this;
  5149. self._subclassResponsibility();
  5150. return self;},
  5151. source: unescape('parse%3A%20aStream%0A%09self%20subclassResponsibility%0A')}),
  5152. smalltalk.PPParser);
  5153. smalltalk.addMethod(
  5154. '_parseAll_',
  5155. smalltalk.method({
  5156. selector: 'parseAll:',
  5157. category: 'parsing',
  5158. fn: function (aStream){
  5159. var self=this;
  5160. var result=nil;
  5161. result=smalltalk.PPSequenceParser._with_with_(self,smalltalk.PPEOFParser._new())._memoizedParse_(aStream);
  5162. return result._isParseFailure()._ifTrue_ifFalse_((function(){return self._error_(result._messageFor_(aStream._contents()));}),(function(){return result._first();}));
  5163. return self;},
  5164. 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')}),
  5165. smalltalk.PPParser);
  5166. smalltalk.addClass('PPEOFParser', smalltalk.PPParser, [], 'Parser');
  5167. smalltalk.addMethod(
  5168. '_parse_',
  5169. smalltalk.method({
  5170. selector: 'parse:',
  5171. category: 'parsing',
  5172. fn: function (aStream){
  5173. var self=this;
  5174. return aStream._atEnd()._ifFalse_ifTrue_((function(){return smalltalk.PPFailure._new()._reason_at_("EOF expected",aStream._position());}),(function(){return nil;}));
  5175. return self;},
  5176. 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')}),
  5177. smalltalk.PPEOFParser);
  5178. smalltalk.addClass('PPAnyParser', smalltalk.PPParser, [], 'Parser');
  5179. smalltalk.addMethod(
  5180. '_parse_',
  5181. smalltalk.method({
  5182. selector: 'parse:',
  5183. category: 'parsing',
  5184. fn: function (aStream){
  5185. var self=this;
  5186. return aStream._atEnd()._ifTrue_ifFalse_((function(){return smalltalk.PPFailure._new()._reason_at_("did not expect EOF",aStream._position());}),(function(){return aStream._next();}));
  5187. return self;},
  5188. 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')}),
  5189. smalltalk.PPAnyParser);
  5190. smalltalk.addClass('PPEpsilonParser', smalltalk.PPParser, [], 'Parser');
  5191. smalltalk.addMethod(
  5192. '_parse_',
  5193. smalltalk.method({
  5194. selector: 'parse:',
  5195. category: 'parsing',
  5196. fn: function (aStream){
  5197. var self=this;
  5198. return nil;
  5199. return self;},
  5200. source: unescape('parse%3A%20aStream%0A%09%5Enil%0A')}),
  5201. smalltalk.PPEpsilonParser);
  5202. smalltalk.addClass('PPStringParser', smalltalk.PPParser, ['string'], 'Parser');
  5203. smalltalk.addMethod(
  5204. '_string',
  5205. smalltalk.method({
  5206. selector: 'string',
  5207. category: 'accessing',
  5208. fn: function (){
  5209. var self=this;
  5210. return self['@string'];
  5211. return self;},
  5212. source: unescape('string%0A%09%5Estring%0A')}),
  5213. smalltalk.PPStringParser);
  5214. smalltalk.addMethod(
  5215. '_string_',
  5216. smalltalk.method({
  5217. selector: 'string:',
  5218. category: 'accessing',
  5219. fn: function (aString){
  5220. var self=this;
  5221. self['@string']=aString;
  5222. return self;},
  5223. source: unescape('string%3A%20aString%0A%09string%20%3A%3D%20aString%0A')}),
  5224. smalltalk.PPStringParser);
  5225. smalltalk.addMethod(
  5226. '_parse_',
  5227. smalltalk.method({
  5228. selector: 'parse:',
  5229. category: 'parsing',
  5230. fn: function (aStream){
  5231. var self=this;
  5232. var position=nil;
  5233. var result=nil;
  5234. position=aStream._position();
  5235. result=aStream._next_(self._string()._size());
  5236. return result.__eq(self._string())._ifTrue_ifFalse_((function(){return result;}),(function(){aStream._position_(position);return (function($rec){$rec._reason_("Expected ".__comma(self._string()).__comma(" but got ").__comma(result._at_(position)._printString()));return $rec._yourself();})(smalltalk.PPFailure._new());}));
  5237. return self;},
  5238. 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')}),
  5239. smalltalk.PPStringParser);
  5240. smalltalk.addClass('PPCharacterParser', smalltalk.PPParser, ['regexp'], 'Parser');
  5241. smalltalk.addMethod(
  5242. '_string_',
  5243. smalltalk.method({
  5244. selector: 'string:',
  5245. category: 'accessing',
  5246. fn: function (aString){
  5247. var self=this;
  5248. self['@regexp']=smalltalk.RegularExpression._fromString_(unescape("%5B").__comma(aString).__comma(unescape("%5D")));
  5249. return self;},
  5250. 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')}),
  5251. smalltalk.PPCharacterParser);
  5252. smalltalk.addMethod(
  5253. '_parse_',
  5254. smalltalk.method({
  5255. selector: 'parse:',
  5256. category: 'parsing',
  5257. fn: function (aStream){
  5258. var self=this;
  5259. return aStream._peek()._notNil()._and_((function(){return self._match_(aStream._peek());}))._ifTrue_ifFalse_((function(){return aStream._next();}),(function(){return smalltalk.PPFailure._new()._reason_at_("Could not match",aStream._position());}));
  5260. return self;},
  5261. 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')}),
  5262. smalltalk.PPCharacterParser);
  5263. smalltalk.addMethod(
  5264. '_match_',
  5265. smalltalk.method({
  5266. selector: 'match:',
  5267. category: 'private',
  5268. fn: function (aString){
  5269. var self=this;
  5270. return aString._match_(self['@regexp']);
  5271. return self;},
  5272. source: unescape('match%3A%20aString%0A%09%5EaString%20match%3A%20regexp%0A')}),
  5273. smalltalk.PPCharacterParser);
  5274. smalltalk.addClass('PPListParser', smalltalk.PPParser, ['parsers'], 'Parser');
  5275. smalltalk.addMethod(
  5276. '_parsers',
  5277. smalltalk.method({
  5278. selector: 'parsers',
  5279. category: 'accessing',
  5280. fn: function (){
  5281. var self=this;
  5282. return self['@parsers']._ifNil_((function(){return [];}));
  5283. return self;},
  5284. source: unescape('parsers%0A%09%5Eparsers%20ifNil%3A%20%5B%23%28%29%5D%0A')}),
  5285. smalltalk.PPListParser);
  5286. smalltalk.addMethod(
  5287. '_parsers_',
  5288. smalltalk.method({
  5289. selector: 'parsers:',
  5290. category: 'accessing',
  5291. fn: function (aCollection){
  5292. var self=this;
  5293. self['@parsers']=aCollection;
  5294. return self;},
  5295. source: unescape('parsers%3A%20aCollection%0A%09parsers%20%3A%3D%20aCollection%0A')}),
  5296. smalltalk.PPListParser);
  5297. smalltalk.addMethod(
  5298. '_copyWith_',
  5299. smalltalk.method({
  5300. selector: 'copyWith:',
  5301. category: 'copying',
  5302. fn: function (aParser){
  5303. var self=this;
  5304. return self._class()._withAll_(self._parsers()._copyWith_(aParser));
  5305. return self;},
  5306. source: unescape('copyWith%3A%20aParser%0A%09%5Eself%20class%20withAll%3A%20%28self%20parsers%20copyWith%3A%20aParser%29%0A')}),
  5307. smalltalk.PPListParser);
  5308. smalltalk.addMethod(
  5309. '_withAll_',
  5310. smalltalk.method({
  5311. selector: 'withAll:',
  5312. category: 'instance creation',
  5313. fn: function (aCollection){
  5314. var self=this;
  5315. return (function($rec){$rec._parsers_(aCollection);return $rec._yourself();})(self._new());
  5316. return self;},
  5317. source: unescape('withAll%3A%20aCollection%0A%09%20%20%20%20%5Eself%20new%0A%09%09parsers%3A%20aCollection%3B%0A%09%09yourself%0A')}),
  5318. smalltalk.PPListParser.klass);
  5319. smalltalk.addMethod(
  5320. '_with_with_',
  5321. smalltalk.method({
  5322. selector: 'with:with:',
  5323. category: 'instance creation',
  5324. fn: function (aParser, anotherParser){
  5325. var self=this;
  5326. return self._withAll_(smalltalk.Array._with_with_(aParser,anotherParser));
  5327. return self;},
  5328. 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')}),
  5329. smalltalk.PPListParser.klass);
  5330. smalltalk.addClass('PPSequenceParser', smalltalk.PPListParser, [], 'Parser');
  5331. smalltalk.addMethod(
  5332. '__comma',
  5333. smalltalk.method({
  5334. selector: ',',
  5335. category: 'copying',
  5336. fn: function (aRule){
  5337. var self=this;
  5338. return self._copyWith_(aRule);
  5339. return self;},
  5340. source: unescape('%2C%20aRule%0A%09%5Eself%20copyWith%3A%20aRule%0A')}),
  5341. smalltalk.PPSequenceParser);
  5342. smalltalk.addMethod(
  5343. '_parse_',
  5344. smalltalk.method({
  5345. selector: 'parse:',
  5346. category: 'parsing',
  5347. fn: function (aStream){
  5348. var self=this;
  5349. var start=nil;
  5350. var elements=nil;
  5351. var element=nil;
  5352. start=aStream._position();
  5353. elements=[];
  5354. self._parsers()._detect_ifNone_((function(each){element=each._memoizedParse_(aStream);elements._add_(element);return element._isParseFailure();}),(function(){return nil;}));
  5355. return element._isParseFailure()._ifFalse_ifTrue_((function(){return elements;}),(function(){aStream._position_(start);return element;}));
  5356. return self;},
  5357. 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')}),
  5358. smalltalk.PPSequenceParser);
  5359. smalltalk.addClass('PPChoiceParser', smalltalk.PPListParser, [], 'Parser');
  5360. smalltalk.addMethod(
  5361. '__slash',
  5362. smalltalk.method({
  5363. selector: '/',
  5364. category: 'copying',
  5365. fn: function (aRule){
  5366. var self=this;
  5367. return self._copyWith_(aRule);
  5368. return self;},
  5369. source: unescape('/%20aRule%0A%09%5Eself%20copyWith%3A%20aRule%0A')}),
  5370. smalltalk.PPChoiceParser);
  5371. smalltalk.addMethod(
  5372. '_parse_',
  5373. smalltalk.method({
  5374. selector: 'parse:',
  5375. category: 'parsing',
  5376. fn: function (aStream){
  5377. var self=this;
  5378. var result=nil;
  5379. self._parsers()._detect_ifNone_((function(each){result=each._memoizedParse_(aStream);return result._isParseFailure()._not();}),(function(){return nil;}));
  5380. return result;
  5381. return self;},
  5382. 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')}),
  5383. smalltalk.PPChoiceParser);
  5384. smalltalk.addClass('PPDelegateParser', smalltalk.PPParser, ['parser'], 'Parser');
  5385. smalltalk.addMethod(
  5386. '_parser',
  5387. smalltalk.method({
  5388. selector: 'parser',
  5389. category: 'accessing',
  5390. fn: function (){
  5391. var self=this;
  5392. return self['@parser'];
  5393. return self;},
  5394. source: unescape('parser%0A%09%5Eparser%0A')}),
  5395. smalltalk.PPDelegateParser);
  5396. smalltalk.addMethod(
  5397. '_parser_',
  5398. smalltalk.method({
  5399. selector: 'parser:',
  5400. category: 'accessing',
  5401. fn: function (aParser){
  5402. var self=this;
  5403. self['@parser']=aParser;
  5404. return self;},
  5405. source: unescape('parser%3A%20aParser%0A%09parser%20%3A%3D%20aParser%0A')}),
  5406. smalltalk.PPDelegateParser);
  5407. smalltalk.addMethod(
  5408. '_parse_',
  5409. smalltalk.method({
  5410. selector: 'parse:',
  5411. category: 'parsing',
  5412. fn: function (aStream){
  5413. var self=this;
  5414. return self._parser()._memoizedParse_(aStream);
  5415. return self;},
  5416. source: unescape('parse%3A%20aStream%0A%09%5Eself%20parser%20memoizedParse%3A%20aStream%0A')}),
  5417. smalltalk.PPDelegateParser);
  5418. smalltalk.addMethod(
  5419. '_on_',
  5420. smalltalk.method({
  5421. selector: 'on:',
  5422. category: 'instance creation',
  5423. fn: function (aParser){
  5424. var self=this;
  5425. return (function($rec){$rec._parser_(aParser);return $rec._yourself();})(self._new());
  5426. return self;},
  5427. source: unescape('on%3A%20aParser%0A%09%20%20%20%20%5Eself%20new%0A%09%09parser%3A%20aParser%3B%0A%09%09yourself%0A')}),
  5428. smalltalk.PPDelegateParser.klass);
  5429. smalltalk.addClass('PPAndParser', smalltalk.PPDelegateParser, [], 'Parser');
  5430. smalltalk.addMethod(
  5431. '_parse_',
  5432. smalltalk.method({
  5433. selector: 'parse:',
  5434. category: 'parsing',
  5435. fn: function (aStream){
  5436. var self=this;
  5437. return self._basicParse_(aStream);
  5438. return self;},
  5439. source: unescape('parse%3A%20aStream%0A%09%5Eself%20basicParse%3A%20aStream%0A')}),
  5440. smalltalk.PPAndParser);
  5441. smalltalk.addMethod(
  5442. '_basicParse_',
  5443. smalltalk.method({
  5444. selector: 'basicParse:',
  5445. category: 'parsing',
  5446. fn: function (aStream){
  5447. var self=this;
  5448. var element=nil;
  5449. var position=nil;
  5450. position=aStream._position();
  5451. element=self._parser()._memoizedParse_(aStream);
  5452. aStream._position_(position);
  5453. return element;
  5454. return self;},
  5455. 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')}),
  5456. smalltalk.PPAndParser);
  5457. smalltalk.addClass('PPNotParser', smalltalk.PPAndParser, [], 'Parser');
  5458. smalltalk.addMethod(
  5459. '_parse_',
  5460. smalltalk.method({
  5461. selector: 'parse:',
  5462. category: 'parsing',
  5463. fn: function (aStream){
  5464. var self=this;
  5465. var element=nil;
  5466. element=self._basicParse_(aStream);
  5467. return element._isParseFailure()._ifTrue_ifFalse_((function(){return nil;}),(function(){return smalltalk.PPFailure._reason_at_(element,aStream._position());}));
  5468. return self;},
  5469. 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')}),
  5470. smalltalk.PPNotParser);
  5471. smalltalk.addClass('PPActionParser', smalltalk.PPDelegateParser, ['block'], 'Parser');
  5472. smalltalk.addMethod(
  5473. '_block',
  5474. smalltalk.method({
  5475. selector: 'block',
  5476. category: 'accessing',
  5477. fn: function (){
  5478. var self=this;
  5479. return self['@block'];
  5480. return self;},
  5481. source: unescape('block%0A%09%5Eblock%0A')}),
  5482. smalltalk.PPActionParser);
  5483. smalltalk.addMethod(
  5484. '_block_',
  5485. smalltalk.method({
  5486. selector: 'block:',
  5487. category: 'accessing',
  5488. fn: function (aBlock){
  5489. var self=this;
  5490. self['@block']=aBlock;
  5491. return self;},
  5492. source: unescape('block%3A%20aBlock%0A%09block%20%3A%3D%20aBlock%0A')}),
  5493. smalltalk.PPActionParser);
  5494. smalltalk.addMethod(
  5495. '_parse_',
  5496. smalltalk.method({
  5497. selector: 'parse:',
  5498. category: 'parsing',
  5499. fn: function (aStream){
  5500. var self=this;
  5501. var element=nil;
  5502. element=self._parser()._memoizedParse_(aStream);
  5503. return element._isParseFailure()._ifFalse_ifTrue_((function(){return self._block()._value_(element);}),(function(){return element;}));
  5504. return self;},
  5505. 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')}),
  5506. smalltalk.PPActionParser);
  5507. smalltalk.addMethod(
  5508. '_on_block_',
  5509. smalltalk.method({
  5510. selector: 'on:block:',
  5511. category: 'instance creation',
  5512. fn: function (aParser, aBlock){
  5513. var self=this;
  5514. return (function($rec){$rec._parser_(aParser);$rec._block_(aBlock);return $rec._yourself();})(self._new());
  5515. return self;},
  5516. 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')}),
  5517. smalltalk.PPActionParser.klass);
  5518. smalltalk.addClass('PPFlattenParser', smalltalk.PPDelegateParser, [], 'Parser');
  5519. smalltalk.addMethod(
  5520. '_parse_',
  5521. smalltalk.method({
  5522. selector: 'parse:',
  5523. category: 'parsing',
  5524. fn: function (aStream){
  5525. var self=this;
  5526. var start=nil;
  5527. var element=nil;
  5528. var stop=nil;
  5529. start=aStream._position();
  5530. element=self._parser()._memoizedParse_(aStream);
  5531. return element._isParseFailure()._ifTrue_ifFalse_((function(){return element;}),(function(){return aStream._collection()._copyFrom_to_(start.__plus((1)),aStream._position());}));
  5532. return self;},
  5533. 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')}),
  5534. smalltalk.PPFlattenParser);
  5535. smalltalk.addClass('PPSourceParser', smalltalk.PPDelegateParser, [], 'Parser');
  5536. smalltalk.addMethod(
  5537. '_parse_',
  5538. smalltalk.method({
  5539. selector: 'parse:',
  5540. category: 'parsing',
  5541. fn: function (aStream){
  5542. var self=this;
  5543. var start=nil;
  5544. var element=nil;
  5545. var stop=nil;
  5546. var result=nil;
  5547. start=aStream._position();
  5548. element=self._parser()._memoizedParse_(aStream);
  5549. return element._isParseFailure()._ifTrue_ifFalse_((function(){return element;}),(function(){result=aStream._collection()._copyFrom_to_(start.__plus((1)),aStream._position());return smalltalk.Array._with_with_(element,result);}));
  5550. return self;},
  5551. 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')}),
  5552. smalltalk.PPSourceParser);
  5553. smalltalk.addClass('PPRepeatingParser', smalltalk.PPDelegateParser, ['min'], 'Parser');
  5554. smalltalk.addMethod(
  5555. '_min',
  5556. smalltalk.method({
  5557. selector: 'min',
  5558. category: 'accessing',
  5559. fn: function (){
  5560. var self=this;
  5561. return self['@min'];
  5562. return self;},
  5563. source: unescape('min%0A%09%5Emin%0A')}),
  5564. smalltalk.PPRepeatingParser);
  5565. smalltalk.addMethod(
  5566. '_min_',
  5567. smalltalk.method({
  5568. selector: 'min:',
  5569. category: 'accessing',
  5570. fn: function (aNumber){
  5571. var self=this;
  5572. self['@min']=aNumber;
  5573. return self;},
  5574. source: unescape('min%3A%20aNumber%0A%09min%20%3A%3D%20aNumber%0A')}),
  5575. smalltalk.PPRepeatingParser);
  5576. smalltalk.addMethod(
  5577. '_parse_',
  5578. smalltalk.method({
  5579. selector: 'parse:',
  5580. category: 'parsing',
  5581. fn: function (aStream){
  5582. var self=this;
  5583. var start=nil;
  5584. var element=nil;
  5585. var elements=nil;
  5586. var failure=nil;
  5587. start=aStream._position();
  5588. elements=smalltalk.Array._new();
  5589. (function(){return elements._size().__lt(self._min())._and_((function(){return failure._isNil();}));})._whileTrue_((function(){element=self._parser()._memoizedParse_(aStream);return element._isParseFailure()._ifFalse_ifTrue_((function(){return elements._addLast_(element);}),(function(){aStream._position_(start);return failure=element;}));}));
  5590. return failure._ifNil_ifNotNil_((function(){(function(){return failure._isNil();})._whileTrue_((function(){element=self._parser()._memoizedParse_(aStream);return element._isParseFailure()._ifTrue_ifFalse_((function(){return failure=element;}),(function(){return elements._addLast_(element);}));}));return elements;}),(function(){return failure;}));
  5591. return self;},
  5592. 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')}),
  5593. smalltalk.PPRepeatingParser);
  5594. smalltalk.addMethod(
  5595. '_on_min_',
  5596. smalltalk.method({
  5597. selector: 'on:min:',
  5598. category: 'instance creation',
  5599. fn: function (aParser, aNumber){
  5600. var self=this;
  5601. return (function($rec){$rec._parser_(aParser);$rec._min_(aNumber);return $rec._yourself();})(self._new());
  5602. return self;},
  5603. 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')}),
  5604. smalltalk.PPRepeatingParser.klass);
  5605. smalltalk.addClass('PPFailure', smalltalk.Object, ['position', 'reason'], 'Parser');
  5606. smalltalk.addMethod(
  5607. '_position',
  5608. smalltalk.method({
  5609. selector: 'position',
  5610. category: 'accessing',
  5611. fn: function (){
  5612. var self=this;
  5613. return self['@position']._ifNil_((function(){return (0);}));
  5614. return self;},
  5615. source: unescape('position%0A%09%5Eposition%20ifNil%3A%20%5B0%5D%0A')}),
  5616. smalltalk.PPFailure);
  5617. smalltalk.addMethod(
  5618. '_position_',
  5619. smalltalk.method({
  5620. selector: 'position:',
  5621. category: 'accessing',
  5622. fn: function (aNumber){
  5623. var self=this;
  5624. self['@position']=aNumber;
  5625. return self;},
  5626. source: unescape('position%3A%20aNumber%0A%09position%20%3A%3D%20aNumber%0A')}),
  5627. smalltalk.PPFailure);
  5628. smalltalk.addMethod(
  5629. '_reason',
  5630. smalltalk.method({
  5631. selector: 'reason',
  5632. category: 'accessing',
  5633. fn: function (){
  5634. var self=this;
  5635. return self['@reason']._ifNil_((function(){return "";}));
  5636. return self;},
  5637. source: unescape('reason%0A%09%5Ereason%20ifNil%3A%20%5B%27%27%5D%0A')}),
  5638. smalltalk.PPFailure);
  5639. smalltalk.addMethod(
  5640. '_reason_',
  5641. smalltalk.method({
  5642. selector: 'reason:',
  5643. category: 'accessing',
  5644. fn: function (aString){
  5645. var self=this;
  5646. self['@reason']=aString;
  5647. return self;},
  5648. source: unescape('reason%3A%20aString%0A%09reason%20%3A%3D%20aString%0A')}),
  5649. smalltalk.PPFailure);
  5650. smalltalk.addMethod(
  5651. '_reason_at_',
  5652. smalltalk.method({
  5653. selector: 'reason:at:',
  5654. category: 'accessing',
  5655. fn: function (aString, anInteger){
  5656. var self=this;
  5657. (function($rec){$rec._reason_(aString);return $rec._position_(anInteger);})(self);
  5658. return self;},
  5659. 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')}),
  5660. smalltalk.PPFailure);
  5661. smalltalk.addMethod(
  5662. '_isParseFailure',
  5663. smalltalk.method({
  5664. selector: 'isParseFailure',
  5665. category: 'testing',
  5666. fn: function (){
  5667. var self=this;
  5668. return true;
  5669. return self;},
  5670. source: unescape('isParseFailure%0A%09%5Etrue%0A')}),
  5671. smalltalk.PPFailure);
  5672. smalltalk.addMethod(
  5673. '_reason_at_',
  5674. smalltalk.method({
  5675. selector: 'reason:at:',
  5676. category: 'instance creation',
  5677. fn: function (aString, anInteger){
  5678. var self=this;
  5679. return (function($rec){$rec._reason_at_(aString,anInteger);return $rec._yourself();})(self._new());
  5680. return self;},
  5681. 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')}),
  5682. smalltalk.PPFailure.klass);
  5683. smalltalk.addClass('SmalltalkParser', smalltalk.Object, [], 'Parser');
  5684. smalltalk.addMethod(
  5685. '_parse_',
  5686. smalltalk.method({
  5687. selector: 'parse:',
  5688. category: 'parsing',
  5689. fn: function (aStream){
  5690. var self=this;
  5691. return self._parser()._parse_(aStream);
  5692. return self;},
  5693. source: unescape('parse%3A%20aStream%0A%09%5Eself%20parser%20parse%3A%20aStream%0A')}),
  5694. smalltalk.SmalltalkParser);
  5695. smalltalk.addMethod(
  5696. '_parser',
  5697. smalltalk.method({
  5698. selector: 'parser',
  5699. category: 'grammar',
  5700. fn: function (){
  5701. var self=this;
  5702. var method=nil;
  5703. var expression=nil;
  5704. var separator=nil;
  5705. var comment=nil;
  5706. var ws=nil;
  5707. var identifier=nil;
  5708. var keyword=nil;
  5709. var className=nil;
  5710. var string=nil;
  5711. var symbol=nil;
  5712. var number=nil;
  5713. var literalArray=nil;
  5714. var variable=nil;
  5715. var reference=nil;
  5716. var classReference=nil;
  5717. var literal=nil;
  5718. var ret=nil;
  5719. var methodParser=nil;
  5720. var expressionParser=nil;
  5721. var keyword=nil;
  5722. var unarySelector=nil;
  5723. var binarySelector=nil;
  5724. var keywordPattern=nil;
  5725. var unaryPattern=nil;
  5726. var binaryPattern=nil;
  5727. var assignment=nil;
  5728. var temps=nil;
  5729. var blockParamList=nil;
  5730. var block=nil;
  5731. var expression=nil;
  5732. var expressions=nil;
  5733. var subexpression=nil;
  5734. var statements=nil;
  5735. var sequence=nil;
  5736. var operand=nil;
  5737. var unaryMessage=nil;
  5738. var unarySend=nil;
  5739. var unaryTail=nil;
  5740. var binaryMessage=nil;
  5741. var binarySend=nil;
  5742. var binaryTail=nil;
  5743. var keywordMessage=nil;
  5744. var keywordSend=nil;
  5745. var keywordPair=nil;
  5746. var cascade=nil;
  5747. var message=nil;
  5748. var jsStatement=nil;
  5749. separator=smalltalk.String._cr().__comma(smalltalk.String._space()).__comma(smalltalk.String._lf()).__comma(smalltalk.String._tab())._asChoiceParser();
  5750. comment=unescape("%22")._asCharacterParser().__comma(unescape("%22")._asParser()._not().__comma(smalltalk.PPAnyParser._new())._star()).__comma(unescape("%22")._asCharacterParser())._flatten();
  5751. ws=separator.__slash(comment)._star();
  5752. identifier=unescape("a-z")._asCharacterParser().__comma(unescape("a-zA-Z0-9")._asCharacterParser()._star())._flatten();
  5753. keyword=identifier.__comma(":"._asParser())._flatten();
  5754. className=unescape("A-Z")._asCharacterParser().__comma(unescape("a-zA-Z0-9")._asCharacterParser()._star())._flatten();
  5755. string=unescape("%27")._asParser().__comma(unescape("%27%27")._asParser().__slash(unescape("%27")._asParser()._not().__comma(smalltalk.PPAnyParser._new()))._star()._flatten()).__comma(unescape("%27")._asParser()).__eq_eq_gt((function(node){return smalltalk.ValueNode._new()._value_(node._at_((2))._replace_with_(unescape("%27%27"),unescape("%27")));}));
  5756. symbol=unescape("%23")._asParser().__comma(unescape("a-zA-Z0-9")._asCharacterParser()._plus()._flatten()).__eq_eq_gt((function(node){return smalltalk.ValueNode._new()._value_(node._second());}));
  5757. number=unescape("0-9")._asCharacterParser()._plus().__comma("."._asParser().__comma(unescape("0-9")._asCharacterParser()._plus())._optional())._flatten().__eq_eq_gt((function(node){return smalltalk.ValueNode._new()._value_(node._asNumber());}));
  5758. literal=smalltalk.PPDelegateParser._new();
  5759. literalArray=unescape("%23%28")._asParser().__comma(ws.__comma(literal).__comma(ws)._star()).__comma(unescape("%29")._asParser()).__eq_eq_gt((function(node){return smalltalk.ValueNode._new()._value_(smalltalk.Array._withAll_(node._second()._collect_((function(each){return each._second()._value();}))));}));
  5760. variable=identifier.__eq_eq_gt((function(token){return smalltalk.VariableNode._new()._value_(token);}));
  5761. classReference=className.__eq_eq_gt((function(token){return smalltalk.ClassReferenceNode._new()._value_(token);}));
  5762. reference=variable.__slash(classReference);
  5763. binarySelector=unescape("+*/%3D%3E%3C%2C@%25%7E-")._asCharacterParser()._plus()._flatten();
  5764. unarySelector=identifier;
  5765. keywordPattern=ws.__comma(keyword).__comma(ws).__comma(identifier)._plus().__eq_eq_gt((function(nodes){return smalltalk.Array._with_with_(nodes._collect_((function(each){return each._at_((2));}))._join_(""),nodes._collect_((function(each){return each._at_((4));})));}));
  5766. binaryPattern=ws.__comma(binarySelector).__comma(ws).__comma(identifier).__eq_eq_gt((function(node){return smalltalk.Array._with_with_(node._second(),smalltalk.Array._with_(node._fourth()));}));
  5767. unaryPattern=ws.__comma(unarySelector).__eq_eq_gt((function(node){return smalltalk.Array._with_with_(node._second(),smalltalk.Array._new());}));
  5768. expression=smalltalk.PPDelegateParser._new();
  5769. expressions=expression.__comma(ws.__comma("."._asParser()).__comma(ws).__comma(expression).__eq_eq_gt((function(node){return node._fourth();}))._star()).__eq_eq_gt((function(node){var result=nil;
  5770. result=smalltalk.Array._with_(node._first());node._second()._do_((function(each){return result._add_(each);}));return result;}));
  5771. assignment=reference.__comma(ws).__comma(unescape("%3A%3D")._asParser()).__comma(ws).__comma(expression).__eq_eq_gt((function(node){return (function($rec){$rec._left_(node._first());return $rec._right_(node._at_((5)));})(smalltalk.AssignmentNode._new());}));
  5772. ret=unescape("%5E")._asParser().__comma(ws).__comma(expression).__comma(ws).__comma("."._asParser()._optional()).__eq_eq_gt((function(node){return (function($rec){$rec._addNode_(node._third());return $rec._yourself();})(smalltalk.ReturnNode._new());}));
  5773. temps=unescape("%7C")._asParser().__comma(ws.__comma(identifier)._star()).__comma(ws).__comma(unescape("%7C")._asParser()).__eq_eq_gt((function(node){return node._second()._collect_((function(each){return each._second();}));}));
  5774. blockParamList=":"._asParser().__comma(identifier).__comma(ws)._plus().__comma(unescape("%7C")._asParser()).__eq_eq_gt((function(node){return node._first()._collect_((function(each){return each._second();}));}));
  5775. subexpression=unescape("%28")._asParser().__comma(ws).__comma(expression).__comma(ws).__comma(unescape("%29")._asParser()).__eq_eq_gt((function(node){return node._third();}));
  5776. statements=ret.__eq_eq_gt((function(node){return smalltalk.Array._with_(node);})).__slash(expressions.__comma(ws).__comma("."._asParser()).__comma(ws).__comma(ret).__eq_eq_gt((function(node){return (function($rec){$rec._add_(node._at_((5)));return $rec._yourself();})(node._first());}))).__slash(expressions.__comma("."._asParser()._optional()).__eq_eq_gt((function(node){return node._first();})));
  5777. sequence=temps._optional().__comma(ws).__comma(statements._optional()).__comma(ws).__eq_eq_gt((function(node){return (function($rec){$rec._temps_(node._first());$rec._nodes_(node._third());return $rec._yourself();})(smalltalk.SequenceNode._new());}));
  5778. block=unescape("%5B")._asParser().__comma(ws).__comma(blockParamList._optional()).__comma(ws).__comma(sequence._optional()).__comma(ws).__comma(unescape("%5D")._asParser()).__eq_eq_gt((function(node){return (function($rec){$rec._parameters_(node._third());return $rec._addNode_(node._at_((5))._asBlockSequenceNode());})(smalltalk.BlockNode._new());}));
  5779. operand=literal.__slash(reference).__slash(subexpression);
  5780. literal._parser_(number.__slash(string).__slash(literalArray).__slash(symbol).__slash(block));
  5781. unaryMessage=ws.__comma(unarySelector).__comma(":"._asParser()._not()).__eq_eq_gt((function(node){return smalltalk.SendNode._new()._selector_(node._second());}));
  5782. unaryTail=smalltalk.PPDelegateParser._new();
  5783. unaryTail._parser_(unaryMessage.__comma(unaryTail._optional()).__eq_eq_gt((function(node){return node._second()._ifNil_ifNotNil_((function(){return node._first();}),(function(){return node._second()._valueForReceiver_(node._first());}));})));
  5784. unarySend=operand.__comma(unaryTail._optional()).__eq_eq_gt((function(node){return node._second()._ifNil_ifNotNil_((function(){return node._first();}),(function(){return node._second()._valueForReceiver_(node._first());}));}));
  5785. binaryMessage=ws.__comma(binarySelector).__comma(ws).__comma(unarySend.__slash(operand)).__eq_eq_gt((function(node){return (function($rec){$rec._selector_(node._second());return $rec._arguments_(smalltalk.Array._with_(node._fourth()));})(smalltalk.SendNode._new());}));
  5786. binaryTail=smalltalk.PPDelegateParser._new();
  5787. binaryTail._parser_(binaryMessage.__comma(binaryTail._optional()).__eq_eq_gt((function(node){return node._second()._ifNil_ifNotNil_((function(){return node._first();}),(function(){return node._second()._valueForReceiver_(node._first());}));})));
  5788. binarySend=unarySend.__comma(binaryTail._optional()).__eq_eq_gt((function(node){return node._second()._ifNil_ifNotNil_((function(){return node._first();}),(function(){return node._second()._valueForReceiver_(node._first());}));}));
  5789. keywordPair=keyword.__comma(ws).__comma(binarySend);
  5790. keywordMessage=ws.__comma(keywordPair)._plus().__eq_eq_gt((function(nodes){return (function($rec){$rec._selector_(nodes._collect_((function(each){return each._second()._first();}))._join_(""));return $rec._arguments_(nodes._collect_((function(each){return each._second()._third();})));})(smalltalk.SendNode._new());}));
  5791. keywordSend=binarySend.__comma(keywordMessage).__eq_eq_gt((function(node){return node._second()._valueForReceiver_(node._first());}));
  5792. message=binaryMessage.__slash(unaryMessage).__slash(keywordMessage);
  5793. cascade=keywordSend.__slash(binarySend).__comma(ws.__comma(unescape("%3B")._asParser()).__comma(message)._plus()).__eq_eq_gt((function(node){return node._first()._cascadeNodeWithMessages_(node._second()._collect_((function(each){return each._third();})));}));
  5794. jsStatement=unescape("%7B")._asParser().__comma(ws).__comma(string).__comma(ws).__comma(unescape("%7D")._asParser()).__eq_eq_gt((function(node){return (function($rec){$rec._source_(node._third());return $rec._yourself();})(smalltalk.JSStatementNode._new());}));
  5795. expression._parser_(assignment.__slash(cascade).__slash(keywordSend).__slash(binarySend).__slash(jsStatement));
  5796. method=ws.__comma(keywordPattern.__slash(binaryPattern).__slash(unaryPattern)).__comma(ws).__comma(sequence._optional()).__comma(ws)._withSource().__eq_eq_gt((function(node){return (function($rec){$rec._selector_(node._first()._second()._first());$rec._arguments_(node._first()._second()._second());$rec._addNode_(node._first()._fourth());$rec._source_(node._second());return $rec._yourself();})(smalltalk.MethodNode._new());}));
  5797. return method.__comma(smalltalk.PPEOFParser._new()).__eq_eq_gt((function(node){return node._first();}));
  5798. return self;},
  5799. 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')}),
  5800. smalltalk.SmalltalkParser);
  5801. smalltalk.addMethod(
  5802. '_parse_',
  5803. smalltalk.method({
  5804. selector: 'parse:',
  5805. category: 'instance creation',
  5806. fn: function (aStream){
  5807. var self=this;
  5808. return self._new()._parse_(aStream);
  5809. return self;},
  5810. source: unescape('parse%3A%20aStream%0A%09%20%20%20%20%5Eself%20new%0A%09%09parse%3A%20aStream%0A')}),
  5811. smalltalk.SmalltalkParser.klass);
  5812. smalltalk.addClass('Chunk', smalltalk.Object, ['contents'], 'Parser');
  5813. smalltalk.addMethod(
  5814. '_contents',
  5815. smalltalk.method({
  5816. selector: 'contents',
  5817. category: 'accessing',
  5818. fn: function (){
  5819. var self=this;
  5820. return self['@contents']._ifNil_((function(){return "";}));
  5821. return self;},
  5822. source: unescape('contents%0A%09%5Econtents%20ifNil%3A%20%5B%27%27%5D%0A')}),
  5823. smalltalk.Chunk);
  5824. smalltalk.addMethod(
  5825. '_contents_',
  5826. smalltalk.method({
  5827. selector: 'contents:',
  5828. category: 'accessing',
  5829. fn: function (aString){
  5830. var self=this;
  5831. self['@contents']=aString;
  5832. return self;},
  5833. source: unescape('contents%3A%20aString%0A%09contents%20%3A%3D%20aString%0A')}),
  5834. smalltalk.Chunk);
  5835. smalltalk.addMethod(
  5836. '_isEmptyChunk',
  5837. smalltalk.method({
  5838. selector: 'isEmptyChunk',
  5839. category: 'testing',
  5840. fn: function (){
  5841. var self=this;
  5842. return false;
  5843. return self;},
  5844. source: unescape('isEmptyChunk%0A%09%5Efalse%0A')}),
  5845. smalltalk.Chunk);
  5846. smalltalk.addMethod(
  5847. '_isInstructionChunk',
  5848. smalltalk.method({
  5849. selector: 'isInstructionChunk',
  5850. category: 'testing',
  5851. fn: function (){
  5852. var self=this;
  5853. return false;
  5854. return self;},
  5855. source: unescape('isInstructionChunk%0A%09%5Efalse%0A')}),
  5856. smalltalk.Chunk);
  5857. smalltalk.addClass('InstructionChunk', smalltalk.Chunk, [], 'Parser');
  5858. smalltalk.addMethod(
  5859. '_isInstructionChunk',
  5860. smalltalk.method({
  5861. selector: 'isInstructionChunk',
  5862. category: 'testing',
  5863. fn: function (){
  5864. var self=this;
  5865. return true;
  5866. return self;},
  5867. source: unescape('isInstructionChunk%0A%09%5Etrue%0A')}),
  5868. smalltalk.InstructionChunk);
  5869. smalltalk.addClass('EmptyChunk', smalltalk.Chunk, [], 'Parser');
  5870. smalltalk.addMethod(
  5871. '_isEmptyChunk',
  5872. smalltalk.method({
  5873. selector: 'isEmptyChunk',
  5874. category: 'testing',
  5875. fn: function (){
  5876. var self=this;
  5877. return true;
  5878. return self;},
  5879. source: unescape('isEmptyChunk%0A%09%5Etrue%0A')}),
  5880. smalltalk.EmptyChunk);
  5881. smalltalk.addClass('ChunkParser', smalltalk.Object, ['parser', 'separator', 'eof', 'ws', 'chunk', 'emptyChunk', 'instructionChunk'], 'Parser');
  5882. smalltalk.addMethod(
  5883. '_parser',
  5884. smalltalk.method({
  5885. selector: 'parser',
  5886. category: 'accessing',
  5887. fn: function (){
  5888. var self=this;
  5889. return self['@parser']._ifNil_((function(){return self['@parser']=self._instructionChunk().__slash(self._emptyChunk()).__slash(self._chunk()).__slash(self._eof());}));
  5890. return self;},
  5891. 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')}),
  5892. smalltalk.ChunkParser);
  5893. smalltalk.addMethod(
  5894. '_eof',
  5895. smalltalk.method({
  5896. selector: 'eof',
  5897. category: 'accessing',
  5898. fn: function (){
  5899. var self=this;
  5900. return self['@eof']._ifNil_((function(){return self['@eof']=self._ws().__comma(smalltalk.PPEOFParser._new()).__eq_eq_gt((function(node){return nil;}));}));
  5901. return self;},
  5902. 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')}),
  5903. smalltalk.ChunkParser);
  5904. smalltalk.addMethod(
  5905. '_separator',
  5906. smalltalk.method({
  5907. selector: 'separator',
  5908. category: 'accessing',
  5909. fn: function (){
  5910. var self=this;
  5911. return self['@separator']._ifNil_((function(){return self['@separator']=smalltalk.String._cr().__comma(smalltalk.String._space()).__comma(smalltalk.String._lf()).__comma(smalltalk.String._tab())._asChoiceParser();}));
  5912. return self;},
  5913. 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')}),
  5914. smalltalk.ChunkParser);
  5915. smalltalk.addMethod(
  5916. '_ws',
  5917. smalltalk.method({
  5918. selector: 'ws',
  5919. category: 'accessing',
  5920. fn: function (){
  5921. var self=this;
  5922. return self['@ws']._ifNil_((function(){return self['@ws']=self._separator()._star();}));
  5923. return self;},
  5924. source: unescape('ws%0A%09%5Ews%20ifNil%3A%20%5Bws%20%3A%3D%20self%20separator%20star%5D%0A')}),
  5925. smalltalk.ChunkParser);
  5926. smalltalk.addMethod(
  5927. '_chunk',
  5928. smalltalk.method({
  5929. selector: 'chunk',
  5930. category: 'accessing',
  5931. fn: function (){
  5932. var self=this;
  5933. return self['@chunk']._ifNil_((function(){return self['@chunk']=self._ws().__comma(unescape("%21%21")._asParser().__slash(unescape("%21")._asParser()._not().__comma(smalltalk.PPAnyParser._new()))._plus()._flatten()).__comma(unescape("%21")._asParser()).__eq_eq_gt((function(node){return smalltalk.Chunk._new()._contents_(node._second()._replace_with_(unescape("%21%21"),unescape("%21")));}));}));
  5934. return self;},
  5935. 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')}),
  5936. smalltalk.ChunkParser);
  5937. smalltalk.addMethod(
  5938. '_emptyChunk',
  5939. smalltalk.method({
  5940. selector: 'emptyChunk',
  5941. category: 'accessing',
  5942. fn: function (){
  5943. var self=this;
  5944. return self['@emptyChunk']._ifNil_((function(){return self['@emptyChunk']=self._separator()._plus().__comma(unescape("%21")._asParser()).__comma(self._ws()).__eq_eq_gt((function(node){return smalltalk.EmptyChunk._new();}));}));
  5945. return self;},
  5946. 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')}),
  5947. smalltalk.ChunkParser);
  5948. smalltalk.addMethod(
  5949. '_instructionChunk',
  5950. smalltalk.method({
  5951. selector: 'instructionChunk',
  5952. category: '',
  5953. fn: function (){
  5954. var self=this;
  5955. return self['@instructionChunk']._ifNil_((function(){return self['@instructionChunk']=self._ws().__comma(unescape("%21")._asParser()).__comma(self._chunk()).__eq_eq_gt((function(node){return smalltalk.InstructionChunk._new()._contents_(node._last()._contents());}));}));
  5956. return self;},
  5957. 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')}),
  5958. smalltalk.ChunkParser);
  5959. smalltalk.addClass('Importer', smalltalk.Object, ['chunkParser'], 'Parser');
  5960. smalltalk.addMethod(
  5961. '_chunkParser',
  5962. smalltalk.method({
  5963. selector: 'chunkParser',
  5964. category: 'accessing',
  5965. fn: function (){
  5966. var self=this;
  5967. return self['@chunkParser']._ifNil_((function(){return self['@chunkParser']=smalltalk.ChunkParser._new()._parser();}));
  5968. return self;},
  5969. source: unescape('chunkParser%0A%09%5EchunkParser%20ifNil%3A%20%5BchunkParser%20%3A%3D%20ChunkParser%20new%20parser%5D%0A')}),
  5970. smalltalk.Importer);
  5971. smalltalk.addMethod(
  5972. '_import_',
  5973. smalltalk.method({
  5974. selector: 'import:',
  5975. category: 'fileIn',
  5976. fn: function (aStream){
  5977. var self=this;
  5978. aStream._atEnd()._ifFalse_((function(){var nextChunk=nil;
  5979. nextChunk=self._chunkParser()._parse_(aStream);return nextChunk._ifNotNil_((function(){nextChunk._isInstructionChunk()._ifTrue_ifFalse_((function(){return smalltalk.Compiler._new()._loadExpression_(nextChunk._contents())._scanFrom_(aStream);}),(function(){return smalltalk.Compiler._new()._loadExpression_(nextChunk._contents());}));return self._import_(aStream);}));}));
  5980. return self;},
  5981. 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')}),
  5982. smalltalk.Importer);
  5983. smalltalk.addClass('Exporter', smalltalk.Object, [], 'Parser');
  5984. smalltalk.addMethod(
  5985. '_exportCategory_',
  5986. smalltalk.method({
  5987. selector: 'exportCategory:',
  5988. category: 'fileout',
  5989. fn: function (aString){
  5990. var self=this;
  5991. var stream=nil;
  5992. stream=""._writeStream();
  5993. smalltalk.Smalltalk._current()._classes()._select_((function(each){return each._category().__eq(aString);}))._do_((function(each){return stream._nextPutAll_(self._export_(each));}));
  5994. return stream._contents();
  5995. return self;},
  5996. 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')}),
  5997. smalltalk.Exporter);
  5998. smalltalk.addMethod(
  5999. '_export_',
  6000. smalltalk.method({
  6001. selector: 'export:',
  6002. category: 'fileOut',
  6003. fn: function (aClass){
  6004. var self=this;
  6005. var stream=nil;
  6006. stream=""._writeStream();
  6007. self._exportDefinitionOf_on_(aClass,stream);
  6008. stream._nextPutAll_(smalltalk.String._cr());
  6009. self._exportMethodsOf_on_(aClass,stream);
  6010. stream._nextPutAll_(smalltalk.String._cr());
  6011. self._exportMetaDefinitionOf_on_(aClass,stream);
  6012. self._exportMethodsOf_on_(aClass._class(),stream);
  6013. stream._nextPutAll_(smalltalk.String._cr());
  6014. return stream._contents();
  6015. return self;},
  6016. 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')}),
  6017. smalltalk.Exporter);
  6018. smalltalk.addMethod(
  6019. '_exportDefinitionOf_on_',
  6020. smalltalk.method({
  6021. selector: 'exportDefinitionOf:on:',
  6022. category: 'private',
  6023. fn: function (aClass, aStream){
  6024. var self=this;
  6025. (function($rec){$rec._nextPutAll_(unescape("smalltalk.addClass%28"));$rec._nextPutAll_(unescape("%27").__comma(self._classNameFor_(aClass)).__comma(unescape("%27%2C%20")));$rec._nextPutAll_("smalltalk.".__comma(self._classNameFor_(aClass._superclass())));return $rec._nextPutAll_(unescape("%2C%20%5B"));})(aStream);
  6026. aClass._instVarNames()._do_separatedBy_((function(each){return aStream._nextPutAll_(unescape("%27").__comma(each).__comma(unescape("%27")));}),(function(){return aStream._nextPutAll_(unescape("%2C%20"));}));
  6027. (function($rec){$rec._nextPutAll_(unescape("%5D%2C%20%27"));$rec._nextPutAll_(aClass._category().__comma(unescape("%27")));return $rec._nextPutAll_(unescape("%29%3B"));})(aStream);
  6028. aClass._comment()._notEmpty()._ifTrue_((function(){return (function($rec){$rec._nextPutAll_(smalltalk.String._cr());$rec._nextPutAll_("smalltalk.");$rec._nextPutAll_(self._classNameFor_(aClass));$rec._nextPutAll_(unescape(".comment%3D"));return $rec._nextPutAll_(unescape("unescape%28%27").__comma(aClass._comment()._escaped()).__comma(unescape("%27%29")));})(aStream);}));
  6029. return self;},
  6030. source: unescape('exportDefinitionOf%3A%20aClass%20on%3A%20aStream%0A%09aStream%20%0A%09%20%20%20%20nextPutAll%3A%20%27smalltalk.addClass%28%27%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%27%27%27%2C%20%28self%20classNameFor%3A%20aClass%29%2C%20%27%27%27%2C%20%27%3B%0A%09%20%20%20%20nextPutAll%3A%20%27smalltalk.%27%2C%20%28self%20classNameFor%3A%20aClass%20superclass%29%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%2C%20%5B%27.%0A%09aClass%20instVarNames%20%0A%09%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20aStream%20nextPutAll%3A%20%27%27%27%27%2C%20each%2C%20%27%27%27%27%5D%0A%09%20%20%20%20separatedBy%3A%20%5BaStream%20nextPutAll%3A%20%27%2C%20%27%5D.%0A%09aStream%09%0A%09%20%20%20%20nextPutAll%3A%20%27%5D%2C%20%27%27%27%3B%0A%09%20%20%20%20nextPutAll%3A%20aClass%20category%2C%20%27%27%27%27%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%29%3B%27.%0A%09aClass%20comment%20notEmpty%20ifTrue%3A%20%5B%0A%09%20%20%20%20aStream%20%0A%09%20%20%20%20%09nextPutAll%3A%20String%20cr%3B%0A%09%09nextPutAll%3A%20%27smalltalk.%27%3B%0A%09%09nextPutAll%3A%20%28self%20classNameFor%3A%20aClass%29%3B%0A%09%09nextPutAll%3A%20%27.comment%3D%27%3B%0A%09%09nextPutAll%3A%20%27unescape%28%27%27%27%2C%20aClass%20comment%20escaped%2C%20%27%27%27%29%27%5D%0A')}),
  6031. smalltalk.Exporter);
  6032. smalltalk.addMethod(
  6033. '_exportMetaDefinitionOf_on_',
  6034. smalltalk.method({
  6035. selector: 'exportMetaDefinitionOf:on:',
  6036. category: 'private',
  6037. fn: function (aClass, aStream){
  6038. var self=this;
  6039. aClass._class()._instVarNames()._isEmpty()._ifFalse_((function(){(function($rec){$rec._nextPutAll_("smalltalk.".__comma(self._classNameFor_(aClass._class())));return $rec._nextPutAll_(unescape(".iVarNames%20%3D%20%5B"));})(aStream);aClass._class()._instVarNames()._do_separatedBy_((function(each){return aStream._nextPutAll_(unescape("%27").__comma(each).__comma(unescape("%27")));}),(function(){return aStream._nextPutAll_(unescape("%2C"));}));return aStream._nextPutAll_(unescape("%5D%3B").__comma(smalltalk.String._cr()));}));
  6040. return self;},
  6041. source: unescape('exportMetaDefinitionOf%3A%20aClass%20on%3A%20aStream%0A%09aClass%20class%20instVarNames%20isEmpty%20ifFalse%3A%20%5B%0A%09%20%20%20%20aStream%20%0A%09%09nextPutAll%3A%20%27smalltalk.%27%2C%20%28self%20classNameFor%3A%20aClass%20class%29%3B%0A%09%09nextPutAll%3A%20%27.iVarNames%20%3D%20%5B%27.%0A%09%20%20%20%20aClass%20class%20instVarNames%0A%09%09do%3A%20%5B%3Aeach%20%7C%20aStream%20nextPutAll%3A%20%27%27%27%27%2C%20each%2C%20%27%27%27%27%5D%0A%09%09separatedBy%3A%20%5BaStream%20nextPutAll%3A%20%27%2C%27%5D.%0A%09%20%20%20%20aStream%20nextPutAll%3A%20%27%5D%3B%27%2C%20String%20cr%5D%0A')}),
  6042. smalltalk.Exporter);
  6043. smalltalk.addMethod(
  6044. '_exportMethodsOf_on_',
  6045. smalltalk.method({
  6046. selector: 'exportMethodsOf:on:',
  6047. category: 'private',
  6048. fn: function (aClass, aStream){
  6049. var self=this;
  6050. aClass._methodDictionary()._keysAndValuesDo_((function(key, value){return (function($rec){$rec._nextPutAll_(unescape("smalltalk.addMethod%28").__comma(smalltalk.String._cr()));$rec._nextPutAll_(unescape("%27").__comma(value._selector()._asSelector()).__comma(unescape("%27%2C")).__comma(smalltalk.String._cr()));$rec._nextPutAll_(unescape("smalltalk.method%28%7B").__comma(smalltalk.String._cr()));$rec._nextPutAll_(unescape("selector%3A%20%27").__comma(value._selector()).__comma(unescape("%27%2C")).__comma(smalltalk.String._cr()));$rec._nextPutAll_(unescape("category%3A%20%27").__comma(value._category()).__comma(unescape("%27%2C")).__comma(smalltalk.String._cr()));$rec._nextPutAll_("fn: ".__comma(value._fn()._compiledSource()).__comma(unescape("%2C")).__comma(smalltalk.String._cr()));$rec._nextPutAll_(unescape("source%3A%20unescape%28%27").__comma(value._source()._escaped()).__comma(unescape("%27%29")));$rec._nextPutAll_(unescape("%7D%29%2C").__comma(smalltalk.String._cr()));$rec._nextPutAll_("smalltalk.".__comma(self._classNameFor_(aClass)));return $rec._nextPutAll_(unescape("%29%3B").__comma(smalltalk.String._cr()).__comma(smalltalk.String._cr()));})(aStream);}));
  6051. return self;},
  6052. 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')}),
  6053. smalltalk.Exporter);
  6054. smalltalk.addMethod(
  6055. '_classNameFor_',
  6056. smalltalk.method({
  6057. selector: 'classNameFor:',
  6058. category: 'private',
  6059. fn: function (aClass){
  6060. var self=this;
  6061. return aClass._isMetaclass()._ifTrue_ifFalse_((function(){return aClass._instanceClass()._name().__comma(".klass");}),(function(){return aClass._isNil()._ifTrue_ifFalse_((function(){return "nil";}),(function(){return aClass._name();}));}));
  6062. return self;},
  6063. 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')}),
  6064. smalltalk.Exporter);
  6065. smalltalk.addClass('Node', smalltalk.Object, ['nodes'], 'Compiler');
  6066. smalltalk.addMethod(
  6067. '_nodes',
  6068. smalltalk.method({
  6069. selector: 'nodes',
  6070. category: 'accessing',
  6071. fn: function (){
  6072. var self=this;
  6073. return self['@nodes']._ifNil_((function(){return self['@nodes']=smalltalk.Array._new();}));
  6074. return self;},
  6075. source: unescape('nodes%0A%09%5Enodes%20ifNil%3A%20%5Bnodes%20%3A%3D%20Array%20new%5D%0A')}),
  6076. smalltalk.Node);
  6077. smalltalk.addMethod(
  6078. '_nodes_',
  6079. smalltalk.method({
  6080. selector: 'nodes:',
  6081. category: 'building',
  6082. fn: function (aCollection){
  6083. var self=this;
  6084. self['@nodes']=aCollection;
  6085. return self;},
  6086. source: unescape('nodes%3A%20aCollection%0A%09nodes%20%3A%3D%20aCollection%0A')}),
  6087. smalltalk.Node);
  6088. smalltalk.addMethod(
  6089. '_addNode_',
  6090. smalltalk.method({
  6091. selector: 'addNode:',
  6092. category: 'accessing',
  6093. fn: function (aNode){
  6094. var self=this;
  6095. self._nodes()._add_(aNode);
  6096. return self;},
  6097. source: unescape('addNode%3A%20aNode%0A%09self%20nodes%20add%3A%20aNode%0A')}),
  6098. smalltalk.Node);
  6099. smalltalk.addMethod(
  6100. '_accept_',
  6101. smalltalk.method({
  6102. selector: 'accept:',
  6103. category: 'visiting',
  6104. fn: function (aVisitor){
  6105. var self=this;
  6106. aVisitor._visitNode_(self);
  6107. return self;},
  6108. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitNode%3A%20self%0A')}),
  6109. smalltalk.Node);
  6110. smalltalk.addClass('MethodNode', smalltalk.Node, ['selector', 'arguments', 'source'], 'Compiler');
  6111. smalltalk.addMethod(
  6112. '_selector',
  6113. smalltalk.method({
  6114. selector: 'selector',
  6115. category: 'accessing',
  6116. fn: function (){
  6117. var self=this;
  6118. return self['@selector'];
  6119. return self;},
  6120. source: unescape('selector%0A%09%5Eselector%0A')}),
  6121. smalltalk.MethodNode);
  6122. smalltalk.addMethod(
  6123. '_selector_',
  6124. smalltalk.method({
  6125. selector: 'selector:',
  6126. category: 'accessing',
  6127. fn: function (aString){
  6128. var self=this;
  6129. self['@selector']=aString;
  6130. return self;},
  6131. source: unescape('selector%3A%20aString%0A%09selector%20%3A%3D%20aString%0A')}),
  6132. smalltalk.MethodNode);
  6133. smalltalk.addMethod(
  6134. '_arguments',
  6135. smalltalk.method({
  6136. selector: 'arguments',
  6137. category: 'accessing',
  6138. fn: function (){
  6139. var self=this;
  6140. return self['@arguments']._ifNil_((function(){return [];}));
  6141. return self;},
  6142. source: unescape('arguments%0A%09%5Earguments%20ifNil%3A%20%5B%23%28%29%5D%0A')}),
  6143. smalltalk.MethodNode);
  6144. smalltalk.addMethod(
  6145. '_arguments_',
  6146. smalltalk.method({
  6147. selector: 'arguments:',
  6148. category: 'accessing',
  6149. fn: function (aCollection){
  6150. var self=this;
  6151. self['@arguments']=aCollection;
  6152. return self;},
  6153. source: unescape('arguments%3A%20aCollection%0A%09arguments%20%3A%3D%20aCollection%0A')}),
  6154. smalltalk.MethodNode);
  6155. smalltalk.addMethod(
  6156. '_source',
  6157. smalltalk.method({
  6158. selector: 'source',
  6159. category: 'accessing',
  6160. fn: function (){
  6161. var self=this;
  6162. return self['@source'];
  6163. return self;},
  6164. source: unescape('source%0A%09%5Esource%0A')}),
  6165. smalltalk.MethodNode);
  6166. smalltalk.addMethod(
  6167. '_source_',
  6168. smalltalk.method({
  6169. selector: 'source:',
  6170. category: 'accessing',
  6171. fn: function (aString){
  6172. var self=this;
  6173. self['@source']=aString;
  6174. return self;},
  6175. source: unescape('source%3A%20aString%0A%09source%20%3A%3D%20aString%0A')}),
  6176. smalltalk.MethodNode);
  6177. smalltalk.addMethod(
  6178. '_accept_',
  6179. smalltalk.method({
  6180. selector: 'accept:',
  6181. category: 'visiting',
  6182. fn: function (aVisitor){
  6183. var self=this;
  6184. aVisitor._visitMethodNode_(self);
  6185. return self;},
  6186. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitMethodNode%3A%20self%0A')}),
  6187. smalltalk.MethodNode);
  6188. smalltalk.addClass('SendNode', smalltalk.Node, ['selector', 'arguments', 'receiver'], 'Compiler');
  6189. smalltalk.addMethod(
  6190. '_selector',
  6191. smalltalk.method({
  6192. selector: 'selector',
  6193. category: 'accessing',
  6194. fn: function (){
  6195. var self=this;
  6196. return self['@selector'];
  6197. return self;},
  6198. source: unescape('selector%0A%09%5Eselector%0A')}),
  6199. smalltalk.SendNode);
  6200. smalltalk.addMethod(
  6201. '_selector_',
  6202. smalltalk.method({
  6203. selector: 'selector:',
  6204. category: 'accessing',
  6205. fn: function (aString){
  6206. var self=this;
  6207. self['@selector']=aString;
  6208. return self;},
  6209. source: unescape('selector%3A%20aString%0A%09selector%20%3A%3D%20aString%0A')}),
  6210. smalltalk.SendNode);
  6211. smalltalk.addMethod(
  6212. '_arguments',
  6213. smalltalk.method({
  6214. selector: 'arguments',
  6215. category: 'accessing',
  6216. fn: function (){
  6217. var self=this;
  6218. return self['@arguments']._ifNil_((function(){return self['@arguments']=[];}));
  6219. return self;},
  6220. source: unescape('arguments%0A%09%5Earguments%20ifNil%3A%20%5Barguments%20%3A%3D%20%23%28%29%5D%0A')}),
  6221. smalltalk.SendNode);
  6222. smalltalk.addMethod(
  6223. '_arguments_',
  6224. smalltalk.method({
  6225. selector: 'arguments:',
  6226. category: 'accessing',
  6227. fn: function (aCollection){
  6228. var self=this;
  6229. self['@arguments']=aCollection;
  6230. return self;},
  6231. source: unescape('arguments%3A%20aCollection%0A%09arguments%20%3A%3D%20aCollection%0A')}),
  6232. smalltalk.SendNode);
  6233. smalltalk.addMethod(
  6234. '_receiver',
  6235. smalltalk.method({
  6236. selector: 'receiver',
  6237. category: 'accessing',
  6238. fn: function (){
  6239. var self=this;
  6240. return self['@receiver'];
  6241. return self;},
  6242. source: unescape('receiver%0A%09%5Ereceiver%0A')}),
  6243. smalltalk.SendNode);
  6244. smalltalk.addMethod(
  6245. '_receiver_',
  6246. smalltalk.method({
  6247. selector: 'receiver:',
  6248. category: 'accessing',
  6249. fn: function (aNode){
  6250. var self=this;
  6251. self['@receiver']=aNode;
  6252. return self;},
  6253. source: unescape('receiver%3A%20aNode%0A%09receiver%20%3A%3D%20aNode%0A')}),
  6254. smalltalk.SendNode);
  6255. smalltalk.addMethod(
  6256. '_valueForReceiver_',
  6257. smalltalk.method({
  6258. selector: 'valueForReceiver:',
  6259. category: 'accessing',
  6260. fn: function (anObject){
  6261. var self=this;
  6262. return (function($rec){$rec._receiver_(self._receiver()._ifNil_ifNotNil_((function(){return anObject;}),(function(){return self._receiver()._valueForReceiver_(anObject);})));$rec._selector_(self._selector());$rec._arguments_(self._arguments());return $rec._yourself();})(smalltalk.SendNode._new());
  6263. return self;},
  6264. 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')}),
  6265. smalltalk.SendNode);
  6266. smalltalk.addMethod(
  6267. '_cascadeNodeWithMessages_',
  6268. smalltalk.method({
  6269. selector: 'cascadeNodeWithMessages:',
  6270. category: 'accessing',
  6271. fn: function (aCollection){
  6272. var self=this;
  6273. var first=nil;
  6274. first=(function($rec){$rec._selector_(self._selector());$rec._arguments_(self._arguments());return $rec._yourself();})(smalltalk.SendNode._new());
  6275. return (function($rec){$rec._receiver_(self._receiver());$rec._nodes_(smalltalk.Array._with_(first).__comma(aCollection));return $rec._yourself();})(smalltalk.CascadeNode._new());
  6276. return self;},
  6277. 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')}),
  6278. smalltalk.SendNode);
  6279. smalltalk.addMethod(
  6280. '_accept_',
  6281. smalltalk.method({
  6282. selector: 'accept:',
  6283. category: 'visiting',
  6284. fn: function (aVisitor){
  6285. var self=this;
  6286. aVisitor._visitSendNode_(self);
  6287. return self;},
  6288. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitSendNode%3A%20self%0A')}),
  6289. smalltalk.SendNode);
  6290. smalltalk.addClass('CascadeNode', smalltalk.Node, ['receiver'], 'Compiler');
  6291. smalltalk.addMethod(
  6292. '_receiver',
  6293. smalltalk.method({
  6294. selector: 'receiver',
  6295. category: 'accessing',
  6296. fn: function (){
  6297. var self=this;
  6298. return self['@receiver'];
  6299. return self;},
  6300. source: unescape('receiver%0A%09%5Ereceiver%0A')}),
  6301. smalltalk.CascadeNode);
  6302. smalltalk.addMethod(
  6303. '_receiver_',
  6304. smalltalk.method({
  6305. selector: 'receiver:',
  6306. category: 'accessing',
  6307. fn: function (aNode){
  6308. var self=this;
  6309. self['@receiver']=aNode;
  6310. return self;},
  6311. source: unescape('receiver%3A%20aNode%0A%09receiver%20%3A%3D%20aNode%0A')}),
  6312. smalltalk.CascadeNode);
  6313. smalltalk.addMethod(
  6314. '_accept_',
  6315. smalltalk.method({
  6316. selector: 'accept:',
  6317. category: 'visiting',
  6318. fn: function (aVisitor){
  6319. var self=this;
  6320. aVisitor._visitCascadeNode_(self);
  6321. return self;},
  6322. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitCascadeNode%3A%20self%0A')}),
  6323. smalltalk.CascadeNode);
  6324. smalltalk.addClass('AssignmentNode', smalltalk.Node, ['left', 'right'], 'Compiler');
  6325. smalltalk.addMethod(
  6326. '_left',
  6327. smalltalk.method({
  6328. selector: 'left',
  6329. category: 'accessing',
  6330. fn: function (){
  6331. var self=this;
  6332. return self['@left'];
  6333. return self;},
  6334. source: unescape('left%0A%09%5Eleft%0A')}),
  6335. smalltalk.AssignmentNode);
  6336. smalltalk.addMethod(
  6337. '_left_',
  6338. smalltalk.method({
  6339. selector: 'left:',
  6340. category: 'accessing',
  6341. fn: function (aNode){
  6342. var self=this;
  6343. self['@left']=aNode;
  6344. return self;},
  6345. source: unescape('left%3A%20aNode%0A%09left%20%3A%3D%20aNode%0A')}),
  6346. smalltalk.AssignmentNode);
  6347. smalltalk.addMethod(
  6348. '_right',
  6349. smalltalk.method({
  6350. selector: 'right',
  6351. category: 'accessing',
  6352. fn: function (){
  6353. var self=this;
  6354. return self['@right'];
  6355. return self;},
  6356. source: unescape('right%0A%09%5Eright%0A')}),
  6357. smalltalk.AssignmentNode);
  6358. smalltalk.addMethod(
  6359. '_right_',
  6360. smalltalk.method({
  6361. selector: 'right:',
  6362. category: 'accessing',
  6363. fn: function (aNode){
  6364. var self=this;
  6365. self['@right']=aNode;
  6366. return self;},
  6367. source: unescape('right%3A%20aNode%0A%09right%20%3A%3D%20aNode%0A')}),
  6368. smalltalk.AssignmentNode);
  6369. smalltalk.addMethod(
  6370. '_accept_',
  6371. smalltalk.method({
  6372. selector: 'accept:',
  6373. category: 'visiting',
  6374. fn: function (aVisitor){
  6375. var self=this;
  6376. aVisitor._visitAssignmentNode_(self);
  6377. return self;},
  6378. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitAssignmentNode%3A%20self%0A')}),
  6379. smalltalk.AssignmentNode);
  6380. smalltalk.addClass('BlockNode', smalltalk.Node, ['parameters'], 'Compiler');
  6381. smalltalk.addMethod(
  6382. '_parameters',
  6383. smalltalk.method({
  6384. selector: 'parameters',
  6385. category: 'accessing',
  6386. fn: function (){
  6387. var self=this;
  6388. return self['@parameters']._ifNil_((function(){return self['@parameters']=smalltalk.Array._new();}));
  6389. return self;},
  6390. source: unescape('parameters%0A%09%5Eparameters%20ifNil%3A%20%5Bparameters%20%3A%3D%20Array%20new%5D%0A')}),
  6391. smalltalk.BlockNode);
  6392. smalltalk.addMethod(
  6393. '_parameters_',
  6394. smalltalk.method({
  6395. selector: 'parameters:',
  6396. category: 'accessing',
  6397. fn: function (aCollection){
  6398. var self=this;
  6399. self['@parameters']=aCollection;
  6400. return self;},
  6401. source: unescape('parameters%3A%20aCollection%0A%09parameters%20%3A%3D%20aCollection%0A')}),
  6402. smalltalk.BlockNode);
  6403. smalltalk.addMethod(
  6404. '_accept_',
  6405. smalltalk.method({
  6406. selector: 'accept:',
  6407. category: 'visiting',
  6408. fn: function (aVisitor){
  6409. var self=this;
  6410. aVisitor._visitBlockNode_(self);
  6411. return self;},
  6412. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitBlockNode%3A%20self%0A')}),
  6413. smalltalk.BlockNode);
  6414. smalltalk.addClass('SequenceNode', smalltalk.Node, ['temps'], 'Compiler');
  6415. smalltalk.addMethod(
  6416. '_temps',
  6417. smalltalk.method({
  6418. selector: 'temps',
  6419. category: 'accessing',
  6420. fn: function (){
  6421. var self=this;
  6422. return self['@temps']._ifNil_((function(){return [];}));
  6423. return self;},
  6424. source: unescape('temps%0A%09%5Etemps%20ifNil%3A%20%5B%23%28%29%5D%0A')}),
  6425. smalltalk.SequenceNode);
  6426. smalltalk.addMethod(
  6427. '_temps_',
  6428. smalltalk.method({
  6429. selector: 'temps:',
  6430. category: 'accessing',
  6431. fn: function (aCollection){
  6432. var self=this;
  6433. self['@temps']=aCollection;
  6434. return self;},
  6435. source: unescape('temps%3A%20aCollection%0A%09temps%20%3A%3D%20aCollection%0A')}),
  6436. smalltalk.SequenceNode);
  6437. smalltalk.addMethod(
  6438. '_asBlockSequenceNode',
  6439. smalltalk.method({
  6440. selector: 'asBlockSequenceNode',
  6441. category: 'testing',
  6442. fn: function (){
  6443. var self=this;
  6444. return (function($rec){$rec._nodes_(self._nodes());$rec._temps_(self._temps());return $rec._yourself();})(smalltalk.BlockSequenceNode._new());
  6445. return self;},
  6446. 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')}),
  6447. smalltalk.SequenceNode);
  6448. smalltalk.addMethod(
  6449. '_accept_',
  6450. smalltalk.method({
  6451. selector: 'accept:',
  6452. category: 'visiting',
  6453. fn: function (aVisitor){
  6454. var self=this;
  6455. aVisitor._visitSequenceNode_(self);
  6456. return self;},
  6457. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitSequenceNode%3A%20self%0A')}),
  6458. smalltalk.SequenceNode);
  6459. smalltalk.addClass('BlockSequenceNode', smalltalk.SequenceNode, [], 'Compiler');
  6460. smalltalk.addMethod(
  6461. '_accept_',
  6462. smalltalk.method({
  6463. selector: 'accept:',
  6464. category: 'visiting',
  6465. fn: function (aVisitor){
  6466. var self=this;
  6467. aVisitor._visitBlockSequenceNode_(self);
  6468. return self;},
  6469. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitBlockSequenceNode%3A%20self%0A')}),
  6470. smalltalk.BlockSequenceNode);
  6471. smalltalk.addClass('ReturnNode', smalltalk.Node, [], 'Compiler');
  6472. smalltalk.addMethod(
  6473. '_accept_',
  6474. smalltalk.method({
  6475. selector: 'accept:',
  6476. category: 'visiting',
  6477. fn: function (aVisitor){
  6478. var self=this;
  6479. aVisitor._visitReturnNode_(self);
  6480. return self;},
  6481. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitReturnNode%3A%20self%0A')}),
  6482. smalltalk.ReturnNode);
  6483. smalltalk.addClass('ValueNode', smalltalk.Node, ['value'], 'Compiler');
  6484. smalltalk.addMethod(
  6485. '_value',
  6486. smalltalk.method({
  6487. selector: 'value',
  6488. category: 'accessing',
  6489. fn: function (){
  6490. var self=this;
  6491. return self['@value'];
  6492. return self;},
  6493. source: unescape('value%0A%09%5Evalue%0A')}),
  6494. smalltalk.ValueNode);
  6495. smalltalk.addMethod(
  6496. '_value_',
  6497. smalltalk.method({
  6498. selector: 'value:',
  6499. category: 'accessing',
  6500. fn: function (anObject){
  6501. var self=this;
  6502. self['@value']=anObject;
  6503. return self;},
  6504. source: unescape('value%3A%20anObject%0A%09value%20%3A%3D%20anObject%0A')}),
  6505. smalltalk.ValueNode);
  6506. smalltalk.addMethod(
  6507. '_accept_',
  6508. smalltalk.method({
  6509. selector: 'accept:',
  6510. category: 'visiting',
  6511. fn: function (aVisitor){
  6512. var self=this;
  6513. aVisitor._visitValueNode_(self);
  6514. return self;},
  6515. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitValueNode%3A%20self%0A')}),
  6516. smalltalk.ValueNode);
  6517. smalltalk.addClass('VariableNode', smalltalk.ValueNode, [], 'Compiler');
  6518. smalltalk.addMethod(
  6519. '_accept_',
  6520. smalltalk.method({
  6521. selector: 'accept:',
  6522. category: 'visiting',
  6523. fn: function (aVisitor){
  6524. var self=this;
  6525. aVisitor._visitVariableNode_(self);
  6526. return self;},
  6527. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitVariableNode%3A%20self%0A')}),
  6528. smalltalk.VariableNode);
  6529. smalltalk.addClass('ClassReferenceNode', smalltalk.VariableNode, [], 'Compiler');
  6530. smalltalk.addMethod(
  6531. '_accept_',
  6532. smalltalk.method({
  6533. selector: 'accept:',
  6534. category: 'visiting',
  6535. fn: function (aVisitor){
  6536. var self=this;
  6537. aVisitor._visitClassReferenceNode_(self);
  6538. return self;},
  6539. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitClassReferenceNode%3A%20self%0A')}),
  6540. smalltalk.ClassReferenceNode);
  6541. smalltalk.addClass('JSStatementNode', smalltalk.Node, ['source'], 'Compiler');
  6542. smalltalk.addMethod(
  6543. '_source',
  6544. smalltalk.method({
  6545. selector: 'source',
  6546. category: 'accessing',
  6547. fn: function (){
  6548. var self=this;
  6549. return self['@source']._ifNil_((function(){return "";}));
  6550. return self;},
  6551. source: unescape('source%0A%09%5Esource%20ifNil%3A%20%5B%27%27%5D%0A')}),
  6552. smalltalk.JSStatementNode);
  6553. smalltalk.addMethod(
  6554. '_source_',
  6555. smalltalk.method({
  6556. selector: 'source:',
  6557. category: 'accessing',
  6558. fn: function (aString){
  6559. var self=this;
  6560. self['@source']=aString;
  6561. return self;},
  6562. source: unescape('source%3A%20aString%0A%09source%20%3A%3D%20aString%0A')}),
  6563. smalltalk.JSStatementNode);
  6564. smalltalk.addMethod(
  6565. '_accept_',
  6566. smalltalk.method({
  6567. selector: 'accept:',
  6568. category: 'visiting',
  6569. fn: function (aVisitor){
  6570. var self=this;
  6571. aVisitor._visitJSStatementNode_(self);
  6572. return self;},
  6573. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitJSStatementNode%3A%20self%0A')}),
  6574. smalltalk.JSStatementNode);
  6575. smalltalk.addClass('NodeVisitor', smalltalk.Object, [], 'Compiler');
  6576. smalltalk.addMethod(
  6577. '_visit_',
  6578. smalltalk.method({
  6579. selector: 'visit:',
  6580. category: 'visiting',
  6581. fn: function (aNode){
  6582. var self=this;
  6583. aNode._accept_(self);
  6584. return self;},
  6585. source: unescape('visit%3A%20aNode%0A%09aNode%20accept%3A%20self%0A')}),
  6586. smalltalk.NodeVisitor);
  6587. smalltalk.addMethod(
  6588. '_visitNode_',
  6589. smalltalk.method({
  6590. selector: 'visitNode:',
  6591. category: 'visiting',
  6592. fn: function (aNode){
  6593. var self=this;
  6594. return self;},
  6595. source: unescape('visitNode%3A%20aNode%0A')}),
  6596. smalltalk.NodeVisitor);
  6597. smalltalk.addMethod(
  6598. '_visitMethodNode_',
  6599. smalltalk.method({
  6600. selector: 'visitMethodNode:',
  6601. category: 'visiting',
  6602. fn: function (aNode){
  6603. var self=this;
  6604. self._visitNode_(aNode);
  6605. return self;},
  6606. source: unescape('visitMethodNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  6607. smalltalk.NodeVisitor);
  6608. smalltalk.addMethod(
  6609. '_visitSequenceNode_',
  6610. smalltalk.method({
  6611. selector: 'visitSequenceNode:',
  6612. category: 'visiting',
  6613. fn: function (aNode){
  6614. var self=this;
  6615. self._visitNode_(aNode);
  6616. return self;},
  6617. source: unescape('visitSequenceNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  6618. smalltalk.NodeVisitor);
  6619. smalltalk.addMethod(
  6620. '_visitBlockSequenceNode_',
  6621. smalltalk.method({
  6622. selector: 'visitBlockSequenceNode:',
  6623. category: 'visiting',
  6624. fn: function (aNode){
  6625. var self=this;
  6626. self._visitSequenceNode_(aNode);
  6627. return self;},
  6628. source: unescape('visitBlockSequenceNode%3A%20aNode%0A%09self%20visitSequenceNode%3A%20aNode%0A')}),
  6629. smalltalk.NodeVisitor);
  6630. smalltalk.addMethod(
  6631. '_visitBlockNode_',
  6632. smalltalk.method({
  6633. selector: 'visitBlockNode:',
  6634. category: 'visiting',
  6635. fn: function (aNode){
  6636. var self=this;
  6637. self._visitNode_(aNode);
  6638. return self;},
  6639. source: unescape('visitBlockNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  6640. smalltalk.NodeVisitor);
  6641. smalltalk.addMethod(
  6642. '_visitReturnNode_',
  6643. smalltalk.method({
  6644. selector: 'visitReturnNode:',
  6645. category: 'visiting',
  6646. fn: function (aNode){
  6647. var self=this;
  6648. self._visitNode_(aNode);
  6649. return self;},
  6650. source: unescape('visitReturnNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  6651. smalltalk.NodeVisitor);
  6652. smalltalk.addMethod(
  6653. '_visitSendNode_',
  6654. smalltalk.method({
  6655. selector: 'visitSendNode:',
  6656. category: 'visiting',
  6657. fn: function (aNode){
  6658. var self=this;
  6659. self._visitNode_(aNode);
  6660. return self;},
  6661. source: unescape('visitSendNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  6662. smalltalk.NodeVisitor);
  6663. smalltalk.addMethod(
  6664. '_visitCascadeNode_',
  6665. smalltalk.method({
  6666. selector: 'visitCascadeNode:',
  6667. category: 'visiting',
  6668. fn: function (aNode){
  6669. var self=this;
  6670. self._visitNode_(aNode);
  6671. return self;},
  6672. source: unescape('visitCascadeNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  6673. smalltalk.NodeVisitor);
  6674. smalltalk.addMethod(
  6675. '_visitValueNode_',
  6676. smalltalk.method({
  6677. selector: 'visitValueNode:',
  6678. category: 'visiting',
  6679. fn: function (aNode){
  6680. var self=this;
  6681. self._visitNode_(aNode);
  6682. return self;},
  6683. source: unescape('visitValueNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  6684. smalltalk.NodeVisitor);
  6685. smalltalk.addMethod(
  6686. '_visitVariableNode_',
  6687. smalltalk.method({
  6688. selector: 'visitVariableNode:',
  6689. category: 'visiting',
  6690. fn: function (aNode){
  6691. var self=this;
  6692. return self;},
  6693. source: unescape('visitVariableNode%3A%20aNode%0A')}),
  6694. smalltalk.NodeVisitor);
  6695. smalltalk.addMethod(
  6696. '_visitAssignmentNode_',
  6697. smalltalk.method({
  6698. selector: 'visitAssignmentNode:',
  6699. category: 'visiting',
  6700. fn: function (aNode){
  6701. var self=this;
  6702. self._visitNode_(aNode);
  6703. return self;},
  6704. source: unescape('visitAssignmentNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  6705. smalltalk.NodeVisitor);
  6706. smalltalk.addMethod(
  6707. '_visitClassReferenceNode_',
  6708. smalltalk.method({
  6709. selector: 'visitClassReferenceNode:',
  6710. category: 'visiting',
  6711. fn: function (aNode){
  6712. var self=this;
  6713. (function($rec){$rec._nextPutAll_("smalltalk.");return $rec._nextPutAll_(aNode._value());})(self);
  6714. return self;},
  6715. 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')}),
  6716. smalltalk.NodeVisitor);
  6717. smalltalk.addMethod(
  6718. '_visitJSStatementNode_',
  6719. smalltalk.method({
  6720. selector: 'visitJSStatementNode:',
  6721. category: 'visiting',
  6722. fn: function (aNode){
  6723. var self=this;
  6724. (function($rec){$rec._nextPutAll_(unescape("function%28%29%7B"));$rec._nextPutAll_(aNode._source());return $rec._nextPutAll_(unescape("%7D%29%28%29"));})(self);
  6725. return self;},
  6726. 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')}),
  6727. smalltalk.NodeVisitor);
  6728. smalltalk.addClass('Compiler', smalltalk.NodeVisitor, ['stream', 'nestedBlocks', 'earlyReturn', 'currentClass', 'currentSelector'], 'Compiler');
  6729. smalltalk.addMethod(
  6730. '_initialize',
  6731. smalltalk.method({
  6732. selector: 'initialize',
  6733. category: 'initialization',
  6734. fn: function (){
  6735. var self=this;
  6736. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  6737. self['@stream']=""._writeStream();
  6738. return self;},
  6739. source: unescape('initialize%0A%09super%20initialize.%0A%09stream%20%3A%3D%20%27%27%20writeStream%0A')}),
  6740. smalltalk.Compiler);
  6741. smalltalk.addMethod(
  6742. '_parser',
  6743. smalltalk.method({
  6744. selector: 'parser',
  6745. category: 'accessing',
  6746. fn: function (){
  6747. var self=this;
  6748. return smalltalk.SmalltalkParser._new();
  6749. return self;},
  6750. source: unescape('parser%0A%09%5ESmalltalkParser%20new%0A')}),
  6751. smalltalk.Compiler);
  6752. smalltalk.addMethod(
  6753. '_currentClass',
  6754. smalltalk.method({
  6755. selector: 'currentClass',
  6756. category: 'accessing',
  6757. fn: function (){
  6758. var self=this;
  6759. return self['@currentClass'];
  6760. return self;},
  6761. source: unescape('currentClass%0A%09%5EcurrentClass%0A')}),
  6762. smalltalk.Compiler);
  6763. smalltalk.addMethod(
  6764. '_currentClass_',
  6765. smalltalk.method({
  6766. selector: 'currentClass:',
  6767. category: 'accessing',
  6768. fn: function (aClass){
  6769. var self=this;
  6770. self['@currentClass']=aClass;
  6771. return self;},
  6772. source: unescape('currentClass%3A%20aClass%0A%09currentClass%20%3A%3D%20aClass%0A')}),
  6773. smalltalk.Compiler);
  6774. smalltalk.addMethod(
  6775. '_loadExpression_',
  6776. smalltalk.method({
  6777. selector: 'loadExpression:',
  6778. category: 'compiling',
  6779. fn: function (aString){
  6780. var self=this;
  6781. smalltalk.DoIt._addCompiledMethod_(self._eval_(self._compileExpression_(aString)));
  6782. return smalltalk.DoIt._new()._doIt();
  6783. return self;},
  6784. 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')}),
  6785. smalltalk.Compiler);
  6786. smalltalk.addMethod(
  6787. '_load_forClass_',
  6788. smalltalk.method({
  6789. selector: 'load:forClass:',
  6790. category: 'compiling',
  6791. fn: function (aString, aClass){
  6792. var self=this;
  6793. return self._eval_(self._compile_forClass_(aString,aClass));
  6794. return self;},
  6795. source: unescape('load%3A%20aString%20forClass%3A%20aClass%0A%09%5Eself%20eval%3A%20%28self%20compile%3A%20aString%20forClass%3A%20aClass%29%0A')}),
  6796. smalltalk.Compiler);
  6797. smalltalk.addMethod(
  6798. '_compile_forClass_',
  6799. smalltalk.method({
  6800. selector: 'compile:forClass:',
  6801. category: 'compiling',
  6802. fn: function (aString, aClass){
  6803. var self=this;
  6804. self._currentClass_(aClass);
  6805. return self._compile_(aString);
  6806. return self;},
  6807. source: unescape('compile%3A%20aString%20forClass%3A%20aClass%0A%09self%20currentClass%3A%20aClass.%0A%09%5Eself%20compile%3A%20aString%0A')}),
  6808. smalltalk.Compiler);
  6809. smalltalk.addMethod(
  6810. '_compileExpression_',
  6811. smalltalk.method({
  6812. selector: 'compileExpression:',
  6813. category: 'compiling',
  6814. fn: function (aString){
  6815. var self=this;
  6816. self._currentClass_(smalltalk.DoIt);
  6817. return self._compileNode_(self._parseExpression_(aString));
  6818. return self;},
  6819. source: unescape('compileExpression%3A%20aString%0A%09self%20currentClass%3A%20DoIt.%0A%09%5Eself%20compileNode%3A%20%28self%20parseExpression%3A%20aString%29%0A')}),
  6820. smalltalk.Compiler);
  6821. smalltalk.addMethod(
  6822. '_eval_',
  6823. smalltalk.method({
  6824. selector: 'eval:',
  6825. category: 'compiling',
  6826. fn: function (aString){
  6827. var self=this;
  6828. return (function(){return eval(aString);})();
  6829. return self;},
  6830. source: unescape('eval%3A%20aString%0A%09%5E%7B%27return%20eval%28aString%29%3B%27%7D%0A')}),
  6831. smalltalk.Compiler);
  6832. smalltalk.addMethod(
  6833. '_compile_',
  6834. smalltalk.method({
  6835. selector: 'compile:',
  6836. category: 'compiling',
  6837. fn: function (aString){
  6838. var self=this;
  6839. return self._compileNode_(self._parse_(aString));
  6840. return self;},
  6841. source: unescape('compile%3A%20aString%0A%09%5Eself%20compileNode%3A%20%28self%20parse%3A%20aString%29%0A')}),
  6842. smalltalk.Compiler);
  6843. smalltalk.addMethod(
  6844. '_compileNode_',
  6845. smalltalk.method({
  6846. selector: 'compileNode:',
  6847. category: 'compiling',
  6848. fn: function (aNode){
  6849. var self=this;
  6850. self['@stream']=""._writeStream();
  6851. self._visit_(aNode);
  6852. return self['@stream']._contents();
  6853. return self;},
  6854. source: unescape('compileNode%3A%20aNode%0A%09stream%20%3A%3D%20%27%27%20writeStream.%0A%09self%20visit%3A%20aNode.%0A%09%5Estream%20contents%0A')}),
  6855. smalltalk.Compiler);
  6856. smalltalk.addMethod(
  6857. '_visit_',
  6858. smalltalk.method({
  6859. selector: 'visit:',
  6860. category: 'visiting',
  6861. fn: function (aNode){
  6862. var self=this;
  6863. aNode._accept_(self);
  6864. return self;},
  6865. source: unescape('visit%3A%20aNode%0A%09aNode%20accept%3A%20self%0A')}),
  6866. smalltalk.Compiler);
  6867. smalltalk.addMethod(
  6868. '_visitMethodNode_',
  6869. smalltalk.method({
  6870. selector: 'visitMethodNode:',
  6871. category: 'visiting',
  6872. fn: function (aNode){
  6873. var self=this;
  6874. var str=nil;
  6875. var currentSelector=nil;
  6876. self['@currentSelector']=aNode._selector()._asSelector();
  6877. self['@nestedBlocks']=(0);
  6878. self['@earlyReturn']=false;
  6879. (function($rec){$rec._nextPutAll_(unescape("smalltalk.method%28%7B").__comma(smalltalk.String._cr()));$rec._nextPutAll_(unescape("selector%3A%20%22").__comma(aNode._selector()).__comma(unescape("%22%2C")).__comma(smalltalk.String._cr()));$rec._nextPutAll_(unescape("source%3A%20unescape%28%22").__comma(aNode._source()._escaped()).__comma(unescape("%22%29%2C")).__comma(smalltalk.String._cr()));return $rec._nextPutAll_(unescape("fn%3A%20function%28"));})(self['@stream']);
  6880. aNode._arguments()._do_separatedBy_((function(each){return self['@stream']._nextPutAll_(each);}),(function(){return self['@stream']._nextPutAll_(unescape("%2C%20"));}));
  6881. (function($rec){$rec._nextPutAll_(unescape("%29%7B").__comma(smalltalk.String._cr()));return $rec._nextPutAll_(unescape("var%20self%3Dthis%3B").__comma(smalltalk.String._cr()));})(self['@stream']);
  6882. str=self['@stream'];
  6883. self['@stream']=""._writeStream();
  6884. aNode._nodes()._do_((function(each){return self._visit_(each);}));
  6885. self['@earlyReturn']._ifTrue_((function(){return str._nextPutAll_(unescape("try%7B"));}));
  6886. str._nextPutAll_(self['@stream']._contents());
  6887. self['@stream']=str;
  6888. (function($rec){$rec._nextPutAll_(smalltalk.String._cr());return $rec._nextPutAll_(unescape("return%20self%3B"));})(self['@stream']);
  6889. self['@earlyReturn']._ifTrue_((function(){return self['@stream']._nextPutAll_(smalltalk.String._cr().__comma(unescape("%7D%20catch%28e%29%20%7Bif%28e.name%20%3D%3D%3D%20%27stReturn%27%20%26%26%20e.selector%20%3D%3D%3D%20")).__comma(self['@currentSelector']._printString()).__comma(unescape("%29%7Breturn%20e.fn%28%29%7D%20throw%28e%29%7D")));}));
  6890. (function($rec){$rec._nextPutAll_(unescape("%7D").__comma(smalltalk.String._cr()));return $rec._nextPutAll_(unescape("%7D%29"));})(self['@stream']);
  6891. return self;},
  6892. source: unescape('visitMethodNode%3A%20aNode%0A%09%7C%20str%20currentSelector%20%7C%0A%09currentSelector%20%3A%3D%20aNode%20selector%20asSelector.%0A%09nestedBlocks%20%3A%3D%200.%0A%09earlyReturn%20%3A%3D%20false.%0A%09stream%20%0A%09%20%20%20%20nextPutAll%3A%20%27smalltalk.method%28%7B%27%2C%20String%20cr%3B%0A%09%20%20%20%20nextPutAll%3A%20%27selector%3A%20%22%27%2C%20aNode%20selector%2C%20%27%22%2C%27%2C%20String%20cr%3B%0A%09%20%20%20%20nextPutAll%3A%20%27source%3A%20unescape%28%22%27%2C%20aNode%20source%20escaped%2C%20%27%22%29%2C%27%2C%20String%20cr%3B%0A%09%20%20%20%20nextPutAll%3A%20%27fn%3A%20function%28%27.%0A%09aNode%20arguments%20%0A%09%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20stream%20nextPutAll%3A%20each%5D%0A%09%20%20%20%20separatedBy%3A%20%5Bstream%20nextPutAll%3A%20%27%2C%20%27%5D.%0A%09stream%20%0A%09%20%20%20%20nextPutAll%3A%20%27%29%7B%27%2C%20String%20cr%3B%0A%09%20%20%20%20nextPutAll%3A%20%27var%20self%3Dthis%3B%27%2C%20String%20cr.%0A%09str%20%3A%3D%20stream.%0A%09stream%20%3A%3D%20%27%27%20writeStream.%0A%09aNode%20nodes%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20self%20visit%3A%20each%5D.%0A%09earlyReturn%20ifTrue%3A%20%5B%0A%09%20%20%20%20str%20nextPutAll%3A%20%27try%7B%27%5D.%0A%09str%20nextPutAll%3A%20stream%20contents.%0A%09stream%20%3A%3D%20str.%0A%09stream%20%0A%09%20%20%20%20nextPutAll%3A%20String%20cr%3B%20%0A%09%20%20%20%20nextPutAll%3A%20%27return%20self%3B%27.%0A%09earlyReturn%20ifTrue%3A%20%5B%0A%09%20%20%20%20stream%20nextPutAll%3A%20String%20cr%2C%20%27%7D%20catch%28e%29%20%7Bif%28e.name%20%3D%3D%3D%20%27%27stReturn%27%27%20%26%26%20e.selector%20%3D%3D%3D%20%27%2C%20currentSelector%20printString%2C%20%27%29%7Breturn%20e.fn%28%29%7D%20throw%28e%29%7D%27%5D.%0A%09stream%20%0A%09%20%20%20%20nextPutAll%3A%20%27%7D%27%2C%20String%20cr%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%7D%29%27%0A')}),
  6893. smalltalk.Compiler);
  6894. smalltalk.addMethod(
  6895. '_visitBlockNode_',
  6896. smalltalk.method({
  6897. selector: 'visitBlockNode:',
  6898. category: 'visiting',
  6899. fn: function (aNode){
  6900. var self=this;
  6901. self['@stream']._nextPutAll_(unescape("%28function%28"));
  6902. aNode._parameters()._do_separatedBy_((function(each){return self['@stream']._nextPutAll_(each);}),(function(){return self['@stream']._nextPutAll_(unescape("%2C%20"));}));
  6903. self['@stream']._nextPutAll_(unescape("%29%7B"));
  6904. aNode._nodes()._do_((function(each){return self._visit_(each);}));
  6905. self['@stream']._nextPutAll_(unescape("%7D%29"));
  6906. return self;},
  6907. source: unescape('visitBlockNode%3A%20aNode%0A%09stream%20nextPutAll%3A%20%27%28function%28%27.%0A%09aNode%20parameters%20%0A%09%20%20%20%20do%3A%20%5B%3Aeach%20%7C%0A%09%09stream%20nextPutAll%3A%20each%5D%0A%09%20%20%20%20separatedBy%3A%20%5Bstream%20nextPutAll%3A%20%27%2C%20%27%5D.%0A%09stream%20nextPutAll%3A%20%27%29%7B%27.%0A%09aNode%20nodes%20do%3A%20%5B%3Aeach%20%7C%20self%20visit%3A%20each%5D.%0A%09stream%20nextPutAll%3A%20%27%7D%29%27%0A')}),
  6908. smalltalk.Compiler);
  6909. smalltalk.addMethod(
  6910. '_visitSequenceNode_',
  6911. smalltalk.method({
  6912. selector: 'visitSequenceNode:',
  6913. category: 'visiting',
  6914. fn: function (aNode){
  6915. var self=this;
  6916. aNode._temps()._do_((function(each){self['@stream']._nextPutAll_("var ".__comma(each).__comma(unescape("%3Dnil%3B")));return self['@stream']._nextPutAll_(smalltalk.String._cr());}));
  6917. aNode._nodes()._do_separatedBy_((function(each){self._visit_(each);return self['@stream']._nextPutAll_(unescape("%3B"));}),(function(){return self['@stream']._nextPutAll_(smalltalk.String._cr());}));
  6918. return self;},
  6919. source: unescape('visitSequenceNode%3A%20aNode%0A%09aNode%20temps%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20stream%20nextPutAll%3A%20%27var%20%27%2C%20each%2C%20%27%3Dnil%3B%27.%0A%09%20%20%20%20stream%20nextPutAll%3A%20String%20cr%5D.%0A%09aNode%20nodes%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20self%20visit%3A%20each.%0A%09%20%20%20%20stream%20nextPutAll%3A%20%27%3B%27%5D%0A%09%20%20%20%20separatedBy%3A%20%5Bstream%20nextPutAll%3A%20String%20cr%5D%0A')}),
  6920. smalltalk.Compiler);
  6921. smalltalk.addMethod(
  6922. '_visitBlockSequenceNode_',
  6923. smalltalk.method({
  6924. selector: 'visitBlockSequenceNode:',
  6925. category: 'visiting',
  6926. fn: function (aNode){
  6927. var self=this;
  6928. var index=nil;
  6929. self['@nestedBlocks']=self['@nestedBlocks'].__plus((1));
  6930. aNode._nodes()._isEmpty()._ifTrue_ifFalse_((function(){return self['@stream']._nextPutAll_(unescape("return%20nil%3B"));}),(function(){aNode._temps()._do_((function(each){self['@stream']._nextPutAll_("var ".__comma(each).__comma(unescape("%3Dnil%3B")));return self['@stream']._nextPutAll_(smalltalk.String._cr());}));index=(0);return aNode._nodes()._do_((function(each){index=index.__plus((1));index.__eq(aNode._nodes()._size())._ifTrue_((function(){return self['@stream']._nextPutAll_("return ");}));self._visit_(each);return self['@stream']._nextPutAll_(unescape("%3B"));}));}));
  6931. self['@nestedBlocks']=self['@nestedBlocks'].__minus((1));
  6932. return self;},
  6933. source: unescape('visitBlockSequenceNode%3A%20aNode%0A%09%7C%20index%20%7C%0A%09nestedBlocks%20%3A%3D%20nestedBlocks%20+%201.%0A%09aNode%20nodes%20isEmpty%0A%09%20%20%20%20ifTrue%3A%20%5B%0A%09%09stream%20nextPutAll%3A%20%27return%20nil%3B%27%5D%0A%09%20%20%20%20ifFalse%3A%20%5B%0A%09%09aNode%20temps%20do%3A%20%5B%3Aeach%20%7C%0A%09%09%20%20%20%20stream%20nextPutAll%3A%20%27var%20%27%2C%20each%2C%20%27%3Dnil%3B%27.%0A%09%09%20%20%20%20stream%20nextPutAll%3A%20String%20cr%5D.%0A%09%09index%20%3A%3D%200.%0A%09%09aNode%20nodes%20do%3A%20%5B%3Aeach%20%7C%0A%09%09%20%20%20%20index%20%3A%3D%20index%20+%201.%0A%09%09%20%20%20%20index%20%3D%20aNode%20nodes%20size%20ifTrue%3A%20%5B%0A%09%09%09stream%20nextPutAll%3A%20%27return%20%27%5D.%0A%09%09%20%20%20%20self%20visit%3A%20each.%0A%09%09%20%20%20%20stream%20nextPutAll%3A%20%27%3B%27%5D%5D.%0A%09nestedBlocks%20%3A%3D%20nestedBlocks%20-%201%0A')}),
  6934. smalltalk.Compiler);
  6935. smalltalk.addMethod(
  6936. '_visitReturnNode_',
  6937. smalltalk.method({
  6938. selector: 'visitReturnNode:',
  6939. category: 'visiting',
  6940. fn: function (aNode){
  6941. var self=this;
  6942. self['@nestedBlocks'].__gt((0))._ifTrue_((function(){return self['@earlyReturn']=true;}));
  6943. self['@earlyReturn']._ifTrue_ifFalse_((function(){return (function($rec){$rec._nextPutAll_(unescape("%28function%28%29%7Bthrow%28"));$rec._nextPutAll_(unescape("%7Bname%3A%20%27stReturn%27%2C%20selector%3A%20"));$rec._nextPutAll_(self['@currentSelector']._printString());return $rec._nextPutAll_(unescape("%2C%20fn%3A%20function%28%29%7Breturn%20"));})(self['@stream']);}),(function(){return self['@stream']._nextPutAll_("return ");}));
  6944. aNode._nodes()._do_((function(each){return self._visit_(each);}));
  6945. self['@earlyReturn']._ifTrue_((function(){return self['@stream']._nextPutAll_(unescape("%7D%7D%29%7D%29%28%29"));}));
  6946. return self;},
  6947. 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')}),
  6948. smalltalk.Compiler);
  6949. smalltalk.addMethod(
  6950. '_visitSendNode_',
  6951. smalltalk.method({
  6952. selector: 'visitSendNode:',
  6953. category: 'visiting',
  6954. fn: function (aNode){
  6955. var self=this;
  6956. var str=nil;
  6957. str=self['@stream'];
  6958. self['@stream']=""._writeStream();
  6959. self._visit_(aNode._receiver());
  6960. self['@stream']._contents().__eq("super")._ifTrue_ifFalse_((function(){self['@stream']=str;(function($rec){$rec._nextPutAll_(unescape("self.klass.superclass.fn.prototype%5B%27"));$rec._nextPutAll_(aNode._selector()._asSelector());return $rec._nextPutAll_(unescape("%27%5D.apply%28self%2C%20%5B"));})(self['@stream']);aNode._arguments()._do_separatedBy_((function(each){return self._visit_(each);}),(function(){return self['@stream']._nextPutAll_(unescape("%2C"));}));return self['@stream']._nextPutAll_(unescape("%5D%29"));}),(function(){str._nextPutAll_(self['@stream']._contents());self['@stream']=str;self['@stream']._nextPutAll_(".".__comma(aNode._selector()._asSelector()).__comma(unescape("%28")));aNode._arguments()._do_separatedBy_((function(each){return self._visit_(each);}),(function(){return self['@stream']._nextPutAll_(unescape("%2C"));}));return self['@stream']._nextPutAll_(unescape("%29"));}));
  6961. return self;},
  6962. source: unescape('visitSendNode%3A%20aNode%0A%09%7C%20str%20%7C%0A%09str%20%3A%3D%20stream.%0A%09stream%20%3A%3D%20%27%27%20writeStream.%0A%09self%20visit%3A%20aNode%20receiver.%0A%09stream%20contents%20%3D%20%27super%27%20%0A%09%20%20%20%20ifTrue%3A%20%5B%0A%09%09stream%20%3A%3D%20str.%0A%09%09stream%20%0A%09%09%20%20%20%20nextPutAll%3A%20%27self.klass.superclass.fn.prototype%5B%27%27%27%3B%0A%09%09%20%20%20%20nextPutAll%3A%20aNode%20selector%20asSelector%3B%0A%09%09%20%20%20%20nextPutAll%3A%20%27%27%27%5D.apply%28self%2C%20%5B%27.%0A%09%09aNode%20arguments%20%0A%09%09%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20self%20visit%3A%20each%5D%0A%09%09%20%20%20%20separatedBy%3A%20%5Bstream%20nextPutAll%3A%20%27%2C%27%5D.%0A%09%09stream%20nextPutAll%3A%20%27%5D%29%27%5D%0A%09%20%20%20%20ifFalse%3A%20%5B%0A%09%09str%20nextPutAll%3A%20stream%20contents.%0A%09%09stream%20%3A%3D%20str.%0A%09%09stream%20nextPutAll%3A%20%27.%27%2C%20aNode%20selector%20asSelector%2C%20%27%28%27.%0A%09%09aNode%20arguments%20%0A%09%09%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20self%20visit%3A%20each%5D%0A%09%09%20%20%20%20separatedBy%3A%20%5Bstream%20nextPutAll%3A%20%27%2C%27%5D.%0A%09%09stream%20nextPutAll%3A%20%27%29%27%5D%0A')}),
  6963. smalltalk.Compiler);
  6964. smalltalk.addMethod(
  6965. '_visitCascadeNode_',
  6966. smalltalk.method({
  6967. selector: 'visitCascadeNode:',
  6968. category: 'visiting',
  6969. fn: function (aNode){
  6970. var self=this;
  6971. var index=nil;
  6972. index=(0);
  6973. self['@stream']._nextPutAll_(unescape("%28function%28%24rec%29%7B"));
  6974. aNode._nodes()._do_((function(each){index=index.__plus((1));index.__eq(aNode._nodes()._size())._ifTrue_((function(){return self['@stream']._nextPutAll_("return ");}));each._receiver_(smalltalk.VariableNode._new()._value_("$rec"));self._visit_(each);return self['@stream']._nextPutAll_(unescape("%3B"));}));
  6975. self['@stream']._nextPutAll_(unescape("%7D%29%28"));
  6976. self._visit_(aNode._receiver());
  6977. self['@stream']._nextPutAll_(unescape("%29"));
  6978. return self;},
  6979. source: unescape('visitCascadeNode%3A%20aNode%0A%09%7C%20index%20%7C%0A%09index%20%3A%3D%200.%0A%09stream%20nextPutAll%3A%20%27%28function%28%24rec%29%7B%27.%0A%09aNode%20nodes%20do%3A%20%5B%3Aeach%20%7C%0A%09%20%20%20%20index%20%3A%3D%20index%20+%201.%0A%09%20%20%20%20index%20%3D%20aNode%20nodes%20size%20ifTrue%3A%20%5B%0A%09%09stream%20nextPutAll%3A%20%27return%20%27%5D.%0A%09%20%20%20%20each%20receiver%3A%20%28VariableNode%20new%20value%3A%20%27%24rec%27%29.%0A%09%20%20%20%20self%20visit%3A%20each.%0A%09%20%20%20%20stream%20nextPutAll%3A%20%27%3B%27%5D.%0A%09stream%20nextPutAll%3A%20%27%7D%29%28%27.%0A%09self%20visit%3A%20aNode%20receiver.%0A%09stream%20nextPutAll%3A%20%27%29%27%0A')}),
  6980. smalltalk.Compiler);
  6981. smalltalk.addMethod(
  6982. '_visitValueNode_',
  6983. smalltalk.method({
  6984. selector: 'visitValueNode:',
  6985. category: 'visiting',
  6986. fn: function (aNode){
  6987. var self=this;
  6988. self['@stream']._nextPutAll_(aNode._value()._asJavascript());
  6989. return self;},
  6990. source: unescape('visitValueNode%3A%20aNode%0A%09stream%20nextPutAll%3A%20aNode%20value%20asJavascript%0A')}),
  6991. smalltalk.Compiler);
  6992. smalltalk.addMethod(
  6993. '_visitAssignmentNode_',
  6994. smalltalk.method({
  6995. selector: 'visitAssignmentNode:',
  6996. category: 'visiting',
  6997. fn: function (aNode){
  6998. var self=this;
  6999. self._visit_(aNode._left());
  7000. self['@stream']._nextPutAll_(unescape("%3D"));
  7001. self._visit_(aNode._right());
  7002. return self;},
  7003. 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')}),
  7004. smalltalk.Compiler);
  7005. smalltalk.addMethod(
  7006. '_visitClassReferenceNode_',
  7007. smalltalk.method({
  7008. selector: 'visitClassReferenceNode:',
  7009. category: 'visiting',
  7010. fn: function (aNode){
  7011. var self=this;
  7012. (function($rec){$rec._nextPutAll_("smalltalk.");return $rec._nextPutAll_(aNode._value());})(self['@stream']);
  7013. return self;},
  7014. 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')}),
  7015. smalltalk.Compiler);
  7016. smalltalk.addMethod(
  7017. '_visitVariableNode_',
  7018. smalltalk.method({
  7019. selector: 'visitVariableNode:',
  7020. category: 'visiting',
  7021. fn: function (aNode){
  7022. var self=this;
  7023. self._currentClass()._instVarNames()._includes_(aNode._value())._ifTrue_ifFalse_((function(){return self['@stream']._nextPutAll_(unescape("self%5B%27@").__comma(aNode._value()).__comma(unescape("%27%5D")));}),(function(){return self['@stream']._nextPutAll_(aNode._value());}));
  7024. return self;},
  7025. source: unescape('visitVariableNode%3A%20aNode%0A%09%28self%20currentClass%20instVarNames%20includes%3A%20aNode%20value%29%20%0A%09%20%20%20%20ifTrue%3A%20%5Bstream%20nextPutAll%3A%20%27self%5B%27%27@%27%2C%20aNode%20value%2C%20%27%27%27%5D%27%5D%0A%09%20%20%20%20ifFalse%3A%20%5Bstream%20nextPutAll%3A%20aNode%20value%5D%0A')}),
  7026. smalltalk.Compiler);
  7027. smalltalk.addMethod(
  7028. '_visitJSStatementNode_',
  7029. smalltalk.method({
  7030. selector: 'visitJSStatementNode:',
  7031. category: 'visiting',
  7032. fn: function (aNode){
  7033. var self=this;
  7034. self['@stream']._nextPutAll_(unescape("%28function%28%29%7B"));
  7035. self['@stream']._nextPutAll_(aNode._source()._value()._replace_with_(unescape("%27%27"),unescape("%27")));
  7036. self['@stream']._nextPutAll_(unescape("%7D%29%28%29"));
  7037. return self;},
  7038. source: unescape('visitJSStatementNode%3A%20aNode%0A%09stream%20nextPutAll%3A%20%27%28function%28%29%7B%27.%0A%09stream%20nextPutAll%3A%20%28aNode%20source%20value%20replace%3A%20%27%27%27%27%27%27%20with%3A%20%27%27%27%27%29.%0A%09stream%20nextPutAll%3A%20%27%7D%29%28%29%27%0A')}),
  7039. smalltalk.Compiler);
  7040. smalltalk.addMethod(
  7041. '_parse_',
  7042. smalltalk.method({
  7043. selector: 'parse:',
  7044. category: 'compiling',
  7045. fn: function (aString){
  7046. var self=this;
  7047. return self._parser()._parse_(aString._readStream());
  7048. return self;},
  7049. source: unescape('parse%3A%20aString%0A%20%20%20%20%5Eself%20parser%20parse%3A%20aString%20readStream%0A')}),
  7050. smalltalk.Compiler);
  7051. smalltalk.addMethod(
  7052. '_parseExpression_',
  7053. smalltalk.method({
  7054. selector: 'parseExpression:',
  7055. category: 'compiling',
  7056. fn: function (aString){
  7057. var self=this;
  7058. return self._parse_(unescape("doIt%20%5E%5B").__comma(aString).__comma(unescape("%5D%20value")));
  7059. return self;},
  7060. 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')}),
  7061. smalltalk.Compiler);
  7062. smalltalk.addClass('DoIt', smalltalk.Object, [], 'Compiler');
  7063. smalltalk.addMethod(
  7064. '_doIt',
  7065. smalltalk.method({
  7066. selector: 'doIt',
  7067. category: '',
  7068. fn: function (){
  7069. var self=this;
  7070. return (function(){return smalltalk.Object._subclass_instanceVariableNames_category_("DoIt","","Compiler");})._value();
  7071. return self;},
  7072. source: unescape('doIt%20%5E%5BObject%20subclass%3A%20%23DoIt%0A%09instanceVariableNames%3A%20%27%27%0A%09category%3A%20%27Compiler%27%5D%20value')}),
  7073. smalltalk.DoIt);
  7074. smalltalk.addClass('TabManager', smalltalk.Widget, ['selectedTab', 'tabs', 'opened'], 'IDE');
  7075. smalltalk.addMethod(
  7076. '_initialize',
  7077. smalltalk.method({
  7078. selector: 'initialize',
  7079. category: 'initialization',
  7080. fn: function (){
  7081. var self=this;
  7082. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  7083. self['@opened']=true;
  7084. (function($rec){$rec._append_(self);$rec._append_((function(html){return html._div()._id_("jtalk");}));return $rec._addClass_("jtalkBody");})("body"._asJQuery());
  7085. (function($rec){$rec._addTab_(smalltalk.Transcript._current());return $rec._addTab_(smalltalk.Workspace._new());})(self);
  7086. self._selectTab_(self._tabs()._last());
  7087. (function($rec){$rec._onResize_((function(){return (function($rec){$rec._updateBodyMargin();return $rec._updatePosition();})(self);}));return $rec._onWindowResize_((function(){return self._updatePosition();}));})(self);
  7088. return self;},
  7089. 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')}),
  7090. smalltalk.TabManager);
  7091. smalltalk.addMethod(
  7092. '_tabs',
  7093. smalltalk.method({
  7094. selector: 'tabs',
  7095. category: 'accessing',
  7096. fn: function (){
  7097. var self=this;
  7098. return self['@tabs']._ifNil_((function(){return self['@tabs']=smalltalk.Array._new();}));
  7099. return self;},
  7100. source: unescape('tabs%0A%20%20%20%20%5Etabs%20ifNil%3A%20%5Btabs%20%3A%3D%20Array%20new%5D%0A')}),
  7101. smalltalk.TabManager);
  7102. smalltalk.addMethod(
  7103. '_addTab_',
  7104. smalltalk.method({
  7105. selector: 'addTab:',
  7106. category: 'adding/Removing',
  7107. fn: function (aWidget){
  7108. var self=this;
  7109. self._tabs()._add_(aWidget);
  7110. unescape("%23jtalk")._asJQuery()._append_(aWidget);
  7111. aWidget._root()._asJQuery()._hide();
  7112. return self;},
  7113. 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')}),
  7114. smalltalk.TabManager);
  7115. smalltalk.addMethod(
  7116. '_removeTab_',
  7117. smalltalk.method({
  7118. selector: 'removeTab:',
  7119. category: 'adding/Removing',
  7120. fn: function (aWidget){
  7121. var self=this;
  7122. self._tabs()._remove_(aWidget);
  7123. self._update();
  7124. return self;},
  7125. source: unescape('removeTab%3A%20aWidget%0A%20%20%20%20self%20tabs%20remove%3A%20aWidget.%0A%20%20%20%20self%20update%0A')}),
  7126. smalltalk.TabManager);
  7127. smalltalk.addMethod(
  7128. '_updateBodyMargin',
  7129. smalltalk.method({
  7130. selector: 'updateBodyMargin',
  7131. category: 'actions',
  7132. fn: function (){
  7133. var self=this;
  7134. self._setBodyMargin_(unescape("%23jtalk")._asJQuery()._height().__plus((27)));
  7135. return self;},
  7136. source: unescape('updateBodyMargin%0A%20%20%20%20self%20setBodyMargin%3A%20%27%23jtalk%27%20asJQuery%20height%20+%2027%0A')}),
  7137. smalltalk.TabManager);
  7138. smalltalk.addMethod(
  7139. '_updatePosition',
  7140. smalltalk.method({
  7141. selector: 'updatePosition',
  7142. category: 'actions',
  7143. fn: function (){
  7144. var self=this;
  7145. (function(){jQuery('#jtalk').css('top', '').css('bottom', '27px');})();
  7146. return self;},
  7147. 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')}),
  7148. smalltalk.TabManager);
  7149. smalltalk.addMethod(
  7150. '_removeBodyMargin',
  7151. smalltalk.method({
  7152. selector: 'removeBodyMargin',
  7153. category: 'actions',
  7154. fn: function (){
  7155. var self=this;
  7156. self._setBodyMargin_((0));
  7157. return self;},
  7158. source: unescape('removeBodyMargin%0A%20%20%20%20self%20setBodyMargin%3A%200%0A')}),
  7159. smalltalk.TabManager);
  7160. smalltalk.addMethod(
  7161. '_setBodyMargin_',
  7162. smalltalk.method({
  7163. selector: 'setBodyMargin:',
  7164. category: 'actions',
  7165. fn: function (anInteger){
  7166. var self=this;
  7167. ".jtalkBody"._asJQuery()._cssAt_put_(unescape("margin-bottom"),anInteger._asString().__comma("px"));
  7168. return self;},
  7169. 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')}),
  7170. smalltalk.TabManager);
  7171. smalltalk.addMethod(
  7172. '_onResize_',
  7173. smalltalk.method({
  7174. selector: 'onResize:',
  7175. category: 'actions',
  7176. fn: function (aBlock){
  7177. var self=this;
  7178. (function(){jQuery('#jtalk').resizable({
  7179. handles: 'n',
  7180. resize: aBlock,
  7181. minHeight: 230
  7182. });})();
  7183. return self;},
  7184. 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')}),
  7185. smalltalk.TabManager);
  7186. smalltalk.addMethod(
  7187. '_onWindowResize_',
  7188. smalltalk.method({
  7189. selector: 'onWindowResize:',
  7190. category: 'actions',
  7191. fn: function (aBlock){
  7192. var self=this;
  7193. (function(){jQuery(window).resize(aBlock)})();
  7194. return self;},
  7195. source: unescape('onWindowResize%3A%20aBlock%0A%20%20%20%20%7B%27jQuery%28window%29.resize%28aBlock%29%27%7D%0A')}),
  7196. smalltalk.TabManager);
  7197. smalltalk.addMethod(
  7198. '_open',
  7199. smalltalk.method({
  7200. selector: 'open',
  7201. category: 'actions',
  7202. fn: function (){
  7203. var self=this;
  7204. self['@opened']._ifFalse_((function(){self._root()._asJQuery()._show();"body"._asJQuery()._addClass_("jtalkBody");unescape("%23jtalk")._asJQuery()._show();self._updateBodyMargin();self['@selectedTab']._root()._asJQuery()._show();return self['@opened']=true;}));
  7205. return self;},
  7206. 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')}),
  7207. smalltalk.TabManager);
  7208. smalltalk.addMethod(
  7209. '_close',
  7210. smalltalk.method({
  7211. selector: 'close',
  7212. category: 'actions',
  7213. fn: function (){
  7214. var self=this;
  7215. self['@opened']._ifTrue_((function(){self._root()._asJQuery()._hide();unescape("%23jtalk")._asJQuery()._hide();self._removeBodyMargin();"body"._asJQuery()._removeClass_("jtalkBody");return self['@opened']=false;}));
  7216. return self;},
  7217. 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')}),
  7218. smalltalk.TabManager);
  7219. smalltalk.addMethod(
  7220. '_newBrowserTab',
  7221. smalltalk.method({
  7222. selector: 'newBrowserTab',
  7223. category: 'actions',
  7224. fn: function (){
  7225. var self=this;
  7226. smalltalk.Browser._open();
  7227. return self;},
  7228. source: unescape('newBrowserTab%0A%20%20%20%20Browser%20open%0A')}),
  7229. smalltalk.TabManager);
  7230. smalltalk.addMethod(
  7231. '_selectTab_',
  7232. smalltalk.method({
  7233. selector: 'selectTab:',
  7234. category: 'actions',
  7235. fn: function (aWidget){
  7236. var self=this;
  7237. self._open();
  7238. self['@selectedTab']=aWidget;
  7239. self._tabs()._do_((function(each){return each._root()._asJQuery()._hide();}));
  7240. aWidget._root()._asJQuery()._show();
  7241. self._update();
  7242. return self;},
  7243. 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')}),
  7244. smalltalk.TabManager);
  7245. smalltalk.addMethod(
  7246. '_closeTab_',
  7247. smalltalk.method({
  7248. selector: 'closeTab:',
  7249. category: 'actions',
  7250. fn: function (aWidget){
  7251. var self=this;
  7252. self._removeTab_(aWidget);
  7253. self._selectTab_(self._tabs()._last());
  7254. aWidget._root()._asJQuery()._remove();
  7255. self._update();
  7256. return self;},
  7257. 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')}),
  7258. smalltalk.TabManager);
  7259. smalltalk.addMethod(
  7260. '_renderOn_',
  7261. smalltalk.method({
  7262. selector: 'renderOn:',
  7263. category: 'rendering',
  7264. fn: function (html){
  7265. var self=this;
  7266. (function($rec){$rec._id_("jtalkTabs");return $rec._with_((function(){(function($rec){$rec._class_("closeAll");$rec._with_("x");return $rec._onClick_((function(){return self._close();}));})(html._li());self._tabs()._do_((function(each){return self._renderTabFor_on_(each,html);}));return (function($rec){$rec._class_("newtab");$rec._with_(unescape("%20+%20"));return $rec._onClick_((function(){return self._newBrowserTab();}));})(html._li());}));})(html._ul());
  7267. return self;},
  7268. 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')}),
  7269. smalltalk.TabManager);
  7270. smalltalk.addMethod(
  7271. '_renderTabFor_on_',
  7272. smalltalk.method({
  7273. selector: 'renderTabFor:on:',
  7274. category: 'rendering',
  7275. fn: function (aWidget, html){
  7276. var self=this;
  7277. var li=nil;
  7278. li=html._li();
  7279. self['@selectedTab'].__eq(aWidget)._ifTrue_((function(){return li._class_("selected");}));
  7280. li._with_((function(){(function($rec){$rec._with_(aWidget._label());return $rec._onClick_((function(){return self._selectTab_(aWidget);}));})(html._span());return aWidget._canBeClosed()._ifTrue_((function(){return (function($rec){$rec._class_("close");$rec._with_("x");return $rec._onClick_((function(){return self._closeTab_(aWidget);}));})(html._span());}));}));
  7281. return self;},
  7282. 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')}),
  7283. smalltalk.TabManager);
  7284. smalltalk.TabManager.klass.iVarNames = ['current'];
  7285. smalltalk.addMethod(
  7286. '_current',
  7287. smalltalk.method({
  7288. selector: 'current',
  7289. category: 'instance creation',
  7290. fn: function (){
  7291. var self=this;
  7292. return self['@current']._ifNil_((function(){return self['@current']=self.klass.superclass.fn.prototype['_new'].apply(self, []);}));
  7293. return self;},
  7294. source: unescape('current%0A%20%20%20%20%5Ecurrent%20ifNil%3A%20%5Bcurrent%20%3A%3D%20super%20new%5D%0A')}),
  7295. smalltalk.TabManager.klass);
  7296. smalltalk.addMethod(
  7297. '_new',
  7298. smalltalk.method({
  7299. selector: 'new',
  7300. category: 'instance creation',
  7301. fn: function (){
  7302. var self=this;
  7303. self._shouldNotImplement();
  7304. return self;},
  7305. source: unescape('new%0A%20%20%20%20self%20shouldNotImplement%0A')}),
  7306. smalltalk.TabManager.klass);
  7307. smalltalk.addClass('TabWidget', smalltalk.Widget, [], 'IDE');
  7308. smalltalk.addMethod(
  7309. '_label',
  7310. smalltalk.method({
  7311. selector: 'label',
  7312. category: 'accessing',
  7313. fn: function (){
  7314. var self=this;
  7315. self._subclassResponsibility();
  7316. return self;},
  7317. source: unescape('label%0A%20%20%20%20self%20subclassResponsibility%0A')}),
  7318. smalltalk.TabWidget);
  7319. smalltalk.addMethod(
  7320. '_open',
  7321. smalltalk.method({
  7322. selector: 'open',
  7323. category: 'actions',
  7324. fn: function (){
  7325. var self=this;
  7326. (function($rec){$rec._addTab_(self);return $rec._selectTab_(self);})(smalltalk.TabManager._current());
  7327. return self;},
  7328. source: unescape('open%0A%20%20%20%20TabManager%20current%0A%09addTab%3A%20self%3B%0A%09selectTab%3A%20self%0A')}),
  7329. smalltalk.TabWidget);
  7330. smalltalk.addMethod(
  7331. '_canBeClosed',
  7332. smalltalk.method({
  7333. selector: 'canBeClosed',
  7334. category: 'testing',
  7335. fn: function (){
  7336. var self=this;
  7337. return false;
  7338. return self;},
  7339. source: unescape('canBeClosed%0A%20%20%20%20%5Efalse%0A')}),
  7340. smalltalk.TabWidget);
  7341. smalltalk.addMethod(
  7342. '_renderOn_',
  7343. smalltalk.method({
  7344. selector: 'renderOn:',
  7345. category: 'rendering',
  7346. fn: function (html){
  7347. var self=this;
  7348. (function($rec){$rec._class_("jtalkTool");return $rec._with_((function(){(function($rec){$rec._class_("jt_box");return $rec._with_((function(){return self._renderBoxOn_(html);}));})(html._div());return (function($rec){$rec._class_("jt_buttons");return $rec._with_((function(){return self._renderButtonsOn_(html);}));})(html._div());}));})(html._root());
  7349. return self;},
  7350. 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')}),
  7351. smalltalk.TabWidget);
  7352. smalltalk.addMethod(
  7353. '_renderBoxOn_',
  7354. smalltalk.method({
  7355. selector: 'renderBoxOn:',
  7356. category: 'rendering',
  7357. fn: function (html){
  7358. var self=this;
  7359. return self;},
  7360. source: unescape('renderBoxOn%3A%20html%0A')}),
  7361. smalltalk.TabWidget);
  7362. smalltalk.addMethod(
  7363. '_renderButtonsOn_',
  7364. smalltalk.method({
  7365. selector: 'renderButtonsOn:',
  7366. category: 'rendering',
  7367. fn: function (html){
  7368. var self=this;
  7369. return self;},
  7370. source: unescape('renderButtonsOn%3A%20html%0A')}),
  7371. smalltalk.TabWidget);
  7372. smalltalk.addMethod(
  7373. '_open',
  7374. smalltalk.method({
  7375. selector: 'open',
  7376. category: 'instance creation',
  7377. fn: function (){
  7378. var self=this;
  7379. return self._new()._open();
  7380. return self;},
  7381. source: unescape('open%0A%20%20%20%20%5Eself%20new%20open%0A')}),
  7382. smalltalk.TabWidget.klass);
  7383. smalltalk.addClass('Workspace', smalltalk.TabWidget, ['textarea'], 'IDE');
  7384. smalltalk.addMethod(
  7385. '_label',
  7386. smalltalk.method({
  7387. selector: 'label',
  7388. category: 'accessing',
  7389. fn: function (){
  7390. var self=this;
  7391. return unescape("%5BWorkspace%5D");
  7392. return self;},
  7393. source: unescape('label%0A%20%20%20%20%5E%27%5BWorkspace%5D%27%0A')}),
  7394. smalltalk.Workspace);
  7395. smalltalk.addMethod(
  7396. '_selection',
  7397. smalltalk.method({
  7398. selector: 'selection',
  7399. category: 'accessing',
  7400. fn: function (){
  7401. var self=this;
  7402. return (function(){return document.selection})();
  7403. return self;},
  7404. source: unescape('selection%0A%20%20%20%20%5E%7B%27return%20document.selection%27%7D%0A')}),
  7405. smalltalk.Workspace);
  7406. smalltalk.addMethod(
  7407. '_selectionStart',
  7408. smalltalk.method({
  7409. selector: 'selectionStart',
  7410. category: 'accessing',
  7411. fn: function (){
  7412. var self=this;
  7413. return (function(){return jQuery('.jt_workspace')[0].selectionStart})();
  7414. return self;},
  7415. source: unescape('selectionStart%0A%20%20%20%20%5E%7B%27return%20jQuery%28%27%27.jt_workspace%27%27%29%5B0%5D.selectionStart%27%7D%0A')}),
  7416. smalltalk.Workspace);
  7417. smalltalk.addMethod(
  7418. '_selectionEnd',
  7419. smalltalk.method({
  7420. selector: 'selectionEnd',
  7421. category: 'accessing',
  7422. fn: function (){
  7423. var self=this;
  7424. return (function(){return jQuery('.jt_workspace')[0].selectionEnd})();
  7425. return self;},
  7426. source: unescape('selectionEnd%0A%20%20%20%20%5E%7B%27return%20jQuery%28%27%27.jt_workspace%27%27%29%5B0%5D.selectionEnd%27%7D%0A')}),
  7427. smalltalk.Workspace);
  7428. smalltalk.addMethod(
  7429. '_selectionStart_',
  7430. smalltalk.method({
  7431. selector: 'selectionStart:',
  7432. category: 'accessing',
  7433. fn: function (anInteger){
  7434. var self=this;
  7435. (function(){jQuery('.jt_workspace')[0].selectionStart = anInteger})();
  7436. return self;},
  7437. 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')}),
  7438. smalltalk.Workspace);
  7439. smalltalk.addMethod(
  7440. '_selectionEnd_',
  7441. smalltalk.method({
  7442. selector: 'selectionEnd:',
  7443. category: 'accessing',
  7444. fn: function (anInteger){
  7445. var self=this;
  7446. (function(){jQuery('.jt_workspace')[0].selectionEnd = anInteger})();
  7447. return self;},
  7448. 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')}),
  7449. smalltalk.Workspace);
  7450. smalltalk.addMethod(
  7451. '_currentLine',
  7452. smalltalk.method({
  7453. selector: 'currentLine',
  7454. category: 'accessing',
  7455. fn: function (){
  7456. var self=this;
  7457. try{var lines=nil;
  7458. var startLine=nil;
  7459. var endLine=nil;
  7460. lines=self['@textarea']._asJQuery()._val()._tokenize_(smalltalk.String._cr());
  7461. startLine=endLine=(0);
  7462. lines._do_((function(each){endLine=startLine.__plus(each._size());startLine=endLine.__plus((1));return endLine.__gt_eq(self._selectionStart())._ifTrue_((function(){self._selectionEnd_(endLine);return (function(){throw({name: 'stReturn', selector: '_currentLine', fn: function(){return each}})})();}));}));
  7463. return self;
  7464. } catch(e) {if(e.name === 'stReturn' && e.selector === '_currentLine'){return e.fn()} throw(e)}},
  7465. 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')}),
  7466. smalltalk.Workspace);
  7467. smalltalk.addMethod(
  7468. '_handleKeyDown_',
  7469. smalltalk.method({
  7470. selector: 'handleKeyDown:',
  7471. category: 'actions',
  7472. fn: function (anEvent){
  7473. var self=this;
  7474. return (function(){if(anEvent.ctrlKey) {
  7475. if(anEvent.keyCode === 68) { //ctrl+p
  7476. self._printIt();
  7477. return false;
  7478. }
  7479. if(anEvent.keyCode === 80) { //ctrl+d
  7480. self._doIt();
  7481. return false;
  7482. }
  7483. }})();
  7484. return self;},
  7485. source: unescape('handleKeyDown%3A%20anEvent%0A%20%20%20%20%5E%7B%27if%28anEvent.ctrlKey%29%20%7B%0A%09%09if%28anEvent.keyCode%20%3D%3D%3D%2068%29%20%7B%20//ctrl+p%0A%09%09%09self._printIt%28%29%3B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%09%09if%28anEvent.keyCode%20%3D%3D%3D%2080%29%20%7B%20//ctrl+d%0A%09%09%09self._doIt%28%29%3B%0A%09%09%09return%20false%3B%0A%09%09%7D%0A%09%7D%27%7D%0A')}),
  7486. smalltalk.Workspace);
  7487. smalltalk.addMethod(
  7488. '_clearWorkspace',
  7489. smalltalk.method({
  7490. selector: 'clearWorkspace',
  7491. category: 'actions',
  7492. fn: function (){
  7493. var self=this;
  7494. self['@textarea']._asJQuery()._val_("");
  7495. return self;},
  7496. source: unescape('clearWorkspace%0A%20%20%20%20textarea%20asJQuery%20val%3A%20%27%27%0A')}),
  7497. smalltalk.Workspace);
  7498. smalltalk.addMethod(
  7499. '_doIt',
  7500. smalltalk.method({
  7501. selector: 'doIt',
  7502. category: 'actions',
  7503. fn: function (){
  7504. var self=this;
  7505. self._printIt();
  7506. return self;},
  7507. source: unescape('doIt%0A%20%20%20%20self%20printIt%0A')}),
  7508. smalltalk.Workspace);
  7509. smalltalk.addMethod(
  7510. '_printIt',
  7511. smalltalk.method({
  7512. selector: 'printIt',
  7513. category: 'actions',
  7514. fn: function (){
  7515. var self=this;
  7516. var selection=nil;
  7517. self['@textarea']._asJQuery()._focus();
  7518. self._selectionStart().__eq(self._selectionEnd())._ifTrue_ifFalse_((function(){return selection=self._currentLine();}),(function(){return selection=self['@textarea']._asJQuery()._val()._copyFrom_to_(self._selectionStart().__plus((1)),self._selectionEnd().__plus((1)));}));
  7519. self._print_(self._eval_(selection)._printString());
  7520. return self;},
  7521. source: unescape('printIt%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%20self%20print%3A%20%28self%20eval%3A%20selection%29%20printString%0A')}),
  7522. smalltalk.Workspace);
  7523. smalltalk.addMethod(
  7524. '_print_',
  7525. smalltalk.method({
  7526. selector: 'print:',
  7527. category: 'actions',
  7528. fn: function (aString){
  7529. var self=this;
  7530. var start=nil;
  7531. start=self._selectionEnd();
  7532. self['@textarea']._asJQuery()._val_(self['@textarea']._asJQuery()._val()._copyFrom_to_((1),start).__comma(" ").__comma(aString).__comma(" ").__comma(self['@textarea']._asJQuery()._val()._copyFrom_to_(start.__plus((1)),self['@textarea']._asJQuery()._val()._size())));
  7533. self._selectionStart_(start);
  7534. self._selectionEnd_(start.__plus(aString._size()).__plus((2)));
  7535. return self;},
  7536. 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')}),
  7537. smalltalk.Workspace);
  7538. smalltalk.addMethod(
  7539. '_eval_',
  7540. smalltalk.method({
  7541. selector: 'eval:',
  7542. category: 'actions',
  7543. fn: function (aString){
  7544. var self=this;
  7545. try{var compiler=nil;
  7546. var node=nil;
  7547. compiler=smalltalk.Compiler._new();
  7548. node=compiler._parseExpression_(aString);
  7549. node._isParseFailure()._ifTrue_((function(){return (function(){throw({name: 'stReturn', selector: '_eval_', fn: function(){return self._alert_(node._reason().__comma(unescape("%2C%20position%3A%20")).__comma(node._position()))}})})();}));
  7550. (function(){throw({name: 'stReturn', selector: '_eval_', fn: function(){return compiler._loadExpression_(aString)}})})();
  7551. return self;
  7552. } catch(e) {if(e.name === 'stReturn' && e.selector === '_eval_'){return e.fn()} throw(e)}},
  7553. 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')}),
  7554. smalltalk.Workspace);
  7555. smalltalk.addMethod(
  7556. '_renderBoxOn_',
  7557. smalltalk.method({
  7558. selector: 'renderBoxOn:',
  7559. category: 'rendering',
  7560. fn: function (html){
  7561. var self=this;
  7562. self['@textarea']=html._textarea();
  7563. self['@textarea']._asJQuery()._call_("tabby");
  7564. self['@textarea']._onKeyDown_((function(e){return self._handleKeyDown_(e);}));
  7565. (function($rec){$rec._class_("jt_workspace");return $rec._at_put_("spellcheck","false");})(self['@textarea']);
  7566. return self;},
  7567. 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')}),
  7568. smalltalk.Workspace);
  7569. smalltalk.addMethod(
  7570. '_renderButtonsOn_',
  7571. smalltalk.method({
  7572. selector: 'renderButtonsOn:',
  7573. category: 'rendering',
  7574. fn: function (html){
  7575. var self=this;
  7576. (function($rec){$rec._with_("DoIt");$rec._title_(unescape("ctrl+d"));return $rec._onClick_((function(){return self._doIt();}));})(html._button());
  7577. (function($rec){$rec._with_("PrintIt");$rec._title_(unescape("ctrl+p"));return $rec._onClick_((function(){return self._printIt();}));})(html._button());
  7578. (function($rec){$rec._with_("Clear workspace");return $rec._onClick_((function(){return self._clearWorkspace();}));})(html._button());
  7579. return self;},
  7580. 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%27Clear%20workspace%27%3B%0A%09onClick%3A%20%5Bself%20clearWorkspace%5D%0A')}),
  7581. smalltalk.Workspace);
  7582. smalltalk.addClass('Transcript', smalltalk.TabWidget, ['textarea'], 'IDE');
  7583. smalltalk.addMethod(
  7584. '_label',
  7585. smalltalk.method({
  7586. selector: 'label',
  7587. category: 'accessing',
  7588. fn: function (){
  7589. var self=this;
  7590. return unescape("%5BTranscript%5D");
  7591. return self;},
  7592. source: unescape('label%0A%20%20%20%20%5E%27%5BTranscript%5D%27%0A')}),
  7593. smalltalk.Transcript);
  7594. smalltalk.addMethod(
  7595. '_show_',
  7596. smalltalk.method({
  7597. selector: 'show:',
  7598. category: 'actions',
  7599. fn: function (anObject){
  7600. var self=this;
  7601. self['@textarea']._asJQuery()._val_(self['@textarea']._asJQuery()._val().__comma(anObject._asString()));
  7602. return self;},
  7603. source: unescape('show%3A%20anObject%0A%20%20%20%20textarea%20asJQuery%20val%3A%20textarea%20asJQuery%20val%2C%20anObject%20asString.%0A%0A')}),
  7604. smalltalk.Transcript);
  7605. smalltalk.addMethod(
  7606. '_cr',
  7607. smalltalk.method({
  7608. selector: 'cr',
  7609. category: 'actions',
  7610. fn: function (){
  7611. var self=this;
  7612. self['@textarea']._asJQuery()._val_(self['@textarea']._asJQuery()._val().__comma(smalltalk.String._cr()));
  7613. return self;},
  7614. source: unescape('cr%0A%20%20%20%20textarea%20asJQuery%20val%3A%20textarea%20asJQuery%20val%2C%20String%20cr.%0A')}),
  7615. smalltalk.Transcript);
  7616. smalltalk.addMethod(
  7617. '_clear',
  7618. smalltalk.method({
  7619. selector: 'clear',
  7620. category: 'actions',
  7621. fn: function (){
  7622. var self=this;
  7623. self['@textarea']._asJQuery()._val_("");
  7624. return self;},
  7625. source: unescape('clear%0A%20%20%20%20textarea%20asJQuery%20val%3A%20%27%27%0A')}),
  7626. smalltalk.Transcript);
  7627. smalltalk.addMethod(
  7628. '_renderBoxOn_',
  7629. smalltalk.method({
  7630. selector: 'renderBoxOn:',
  7631. category: 'rendering',
  7632. fn: function (html){
  7633. var self=this;
  7634. self['@textarea']=html._textarea();
  7635. self['@textarea']._asJQuery()._call_("tabby");
  7636. (function($rec){$rec._class_("jt_transcript");return $rec._at_put_("spellcheck","false");})(self['@textarea']);
  7637. return self;},
  7638. 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')}),
  7639. smalltalk.Transcript);
  7640. smalltalk.addMethod(
  7641. '_renderButtonsOn_',
  7642. smalltalk.method({
  7643. selector: 'renderButtonsOn:',
  7644. category: 'rendering',
  7645. fn: function (html){
  7646. var self=this;
  7647. (function($rec){$rec._with_("Clear transcript");return $rec._onClick_((function(){return self._clear();}));})(html._button());
  7648. return self;},
  7649. 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')}),
  7650. smalltalk.Transcript);
  7651. smalltalk.Transcript.klass.iVarNames = ['current'];
  7652. smalltalk.addMethod(
  7653. '_open',
  7654. smalltalk.method({
  7655. selector: 'open',
  7656. category: 'instance creation',
  7657. fn: function (){
  7658. var self=this;
  7659. self._current()._open();
  7660. return self;},
  7661. source: unescape('open%0A%20%20%20%20self%20current%20open%0A')}),
  7662. smalltalk.Transcript.klass);
  7663. smalltalk.addMethod(
  7664. '_new',
  7665. smalltalk.method({
  7666. selector: 'new',
  7667. category: 'instance creation',
  7668. fn: function (){
  7669. var self=this;
  7670. self._shouldNotImplement();
  7671. return self;},
  7672. source: unescape('new%0A%20%20%20%20self%20shouldNotImplement%0A')}),
  7673. smalltalk.Transcript.klass);
  7674. smalltalk.addMethod(
  7675. '_current',
  7676. smalltalk.method({
  7677. selector: 'current',
  7678. category: 'instance creation',
  7679. fn: function (){
  7680. var self=this;
  7681. return self['@current']._ifNil_((function(){return self['@current']=self.klass.superclass.fn.prototype['_new'].apply(self, []);}));
  7682. return self;},
  7683. source: unescape('current%0A%20%20%20%20%5Ecurrent%20ifNil%3A%20%5Bcurrent%20%3A%3D%20super%20new%5D%0A')}),
  7684. smalltalk.Transcript.klass);
  7685. smalltalk.addMethod(
  7686. '_show_',
  7687. smalltalk.method({
  7688. selector: 'show:',
  7689. category: 'printing',
  7690. fn: function (anObject){
  7691. var self=this;
  7692. self._current()._show_(anObject);
  7693. return self;},
  7694. source: unescape('show%3A%20anObject%0A%20%20%20%20self%20current%20show%3A%20anObject%0A')}),
  7695. smalltalk.Transcript.klass);
  7696. smalltalk.addMethod(
  7697. '_cr',
  7698. smalltalk.method({
  7699. selector: 'cr',
  7700. category: 'printing',
  7701. fn: function (){
  7702. var self=this;
  7703. self._current()._show_(smalltalk.String._cr());
  7704. return self;},
  7705. source: unescape('cr%0A%20%20%20%20self%20current%20show%3A%20String%20cr%0A')}),
  7706. smalltalk.Transcript.klass);
  7707. smalltalk.addMethod(
  7708. '_clear',
  7709. smalltalk.method({
  7710. selector: 'clear',
  7711. category: 'printing',
  7712. fn: function (){
  7713. var self=this;
  7714. self._current()._clear();
  7715. return self;},
  7716. source: unescape('clear%0A%20%20%20%20self%20current%20clear%0A')}),
  7717. smalltalk.Transcript.klass);
  7718. smalltalk.addClass('Browser', smalltalk.TabWidget, ['selectedCategory', 'selectedClass', 'selectedProtocol', 'selectedMethod', 'categoriesList', 'classesList', 'protocolsList', 'methodsList', 'sourceTextarea', 'tabsList', 'selectedTab', 'saveButton', 'classButtons', 'methodButtons', 'unsavedChanges'], 'IDE');
  7719. smalltalk.addMethod(
  7720. '_initialize',
  7721. smalltalk.method({
  7722. selector: 'initialize',
  7723. category: 'initialization',
  7724. fn: function (){
  7725. var self=this;
  7726. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  7727. self['@selectedTab']="instance";
  7728. self['@unsavedChanges']=false;
  7729. return self;},
  7730. 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')}),
  7731. smalltalk.Browser);
  7732. smalltalk.addMethod(
  7733. '_label',
  7734. smalltalk.method({
  7735. selector: 'label',
  7736. category: 'accessing',
  7737. fn: function (){
  7738. var self=this;
  7739. return self['@selectedClass']._ifNil_ifNotNil_((function(){return unescape("Browser%20%28nil%29");}),(function(){return self['@selectedClass']._name();}));
  7740. return self;},
  7741. 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')}),
  7742. smalltalk.Browser);
  7743. smalltalk.addMethod(
  7744. '_categories',
  7745. smalltalk.method({
  7746. selector: 'categories',
  7747. category: 'accessing',
  7748. fn: function (){
  7749. var self=this;
  7750. var categories=nil;
  7751. categories=smalltalk.Array._new();
  7752. smalltalk.Smalltalk._current()._classes()._do_((function(each){return categories._includes_(each._category())._ifFalse_((function(){return categories._add_(each._category());}));}));
  7753. return categories._sort();
  7754. return self;},
  7755. 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')}),
  7756. smalltalk.Browser);
  7757. smalltalk.addMethod(
  7758. '_classes',
  7759. smalltalk.method({
  7760. selector: 'classes',
  7761. category: 'accessing',
  7762. fn: function (){
  7763. var self=this;
  7764. return smalltalk.Smalltalk._current()._classes()._select_((function(each){return each._category().__eq(self['@selectedCategory']);}))._sort_((function(a, b){return a._name().__gt(b._name());}));
  7765. return self;},
  7766. 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')}),
  7767. smalltalk.Browser);
  7768. smalltalk.addMethod(
  7769. '_protocols',
  7770. smalltalk.method({
  7771. selector: 'protocols',
  7772. category: 'accessing',
  7773. fn: function (){
  7774. var self=this;
  7775. try{var klass=nil;
  7776. var protocols=nil;
  7777. protocols=smalltalk.Array._new();
  7778. self['@selectedClass']._ifNotNil_((function(){self['@selectedTab'].__eq("comment")._ifTrue_((function(){return (function(){throw({name: 'stReturn', selector: '_protocols', fn: function(){return []}})})();}));klass=self['@selectedTab'].__eq("instance")._ifTrue_ifFalse_((function(){return self['@selectedClass'];}),(function(){return self['@selectedClass']._class();}));klass._methodDictionary()._isEmpty()._ifTrue_((function(){return protocols._add_("not yet classified");}));return klass._methodDictionary()._do_((function(each){return protocols._includes_(each._category())._ifFalse_((function(){return protocols._add_(each._category());}));}));}));
  7779. (function(){throw({name: 'stReturn', selector: '_protocols', fn: function(){return protocols._sort()}})})();
  7780. return self;
  7781. } catch(e) {if(e.name === 'stReturn' && e.selector === '_protocols'){return e.fn()} throw(e)}},
  7782. 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')}),
  7783. smalltalk.Browser);
  7784. smalltalk.addMethod(
  7785. '_methods',
  7786. smalltalk.method({
  7787. selector: 'methods',
  7788. category: 'accessing',
  7789. fn: function (){
  7790. var self=this;
  7791. try{var klass=nil;
  7792. self['@selectedTab'].__eq("comment")._ifTrue_((function(){return (function(){throw({name: 'stReturn', selector: '_methods', fn: function(){return []}})})();}));
  7793. self['@selectedClass']._ifNotNil_((function(){return klass=self['@selectedTab'].__eq("instance")._ifTrue_ifFalse_((function(){return self['@selectedClass'];}),(function(){return self['@selectedClass']._class();}));}));
  7794. (function(){throw({name: 'stReturn', selector: '_methods', fn: function(){return self['@selectedProtocol']._ifNil_ifNotNil_((function(){return klass._ifNil_ifNotNil_((function(){return [];}),(function(){return klass._methodDictionary()._values();}));}),(function(){return klass._methodDictionary()._values()._select_((function(each){return each._category().__eq(self['@selectedProtocol']);}));}))._sort_((function(a, b){return a._selector().__gt(b._selector());}))}})})();
  7795. return self;
  7796. } catch(e) {if(e.name === 'stReturn' && e.selector === '_methods'){return e.fn()} throw(e)}},
  7797. 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')}),
  7798. smalltalk.Browser);
  7799. smalltalk.addMethod(
  7800. '_source',
  7801. smalltalk.method({
  7802. selector: 'source',
  7803. category: 'accessing',
  7804. fn: function (){
  7805. var self=this;
  7806. try{self['@selectedTab'].__eq("comment")._ifFalse_((function(){return (function(){throw({name: 'stReturn', selector: '_source', fn: function(){return self['@selectedProtocol']._notNil()._or_((function(){return self['@selectedMethod']._notNil();}))._ifFalse_ifTrue_((function(){return self._declarationSource();}),(function(){return self._methodSource();}))}})})();}));
  7807. (function(){throw({name: 'stReturn', selector: '_source', fn: function(){return self['@selectedClass']._ifNil_ifNotNil_((function(){return "";}),(function(){return self._classCommentSource();}))}})})();
  7808. return self;
  7809. } catch(e) {if(e.name === 'stReturn' && e.selector === '_source'){return e.fn()} throw(e)}},
  7810. 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')}),
  7811. smalltalk.Browser);
  7812. smalltalk.addMethod(
  7813. '_methodSource',
  7814. smalltalk.method({
  7815. selector: 'methodSource',
  7816. category: 'accessing',
  7817. fn: function (){
  7818. var self=this;
  7819. return self['@selectedMethod']._ifNil_ifNotNil_((function(){return self._dummyMethodSource();}),(function(){return self['@selectedMethod']._source();}));
  7820. return self;},
  7821. source: unescape('methodSource%0A%20%20%20%20%5EselectedMethod%0A%09ifNil%3A%20%5Bself%20dummyMethodSource%5D%0A%09ifNotNil%3A%20%5BselectedMethod%20source%5D%0A')}),
  7822. smalltalk.Browser);
  7823. smalltalk.addMethod(
  7824. '_dummyMethodSource',
  7825. smalltalk.method({
  7826. selector: 'dummyMethodSource',
  7827. category: 'accessing',
  7828. fn: function (){
  7829. var self=this;
  7830. return unescape("messageSelectorAndArgumentNames%0A%09%22comment%20stating%20purpose%20of%20message%22%0A%0A%09%7C%20temporary%20variable%20names%20%7C%0A%09statements");
  7831. return self;},
  7832. 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')}),
  7833. smalltalk.Browser);
  7834. smalltalk.addMethod(
  7835. '_declarationSource',
  7836. smalltalk.method({
  7837. selector: 'declarationSource',
  7838. category: 'accessing',
  7839. fn: function (){
  7840. var self=this;
  7841. return self['@selectedTab'].__eq("instance")._ifTrue_ifFalse_((function(){return self._classDeclarationSource();}),(function(){return self._metaclassDeclarationSource();}));
  7842. return self;},
  7843. 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')}),
  7844. smalltalk.Browser);
  7845. smalltalk.addMethod(
  7846. '_classDeclarationSource',
  7847. smalltalk.method({
  7848. selector: 'classDeclarationSource',
  7849. category: 'accessing',
  7850. fn: function (){
  7851. var self=this;
  7852. var stream=nil;
  7853. stream=""._writeStream();
  7854. self['@selectedClass']._ifNotNil_((function(){(function($rec){$rec._nextPutAll_(self['@selectedClass']._superclass()._asString());$rec._nextPutAll_(unescape("%20subclass%3A%20%23"));$rec._nextPutAll_(self['@selectedClass']._name());$rec._nextPutAll_(smalltalk.String._cr().__comma(smalltalk.String._tab()));return $rec._nextPutAll_(unescape("instanceVariableNames%3A%20%27"));})(stream);self['@selectedClass']._instanceVariableNames()._do_separatedBy_((function(each){return stream._nextPutAll_(each);}),(function(){return stream._nextPutAll_(" ");}));return (function($rec){$rec._nextPutAll_(unescape("%27").__comma(smalltalk.String._cr()).__comma(smalltalk.String._tab()));$rec._nextPutAll_(unescape("category%3A%20%27"));$rec._nextPutAll_(self['@selectedClass']._category());return $rec._nextPutAll_(unescape("%27"));})(stream);}));
  7855. return stream._contents();
  7856. return self;},
  7857. 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')}),
  7858. smalltalk.Browser);
  7859. smalltalk.addMethod(
  7860. '_metaclassDeclarationSource',
  7861. smalltalk.method({
  7862. selector: 'metaclassDeclarationSource',
  7863. category: 'accessing',
  7864. fn: function (){
  7865. var self=this;
  7866. var stream=nil;
  7867. stream=""._writeStream();
  7868. self['@selectedClass']._ifNotNil_((function(){(function($rec){$rec._nextPutAll_(self['@selectedClass']._asString());$rec._nextPutAll_(" class ");return $rec._nextPutAll_(unescape("instanceVariableNames%3A%20%27"));})(stream);self['@selectedClass']._class()._instanceVariableNames()._do_separatedBy_((function(each){return stream._nextPutAll_(each);}),(function(){return stream._nextPutAll_(" ");}));return stream._nextPutAll_(unescape("%27"));}));
  7869. return stream._contents();
  7870. return self;},
  7871. 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')}),
  7872. smalltalk.Browser);
  7873. smalltalk.addMethod(
  7874. '_classCommentSource',
  7875. smalltalk.method({
  7876. selector: 'classCommentSource',
  7877. category: 'accessing',
  7878. fn: function (){
  7879. var self=this;
  7880. return self['@selectedClass']._comment();
  7881. return self;},
  7882. source: unescape('classCommentSource%0A%20%20%20%20%5EselectedClass%20comment%0A')}),
  7883. smalltalk.Browser);
  7884. smalltalk.addMethod(
  7885. '_enableSaveButton',
  7886. smalltalk.method({
  7887. selector: 'enableSaveButton',
  7888. category: 'actions',
  7889. fn: function (){
  7890. var self=this;
  7891. self['@saveButton']._removeAt_("disabled");
  7892. self['@unsavedChanges']=true;
  7893. return self;},
  7894. source: unescape('enableSaveButton%0A%20%20%20%20saveButton%20removeAt%3A%20%27disabled%27.%0A%20%20%20%20unsavedChanges%20%3A%3D%20true%0A')}),
  7895. smalltalk.Browser);
  7896. smalltalk.addMethod(
  7897. '_disableSaveButton',
  7898. smalltalk.method({
  7899. selector: 'disableSaveButton',
  7900. category: 'actions',
  7901. fn: function (){
  7902. var self=this;
  7903. self['@saveButton']._ifNotNil_((function(){return self['@saveButton']._at_put_("disabled",true);}));
  7904. self['@unsavedChanges']=false;
  7905. return self;},
  7906. 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')}),
  7907. smalltalk.Browser);
  7908. smalltalk.addMethod(
  7909. '_hideClassButtons',
  7910. smalltalk.method({
  7911. selector: 'hideClassButtons',
  7912. category: 'actions',
  7913. fn: function (){
  7914. var self=this;
  7915. self['@classButtons']._asJQuery()._hide();
  7916. return self;},
  7917. source: unescape('hideClassButtons%0A%20%20%20%20classButtons%20asJQuery%20hide%0A')}),
  7918. smalltalk.Browser);
  7919. smalltalk.addMethod(
  7920. '_showClassButtons',
  7921. smalltalk.method({
  7922. selector: 'showClassButtons',
  7923. category: 'actions',
  7924. fn: function (){
  7925. var self=this;
  7926. self['@classButtons']._asJQuery()._show();
  7927. return self;},
  7928. source: unescape('showClassButtons%0A%20%20%20%20classButtons%20asJQuery%20show%0A')}),
  7929. smalltalk.Browser);
  7930. smalltalk.addMethod(
  7931. '_hideMethodButtons',
  7932. smalltalk.method({
  7933. selector: 'hideMethodButtons',
  7934. category: 'actions',
  7935. fn: function (){
  7936. var self=this;
  7937. self['@methodButtons']._asJQuery()._hide();
  7938. return self;},
  7939. source: unescape('hideMethodButtons%0A%20%20%20%20methodButtons%20asJQuery%20hide%0A')}),
  7940. smalltalk.Browser);
  7941. smalltalk.addMethod(
  7942. '_showMethodButtons',
  7943. smalltalk.method({
  7944. selector: 'showMethodButtons',
  7945. category: 'actions',
  7946. fn: function (){
  7947. var self=this;
  7948. self['@methodButtons']._asJQuery()._show();
  7949. return self;},
  7950. source: unescape('showMethodButtons%0A%20%20%20%20methodButtons%20asJQuery%20show%0A')}),
  7951. smalltalk.Browser);
  7952. smalltalk.addMethod(
  7953. '_compile',
  7954. smalltalk.method({
  7955. selector: 'compile',
  7956. category: 'actions',
  7957. fn: function (){
  7958. var self=this;
  7959. self._disableSaveButton();
  7960. self['@selectedTab'].__eq("comment")._ifTrue_((function(){return self['@selectedClass']._ifNotNil_((function(){return self._compileClassComment();}));}));
  7961. self['@selectedProtocol']._notNil()._or_((function(){return self['@selectedMethod']._notNil();}))._ifFalse_ifTrue_((function(){return self._compileDefinition();}),(function(){return self._compileMethodDefinition();}));
  7962. return self;},
  7963. 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')}),
  7964. smalltalk.Browser);
  7965. smalltalk.addMethod(
  7966. '_compileClassComment',
  7967. smalltalk.method({
  7968. selector: 'compileClassComment',
  7969. category: 'actions',
  7970. fn: function (){
  7971. var self=this;
  7972. self['@selectedClass']._comment_(self['@sourceTextarea']._asJQuery()._val());
  7973. return self;},
  7974. source: unescape('compileClassComment%0A%20%20%20%20selectedClass%20comment%3A%20sourceTextarea%20asJQuery%20val%0A')}),
  7975. smalltalk.Browser);
  7976. smalltalk.addMethod(
  7977. '_compileMethodDefinition',
  7978. smalltalk.method({
  7979. selector: 'compileMethodDefinition',
  7980. category: 'actions',
  7981. fn: function (){
  7982. var self=this;
  7983. self['@selectedTab'].__eq("instance")._ifTrue_ifFalse_((function(){return self._compileMethodDefinitionFor_(self['@selectedClass']);}),(function(){return self._compileMethodDefinitionFor_(self['@selectedClass']._class());}));
  7984. return self;},
  7985. 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')}),
  7986. smalltalk.Browser);
  7987. smalltalk.addMethod(
  7988. '_compileMethodDefinitionFor_',
  7989. smalltalk.method({
  7990. selector: 'compileMethodDefinitionFor:',
  7991. category: 'actions',
  7992. fn: function (aClass){
  7993. var self=this;
  7994. try{var compiler=nil;
  7995. var method=nil;
  7996. var source=nil;
  7997. var node=nil;
  7998. source=self['@sourceTextarea']._asJQuery()._val();
  7999. compiler=smalltalk.Compiler._new();
  8000. node=compiler._parse_(source);
  8001. node._isParseFailure()._ifTrue_((function(){return (function(){throw({name: 'stReturn', selector: '_compileMethodDefinitionFor_', fn: function(){return self._alert_("PARSE ERROR: ".__comma(node._reason()).__comma(unescape("%2C%20position%3A%20")).__comma(node._position()._asString()))}})})();}));
  8002. compiler._currentClass_(self['@selectedClass']);
  8003. method=compiler._eval_(compiler._compileNode_(node));
  8004. method._category_(self['@selectedProtocol']);
  8005. aClass._addCompiledMethod_(method);
  8006. self._updateMethodsList();
  8007. self._selectMethod_(method);
  8008. return self;
  8009. } catch(e) {if(e.name === 'stReturn' && e.selector === '_compileMethodDefinitionFor_'){return e.fn()} throw(e)}},
  8010. 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%20compiler%20%3A%3D%20Compiler%20new.%0A%20%20%20%20node%20%3A%3D%20compiler%20parse%3A%20source.%0A%20%20%20%20node%20isParseFailure%20ifTrue%3A%20%5B%0A%09%5Eself%20alert%3A%20%27PARSE%20ERROR%3A%20%27%2C%20node%20reason%2C%20%27%2C%20position%3A%20%27%2C%20node%20position%20asString%5D.%0A%20%20%20%20compiler%20currentClass%3A%20selectedClass.%0A%20%20%20%20method%20%3A%3D%20compiler%20eval%3A%20%28compiler%20compileNode%3A%20node%29.%0A%20%20%20%20method%20category%3A%20selectedProtocol.%0A%20%20%20%20aClass%20addCompiledMethod%3A%20method.%0A%20%20%20%20self%20updateMethodsList.%0A%20%20%20%20self%20selectMethod%3A%20method%0A')}),
  8011. smalltalk.Browser);
  8012. smalltalk.addMethod(
  8013. '_compileDefinition',
  8014. smalltalk.method({
  8015. selector: 'compileDefinition',
  8016. category: 'actions',
  8017. fn: function (){
  8018. var self=this;
  8019. var newClass=nil;
  8020. newClass=smalltalk.Compiler._new()._loadExpression_(self['@sourceTextarea']._asJQuery()._val());
  8021. (function($rec){$rec._updateCategoriesList();return $rec._updateClassesList();})(self);
  8022. return self;},
  8023. 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')}),
  8024. smalltalk.Browser);
  8025. smalltalk.addMethod(
  8026. '_cancelChanges',
  8027. smalltalk.method({
  8028. selector: 'cancelChanges',
  8029. category: 'actions',
  8030. fn: function (){
  8031. var self=this;
  8032. return self['@unsavedChanges']._ifTrue_ifFalse_((function(){return self._confirm_(unescape("Cancel%20changes%3F"));}),(function(){return true;}));
  8033. return self;},
  8034. 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')}),
  8035. smalltalk.Browser);
  8036. smalltalk.addMethod(
  8037. '_removeClass',
  8038. smalltalk.method({
  8039. selector: 'removeClass',
  8040. category: 'actions',
  8041. fn: function (){
  8042. var self=this;
  8043. self._confirm_("Do you really want to remove ".__comma(self['@selectedClass']._name()).__comma(unescape("%3F")))._ifTrue_((function(){smalltalk.Smalltalk._current()._basicDelete_(self['@selectedClass']._name());return self._selectClass_(nil);}));
  8044. return self;},
  8045. 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')}),
  8046. smalltalk.Browser);
  8047. smalltalk.addMethod(
  8048. '_removeMethod',
  8049. smalltalk.method({
  8050. selector: 'removeMethod',
  8051. category: 'actions',
  8052. fn: function (){
  8053. var self=this;
  8054. self._cancelChanges()._ifTrue_((function(){return self._confirm_(unescape("Do%20you%20really%20want%20to%20remove%20%23").__comma(self['@selectedMethod']._selector()).__comma(unescape("%3F")))._ifTrue_((function(){self['@selectedClass']._removeCompiledMethod_(self['@selectedMethod']);return self._selectMethod_(nil);}));}));
  8055. return self;},
  8056. 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%09selectedClass%20removeCompiledMethod%3A%20selectedMethod.%0A%09%09self%20selectMethod%3A%20nil%5D%5D%0A')}),
  8057. smalltalk.Browser);
  8058. smalltalk.addMethod(
  8059. '_setMethodProtocol_',
  8060. smalltalk.method({
  8061. selector: 'setMethodProtocol:',
  8062. category: 'actions',
  8063. fn: function (aString){
  8064. var self=this;
  8065. self._cancelChanges()._ifTrue_((function(){self['@selectedMethod']._category_(aString);self['@selectedProtocol']=aString;self['@selectedMethod']=self['@selectedMethod'];return (function($rec){$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();})(self);}));
  8066. return self;},
  8067. source: unescape('setMethodProtocol%3A%20aString%0A%20%20%20%20self%20cancelChanges%20ifTrue%3A%20%5B%0A%09selectedMethod%20category%3A%20aString.%0A%09selectedProtocol%20%3A%3D%20aString.%0A%09selectedMethod%20%3A%3D%20selectedMethod.%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')}),
  8068. smalltalk.Browser);
  8069. smalltalk.addMethod(
  8070. '_addNewProtocol',
  8071. smalltalk.method({
  8072. selector: 'addNewProtocol',
  8073. category: 'actions',
  8074. fn: function (){
  8075. var self=this;
  8076. var newProtocol=nil;
  8077. newProtocol=self._prompt_("New method protocol");
  8078. newProtocol._notEmpty()._ifTrue_((function(){return self._setMethodProtocol_(newProtocol);}));
  8079. return self;},
  8080. 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%09self%20setMethodProtocol%3A%20newProtocol%5D%0A')}),
  8081. smalltalk.Browser);
  8082. smalltalk.addMethod(
  8083. '_selectCategory_',
  8084. smalltalk.method({
  8085. selector: 'selectCategory:',
  8086. category: 'actions',
  8087. fn: function (aCategory){
  8088. var self=this;
  8089. self._cancelChanges()._ifTrue_((function(){self['@selectedCategory']=aCategory;self['@selectedClass']=self['@selectedProtocol']=self['@selectedMethod']=nil;return (function($rec){$rec._updateCategoriesList();$rec._updateClassesList();$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();})(self);}));
  8090. return self;},
  8091. 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')}),
  8092. smalltalk.Browser);
  8093. smalltalk.addMethod(
  8094. '_selectClass_',
  8095. smalltalk.method({
  8096. selector: 'selectClass:',
  8097. category: 'actions',
  8098. fn: function (aClass){
  8099. var self=this;
  8100. self._cancelChanges()._ifTrue_((function(){self['@selectedClass']=aClass;self['@selectedProtocol']=self['@selectedMethod']=nil;return (function($rec){$rec._updateClassesList();$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();})(self);}));
  8101. return self;},
  8102. 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')}),
  8103. smalltalk.Browser);
  8104. smalltalk.addMethod(
  8105. '_selectProtocol_',
  8106. smalltalk.method({
  8107. selector: 'selectProtocol:',
  8108. category: 'actions',
  8109. fn: function (aString){
  8110. var self=this;
  8111. self._cancelChanges()._ifTrue_((function(){self['@selectedProtocol']=aString;self['@selectedMethod']=nil;return (function($rec){$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();})(self);}));
  8112. return self;},
  8113. 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')}),
  8114. smalltalk.Browser);
  8115. smalltalk.addMethod(
  8116. '_selectMethod_',
  8117. smalltalk.method({
  8118. selector: 'selectMethod:',
  8119. category: 'actions',
  8120. fn: function (aMethod){
  8121. var self=this;
  8122. self._cancelChanges()._ifTrue_((function(){self['@selectedMethod']=aMethod;return (function($rec){$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();})(self);}));
  8123. return self;},
  8124. 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')}),
  8125. smalltalk.Browser);
  8126. smalltalk.addMethod(
  8127. '_selectTab_',
  8128. smalltalk.method({
  8129. selector: 'selectTab:',
  8130. category: 'actions',
  8131. fn: function (aString){
  8132. var self=this;
  8133. self._cancelChanges()._ifTrue_((function(){self['@selectedTab']=aString;self._selectProtocol_(nil);return self._updateTabsList();}));
  8134. return self;},
  8135. 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')}),
  8136. smalltalk.Browser);
  8137. smalltalk.addMethod(
  8138. '_renderBoxOn_',
  8139. smalltalk.method({
  8140. selector: 'renderBoxOn:',
  8141. category: 'rendering',
  8142. fn: function (html){
  8143. var self=this;
  8144. (function($rec){$rec._renderTopPanelOn_(html);$rec._renderTabsOn_(html);return $rec._renderBottomPanelOn_(html);})(self);
  8145. return self;},
  8146. 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')}),
  8147. smalltalk.Browser);
  8148. smalltalk.addMethod(
  8149. '_renderTopPanelOn_',
  8150. smalltalk.method({
  8151. selector: 'renderTopPanelOn:',
  8152. category: 'rendering',
  8153. fn: function (html){
  8154. var self=this;
  8155. (function($rec){$rec._class_("top");return $rec._with_((function(){self['@categoriesList']=html._ul()._class_("jt_column categories");self['@classesList']=html._ul()._class_("jt_column classes");self['@protocolsList']=html._ul()._class_("jt_column protocols");self['@methodsList']=html._ul()._class_("jt_column methods");(function($rec){$rec._updateCategoriesList();$rec._updateClassesList();$rec._updateProtocolsList();return $rec._updateMethodsList();})(self);return html._div()._class_("jt_clear");}));})(html._div());
  8156. return self;},
  8157. 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%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')}),
  8158. smalltalk.Browser);
  8159. smalltalk.addMethod(
  8160. '_renderTabsOn_',
  8161. smalltalk.method({
  8162. selector: 'renderTabsOn:',
  8163. category: 'rendering',
  8164. fn: function (html){
  8165. var self=this;
  8166. self['@tabsList']=html._ul()._class_("jt_tabs");
  8167. self._updateTabsList();
  8168. return self;},
  8169. 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')}),
  8170. smalltalk.Browser);
  8171. smalltalk.addMethod(
  8172. '_renderBottomPanelOn_',
  8173. smalltalk.method({
  8174. selector: 'renderBottomPanelOn:',
  8175. category: 'rendering',
  8176. fn: function (html){
  8177. var self=this;
  8178. (function($rec){$rec._class_("jt_sourceCode");return $rec._with_((function(){self['@sourceTextarea']=(function($rec){$rec._onKeyPress_((function(){return self._enableSaveButton();}));$rec._class_("source");return $rec._at_put_("spellcheck","false");})(html._textarea());return self['@sourceTextarea']._asJQuery()._call_("tabby");}));})(html._div());
  8179. return self;},
  8180. 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')}),
  8181. smalltalk.Browser);
  8182. smalltalk.addMethod(
  8183. '_renderButtonsOn_',
  8184. smalltalk.method({
  8185. selector: 'renderButtonsOn:',
  8186. category: 'rendering',
  8187. fn: function (html){
  8188. var self=this;
  8189. self['@saveButton']=html._button();
  8190. (function($rec){$rec._with_("Save");return $rec._onClick_((function(){return self._compile();}));})(self['@saveButton']);
  8191. self['@methodButtons']=html._span();
  8192. self['@classButtons']=html._span();
  8193. self._updateSourceAndButtons();
  8194. return self;},
  8195. 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')}),
  8196. smalltalk.Browser);
  8197. smalltalk.addMethod(
  8198. '_updateCategoriesList',
  8199. smalltalk.method({
  8200. selector: 'updateCategoriesList',
  8201. category: 'updating',
  8202. fn: function (){
  8203. var self=this;
  8204. self['@categoriesList']._contents_((function(html){return self._categories()._do_((function(each){var li=nil;
  8205. li=html._li();self['@selectedCategory'].__eq(each)._ifTrue_((function(){return li._class_("selected");}));return (function($rec){$rec._with_(each);return $rec._onClick_((function(){return self._selectCategory_(each);}));})(li);}));}));
  8206. return self;},
  8207. source: unescape('updateCategoriesList%0A%20%20%20%20categoriesList%20contents%3A%20%5B%3Ahtml%20%7C%0A%09self%20categories%20do%3A%20%5B%3Aeach%20%7C%7C%20li%20%7C%0A%09%20%20%20%20li%20%3A%3D%20html%20li.%0A%09%20%20%20%20selectedCategory%20%3D%20each%20ifTrue%3A%20%5B%0A%09%09li%20class%3A%20%27selected%27%5D.%0A%09%20%20%20%20li%0A%09%09with%3A%20each%3B%0A%09%09onClick%3A%20%5Bself%20selectCategory%3A%20each%5D%5D%5D%0A')}),
  8208. smalltalk.Browser);
  8209. smalltalk.addMethod(
  8210. '_updateClassesList',
  8211. smalltalk.method({
  8212. selector: 'updateClassesList',
  8213. category: 'updating',
  8214. fn: function (){
  8215. var self=this;
  8216. smalltalk.TabManager._current()._update();
  8217. self['@classesList']._contents_((function(html){return self._classes()._do_((function(each){var li=nil;
  8218. li=html._li();self['@selectedClass'].__eq(each)._ifTrue_((function(){return li._class_("selected");}));return (function($rec){$rec._with_(each._name());return $rec._onClick_((function(){return self._selectClass_(each);}));})(li);}));}));
  8219. return self;},
  8220. 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')}),
  8221. smalltalk.Browser);
  8222. smalltalk.addMethod(
  8223. '_updateProtocolsList',
  8224. smalltalk.method({
  8225. selector: 'updateProtocolsList',
  8226. category: 'updating',
  8227. fn: function (){
  8228. var self=this;
  8229. self['@protocolsList']._contents_((function(html){return self._protocols()._do_((function(each){var li=nil;
  8230. li=html._li();self['@selectedProtocol'].__eq(each)._ifTrue_((function(){return li._class_("selected");}));return (function($rec){$rec._with_(each);return $rec._onClick_((function(){return self._selectProtocol_(each);}));})(li);}));}));
  8231. return self;},
  8232. 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')}),
  8233. smalltalk.Browser);
  8234. smalltalk.addMethod(
  8235. '_updateMethodsList',
  8236. smalltalk.method({
  8237. selector: 'updateMethodsList',
  8238. category: 'updating',
  8239. fn: function (){
  8240. var self=this;
  8241. self['@methodsList']._contents_((function(html){return self._methods()._do_((function(each){var li=nil;
  8242. li=html._li();self['@selectedMethod'].__eq(each)._ifTrue_((function(){return li._class_("selected");}));return (function($rec){$rec._with_(each._selector());return $rec._onClick_((function(){return self._selectMethod_(each);}));})(li);}));}));
  8243. return self;},
  8244. 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')}),
  8245. smalltalk.Browser);
  8246. smalltalk.addMethod(
  8247. '_updateTabsList',
  8248. smalltalk.method({
  8249. selector: 'updateTabsList',
  8250. category: 'updating',
  8251. fn: function (){
  8252. var self=this;
  8253. self['@tabsList']._contents_((function(html){var li=nil;
  8254. li=html._li();self['@selectedTab'].__eq("instance")._ifTrue_((function(){return li._class_("selected");}));(function($rec){$rec._with_("Instance");return $rec._onClick_((function(){return self._selectTab_("instance");}));})(li);li=html._li();self['@selectedTab'].__eq("class")._ifTrue_((function(){return li._class_("selected");}));(function($rec){$rec._with_("Class");return $rec._onClick_((function(){return self._selectTab_("class");}));})(li);li=html._li();self['@selectedTab'].__eq("comment")._ifTrue_((function(){return li._class_("selected");}));return (function($rec){$rec._with_("Comment");return $rec._onClick_((function(){return self._selectTab_("comment");}));})(li);}));
  8255. return self;},
  8256. 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')}),
  8257. smalltalk.Browser);
  8258. smalltalk.addMethod(
  8259. '_updateSourceAndButtons',
  8260. smalltalk.method({
  8261. selector: 'updateSourceAndButtons',
  8262. category: 'updating',
  8263. fn: function (){
  8264. var self=this;
  8265. self._disableSaveButton();
  8266. self['@classButtons']._contents_((function(html){return (function($rec){$rec._with_("Remove class");return $rec._onClick_((function(){return self._removeClass();}));})(html._button());}));
  8267. self['@methodButtons']._contents_((function(html){(function($rec){$rec._with_("Remove method");return $rec._onClick_((function(){return self._removeMethod();}));})(html._button());return html._select()._with_((function(){(function($rec){$rec._with_("Method protocol");return $rec._at_put_("disabled","disabled");})(html._option());(function($rec){$rec._class_("important");$rec._with_("New...");return $rec._onClick_((function(){return self._addNewProtocol();}));})(html._option());return self._protocols()._do_((function(each){return (function($rec){$rec._with_(each);return $rec._onClick_((function(){return self._setMethodProtocol_(each);}));})(html._option());}));}));}));
  8268. self['@selectedMethod']._ifNil_ifNotNil_((function(){self._hideMethodButtons();return self['@selectedClass']._ifNil_ifNotNil_((function(){return self._hideClassButtons();}),(function(){return self._showClassButtons();}));}),(function(){self._hideClassButtons();return self._showMethodButtons();}));
  8269. self['@sourceTextarea']._asJQuery()._val_(self._source());
  8270. return self;},
  8271. source: unescape('updateSourceAndButtons%0A%20%20%20%20self%20disableSaveButton.%0A%20%20%20%20classButtons%20contents%3A%20%5B%3Ahtml%20%7C%0A%09html%20button%0A%09%20%20%20%20with%3A%20%27Remove%20class%27%3B%0A%09%20%20%20%20onClick%3A%20%5Bself%20removeClass%5D%5D.%0A%20%20%20%20methodButtons%20contents%3A%20%5B%3Ahtml%20%7C%0A%09html%20button%0A%09%20%20%20%20with%3A%20%27Remove%20method%27%3B%0A%09%20%20%20%20onClick%3A%20%5Bself%20removeMethod%5D.%0A%09html%20select%20with%3A%20%5B%0A%09%20%20%20%20html%20option%0A%09%09with%3A%20%27Method%20protocol%27%3B%0A%09%09at%3A%20%27disabled%27%20put%3A%20%27disabled%27.%0A%09%20%20%20%20html%20option%0A%09%09class%3A%20%27important%27%3B%0A%09%09with%3A%20%27New...%27%3B%0A%09%09onClick%3A%20%5Bself%20addNewProtocol%5D.%0A%09%20%20%20%20self%20protocols%20do%3A%20%5B%3Aeach%20%7C%0A%09%09html%20option%0A%09%09%20%20%20%20with%3A%20each%3B%0A%09%09%20%20%20%20onClick%3A%20%5Bself%20setMethodProtocol%3A%20each%5D%5D%5D%5D.%0A%20%20%20%20selectedMethod%20%0A%09ifNil%3A%20%5B%0A%09%20%20%20%20self%20hideMethodButtons.%0A%09%20%20%20%20selectedClass%20%0A%09%09ifNil%3A%20%5Bself%20hideClassButtons%5D%0A%09%20%20%20%20ifNotNil%3A%20%5Bself%20showClassButtons%5D%5D%0A%09ifNotNil%3A%20%5B%0A%09%20%20%20%20self%20hideClassButtons.%0A%09%20%20%20%20self%20showMethodButtons%5D.%0A%20%20%20%20sourceTextarea%20asJQuery%20val%3A%20self%20source%0A')}),
  8272. smalltalk.Browser);
  8273. smalltalk.addMethod(
  8274. '_canBeClosed',
  8275. smalltalk.method({
  8276. selector: 'canBeClosed',
  8277. category: 'testing',
  8278. fn: function (){
  8279. var self=this;
  8280. return true;
  8281. return self;},
  8282. source: unescape('canBeClosed%0A%20%20%20%20%5Etrue%0A')}),
  8283. smalltalk.Browser);
  8284. smalltalk.addMethod(
  8285. '_openOn_',
  8286. smalltalk.method({
  8287. selector: 'openOn:',
  8288. category: 'convenience',
  8289. fn: function (aClass){
  8290. var self=this;
  8291. (function($rec){$rec._open();$rec._selectCategory_(aClass._category());return $rec._selectClass_(aClass);})(self._new());
  8292. return self;},
  8293. 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')}),
  8294. smalltalk.Browser.klass);
  8295. smalltalk.addMethod(
  8296. '_open',
  8297. smalltalk.method({
  8298. selector: 'open',
  8299. category: 'convenience',
  8300. fn: function (){
  8301. var self=this;
  8302. self._new()._open();
  8303. return self;},
  8304. source: unescape('open%0A%20%20%20%20self%20new%20open%0A')}),
  8305. smalltalk.Browser.klass);
  8306. smalltalk.init(smalltalk.Object);