jtalk.js 338 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286
  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('PPParser', smalltalk.Object, ['memo'], 'Parser');
  3690. smalltalk.addMethod(
  3691. '_initialize',
  3692. smalltalk.method({
  3693. selector: 'initialize',
  3694. category: 'initialization',
  3695. fn: function (){
  3696. var self=this;
  3697. self['@memo']=smalltalk.Dictionary._new();
  3698. return self;},
  3699. source: unescape('initialize%0A%09memo%20%3A%3D%20Dictionary%20new%0A')}),
  3700. smalltalk.PPParser);
  3701. smalltalk.addMethod(
  3702. '_memo',
  3703. smalltalk.method({
  3704. selector: 'memo',
  3705. category: 'accessing',
  3706. fn: function (){
  3707. var self=this;
  3708. return self['@memo'];
  3709. return self;},
  3710. source: unescape('memo%0A%09%5Ememo%0A')}),
  3711. smalltalk.PPParser);
  3712. smalltalk.addMethod(
  3713. '_onFailure_',
  3714. smalltalk.method({
  3715. selector: 'onFailure:',
  3716. category: 'error handling',
  3717. fn: function (aBlock){
  3718. var self=this;
  3719. return smalltalk.PPFailureActionParser._on_block_(self,aBlock);
  3720. return self;},
  3721. source: unescape('onFailure%3A%20aBlock%0A%09%5EPPFailureActionParser%20on%3A%20self%20block%3A%20aBlock%0A')}),
  3722. smalltalk.PPParser);
  3723. smalltalk.addMethod(
  3724. '_flatten',
  3725. smalltalk.method({
  3726. selector: 'flatten',
  3727. category: 'operations',
  3728. fn: function (){
  3729. var self=this;
  3730. return smalltalk.PPFlattenParser._on_(self);
  3731. return self;},
  3732. source: unescape('flatten%0A%09%5EPPFlattenParser%20on%3A%20self%0A')}),
  3733. smalltalk.PPParser);
  3734. smalltalk.addMethod(
  3735. '_withSource',
  3736. smalltalk.method({
  3737. selector: 'withSource',
  3738. category: 'operations',
  3739. fn: function (){
  3740. var self=this;
  3741. return smalltalk.PPSourceParser._on_(self);
  3742. return self;},
  3743. source: unescape('withSource%0A%09%5EPPSourceParser%20on%3A%20self%0A')}),
  3744. smalltalk.PPParser);
  3745. smalltalk.addMethod(
  3746. '__eq_eq_gt',
  3747. smalltalk.method({
  3748. selector: '==>',
  3749. category: 'operations',
  3750. fn: function (aBlock){
  3751. var self=this;
  3752. return smalltalk.PPActionParser._on_block_(self,aBlock);
  3753. return self;},
  3754. source: unescape('%3D%3D%3E%20aBlock%0A%09%5EPPActionParser%20on%3A%20self%20block%3A%20aBlock%0A')}),
  3755. smalltalk.PPParser);
  3756. smalltalk.addMethod(
  3757. '__comma',
  3758. smalltalk.method({
  3759. selector: ',',
  3760. category: 'operations',
  3761. fn: function (aParser){
  3762. var self=this;
  3763. return smalltalk.PPSequenceParser._with_with_(self,aParser);
  3764. return self;},
  3765. source: unescape('%2C%20aParser%0A%09%5EPPSequenceParser%20with%3A%20self%20with%3A%20aParser%0A')}),
  3766. smalltalk.PPParser);
  3767. smalltalk.addMethod(
  3768. '__slash',
  3769. smalltalk.method({
  3770. selector: '/',
  3771. category: 'operations',
  3772. fn: function (aParser){
  3773. var self=this;
  3774. return smalltalk.PPChoiceParser._with_with_(self,aParser);
  3775. return self;},
  3776. source: unescape('/%20aParser%0A%09%5EPPChoiceParser%20with%3A%20self%20with%3A%20aParser%0A')}),
  3777. smalltalk.PPParser);
  3778. smalltalk.addMethod(
  3779. '_plus',
  3780. smalltalk.method({
  3781. selector: 'plus',
  3782. category: 'operations',
  3783. fn: function (){
  3784. var self=this;
  3785. return smalltalk.PPRepeatingParser._on_min_(self,(1));
  3786. return self;},
  3787. source: unescape('plus%0A%09%5EPPRepeatingParser%20on%3A%20self%20min%3A%201%0A')}),
  3788. smalltalk.PPParser);
  3789. smalltalk.addMethod(
  3790. '_star',
  3791. smalltalk.method({
  3792. selector: 'star',
  3793. category: 'operations',
  3794. fn: function (){
  3795. var self=this;
  3796. return smalltalk.PPRepeatingParser._on_min_(self,(0));
  3797. return self;},
  3798. source: unescape('star%0A%09%5EPPRepeatingParser%20on%3A%20self%20min%3A%200%0A')}),
  3799. smalltalk.PPParser);
  3800. smalltalk.addMethod(
  3801. '_not',
  3802. smalltalk.method({
  3803. selector: 'not',
  3804. category: 'operations',
  3805. fn: function (){
  3806. var self=this;
  3807. return smalltalk.PPNotParser._on_(self);
  3808. return self;},
  3809. source: unescape('not%0A%09%5EPPNotParser%20on%3A%20self%0A')}),
  3810. smalltalk.PPParser);
  3811. smalltalk.addMethod(
  3812. '_optional',
  3813. smalltalk.method({
  3814. selector: 'optional',
  3815. category: 'operations',
  3816. fn: function (){
  3817. var self=this;
  3818. return self.__slash(smalltalk.PPEpsilonParser._new());
  3819. return self;},
  3820. source: unescape('optional%0A%09%5Eself%20/%20PPEpsilonParser%20new%0A')}),
  3821. smalltalk.PPParser);
  3822. smalltalk.addMethod(
  3823. '_memoizedParse_',
  3824. smalltalk.method({
  3825. selector: 'memoizedParse:',
  3826. category: 'operations',
  3827. fn: function (aStream){
  3828. var self=this;
  3829. var start=nil;
  3830. var end=nil;
  3831. var node=nil;
  3832. start=aStream._position();
  3833. 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;}));
  3834. return self;},
  3835. 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')}),
  3836. smalltalk.PPParser);
  3837. smalltalk.addMethod(
  3838. '_parse_',
  3839. smalltalk.method({
  3840. selector: 'parse:',
  3841. category: 'parsing',
  3842. fn: function (aStream){
  3843. var self=this;
  3844. self._subclassResponsibility();
  3845. return self;},
  3846. source: unescape('parse%3A%20aStream%0A%09self%20subclassResponsibility%0A')}),
  3847. smalltalk.PPParser);
  3848. smalltalk.addMethod(
  3849. '_parseAll_',
  3850. smalltalk.method({
  3851. selector: 'parseAll:',
  3852. category: 'parsing',
  3853. fn: function (aStream){
  3854. var self=this;
  3855. var result=nil;
  3856. result=smalltalk.PPSequenceParser._with_with_(self,smalltalk.PPEOFParser._new())._memoizedParse_(aStream);
  3857. return result._isParseFailure()._ifTrue_ifFalse_((function(){return self._error_(result._messageFor_(aStream._contents()));}),(function(){return result._first();}));
  3858. return self;},
  3859. 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')}),
  3860. smalltalk.PPParser);
  3861. smalltalk.addClass('PPEOFParser', smalltalk.PPParser, [], 'Parser');
  3862. smalltalk.addMethod(
  3863. '_parse_',
  3864. smalltalk.method({
  3865. selector: 'parse:',
  3866. category: 'parsing',
  3867. fn: function (aStream){
  3868. var self=this;
  3869. return aStream._atEnd()._ifFalse_ifTrue_((function(){return smalltalk.PPFailure._new()._reason_at_("EOF expected",aStream._position());}),(function(){return nil;}));
  3870. return self;},
  3871. 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')}),
  3872. smalltalk.PPEOFParser);
  3873. smalltalk.addClass('PPAnyParser', smalltalk.PPParser, [], 'Parser');
  3874. smalltalk.addMethod(
  3875. '_parse_',
  3876. smalltalk.method({
  3877. selector: 'parse:',
  3878. category: 'parsing',
  3879. fn: function (aStream){
  3880. var self=this;
  3881. return aStream._atEnd()._ifTrue_ifFalse_((function(){return smalltalk.PPFailure._new()._reason_at_("did not expect EOF",aStream._position());}),(function(){return aStream._next();}));
  3882. return self;},
  3883. 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')}),
  3884. smalltalk.PPAnyParser);
  3885. smalltalk.addClass('PPEpsilonParser', smalltalk.PPParser, [], 'Parser');
  3886. smalltalk.addMethod(
  3887. '_parse_',
  3888. smalltalk.method({
  3889. selector: 'parse:',
  3890. category: 'parsing',
  3891. fn: function (aStream){
  3892. var self=this;
  3893. return nil;
  3894. return self;},
  3895. source: unescape('parse%3A%20aStream%0A%09%5Enil%0A')}),
  3896. smalltalk.PPEpsilonParser);
  3897. smalltalk.addClass('PPStringParser', smalltalk.PPParser, ['string'], 'Parser');
  3898. smalltalk.addMethod(
  3899. '_string',
  3900. smalltalk.method({
  3901. selector: 'string',
  3902. category: 'accessing',
  3903. fn: function (){
  3904. var self=this;
  3905. return self['@string'];
  3906. return self;},
  3907. source: unescape('string%0A%09%5Estring%0A')}),
  3908. smalltalk.PPStringParser);
  3909. smalltalk.addMethod(
  3910. '_string_',
  3911. smalltalk.method({
  3912. selector: 'string:',
  3913. category: 'accessing',
  3914. fn: function (aString){
  3915. var self=this;
  3916. self['@string']=aString;
  3917. return self;},
  3918. source: unescape('string%3A%20aString%0A%09string%20%3A%3D%20aString%0A')}),
  3919. smalltalk.PPStringParser);
  3920. smalltalk.addMethod(
  3921. '_parse_',
  3922. smalltalk.method({
  3923. selector: 'parse:',
  3924. category: 'parsing',
  3925. fn: function (aStream){
  3926. var self=this;
  3927. var position=nil;
  3928. var result=nil;
  3929. position=aStream._position();
  3930. result=aStream._next_(self._string()._size());
  3931. 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());}));
  3932. return self;},
  3933. 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')}),
  3934. smalltalk.PPStringParser);
  3935. smalltalk.addClass('PPCharacterParser', smalltalk.PPParser, ['regexp'], 'Parser');
  3936. smalltalk.addMethod(
  3937. '_string_',
  3938. smalltalk.method({
  3939. selector: 'string:',
  3940. category: 'accessing',
  3941. fn: function (aString){
  3942. var self=this;
  3943. self['@regexp']=smalltalk.RegularExpression._fromString_(unescape("%5B").__comma(aString).__comma(unescape("%5D")));
  3944. return self;},
  3945. 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')}),
  3946. smalltalk.PPCharacterParser);
  3947. smalltalk.addMethod(
  3948. '_parse_',
  3949. smalltalk.method({
  3950. selector: 'parse:',
  3951. category: 'parsing',
  3952. fn: function (aStream){
  3953. var self=this;
  3954. 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());}));
  3955. return self;},
  3956. 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')}),
  3957. smalltalk.PPCharacterParser);
  3958. smalltalk.addMethod(
  3959. '_match_',
  3960. smalltalk.method({
  3961. selector: 'match:',
  3962. category: 'private',
  3963. fn: function (aString){
  3964. var self=this;
  3965. return aString._match_(self['@regexp']);
  3966. return self;},
  3967. source: unescape('match%3A%20aString%0A%09%5EaString%20match%3A%20regexp%0A')}),
  3968. smalltalk.PPCharacterParser);
  3969. smalltalk.addClass('PPListParser', smalltalk.PPParser, ['parsers'], 'Parser');
  3970. smalltalk.addMethod(
  3971. '_parsers',
  3972. smalltalk.method({
  3973. selector: 'parsers',
  3974. category: 'accessing',
  3975. fn: function (){
  3976. var self=this;
  3977. return self['@parsers']._ifNil_((function(){return [];}));
  3978. return self;},
  3979. source: unescape('parsers%0A%09%5Eparsers%20ifNil%3A%20%5B%23%28%29%5D%0A')}),
  3980. smalltalk.PPListParser);
  3981. smalltalk.addMethod(
  3982. '_parsers_',
  3983. smalltalk.method({
  3984. selector: 'parsers:',
  3985. category: 'accessing',
  3986. fn: function (aCollection){
  3987. var self=this;
  3988. self['@parsers']=aCollection;
  3989. return self;},
  3990. source: unescape('parsers%3A%20aCollection%0A%09parsers%20%3A%3D%20aCollection%0A')}),
  3991. smalltalk.PPListParser);
  3992. smalltalk.addMethod(
  3993. '_copyWith_',
  3994. smalltalk.method({
  3995. selector: 'copyWith:',
  3996. category: 'copying',
  3997. fn: function (aParser){
  3998. var self=this;
  3999. return self._class()._withAll_(self._parsers()._copyWith_(aParser));
  4000. return self;},
  4001. source: unescape('copyWith%3A%20aParser%0A%09%5Eself%20class%20withAll%3A%20%28self%20parsers%20copyWith%3A%20aParser%29%0A')}),
  4002. smalltalk.PPListParser);
  4003. smalltalk.addMethod(
  4004. '_withAll_',
  4005. smalltalk.method({
  4006. selector: 'withAll:',
  4007. category: 'instance creation',
  4008. fn: function (aCollection){
  4009. var self=this;
  4010. return (function($rec){$rec._parsers_(aCollection);return $rec._yourself();})(self._new());
  4011. return self;},
  4012. source: unescape('withAll%3A%20aCollection%0A%09%20%20%20%20%5Eself%20new%0A%09%09parsers%3A%20aCollection%3B%0A%09%09yourself%0A')}),
  4013. smalltalk.PPListParser.klass);
  4014. smalltalk.addMethod(
  4015. '_with_with_',
  4016. smalltalk.method({
  4017. selector: 'with:with:',
  4018. category: 'instance creation',
  4019. fn: function (aParser, anotherParser){
  4020. var self=this;
  4021. return self._withAll_(smalltalk.Array._with_with_(aParser,anotherParser));
  4022. return self;},
  4023. 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')}),
  4024. smalltalk.PPListParser.klass);
  4025. smalltalk.addClass('PPSequenceParser', smalltalk.PPListParser, [], 'Parser');
  4026. smalltalk.addMethod(
  4027. '__comma',
  4028. smalltalk.method({
  4029. selector: ',',
  4030. category: 'copying',
  4031. fn: function (aRule){
  4032. var self=this;
  4033. return self._copyWith_(aRule);
  4034. return self;},
  4035. source: unescape('%2C%20aRule%0A%09%5Eself%20copyWith%3A%20aRule%0A')}),
  4036. smalltalk.PPSequenceParser);
  4037. smalltalk.addMethod(
  4038. '_parse_',
  4039. smalltalk.method({
  4040. selector: 'parse:',
  4041. category: 'parsing',
  4042. fn: function (aStream){
  4043. var self=this;
  4044. var start=nil;
  4045. var elements=nil;
  4046. var element=nil;
  4047. start=aStream._position();
  4048. elements=[];
  4049. self._parsers()._detect_ifNone_((function(each){element=each._memoizedParse_(aStream);elements._add_(element);return element._isParseFailure();}),(function(){return nil;}));
  4050. return element._isParseFailure()._ifFalse_ifTrue_((function(){return elements;}),(function(){aStream._position_(start);return element;}));
  4051. return self;},
  4052. 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')}),
  4053. smalltalk.PPSequenceParser);
  4054. smalltalk.addClass('PPChoiceParser', smalltalk.PPListParser, [], 'Parser');
  4055. smalltalk.addMethod(
  4056. '__slash',
  4057. smalltalk.method({
  4058. selector: '/',
  4059. category: 'copying',
  4060. fn: function (aRule){
  4061. var self=this;
  4062. return self._copyWith_(aRule);
  4063. return self;},
  4064. source: unescape('/%20aRule%0A%09%5Eself%20copyWith%3A%20aRule%0A')}),
  4065. smalltalk.PPChoiceParser);
  4066. smalltalk.addMethod(
  4067. '_parse_',
  4068. smalltalk.method({
  4069. selector: 'parse:',
  4070. category: 'parsing',
  4071. fn: function (aStream){
  4072. var self=this;
  4073. var result=nil;
  4074. self._parsers()._detect_ifNone_((function(each){result=each._memoizedParse_(aStream);return result._isParseFailure()._not();}),(function(){return nil;}));
  4075. return result;
  4076. return self;},
  4077. 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')}),
  4078. smalltalk.PPChoiceParser);
  4079. smalltalk.addClass('PPDelegateParser', smalltalk.PPParser, ['parser'], 'Parser');
  4080. smalltalk.addMethod(
  4081. '_parser',
  4082. smalltalk.method({
  4083. selector: 'parser',
  4084. category: 'accessing',
  4085. fn: function (){
  4086. var self=this;
  4087. return self['@parser'];
  4088. return self;},
  4089. source: unescape('parser%0A%09%5Eparser%0A')}),
  4090. smalltalk.PPDelegateParser);
  4091. smalltalk.addMethod(
  4092. '_parser_',
  4093. smalltalk.method({
  4094. selector: 'parser:',
  4095. category: 'accessing',
  4096. fn: function (aParser){
  4097. var self=this;
  4098. self['@parser']=aParser;
  4099. return self;},
  4100. source: unescape('parser%3A%20aParser%0A%09parser%20%3A%3D%20aParser%0A')}),
  4101. smalltalk.PPDelegateParser);
  4102. smalltalk.addMethod(
  4103. '_parse_',
  4104. smalltalk.method({
  4105. selector: 'parse:',
  4106. category: 'parsing',
  4107. fn: function (aStream){
  4108. var self=this;
  4109. return self._parser()._memoizedParse_(aStream);
  4110. return self;},
  4111. source: unescape('parse%3A%20aStream%0A%09%5Eself%20parser%20memoizedParse%3A%20aStream%0A')}),
  4112. smalltalk.PPDelegateParser);
  4113. smalltalk.addMethod(
  4114. '_on_',
  4115. smalltalk.method({
  4116. selector: 'on:',
  4117. category: 'instance creation',
  4118. fn: function (aParser){
  4119. var self=this;
  4120. return (function($rec){$rec._parser_(aParser);return $rec._yourself();})(self._new());
  4121. return self;},
  4122. source: unescape('on%3A%20aParser%0A%09%20%20%20%20%5Eself%20new%0A%09%09parser%3A%20aParser%3B%0A%09%09yourself%0A')}),
  4123. smalltalk.PPDelegateParser.klass);
  4124. smalltalk.addClass('PPAndParser', smalltalk.PPDelegateParser, [], 'Parser');
  4125. smalltalk.addMethod(
  4126. '_parse_',
  4127. smalltalk.method({
  4128. selector: 'parse:',
  4129. category: 'parsing',
  4130. fn: function (aStream){
  4131. var self=this;
  4132. return self._basicParse_(aStream);
  4133. return self;},
  4134. source: unescape('parse%3A%20aStream%0A%09%5Eself%20basicParse%3A%20aStream%0A')}),
  4135. smalltalk.PPAndParser);
  4136. smalltalk.addMethod(
  4137. '_basicParse_',
  4138. smalltalk.method({
  4139. selector: 'basicParse:',
  4140. category: 'parsing',
  4141. fn: function (aStream){
  4142. var self=this;
  4143. var element=nil;
  4144. var position=nil;
  4145. position=aStream._position();
  4146. element=self._parser()._memoizedParse_(aStream);
  4147. aStream._position_(position);
  4148. return element;
  4149. return self;},
  4150. 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')}),
  4151. smalltalk.PPAndParser);
  4152. smalltalk.addClass('PPNotParser', smalltalk.PPAndParser, [], 'Parser');
  4153. smalltalk.addMethod(
  4154. '_parse_',
  4155. smalltalk.method({
  4156. selector: 'parse:',
  4157. category: 'parsing',
  4158. fn: function (aStream){
  4159. var self=this;
  4160. var element=nil;
  4161. element=self._basicParse_(aStream);
  4162. return element._isParseFailure()._ifTrue_ifFalse_((function(){return nil;}),(function(){return smalltalk.PPFailure._reason_at_(element,aStream._position());}));
  4163. return self;},
  4164. 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')}),
  4165. smalltalk.PPNotParser);
  4166. smalltalk.addClass('PPActionParser', smalltalk.PPDelegateParser, ['block'], 'Parser');
  4167. smalltalk.addMethod(
  4168. '_block',
  4169. smalltalk.method({
  4170. selector: 'block',
  4171. category: 'accessing',
  4172. fn: function (){
  4173. var self=this;
  4174. return self['@block'];
  4175. return self;},
  4176. source: unescape('block%0A%09%5Eblock%0A')}),
  4177. smalltalk.PPActionParser);
  4178. smalltalk.addMethod(
  4179. '_block_',
  4180. smalltalk.method({
  4181. selector: 'block:',
  4182. category: 'accessing',
  4183. fn: function (aBlock){
  4184. var self=this;
  4185. self['@block']=aBlock;
  4186. return self;},
  4187. source: unescape('block%3A%20aBlock%0A%09block%20%3A%3D%20aBlock%0A')}),
  4188. smalltalk.PPActionParser);
  4189. smalltalk.addMethod(
  4190. '_parse_',
  4191. smalltalk.method({
  4192. selector: 'parse:',
  4193. category: 'parsing',
  4194. fn: function (aStream){
  4195. var self=this;
  4196. var element=nil;
  4197. element=self._parser()._memoizedParse_(aStream);
  4198. return element._isParseFailure()._ifFalse_ifTrue_((function(){return self._block()._value_(element);}),(function(){return element;}));
  4199. return self;},
  4200. 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')}),
  4201. smalltalk.PPActionParser);
  4202. smalltalk.addMethod(
  4203. '_on_block_',
  4204. smalltalk.method({
  4205. selector: 'on:block:',
  4206. category: 'instance creation',
  4207. fn: function (aParser, aBlock){
  4208. var self=this;
  4209. return (function($rec){$rec._parser_(aParser);$rec._block_(aBlock);return $rec._yourself();})(self._new());
  4210. return self;},
  4211. 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')}),
  4212. smalltalk.PPActionParser.klass);
  4213. smalltalk.addClass('PPFlattenParser', smalltalk.PPDelegateParser, [], 'Parser');
  4214. smalltalk.addMethod(
  4215. '_parse_',
  4216. smalltalk.method({
  4217. selector: 'parse:',
  4218. category: 'parsing',
  4219. fn: function (aStream){
  4220. var self=this;
  4221. var start=nil;
  4222. var element=nil;
  4223. var stop=nil;
  4224. start=aStream._position();
  4225. element=self._parser()._memoizedParse_(aStream);
  4226. return element._isParseFailure()._ifTrue_ifFalse_((function(){return element;}),(function(){return aStream._collection()._copyFrom_to_(start.__plus((1)),aStream._position());}));
  4227. return self;},
  4228. 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')}),
  4229. smalltalk.PPFlattenParser);
  4230. smalltalk.addClass('PPSourceParser', smalltalk.PPDelegateParser, [], 'Parser');
  4231. smalltalk.addMethod(
  4232. '_parse_',
  4233. smalltalk.method({
  4234. selector: 'parse:',
  4235. category: 'parsing',
  4236. fn: function (aStream){
  4237. var self=this;
  4238. var start=nil;
  4239. var element=nil;
  4240. var stop=nil;
  4241. var result=nil;
  4242. start=aStream._position();
  4243. element=self._parser()._memoizedParse_(aStream);
  4244. 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);}));
  4245. return self;},
  4246. 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')}),
  4247. smalltalk.PPSourceParser);
  4248. smalltalk.addClass('PPRepeatingParser', smalltalk.PPDelegateParser, ['min'], 'Parser');
  4249. smalltalk.addMethod(
  4250. '_min',
  4251. smalltalk.method({
  4252. selector: 'min',
  4253. category: 'accessing',
  4254. fn: function (){
  4255. var self=this;
  4256. return self['@min'];
  4257. return self;},
  4258. source: unescape('min%0A%09%5Emin%0A')}),
  4259. smalltalk.PPRepeatingParser);
  4260. smalltalk.addMethod(
  4261. '_min_',
  4262. smalltalk.method({
  4263. selector: 'min:',
  4264. category: 'accessing',
  4265. fn: function (aNumber){
  4266. var self=this;
  4267. self['@min']=aNumber;
  4268. return self;},
  4269. source: unescape('min%3A%20aNumber%0A%09min%20%3A%3D%20aNumber%0A')}),
  4270. smalltalk.PPRepeatingParser);
  4271. smalltalk.addMethod(
  4272. '_parse_',
  4273. smalltalk.method({
  4274. selector: 'parse:',
  4275. category: 'parsing',
  4276. fn: function (aStream){
  4277. var self=this;
  4278. var start=nil;
  4279. var element=nil;
  4280. var elements=nil;
  4281. var failure=nil;
  4282. start=aStream._position();
  4283. elements=smalltalk.Array._new();
  4284. (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;}));}));
  4285. 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;}));
  4286. return self;},
  4287. 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')}),
  4288. smalltalk.PPRepeatingParser);
  4289. smalltalk.addMethod(
  4290. '_on_min_',
  4291. smalltalk.method({
  4292. selector: 'on:min:',
  4293. category: 'instance creation',
  4294. fn: function (aParser, aNumber){
  4295. var self=this;
  4296. return (function($rec){$rec._parser_(aParser);$rec._min_(aNumber);return $rec._yourself();})(self._new());
  4297. return self;},
  4298. 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')}),
  4299. smalltalk.PPRepeatingParser.klass);
  4300. smalltalk.addClass('PPFailure', smalltalk.Object, ['position', 'reason'], 'Parser');
  4301. smalltalk.addMethod(
  4302. '_position',
  4303. smalltalk.method({
  4304. selector: 'position',
  4305. category: 'accessing',
  4306. fn: function (){
  4307. var self=this;
  4308. return self['@position']._ifNil_((function(){return (0);}));
  4309. return self;},
  4310. source: unescape('position%0A%09%5Eposition%20ifNil%3A%20%5B0%5D%0A')}),
  4311. smalltalk.PPFailure);
  4312. smalltalk.addMethod(
  4313. '_position_',
  4314. smalltalk.method({
  4315. selector: 'position:',
  4316. category: 'accessing',
  4317. fn: function (aNumber){
  4318. var self=this;
  4319. self['@position']=aNumber;
  4320. return self;},
  4321. source: unescape('position%3A%20aNumber%0A%09position%20%3A%3D%20aNumber%0A')}),
  4322. smalltalk.PPFailure);
  4323. smalltalk.addMethod(
  4324. '_reason',
  4325. smalltalk.method({
  4326. selector: 'reason',
  4327. category: 'accessing',
  4328. fn: function (){
  4329. var self=this;
  4330. return self['@reason']._ifNil_((function(){return "";}));
  4331. return self;},
  4332. source: unescape('reason%0A%09%5Ereason%20ifNil%3A%20%5B%27%27%5D%0A')}),
  4333. smalltalk.PPFailure);
  4334. smalltalk.addMethod(
  4335. '_reason_',
  4336. smalltalk.method({
  4337. selector: 'reason:',
  4338. category: 'accessing',
  4339. fn: function (aString){
  4340. var self=this;
  4341. self['@reason']=aString;
  4342. return self;},
  4343. source: unescape('reason%3A%20aString%0A%09reason%20%3A%3D%20aString%0A')}),
  4344. smalltalk.PPFailure);
  4345. smalltalk.addMethod(
  4346. '_reason_at_',
  4347. smalltalk.method({
  4348. selector: 'reason:at:',
  4349. category: 'accessing',
  4350. fn: function (aString, anInteger){
  4351. var self=this;
  4352. (function($rec){$rec._reason_(aString);return $rec._position_(anInteger);})(self);
  4353. return self;},
  4354. 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')}),
  4355. smalltalk.PPFailure);
  4356. smalltalk.addMethod(
  4357. '_isParseFailure',
  4358. smalltalk.method({
  4359. selector: 'isParseFailure',
  4360. category: 'testing',
  4361. fn: function (){
  4362. var self=this;
  4363. return true;
  4364. return self;},
  4365. source: unescape('isParseFailure%0A%09%5Etrue%0A')}),
  4366. smalltalk.PPFailure);
  4367. smalltalk.addMethod(
  4368. '_reason_at_',
  4369. smalltalk.method({
  4370. selector: 'reason:at:',
  4371. category: 'instance creation',
  4372. fn: function (aString, anInteger){
  4373. var self=this;
  4374. return (function($rec){$rec._reason_at_(aString,anInteger);return $rec._yourself();})(self._new());
  4375. return self;},
  4376. 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')}),
  4377. smalltalk.PPFailure.klass);
  4378. smalltalk.addClass('SmalltalkParser', smalltalk.Object, [], 'Parser');
  4379. smalltalk.addMethod(
  4380. '_parse_',
  4381. smalltalk.method({
  4382. selector: 'parse:',
  4383. category: 'parsing',
  4384. fn: function (aStream){
  4385. var self=this;
  4386. return self._parser()._parse_(aStream);
  4387. return self;},
  4388. source: unescape('parse%3A%20aStream%0A%09%5Eself%20parser%20parse%3A%20aStream%0A')}),
  4389. smalltalk.SmalltalkParser);
  4390. smalltalk.addMethod(
  4391. '_parser',
  4392. smalltalk.method({
  4393. selector: 'parser',
  4394. category: 'grammar',
  4395. fn: function (){
  4396. var self=this;
  4397. var method=nil;
  4398. var expression=nil;
  4399. var separator=nil;
  4400. var comment=nil;
  4401. var ws=nil;
  4402. var identifier=nil;
  4403. var keyword=nil;
  4404. var className=nil;
  4405. var string=nil;
  4406. var symbol=nil;
  4407. var number=nil;
  4408. var literalArray=nil;
  4409. var variable=nil;
  4410. var reference=nil;
  4411. var classReference=nil;
  4412. var literal=nil;
  4413. var ret=nil;
  4414. var methodParser=nil;
  4415. var expressionParser=nil;
  4416. var keyword=nil;
  4417. var unarySelector=nil;
  4418. var binarySelector=nil;
  4419. var keywordPattern=nil;
  4420. var unaryPattern=nil;
  4421. var binaryPattern=nil;
  4422. var assignment=nil;
  4423. var temps=nil;
  4424. var blockParamList=nil;
  4425. var block=nil;
  4426. var expression=nil;
  4427. var expressions=nil;
  4428. var subexpression=nil;
  4429. var statements=nil;
  4430. var sequence=nil;
  4431. var operand=nil;
  4432. var unaryMessage=nil;
  4433. var unarySend=nil;
  4434. var unaryTail=nil;
  4435. var binaryMessage=nil;
  4436. var binarySend=nil;
  4437. var binaryTail=nil;
  4438. var keywordMessage=nil;
  4439. var keywordSend=nil;
  4440. var keywordPair=nil;
  4441. var cascade=nil;
  4442. var message=nil;
  4443. var jsStatement=nil;
  4444. separator=smalltalk.String._cr().__comma(smalltalk.String._space()).__comma(smalltalk.String._lf()).__comma(smalltalk.String._tab())._asChoiceParser();
  4445. comment=unescape("%22")._asCharacterParser().__comma(unescape("%22")._asParser()._not().__comma(smalltalk.PPAnyParser._new())._star()).__comma(unescape("%22")._asCharacterParser())._flatten();
  4446. ws=separator.__slash(comment)._star();
  4447. identifier=unescape("a-z")._asCharacterParser().__comma(unescape("a-zA-Z0-9")._asCharacterParser()._star())._flatten();
  4448. keyword=identifier.__comma(":"._asParser())._flatten();
  4449. className=unescape("A-Z")._asCharacterParser().__comma(unescape("a-zA-Z0-9")._asCharacterParser()._star())._flatten();
  4450. 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")));}));
  4451. 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());}));
  4452. 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());}));
  4453. literal=smalltalk.PPDelegateParser._new();
  4454. 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();}))));}));
  4455. variable=identifier.__eq_eq_gt((function(token){return smalltalk.VariableNode._new()._value_(token);}));
  4456. classReference=className.__eq_eq_gt((function(token){return smalltalk.ClassReferenceNode._new()._value_(token);}));
  4457. reference=variable.__slash(classReference);
  4458. binarySelector=unescape("+*/%3D%3E%3C%2C@%25%7E-")._asCharacterParser()._plus()._flatten();
  4459. unarySelector=identifier;
  4460. 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));})));}));
  4461. 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()));}));
  4462. unaryPattern=ws.__comma(unarySelector).__eq_eq_gt((function(node){return smalltalk.Array._with_with_(node._second(),smalltalk.Array._new());}));
  4463. expression=smalltalk.PPDelegateParser._new();
  4464. 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;
  4465. result=smalltalk.Array._with_(node._first());node._second()._do_((function(each){return result._add_(each);}));return result;}));
  4466. 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());}));
  4467. 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());}));
  4468. 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();}));}));
  4469. 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();}));}));
  4470. subexpression=unescape("%28")._asParser().__comma(ws).__comma(expression).__comma(ws).__comma(unescape("%29")._asParser()).__eq_eq_gt((function(node){return node._third();}));
  4471. 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();})));
  4472. 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());}));
  4473. 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());}));
  4474. operand=literal.__slash(reference).__slash(subexpression);
  4475. literal._parser_(number.__slash(string).__slash(literalArray).__slash(symbol).__slash(block));
  4476. unaryMessage=ws.__comma(unarySelector).__comma(":"._asParser()._not()).__eq_eq_gt((function(node){return smalltalk.SendNode._new()._selector_(node._second());}));
  4477. unaryTail=smalltalk.PPDelegateParser._new();
  4478. 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());}));})));
  4479. 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());}));}));
  4480. 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());}));
  4481. binaryTail=smalltalk.PPDelegateParser._new();
  4482. 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());}));})));
  4483. 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());}));}));
  4484. keywordPair=keyword.__comma(ws).__comma(binarySend);
  4485. 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());}));
  4486. keywordSend=binarySend.__comma(keywordMessage).__eq_eq_gt((function(node){return node._second()._valueForReceiver_(node._first());}));
  4487. message=binaryMessage.__slash(unaryMessage).__slash(keywordMessage);
  4488. 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();})));}));
  4489. 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());}));
  4490. expression._parser_(assignment.__slash(cascade).__slash(keywordSend).__slash(binarySend).__slash(jsStatement));
  4491. 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());}));
  4492. return method.__comma(smalltalk.PPEOFParser._new()).__eq_eq_gt((function(node){return node._first();}));
  4493. return self;},
  4494. 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')}),
  4495. smalltalk.SmalltalkParser);
  4496. smalltalk.addMethod(
  4497. '_parse_',
  4498. smalltalk.method({
  4499. selector: 'parse:',
  4500. category: 'instance creation',
  4501. fn: function (aStream){
  4502. var self=this;
  4503. return self._new()._parse_(aStream);
  4504. return self;},
  4505. source: unescape('parse%3A%20aStream%0A%09%20%20%20%20%5Eself%20new%0A%09%09parse%3A%20aStream%0A')}),
  4506. smalltalk.SmalltalkParser.klass);
  4507. smalltalk.addClass('Chunk', smalltalk.Object, ['contents'], 'Parser');
  4508. smalltalk.addMethod(
  4509. '_contents',
  4510. smalltalk.method({
  4511. selector: 'contents',
  4512. category: 'accessing',
  4513. fn: function (){
  4514. var self=this;
  4515. return self['@contents']._ifNil_((function(){return "";}));
  4516. return self;},
  4517. source: unescape('contents%0A%09%5Econtents%20ifNil%3A%20%5B%27%27%5D%0A')}),
  4518. smalltalk.Chunk);
  4519. smalltalk.addMethod(
  4520. '_contents_',
  4521. smalltalk.method({
  4522. selector: 'contents:',
  4523. category: 'accessing',
  4524. fn: function (aString){
  4525. var self=this;
  4526. self['@contents']=aString;
  4527. return self;},
  4528. source: unescape('contents%3A%20aString%0A%09contents%20%3A%3D%20aString%0A')}),
  4529. smalltalk.Chunk);
  4530. smalltalk.addMethod(
  4531. '_isEmptyChunk',
  4532. smalltalk.method({
  4533. selector: 'isEmptyChunk',
  4534. category: 'testing',
  4535. fn: function (){
  4536. var self=this;
  4537. return false;
  4538. return self;},
  4539. source: unescape('isEmptyChunk%0A%09%5Efalse%0A')}),
  4540. smalltalk.Chunk);
  4541. smalltalk.addMethod(
  4542. '_isInstructionChunk',
  4543. smalltalk.method({
  4544. selector: 'isInstructionChunk',
  4545. category: 'testing',
  4546. fn: function (){
  4547. var self=this;
  4548. return false;
  4549. return self;},
  4550. source: unescape('isInstructionChunk%0A%09%5Efalse%0A')}),
  4551. smalltalk.Chunk);
  4552. smalltalk.addClass('InstructionChunk', smalltalk.Chunk, [], 'Parser');
  4553. smalltalk.addMethod(
  4554. '_isInstructionChunk',
  4555. smalltalk.method({
  4556. selector: 'isInstructionChunk',
  4557. category: 'testing',
  4558. fn: function (){
  4559. var self=this;
  4560. return true;
  4561. return self;},
  4562. source: unescape('isInstructionChunk%0A%09%5Etrue%0A')}),
  4563. smalltalk.InstructionChunk);
  4564. smalltalk.addClass('EmptyChunk', smalltalk.Chunk, [], 'Parser');
  4565. smalltalk.addMethod(
  4566. '_isEmptyChunk',
  4567. smalltalk.method({
  4568. selector: 'isEmptyChunk',
  4569. category: 'testing',
  4570. fn: function (){
  4571. var self=this;
  4572. return true;
  4573. return self;},
  4574. source: unescape('isEmptyChunk%0A%09%5Etrue%0A')}),
  4575. smalltalk.EmptyChunk);
  4576. smalltalk.addClass('ChunkParser', smalltalk.Object, ['parser', 'separator', 'eof', 'ws', 'chunk', 'emptyChunk', 'instructionChunk'], 'Parser');
  4577. smalltalk.addMethod(
  4578. '_parser',
  4579. smalltalk.method({
  4580. selector: 'parser',
  4581. category: 'accessing',
  4582. fn: function (){
  4583. var self=this;
  4584. return self['@parser']._ifNil_((function(){return self['@parser']=self._instructionChunk().__slash(self._emptyChunk()).__slash(self._chunk()).__slash(self._eof());}));
  4585. return self;},
  4586. 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')}),
  4587. smalltalk.ChunkParser);
  4588. smalltalk.addMethod(
  4589. '_eof',
  4590. smalltalk.method({
  4591. selector: 'eof',
  4592. category: 'accessing',
  4593. fn: function (){
  4594. var self=this;
  4595. return self['@eof']._ifNil_((function(){return self['@eof']=self._ws().__comma(smalltalk.PPEOFParser._new()).__eq_eq_gt((function(node){return nil;}));}));
  4596. return self;},
  4597. 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')}),
  4598. smalltalk.ChunkParser);
  4599. smalltalk.addMethod(
  4600. '_separator',
  4601. smalltalk.method({
  4602. selector: 'separator',
  4603. category: 'accessing',
  4604. fn: function (){
  4605. var self=this;
  4606. return self['@separator']._ifNil_((function(){return self['@separator']=smalltalk.String._cr().__comma(smalltalk.String._space()).__comma(smalltalk.String._lf()).__comma(smalltalk.String._tab())._asChoiceParser();}));
  4607. return self;},
  4608. 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')}),
  4609. smalltalk.ChunkParser);
  4610. smalltalk.addMethod(
  4611. '_ws',
  4612. smalltalk.method({
  4613. selector: 'ws',
  4614. category: 'accessing',
  4615. fn: function (){
  4616. var self=this;
  4617. return self['@ws']._ifNil_((function(){return self['@ws']=self._separator()._star();}));
  4618. return self;},
  4619. source: unescape('ws%0A%09%5Ews%20ifNil%3A%20%5Bws%20%3A%3D%20self%20separator%20star%5D%0A')}),
  4620. smalltalk.ChunkParser);
  4621. smalltalk.addMethod(
  4622. '_chunk',
  4623. smalltalk.method({
  4624. selector: 'chunk',
  4625. category: 'accessing',
  4626. fn: function (){
  4627. var self=this;
  4628. 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")));}));}));
  4629. return self;},
  4630. 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')}),
  4631. smalltalk.ChunkParser);
  4632. smalltalk.addMethod(
  4633. '_emptyChunk',
  4634. smalltalk.method({
  4635. selector: 'emptyChunk',
  4636. category: 'accessing',
  4637. fn: function (){
  4638. var self=this;
  4639. 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();}));}));
  4640. return self;},
  4641. 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')}),
  4642. smalltalk.ChunkParser);
  4643. smalltalk.addMethod(
  4644. '_instructionChunk',
  4645. smalltalk.method({
  4646. selector: 'instructionChunk',
  4647. category: '',
  4648. fn: function (){
  4649. var self=this;
  4650. 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());}));}));
  4651. return self;},
  4652. 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')}),
  4653. smalltalk.ChunkParser);
  4654. smalltalk.addClass('Importer', smalltalk.Object, ['chunkParser'], 'Parser');
  4655. smalltalk.addMethod(
  4656. '_chunkParser',
  4657. smalltalk.method({
  4658. selector: 'chunkParser',
  4659. category: 'accessing',
  4660. fn: function (){
  4661. var self=this;
  4662. return self['@chunkParser']._ifNil_((function(){return self['@chunkParser']=smalltalk.ChunkParser._new()._parser();}));
  4663. return self;},
  4664. source: unescape('chunkParser%0A%09%5EchunkParser%20ifNil%3A%20%5BchunkParser%20%3A%3D%20ChunkParser%20new%20parser%5D%0A')}),
  4665. smalltalk.Importer);
  4666. smalltalk.addMethod(
  4667. '_import_',
  4668. smalltalk.method({
  4669. selector: 'import:',
  4670. category: 'fileIn',
  4671. fn: function (aStream){
  4672. var self=this;
  4673. aStream._atEnd()._ifFalse_((function(){var nextChunk=nil;
  4674. 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);}));}));
  4675. return self;},
  4676. 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')}),
  4677. smalltalk.Importer);
  4678. smalltalk.addClass('Exporter', smalltalk.Object, [], 'Parser');
  4679. smalltalk.addMethod(
  4680. '_exportCategory_',
  4681. smalltalk.method({
  4682. selector: 'exportCategory:',
  4683. category: 'fileout',
  4684. fn: function (aString){
  4685. var self=this;
  4686. var stream=nil;
  4687. stream=""._writeStream();
  4688. smalltalk.Smalltalk._current()._classes()._select_((function(each){return each._category().__eq(aString);}))._do_((function(each){return stream._nextPutAll_(self._export_(each));}));
  4689. return stream._contents();
  4690. return self;},
  4691. 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')}),
  4692. smalltalk.Exporter);
  4693. smalltalk.addMethod(
  4694. '_export_',
  4695. smalltalk.method({
  4696. selector: 'export:',
  4697. category: 'fileOut',
  4698. fn: function (aClass){
  4699. var self=this;
  4700. var stream=nil;
  4701. stream=""._writeStream();
  4702. self._exportDefinitionOf_on_(aClass,stream);
  4703. stream._nextPutAll_(smalltalk.String._cr());
  4704. self._exportMethodsOf_on_(aClass,stream);
  4705. stream._nextPutAll_(smalltalk.String._cr());
  4706. self._exportMetaDefinitionOf_on_(aClass,stream);
  4707. self._exportMethodsOf_on_(aClass._class(),stream);
  4708. stream._nextPutAll_(smalltalk.String._cr());
  4709. return stream._contents();
  4710. return self;},
  4711. 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')}),
  4712. smalltalk.Exporter);
  4713. smalltalk.addMethod(
  4714. '_exportDefinitionOf_on_',
  4715. smalltalk.method({
  4716. selector: 'exportDefinitionOf:on:',
  4717. category: 'private',
  4718. fn: function (aClass, aStream){
  4719. var self=this;
  4720. (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);
  4721. aClass._instVarNames()._do_separatedBy_((function(each){return aStream._nextPutAll_(unescape("%27").__comma(each).__comma(unescape("%27")));}),(function(){return aStream._nextPutAll_(unescape("%2C%20"));}));
  4722. (function($rec){$rec._nextPutAll_(unescape("%5D%2C%20%27"));$rec._nextPutAll_(aClass._category().__comma(unescape("%27")));return $rec._nextPutAll_(unescape("%29%3B"));})(aStream);
  4723. 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);}));
  4724. return self;},
  4725. 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')}),
  4726. smalltalk.Exporter);
  4727. smalltalk.addMethod(
  4728. '_exportMetaDefinitionOf_on_',
  4729. smalltalk.method({
  4730. selector: 'exportMetaDefinitionOf:on:',
  4731. category: 'private',
  4732. fn: function (aClass, aStream){
  4733. var self=this;
  4734. 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()));}));
  4735. return self;},
  4736. 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')}),
  4737. smalltalk.Exporter);
  4738. smalltalk.addMethod(
  4739. '_exportMethodsOf_on_',
  4740. smalltalk.method({
  4741. selector: 'exportMethodsOf:on:',
  4742. category: 'private',
  4743. fn: function (aClass, aStream){
  4744. var self=this;
  4745. 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);}));
  4746. return self;},
  4747. 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')}),
  4748. smalltalk.Exporter);
  4749. smalltalk.addMethod(
  4750. '_classNameFor_',
  4751. smalltalk.method({
  4752. selector: 'classNameFor:',
  4753. category: 'private',
  4754. fn: function (aClass){
  4755. var self=this;
  4756. 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();}));}));
  4757. return self;},
  4758. 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')}),
  4759. smalltalk.Exporter);
  4760. smalltalk.addClass('Node', smalltalk.Object, ['nodes'], 'Compiler');
  4761. smalltalk.addMethod(
  4762. '_nodes',
  4763. smalltalk.method({
  4764. selector: 'nodes',
  4765. category: 'accessing',
  4766. fn: function (){
  4767. var self=this;
  4768. return self['@nodes']._ifNil_((function(){return self['@nodes']=smalltalk.Array._new();}));
  4769. return self;},
  4770. source: unescape('nodes%0A%09%5Enodes%20ifNil%3A%20%5Bnodes%20%3A%3D%20Array%20new%5D%0A')}),
  4771. smalltalk.Node);
  4772. smalltalk.addMethod(
  4773. '_nodes_',
  4774. smalltalk.method({
  4775. selector: 'nodes:',
  4776. category: 'building',
  4777. fn: function (aCollection){
  4778. var self=this;
  4779. self['@nodes']=aCollection;
  4780. return self;},
  4781. source: unescape('nodes%3A%20aCollection%0A%09nodes%20%3A%3D%20aCollection%0A')}),
  4782. smalltalk.Node);
  4783. smalltalk.addMethod(
  4784. '_addNode_',
  4785. smalltalk.method({
  4786. selector: 'addNode:',
  4787. category: 'accessing',
  4788. fn: function (aNode){
  4789. var self=this;
  4790. self._nodes()._add_(aNode);
  4791. return self;},
  4792. source: unescape('addNode%3A%20aNode%0A%09self%20nodes%20add%3A%20aNode%0A')}),
  4793. smalltalk.Node);
  4794. smalltalk.addMethod(
  4795. '_accept_',
  4796. smalltalk.method({
  4797. selector: 'accept:',
  4798. category: 'visiting',
  4799. fn: function (aVisitor){
  4800. var self=this;
  4801. aVisitor._visitNode_(self);
  4802. return self;},
  4803. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitNode%3A%20self%0A')}),
  4804. smalltalk.Node);
  4805. smalltalk.addClass('MethodNode', smalltalk.Node, ['selector', 'arguments', 'source'], 'Compiler');
  4806. smalltalk.addMethod(
  4807. '_selector',
  4808. smalltalk.method({
  4809. selector: 'selector',
  4810. category: 'accessing',
  4811. fn: function (){
  4812. var self=this;
  4813. return self['@selector'];
  4814. return self;},
  4815. source: unescape('selector%0A%09%5Eselector%0A')}),
  4816. smalltalk.MethodNode);
  4817. smalltalk.addMethod(
  4818. '_selector_',
  4819. smalltalk.method({
  4820. selector: 'selector:',
  4821. category: 'accessing',
  4822. fn: function (aString){
  4823. var self=this;
  4824. self['@selector']=aString;
  4825. return self;},
  4826. source: unescape('selector%3A%20aString%0A%09selector%20%3A%3D%20aString%0A')}),
  4827. smalltalk.MethodNode);
  4828. smalltalk.addMethod(
  4829. '_arguments',
  4830. smalltalk.method({
  4831. selector: 'arguments',
  4832. category: 'accessing',
  4833. fn: function (){
  4834. var self=this;
  4835. return self['@arguments']._ifNil_((function(){return [];}));
  4836. return self;},
  4837. source: unescape('arguments%0A%09%5Earguments%20ifNil%3A%20%5B%23%28%29%5D%0A')}),
  4838. smalltalk.MethodNode);
  4839. smalltalk.addMethod(
  4840. '_arguments_',
  4841. smalltalk.method({
  4842. selector: 'arguments:',
  4843. category: 'accessing',
  4844. fn: function (aCollection){
  4845. var self=this;
  4846. self['@arguments']=aCollection;
  4847. return self;},
  4848. source: unescape('arguments%3A%20aCollection%0A%09arguments%20%3A%3D%20aCollection%0A')}),
  4849. smalltalk.MethodNode);
  4850. smalltalk.addMethod(
  4851. '_source',
  4852. smalltalk.method({
  4853. selector: 'source',
  4854. category: 'accessing',
  4855. fn: function (){
  4856. var self=this;
  4857. return self['@source'];
  4858. return self;},
  4859. source: unescape('source%0A%09%5Esource%0A')}),
  4860. smalltalk.MethodNode);
  4861. smalltalk.addMethod(
  4862. '_source_',
  4863. smalltalk.method({
  4864. selector: 'source:',
  4865. category: 'accessing',
  4866. fn: function (aString){
  4867. var self=this;
  4868. self['@source']=aString;
  4869. return self;},
  4870. source: unescape('source%3A%20aString%0A%09source%20%3A%3D%20aString%0A')}),
  4871. smalltalk.MethodNode);
  4872. smalltalk.addMethod(
  4873. '_accept_',
  4874. smalltalk.method({
  4875. selector: 'accept:',
  4876. category: 'visiting',
  4877. fn: function (aVisitor){
  4878. var self=this;
  4879. aVisitor._visitMethodNode_(self);
  4880. return self;},
  4881. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitMethodNode%3A%20self%0A')}),
  4882. smalltalk.MethodNode);
  4883. smalltalk.addClass('SendNode', smalltalk.Node, ['selector', 'arguments', 'receiver'], 'Compiler');
  4884. smalltalk.addMethod(
  4885. '_selector',
  4886. smalltalk.method({
  4887. selector: 'selector',
  4888. category: 'accessing',
  4889. fn: function (){
  4890. var self=this;
  4891. return self['@selector'];
  4892. return self;},
  4893. source: unescape('selector%0A%09%5Eselector%0A')}),
  4894. smalltalk.SendNode);
  4895. smalltalk.addMethod(
  4896. '_selector_',
  4897. smalltalk.method({
  4898. selector: 'selector:',
  4899. category: 'accessing',
  4900. fn: function (aString){
  4901. var self=this;
  4902. self['@selector']=aString;
  4903. return self;},
  4904. source: unescape('selector%3A%20aString%0A%09selector%20%3A%3D%20aString%0A')}),
  4905. smalltalk.SendNode);
  4906. smalltalk.addMethod(
  4907. '_arguments',
  4908. smalltalk.method({
  4909. selector: 'arguments',
  4910. category: 'accessing',
  4911. fn: function (){
  4912. var self=this;
  4913. return self['@arguments']._ifNil_((function(){return self['@arguments']=[];}));
  4914. return self;},
  4915. source: unescape('arguments%0A%09%5Earguments%20ifNil%3A%20%5Barguments%20%3A%3D%20%23%28%29%5D%0A')}),
  4916. smalltalk.SendNode);
  4917. smalltalk.addMethod(
  4918. '_arguments_',
  4919. smalltalk.method({
  4920. selector: 'arguments:',
  4921. category: 'accessing',
  4922. fn: function (aCollection){
  4923. var self=this;
  4924. self['@arguments']=aCollection;
  4925. return self;},
  4926. source: unescape('arguments%3A%20aCollection%0A%09arguments%20%3A%3D%20aCollection%0A')}),
  4927. smalltalk.SendNode);
  4928. smalltalk.addMethod(
  4929. '_receiver',
  4930. smalltalk.method({
  4931. selector: 'receiver',
  4932. category: 'accessing',
  4933. fn: function (){
  4934. var self=this;
  4935. return self['@receiver'];
  4936. return self;},
  4937. source: unescape('receiver%0A%09%5Ereceiver%0A')}),
  4938. smalltalk.SendNode);
  4939. smalltalk.addMethod(
  4940. '_receiver_',
  4941. smalltalk.method({
  4942. selector: 'receiver:',
  4943. category: 'accessing',
  4944. fn: function (aNode){
  4945. var self=this;
  4946. self['@receiver']=aNode;
  4947. return self;},
  4948. source: unescape('receiver%3A%20aNode%0A%09receiver%20%3A%3D%20aNode%0A')}),
  4949. smalltalk.SendNode);
  4950. smalltalk.addMethod(
  4951. '_valueForReceiver_',
  4952. smalltalk.method({
  4953. selector: 'valueForReceiver:',
  4954. category: 'accessing',
  4955. fn: function (anObject){
  4956. var self=this;
  4957. 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());
  4958. return self;},
  4959. 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')}),
  4960. smalltalk.SendNode);
  4961. smalltalk.addMethod(
  4962. '_cascadeNodeWithMessages_',
  4963. smalltalk.method({
  4964. selector: 'cascadeNodeWithMessages:',
  4965. category: 'accessing',
  4966. fn: function (aCollection){
  4967. var self=this;
  4968. var first=nil;
  4969. first=(function($rec){$rec._selector_(self._selector());$rec._arguments_(self._arguments());return $rec._yourself();})(smalltalk.SendNode._new());
  4970. return (function($rec){$rec._receiver_(self._receiver());$rec._nodes_(smalltalk.Array._with_(first).__comma(aCollection));return $rec._yourself();})(smalltalk.CascadeNode._new());
  4971. return self;},
  4972. 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')}),
  4973. smalltalk.SendNode);
  4974. smalltalk.addMethod(
  4975. '_accept_',
  4976. smalltalk.method({
  4977. selector: 'accept:',
  4978. category: 'visiting',
  4979. fn: function (aVisitor){
  4980. var self=this;
  4981. aVisitor._visitSendNode_(self);
  4982. return self;},
  4983. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitSendNode%3A%20self%0A')}),
  4984. smalltalk.SendNode);
  4985. smalltalk.addClass('CascadeNode', smalltalk.Node, ['receiver'], 'Compiler');
  4986. smalltalk.addMethod(
  4987. '_receiver',
  4988. smalltalk.method({
  4989. selector: 'receiver',
  4990. category: 'accessing',
  4991. fn: function (){
  4992. var self=this;
  4993. return self['@receiver'];
  4994. return self;},
  4995. source: unescape('receiver%0A%09%5Ereceiver%0A')}),
  4996. smalltalk.CascadeNode);
  4997. smalltalk.addMethod(
  4998. '_receiver_',
  4999. smalltalk.method({
  5000. selector: 'receiver:',
  5001. category: 'accessing',
  5002. fn: function (aNode){
  5003. var self=this;
  5004. self['@receiver']=aNode;
  5005. return self;},
  5006. source: unescape('receiver%3A%20aNode%0A%09receiver%20%3A%3D%20aNode%0A')}),
  5007. smalltalk.CascadeNode);
  5008. smalltalk.addMethod(
  5009. '_accept_',
  5010. smalltalk.method({
  5011. selector: 'accept:',
  5012. category: 'visiting',
  5013. fn: function (aVisitor){
  5014. var self=this;
  5015. aVisitor._visitCascadeNode_(self);
  5016. return self;},
  5017. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitCascadeNode%3A%20self%0A')}),
  5018. smalltalk.CascadeNode);
  5019. smalltalk.addClass('AssignmentNode', smalltalk.Node, ['left', 'right'], 'Compiler');
  5020. smalltalk.addMethod(
  5021. '_left',
  5022. smalltalk.method({
  5023. selector: 'left',
  5024. category: 'accessing',
  5025. fn: function (){
  5026. var self=this;
  5027. return self['@left'];
  5028. return self;},
  5029. source: unescape('left%0A%09%5Eleft%0A')}),
  5030. smalltalk.AssignmentNode);
  5031. smalltalk.addMethod(
  5032. '_left_',
  5033. smalltalk.method({
  5034. selector: 'left:',
  5035. category: 'accessing',
  5036. fn: function (aNode){
  5037. var self=this;
  5038. self['@left']=aNode;
  5039. return self;},
  5040. source: unescape('left%3A%20aNode%0A%09left%20%3A%3D%20aNode%0A')}),
  5041. smalltalk.AssignmentNode);
  5042. smalltalk.addMethod(
  5043. '_right',
  5044. smalltalk.method({
  5045. selector: 'right',
  5046. category: 'accessing',
  5047. fn: function (){
  5048. var self=this;
  5049. return self['@right'];
  5050. return self;},
  5051. source: unescape('right%0A%09%5Eright%0A')}),
  5052. smalltalk.AssignmentNode);
  5053. smalltalk.addMethod(
  5054. '_right_',
  5055. smalltalk.method({
  5056. selector: 'right:',
  5057. category: 'accessing',
  5058. fn: function (aNode){
  5059. var self=this;
  5060. self['@right']=aNode;
  5061. return self;},
  5062. source: unescape('right%3A%20aNode%0A%09right%20%3A%3D%20aNode%0A')}),
  5063. smalltalk.AssignmentNode);
  5064. smalltalk.addMethod(
  5065. '_accept_',
  5066. smalltalk.method({
  5067. selector: 'accept:',
  5068. category: 'visiting',
  5069. fn: function (aVisitor){
  5070. var self=this;
  5071. aVisitor._visitAssignmentNode_(self);
  5072. return self;},
  5073. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitAssignmentNode%3A%20self%0A')}),
  5074. smalltalk.AssignmentNode);
  5075. smalltalk.addClass('BlockNode', smalltalk.Node, ['parameters'], 'Compiler');
  5076. smalltalk.addMethod(
  5077. '_parameters',
  5078. smalltalk.method({
  5079. selector: 'parameters',
  5080. category: 'accessing',
  5081. fn: function (){
  5082. var self=this;
  5083. return self['@parameters']._ifNil_((function(){return self['@parameters']=smalltalk.Array._new();}));
  5084. return self;},
  5085. source: unescape('parameters%0A%09%5Eparameters%20ifNil%3A%20%5Bparameters%20%3A%3D%20Array%20new%5D%0A')}),
  5086. smalltalk.BlockNode);
  5087. smalltalk.addMethod(
  5088. '_parameters_',
  5089. smalltalk.method({
  5090. selector: 'parameters:',
  5091. category: 'accessing',
  5092. fn: function (aCollection){
  5093. var self=this;
  5094. self['@parameters']=aCollection;
  5095. return self;},
  5096. source: unescape('parameters%3A%20aCollection%0A%09parameters%20%3A%3D%20aCollection%0A')}),
  5097. smalltalk.BlockNode);
  5098. smalltalk.addMethod(
  5099. '_accept_',
  5100. smalltalk.method({
  5101. selector: 'accept:',
  5102. category: 'visiting',
  5103. fn: function (aVisitor){
  5104. var self=this;
  5105. aVisitor._visitBlockNode_(self);
  5106. return self;},
  5107. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitBlockNode%3A%20self%0A')}),
  5108. smalltalk.BlockNode);
  5109. smalltalk.addClass('SequenceNode', smalltalk.Node, ['temps'], 'Compiler');
  5110. smalltalk.addMethod(
  5111. '_temps',
  5112. smalltalk.method({
  5113. selector: 'temps',
  5114. category: 'accessing',
  5115. fn: function (){
  5116. var self=this;
  5117. return self['@temps']._ifNil_((function(){return [];}));
  5118. return self;},
  5119. source: unescape('temps%0A%09%5Etemps%20ifNil%3A%20%5B%23%28%29%5D%0A')}),
  5120. smalltalk.SequenceNode);
  5121. smalltalk.addMethod(
  5122. '_temps_',
  5123. smalltalk.method({
  5124. selector: 'temps:',
  5125. category: 'accessing',
  5126. fn: function (aCollection){
  5127. var self=this;
  5128. self['@temps']=aCollection;
  5129. return self;},
  5130. source: unescape('temps%3A%20aCollection%0A%09temps%20%3A%3D%20aCollection%0A')}),
  5131. smalltalk.SequenceNode);
  5132. smalltalk.addMethod(
  5133. '_asBlockSequenceNode',
  5134. smalltalk.method({
  5135. selector: 'asBlockSequenceNode',
  5136. category: 'testing',
  5137. fn: function (){
  5138. var self=this;
  5139. return (function($rec){$rec._nodes_(self._nodes());$rec._temps_(self._temps());return $rec._yourself();})(smalltalk.BlockSequenceNode._new());
  5140. return self;},
  5141. 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')}),
  5142. smalltalk.SequenceNode);
  5143. smalltalk.addMethod(
  5144. '_accept_',
  5145. smalltalk.method({
  5146. selector: 'accept:',
  5147. category: 'visiting',
  5148. fn: function (aVisitor){
  5149. var self=this;
  5150. aVisitor._visitSequenceNode_(self);
  5151. return self;},
  5152. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitSequenceNode%3A%20self%0A')}),
  5153. smalltalk.SequenceNode);
  5154. smalltalk.addClass('BlockSequenceNode', smalltalk.SequenceNode, [], 'Compiler');
  5155. smalltalk.addMethod(
  5156. '_accept_',
  5157. smalltalk.method({
  5158. selector: 'accept:',
  5159. category: 'visiting',
  5160. fn: function (aVisitor){
  5161. var self=this;
  5162. aVisitor._visitBlockSequenceNode_(self);
  5163. return self;},
  5164. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitBlockSequenceNode%3A%20self%0A')}),
  5165. smalltalk.BlockSequenceNode);
  5166. smalltalk.addClass('ReturnNode', smalltalk.Node, [], 'Compiler');
  5167. smalltalk.addMethod(
  5168. '_accept_',
  5169. smalltalk.method({
  5170. selector: 'accept:',
  5171. category: 'visiting',
  5172. fn: function (aVisitor){
  5173. var self=this;
  5174. aVisitor._visitReturnNode_(self);
  5175. return self;},
  5176. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitReturnNode%3A%20self%0A')}),
  5177. smalltalk.ReturnNode);
  5178. smalltalk.addClass('ValueNode', smalltalk.Node, ['value'], 'Compiler');
  5179. smalltalk.addMethod(
  5180. '_value',
  5181. smalltalk.method({
  5182. selector: 'value',
  5183. category: 'accessing',
  5184. fn: function (){
  5185. var self=this;
  5186. return self['@value'];
  5187. return self;},
  5188. source: unescape('value%0A%09%5Evalue%0A')}),
  5189. smalltalk.ValueNode);
  5190. smalltalk.addMethod(
  5191. '_value_',
  5192. smalltalk.method({
  5193. selector: 'value:',
  5194. category: 'accessing',
  5195. fn: function (anObject){
  5196. var self=this;
  5197. self['@value']=anObject;
  5198. return self;},
  5199. source: unescape('value%3A%20anObject%0A%09value%20%3A%3D%20anObject%0A')}),
  5200. smalltalk.ValueNode);
  5201. smalltalk.addMethod(
  5202. '_accept_',
  5203. smalltalk.method({
  5204. selector: 'accept:',
  5205. category: 'visiting',
  5206. fn: function (aVisitor){
  5207. var self=this;
  5208. aVisitor._visitValueNode_(self);
  5209. return self;},
  5210. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitValueNode%3A%20self%0A')}),
  5211. smalltalk.ValueNode);
  5212. smalltalk.addClass('VariableNode', smalltalk.ValueNode, [], 'Compiler');
  5213. smalltalk.addMethod(
  5214. '_accept_',
  5215. smalltalk.method({
  5216. selector: 'accept:',
  5217. category: 'visiting',
  5218. fn: function (aVisitor){
  5219. var self=this;
  5220. aVisitor._visitVariableNode_(self);
  5221. return self;},
  5222. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitVariableNode%3A%20self%0A')}),
  5223. smalltalk.VariableNode);
  5224. smalltalk.addClass('ClassReferenceNode', smalltalk.VariableNode, [], 'Compiler');
  5225. smalltalk.addMethod(
  5226. '_accept_',
  5227. smalltalk.method({
  5228. selector: 'accept:',
  5229. category: 'visiting',
  5230. fn: function (aVisitor){
  5231. var self=this;
  5232. aVisitor._visitClassReferenceNode_(self);
  5233. return self;},
  5234. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitClassReferenceNode%3A%20self%0A')}),
  5235. smalltalk.ClassReferenceNode);
  5236. smalltalk.addClass('JSStatementNode', smalltalk.Node, ['source'], 'Compiler');
  5237. smalltalk.addMethod(
  5238. '_source',
  5239. smalltalk.method({
  5240. selector: 'source',
  5241. category: 'accessing',
  5242. fn: function (){
  5243. var self=this;
  5244. return self['@source']._ifNil_((function(){return "";}));
  5245. return self;},
  5246. source: unescape('source%0A%09%5Esource%20ifNil%3A%20%5B%27%27%5D%0A')}),
  5247. smalltalk.JSStatementNode);
  5248. smalltalk.addMethod(
  5249. '_source_',
  5250. smalltalk.method({
  5251. selector: 'source:',
  5252. category: 'accessing',
  5253. fn: function (aString){
  5254. var self=this;
  5255. self['@source']=aString;
  5256. return self;},
  5257. source: unescape('source%3A%20aString%0A%09source%20%3A%3D%20aString%0A')}),
  5258. smalltalk.JSStatementNode);
  5259. smalltalk.addMethod(
  5260. '_accept_',
  5261. smalltalk.method({
  5262. selector: 'accept:',
  5263. category: 'visiting',
  5264. fn: function (aVisitor){
  5265. var self=this;
  5266. aVisitor._visitJSStatementNode_(self);
  5267. return self;},
  5268. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitJSStatementNode%3A%20self%0A')}),
  5269. smalltalk.JSStatementNode);
  5270. smalltalk.addClass('NodeVisitor', smalltalk.Object, [], 'Compiler');
  5271. smalltalk.addMethod(
  5272. '_visit_',
  5273. smalltalk.method({
  5274. selector: 'visit:',
  5275. category: 'visiting',
  5276. fn: function (aNode){
  5277. var self=this;
  5278. aNode._accept_(self);
  5279. return self;},
  5280. source: unescape('visit%3A%20aNode%0A%09aNode%20accept%3A%20self%0A')}),
  5281. smalltalk.NodeVisitor);
  5282. smalltalk.addMethod(
  5283. '_visitNode_',
  5284. smalltalk.method({
  5285. selector: 'visitNode:',
  5286. category: 'visiting',
  5287. fn: function (aNode){
  5288. var self=this;
  5289. return self;},
  5290. source: unescape('visitNode%3A%20aNode%0A')}),
  5291. smalltalk.NodeVisitor);
  5292. smalltalk.addMethod(
  5293. '_visitMethodNode_',
  5294. smalltalk.method({
  5295. selector: 'visitMethodNode:',
  5296. category: 'visiting',
  5297. fn: function (aNode){
  5298. var self=this;
  5299. self._visitNode_(aNode);
  5300. return self;},
  5301. source: unescape('visitMethodNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  5302. smalltalk.NodeVisitor);
  5303. smalltalk.addMethod(
  5304. '_visitSequenceNode_',
  5305. smalltalk.method({
  5306. selector: 'visitSequenceNode:',
  5307. category: 'visiting',
  5308. fn: function (aNode){
  5309. var self=this;
  5310. self._visitNode_(aNode);
  5311. return self;},
  5312. source: unescape('visitSequenceNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  5313. smalltalk.NodeVisitor);
  5314. smalltalk.addMethod(
  5315. '_visitBlockSequenceNode_',
  5316. smalltalk.method({
  5317. selector: 'visitBlockSequenceNode:',
  5318. category: 'visiting',
  5319. fn: function (aNode){
  5320. var self=this;
  5321. self._visitSequenceNode_(aNode);
  5322. return self;},
  5323. source: unescape('visitBlockSequenceNode%3A%20aNode%0A%09self%20visitSequenceNode%3A%20aNode%0A')}),
  5324. smalltalk.NodeVisitor);
  5325. smalltalk.addMethod(
  5326. '_visitBlockNode_',
  5327. smalltalk.method({
  5328. selector: 'visitBlockNode:',
  5329. category: 'visiting',
  5330. fn: function (aNode){
  5331. var self=this;
  5332. self._visitNode_(aNode);
  5333. return self;},
  5334. source: unescape('visitBlockNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  5335. smalltalk.NodeVisitor);
  5336. smalltalk.addMethod(
  5337. '_visitReturnNode_',
  5338. smalltalk.method({
  5339. selector: 'visitReturnNode:',
  5340. category: 'visiting',
  5341. fn: function (aNode){
  5342. var self=this;
  5343. self._visitNode_(aNode);
  5344. return self;},
  5345. source: unescape('visitReturnNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  5346. smalltalk.NodeVisitor);
  5347. smalltalk.addMethod(
  5348. '_visitSendNode_',
  5349. smalltalk.method({
  5350. selector: 'visitSendNode:',
  5351. category: 'visiting',
  5352. fn: function (aNode){
  5353. var self=this;
  5354. self._visitNode_(aNode);
  5355. return self;},
  5356. source: unescape('visitSendNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  5357. smalltalk.NodeVisitor);
  5358. smalltalk.addMethod(
  5359. '_visitCascadeNode_',
  5360. smalltalk.method({
  5361. selector: 'visitCascadeNode:',
  5362. category: 'visiting',
  5363. fn: function (aNode){
  5364. var self=this;
  5365. self._visitNode_(aNode);
  5366. return self;},
  5367. source: unescape('visitCascadeNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  5368. smalltalk.NodeVisitor);
  5369. smalltalk.addMethod(
  5370. '_visitValueNode_',
  5371. smalltalk.method({
  5372. selector: 'visitValueNode:',
  5373. category: 'visiting',
  5374. fn: function (aNode){
  5375. var self=this;
  5376. self._visitNode_(aNode);
  5377. return self;},
  5378. source: unescape('visitValueNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  5379. smalltalk.NodeVisitor);
  5380. smalltalk.addMethod(
  5381. '_visitVariableNode_',
  5382. smalltalk.method({
  5383. selector: 'visitVariableNode:',
  5384. category: 'visiting',
  5385. fn: function (aNode){
  5386. var self=this;
  5387. return self;},
  5388. source: unescape('visitVariableNode%3A%20aNode%0A')}),
  5389. smalltalk.NodeVisitor);
  5390. smalltalk.addMethod(
  5391. '_visitAssignmentNode_',
  5392. smalltalk.method({
  5393. selector: 'visitAssignmentNode:',
  5394. category: 'visiting',
  5395. fn: function (aNode){
  5396. var self=this;
  5397. self._visitNode_(aNode);
  5398. return self;},
  5399. source: unescape('visitAssignmentNode%3A%20aNode%0A%09self%20visitNode%3A%20aNode%0A')}),
  5400. smalltalk.NodeVisitor);
  5401. smalltalk.addMethod(
  5402. '_visitClassReferenceNode_',
  5403. smalltalk.method({
  5404. selector: 'visitClassReferenceNode:',
  5405. category: 'visiting',
  5406. fn: function (aNode){
  5407. var self=this;
  5408. (function($rec){$rec._nextPutAll_("smalltalk.");return $rec._nextPutAll_(aNode._value());})(self);
  5409. return self;},
  5410. 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')}),
  5411. smalltalk.NodeVisitor);
  5412. smalltalk.addMethod(
  5413. '_visitJSStatementNode_',
  5414. smalltalk.method({
  5415. selector: 'visitJSStatementNode:',
  5416. category: 'visiting',
  5417. fn: function (aNode){
  5418. var self=this;
  5419. (function($rec){$rec._nextPutAll_(unescape("function%28%29%7B"));$rec._nextPutAll_(aNode._source());return $rec._nextPutAll_(unescape("%7D%29%28%29"));})(self);
  5420. return self;},
  5421. 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')}),
  5422. smalltalk.NodeVisitor);
  5423. smalltalk.addClass('Compiler', smalltalk.NodeVisitor, ['stream', 'nestedBlocks', 'earlyReturn', 'currentClass', 'currentSelector'], 'Compiler');
  5424. smalltalk.addMethod(
  5425. '_initialize',
  5426. smalltalk.method({
  5427. selector: 'initialize',
  5428. category: 'initialization',
  5429. fn: function (){
  5430. var self=this;
  5431. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  5432. self['@stream']=""._writeStream();
  5433. return self;},
  5434. source: unescape('initialize%0A%09super%20initialize.%0A%09stream%20%3A%3D%20%27%27%20writeStream%0A')}),
  5435. smalltalk.Compiler);
  5436. smalltalk.addMethod(
  5437. '_parser',
  5438. smalltalk.method({
  5439. selector: 'parser',
  5440. category: 'accessing',
  5441. fn: function (){
  5442. var self=this;
  5443. return smalltalk.SmalltalkParser._new();
  5444. return self;},
  5445. source: unescape('parser%0A%09%5ESmalltalkParser%20new%0A')}),
  5446. smalltalk.Compiler);
  5447. smalltalk.addMethod(
  5448. '_currentClass',
  5449. smalltalk.method({
  5450. selector: 'currentClass',
  5451. category: 'accessing',
  5452. fn: function (){
  5453. var self=this;
  5454. return self['@currentClass'];
  5455. return self;},
  5456. source: unescape('currentClass%0A%09%5EcurrentClass%0A')}),
  5457. smalltalk.Compiler);
  5458. smalltalk.addMethod(
  5459. '_currentClass_',
  5460. smalltalk.method({
  5461. selector: 'currentClass:',
  5462. category: 'accessing',
  5463. fn: function (aClass){
  5464. var self=this;
  5465. self['@currentClass']=aClass;
  5466. return self;},
  5467. source: unescape('currentClass%3A%20aClass%0A%09currentClass%20%3A%3D%20aClass%0A')}),
  5468. smalltalk.Compiler);
  5469. smalltalk.addMethod(
  5470. '_loadExpression_',
  5471. smalltalk.method({
  5472. selector: 'loadExpression:',
  5473. category: 'compiling',
  5474. fn: function (aString){
  5475. var self=this;
  5476. smalltalk.DoIt._addCompiledMethod_(self._eval_(self._compileExpression_(aString)));
  5477. return smalltalk.DoIt._new()._doIt();
  5478. return self;},
  5479. 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')}),
  5480. smalltalk.Compiler);
  5481. smalltalk.addMethod(
  5482. '_load_forClass_',
  5483. smalltalk.method({
  5484. selector: 'load:forClass:',
  5485. category: 'compiling',
  5486. fn: function (aString, aClass){
  5487. var self=this;
  5488. return self._eval_(self._compile_forClass_(aString,aClass));
  5489. return self;},
  5490. source: unescape('load%3A%20aString%20forClass%3A%20aClass%0A%09%5Eself%20eval%3A%20%28self%20compile%3A%20aString%20forClass%3A%20aClass%29%0A')}),
  5491. smalltalk.Compiler);
  5492. smalltalk.addMethod(
  5493. '_compile_forClass_',
  5494. smalltalk.method({
  5495. selector: 'compile:forClass:',
  5496. category: 'compiling',
  5497. fn: function (aString, aClass){
  5498. var self=this;
  5499. self._currentClass_(aClass);
  5500. return self._compile_(aString);
  5501. return self;},
  5502. source: unescape('compile%3A%20aString%20forClass%3A%20aClass%0A%09self%20currentClass%3A%20aClass.%0A%09%5Eself%20compile%3A%20aString%0A')}),
  5503. smalltalk.Compiler);
  5504. smalltalk.addMethod(
  5505. '_compileExpression_',
  5506. smalltalk.method({
  5507. selector: 'compileExpression:',
  5508. category: 'compiling',
  5509. fn: function (aString){
  5510. var self=this;
  5511. self._currentClass_(smalltalk.DoIt);
  5512. return self._compileNode_(self._parseExpression_(aString));
  5513. return self;},
  5514. source: unescape('compileExpression%3A%20aString%0A%09self%20currentClass%3A%20DoIt.%0A%09%5Eself%20compileNode%3A%20%28self%20parseExpression%3A%20aString%29%0A')}),
  5515. smalltalk.Compiler);
  5516. smalltalk.addMethod(
  5517. '_eval_',
  5518. smalltalk.method({
  5519. selector: 'eval:',
  5520. category: 'compiling',
  5521. fn: function (aString){
  5522. var self=this;
  5523. return (function(){return eval(aString);})();
  5524. return self;},
  5525. source: unescape('eval%3A%20aString%0A%09%5E%7B%27return%20eval%28aString%29%3B%27%7D%0A')}),
  5526. smalltalk.Compiler);
  5527. smalltalk.addMethod(
  5528. '_compile_',
  5529. smalltalk.method({
  5530. selector: 'compile:',
  5531. category: 'compiling',
  5532. fn: function (aString){
  5533. var self=this;
  5534. return self._compileNode_(self._parse_(aString));
  5535. return self;},
  5536. source: unescape('compile%3A%20aString%0A%09%5Eself%20compileNode%3A%20%28self%20parse%3A%20aString%29%0A')}),
  5537. smalltalk.Compiler);
  5538. smalltalk.addMethod(
  5539. '_compileNode_',
  5540. smalltalk.method({
  5541. selector: 'compileNode:',
  5542. category: 'compiling',
  5543. fn: function (aNode){
  5544. var self=this;
  5545. self['@stream']=""._writeStream();
  5546. self._visit_(aNode);
  5547. return self['@stream']._contents();
  5548. return self;},
  5549. source: unescape('compileNode%3A%20aNode%0A%09stream%20%3A%3D%20%27%27%20writeStream.%0A%09self%20visit%3A%20aNode.%0A%09%5Estream%20contents%0A')}),
  5550. smalltalk.Compiler);
  5551. smalltalk.addMethod(
  5552. '_visit_',
  5553. smalltalk.method({
  5554. selector: 'visit:',
  5555. category: 'visiting',
  5556. fn: function (aNode){
  5557. var self=this;
  5558. aNode._accept_(self);
  5559. return self;},
  5560. source: unescape('visit%3A%20aNode%0A%09aNode%20accept%3A%20self%0A')}),
  5561. smalltalk.Compiler);
  5562. smalltalk.addMethod(
  5563. '_visitMethodNode_',
  5564. smalltalk.method({
  5565. selector: 'visitMethodNode:',
  5566. category: 'visiting',
  5567. fn: function (aNode){
  5568. var self=this;
  5569. var str=nil;
  5570. var currentSelector=nil;
  5571. self['@currentSelector']=aNode._selector()._asSelector();
  5572. self['@nestedBlocks']=(0);
  5573. self['@earlyReturn']=false;
  5574. (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']);
  5575. aNode._arguments()._do_separatedBy_((function(each){return self['@stream']._nextPutAll_(each);}),(function(){return self['@stream']._nextPutAll_(unescape("%2C%20"));}));
  5576. (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']);
  5577. str=self['@stream'];
  5578. self['@stream']=""._writeStream();
  5579. aNode._nodes()._do_((function(each){return self._visit_(each);}));
  5580. self['@earlyReturn']._ifTrue_((function(){return str._nextPutAll_(unescape("try%7B"));}));
  5581. str._nextPutAll_(self['@stream']._contents());
  5582. self['@stream']=str;
  5583. (function($rec){$rec._nextPutAll_(smalltalk.String._cr());return $rec._nextPutAll_(unescape("return%20self%3B"));})(self['@stream']);
  5584. 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")));}));
  5585. (function($rec){$rec._nextPutAll_(unescape("%7D").__comma(smalltalk.String._cr()));return $rec._nextPutAll_(unescape("%7D%29"));})(self['@stream']);
  5586. return self;},
  5587. 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')}),
  5588. smalltalk.Compiler);
  5589. smalltalk.addMethod(
  5590. '_visitBlockNode_',
  5591. smalltalk.method({
  5592. selector: 'visitBlockNode:',
  5593. category: 'visiting',
  5594. fn: function (aNode){
  5595. var self=this;
  5596. self['@stream']._nextPutAll_(unescape("%28function%28"));
  5597. aNode._parameters()._do_separatedBy_((function(each){return self['@stream']._nextPutAll_(each);}),(function(){return self['@stream']._nextPutAll_(unescape("%2C%20"));}));
  5598. self['@stream']._nextPutAll_(unescape("%29%7B"));
  5599. aNode._nodes()._do_((function(each){return self._visit_(each);}));
  5600. self['@stream']._nextPutAll_(unescape("%7D%29"));
  5601. return self;},
  5602. 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')}),
  5603. smalltalk.Compiler);
  5604. smalltalk.addMethod(
  5605. '_visitSequenceNode_',
  5606. smalltalk.method({
  5607. selector: 'visitSequenceNode:',
  5608. category: 'visiting',
  5609. fn: function (aNode){
  5610. var self=this;
  5611. aNode._temps()._do_((function(each){self['@stream']._nextPutAll_("var ".__comma(each).__comma(unescape("%3Dnil%3B")));return self['@stream']._nextPutAll_(smalltalk.String._cr());}));
  5612. aNode._nodes()._do_separatedBy_((function(each){self._visit_(each);return self['@stream']._nextPutAll_(unescape("%3B"));}),(function(){return self['@stream']._nextPutAll_(smalltalk.String._cr());}));
  5613. return self;},
  5614. 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')}),
  5615. smalltalk.Compiler);
  5616. smalltalk.addMethod(
  5617. '_visitBlockSequenceNode_',
  5618. smalltalk.method({
  5619. selector: 'visitBlockSequenceNode:',
  5620. category: 'visiting',
  5621. fn: function (aNode){
  5622. var self=this;
  5623. var index=nil;
  5624. self['@nestedBlocks']=self['@nestedBlocks'].__plus((1));
  5625. 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"));}));}));
  5626. self['@nestedBlocks']=self['@nestedBlocks'].__minus((1));
  5627. return self;},
  5628. 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')}),
  5629. smalltalk.Compiler);
  5630. smalltalk.addMethod(
  5631. '_visitReturnNode_',
  5632. smalltalk.method({
  5633. selector: 'visitReturnNode:',
  5634. category: 'visiting',
  5635. fn: function (aNode){
  5636. var self=this;
  5637. self['@nestedBlocks'].__gt((0))._ifTrue_((function(){return self['@earlyReturn']=true;}));
  5638. 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 ");}));
  5639. aNode._nodes()._do_((function(each){return self._visit_(each);}));
  5640. self['@earlyReturn']._ifTrue_((function(){return self['@stream']._nextPutAll_(unescape("%7D%7D%29%7D%29%28%29"));}));
  5641. return self;},
  5642. 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')}),
  5643. smalltalk.Compiler);
  5644. smalltalk.addMethod(
  5645. '_visitSendNode_',
  5646. smalltalk.method({
  5647. selector: 'visitSendNode:',
  5648. category: 'visiting',
  5649. fn: function (aNode){
  5650. var self=this;
  5651. var str=nil;
  5652. str=self['@stream'];
  5653. self['@stream']=""._writeStream();
  5654. self._visit_(aNode._receiver());
  5655. 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"));}));
  5656. return self;},
  5657. 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')}),
  5658. smalltalk.Compiler);
  5659. smalltalk.addMethod(
  5660. '_visitCascadeNode_',
  5661. smalltalk.method({
  5662. selector: 'visitCascadeNode:',
  5663. category: 'visiting',
  5664. fn: function (aNode){
  5665. var self=this;
  5666. var index=nil;
  5667. index=(0);
  5668. self['@stream']._nextPutAll_(unescape("%28function%28%24rec%29%7B"));
  5669. 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"));}));
  5670. self['@stream']._nextPutAll_(unescape("%7D%29%28"));
  5671. self._visit_(aNode._receiver());
  5672. self['@stream']._nextPutAll_(unescape("%29"));
  5673. return self;},
  5674. 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')}),
  5675. smalltalk.Compiler);
  5676. smalltalk.addMethod(
  5677. '_visitValueNode_',
  5678. smalltalk.method({
  5679. selector: 'visitValueNode:',
  5680. category: 'visiting',
  5681. fn: function (aNode){
  5682. var self=this;
  5683. self['@stream']._nextPutAll_(aNode._value()._asJavascript());
  5684. return self;},
  5685. source: unescape('visitValueNode%3A%20aNode%0A%09stream%20nextPutAll%3A%20aNode%20value%20asJavascript%0A')}),
  5686. smalltalk.Compiler);
  5687. smalltalk.addMethod(
  5688. '_visitAssignmentNode_',
  5689. smalltalk.method({
  5690. selector: 'visitAssignmentNode:',
  5691. category: 'visiting',
  5692. fn: function (aNode){
  5693. var self=this;
  5694. self._visit_(aNode._left());
  5695. self['@stream']._nextPutAll_(unescape("%3D"));
  5696. self._visit_(aNode._right());
  5697. return self;},
  5698. 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')}),
  5699. smalltalk.Compiler);
  5700. smalltalk.addMethod(
  5701. '_visitClassReferenceNode_',
  5702. smalltalk.method({
  5703. selector: 'visitClassReferenceNode:',
  5704. category: 'visiting',
  5705. fn: function (aNode){
  5706. var self=this;
  5707. (function($rec){$rec._nextPutAll_("smalltalk.");return $rec._nextPutAll_(aNode._value());})(self['@stream']);
  5708. return self;},
  5709. 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')}),
  5710. smalltalk.Compiler);
  5711. smalltalk.addMethod(
  5712. '_visitVariableNode_',
  5713. smalltalk.method({
  5714. selector: 'visitVariableNode:',
  5715. category: 'visiting',
  5716. fn: function (aNode){
  5717. var self=this;
  5718. 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());}));
  5719. return self;},
  5720. 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')}),
  5721. smalltalk.Compiler);
  5722. smalltalk.addMethod(
  5723. '_visitJSStatementNode_',
  5724. smalltalk.method({
  5725. selector: 'visitJSStatementNode:',
  5726. category: 'visiting',
  5727. fn: function (aNode){
  5728. var self=this;
  5729. self['@stream']._nextPutAll_(unescape("%28function%28%29%7B"));
  5730. self['@stream']._nextPutAll_(aNode._source()._value()._replace_with_(unescape("%27%27"),unescape("%27")));
  5731. self['@stream']._nextPutAll_(unescape("%7D%29%28%29"));
  5732. return self;},
  5733. 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')}),
  5734. smalltalk.Compiler);
  5735. smalltalk.addMethod(
  5736. '_parse_',
  5737. smalltalk.method({
  5738. selector: 'parse:',
  5739. category: 'compiling',
  5740. fn: function (aString){
  5741. var self=this;
  5742. return self._parser()._parse_(aString._readStream());
  5743. return self;},
  5744. source: unescape('parse%3A%20aString%0A%20%20%20%20%5Eself%20parser%20parse%3A%20aString%20readStream%0A')}),
  5745. smalltalk.Compiler);
  5746. smalltalk.addMethod(
  5747. '_parseExpression_',
  5748. smalltalk.method({
  5749. selector: 'parseExpression:',
  5750. category: 'compiling',
  5751. fn: function (aString){
  5752. var self=this;
  5753. return self._parse_(unescape("doIt%20%5E%5B").__comma(aString).__comma(unescape("%5D%20value")));
  5754. return self;},
  5755. 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')}),
  5756. smalltalk.Compiler);
  5757. smalltalk.addClass('DoIt', smalltalk.Object, [], 'Compiler');
  5758. smalltalk.addMethod(
  5759. '_doIt',
  5760. smalltalk.method({
  5761. selector: 'doIt',
  5762. category: '',
  5763. fn: function (){
  5764. var self=this;
  5765. return (function(){return smalltalk.Object._subclass_instanceVariableNames_category_("DoIt","","Compiler");})._value();
  5766. return self;},
  5767. source: unescape('doIt%20%5E%5BObject%20subclass%3A%20%23DoIt%0A%09instanceVariableNames%3A%20%27%27%0A%09category%3A%20%27Compiler%27%5D%20value')}),
  5768. smalltalk.DoIt);
  5769. smalltalk.addClass('JQuery', smalltalk.Object, ['jquery'], 'JQuery');
  5770. smalltalk.addMethod(
  5771. '_removeAttribute_',
  5772. smalltalk.method({
  5773. selector: 'removeAttribute:',
  5774. category: 'attributes',
  5775. fn: function (aString){
  5776. var self=this;
  5777. return self._call_withArgument_("removeAttribute",aString);
  5778. return self;},
  5779. 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')}),
  5780. smalltalk.JQuery);
  5781. smalltalk.addMethod(
  5782. '_attr_',
  5783. smalltalk.method({
  5784. selector: 'attr:',
  5785. category: 'attributes',
  5786. fn: function (aString){
  5787. var self=this;
  5788. return self._call_withArgument_("attr",aString);
  5789. return self;},
  5790. 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')}),
  5791. smalltalk.JQuery);
  5792. smalltalk.addMethod(
  5793. '_val',
  5794. smalltalk.method({
  5795. selector: 'val',
  5796. category: 'attributes',
  5797. fn: function (){
  5798. var self=this;
  5799. return self._call_("val");
  5800. return self;},
  5801. 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')}),
  5802. smalltalk.JQuery);
  5803. smalltalk.addMethod(
  5804. '_val_',
  5805. smalltalk.method({
  5806. selector: 'val:',
  5807. category: 'attributes',
  5808. fn: function (aString){
  5809. var self=this;
  5810. self._call_withArgument_("val",aString);
  5811. return self;},
  5812. source: unescape('val%3A%20aString%0A%20%20%20%20self%20call%3A%20%27val%27%20withArgument%3A%20aString%0A')}),
  5813. smalltalk.JQuery);
  5814. smalltalk.addMethod(
  5815. '_cssAt_',
  5816. smalltalk.method({
  5817. selector: 'cssAt:',
  5818. category: 'css',
  5819. fn: function (aString){
  5820. var self=this;
  5821. return (function(){return self['@jquery'].css(aString)})();
  5822. return self;},
  5823. 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')}),
  5824. smalltalk.JQuery);
  5825. smalltalk.addMethod(
  5826. '_cssAt_put_',
  5827. smalltalk.method({
  5828. selector: 'cssAt:put:',
  5829. category: 'css',
  5830. fn: function (aString, anotherString){
  5831. var self=this;
  5832. (function(){self['@jquery'].css(aString, anotherString)})();
  5833. return self;},
  5834. 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')}),
  5835. smalltalk.JQuery);
  5836. smalltalk.addMethod(
  5837. '_addClass_',
  5838. smalltalk.method({
  5839. selector: 'addClass:',
  5840. category: 'css',
  5841. fn: function (aString){
  5842. var self=this;
  5843. self._call_withArgument_("addClass",aString);
  5844. return self;},
  5845. 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')}),
  5846. smalltalk.JQuery);
  5847. smalltalk.addMethod(
  5848. '_removeClass_',
  5849. smalltalk.method({
  5850. selector: 'removeClass:',
  5851. category: 'css',
  5852. fn: function (aString){
  5853. var self=this;
  5854. self._call_withArgument_("removeClass",aString);
  5855. return self;},
  5856. 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')}),
  5857. smalltalk.JQuery);
  5858. smalltalk.addMethod(
  5859. '_toggleClass_',
  5860. smalltalk.method({
  5861. selector: 'toggleClass:',
  5862. category: 'css',
  5863. fn: function (aString){
  5864. var self=this;
  5865. self._call_withArgument_("toggleClass",aString);
  5866. return self;},
  5867. 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')}),
  5868. smalltalk.JQuery);
  5869. smalltalk.addMethod(
  5870. '_height',
  5871. smalltalk.method({
  5872. selector: 'height',
  5873. category: 'css',
  5874. fn: function (){
  5875. var self=this;
  5876. return self._call_("height");
  5877. return self;},
  5878. 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')}),
  5879. smalltalk.JQuery);
  5880. smalltalk.addMethod(
  5881. '_height_',
  5882. smalltalk.method({
  5883. selector: 'height:',
  5884. category: 'css',
  5885. fn: function (anInteger){
  5886. var self=this;
  5887. self._call_withArgument_("height",anInteger);
  5888. return self;},
  5889. source: unescape('height%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27height%27%20withArgument%3A%20anInteger%0A')}),
  5890. smalltalk.JQuery);
  5891. smalltalk.addMethod(
  5892. '_width_',
  5893. smalltalk.method({
  5894. selector: 'width:',
  5895. category: 'css',
  5896. fn: function (anInteger){
  5897. var self=this;
  5898. self._call_withArgument_("width",anInteger);
  5899. return self;},
  5900. source: unescape('width%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27width%27%20withArgument%3A%20anInteger%0A')}),
  5901. smalltalk.JQuery);
  5902. smalltalk.addMethod(
  5903. '_width',
  5904. smalltalk.method({
  5905. selector: 'width',
  5906. category: 'css',
  5907. fn: function (){
  5908. var self=this;
  5909. return self._call_("width");
  5910. return self;},
  5911. 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')}),
  5912. smalltalk.JQuery);
  5913. smalltalk.addMethod(
  5914. '_innerHeight',
  5915. smalltalk.method({
  5916. selector: 'innerHeight',
  5917. category: 'css',
  5918. fn: function (){
  5919. var self=this;
  5920. return self._call_("innerHeight");
  5921. return self;},
  5922. 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')}),
  5923. smalltalk.JQuery);
  5924. smalltalk.addMethod(
  5925. '_innerWidth',
  5926. smalltalk.method({
  5927. selector: 'innerWidth',
  5928. category: 'css',
  5929. fn: function (){
  5930. var self=this;
  5931. return self._call_("innerWidth");
  5932. return self;},
  5933. 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')}),
  5934. smalltalk.JQuery);
  5935. smalltalk.addMethod(
  5936. '_outerHeight',
  5937. smalltalk.method({
  5938. selector: 'outerHeight',
  5939. category: 'css',
  5940. fn: function (){
  5941. var self=this;
  5942. return self._call_("outerHeight");
  5943. return self;},
  5944. 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')}),
  5945. smalltalk.JQuery);
  5946. smalltalk.addMethod(
  5947. '_outerWidth',
  5948. smalltalk.method({
  5949. selector: 'outerWidth',
  5950. category: 'css',
  5951. fn: function (){
  5952. var self=this;
  5953. return self._call_("outerWidth");
  5954. return self;},
  5955. 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')}),
  5956. smalltalk.JQuery);
  5957. smalltalk.addMethod(
  5958. '_top',
  5959. smalltalk.method({
  5960. selector: 'top',
  5961. category: 'css',
  5962. fn: function (){
  5963. var self=this;
  5964. return self._call_("position")._basicAt_("top");
  5965. return self;},
  5966. 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')}),
  5967. smalltalk.JQuery);
  5968. smalltalk.addMethod(
  5969. '_left',
  5970. smalltalk.method({
  5971. selector: 'left',
  5972. category: 'css',
  5973. fn: function (){
  5974. var self=this;
  5975. return self._call_("position")._basicAt_("left");
  5976. return self;},
  5977. 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')}),
  5978. smalltalk.JQuery);
  5979. smalltalk.addMethod(
  5980. '_offsetLeft',
  5981. smalltalk.method({
  5982. selector: 'offsetLeft',
  5983. category: 'css',
  5984. fn: function (){
  5985. var self=this;
  5986. return self._call_("offset")._basicAt_("left");
  5987. return self;},
  5988. 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')}),
  5989. smalltalk.JQuery);
  5990. smalltalk.addMethod(
  5991. '_offsetTop',
  5992. smalltalk.method({
  5993. selector: 'offsetTop',
  5994. category: 'css',
  5995. fn: function (){
  5996. var self=this;
  5997. return self._call_("offset")._basicAt_("top");
  5998. return self;},
  5999. 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')}),
  6000. smalltalk.JQuery);
  6001. smalltalk.addMethod(
  6002. '_scrollLeft',
  6003. smalltalk.method({
  6004. selector: 'scrollLeft',
  6005. category: 'css',
  6006. fn: function (){
  6007. var self=this;
  6008. return self._call_("scrollLeft");
  6009. return self;},
  6010. 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')}),
  6011. smalltalk.JQuery);
  6012. smalltalk.addMethod(
  6013. '_scrollTop',
  6014. smalltalk.method({
  6015. selector: 'scrollTop',
  6016. category: 'css',
  6017. fn: function (){
  6018. var self=this;
  6019. return self._call_("scrollTop");
  6020. return self;},
  6021. 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')}),
  6022. smalltalk.JQuery);
  6023. smalltalk.addMethod(
  6024. '_scrollLeft_',
  6025. smalltalk.method({
  6026. selector: 'scrollLeft:',
  6027. category: 'css',
  6028. fn: function (anInteger){
  6029. var self=this;
  6030. self._call_withArgument_("scrollLeft",anInteger);
  6031. return self;},
  6032. source: unescape('scrollLeft%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27scrollLeft%27%20withArgument%3A%20anInteger%0A')}),
  6033. smalltalk.JQuery);
  6034. smalltalk.addMethod(
  6035. '_scrollTop_',
  6036. smalltalk.method({
  6037. selector: 'scrollTop:',
  6038. category: 'css',
  6039. fn: function (anInteger){
  6040. var self=this;
  6041. self._call_withArgument_("scrollTop",anInteger);
  6042. return self;},
  6043. source: unescape('scrollTop%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27scrollTop%27%20withArgument%3A%20anInteger%0A')}),
  6044. smalltalk.JQuery);
  6045. smalltalk.addMethod(
  6046. '_focus',
  6047. smalltalk.method({
  6048. selector: 'focus',
  6049. category: 'events',
  6050. fn: function (){
  6051. var self=this;
  6052. self._call_("focus");
  6053. return self;},
  6054. source: unescape('focus%0A%20%20%20%20self%20call%3A%20%27focus%27%0A')}),
  6055. smalltalk.JQuery);
  6056. smalltalk.addMethod(
  6057. '_show',
  6058. smalltalk.method({
  6059. selector: 'show',
  6060. category: 'events',
  6061. fn: function (){
  6062. var self=this;
  6063. self._call_("show");
  6064. return self;},
  6065. source: unescape('show%0A%20%20%20%20self%20call%3A%20%27show%27%0A')}),
  6066. smalltalk.JQuery);
  6067. smalltalk.addMethod(
  6068. '_hide',
  6069. smalltalk.method({
  6070. selector: 'hide',
  6071. category: 'events',
  6072. fn: function (){
  6073. var self=this;
  6074. self._call_("hide");
  6075. return self;},
  6076. source: unescape('hide%0A%20%20%20%20self%20call%3A%20%27hide%27%0A')}),
  6077. smalltalk.JQuery);
  6078. smalltalk.addMethod(
  6079. '_remove',
  6080. smalltalk.method({
  6081. selector: 'remove',
  6082. category: 'events',
  6083. fn: function (){
  6084. var self=this;
  6085. self._call_("remove");
  6086. return self;},
  6087. source: unescape('remove%0A%20%20%20%20self%20call%3A%20%27remove%27%0A')}),
  6088. smalltalk.JQuery);
  6089. smalltalk.addMethod(
  6090. '_on_do_',
  6091. smalltalk.method({
  6092. selector: 'on:do:',
  6093. category: 'events',
  6094. fn: function (anEventString, aBlock){
  6095. var self=this;
  6096. (function(){self['@jquery'].bind(anEventString, function(e){aBlock(self)})})();
  6097. return self;},
  6098. source: unescape('on%3A%20anEventString%20do%3A%20aBlock%0A%20%20%20%20%22Attach%20aBlock%20for%20anEventString%20on%20the%20element%22%0A%20%20%20%20%7B%27self%5B%27%27@jquery%27%27%5D.bind%28anEventString%2C%20function%28e%29%7BaBlock%28self%29%7D%29%27%7D%0A')}),
  6099. smalltalk.JQuery);
  6100. smalltalk.addMethod(
  6101. '_removeEvents_',
  6102. smalltalk.method({
  6103. selector: 'removeEvents:',
  6104. category: 'events',
  6105. fn: function (aString){
  6106. var self=this;
  6107. self._call_withArgument_("unbind",aString);
  6108. return self;},
  6109. 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')}),
  6110. smalltalk.JQuery);
  6111. smalltalk.addMethod(
  6112. '_append_',
  6113. smalltalk.method({
  6114. selector: 'append:',
  6115. category: 'DOM insertion',
  6116. fn: function (anObject){
  6117. var self=this;
  6118. anObject._appendToJQuery_(self);
  6119. return self;},
  6120. 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')}),
  6121. smalltalk.JQuery);
  6122. smalltalk.addMethod(
  6123. '_appendElement_',
  6124. smalltalk.method({
  6125. selector: 'appendElement:',
  6126. category: 'DOM insertion',
  6127. fn: function (anElement){
  6128. var self=this;
  6129. self._call_withArgument_("append",anElement);
  6130. return self;},
  6131. 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')}),
  6132. smalltalk.JQuery);
  6133. smalltalk.addMethod(
  6134. '_appendToJQuery_',
  6135. smalltalk.method({
  6136. selector: 'appendToJQuery:',
  6137. category: 'DOM insertion',
  6138. fn: function (aJQuery){
  6139. var self=this;
  6140. aJQuery._appendElement_(self['@jquery']);
  6141. return self;},
  6142. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20aJQuery%20appendElement%3A%20jquery%0A')}),
  6143. smalltalk.JQuery);
  6144. smalltalk.addMethod(
  6145. '_contents_',
  6146. smalltalk.method({
  6147. selector: 'contents:',
  6148. category: 'DOM insertion',
  6149. fn: function (anObject){
  6150. var self=this;
  6151. self._empty();
  6152. self._append_(anObject);
  6153. return self;},
  6154. source: unescape('contents%3A%20anObject%0A%20%20%20%20self%20empty.%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  6155. smalltalk.JQuery);
  6156. smalltalk.addMethod(
  6157. '_empty',
  6158. smalltalk.method({
  6159. selector: 'empty',
  6160. category: 'DOM insertion',
  6161. fn: function (){
  6162. var self=this;
  6163. self._call_("empty");
  6164. return self;},
  6165. source: unescape('empty%0A%20%20%20%20self%20call%3A%20%27empty%27%0A')}),
  6166. smalltalk.JQuery);
  6167. smalltalk.addMethod(
  6168. '_initializeWithJQueryObject_',
  6169. smalltalk.method({
  6170. selector: 'initializeWithJQueryObject:',
  6171. category: 'initialization',
  6172. fn: function (anObject){
  6173. var self=this;
  6174. self['@jquery']=anObject;
  6175. return self;},
  6176. source: unescape('initializeWithJQueryObject%3A%20anObject%0A%20%20%20%20jquery%20%3A%3D%20anObject%0A')}),
  6177. smalltalk.JQuery);
  6178. smalltalk.addMethod(
  6179. '_call_',
  6180. smalltalk.method({
  6181. selector: 'call:',
  6182. category: 'private',
  6183. fn: function (aString){
  6184. var self=this;
  6185. return (function(){return self['@jquery'][aString]()})();
  6186. return self;},
  6187. 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')}),
  6188. smalltalk.JQuery);
  6189. smalltalk.addMethod(
  6190. '_call_withArgument_',
  6191. smalltalk.method({
  6192. selector: 'call:withArgument:',
  6193. category: 'private',
  6194. fn: function (aString, anObject){
  6195. var self=this;
  6196. return (function(){return self['@jquery'][aString](anObject)})();
  6197. return self;},
  6198. 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')}),
  6199. smalltalk.JQuery);
  6200. smalltalk.addMethod(
  6201. '_hasClass_',
  6202. smalltalk.method({
  6203. selector: 'hasClass:',
  6204. category: 'testing',
  6205. fn: function (aString){
  6206. var self=this;
  6207. return self._call_withArgument_("hasClass",aString);
  6208. return self;},
  6209. 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')}),
  6210. smalltalk.JQuery);
  6211. smalltalk.addMethod(
  6212. '_fromString_',
  6213. smalltalk.method({
  6214. selector: 'fromString:',
  6215. category: 'instance creation',
  6216. fn: function (aString){
  6217. var self=this;
  6218. var newJQuery=nil;
  6219. (function(){newJQuery = jQuery(String(aString))})();
  6220. return self._from_(newJQuery);
  6221. return self;},
  6222. 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')}),
  6223. smalltalk.JQuery.klass);
  6224. smalltalk.addMethod(
  6225. '_from_',
  6226. smalltalk.method({
  6227. selector: 'from:',
  6228. category: 'instance creation',
  6229. fn: function (anObject){
  6230. var self=this;
  6231. return (function($rec){$rec._initializeWithJQueryObject_(anObject);return $rec._yourself();})(self._new());
  6232. return self;},
  6233. source: unescape('from%3A%20anObject%0A%20%20%20%20%5Eself%20new%0A%09initializeWithJQueryObject%3A%20anObject%3B%0A%09yourself%0A')}),
  6234. smalltalk.JQuery.klass);
  6235. smalltalk.addClass('Ajax', smalltalk.Object, ['settings'], 'JQuery');
  6236. smalltalk.Ajax.comment=unescape('instance%20variable%20names%3A%0A-%20settings%20%20A%20set%20of%20key/value%20pairs%20that%20configure%20the%20Ajax%20request.%20All%20settings%20are%20optional.%0A%0AFull%20list%20of%20settings%20options%20at%20http%3A//api.jquery.com/jQuery.ajax/%0A')
  6237. smalltalk.addMethod(
  6238. '_initialize',
  6239. smalltalk.method({
  6240. selector: 'initialize',
  6241. category: 'initialization',
  6242. fn: function (){
  6243. var self=this;
  6244. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  6245. self['@settings']=smalltalk.Dictionary._new();
  6246. return self;},
  6247. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20settings%20%3A%3D%20Dictionary%20new%0A')}),
  6248. smalltalk.Ajax);
  6249. smalltalk.addMethod(
  6250. '_at_',
  6251. smalltalk.method({
  6252. selector: 'at:',
  6253. category: 'accessing',
  6254. fn: function (aKey){
  6255. var self=this;
  6256. return self['@settings']._at_ifAbsent_(aKey,(function(){return nil;}));
  6257. return self;},
  6258. source: unescape('at%3A%20aKey%0A%20%20%20%20%5Esettings%20at%3A%20aKey%20ifAbsent%3A%20%5Bnil%5D%0A')}),
  6259. smalltalk.Ajax);
  6260. smalltalk.addMethod(
  6261. '_at_put_',
  6262. smalltalk.method({
  6263. selector: 'at:put:',
  6264. category: 'accessing',
  6265. fn: function (aKey, aValue){
  6266. var self=this;
  6267. self['@settings']._at_put_(aKey,aValue);
  6268. return self;},
  6269. source: unescape('at%3A%20aKey%20put%3A%20aValue%0A%20%20%20%20settings%20at%3A%20aKey%20put%3A%20aValue%0A')}),
  6270. smalltalk.Ajax);
  6271. smalltalk.addMethod(
  6272. '_url',
  6273. smalltalk.method({
  6274. selector: 'url',
  6275. category: 'accessing',
  6276. fn: function (){
  6277. var self=this;
  6278. return self._at_("url");
  6279. return self;},
  6280. source: unescape('url%0A%20%20%20%20%5Eself%20at%3A%20%27url%27%0A')}),
  6281. smalltalk.Ajax);
  6282. smalltalk.addMethod(
  6283. '_url_',
  6284. smalltalk.method({
  6285. selector: 'url:',
  6286. category: 'accessing',
  6287. fn: function (aString){
  6288. var self=this;
  6289. self._at_put_("url",aString);
  6290. return self;},
  6291. source: unescape('url%3A%20aString%0A%20%20%20%20self%20at%3A%20%27url%27%20put%3A%20aString%0A')}),
  6292. smalltalk.Ajax);
  6293. smalltalk.addMethod(
  6294. '_send',
  6295. smalltalk.method({
  6296. selector: 'send',
  6297. category: 'actions',
  6298. fn: function (){
  6299. var self=this;
  6300. (function(){jQuery.ajax(self['@settings'])})();
  6301. return self;},
  6302. source: unescape('send%0A%20%20%20%20%7B%27jQuery.ajax%28self%5B%27%27@settings%27%27%5D%29%27%7D%0A')}),
  6303. smalltalk.Ajax);
  6304. smalltalk.addMethod(
  6305. '_url_',
  6306. smalltalk.method({
  6307. selector: 'url:',
  6308. category: 'instance creation',
  6309. fn: function (aString){
  6310. var self=this;
  6311. return (function($rec){$rec._url_(aString);return $rec._yourself();})(self._new());
  6312. return self;},
  6313. source: unescape('url%3A%20aString%0A%20%20%20%20%5Eself%20new%0A%09url%3A%20aString%3B%0A%09yourself%0A')}),
  6314. smalltalk.Ajax.klass);
  6315. smalltalk.addClass('HTMLCanvas', smalltalk.Object, ['root'], 'Canvas');
  6316. smalltalk.addMethod(
  6317. '_root_',
  6318. smalltalk.method({
  6319. selector: 'root:',
  6320. category: 'accessing',
  6321. fn: function (aTagBrush){
  6322. var self=this;
  6323. self['@root']=aTagBrush;
  6324. return self;},
  6325. source: unescape('root%3A%20aTagBrush%0A%20%20%20%20root%20%3A%3D%20aTagBrush%0A')}),
  6326. smalltalk.HTMLCanvas);
  6327. smalltalk.addMethod(
  6328. '_root',
  6329. smalltalk.method({
  6330. selector: 'root',
  6331. category: 'accessing',
  6332. fn: function (){
  6333. var self=this;
  6334. return self['@root'];
  6335. return self;},
  6336. source: unescape('root%0A%20%20%20%20%5Eroot%0A')}),
  6337. smalltalk.HTMLCanvas);
  6338. smalltalk.addMethod(
  6339. '_initialize',
  6340. smalltalk.method({
  6341. selector: 'initialize',
  6342. category: 'initialization',
  6343. fn: function (){
  6344. var self=this;
  6345. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  6346. self['@root']=smalltalk.TagBrush._fromString_canvas_("div",self);
  6347. return self;},
  6348. 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')}),
  6349. smalltalk.HTMLCanvas);
  6350. smalltalk.addMethod(
  6351. '_with_',
  6352. smalltalk.method({
  6353. selector: 'with:',
  6354. category: 'adding',
  6355. fn: function (anObject){
  6356. var self=this;
  6357. return self._root()._with_(anObject);
  6358. return self;},
  6359. source: unescape('with%3A%20anObject%0A%20%20%20%20%5Eself%20root%20with%3A%20anObject%0A')}),
  6360. smalltalk.HTMLCanvas);
  6361. smalltalk.addMethod(
  6362. '_newTag_',
  6363. smalltalk.method({
  6364. selector: 'newTag:',
  6365. category: 'tags',
  6366. fn: function (aString){
  6367. var self=this;
  6368. return smalltalk.TagBrush._fromString_canvas_(aString,self);
  6369. return self;},
  6370. source: unescape('newTag%3A%20aString%0A%20%20%20%20%5ETagBrush%20fromString%3A%20aString%20canvas%3A%20self%0A')}),
  6371. smalltalk.HTMLCanvas);
  6372. smalltalk.addMethod(
  6373. '_tag_',
  6374. smalltalk.method({
  6375. selector: 'tag:',
  6376. category: 'tags',
  6377. fn: function (aString){
  6378. var self=this;
  6379. return self['@root']._addBrush_(self._newTag_(aString));
  6380. return self;},
  6381. source: unescape('tag%3A%20aString%0A%20%20%20%20%5Eroot%20addBrush%3A%20%28self%20newTag%3A%20aString%29%0A')}),
  6382. smalltalk.HTMLCanvas);
  6383. smalltalk.addMethod(
  6384. '_h1',
  6385. smalltalk.method({
  6386. selector: 'h1',
  6387. category: 'tags',
  6388. fn: function (){
  6389. var self=this;
  6390. return self._tag_("h1");
  6391. return self;},
  6392. source: unescape('h1%0A%20%20%20%20%5Eself%20tag%3A%20%27h1%27%0A')}),
  6393. smalltalk.HTMLCanvas);
  6394. smalltalk.addMethod(
  6395. '_h2',
  6396. smalltalk.method({
  6397. selector: 'h2',
  6398. category: 'tags',
  6399. fn: function (){
  6400. var self=this;
  6401. return self._tag_("h2");
  6402. return self;},
  6403. source: unescape('h2%0A%20%20%20%20%5Eself%20tag%3A%20%27h2%27%0A')}),
  6404. smalltalk.HTMLCanvas);
  6405. smalltalk.addMethod(
  6406. '_h3',
  6407. smalltalk.method({
  6408. selector: 'h3',
  6409. category: 'tags',
  6410. fn: function (){
  6411. var self=this;
  6412. return self._tag_("h3");
  6413. return self;},
  6414. source: unescape('h3%0A%20%20%20%20%5Eself%20tag%3A%20%27h3%27%0A')}),
  6415. smalltalk.HTMLCanvas);
  6416. smalltalk.addMethod(
  6417. '_h4',
  6418. smalltalk.method({
  6419. selector: 'h4',
  6420. category: 'tags',
  6421. fn: function (){
  6422. var self=this;
  6423. return self._tag_("h4");
  6424. return self;},
  6425. source: unescape('h4%0A%20%20%20%20%5Eself%20tag%3A%20%27h4%27%0A')}),
  6426. smalltalk.HTMLCanvas);
  6427. smalltalk.addMethod(
  6428. '_h5',
  6429. smalltalk.method({
  6430. selector: 'h5',
  6431. category: 'tags',
  6432. fn: function (){
  6433. var self=this;
  6434. return self._tag_("h5");
  6435. return self;},
  6436. source: unescape('h5%0A%20%20%20%20%5Eself%20tag%3A%20%27h5%27%0A')}),
  6437. smalltalk.HTMLCanvas);
  6438. smalltalk.addMethod(
  6439. '_h6',
  6440. smalltalk.method({
  6441. selector: 'h6',
  6442. category: 'tags',
  6443. fn: function (){
  6444. var self=this;
  6445. return self._tag_("h6");
  6446. return self;},
  6447. source: unescape('h6%0A%20%20%20%20%5Eself%20tag%3A%20%27h6%27%0A')}),
  6448. smalltalk.HTMLCanvas);
  6449. smalltalk.addMethod(
  6450. '_p',
  6451. smalltalk.method({
  6452. selector: 'p',
  6453. category: 'tags',
  6454. fn: function (){
  6455. var self=this;
  6456. return self._tag_("p");
  6457. return self;},
  6458. source: unescape('p%0A%20%20%20%20%5Eself%20tag%3A%20%27p%27%0A')}),
  6459. smalltalk.HTMLCanvas);
  6460. smalltalk.addMethod(
  6461. '_div',
  6462. smalltalk.method({
  6463. selector: 'div',
  6464. category: 'tags',
  6465. fn: function (){
  6466. var self=this;
  6467. return self._tag_("div");
  6468. return self;},
  6469. source: unescape('div%0A%20%20%20%20%5Eself%20tag%3A%20%27div%27%0A')}),
  6470. smalltalk.HTMLCanvas);
  6471. smalltalk.addMethod(
  6472. '_span',
  6473. smalltalk.method({
  6474. selector: 'span',
  6475. category: 'tags',
  6476. fn: function (){
  6477. var self=this;
  6478. return self._tag_("span");
  6479. return self;},
  6480. source: unescape('span%0A%20%20%20%20%5Eself%20tag%3A%20%27span%27%0A')}),
  6481. smalltalk.HTMLCanvas);
  6482. smalltalk.addMethod(
  6483. '_img',
  6484. smalltalk.method({
  6485. selector: 'img',
  6486. category: 'tags',
  6487. fn: function (){
  6488. var self=this;
  6489. return self._tag_("img");
  6490. return self;},
  6491. source: unescape('img%0A%20%20%20%20%5Eself%20tag%3A%20%27img%27%0A')}),
  6492. smalltalk.HTMLCanvas);
  6493. smalltalk.addMethod(
  6494. '_ul',
  6495. smalltalk.method({
  6496. selector: 'ul',
  6497. category: 'tags',
  6498. fn: function (){
  6499. var self=this;
  6500. return self._tag_("ul");
  6501. return self;},
  6502. source: unescape('ul%0A%20%20%20%20%5Eself%20tag%3A%20%27ul%27%0A')}),
  6503. smalltalk.HTMLCanvas);
  6504. smalltalk.addMethod(
  6505. '_ol',
  6506. smalltalk.method({
  6507. selector: 'ol',
  6508. category: 'tags',
  6509. fn: function (){
  6510. var self=this;
  6511. return self._tag_("ol");
  6512. return self;},
  6513. source: unescape('ol%0A%20%20%20%20%5Eself%20tag%3A%20%27ol%27%0A')}),
  6514. smalltalk.HTMLCanvas);
  6515. smalltalk.addMethod(
  6516. '_li',
  6517. smalltalk.method({
  6518. selector: 'li',
  6519. category: 'tags',
  6520. fn: function (){
  6521. var self=this;
  6522. return self._tag_("li");
  6523. return self;},
  6524. source: unescape('li%0A%20%20%20%20%5Eself%20tag%3A%20%27li%27%0A')}),
  6525. smalltalk.HTMLCanvas);
  6526. smalltalk.addMethod(
  6527. '_table',
  6528. smalltalk.method({
  6529. selector: 'table',
  6530. category: 'tags',
  6531. fn: function (){
  6532. var self=this;
  6533. return self._tag_("table");
  6534. return self;},
  6535. source: unescape('table%0A%20%20%20%20%5Eself%20tag%3A%20%27table%27%0A')}),
  6536. smalltalk.HTMLCanvas);
  6537. smalltalk.addMethod(
  6538. '_tr',
  6539. smalltalk.method({
  6540. selector: 'tr',
  6541. category: 'tags',
  6542. fn: function (){
  6543. var self=this;
  6544. return self._tag_("tr");
  6545. return self;},
  6546. source: unescape('tr%0A%20%20%20%20%5Eself%20tag%3A%20%27tr%27%0A')}),
  6547. smalltalk.HTMLCanvas);
  6548. smalltalk.addMethod(
  6549. '_td',
  6550. smalltalk.method({
  6551. selector: 'td',
  6552. category: 'tags',
  6553. fn: function (){
  6554. var self=this;
  6555. return self._tag_("td");
  6556. return self;},
  6557. source: unescape('td%20%0A%20%20%20%20%5Eself%20tag%3A%20%27td%27%0A')}),
  6558. smalltalk.HTMLCanvas);
  6559. smalltalk.addMethod(
  6560. '_th',
  6561. smalltalk.method({
  6562. selector: 'th',
  6563. category: 'tags',
  6564. fn: function (){
  6565. var self=this;
  6566. return self._tag_("th");
  6567. return self;},
  6568. source: unescape('th%0A%20%20%20%20%5Eself%20tag%3A%20%27th%27%0A')}),
  6569. smalltalk.HTMLCanvas);
  6570. smalltalk.addMethod(
  6571. '_form',
  6572. smalltalk.method({
  6573. selector: 'form',
  6574. category: 'tags',
  6575. fn: function (){
  6576. var self=this;
  6577. return self._tag_("form");
  6578. return self;},
  6579. source: unescape('form%0A%20%20%20%20%5Eself%20tag%3A%20%27form%27%0A')}),
  6580. smalltalk.HTMLCanvas);
  6581. smalltalk.addMethod(
  6582. '_input',
  6583. smalltalk.method({
  6584. selector: 'input',
  6585. category: 'tags',
  6586. fn: function (){
  6587. var self=this;
  6588. return self._tag_("input");
  6589. return self;},
  6590. source: unescape('input%0A%20%20%20%20%5Eself%20tag%3A%20%27input%27%0A')}),
  6591. smalltalk.HTMLCanvas);
  6592. smalltalk.addMethod(
  6593. '_button',
  6594. smalltalk.method({
  6595. selector: 'button',
  6596. category: 'tags',
  6597. fn: function (){
  6598. var self=this;
  6599. return self._tag_("button");
  6600. return self;},
  6601. source: unescape('button%0A%20%20%20%20%5Eself%20tag%3A%20%27button%27%0A')}),
  6602. smalltalk.HTMLCanvas);
  6603. smalltalk.addMethod(
  6604. '_select',
  6605. smalltalk.method({
  6606. selector: 'select',
  6607. category: 'tags',
  6608. fn: function (){
  6609. var self=this;
  6610. return self._tag_("select");
  6611. return self;},
  6612. source: unescape('select%0A%20%20%20%20%5Eself%20tag%3A%20%27select%27%0A')}),
  6613. smalltalk.HTMLCanvas);
  6614. smalltalk.addMethod(
  6615. '_option',
  6616. smalltalk.method({
  6617. selector: 'option',
  6618. category: 'tags',
  6619. fn: function (){
  6620. var self=this;
  6621. return self._tag_("option");
  6622. return self;},
  6623. source: unescape('option%0A%20%20%20%20%5Eself%20tag%3A%20%27option%27%0A')}),
  6624. smalltalk.HTMLCanvas);
  6625. smalltalk.addMethod(
  6626. '_textarea',
  6627. smalltalk.method({
  6628. selector: 'textarea',
  6629. category: 'tags',
  6630. fn: function (){
  6631. var self=this;
  6632. return self._tag_("textarea");
  6633. return self;},
  6634. source: unescape('textarea%0A%20%20%20%20%5Eself%20tag%3A%20%27textarea%27%0A')}),
  6635. smalltalk.HTMLCanvas);
  6636. smalltalk.addMethod(
  6637. '_a',
  6638. smalltalk.method({
  6639. selector: 'a',
  6640. category: 'tags',
  6641. fn: function (){
  6642. var self=this;
  6643. return self._tag_("a");
  6644. return self;},
  6645. source: unescape('a%0A%20%20%20%20%5Eself%20tag%3A%20%27a%27%0A')}),
  6646. smalltalk.HTMLCanvas);
  6647. smalltalk.addMethod(
  6648. '_appendToJQuery_',
  6649. smalltalk.method({
  6650. selector: 'appendToJQuery:',
  6651. category: '*JQuery',
  6652. fn: function (aJQuery){
  6653. var self=this;
  6654. aJQuery._appendElement_(self['@root']._element());
  6655. return self;},
  6656. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20aJQuery%20appendElement%3A%20root%20element%0A')}),
  6657. smalltalk.HTMLCanvas);
  6658. smalltalk.addClass('TagBrush', smalltalk.Object, ['element'], 'Canvas');
  6659. smalltalk.addMethod(
  6660. '_contents_',
  6661. smalltalk.method({
  6662. selector: 'contents:',
  6663. category: 'adding',
  6664. fn: function (anObject){
  6665. var self=this;
  6666. self._asJQuery()._empty();
  6667. self._append_(anObject);
  6668. return self;},
  6669. source: unescape('contents%3A%20anObject%0A%20%20%20%20self%20asJQuery%20empty.%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  6670. smalltalk.TagBrush);
  6671. smalltalk.addMethod(
  6672. '_addBrush_',
  6673. smalltalk.method({
  6674. selector: 'addBrush:',
  6675. category: 'adding',
  6676. fn: function (aTagBrush){
  6677. var self=this;
  6678. self._appendChild_(aTagBrush._element());
  6679. return aTagBrush;
  6680. return self;},
  6681. source: unescape('addBrush%3A%20aTagBrush%0A%20%20%20%20self%20appendChild%3A%20aTagBrush%20element.%0A%20%20%20%20%5EaTagBrush%0A')}),
  6682. smalltalk.TagBrush);
  6683. smalltalk.addMethod(
  6684. '_with_',
  6685. smalltalk.method({
  6686. selector: 'with:',
  6687. category: 'adding',
  6688. fn: function (anObject){
  6689. var self=this;
  6690. self._append_(anObject);
  6691. return self;},
  6692. source: unescape('with%3A%20anObject%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  6693. smalltalk.TagBrush);
  6694. smalltalk.addMethod(
  6695. '_append_',
  6696. smalltalk.method({
  6697. selector: 'append:',
  6698. category: 'adding',
  6699. fn: function (anObject){
  6700. var self=this;
  6701. anObject._appendToBrush_(self);
  6702. return self;},
  6703. source: unescape('append%3A%20anObject%0A%20%20%20%20anObject%20appendToBrush%3A%20self%0A')}),
  6704. smalltalk.TagBrush);
  6705. smalltalk.addMethod(
  6706. '_appendToBrush_',
  6707. smalltalk.method({
  6708. selector: 'appendToBrush:',
  6709. category: 'adding',
  6710. fn: function (aTagBrush){
  6711. var self=this;
  6712. aTagBrush._addBrush_(self);
  6713. return self;},
  6714. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20aTagBrush%20addBrush%3A%20self%0A')}),
  6715. smalltalk.TagBrush);
  6716. smalltalk.addMethod(
  6717. '_appendBlock_',
  6718. smalltalk.method({
  6719. selector: 'appendBlock:',
  6720. category: 'adding',
  6721. fn: function (aBlock){
  6722. var self=this;
  6723. var root=nil;
  6724. root=canvas._root();
  6725. canvas._root_(self);
  6726. aBlock._value_(canvas);
  6727. canvas._root_(root);
  6728. return self;},
  6729. 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')}),
  6730. smalltalk.TagBrush);
  6731. smalltalk.addMethod(
  6732. '_appendChild_',
  6733. smalltalk.method({
  6734. selector: 'appendChild:',
  6735. category: 'adding',
  6736. fn: function (anElement){
  6737. var self=this;
  6738. (function(){self['@element'].appendChild(anElement)})();
  6739. return self;},
  6740. 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')}),
  6741. smalltalk.TagBrush);
  6742. smalltalk.addMethod(
  6743. '_appendString_',
  6744. smalltalk.method({
  6745. selector: 'appendString:',
  6746. category: 'adding',
  6747. fn: function (aString){
  6748. var self=this;
  6749. self._appendChild_(self._createTextNodeFor_(aString));
  6750. return self;},
  6751. source: unescape('appendString%3A%20aString%0A%20%20%20%20self%20appendChild%3A%20%28self%20createTextNodeFor%3A%20aString%29%0A')}),
  6752. smalltalk.TagBrush);
  6753. smalltalk.addMethod(
  6754. '_at_put_',
  6755. smalltalk.method({
  6756. selector: 'at:put:',
  6757. category: 'attributes',
  6758. fn: function (aString, aValue){
  6759. var self=this;
  6760. (function(){self['@element'].setAttribute(aString, aValue)})();
  6761. return self;},
  6762. 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')}),
  6763. smalltalk.TagBrush);
  6764. smalltalk.addMethod(
  6765. '_removeAt_',
  6766. smalltalk.method({
  6767. selector: 'removeAt:',
  6768. category: 'attributes',
  6769. fn: function (aString){
  6770. var self=this;
  6771. (function(){self['@element'].removeAttribute(aString)})();
  6772. return self;},
  6773. 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')}),
  6774. smalltalk.TagBrush);
  6775. smalltalk.addMethod(
  6776. '_class_',
  6777. smalltalk.method({
  6778. selector: 'class:',
  6779. category: 'attributes',
  6780. fn: function (aString){
  6781. var self=this;
  6782. self._at_put_("class",aString);
  6783. return self;},
  6784. source: unescape('class%3A%20aString%0A%20%20%20%20self%20at%3A%20%27class%27%20put%3A%20aString%0A')}),
  6785. smalltalk.TagBrush);
  6786. smalltalk.addMethod(
  6787. '_id_',
  6788. smalltalk.method({
  6789. selector: 'id:',
  6790. category: 'attributes',
  6791. fn: function (aString){
  6792. var self=this;
  6793. self._at_put_("id",aString);
  6794. return self;},
  6795. source: unescape('id%3A%20aString%0A%20%20%20%20self%20at%3A%20%27id%27%20put%3A%20aString%0A')}),
  6796. smalltalk.TagBrush);
  6797. smalltalk.addMethod(
  6798. '_src_',
  6799. smalltalk.method({
  6800. selector: 'src:',
  6801. category: 'attributes',
  6802. fn: function (aString){
  6803. var self=this;
  6804. self._at_put_("src",aString);
  6805. return self;},
  6806. source: unescape('src%3A%20aString%0A%20%20%20%20self%20%20at%3A%20%27src%27%20put%3A%20aString%0A')}),
  6807. smalltalk.TagBrush);
  6808. smalltalk.addMethod(
  6809. '_href_',
  6810. smalltalk.method({
  6811. selector: 'href:',
  6812. category: 'attributes',
  6813. fn: function (aString){
  6814. var self=this;
  6815. self._at_put_("href",aString);
  6816. return self;},
  6817. source: unescape('href%3A%20aString%0A%20%20%20%20self%20at%3A%20%27href%27%20put%3A%20aString%0A')}),
  6818. smalltalk.TagBrush);
  6819. smalltalk.addMethod(
  6820. '_title_',
  6821. smalltalk.method({
  6822. selector: 'title:',
  6823. category: 'attributes',
  6824. fn: function (aString){
  6825. var self=this;
  6826. self._at_put_("title",aString);
  6827. return self;},
  6828. source: unescape('title%3A%20aString%0A%20%20%20%20self%20at%3A%20%27title%27%20put%3A%20aString%0A')}),
  6829. smalltalk.TagBrush);
  6830. smalltalk.addMethod(
  6831. '_style_',
  6832. smalltalk.method({
  6833. selector: 'style:',
  6834. category: 'attributes',
  6835. fn: function (aString){
  6836. var self=this;
  6837. self._at_put_("style",aString);
  6838. return self;},
  6839. source: unescape('style%3A%20aString%0A%20%20%20%20self%20at%3A%20%27style%27%20put%3A%20aString%0A')}),
  6840. smalltalk.TagBrush);
  6841. smalltalk.addMethod(
  6842. '_initializeFromString_canvas_',
  6843. smalltalk.method({
  6844. selector: 'initializeFromString:canvas:',
  6845. category: 'initialization',
  6846. fn: function (aString, aCanvas){
  6847. var self=this;
  6848. self['@element']=self._createElementFor_(aString);
  6849. canvas=aCanvas;
  6850. return self;},
  6851. 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')}),
  6852. smalltalk.TagBrush);
  6853. smalltalk.addMethod(
  6854. '_element',
  6855. smalltalk.method({
  6856. selector: 'element',
  6857. category: 'accessing',
  6858. fn: function (){
  6859. var self=this;
  6860. return self['@element'];
  6861. return self;},
  6862. source: unescape('element%0A%20%20%20%20%5Eelement%0A')}),
  6863. smalltalk.TagBrush);
  6864. smalltalk.addMethod(
  6865. '_asJQuery',
  6866. smalltalk.method({
  6867. selector: 'asJQuery',
  6868. category: 'converting',
  6869. fn: function (){
  6870. var self=this;
  6871. return (function(){return smalltalk.JQuery._from_(jQuery(self['@element']))})();
  6872. return self;},
  6873. 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')}),
  6874. smalltalk.TagBrush);
  6875. smalltalk.addMethod(
  6876. '_asJQueryDo_',
  6877. smalltalk.method({
  6878. selector: 'asJQueryDo:',
  6879. category: 'converting',
  6880. fn: function (aBlock){
  6881. var self=this;
  6882. aBlock._value_(self._asJQuery());
  6883. return self;},
  6884. source: unescape('asJQueryDo%3A%20aBlock%0A%20%20%20%20aBlock%20value%3A%20self%20asJQuery%0A')}),
  6885. smalltalk.TagBrush);
  6886. smalltalk.addMethod(
  6887. '_onKeyDown_',
  6888. smalltalk.method({
  6889. selector: 'onKeyDown:',
  6890. category: 'events',
  6891. fn: function (aBlock){
  6892. var self=this;
  6893. self._asJQuery()._on_do_("keydown",aBlock);
  6894. return self;},
  6895. source: unescape('onKeyDown%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keydown%27%20do%3A%20aBlock%0A')}),
  6896. smalltalk.TagBrush);
  6897. smalltalk.addMethod(
  6898. '_onKeyPress_',
  6899. smalltalk.method({
  6900. selector: 'onKeyPress:',
  6901. category: 'events',
  6902. fn: function (aBlock){
  6903. var self=this;
  6904. self._asJQuery()._on_do_("keypress",aBlock);
  6905. return self;},
  6906. source: unescape('onKeyPress%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keypress%27%20do%3A%20aBlock%0A')}),
  6907. smalltalk.TagBrush);
  6908. smalltalk.addMethod(
  6909. '_onKeyUp_',
  6910. smalltalk.method({
  6911. selector: 'onKeyUp:',
  6912. category: 'events',
  6913. fn: function (aBlock){
  6914. var self=this;
  6915. self._asJQuery()._on_do_("keyup",aBlock);
  6916. return self;},
  6917. source: unescape('onKeyUp%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keyup%27%20do%3A%20aBlock%0A')}),
  6918. smalltalk.TagBrush);
  6919. smalltalk.addMethod(
  6920. '_onFocus_',
  6921. smalltalk.method({
  6922. selector: 'onFocus:',
  6923. category: 'events',
  6924. fn: function (aBlock){
  6925. var self=this;
  6926. self._asJQuery()._on_do_("focus",aBlock);
  6927. return self;},
  6928. source: unescape('onFocus%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27focus%27%20do%3A%20aBlock%0A')}),
  6929. smalltalk.TagBrush);
  6930. smalltalk.addMethod(
  6931. '_onBlur_',
  6932. smalltalk.method({
  6933. selector: 'onBlur:',
  6934. category: 'events',
  6935. fn: function (aBlock){
  6936. var self=this;
  6937. self._asJQuery()._on_do_("blur",aBlock);
  6938. return self;},
  6939. source: unescape('onBlur%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27blur%27%20do%3A%20aBlock%0A')}),
  6940. smalltalk.TagBrush);
  6941. smalltalk.addMethod(
  6942. '_onChange_',
  6943. smalltalk.method({
  6944. selector: 'onChange:',
  6945. category: 'events',
  6946. fn: function (aBlock){
  6947. var self=this;
  6948. self._asJQuery()._on_do_("change",aBlock);
  6949. return self;},
  6950. source: unescape('onChange%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27change%27%20do%3A%20aBlock%0A')}),
  6951. smalltalk.TagBrush);
  6952. smalltalk.addMethod(
  6953. '_onClick_',
  6954. smalltalk.method({
  6955. selector: 'onClick:',
  6956. category: 'events',
  6957. fn: function (aBlock){
  6958. var self=this;
  6959. self._asJQuery()._on_do_("click",aBlock);
  6960. return self;},
  6961. source: unescape('onClick%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27click%27%20do%3A%20aBlock%0A')}),
  6962. smalltalk.TagBrush);
  6963. smalltalk.addMethod(
  6964. '_createElementFor_',
  6965. smalltalk.method({
  6966. selector: 'createElementFor:',
  6967. category: 'private',
  6968. fn: function (aString){
  6969. var self=this;
  6970. return (function(){return document.createElement(String(aString))})();
  6971. return self;},
  6972. source: unescape('createElementFor%3A%20aString%0A%20%20%20%20%5E%7B%27return%20document.createElement%28String%28aString%29%29%27%7D%0A')}),
  6973. smalltalk.TagBrush);
  6974. smalltalk.addMethod(
  6975. '_createTextNodeFor_',
  6976. smalltalk.method({
  6977. selector: 'createTextNodeFor:',
  6978. category: 'private',
  6979. fn: function (aString){
  6980. var self=this;
  6981. return (function(){return document.createTextNode(String(aString))})();
  6982. return self;},
  6983. source: unescape('createTextNodeFor%3A%20aString%0A%20%20%20%20%5E%7B%27return%20document.createTextNode%28String%28aString%29%29%27%7D%0A')}),
  6984. smalltalk.TagBrush);
  6985. smalltalk.addMethod(
  6986. '_fromString_canvas_',
  6987. smalltalk.method({
  6988. selector: 'fromString:canvas:',
  6989. category: 'instance creation',
  6990. fn: function (aString, aCanvas){
  6991. var self=this;
  6992. return (function($rec){$rec._initializeFromString_canvas_(aString,aCanvas);return $rec._yourself();})(self._new());
  6993. return self;},
  6994. 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')}),
  6995. smalltalk.TagBrush.klass);
  6996. smalltalk.addClass('Widget', smalltalk.Object, ['root'], 'Canvas');
  6997. smalltalk.addMethod(
  6998. '_root',
  6999. smalltalk.method({
  7000. selector: 'root',
  7001. category: 'accessing',
  7002. fn: function (){
  7003. var self=this;
  7004. return self['@root'];
  7005. return self;},
  7006. source: unescape('root%0A%20%20%20%20%5Eroot%0A')}),
  7007. smalltalk.Widget);
  7008. smalltalk.addMethod(
  7009. '_appendToBrush_',
  7010. smalltalk.method({
  7011. selector: 'appendToBrush:',
  7012. category: 'adding',
  7013. fn: function (aTagBrush){
  7014. var self=this;
  7015. self._appendToJQuery_(aTagBrush._asJQuery());
  7016. return self;},
  7017. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20self%20appendToJQuery%3A%20aTagBrush%20asJQuery%0A')}),
  7018. smalltalk.Widget);
  7019. smalltalk.addMethod(
  7020. '_appendToJQuery_',
  7021. smalltalk.method({
  7022. selector: 'appendToJQuery:',
  7023. category: 'adding',
  7024. fn: function (aJQuery){
  7025. var self=this;
  7026. self._render();
  7027. aJQuery._append_(self._root()._asJQuery());
  7028. return self;},
  7029. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20self%20render.%0A%20%20%20%20aJQuery%20append%3A%20self%20root%20asJQuery%0A')}),
  7030. smalltalk.Widget);
  7031. smalltalk.addMethod(
  7032. '_alert_',
  7033. smalltalk.method({
  7034. selector: 'alert:',
  7035. category: 'actions',
  7036. fn: function (aString){
  7037. var self=this;
  7038. (function(){alert(aString)})();
  7039. return self;},
  7040. source: unescape('alert%3A%20aString%0A%20%20%20%20%7B%27alert%28aString%29%27%7D%0A')}),
  7041. smalltalk.Widget);
  7042. smalltalk.addMethod(
  7043. '_confirm_',
  7044. smalltalk.method({
  7045. selector: 'confirm:',
  7046. category: 'actions',
  7047. fn: function (aString){
  7048. var self=this;
  7049. return (function(){return window.confirm(aString)})();
  7050. return self;},
  7051. source: unescape('confirm%3A%20aString%0A%20%20%20%20%5E%7B%27return%20window.confirm%28aString%29%27%7D%0A')}),
  7052. smalltalk.Widget);
  7053. smalltalk.addMethod(
  7054. '_prompt_',
  7055. smalltalk.method({
  7056. selector: 'prompt:',
  7057. category: 'actions',
  7058. fn: function (aString){
  7059. var self=this;
  7060. return self._prompt_default_(aString,"");
  7061. return self;},
  7062. source: unescape('prompt%3A%20aString%0A%20%20%20%20%5Eself%20prompt%3A%20aString%20default%3A%20%27%27%0A')}),
  7063. smalltalk.Widget);
  7064. smalltalk.addMethod(
  7065. '_prompt_default_',
  7066. smalltalk.method({
  7067. selector: 'prompt:default:',
  7068. category: 'actions',
  7069. fn: function (aString, anotherString){
  7070. var self=this;
  7071. return (function(){return window.prompt(aString, anotherString)})();
  7072. return self;},
  7073. 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')}),
  7074. smalltalk.Widget);
  7075. smalltalk.addMethod(
  7076. '_update',
  7077. smalltalk.method({
  7078. selector: 'update',
  7079. category: 'actions',
  7080. fn: function (){
  7081. var self=this;
  7082. var canvas=nil;
  7083. canvas=smalltalk.HTMLCanvas._new();
  7084. canvas._root_(self._root());
  7085. self._root()._asJQuery()._empty();
  7086. self._renderOn_(canvas);
  7087. return self;},
  7088. 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')}),
  7089. smalltalk.Widget);
  7090. smalltalk.addMethod(
  7091. '_render',
  7092. smalltalk.method({
  7093. selector: 'render',
  7094. category: 'rendering',
  7095. fn: function (){
  7096. var self=this;
  7097. var canvas=nil;
  7098. canvas=smalltalk.HTMLCanvas._new();
  7099. self['@root']=canvas._root();
  7100. self._renderOn_(canvas);
  7101. return self;},
  7102. 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')}),
  7103. smalltalk.Widget);
  7104. smalltalk.addMethod(
  7105. '_renderOn_',
  7106. smalltalk.method({
  7107. selector: 'renderOn:',
  7108. category: 'rendering',
  7109. fn: function (html){
  7110. var self=this;
  7111. self;
  7112. return self;},
  7113. source: unescape('renderOn%3A%20html%0A%20%20%20%20self%0A')}),
  7114. smalltalk.Widget);
  7115. smalltalk.addClass('Counter', smalltalk.Widget, ['count'], 'Canvas');
  7116. smalltalk.addMethod(
  7117. '_initialize',
  7118. smalltalk.method({
  7119. selector: 'initialize',
  7120. category: 'initialization',
  7121. fn: function (){
  7122. var self=this;
  7123. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  7124. self['@count']=(0);
  7125. return self;},
  7126. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20count%20%3A%3D%200%0A')}),
  7127. smalltalk.Counter);
  7128. smalltalk.addMethod(
  7129. '_renderOn_',
  7130. smalltalk.method({
  7131. selector: 'renderOn:',
  7132. category: 'rendering',
  7133. fn: function (html){
  7134. var self=this;
  7135. html._h1()._with_(self['@count']._asString());
  7136. (function($rec){$rec._with_(unescape("++"));return $rec._onClick_((function(){return self._increase();}));})(html._button());
  7137. (function($rec){$rec._with_(unescape("--"));return $rec._onClick_((function(){return self._decrease();}));})(html._button());
  7138. return self;},
  7139. 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')}),
  7140. smalltalk.Counter);
  7141. smalltalk.addMethod(
  7142. '_increase',
  7143. smalltalk.method({
  7144. selector: 'increase',
  7145. category: 'actions',
  7146. fn: function (){
  7147. var self=this;
  7148. self['@count']=self['@count'].__plus((1));
  7149. self._update();
  7150. return self;},
  7151. source: unescape('increase%0A%20%20%20%20count%20%3A%3D%20count%20+%201.%0A%20%20%20%20self%20update%0A')}),
  7152. smalltalk.Counter);
  7153. smalltalk.addMethod(
  7154. '_decrease',
  7155. smalltalk.method({
  7156. selector: 'decrease',
  7157. category: 'actions',
  7158. fn: function (){
  7159. var self=this;
  7160. self['@count']=self['@count'].__minus((1));
  7161. self._update();
  7162. return self;},
  7163. source: unescape('decrease%0A%20%20%20%20count%20%3A%3D%20count%20-%201.%0A%20%20%20%20self%20update%0A')}),
  7164. smalltalk.Counter);
  7165. smalltalk.addClass('TabManager', smalltalk.Widget, ['selectedTab', 'tabs', 'opened'], 'IDE');
  7166. smalltalk.addMethod(
  7167. '_initialize',
  7168. smalltalk.method({
  7169. selector: 'initialize',
  7170. category: 'initialization',
  7171. fn: function (){
  7172. var self=this;
  7173. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  7174. self['@opened']=true;
  7175. (function($rec){$rec._append_(self);$rec._append_((function(html){return html._div()._id_("jtalk");}));return $rec._addClass_("jtalkBody");})("body"._asJQuery());
  7176. (function($rec){$rec._addTab_(smalltalk.Transcript._current());return $rec._addTab_(smalltalk.Workspace._new());})(self);
  7177. self._selectTab_(self._tabs()._last());
  7178. (function($rec){$rec._onResize_((function(){return (function($rec){$rec._updateBodyMargin();return $rec._updatePosition();})(self);}));return $rec._onWindowResize_((function(){return self._updatePosition();}));})(self);
  7179. return self;},
  7180. 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')}),
  7181. smalltalk.TabManager);
  7182. smalltalk.addMethod(
  7183. '_tabs',
  7184. smalltalk.method({
  7185. selector: 'tabs',
  7186. category: 'accessing',
  7187. fn: function (){
  7188. var self=this;
  7189. return self['@tabs']._ifNil_((function(){return self['@tabs']=smalltalk.Array._new();}));
  7190. return self;},
  7191. source: unescape('tabs%0A%20%20%20%20%5Etabs%20ifNil%3A%20%5Btabs%20%3A%3D%20Array%20new%5D%0A')}),
  7192. smalltalk.TabManager);
  7193. smalltalk.addMethod(
  7194. '_addTab_',
  7195. smalltalk.method({
  7196. selector: 'addTab:',
  7197. category: 'adding/Removing',
  7198. fn: function (aWidget){
  7199. var self=this;
  7200. self._tabs()._add_(aWidget);
  7201. unescape("%23jtalk")._asJQuery()._append_(aWidget);
  7202. aWidget._root()._asJQuery()._hide();
  7203. return self;},
  7204. 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')}),
  7205. smalltalk.TabManager);
  7206. smalltalk.addMethod(
  7207. '_removeTab_',
  7208. smalltalk.method({
  7209. selector: 'removeTab:',
  7210. category: 'adding/Removing',
  7211. fn: function (aWidget){
  7212. var self=this;
  7213. self._tabs()._remove_(aWidget);
  7214. self._update();
  7215. return self;},
  7216. source: unescape('removeTab%3A%20aWidget%0A%20%20%20%20self%20tabs%20remove%3A%20aWidget.%0A%20%20%20%20self%20update%0A')}),
  7217. smalltalk.TabManager);
  7218. smalltalk.addMethod(
  7219. '_updateBodyMargin',
  7220. smalltalk.method({
  7221. selector: 'updateBodyMargin',
  7222. category: 'actions',
  7223. fn: function (){
  7224. var self=this;
  7225. self._setBodyMargin_(unescape("%23jtalk")._asJQuery()._height().__plus((27)));
  7226. return self;},
  7227. source: unescape('updateBodyMargin%0A%20%20%20%20self%20setBodyMargin%3A%20%27%23jtalk%27%20asJQuery%20height%20+%2027%0A')}),
  7228. smalltalk.TabManager);
  7229. smalltalk.addMethod(
  7230. '_updatePosition',
  7231. smalltalk.method({
  7232. selector: 'updatePosition',
  7233. category: 'actions',
  7234. fn: function (){
  7235. var self=this;
  7236. (function(){jQuery('#jtalk').css('top', '').css('bottom', '27px');})();
  7237. return self;},
  7238. 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')}),
  7239. smalltalk.TabManager);
  7240. smalltalk.addMethod(
  7241. '_removeBodyMargin',
  7242. smalltalk.method({
  7243. selector: 'removeBodyMargin',
  7244. category: 'actions',
  7245. fn: function (){
  7246. var self=this;
  7247. self._setBodyMargin_((0));
  7248. return self;},
  7249. source: unescape('removeBodyMargin%0A%20%20%20%20self%20setBodyMargin%3A%200%0A')}),
  7250. smalltalk.TabManager);
  7251. smalltalk.addMethod(
  7252. '_setBodyMargin_',
  7253. smalltalk.method({
  7254. selector: 'setBodyMargin:',
  7255. category: 'actions',
  7256. fn: function (anInteger){
  7257. var self=this;
  7258. ".jtalkBody"._asJQuery()._cssAt_put_(unescape("margin-bottom"),anInteger._asString().__comma("px"));
  7259. return self;},
  7260. 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')}),
  7261. smalltalk.TabManager);
  7262. smalltalk.addMethod(
  7263. '_onResize_',
  7264. smalltalk.method({
  7265. selector: 'onResize:',
  7266. category: 'actions',
  7267. fn: function (aBlock){
  7268. var self=this;
  7269. (function(){jQuery('#jtalk').resizable({
  7270. handles: 'n',
  7271. resize: aBlock,
  7272. minHeight: 230
  7273. });})();
  7274. return self;},
  7275. 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')}),
  7276. smalltalk.TabManager);
  7277. smalltalk.addMethod(
  7278. '_onWindowResize_',
  7279. smalltalk.method({
  7280. selector: 'onWindowResize:',
  7281. category: 'actions',
  7282. fn: function (aBlock){
  7283. var self=this;
  7284. (function(){jQuery(window).resize(aBlock)})();
  7285. return self;},
  7286. source: unescape('onWindowResize%3A%20aBlock%0A%20%20%20%20%7B%27jQuery%28window%29.resize%28aBlock%29%27%7D%0A')}),
  7287. smalltalk.TabManager);
  7288. smalltalk.addMethod(
  7289. '_open',
  7290. smalltalk.method({
  7291. selector: 'open',
  7292. category: 'actions',
  7293. fn: function (){
  7294. var self=this;
  7295. 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;}));
  7296. return self;},
  7297. 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')}),
  7298. smalltalk.TabManager);
  7299. smalltalk.addMethod(
  7300. '_close',
  7301. smalltalk.method({
  7302. selector: 'close',
  7303. category: 'actions',
  7304. fn: function (){
  7305. var self=this;
  7306. self['@opened']._ifTrue_((function(){self._root()._asJQuery()._hide();unescape("%23jtalk")._asJQuery()._hide();self._removeBodyMargin();"body"._asJQuery()._removeClass_("jtalkBody");return self['@opened']=false;}));
  7307. return self;},
  7308. 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')}),
  7309. smalltalk.TabManager);
  7310. smalltalk.addMethod(
  7311. '_newBrowserTab',
  7312. smalltalk.method({
  7313. selector: 'newBrowserTab',
  7314. category: 'actions',
  7315. fn: function (){
  7316. var self=this;
  7317. smalltalk.Browser._open();
  7318. return self;},
  7319. source: unescape('newBrowserTab%0A%20%20%20%20Browser%20open%0A')}),
  7320. smalltalk.TabManager);
  7321. smalltalk.addMethod(
  7322. '_selectTab_',
  7323. smalltalk.method({
  7324. selector: 'selectTab:',
  7325. category: 'actions',
  7326. fn: function (aWidget){
  7327. var self=this;
  7328. self._open();
  7329. self['@selectedTab']=aWidget;
  7330. self._tabs()._do_((function(each){return each._root()._asJQuery()._hide();}));
  7331. aWidget._root()._asJQuery()._show();
  7332. self._update();
  7333. return self;},
  7334. 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')}),
  7335. smalltalk.TabManager);
  7336. smalltalk.addMethod(
  7337. '_closeTab_',
  7338. smalltalk.method({
  7339. selector: 'closeTab:',
  7340. category: 'actions',
  7341. fn: function (aWidget){
  7342. var self=this;
  7343. self._removeTab_(aWidget);
  7344. self._selectTab_(self._tabs()._last());
  7345. aWidget._root()._asJQuery()._remove();
  7346. self._update();
  7347. return self;},
  7348. 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')}),
  7349. smalltalk.TabManager);
  7350. smalltalk.addMethod(
  7351. '_renderOn_',
  7352. smalltalk.method({
  7353. selector: 'renderOn:',
  7354. category: 'rendering',
  7355. fn: function (html){
  7356. var self=this;
  7357. (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());
  7358. return self;},
  7359. 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')}),
  7360. smalltalk.TabManager);
  7361. smalltalk.addMethod(
  7362. '_renderTabFor_on_',
  7363. smalltalk.method({
  7364. selector: 'renderTabFor:on:',
  7365. category: 'rendering',
  7366. fn: function (aWidget, html){
  7367. var self=this;
  7368. var li=nil;
  7369. li=html._li();
  7370. self['@selectedTab'].__eq(aWidget)._ifTrue_((function(){return li._class_("selected");}));
  7371. 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());}));}));
  7372. return self;},
  7373. 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')}),
  7374. smalltalk.TabManager);
  7375. smalltalk.TabManager.klass.iVarNames = ['current'];
  7376. smalltalk.addMethod(
  7377. '_current',
  7378. smalltalk.method({
  7379. selector: 'current',
  7380. category: 'instance creation',
  7381. fn: function (){
  7382. var self=this;
  7383. return self['@current']._ifNil_((function(){return self['@current']=self.klass.superclass.fn.prototype['_new'].apply(self, []);}));
  7384. return self;},
  7385. source: unescape('current%0A%20%20%20%20%5Ecurrent%20ifNil%3A%20%5Bcurrent%20%3A%3D%20super%20new%5D%0A')}),
  7386. smalltalk.TabManager.klass);
  7387. smalltalk.addMethod(
  7388. '_new',
  7389. smalltalk.method({
  7390. selector: 'new',
  7391. category: 'instance creation',
  7392. fn: function (){
  7393. var self=this;
  7394. self._shouldNotImplement();
  7395. return self;},
  7396. source: unescape('new%0A%20%20%20%20self%20shouldNotImplement%0A')}),
  7397. smalltalk.TabManager.klass);
  7398. smalltalk.addClass('TabWidget', smalltalk.Widget, [], 'IDE');
  7399. smalltalk.addMethod(
  7400. '_label',
  7401. smalltalk.method({
  7402. selector: 'label',
  7403. category: 'accessing',
  7404. fn: function (){
  7405. var self=this;
  7406. self._subclassResponsibility();
  7407. return self;},
  7408. source: unescape('label%0A%20%20%20%20self%20subclassResponsibility%0A')}),
  7409. smalltalk.TabWidget);
  7410. smalltalk.addMethod(
  7411. '_open',
  7412. smalltalk.method({
  7413. selector: 'open',
  7414. category: 'actions',
  7415. fn: function (){
  7416. var self=this;
  7417. (function($rec){$rec._addTab_(self);return $rec._selectTab_(self);})(smalltalk.TabManager._current());
  7418. return self;},
  7419. source: unescape('open%0A%20%20%20%20TabManager%20current%0A%09addTab%3A%20self%3B%0A%09selectTab%3A%20self%0A')}),
  7420. smalltalk.TabWidget);
  7421. smalltalk.addMethod(
  7422. '_canBeClosed',
  7423. smalltalk.method({
  7424. selector: 'canBeClosed',
  7425. category: 'testing',
  7426. fn: function (){
  7427. var self=this;
  7428. return false;
  7429. return self;},
  7430. source: unescape('canBeClosed%0A%20%20%20%20%5Efalse%0A')}),
  7431. smalltalk.TabWidget);
  7432. smalltalk.addMethod(
  7433. '_renderOn_',
  7434. smalltalk.method({
  7435. selector: 'renderOn:',
  7436. category: 'rendering',
  7437. fn: function (html){
  7438. var self=this;
  7439. (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());
  7440. return self;},
  7441. 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')}),
  7442. smalltalk.TabWidget);
  7443. smalltalk.addMethod(
  7444. '_renderBoxOn_',
  7445. smalltalk.method({
  7446. selector: 'renderBoxOn:',
  7447. category: 'rendering',
  7448. fn: function (html){
  7449. var self=this;
  7450. return self;},
  7451. source: unescape('renderBoxOn%3A%20html%0A')}),
  7452. smalltalk.TabWidget);
  7453. smalltalk.addMethod(
  7454. '_renderButtonsOn_',
  7455. smalltalk.method({
  7456. selector: 'renderButtonsOn:',
  7457. category: 'rendering',
  7458. fn: function (html){
  7459. var self=this;
  7460. return self;},
  7461. source: unescape('renderButtonsOn%3A%20html%0A')}),
  7462. smalltalk.TabWidget);
  7463. smalltalk.addMethod(
  7464. '_open',
  7465. smalltalk.method({
  7466. selector: 'open',
  7467. category: 'instance creation',
  7468. fn: function (){
  7469. var self=this;
  7470. return self._new()._open();
  7471. return self;},
  7472. source: unescape('open%0A%20%20%20%20%5Eself%20new%20open%0A')}),
  7473. smalltalk.TabWidget.klass);
  7474. smalltalk.addClass('Workspace', smalltalk.TabWidget, ['textarea'], 'IDE');
  7475. smalltalk.addMethod(
  7476. '_label',
  7477. smalltalk.method({
  7478. selector: 'label',
  7479. category: 'accessing',
  7480. fn: function (){
  7481. var self=this;
  7482. return unescape("%5BWorkspace%5D");
  7483. return self;},
  7484. source: unescape('label%0A%20%20%20%20%5E%27%5BWorkspace%5D%27%0A')}),
  7485. smalltalk.Workspace);
  7486. smalltalk.addMethod(
  7487. '_selection',
  7488. smalltalk.method({
  7489. selector: 'selection',
  7490. category: 'accessing',
  7491. fn: function (){
  7492. var self=this;
  7493. return (function(){return document.selection})();
  7494. return self;},
  7495. source: unescape('selection%0A%20%20%20%20%5E%7B%27return%20document.selection%27%7D%0A')}),
  7496. smalltalk.Workspace);
  7497. smalltalk.addMethod(
  7498. '_selectionStart',
  7499. smalltalk.method({
  7500. selector: 'selectionStart',
  7501. category: 'accessing',
  7502. fn: function (){
  7503. var self=this;
  7504. return (function(){return jQuery('.jt_workspace')[0].selectionStart})();
  7505. return self;},
  7506. 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')}),
  7507. smalltalk.Workspace);
  7508. smalltalk.addMethod(
  7509. '_selectionEnd',
  7510. smalltalk.method({
  7511. selector: 'selectionEnd',
  7512. category: 'accessing',
  7513. fn: function (){
  7514. var self=this;
  7515. return (function(){return jQuery('.jt_workspace')[0].selectionEnd})();
  7516. return self;},
  7517. 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')}),
  7518. smalltalk.Workspace);
  7519. smalltalk.addMethod(
  7520. '_selectionStart_',
  7521. smalltalk.method({
  7522. selector: 'selectionStart:',
  7523. category: 'accessing',
  7524. fn: function (anInteger){
  7525. var self=this;
  7526. (function(){jQuery('.jt_workspace')[0].selectionStart = anInteger})();
  7527. return self;},
  7528. 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')}),
  7529. smalltalk.Workspace);
  7530. smalltalk.addMethod(
  7531. '_selectionEnd_',
  7532. smalltalk.method({
  7533. selector: 'selectionEnd:',
  7534. category: 'accessing',
  7535. fn: function (anInteger){
  7536. var self=this;
  7537. (function(){jQuery('.jt_workspace')[0].selectionEnd = anInteger})();
  7538. return self;},
  7539. 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')}),
  7540. smalltalk.Workspace);
  7541. smalltalk.addMethod(
  7542. '_currentLine',
  7543. smalltalk.method({
  7544. selector: 'currentLine',
  7545. category: 'accessing',
  7546. fn: function (){
  7547. var self=this;
  7548. try{var lines=nil;
  7549. var startLine=nil;
  7550. var endLine=nil;
  7551. lines=self['@textarea']._asJQuery()._val()._tokenize_(smalltalk.String._cr());
  7552. startLine=endLine=(0);
  7553. 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}})})();}));}));
  7554. return self;
  7555. } catch(e) {if(e.name === 'stReturn' && e.selector === '_currentLine'){return e.fn()} throw(e)}},
  7556. 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')}),
  7557. smalltalk.Workspace);
  7558. smalltalk.addMethod(
  7559. '_handleKeyDown_',
  7560. smalltalk.method({
  7561. selector: 'handleKeyDown:',
  7562. category: 'actions',
  7563. fn: function (anEvent){
  7564. var self=this;
  7565. return (function(){if(anEvent.ctrlKey) {
  7566. if(anEvent.keyCode === 68) { //ctrl+p
  7567. self._printIt();
  7568. return false;
  7569. }
  7570. if(anEvent.keyCode === 80) { //ctrl+d
  7571. self._doIt();
  7572. return false;
  7573. }
  7574. }})();
  7575. return self;},
  7576. 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')}),
  7577. smalltalk.Workspace);
  7578. smalltalk.addMethod(
  7579. '_clearWorkspace',
  7580. smalltalk.method({
  7581. selector: 'clearWorkspace',
  7582. category: 'actions',
  7583. fn: function (){
  7584. var self=this;
  7585. self['@textarea']._asJQuery()._val_("");
  7586. return self;},
  7587. source: unescape('clearWorkspace%0A%20%20%20%20textarea%20asJQuery%20val%3A%20%27%27%0A')}),
  7588. smalltalk.Workspace);
  7589. smalltalk.addMethod(
  7590. '_doIt',
  7591. smalltalk.method({
  7592. selector: 'doIt',
  7593. category: 'actions',
  7594. fn: function (){
  7595. var self=this;
  7596. self._printIt();
  7597. return self;},
  7598. source: unescape('doIt%0A%20%20%20%20self%20printIt%0A')}),
  7599. smalltalk.Workspace);
  7600. smalltalk.addMethod(
  7601. '_printIt',
  7602. smalltalk.method({
  7603. selector: 'printIt',
  7604. category: 'actions',
  7605. fn: function (){
  7606. var self=this;
  7607. var selection=nil;
  7608. self['@textarea']._asJQuery()._focus();
  7609. 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)));}));
  7610. self._print_(self._eval_(selection)._printString());
  7611. return self;},
  7612. 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')}),
  7613. smalltalk.Workspace);
  7614. smalltalk.addMethod(
  7615. '_print_',
  7616. smalltalk.method({
  7617. selector: 'print:',
  7618. category: 'actions',
  7619. fn: function (aString){
  7620. var self=this;
  7621. var start=nil;
  7622. start=self._selectionEnd();
  7623. 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())));
  7624. self._selectionStart_(start);
  7625. self._selectionEnd_(start.__plus(aString._size()).__plus((2)));
  7626. return self;},
  7627. 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')}),
  7628. smalltalk.Workspace);
  7629. smalltalk.addMethod(
  7630. '_eval_',
  7631. smalltalk.method({
  7632. selector: 'eval:',
  7633. category: 'actions',
  7634. fn: function (aString){
  7635. var self=this;
  7636. try{var compiler=nil;
  7637. var node=nil;
  7638. compiler=smalltalk.Compiler._new();
  7639. node=compiler._parseExpression_(aString);
  7640. 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()))}})})();}));
  7641. (function(){throw({name: 'stReturn', selector: '_eval_', fn: function(){return compiler._loadExpression_(aString)}})})();
  7642. return self;
  7643. } catch(e) {if(e.name === 'stReturn' && e.selector === '_eval_'){return e.fn()} throw(e)}},
  7644. 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')}),
  7645. smalltalk.Workspace);
  7646. smalltalk.addMethod(
  7647. '_renderBoxOn_',
  7648. smalltalk.method({
  7649. selector: 'renderBoxOn:',
  7650. category: 'rendering',
  7651. fn: function (html){
  7652. var self=this;
  7653. self['@textarea']=html._textarea();
  7654. self['@textarea']._asJQuery()._call_("tabby");
  7655. self['@textarea']._onKeyDown_((function(e){return self._handleKeyDown_(e);}));
  7656. (function($rec){$rec._class_("jt_workspace");return $rec._at_put_("spellcheck","false");})(self['@textarea']);
  7657. return self;},
  7658. 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')}),
  7659. smalltalk.Workspace);
  7660. smalltalk.addMethod(
  7661. '_renderButtonsOn_',
  7662. smalltalk.method({
  7663. selector: 'renderButtonsOn:',
  7664. category: 'rendering',
  7665. fn: function (html){
  7666. var self=this;
  7667. (function($rec){$rec._with_("DoIt");$rec._title_(unescape("ctrl+d"));return $rec._onClick_((function(){return self._doIt();}));})(html._button());
  7668. (function($rec){$rec._with_("PrintIt");$rec._title_(unescape("ctrl+p"));return $rec._onClick_((function(){return self._printIt();}));})(html._button());
  7669. (function($rec){$rec._with_("Clear workspace");return $rec._onClick_((function(){return self._clearWorkspace();}));})(html._button());
  7670. return self;},
  7671. 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')}),
  7672. smalltalk.Workspace);
  7673. smalltalk.addClass('Transcript', smalltalk.TabWidget, ['textarea'], 'IDE');
  7674. smalltalk.addMethod(
  7675. '_label',
  7676. smalltalk.method({
  7677. selector: 'label',
  7678. category: 'accessing',
  7679. fn: function (){
  7680. var self=this;
  7681. return unescape("%5BTranscript%5D");
  7682. return self;},
  7683. source: unescape('label%0A%20%20%20%20%5E%27%5BTranscript%5D%27%0A')}),
  7684. smalltalk.Transcript);
  7685. smalltalk.addMethod(
  7686. '_show_',
  7687. smalltalk.method({
  7688. selector: 'show:',
  7689. category: 'actions',
  7690. fn: function (anObject){
  7691. var self=this;
  7692. self['@textarea']._asJQuery()._val_(self['@textarea']._asJQuery()._val().__comma(anObject._asString()));
  7693. return self;},
  7694. source: unescape('show%3A%20anObject%0A%20%20%20%20textarea%20asJQuery%20val%3A%20textarea%20asJQuery%20val%2C%20anObject%20asString.%0A%0A')}),
  7695. smalltalk.Transcript);
  7696. smalltalk.addMethod(
  7697. '_cr',
  7698. smalltalk.method({
  7699. selector: 'cr',
  7700. category: 'actions',
  7701. fn: function (){
  7702. var self=this;
  7703. self['@textarea']._asJQuery()._val_(self['@textarea']._asJQuery()._val().__comma(smalltalk.String._cr()));
  7704. return self;},
  7705. source: unescape('cr%0A%20%20%20%20textarea%20asJQuery%20val%3A%20textarea%20asJQuery%20val%2C%20String%20cr.%0A')}),
  7706. smalltalk.Transcript);
  7707. smalltalk.addMethod(
  7708. '_clear',
  7709. smalltalk.method({
  7710. selector: 'clear',
  7711. category: 'actions',
  7712. fn: function (){
  7713. var self=this;
  7714. self['@textarea']._asJQuery()._val_("");
  7715. return self;},
  7716. source: unescape('clear%0A%20%20%20%20textarea%20asJQuery%20val%3A%20%27%27%0A')}),
  7717. smalltalk.Transcript);
  7718. smalltalk.addMethod(
  7719. '_renderBoxOn_',
  7720. smalltalk.method({
  7721. selector: 'renderBoxOn:',
  7722. category: 'rendering',
  7723. fn: function (html){
  7724. var self=this;
  7725. self['@textarea']=html._textarea();
  7726. self['@textarea']._asJQuery()._call_("tabby");
  7727. (function($rec){$rec._class_("jt_transcript");return $rec._at_put_("spellcheck","false");})(self['@textarea']);
  7728. return self;},
  7729. 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')}),
  7730. smalltalk.Transcript);
  7731. smalltalk.addMethod(
  7732. '_renderButtonsOn_',
  7733. smalltalk.method({
  7734. selector: 'renderButtonsOn:',
  7735. category: 'rendering',
  7736. fn: function (html){
  7737. var self=this;
  7738. (function($rec){$rec._with_("Clear transcript");return $rec._onClick_((function(){return self._clear();}));})(html._button());
  7739. return self;},
  7740. 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')}),
  7741. smalltalk.Transcript);
  7742. smalltalk.Transcript.klass.iVarNames = ['current'];
  7743. smalltalk.addMethod(
  7744. '_open',
  7745. smalltalk.method({
  7746. selector: 'open',
  7747. category: 'instance creation',
  7748. fn: function (){
  7749. var self=this;
  7750. self._current()._open();
  7751. return self;},
  7752. source: unescape('open%0A%20%20%20%20self%20current%20open%0A')}),
  7753. smalltalk.Transcript.klass);
  7754. smalltalk.addMethod(
  7755. '_new',
  7756. smalltalk.method({
  7757. selector: 'new',
  7758. category: 'instance creation',
  7759. fn: function (){
  7760. var self=this;
  7761. self._shouldNotImplement();
  7762. return self;},
  7763. source: unescape('new%0A%20%20%20%20self%20shouldNotImplement%0A')}),
  7764. smalltalk.Transcript.klass);
  7765. smalltalk.addMethod(
  7766. '_current',
  7767. smalltalk.method({
  7768. selector: 'current',
  7769. category: 'instance creation',
  7770. fn: function (){
  7771. var self=this;
  7772. return self['@current']._ifNil_((function(){return self['@current']=self.klass.superclass.fn.prototype['_new'].apply(self, []);}));
  7773. return self;},
  7774. source: unescape('current%0A%20%20%20%20%5Ecurrent%20ifNil%3A%20%5Bcurrent%20%3A%3D%20super%20new%5D%0A')}),
  7775. smalltalk.Transcript.klass);
  7776. smalltalk.addMethod(
  7777. '_show_',
  7778. smalltalk.method({
  7779. selector: 'show:',
  7780. category: 'printing',
  7781. fn: function (anObject){
  7782. var self=this;
  7783. self._current()._show_(anObject);
  7784. return self;},
  7785. source: unescape('show%3A%20anObject%0A%20%20%20%20self%20current%20show%3A%20anObject%0A')}),
  7786. smalltalk.Transcript.klass);
  7787. smalltalk.addMethod(
  7788. '_cr',
  7789. smalltalk.method({
  7790. selector: 'cr',
  7791. category: 'printing',
  7792. fn: function (){
  7793. var self=this;
  7794. self._current()._show_(smalltalk.String._cr());
  7795. return self;},
  7796. source: unescape('cr%0A%20%20%20%20self%20current%20show%3A%20String%20cr%0A')}),
  7797. smalltalk.Transcript.klass);
  7798. smalltalk.addMethod(
  7799. '_clear',
  7800. smalltalk.method({
  7801. selector: 'clear',
  7802. category: 'printing',
  7803. fn: function (){
  7804. var self=this;
  7805. self._current()._clear();
  7806. return self;},
  7807. source: unescape('clear%0A%20%20%20%20self%20current%20clear%0A')}),
  7808. smalltalk.Transcript.klass);
  7809. smalltalk.addClass('Browser', smalltalk.TabWidget, ['selectedCategory', 'selectedClass', 'selectedProtocol', 'selectedMethod', 'commitButton', 'categoriesList', 'classesList', 'protocolsList', 'methodsList', 'sourceTextarea', 'tabsList', 'selectedTab', 'saveButton', 'classButtons', 'methodButtons', 'unsavedChanges'], 'IDE');
  7810. smalltalk.addMethod(
  7811. '_initialize',
  7812. smalltalk.method({
  7813. selector: 'initialize',
  7814. category: 'initialization',
  7815. fn: function (){
  7816. var self=this;
  7817. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  7818. self['@selectedTab']="instance";
  7819. self['@unsavedChanges']=false;
  7820. return self;},
  7821. 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')}),
  7822. smalltalk.Browser);
  7823. smalltalk.addMethod(
  7824. '_label',
  7825. smalltalk.method({
  7826. selector: 'label',
  7827. category: 'accessing',
  7828. fn: function (){
  7829. var self=this;
  7830. return self['@selectedClass']._ifNil_ifNotNil_((function(){return unescape("Browser%20%28nil%29");}),(function(){return self['@selectedClass']._name();}));
  7831. return self;},
  7832. 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')}),
  7833. smalltalk.Browser);
  7834. smalltalk.addMethod(
  7835. '_categories',
  7836. smalltalk.method({
  7837. selector: 'categories',
  7838. category: 'accessing',
  7839. fn: function (){
  7840. var self=this;
  7841. var categories=nil;
  7842. categories=smalltalk.Array._new();
  7843. smalltalk.Smalltalk._current()._classes()._do_((function(each){return categories._includes_(each._category())._ifFalse_((function(){return categories._add_(each._category());}));}));
  7844. return categories._sort();
  7845. return self;},
  7846. 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')}),
  7847. smalltalk.Browser);
  7848. smalltalk.addMethod(
  7849. '_classes',
  7850. smalltalk.method({
  7851. selector: 'classes',
  7852. category: 'accessing',
  7853. fn: function (){
  7854. var self=this;
  7855. return smalltalk.Smalltalk._current()._classes()._select_((function(each){return each._category().__eq(self['@selectedCategory']);}))._sort_((function(a, b){return a._name().__gt(b._name());}));
  7856. return self;},
  7857. 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')}),
  7858. smalltalk.Browser);
  7859. smalltalk.addMethod(
  7860. '_protocols',
  7861. smalltalk.method({
  7862. selector: 'protocols',
  7863. category: 'accessing',
  7864. fn: function (){
  7865. var self=this;
  7866. try{var klass=nil;
  7867. var protocols=nil;
  7868. protocols=smalltalk.Array._new();
  7869. 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());}));}));}));
  7870. (function(){throw({name: 'stReturn', selector: '_protocols', fn: function(){return protocols._sort()}})})();
  7871. return self;
  7872. } catch(e) {if(e.name === 'stReturn' && e.selector === '_protocols'){return e.fn()} throw(e)}},
  7873. 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')}),
  7874. smalltalk.Browser);
  7875. smalltalk.addMethod(
  7876. '_methods',
  7877. smalltalk.method({
  7878. selector: 'methods',
  7879. category: 'accessing',
  7880. fn: function (){
  7881. var self=this;
  7882. try{var klass=nil;
  7883. self['@selectedTab'].__eq("comment")._ifTrue_((function(){return (function(){throw({name: 'stReturn', selector: '_methods', fn: function(){return []}})})();}));
  7884. self['@selectedClass']._ifNotNil_((function(){return klass=self['@selectedTab'].__eq("instance")._ifTrue_ifFalse_((function(){return self['@selectedClass'];}),(function(){return self['@selectedClass']._class();}));}));
  7885. (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());}))}})})();
  7886. return self;
  7887. } catch(e) {if(e.name === 'stReturn' && e.selector === '_methods'){return e.fn()} throw(e)}},
  7888. 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')}),
  7889. smalltalk.Browser);
  7890. smalltalk.addMethod(
  7891. '_source',
  7892. smalltalk.method({
  7893. selector: 'source',
  7894. category: 'accessing',
  7895. fn: function (){
  7896. var self=this;
  7897. 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();}))}})})();}));
  7898. (function(){throw({name: 'stReturn', selector: '_source', fn: function(){return self['@selectedClass']._ifNil_ifNotNil_((function(){return "";}),(function(){return self._classCommentSource();}))}})})();
  7899. return self;
  7900. } catch(e) {if(e.name === 'stReturn' && e.selector === '_source'){return e.fn()} throw(e)}},
  7901. 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')}),
  7902. smalltalk.Browser);
  7903. smalltalk.addMethod(
  7904. '_methodSource',
  7905. smalltalk.method({
  7906. selector: 'methodSource',
  7907. category: 'accessing',
  7908. fn: function (){
  7909. var self=this;
  7910. return self['@selectedMethod']._ifNil_ifNotNil_((function(){return self._dummyMethodSource();}),(function(){return self['@selectedMethod']._source();}));
  7911. return self;},
  7912. source: unescape('methodSource%0A%20%20%20%20%5EselectedMethod%0A%09ifNil%3A%20%5Bself%20dummyMethodSource%5D%0A%09ifNotNil%3A%20%5BselectedMethod%20source%5D%0A')}),
  7913. smalltalk.Browser);
  7914. smalltalk.addMethod(
  7915. '_dummyMethodSource',
  7916. smalltalk.method({
  7917. selector: 'dummyMethodSource',
  7918. category: 'accessing',
  7919. fn: function (){
  7920. var self=this;
  7921. return unescape("messageSelectorAndArgumentNames%0A%09%22comment%20stating%20purpose%20of%20message%22%0A%0A%09%7C%20temporary%20variable%20names%20%7C%0A%09statements");
  7922. return self;},
  7923. 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')}),
  7924. smalltalk.Browser);
  7925. smalltalk.addMethod(
  7926. '_declarationSource',
  7927. smalltalk.method({
  7928. selector: 'declarationSource',
  7929. category: 'accessing',
  7930. fn: function (){
  7931. var self=this;
  7932. return self['@selectedTab'].__eq("instance")._ifTrue_ifFalse_((function(){return self._classDeclarationSource();}),(function(){return self._metaclassDeclarationSource();}));
  7933. return self;},
  7934. 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')}),
  7935. smalltalk.Browser);
  7936. smalltalk.addMethod(
  7937. '_classDeclarationSource',
  7938. smalltalk.method({
  7939. selector: 'classDeclarationSource',
  7940. category: 'accessing',
  7941. fn: function (){
  7942. var self=this;
  7943. var stream=nil;
  7944. stream=""._writeStream();
  7945. 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);}));
  7946. return stream._contents();
  7947. return self;},
  7948. 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')}),
  7949. smalltalk.Browser);
  7950. smalltalk.addMethod(
  7951. '_metaclassDeclarationSource',
  7952. smalltalk.method({
  7953. selector: 'metaclassDeclarationSource',
  7954. category: 'accessing',
  7955. fn: function (){
  7956. var self=this;
  7957. var stream=nil;
  7958. stream=""._writeStream();
  7959. 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"));}));
  7960. return stream._contents();
  7961. return self;},
  7962. 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')}),
  7963. smalltalk.Browser);
  7964. smalltalk.addMethod(
  7965. '_classCommentSource',
  7966. smalltalk.method({
  7967. selector: 'classCommentSource',
  7968. category: 'accessing',
  7969. fn: function (){
  7970. var self=this;
  7971. return self['@selectedClass']._comment();
  7972. return self;},
  7973. source: unescape('classCommentSource%0A%20%20%20%20%5EselectedClass%20comment%0A')}),
  7974. smalltalk.Browser);
  7975. smalltalk.addMethod(
  7976. '_enableSaveButton',
  7977. smalltalk.method({
  7978. selector: 'enableSaveButton',
  7979. category: 'actions',
  7980. fn: function (){
  7981. var self=this;
  7982. self['@saveButton']._removeAt_("disabled");
  7983. self['@unsavedChanges']=true;
  7984. return self;},
  7985. source: unescape('enableSaveButton%0A%20%20%20%20saveButton%20removeAt%3A%20%27disabled%27.%0A%20%20%20%20unsavedChanges%20%3A%3D%20true%0A')}),
  7986. smalltalk.Browser);
  7987. smalltalk.addMethod(
  7988. '_disableSaveButton',
  7989. smalltalk.method({
  7990. selector: 'disableSaveButton',
  7991. category: 'actions',
  7992. fn: function (){
  7993. var self=this;
  7994. self['@saveButton']._ifNotNil_((function(){return self['@saveButton']._at_put_("disabled",true);}));
  7995. self['@unsavedChanges']=false;
  7996. return self;},
  7997. 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')}),
  7998. smalltalk.Browser);
  7999. smalltalk.addMethod(
  8000. '_hideClassButtons',
  8001. smalltalk.method({
  8002. selector: 'hideClassButtons',
  8003. category: 'actions',
  8004. fn: function (){
  8005. var self=this;
  8006. self['@classButtons']._asJQuery()._hide();
  8007. return self;},
  8008. source: unescape('hideClassButtons%0A%20%20%20%20classButtons%20asJQuery%20hide%0A')}),
  8009. smalltalk.Browser);
  8010. smalltalk.addMethod(
  8011. '_showClassButtons',
  8012. smalltalk.method({
  8013. selector: 'showClassButtons',
  8014. category: 'actions',
  8015. fn: function (){
  8016. var self=this;
  8017. self['@classButtons']._asJQuery()._show();
  8018. return self;},
  8019. source: unescape('showClassButtons%0A%20%20%20%20classButtons%20asJQuery%20show%0A')}),
  8020. smalltalk.Browser);
  8021. smalltalk.addMethod(
  8022. '_hideMethodButtons',
  8023. smalltalk.method({
  8024. selector: 'hideMethodButtons',
  8025. category: 'actions',
  8026. fn: function (){
  8027. var self=this;
  8028. self['@methodButtons']._asJQuery()._hide();
  8029. return self;},
  8030. source: unescape('hideMethodButtons%0A%20%20%20%20methodButtons%20asJQuery%20hide%0A')}),
  8031. smalltalk.Browser);
  8032. smalltalk.addMethod(
  8033. '_showMethodButtons',
  8034. smalltalk.method({
  8035. selector: 'showMethodButtons',
  8036. category: 'actions',
  8037. fn: function (){
  8038. var self=this;
  8039. self['@methodButtons']._asJQuery()._show();
  8040. return self;},
  8041. source: unescape('showMethodButtons%0A%20%20%20%20methodButtons%20asJQuery%20show%0A')}),
  8042. smalltalk.Browser);
  8043. smalltalk.addMethod(
  8044. '_compile',
  8045. smalltalk.method({
  8046. selector: 'compile',
  8047. category: 'actions',
  8048. fn: function (){
  8049. var self=this;
  8050. self._disableSaveButton();
  8051. self['@selectedTab'].__eq("comment")._ifTrue_((function(){return self['@selectedClass']._ifNotNil_((function(){return self._compileClassComment();}));}));
  8052. self['@selectedProtocol']._notNil()._or_((function(){return self['@selectedMethod']._notNil();}))._ifFalse_ifTrue_((function(){return self._compileDefinition();}),(function(){return self._compileMethodDefinition();}));
  8053. return self;},
  8054. 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')}),
  8055. smalltalk.Browser);
  8056. smalltalk.addMethod(
  8057. '_compileClassComment',
  8058. smalltalk.method({
  8059. selector: 'compileClassComment',
  8060. category: 'actions',
  8061. fn: function (){
  8062. var self=this;
  8063. self['@selectedClass']._comment_(self['@sourceTextarea']._asJQuery()._val());
  8064. return self;},
  8065. source: unescape('compileClassComment%0A%20%20%20%20selectedClass%20comment%3A%20sourceTextarea%20asJQuery%20val%0A')}),
  8066. smalltalk.Browser);
  8067. smalltalk.addMethod(
  8068. '_compileMethodDefinition',
  8069. smalltalk.method({
  8070. selector: 'compileMethodDefinition',
  8071. category: 'actions',
  8072. fn: function (){
  8073. var self=this;
  8074. self['@selectedTab'].__eq("instance")._ifTrue_ifFalse_((function(){return self._compileMethodDefinitionFor_(self['@selectedClass']);}),(function(){return self._compileMethodDefinitionFor_(self['@selectedClass']._class());}));
  8075. return self;},
  8076. 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')}),
  8077. smalltalk.Browser);
  8078. smalltalk.addMethod(
  8079. '_compileMethodDefinitionFor_',
  8080. smalltalk.method({
  8081. selector: 'compileMethodDefinitionFor:',
  8082. category: 'actions',
  8083. fn: function (aClass){
  8084. var self=this;
  8085. try{var compiler=nil;
  8086. var method=nil;
  8087. var source=nil;
  8088. var node=nil;
  8089. source=self['@sourceTextarea']._asJQuery()._val();
  8090. self['@selectedProtocol']._ifNil_((function(){return self['@selectedProtocol']=self['@selectedMethod']._category();}));
  8091. compiler=smalltalk.Compiler._new();
  8092. node=compiler._parse_(source);
  8093. 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()))}})})();}));
  8094. compiler._currentClass_(self['@selectedClass']);
  8095. method=compiler._eval_(compiler._compileNode_(node));
  8096. method._category_(self['@selectedProtocol']);
  8097. aClass._addCompiledMethod_(method);
  8098. self._updateMethodsList();
  8099. self._selectMethod_(method);
  8100. return self;
  8101. } catch(e) {if(e.name === 'stReturn' && e.selector === '_compileMethodDefinitionFor_'){return e.fn()} throw(e)}},
  8102. source: unescape('compileMethodDefinitionFor%3A%20aClass%0A%20%20%20%20%7C%20compiler%20method%20source%20node%20%7C%0A%20%20%20%20source%20%3A%3D%20sourceTextarea%20asJQuery%20val.%0A%20%20%20%20selectedProtocol%20ifNil%3A%20%5BselectedProtocol%20%3A%3D%20selectedMethod%20category%5D.%0A%20%20%20%20compiler%20%3A%3D%20Compiler%20new.%0A%20%20%20%20node%20%3A%3D%20compiler%20parse%3A%20source.%0A%20%20%20%20node%20isParseFailure%20ifTrue%3A%20%5B%0A%09%5Eself%20alert%3A%20%27PARSE%20ERROR%3A%20%27%2C%20node%20reason%2C%20%27%2C%20position%3A%20%27%2C%20node%20position%20asString%5D.%0A%20%20%20%20compiler%20currentClass%3A%20selectedClass.%0A%20%20%20%20method%20%3A%3D%20compiler%20eval%3A%20%28compiler%20compileNode%3A%20node%29.%0A%20%20%20%20method%20category%3A%20selectedProtocol.%0A%20%20%20%20aClass%20addCompiledMethod%3A%20method.%0A%20%20%20%20self%20updateMethodsList.%0A%20%20%20%20self%20selectMethod%3A%20method%0A')}),
  8103. smalltalk.Browser);
  8104. smalltalk.addMethod(
  8105. '_compileDefinition',
  8106. smalltalk.method({
  8107. selector: 'compileDefinition',
  8108. category: 'actions',
  8109. fn: function (){
  8110. var self=this;
  8111. var newClass=nil;
  8112. newClass=smalltalk.Compiler._new()._loadExpression_(self['@sourceTextarea']._asJQuery()._val());
  8113. (function($rec){$rec._updateCategoriesList();return $rec._updateClassesList();})(self);
  8114. return self;},
  8115. 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')}),
  8116. smalltalk.Browser);
  8117. smalltalk.addMethod(
  8118. '_commitCategory',
  8119. smalltalk.method({
  8120. selector: 'commitCategory',
  8121. category: 'actions',
  8122. fn: function (){
  8123. var self=this;
  8124. self['@selectedCategory']._ifNotNil_((function(){return (function($rec){$rec._at_put_("type","PUT");$rec._at_put_("data",smalltalk.Exporter._new()._exportCategory_(self['@selectedCategory']));$rec._at_put_("error",(function(){return self._alert_(unescape("Commit%20failed%21"));}));return $rec._send();})(smalltalk.Ajax._url_(unescape("js/").__comma(self['@selectedCategory']).__comma(".js")));}));
  8125. return self;},
  8126. source: unescape('commitCategory%0A%20%20%20%20selectedCategory%20ifNotNil%3A%20%5B%0A%09%28Ajax%20url%3A%20%27js/%27%2C%20selectedCategory%2C%20%27.js%27%29%0A%09%20%20%20%20at%3A%20%27type%27%20put%3A%20%27PUT%27%3B%0A%09%20%20%20%20at%3A%20%27data%27%20put%3A%20%28Exporter%20new%20exportCategory%3A%20selectedCategory%29%3B%0A%09%20%20%20%20at%3A%20%27error%27%20put%3A%20%5Bself%20alert%3A%20%27Commit%20failed%21%27%5D%3B%0A%09%20%20%20%20send%5D%0A')}),
  8127. smalltalk.Browser);
  8128. smalltalk.addMethod(
  8129. '_cancelChanges',
  8130. smalltalk.method({
  8131. selector: 'cancelChanges',
  8132. category: 'actions',
  8133. fn: function (){
  8134. var self=this;
  8135. return self['@unsavedChanges']._ifTrue_ifFalse_((function(){return self._confirm_(unescape("Cancel%20changes%3F"));}),(function(){return true;}));
  8136. return self;},
  8137. 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')}),
  8138. smalltalk.Browser);
  8139. smalltalk.addMethod(
  8140. '_removeClass',
  8141. smalltalk.method({
  8142. selector: 'removeClass',
  8143. category: 'actions',
  8144. fn: function (){
  8145. var self=this;
  8146. 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);}));
  8147. return self;},
  8148. 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')}),
  8149. smalltalk.Browser);
  8150. smalltalk.addMethod(
  8151. '_removeMethod',
  8152. smalltalk.method({
  8153. selector: 'removeMethod',
  8154. category: 'actions',
  8155. fn: function (){
  8156. var self=this;
  8157. 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);}));}));
  8158. return self;},
  8159. 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')}),
  8160. smalltalk.Browser);
  8161. smalltalk.addMethod(
  8162. '_setMethodProtocol_',
  8163. smalltalk.method({
  8164. selector: 'setMethodProtocol:',
  8165. category: 'actions',
  8166. fn: function (aString){
  8167. var self=this;
  8168. self._cancelChanges()._ifTrue_((function(){return self._protocols()._includes_(aString)._ifFalse_ifTrue_((function(){return self._addNewProtocol();}),(function(){self['@selectedMethod']._category_(aString);self['@selectedProtocol']=aString;self['@selectedMethod']=self['@selectedMethod'];return (function($rec){$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();})(self);}));}));
  8169. return self;},
  8170. source: unescape('setMethodProtocol%3A%20aString%0A%20%20%20%20self%20cancelChanges%20ifTrue%3A%20%5B%0A%09%28self%20protocols%20includes%3A%20aString%29%0A%09%20%20%20%20ifFalse%3A%20%5Bself%20addNewProtocol%5D%0A%09%20%20%20%20ifTrue%3A%20%5B%0A%09%09selectedMethod%20category%3A%20aString.%0A%09%09selectedProtocol%20%3A%3D%20aString.%0A%09%09selectedMethod%20%3A%3D%20selectedMethod.%0A%09%09self%20%0A%09%09%20%20%20%20updateProtocolsList%3B%0A%09%09%20%20%20%20updateMethodsList%3B%0A%09%09%20%20%20%20updateSourceAndButtons%5D%5D%0A')}),
  8171. smalltalk.Browser);
  8172. smalltalk.addMethod(
  8173. '_addNewProtocol',
  8174. smalltalk.method({
  8175. selector: 'addNewProtocol',
  8176. category: 'actions',
  8177. fn: function (){
  8178. var self=this;
  8179. var newProtocol=nil;
  8180. newProtocol=self._prompt_("New method protocol");
  8181. newProtocol._notEmpty()._ifTrue_((function(){self['@selectedMethod']._category_(newProtocol);return self._setMethodProtocol_(newProtocol);}));
  8182. return self;},
  8183. source: unescape('addNewProtocol%0A%20%20%20%20%7C%20newProtocol%20%7C%0A%20%20%20%20newProtocol%20%3A%3D%20self%20prompt%3A%20%27New%20method%20protocol%27.%0A%20%20%20%20newProtocol%20notEmpty%20ifTrue%3A%20%5B%0A%09selectedMethod%20category%3A%20newProtocol.%0A%09self%20setMethodProtocol%3A%20newProtocol%5D%0A')}),
  8184. smalltalk.Browser);
  8185. smalltalk.addMethod(
  8186. '_selectCategory_',
  8187. smalltalk.method({
  8188. selector: 'selectCategory:',
  8189. category: 'actions',
  8190. fn: function (aCategory){
  8191. var self=this;
  8192. 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);}));
  8193. return self;},
  8194. 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')}),
  8195. smalltalk.Browser);
  8196. smalltalk.addMethod(
  8197. '_selectClass_',
  8198. smalltalk.method({
  8199. selector: 'selectClass:',
  8200. category: 'actions',
  8201. fn: function (aClass){
  8202. var self=this;
  8203. 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);}));
  8204. return self;},
  8205. 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')}),
  8206. smalltalk.Browser);
  8207. smalltalk.addMethod(
  8208. '_selectProtocol_',
  8209. smalltalk.method({
  8210. selector: 'selectProtocol:',
  8211. category: 'actions',
  8212. fn: function (aString){
  8213. var self=this;
  8214. self._cancelChanges()._ifTrue_((function(){self['@selectedProtocol']=aString;self['@selectedMethod']=nil;return (function($rec){$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();})(self);}));
  8215. return self;},
  8216. 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')}),
  8217. smalltalk.Browser);
  8218. smalltalk.addMethod(
  8219. '_selectMethod_',
  8220. smalltalk.method({
  8221. selector: 'selectMethod:',
  8222. category: 'actions',
  8223. fn: function (aMethod){
  8224. var self=this;
  8225. self._cancelChanges()._ifTrue_((function(){self['@selectedMethod']=aMethod;return (function($rec){$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();})(self);}));
  8226. return self;},
  8227. 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')}),
  8228. smalltalk.Browser);
  8229. smalltalk.addMethod(
  8230. '_selectTab_',
  8231. smalltalk.method({
  8232. selector: 'selectTab:',
  8233. category: 'actions',
  8234. fn: function (aString){
  8235. var self=this;
  8236. self._cancelChanges()._ifTrue_((function(){self['@selectedTab']=aString;self._selectProtocol_(nil);return self._updateTabsList();}));
  8237. return self;},
  8238. 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')}),
  8239. smalltalk.Browser);
  8240. smalltalk.addMethod(
  8241. '_renderBoxOn_',
  8242. smalltalk.method({
  8243. selector: 'renderBoxOn:',
  8244. category: 'rendering',
  8245. fn: function (html){
  8246. var self=this;
  8247. (function($rec){$rec._renderTopPanelOn_(html);$rec._renderTabsOn_(html);return $rec._renderBottomPanelOn_(html);})(self);
  8248. return self;},
  8249. 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')}),
  8250. smalltalk.Browser);
  8251. smalltalk.addMethod(
  8252. '_renderTopPanelOn_',
  8253. smalltalk.method({
  8254. selector: 'renderTopPanelOn:',
  8255. category: 'rendering',
  8256. fn: function (html){
  8257. var self=this;
  8258. (function($rec){$rec._class_("top");return $rec._with_((function(){self['@categoriesList']=html._ul()._class_("jt_column categories");self['@commitButton']=(function($rec){$rec._class_("jt_commit");$rec._title_("Commit classes in this category to disk");$rec._onClick_((function(){return self._commitCategory();}));return $rec._with_("Commit category");})(html._button());self['@classesList']=html._ul()._class_("jt_column classes");self['@protocolsList']=html._ul()._class_("jt_column protocols");self['@methodsList']=html._ul()._class_("jt_column methods");(function($rec){$rec._updateCategoriesList();$rec._updateClassesList();$rec._updateProtocolsList();return $rec._updateMethodsList();})(self);return html._div()._class_("jt_clear");}));})(html._div());
  8259. return self;},
  8260. source: unescape('renderTopPanelOn%3A%20html%0A%20%20%20%20html%20div%20%0A%09class%3A%20%27top%27%3B%20%0A%09with%3A%20%5B%0A%09%20%20%20%20categoriesList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20categories%27.%0A%09%20%20%20%20commitButton%20%3A%3D%20html%20button%20%0A%09%09class%3A%20%27jt_commit%27%3B%0A%09%09title%3A%20%27Commit%20classes%20in%20this%20category%20to%20disk%27%3B%0A%09%09onClick%3A%20%5Bself%20commitCategory%5D%3B%0A%09%09with%3A%20%27Commit%20category%27.%0A%09%20%20%20%20classesList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20classes%27.%0A%09%20%20%20%20protocolsList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20protocols%27.%0A%09%20%20%20%20methodsList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20methods%27.%0A%09%20%20%20%20self%0A%09%09updateCategoriesList%3B%0A%09%09updateClassesList%3B%0A%09%09updateProtocolsList%3B%0A%09%09updateMethodsList.%0A%09%20%20%20%20html%20div%20class%3A%20%27jt_clear%27%5D%0A')}),
  8261. smalltalk.Browser);
  8262. smalltalk.addMethod(
  8263. '_renderTabsOn_',
  8264. smalltalk.method({
  8265. selector: 'renderTabsOn:',
  8266. category: 'rendering',
  8267. fn: function (html){
  8268. var self=this;
  8269. self['@tabsList']=html._ul()._class_("jt_tabs");
  8270. self._updateTabsList();
  8271. return self;},
  8272. 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')}),
  8273. smalltalk.Browser);
  8274. smalltalk.addMethod(
  8275. '_renderBottomPanelOn_',
  8276. smalltalk.method({
  8277. selector: 'renderBottomPanelOn:',
  8278. category: 'rendering',
  8279. fn: function (html){
  8280. var self=this;
  8281. (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());
  8282. return self;},
  8283. 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')}),
  8284. smalltalk.Browser);
  8285. smalltalk.addMethod(
  8286. '_renderButtonsOn_',
  8287. smalltalk.method({
  8288. selector: 'renderButtonsOn:',
  8289. category: 'rendering',
  8290. fn: function (html){
  8291. var self=this;
  8292. self['@saveButton']=html._button();
  8293. (function($rec){$rec._with_("Save");return $rec._onClick_((function(){return self._compile();}));})(self['@saveButton']);
  8294. self['@methodButtons']=html._span();
  8295. self['@classButtons']=html._span();
  8296. self._updateSourceAndButtons();
  8297. return self;},
  8298. 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')}),
  8299. smalltalk.Browser);
  8300. smalltalk.addMethod(
  8301. '_updateCategoriesList',
  8302. smalltalk.method({
  8303. selector: 'updateCategoriesList',
  8304. category: 'updating',
  8305. fn: function (){
  8306. var self=this;
  8307. self['@categoriesList']._contents_((function(html){return self._categories()._do_((function(each){var li=nil;
  8308. 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);}));}));
  8309. return self;},
  8310. 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')}),
  8311. smalltalk.Browser);
  8312. smalltalk.addMethod(
  8313. '_updateClassesList',
  8314. smalltalk.method({
  8315. selector: 'updateClassesList',
  8316. category: 'updating',
  8317. fn: function (){
  8318. var self=this;
  8319. smalltalk.TabManager._current()._update();
  8320. self['@classesList']._contents_((function(html){return self._classes()._do_((function(each){var li=nil;
  8321. 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);}));}));
  8322. return self;},
  8323. 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')}),
  8324. smalltalk.Browser);
  8325. smalltalk.addMethod(
  8326. '_updateProtocolsList',
  8327. smalltalk.method({
  8328. selector: 'updateProtocolsList',
  8329. category: 'updating',
  8330. fn: function (){
  8331. var self=this;
  8332. self['@protocolsList']._contents_((function(html){return self._protocols()._do_((function(each){var li=nil;
  8333. 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);}));}));
  8334. return self;},
  8335. 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')}),
  8336. smalltalk.Browser);
  8337. smalltalk.addMethod(
  8338. '_updateMethodsList',
  8339. smalltalk.method({
  8340. selector: 'updateMethodsList',
  8341. category: 'updating',
  8342. fn: function (){
  8343. var self=this;
  8344. self['@methodsList']._contents_((function(html){return self._methods()._do_((function(each){var li=nil;
  8345. 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);}));}));
  8346. return self;},
  8347. 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')}),
  8348. smalltalk.Browser);
  8349. smalltalk.addMethod(
  8350. '_updateTabsList',
  8351. smalltalk.method({
  8352. selector: 'updateTabsList',
  8353. category: 'updating',
  8354. fn: function (){
  8355. var self=this;
  8356. self['@tabsList']._contents_((function(html){var li=nil;
  8357. 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);}));
  8358. return self;},
  8359. 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')}),
  8360. smalltalk.Browser);
  8361. smalltalk.addMethod(
  8362. '_updateSourceAndButtons',
  8363. smalltalk.method({
  8364. selector: 'updateSourceAndButtons',
  8365. category: 'updating',
  8366. fn: function (){
  8367. var self=this;
  8368. self._disableSaveButton();
  8369. self['@classButtons']._contents_((function(html){return (function($rec){$rec._with_("Remove class");return $rec._onClick_((function(){return self._removeClass();}));})(html._button());}));
  8370. self['@methodButtons']._contents_((function(html){(function($rec){$rec._with_("Remove method");return $rec._onClick_((function(){return self._removeMethod();}));})(html._button());return (function($rec){$rec._onChange_((function(s){return self._setMethodProtocol_(s._val());}));return $rec._with_((function(){(function($rec){$rec._with_("Method protocol");return $rec._at_put_("disabled","disabled");})(html._option());(function($rec){$rec._class_("important");return $rec._with_("New...");})(html._option());return self._protocols()._do_((function(each){return html._option()._with_(each);}));}));})(html._select());}));
  8371. 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();}));
  8372. self['@sourceTextarea']._asJQuery()._val_(self._source());
  8373. return self;},
  8374. 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%20%0A%09%20%20%20%20onChange%3A%20%5B%3As%20%7C%20self%20setMethodProtocol%3A%20s%20val%5D%3B%0A%09%20%20%20%20with%3A%20%5B%0A%09%09html%20option%0A%09%09%20%20%20%20with%3A%20%27Method%20protocol%27%3B%0A%09%09%20%20%20%20at%3A%20%27disabled%27%20put%3A%20%27disabled%27.%0A%09%09html%20option%0A%09%09%20%20%20%20class%3A%20%27important%27%3B%0A%09%09%20%20%20%20with%3A%20%27New...%27.%0A%09%09self%20protocols%20do%3A%20%5B%3Aeach%20%7C%0A%09%09%20%20%20%20html%20option%20with%3A%20each%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')}),
  8375. smalltalk.Browser);
  8376. smalltalk.addMethod(
  8377. '_canBeClosed',
  8378. smalltalk.method({
  8379. selector: 'canBeClosed',
  8380. category: 'testing',
  8381. fn: function (){
  8382. var self=this;
  8383. return true;
  8384. return self;},
  8385. source: unescape('canBeClosed%0A%20%20%20%20%5Etrue%0A')}),
  8386. smalltalk.Browser);
  8387. smalltalk.addMethod(
  8388. '_openOn_',
  8389. smalltalk.method({
  8390. selector: 'openOn:',
  8391. category: 'convenience',
  8392. fn: function (aClass){
  8393. var self=this;
  8394. (function($rec){$rec._open();$rec._selectCategory_(aClass._category());return $rec._selectClass_(aClass);})(self._new());
  8395. return self;},
  8396. 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')}),
  8397. smalltalk.Browser.klass);
  8398. smalltalk.addMethod(
  8399. '_open',
  8400. smalltalk.method({
  8401. selector: 'open',
  8402. category: 'convenience',
  8403. fn: function (){
  8404. var self=this;
  8405. self._new()._open();
  8406. return self;},
  8407. source: unescape('open%0A%20%20%20%20self%20new%20open%0A')}),
  8408. smalltalk.Browser.klass);
  8409. smalltalk.init(smalltalk.Object);