1
0

jtalk.js 325 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059
  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._compile_(unescape("doIt%20%5E%5B").__comma(aString).__comma(unescape("%5D%20value")));
  5513. return self;},
  5514. source: unescape('compileExpression%3A%20aString%0A%09self%20currentClass%3A%20DoIt.%0A%09%5Eself%20compile%3A%20%27doIt%20%5E%5B%27%2C%20aString%2C%20%27%5D%20value%27%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._parser()._parse_(aString._readStream()));
  5535. return self;},
  5536. source: unescape('compile%3A%20aString%0A%09%5Eself%20compileNode%3A%20%28self%20parser%20parse%3A%20aString%20readStream%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.addClass('DoIt', smalltalk.Object, [], 'Compiler');
  5736. smalltalk.addMethod(
  5737. '_doIt',
  5738. smalltalk.method({
  5739. selector: 'doIt',
  5740. category: '',
  5741. fn: function (){
  5742. var self=this;
  5743. return (function(){return smalltalk.Object._subclass_instanceVariableNames_category_("DoIt","","Compiler");})._value();
  5744. return self;},
  5745. source: unescape('doIt%20%5E%5BObject%20subclass%3A%20%23DoIt%0A%09instanceVariableNames%3A%20%27%27%0A%09category%3A%20%27Compiler%27%5D%20value')}),
  5746. smalltalk.DoIt);
  5747. smalltalk.addClass('JQuery', smalltalk.Object, ['jquery'], 'JQuery');
  5748. smalltalk.addMethod(
  5749. '_removeAttribute_',
  5750. smalltalk.method({
  5751. selector: 'removeAttribute:',
  5752. category: 'attributes',
  5753. fn: function (aString){
  5754. var self=this;
  5755. return self._call_withArgument_("removeAttribute",aString);
  5756. return self;},
  5757. 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')}),
  5758. smalltalk.JQuery);
  5759. smalltalk.addMethod(
  5760. '_attr_',
  5761. smalltalk.method({
  5762. selector: 'attr:',
  5763. category: 'attributes',
  5764. fn: function (aString){
  5765. var self=this;
  5766. return self._call_withArgument_("attr",aString);
  5767. return self;},
  5768. 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')}),
  5769. smalltalk.JQuery);
  5770. smalltalk.addMethod(
  5771. '_val',
  5772. smalltalk.method({
  5773. selector: 'val',
  5774. category: 'attributes',
  5775. fn: function (){
  5776. var self=this;
  5777. return self._call_("val");
  5778. return self;},
  5779. 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')}),
  5780. smalltalk.JQuery);
  5781. smalltalk.addMethod(
  5782. '_val_',
  5783. smalltalk.method({
  5784. selector: 'val:',
  5785. category: 'attributes',
  5786. fn: function (aString){
  5787. var self=this;
  5788. self._call_withArgument_("val",aString);
  5789. return self;},
  5790. source: unescape('val%3A%20aString%0A%20%20%20%20self%20call%3A%20%27val%27%20withArgument%3A%20aString%0A')}),
  5791. smalltalk.JQuery);
  5792. smalltalk.addMethod(
  5793. '_cssAt_',
  5794. smalltalk.method({
  5795. selector: 'cssAt:',
  5796. category: 'css',
  5797. fn: function (aString){
  5798. var self=this;
  5799. return (function(){return self['@jquery'].css(aString)})();
  5800. return self;},
  5801. 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')}),
  5802. smalltalk.JQuery);
  5803. smalltalk.addMethod(
  5804. '_cssAt_put_',
  5805. smalltalk.method({
  5806. selector: 'cssAt:put:',
  5807. category: 'css',
  5808. fn: function (aString, anotherString){
  5809. var self=this;
  5810. (function(){self['@jquery'].css(aString, anotherString)})();
  5811. return self;},
  5812. 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')}),
  5813. smalltalk.JQuery);
  5814. smalltalk.addMethod(
  5815. '_addClass_',
  5816. smalltalk.method({
  5817. selector: 'addClass:',
  5818. category: 'css',
  5819. fn: function (aString){
  5820. var self=this;
  5821. self._call_withArgument_("addClass",aString);
  5822. return self;},
  5823. 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')}),
  5824. smalltalk.JQuery);
  5825. smalltalk.addMethod(
  5826. '_removeClass_',
  5827. smalltalk.method({
  5828. selector: 'removeClass:',
  5829. category: 'css',
  5830. fn: function (aString){
  5831. var self=this;
  5832. self._call_withArgument_("removeClass",aString);
  5833. return self;},
  5834. 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')}),
  5835. smalltalk.JQuery);
  5836. smalltalk.addMethod(
  5837. '_toggleClass_',
  5838. smalltalk.method({
  5839. selector: 'toggleClass:',
  5840. category: 'css',
  5841. fn: function (aString){
  5842. var self=this;
  5843. self._call_withArgument_("toggleClass",aString);
  5844. return self;},
  5845. 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')}),
  5846. smalltalk.JQuery);
  5847. smalltalk.addMethod(
  5848. '_height',
  5849. smalltalk.method({
  5850. selector: 'height',
  5851. category: 'css',
  5852. fn: function (){
  5853. var self=this;
  5854. return self._call_("height");
  5855. return self;},
  5856. 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')}),
  5857. smalltalk.JQuery);
  5858. smalltalk.addMethod(
  5859. '_height_',
  5860. smalltalk.method({
  5861. selector: 'height:',
  5862. category: 'css',
  5863. fn: function (anInteger){
  5864. var self=this;
  5865. self._call_withArgument_("height",anInteger);
  5866. return self;},
  5867. source: unescape('height%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27height%27%20withArgument%3A%20anInteger%0A')}),
  5868. smalltalk.JQuery);
  5869. smalltalk.addMethod(
  5870. '_width_',
  5871. smalltalk.method({
  5872. selector: 'width:',
  5873. category: 'css',
  5874. fn: function (anInteger){
  5875. var self=this;
  5876. self._call_withArgument_("width",anInteger);
  5877. return self;},
  5878. source: unescape('width%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27width%27%20withArgument%3A%20anInteger%0A')}),
  5879. smalltalk.JQuery);
  5880. smalltalk.addMethod(
  5881. '_width',
  5882. smalltalk.method({
  5883. selector: 'width',
  5884. category: 'css',
  5885. fn: function (){
  5886. var self=this;
  5887. return self._call_("width");
  5888. return self;},
  5889. 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')}),
  5890. smalltalk.JQuery);
  5891. smalltalk.addMethod(
  5892. '_innerHeight',
  5893. smalltalk.method({
  5894. selector: 'innerHeight',
  5895. category: 'css',
  5896. fn: function (){
  5897. var self=this;
  5898. return self._call_("innerHeight");
  5899. return self;},
  5900. 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')}),
  5901. smalltalk.JQuery);
  5902. smalltalk.addMethod(
  5903. '_innerWidth',
  5904. smalltalk.method({
  5905. selector: 'innerWidth',
  5906. category: 'css',
  5907. fn: function (){
  5908. var self=this;
  5909. return self._call_("innerWidth");
  5910. return self;},
  5911. 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')}),
  5912. smalltalk.JQuery);
  5913. smalltalk.addMethod(
  5914. '_outerHeight',
  5915. smalltalk.method({
  5916. selector: 'outerHeight',
  5917. category: 'css',
  5918. fn: function (){
  5919. var self=this;
  5920. return self._call_("outerHeight");
  5921. return self;},
  5922. 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')}),
  5923. smalltalk.JQuery);
  5924. smalltalk.addMethod(
  5925. '_outerWidth',
  5926. smalltalk.method({
  5927. selector: 'outerWidth',
  5928. category: 'css',
  5929. fn: function (){
  5930. var self=this;
  5931. return self._call_("outerWidth");
  5932. return self;},
  5933. 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')}),
  5934. smalltalk.JQuery);
  5935. smalltalk.addMethod(
  5936. '_top',
  5937. smalltalk.method({
  5938. selector: 'top',
  5939. category: 'css',
  5940. fn: function (){
  5941. var self=this;
  5942. return self._call_("position")._basicAt_("top");
  5943. return self;},
  5944. 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')}),
  5945. smalltalk.JQuery);
  5946. smalltalk.addMethod(
  5947. '_left',
  5948. smalltalk.method({
  5949. selector: 'left',
  5950. category: 'css',
  5951. fn: function (){
  5952. var self=this;
  5953. return self._call_("position")._basicAt_("left");
  5954. return self;},
  5955. 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')}),
  5956. smalltalk.JQuery);
  5957. smalltalk.addMethod(
  5958. '_offsetLeft',
  5959. smalltalk.method({
  5960. selector: 'offsetLeft',
  5961. category: 'css',
  5962. fn: function (){
  5963. var self=this;
  5964. return self._call_("offset")._basicAt_("left");
  5965. return self;},
  5966. 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')}),
  5967. smalltalk.JQuery);
  5968. smalltalk.addMethod(
  5969. '_offsetTop',
  5970. smalltalk.method({
  5971. selector: 'offsetTop',
  5972. category: 'css',
  5973. fn: function (){
  5974. var self=this;
  5975. return self._call_("offset")._basicAt_("top");
  5976. return self;},
  5977. 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')}),
  5978. smalltalk.JQuery);
  5979. smalltalk.addMethod(
  5980. '_scrollLeft',
  5981. smalltalk.method({
  5982. selector: 'scrollLeft',
  5983. category: 'css',
  5984. fn: function (){
  5985. var self=this;
  5986. return self._call_("scrollLeft");
  5987. return self;},
  5988. 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')}),
  5989. smalltalk.JQuery);
  5990. smalltalk.addMethod(
  5991. '_scrollTop',
  5992. smalltalk.method({
  5993. selector: 'scrollTop',
  5994. category: 'css',
  5995. fn: function (){
  5996. var self=this;
  5997. return self._call_("scrollTop");
  5998. return self;},
  5999. 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')}),
  6000. smalltalk.JQuery);
  6001. smalltalk.addMethod(
  6002. '_scrollLeft_',
  6003. smalltalk.method({
  6004. selector: 'scrollLeft:',
  6005. category: 'css',
  6006. fn: function (anInteger){
  6007. var self=this;
  6008. self._call_withArgument_("scrollLeft",anInteger);
  6009. return self;},
  6010. source: unescape('scrollLeft%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27scrollLeft%27%20withArgument%3A%20anInteger%0A')}),
  6011. smalltalk.JQuery);
  6012. smalltalk.addMethod(
  6013. '_scrollTop_',
  6014. smalltalk.method({
  6015. selector: 'scrollTop:',
  6016. category: 'css',
  6017. fn: function (anInteger){
  6018. var self=this;
  6019. self._call_withArgument_("scrollTop",anInteger);
  6020. return self;},
  6021. source: unescape('scrollTop%3A%20anInteger%0A%20%20%20%20self%20call%3A%20%27scrollTop%27%20withArgument%3A%20anInteger%0A')}),
  6022. smalltalk.JQuery);
  6023. smalltalk.addMethod(
  6024. '_focus',
  6025. smalltalk.method({
  6026. selector: 'focus',
  6027. category: 'events',
  6028. fn: function (){
  6029. var self=this;
  6030. self._call_("focus");
  6031. return self;},
  6032. source: unescape('focus%0A%20%20%20%20self%20call%3A%20%27focus%27%0A')}),
  6033. smalltalk.JQuery);
  6034. smalltalk.addMethod(
  6035. '_show',
  6036. smalltalk.method({
  6037. selector: 'show',
  6038. category: 'events',
  6039. fn: function (){
  6040. var self=this;
  6041. self._call_("show");
  6042. return self;},
  6043. source: unescape('show%0A%20%20%20%20self%20call%3A%20%27show%27%0A')}),
  6044. smalltalk.JQuery);
  6045. smalltalk.addMethod(
  6046. '_hide',
  6047. smalltalk.method({
  6048. selector: 'hide',
  6049. category: 'events',
  6050. fn: function (){
  6051. var self=this;
  6052. self._call_("hide");
  6053. return self;},
  6054. source: unescape('hide%0A%20%20%20%20self%20call%3A%20%27hide%27%0A')}),
  6055. smalltalk.JQuery);
  6056. smalltalk.addMethod(
  6057. '_remove',
  6058. smalltalk.method({
  6059. selector: 'remove',
  6060. category: 'events',
  6061. fn: function (){
  6062. var self=this;
  6063. self._call_("remove");
  6064. return self;},
  6065. source: unescape('remove%0A%20%20%20%20self%20call%3A%20%27remove%27%0A')}),
  6066. smalltalk.JQuery);
  6067. smalltalk.addMethod(
  6068. '_on_do_',
  6069. smalltalk.method({
  6070. selector: 'on:do:',
  6071. category: 'events',
  6072. fn: function (anEventString, aBlock){
  6073. var self=this;
  6074. (function(){self['@jquery'].bind(anEventString, aBlock)})();
  6075. return self;},
  6076. source: unescape('on%3A%20anEventString%20do%3A%20aBlock%0A%20%20%20%20%22Attach%20aBlock%20for%20anEventString%20on%20the%20element%22%0A%20%20%20%20%7B%27self%5B%27%27@jquery%27%27%5D.bind%28anEventString%2C%20aBlock%29%27%7D%0A')}),
  6077. smalltalk.JQuery);
  6078. smalltalk.addMethod(
  6079. '_removeEvents_',
  6080. smalltalk.method({
  6081. selector: 'removeEvents:',
  6082. category: 'events',
  6083. fn: function (aString){
  6084. var self=this;
  6085. self._call_withArgument_("unbind",aString);
  6086. return self;},
  6087. 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')}),
  6088. smalltalk.JQuery);
  6089. smalltalk.addMethod(
  6090. '_append_',
  6091. smalltalk.method({
  6092. selector: 'append:',
  6093. category: 'DOM insertion',
  6094. fn: function (anObject){
  6095. var self=this;
  6096. anObject._appendToJQuery_(self);
  6097. return self;},
  6098. 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')}),
  6099. smalltalk.JQuery);
  6100. smalltalk.addMethod(
  6101. '_appendElement_',
  6102. smalltalk.method({
  6103. selector: 'appendElement:',
  6104. category: 'DOM insertion',
  6105. fn: function (anElement){
  6106. var self=this;
  6107. self._call_withArgument_("append",anElement);
  6108. return self;},
  6109. 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')}),
  6110. smalltalk.JQuery);
  6111. smalltalk.addMethod(
  6112. '_appendToJQuery_',
  6113. smalltalk.method({
  6114. selector: 'appendToJQuery:',
  6115. category: 'DOM insertion',
  6116. fn: function (aJQuery){
  6117. var self=this;
  6118. aJQuery._appendElement_(self['@jquery']);
  6119. return self;},
  6120. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20aJQuery%20appendElement%3A%20jquery%0A')}),
  6121. smalltalk.JQuery);
  6122. smalltalk.addMethod(
  6123. '_contents_',
  6124. smalltalk.method({
  6125. selector: 'contents:',
  6126. category: 'DOM insertion',
  6127. fn: function (anObject){
  6128. var self=this;
  6129. self._empty();
  6130. self._append_(anObject);
  6131. return self;},
  6132. source: unescape('contents%3A%20anObject%0A%20%20%20%20self%20empty.%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  6133. smalltalk.JQuery);
  6134. smalltalk.addMethod(
  6135. '_empty',
  6136. smalltalk.method({
  6137. selector: 'empty',
  6138. category: 'DOM insertion',
  6139. fn: function (){
  6140. var self=this;
  6141. self._call_("empty");
  6142. return self;},
  6143. source: unescape('empty%0A%20%20%20%20self%20call%3A%20%27empty%27%0A')}),
  6144. smalltalk.JQuery);
  6145. smalltalk.addMethod(
  6146. '_initializeWithJQueryObject_',
  6147. smalltalk.method({
  6148. selector: 'initializeWithJQueryObject:',
  6149. category: 'initialization',
  6150. fn: function (anObject){
  6151. var self=this;
  6152. self['@jquery']=anObject;
  6153. return self;},
  6154. source: unescape('initializeWithJQueryObject%3A%20anObject%0A%20%20%20%20jquery%20%3A%3D%20anObject%0A')}),
  6155. smalltalk.JQuery);
  6156. smalltalk.addMethod(
  6157. '_call_',
  6158. smalltalk.method({
  6159. selector: 'call:',
  6160. category: 'private',
  6161. fn: function (aString){
  6162. var self=this;
  6163. return (function(){return self['@jquery'][aString]()})();
  6164. return self;},
  6165. 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')}),
  6166. smalltalk.JQuery);
  6167. smalltalk.addMethod(
  6168. '_call_withArgument_',
  6169. smalltalk.method({
  6170. selector: 'call:withArgument:',
  6171. category: 'private',
  6172. fn: function (aString, anObject){
  6173. var self=this;
  6174. return (function(){return self['@jquery'][aString](anObject)})();
  6175. return self;},
  6176. 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')}),
  6177. smalltalk.JQuery);
  6178. smalltalk.addMethod(
  6179. '_hasClass_',
  6180. smalltalk.method({
  6181. selector: 'hasClass:',
  6182. category: 'testing',
  6183. fn: function (aString){
  6184. var self=this;
  6185. return self._call_withArgument_("hasClass",aString);
  6186. return self;},
  6187. 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')}),
  6188. smalltalk.JQuery);
  6189. smalltalk.addMethod(
  6190. '_fromString_',
  6191. smalltalk.method({
  6192. selector: 'fromString:',
  6193. category: 'instance creation',
  6194. fn: function (aString){
  6195. var self=this;
  6196. var newJQuery=nil;
  6197. (function(){newJQuery = jQuery(String(aString))})();
  6198. return self._from_(newJQuery);
  6199. return self;},
  6200. 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')}),
  6201. smalltalk.JQuery.klass);
  6202. smalltalk.addMethod(
  6203. '_from_',
  6204. smalltalk.method({
  6205. selector: 'from:',
  6206. category: 'instance creation',
  6207. fn: function (anObject){
  6208. var self=this;
  6209. return (function($rec){$rec._initializeWithJQueryObject_(anObject);return $rec._yourself();})(self._new());
  6210. return self;},
  6211. source: unescape('from%3A%20anObject%0A%20%20%20%20%5Eself%20new%0A%09initializeWithJQueryObject%3A%20anObject%3B%0A%09yourself%0A')}),
  6212. smalltalk.JQuery.klass);
  6213. smalltalk.addClass('HTMLCanvas', smalltalk.Object, ['root'], 'Canvas');
  6214. smalltalk.addMethod(
  6215. '_root_',
  6216. smalltalk.method({
  6217. selector: 'root:',
  6218. category: 'accessing',
  6219. fn: function (aTagBrush){
  6220. var self=this;
  6221. self['@root']=aTagBrush;
  6222. return self;},
  6223. source: unescape('root%3A%20aTagBrush%0A%20%20%20%20root%20%3A%3D%20aTagBrush%0A')}),
  6224. smalltalk.HTMLCanvas);
  6225. smalltalk.addMethod(
  6226. '_root',
  6227. smalltalk.method({
  6228. selector: 'root',
  6229. category: 'accessing',
  6230. fn: function (){
  6231. var self=this;
  6232. return self['@root'];
  6233. return self;},
  6234. source: unescape('root%0A%20%20%20%20%5Eroot%0A')}),
  6235. smalltalk.HTMLCanvas);
  6236. smalltalk.addMethod(
  6237. '_initialize',
  6238. smalltalk.method({
  6239. selector: 'initialize',
  6240. category: 'initialization',
  6241. fn: function (){
  6242. var self=this;
  6243. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  6244. self['@root']=smalltalk.TagBrush._fromString_canvas_("div",self);
  6245. return self;},
  6246. 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')}),
  6247. smalltalk.HTMLCanvas);
  6248. smalltalk.addMethod(
  6249. '_newTag_',
  6250. smalltalk.method({
  6251. selector: 'newTag:',
  6252. category: 'tags',
  6253. fn: function (aString){
  6254. var self=this;
  6255. return smalltalk.TagBrush._fromString_canvas_(aString,self);
  6256. return self;},
  6257. source: unescape('newTag%3A%20aString%0A%20%20%20%20%5ETagBrush%20fromString%3A%20aString%20canvas%3A%20self%0A')}),
  6258. smalltalk.HTMLCanvas);
  6259. smalltalk.addMethod(
  6260. '_tag_',
  6261. smalltalk.method({
  6262. selector: 'tag:',
  6263. category: 'tags',
  6264. fn: function (aString){
  6265. var self=this;
  6266. return self['@root']._addBrush_(self._newTag_(aString));
  6267. return self;},
  6268. source: unescape('tag%3A%20aString%0A%20%20%20%20%5Eroot%20addBrush%3A%20%28self%20newTag%3A%20aString%29%0A')}),
  6269. smalltalk.HTMLCanvas);
  6270. smalltalk.addMethod(
  6271. '_h1',
  6272. smalltalk.method({
  6273. selector: 'h1',
  6274. category: 'tags',
  6275. fn: function (){
  6276. var self=this;
  6277. return self._tag_("h1");
  6278. return self;},
  6279. source: unescape('h1%0A%20%20%20%20%5Eself%20tag%3A%20%27h1%27%0A')}),
  6280. smalltalk.HTMLCanvas);
  6281. smalltalk.addMethod(
  6282. '_h2',
  6283. smalltalk.method({
  6284. selector: 'h2',
  6285. category: 'tags',
  6286. fn: function (){
  6287. var self=this;
  6288. return self._tag_("h2");
  6289. return self;},
  6290. source: unescape('h2%0A%20%20%20%20%5Eself%20tag%3A%20%27h2%27%0A')}),
  6291. smalltalk.HTMLCanvas);
  6292. smalltalk.addMethod(
  6293. '_h3',
  6294. smalltalk.method({
  6295. selector: 'h3',
  6296. category: 'tags',
  6297. fn: function (){
  6298. var self=this;
  6299. return self._tag_("h3");
  6300. return self;},
  6301. source: unescape('h3%0A%20%20%20%20%5Eself%20tag%3A%20%27h3%27%0A')}),
  6302. smalltalk.HTMLCanvas);
  6303. smalltalk.addMethod(
  6304. '_h4',
  6305. smalltalk.method({
  6306. selector: 'h4',
  6307. category: 'tags',
  6308. fn: function (){
  6309. var self=this;
  6310. return self._tag_("h4");
  6311. return self;},
  6312. source: unescape('h4%0A%20%20%20%20%5Eself%20tag%3A%20%27h4%27%0A')}),
  6313. smalltalk.HTMLCanvas);
  6314. smalltalk.addMethod(
  6315. '_h5',
  6316. smalltalk.method({
  6317. selector: 'h5',
  6318. category: 'tags',
  6319. fn: function (){
  6320. var self=this;
  6321. return self._tag_("h5");
  6322. return self;},
  6323. source: unescape('h5%0A%20%20%20%20%5Eself%20tag%3A%20%27h5%27%0A')}),
  6324. smalltalk.HTMLCanvas);
  6325. smalltalk.addMethod(
  6326. '_h6',
  6327. smalltalk.method({
  6328. selector: 'h6',
  6329. category: 'tags',
  6330. fn: function (){
  6331. var self=this;
  6332. return self._tag_("h6");
  6333. return self;},
  6334. source: unescape('h6%0A%20%20%20%20%5Eself%20tag%3A%20%27h6%27%0A')}),
  6335. smalltalk.HTMLCanvas);
  6336. smalltalk.addMethod(
  6337. '_p',
  6338. smalltalk.method({
  6339. selector: 'p',
  6340. category: 'tags',
  6341. fn: function (){
  6342. var self=this;
  6343. return self._tag_("p");
  6344. return self;},
  6345. source: unescape('p%0A%20%20%20%20%5Eself%20tag%3A%20%27p%27%0A')}),
  6346. smalltalk.HTMLCanvas);
  6347. smalltalk.addMethod(
  6348. '_div',
  6349. smalltalk.method({
  6350. selector: 'div',
  6351. category: 'tags',
  6352. fn: function (){
  6353. var self=this;
  6354. return self._tag_("div");
  6355. return self;},
  6356. source: unescape('div%0A%20%20%20%20%5Eself%20tag%3A%20%27div%27%0A')}),
  6357. smalltalk.HTMLCanvas);
  6358. smalltalk.addMethod(
  6359. '_span',
  6360. smalltalk.method({
  6361. selector: 'span',
  6362. category: 'tags',
  6363. fn: function (){
  6364. var self=this;
  6365. return self._tag_("span");
  6366. return self;},
  6367. source: unescape('span%0A%20%20%20%20%5Eself%20tag%3A%20%27span%27%0A')}),
  6368. smalltalk.HTMLCanvas);
  6369. smalltalk.addMethod(
  6370. '_img',
  6371. smalltalk.method({
  6372. selector: 'img',
  6373. category: 'tags',
  6374. fn: function (){
  6375. var self=this;
  6376. return self._tag_("img");
  6377. return self;},
  6378. source: unescape('img%0A%20%20%20%20%5Eself%20tag%3A%20%27img%27%0A')}),
  6379. smalltalk.HTMLCanvas);
  6380. smalltalk.addMethod(
  6381. '_ul',
  6382. smalltalk.method({
  6383. selector: 'ul',
  6384. category: 'tags',
  6385. fn: function (){
  6386. var self=this;
  6387. return self._tag_("ul");
  6388. return self;},
  6389. source: unescape('ul%0A%20%20%20%20%5Eself%20tag%3A%20%27ul%27%0A')}),
  6390. smalltalk.HTMLCanvas);
  6391. smalltalk.addMethod(
  6392. '_ol',
  6393. smalltalk.method({
  6394. selector: 'ol',
  6395. category: 'tags',
  6396. fn: function (){
  6397. var self=this;
  6398. return self._tag_("ol");
  6399. return self;},
  6400. source: unescape('ol%0A%20%20%20%20%5Eself%20tag%3A%20%27ol%27%0A')}),
  6401. smalltalk.HTMLCanvas);
  6402. smalltalk.addMethod(
  6403. '_li',
  6404. smalltalk.method({
  6405. selector: 'li',
  6406. category: 'tags',
  6407. fn: function (){
  6408. var self=this;
  6409. return self._tag_("li");
  6410. return self;},
  6411. source: unescape('li%0A%20%20%20%20%5Eself%20tag%3A%20%27li%27%0A')}),
  6412. smalltalk.HTMLCanvas);
  6413. smalltalk.addMethod(
  6414. '_table',
  6415. smalltalk.method({
  6416. selector: 'table',
  6417. category: 'tags',
  6418. fn: function (){
  6419. var self=this;
  6420. return self._tag_("table");
  6421. return self;},
  6422. source: unescape('table%0A%20%20%20%20%5Eself%20tag%3A%20%27table%27%0A')}),
  6423. smalltalk.HTMLCanvas);
  6424. smalltalk.addMethod(
  6425. '_tr',
  6426. smalltalk.method({
  6427. selector: 'tr',
  6428. category: 'tags',
  6429. fn: function (){
  6430. var self=this;
  6431. return self._tag_("tr");
  6432. return self;},
  6433. source: unescape('tr%0A%20%20%20%20%5Eself%20tag%3A%20%27tr%27%0A')}),
  6434. smalltalk.HTMLCanvas);
  6435. smalltalk.addMethod(
  6436. '_td',
  6437. smalltalk.method({
  6438. selector: 'td',
  6439. category: 'tags',
  6440. fn: function (){
  6441. var self=this;
  6442. return self._tag_("td");
  6443. return self;},
  6444. source: unescape('td%20%0A%20%20%20%20%5Eself%20tag%3A%20%27td%27%0A')}),
  6445. smalltalk.HTMLCanvas);
  6446. smalltalk.addMethod(
  6447. '_th',
  6448. smalltalk.method({
  6449. selector: 'th',
  6450. category: 'tags',
  6451. fn: function (){
  6452. var self=this;
  6453. return self._tag_("th");
  6454. return self;},
  6455. source: unescape('th%0A%20%20%20%20%5Eself%20tag%3A%20%27th%27%0A')}),
  6456. smalltalk.HTMLCanvas);
  6457. smalltalk.addMethod(
  6458. '_form',
  6459. smalltalk.method({
  6460. selector: 'form',
  6461. category: 'tags',
  6462. fn: function (){
  6463. var self=this;
  6464. return self._tag_("form");
  6465. return self;},
  6466. source: unescape('form%0A%20%20%20%20%5Eself%20tag%3A%20%27form%27%0A')}),
  6467. smalltalk.HTMLCanvas);
  6468. smalltalk.addMethod(
  6469. '_input',
  6470. smalltalk.method({
  6471. selector: 'input',
  6472. category: 'tags',
  6473. fn: function (){
  6474. var self=this;
  6475. return self._tag_("input");
  6476. return self;},
  6477. source: unescape('input%0A%20%20%20%20%5Eself%20tag%3A%20%27input%27%0A')}),
  6478. smalltalk.HTMLCanvas);
  6479. smalltalk.addMethod(
  6480. '_button',
  6481. smalltalk.method({
  6482. selector: 'button',
  6483. category: 'tags',
  6484. fn: function (){
  6485. var self=this;
  6486. return self._tag_("button");
  6487. return self;},
  6488. source: unescape('button%0A%20%20%20%20%5Eself%20tag%3A%20%27button%27%0A')}),
  6489. smalltalk.HTMLCanvas);
  6490. smalltalk.addMethod(
  6491. '_select',
  6492. smalltalk.method({
  6493. selector: 'select',
  6494. category: 'tags',
  6495. fn: function (){
  6496. var self=this;
  6497. return self._tag_("select");
  6498. return self;},
  6499. source: unescape('select%0A%20%20%20%20%5Eself%20tag%3A%20%27select%27%0A')}),
  6500. smalltalk.HTMLCanvas);
  6501. smalltalk.addMethod(
  6502. '_option',
  6503. smalltalk.method({
  6504. selector: 'option',
  6505. category: 'tags',
  6506. fn: function (){
  6507. var self=this;
  6508. return self._tag_("option");
  6509. return self;},
  6510. source: unescape('option%0A%20%20%20%20%5Eself%20tag%3A%20%27option%27%0A')}),
  6511. smalltalk.HTMLCanvas);
  6512. smalltalk.addMethod(
  6513. '_textarea',
  6514. smalltalk.method({
  6515. selector: 'textarea',
  6516. category: 'tags',
  6517. fn: function (){
  6518. var self=this;
  6519. return self._tag_("textarea");
  6520. return self;},
  6521. source: unescape('textarea%0A%20%20%20%20%5Eself%20tag%3A%20%27textarea%27%0A')}),
  6522. smalltalk.HTMLCanvas);
  6523. smalltalk.addMethod(
  6524. '_a',
  6525. smalltalk.method({
  6526. selector: 'a',
  6527. category: 'tags',
  6528. fn: function (){
  6529. var self=this;
  6530. return self._tag_("a");
  6531. return self;},
  6532. source: unescape('a%0A%20%20%20%20%5Eself%20tag%3A%20%27a%27%0A')}),
  6533. smalltalk.HTMLCanvas);
  6534. smalltalk.addMethod(
  6535. '_appendToJQuery_',
  6536. smalltalk.method({
  6537. selector: 'appendToJQuery:',
  6538. category: '*JQuery',
  6539. fn: function (aJQuery){
  6540. var self=this;
  6541. aJQuery._appendElement_(self['@root']._element());
  6542. return self;},
  6543. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20aJQuery%20appendElement%3A%20root%20element%0A')}),
  6544. smalltalk.HTMLCanvas);
  6545. smalltalk.addClass('TagBrush', smalltalk.Object, ['element'], 'Canvas');
  6546. smalltalk.addMethod(
  6547. '_contents_',
  6548. smalltalk.method({
  6549. selector: 'contents:',
  6550. category: 'adding',
  6551. fn: function (anObject){
  6552. var self=this;
  6553. self._asJQuery()._empty();
  6554. self._append_(anObject);
  6555. return self;},
  6556. source: unescape('contents%3A%20anObject%0A%20%20%20%20self%20asJQuery%20empty.%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  6557. smalltalk.TagBrush);
  6558. smalltalk.addMethod(
  6559. '_addBrush_',
  6560. smalltalk.method({
  6561. selector: 'addBrush:',
  6562. category: 'adding',
  6563. fn: function (aTagBrush){
  6564. var self=this;
  6565. self._appendChild_(aTagBrush._element());
  6566. return aTagBrush;
  6567. return self;},
  6568. source: unescape('addBrush%3A%20aTagBrush%0A%20%20%20%20self%20appendChild%3A%20aTagBrush%20element.%0A%20%20%20%20%5EaTagBrush%0A')}),
  6569. smalltalk.TagBrush);
  6570. smalltalk.addMethod(
  6571. '_with_',
  6572. smalltalk.method({
  6573. selector: 'with:',
  6574. category: 'adding',
  6575. fn: function (anObject){
  6576. var self=this;
  6577. self._append_(anObject);
  6578. return self;},
  6579. source: unescape('with%3A%20anObject%0A%20%20%20%20self%20append%3A%20anObject%0A')}),
  6580. smalltalk.TagBrush);
  6581. smalltalk.addMethod(
  6582. '_append_',
  6583. smalltalk.method({
  6584. selector: 'append:',
  6585. category: 'adding',
  6586. fn: function (anObject){
  6587. var self=this;
  6588. anObject._appendToBrush_(self);
  6589. return self;},
  6590. source: unescape('append%3A%20anObject%0A%20%20%20%20anObject%20appendToBrush%3A%20self%0A')}),
  6591. smalltalk.TagBrush);
  6592. smalltalk.addMethod(
  6593. '_appendToBrush_',
  6594. smalltalk.method({
  6595. selector: 'appendToBrush:',
  6596. category: 'adding',
  6597. fn: function (aTagBrush){
  6598. var self=this;
  6599. aTagBrush._addBrush_(self);
  6600. return self;},
  6601. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20aTagBrush%20addBrush%3A%20self%0A')}),
  6602. smalltalk.TagBrush);
  6603. smalltalk.addMethod(
  6604. '_appendBlock_',
  6605. smalltalk.method({
  6606. selector: 'appendBlock:',
  6607. category: 'adding',
  6608. fn: function (aBlock){
  6609. var self=this;
  6610. var root=nil;
  6611. root=canvas._root();
  6612. canvas._root_(self);
  6613. aBlock._value_(canvas);
  6614. canvas._root_(root);
  6615. return self;},
  6616. 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')}),
  6617. smalltalk.TagBrush);
  6618. smalltalk.addMethod(
  6619. '_appendChild_',
  6620. smalltalk.method({
  6621. selector: 'appendChild:',
  6622. category: 'adding',
  6623. fn: function (anElement){
  6624. var self=this;
  6625. (function(){self['@element'].appendChild(anElement)})();
  6626. return self;},
  6627. 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')}),
  6628. smalltalk.TagBrush);
  6629. smalltalk.addMethod(
  6630. '_appendString_',
  6631. smalltalk.method({
  6632. selector: 'appendString:',
  6633. category: 'adding',
  6634. fn: function (aString){
  6635. var self=this;
  6636. self._appendChild_(self._createTextNodeFor_(aString));
  6637. return self;},
  6638. source: unescape('appendString%3A%20aString%0A%20%20%20%20self%20appendChild%3A%20%28self%20createTextNodeFor%3A%20aString%29%0A')}),
  6639. smalltalk.TagBrush);
  6640. smalltalk.addMethod(
  6641. '_at_put_',
  6642. smalltalk.method({
  6643. selector: 'at:put:',
  6644. category: 'attributes',
  6645. fn: function (aString, aValue){
  6646. var self=this;
  6647. (function(){self['@element'].setAttribute(aString, aValue)})();
  6648. return self;},
  6649. 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')}),
  6650. smalltalk.TagBrush);
  6651. smalltalk.addMethod(
  6652. '_removeAt_',
  6653. smalltalk.method({
  6654. selector: 'removeAt:',
  6655. category: 'attributes',
  6656. fn: function (aString){
  6657. var self=this;
  6658. (function(){self['@element'].removeAttribute(aString)})();
  6659. return self;},
  6660. 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')}),
  6661. smalltalk.TagBrush);
  6662. smalltalk.addMethod(
  6663. '_class_',
  6664. smalltalk.method({
  6665. selector: 'class:',
  6666. category: 'attributes',
  6667. fn: function (aString){
  6668. var self=this;
  6669. self._at_put_("class",aString);
  6670. return self;},
  6671. source: unescape('class%3A%20aString%0A%20%20%20%20self%20at%3A%20%27class%27%20put%3A%20aString%0A')}),
  6672. smalltalk.TagBrush);
  6673. smalltalk.addMethod(
  6674. '_id_',
  6675. smalltalk.method({
  6676. selector: 'id:',
  6677. category: 'attributes',
  6678. fn: function (aString){
  6679. var self=this;
  6680. self._at_put_("id",aString);
  6681. return self;},
  6682. source: unescape('id%3A%20aString%0A%20%20%20%20self%20at%3A%20%27id%27%20put%3A%20aString%0A')}),
  6683. smalltalk.TagBrush);
  6684. smalltalk.addMethod(
  6685. '_src_',
  6686. smalltalk.method({
  6687. selector: 'src:',
  6688. category: 'attributes',
  6689. fn: function (aString){
  6690. var self=this;
  6691. self._at_put_("src",aString);
  6692. return self;},
  6693. source: unescape('src%3A%20aString%0A%20%20%20%20self%20%20at%3A%20%27src%27%20put%3A%20aString%0A')}),
  6694. smalltalk.TagBrush);
  6695. smalltalk.addMethod(
  6696. '_href_',
  6697. smalltalk.method({
  6698. selector: 'href:',
  6699. category: 'attributes',
  6700. fn: function (aString){
  6701. var self=this;
  6702. self._at_put_("href",aString);
  6703. return self;},
  6704. source: unescape('href%3A%20aString%0A%20%20%20%20self%20at%3A%20%27href%27%20put%3A%20aString%0A')}),
  6705. smalltalk.TagBrush);
  6706. smalltalk.addMethod(
  6707. '_title_',
  6708. smalltalk.method({
  6709. selector: 'title:',
  6710. category: 'attributes',
  6711. fn: function (aString){
  6712. var self=this;
  6713. self._at_put_("title",aString);
  6714. return self;},
  6715. source: unescape('title%3A%20aString%0A%20%20%20%20self%20at%3A%20%27title%27%20put%3A%20aString%0A')}),
  6716. smalltalk.TagBrush);
  6717. smalltalk.addMethod(
  6718. '_style_',
  6719. smalltalk.method({
  6720. selector: 'style:',
  6721. category: 'attributes',
  6722. fn: function (aString){
  6723. var self=this;
  6724. self._at_put_("style",aString);
  6725. return self;},
  6726. source: unescape('style%3A%20aString%0A%20%20%20%20self%20at%3A%20%27style%27%20put%3A%20aString%0A')}),
  6727. smalltalk.TagBrush);
  6728. smalltalk.addMethod(
  6729. '_initializeFromString_canvas_',
  6730. smalltalk.method({
  6731. selector: 'initializeFromString:canvas:',
  6732. category: 'initialization',
  6733. fn: function (aString, aCanvas){
  6734. var self=this;
  6735. self['@element']=self._createElementFor_(aString);
  6736. canvas=aCanvas;
  6737. return self;},
  6738. 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')}),
  6739. smalltalk.TagBrush);
  6740. smalltalk.addMethod(
  6741. '_element',
  6742. smalltalk.method({
  6743. selector: 'element',
  6744. category: 'accessing',
  6745. fn: function (){
  6746. var self=this;
  6747. return self['@element'];
  6748. return self;},
  6749. source: unescape('element%0A%20%20%20%20%5Eelement%0A')}),
  6750. smalltalk.TagBrush);
  6751. smalltalk.addMethod(
  6752. '_asJQuery',
  6753. smalltalk.method({
  6754. selector: 'asJQuery',
  6755. category: 'converting',
  6756. fn: function (){
  6757. var self=this;
  6758. return (function(){return smalltalk.JQuery._from_(jQuery(self['@element']))})();
  6759. return self;},
  6760. 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')}),
  6761. smalltalk.TagBrush);
  6762. smalltalk.addMethod(
  6763. '_onKeyDown_',
  6764. smalltalk.method({
  6765. selector: 'onKeyDown:',
  6766. category: 'events',
  6767. fn: function (aBlock){
  6768. var self=this;
  6769. self._asJQuery()._on_do_("keydown",aBlock);
  6770. return self;},
  6771. source: unescape('onKeyDown%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keydown%27%20do%3A%20aBlock%0A')}),
  6772. smalltalk.TagBrush);
  6773. smalltalk.addMethod(
  6774. '_onKeyPress_',
  6775. smalltalk.method({
  6776. selector: 'onKeyPress:',
  6777. category: 'events',
  6778. fn: function (aBlock){
  6779. var self=this;
  6780. self._asJQuery()._on_do_("keypress",aBlock);
  6781. return self;},
  6782. source: unescape('onKeyPress%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keypress%27%20do%3A%20aBlock%0A')}),
  6783. smalltalk.TagBrush);
  6784. smalltalk.addMethod(
  6785. '_onKeyUp_',
  6786. smalltalk.method({
  6787. selector: 'onKeyUp:',
  6788. category: 'events',
  6789. fn: function (aBlock){
  6790. var self=this;
  6791. self._asJQuery()._on_do_("keyup",aBlock);
  6792. return self;},
  6793. source: unescape('onKeyUp%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27keyup%27%20do%3A%20aBlock%0A')}),
  6794. smalltalk.TagBrush);
  6795. smalltalk.addMethod(
  6796. '_onFocus_',
  6797. smalltalk.method({
  6798. selector: 'onFocus:',
  6799. category: 'events',
  6800. fn: function (aBlock){
  6801. var self=this;
  6802. self._asJQuery()._on_do_("focus",aBlock);
  6803. return self;},
  6804. source: unescape('onFocus%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27focus%27%20do%3A%20aBlock%0A')}),
  6805. smalltalk.TagBrush);
  6806. smalltalk.addMethod(
  6807. '_onBlur_',
  6808. smalltalk.method({
  6809. selector: 'onBlur:',
  6810. category: 'events',
  6811. fn: function (aBlock){
  6812. var self=this;
  6813. self._asJQuery()._on_do_("blur",aBlock);
  6814. return self;},
  6815. source: unescape('onBlur%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27blur%27%20do%3A%20aBlock%0A')}),
  6816. smalltalk.TagBrush);
  6817. smalltalk.addMethod(
  6818. '_onChange_',
  6819. smalltalk.method({
  6820. selector: 'onChange:',
  6821. category: 'events',
  6822. fn: function (aBlock){
  6823. var self=this;
  6824. self._asJQuery()._on_do_("change",aBlock);
  6825. return self;},
  6826. source: unescape('onChange%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27change%27%20do%3A%20aBlock%0A')}),
  6827. smalltalk.TagBrush);
  6828. smalltalk.addMethod(
  6829. '_onClick_',
  6830. smalltalk.method({
  6831. selector: 'onClick:',
  6832. category: 'events',
  6833. fn: function (aBlock){
  6834. var self=this;
  6835. self._asJQuery()._on_do_("click",aBlock);
  6836. return self;},
  6837. source: unescape('onClick%3A%20aBlock%0A%20%20%20%20self%20asJQuery%20on%3A%20%27click%27%20do%3A%20aBlock%0A')}),
  6838. smalltalk.TagBrush);
  6839. smalltalk.addMethod(
  6840. '_createElementFor_',
  6841. smalltalk.method({
  6842. selector: 'createElementFor:',
  6843. category: 'private',
  6844. fn: function (aString){
  6845. var self=this;
  6846. return (function(){return document.createElement(String(aString))})();
  6847. return self;},
  6848. source: unescape('createElementFor%3A%20aString%0A%20%20%20%20%5E%7B%27return%20document.createElement%28String%28aString%29%29%27%7D%0A')}),
  6849. smalltalk.TagBrush);
  6850. smalltalk.addMethod(
  6851. '_createTextNodeFor_',
  6852. smalltalk.method({
  6853. selector: 'createTextNodeFor:',
  6854. category: 'private',
  6855. fn: function (aString){
  6856. var self=this;
  6857. return (function(){return document.createTextNode(String(aString))})();
  6858. return self;},
  6859. source: unescape('createTextNodeFor%3A%20aString%0A%20%20%20%20%5E%7B%27return%20document.createTextNode%28String%28aString%29%29%27%7D%0A')}),
  6860. smalltalk.TagBrush);
  6861. smalltalk.addMethod(
  6862. '_fromString_canvas_',
  6863. smalltalk.method({
  6864. selector: 'fromString:canvas:',
  6865. category: 'instance creation',
  6866. fn: function (aString, aCanvas){
  6867. var self=this;
  6868. return (function($rec){$rec._initializeFromString_canvas_(aString,aCanvas);return $rec._yourself();})(self._new());
  6869. return self;},
  6870. 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')}),
  6871. smalltalk.TagBrush.klass);
  6872. smalltalk.addClass('Widget', smalltalk.Object, ['root'], 'Canvas');
  6873. smalltalk.addMethod(
  6874. '_root',
  6875. smalltalk.method({
  6876. selector: 'root',
  6877. category: 'accessing',
  6878. fn: function (){
  6879. var self=this;
  6880. return self['@root'];
  6881. return self;},
  6882. source: unescape('root%0A%20%20%20%20%5Eroot%0A')}),
  6883. smalltalk.Widget);
  6884. smalltalk.addMethod(
  6885. '_appendToBrush_',
  6886. smalltalk.method({
  6887. selector: 'appendToBrush:',
  6888. category: 'adding',
  6889. fn: function (aTagBrush){
  6890. var self=this;
  6891. self._appendToJQuery_(aTagBrush._asJQuery());
  6892. return self;},
  6893. source: unescape('appendToBrush%3A%20aTagBrush%0A%20%20%20%20self%20appendToJQuery%3A%20aTagBrush%20asJQuery%0A')}),
  6894. smalltalk.Widget);
  6895. smalltalk.addMethod(
  6896. '_appendToJQuery_',
  6897. smalltalk.method({
  6898. selector: 'appendToJQuery:',
  6899. category: 'adding',
  6900. fn: function (aJQuery){
  6901. var self=this;
  6902. self._render();
  6903. aJQuery._append_(self._root()._asJQuery());
  6904. return self;},
  6905. source: unescape('appendToJQuery%3A%20aJQuery%0A%20%20%20%20self%20render.%0A%20%20%20%20aJQuery%20append%3A%20self%20root%20asJQuery%0A')}),
  6906. smalltalk.Widget);
  6907. smalltalk.addMethod(
  6908. '_confirm_',
  6909. smalltalk.method({
  6910. selector: 'confirm:',
  6911. category: 'actions',
  6912. fn: function (aString){
  6913. var self=this;
  6914. return (function(){return window.confirm(aString)})();
  6915. return self;},
  6916. source: unescape('confirm%3A%20aString%0A%20%20%20%20%5E%7B%27return%20window.confirm%28aString%29%27%7D%0A')}),
  6917. smalltalk.Widget);
  6918. smalltalk.addMethod(
  6919. '_prompt_',
  6920. smalltalk.method({
  6921. selector: 'prompt:',
  6922. category: 'actions',
  6923. fn: function (aString){
  6924. var self=this;
  6925. return self._prompt_default_(aString,"");
  6926. return self;},
  6927. source: unescape('prompt%3A%20aString%0A%20%20%20%20%5Eself%20prompt%3A%20aString%20default%3A%20%27%27%0A')}),
  6928. smalltalk.Widget);
  6929. smalltalk.addMethod(
  6930. '_prompt_default_',
  6931. smalltalk.method({
  6932. selector: 'prompt:default:',
  6933. category: 'actions',
  6934. fn: function (aString, anotherString){
  6935. var self=this;
  6936. return (function(){return window.prompt(aString, anotherString)})();
  6937. return self;},
  6938. 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')}),
  6939. smalltalk.Widget);
  6940. smalltalk.addMethod(
  6941. '_update',
  6942. smalltalk.method({
  6943. selector: 'update',
  6944. category: 'actions',
  6945. fn: function (){
  6946. var self=this;
  6947. var canvas=nil;
  6948. canvas=smalltalk.HTMLCanvas._new();
  6949. canvas._root_(self._root());
  6950. self._root()._asJQuery()._empty();
  6951. self._renderOn_(canvas);
  6952. return self;},
  6953. 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')}),
  6954. smalltalk.Widget);
  6955. smalltalk.addMethod(
  6956. '_render',
  6957. smalltalk.method({
  6958. selector: 'render',
  6959. category: 'rendering',
  6960. fn: function (){
  6961. var self=this;
  6962. var canvas=nil;
  6963. canvas=smalltalk.HTMLCanvas._new();
  6964. self['@root']=canvas._root();
  6965. self._renderOn_(canvas);
  6966. return self;},
  6967. 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')}),
  6968. smalltalk.Widget);
  6969. smalltalk.addMethod(
  6970. '_renderOn_',
  6971. smalltalk.method({
  6972. selector: 'renderOn:',
  6973. category: 'rendering',
  6974. fn: function (html){
  6975. var self=this;
  6976. self;
  6977. return self;},
  6978. source: unescape('renderOn%3A%20html%0A%20%20%20%20self%0A')}),
  6979. smalltalk.Widget);
  6980. smalltalk.addClass('Counter', smalltalk.Widget, ['count'], 'Canvas');
  6981. smalltalk.addMethod(
  6982. '_initialize',
  6983. smalltalk.method({
  6984. selector: 'initialize',
  6985. category: 'initialization',
  6986. fn: function (){
  6987. var self=this;
  6988. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  6989. self['@count']=(0);
  6990. return self;},
  6991. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20count%20%3A%3D%200%0A')}),
  6992. smalltalk.Counter);
  6993. smalltalk.addMethod(
  6994. '_renderOn_',
  6995. smalltalk.method({
  6996. selector: 'renderOn:',
  6997. category: 'rendering',
  6998. fn: function (html){
  6999. var self=this;
  7000. html._h1()._with_(self['@count']._asString());
  7001. (function($rec){$rec._with_(unescape("++"));return $rec._onClick_((function(){return self._increase();}));})(html._button());
  7002. (function($rec){$rec._with_(unescape("--"));return $rec._onClick_((function(){return self._decrease();}));})(html._button());
  7003. return self;},
  7004. 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')}),
  7005. smalltalk.Counter);
  7006. smalltalk.addMethod(
  7007. '_increase',
  7008. smalltalk.method({
  7009. selector: 'increase',
  7010. category: 'actions',
  7011. fn: function (){
  7012. var self=this;
  7013. self['@count']=self['@count'].__plus((1));
  7014. self._update();
  7015. return self;},
  7016. source: unescape('increase%0A%20%20%20%20count%20%3A%3D%20count%20+%201.%0A%20%20%20%20self%20update%0A')}),
  7017. smalltalk.Counter);
  7018. smalltalk.addMethod(
  7019. '_decrease',
  7020. smalltalk.method({
  7021. selector: 'decrease',
  7022. category: 'actions',
  7023. fn: function (){
  7024. var self=this;
  7025. self['@count']=self['@count'].__minus((1));
  7026. self._update();
  7027. return self;},
  7028. source: unescape('decrease%0A%20%20%20%20count%20%3A%3D%20count%20-%201.%0A%20%20%20%20self%20update%0A')}),
  7029. smalltalk.Counter);
  7030. smalltalk.addClass('TabManager', smalltalk.Widget, ['selectedTab', 'tabs', 'opened'], 'IDE');
  7031. smalltalk.addMethod(
  7032. '_initialize',
  7033. smalltalk.method({
  7034. selector: 'initialize',
  7035. category: 'initialization',
  7036. fn: function (){
  7037. var self=this;
  7038. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  7039. self['@opened']=true;
  7040. (function($rec){$rec._append_(self);$rec._append_((function(html){return html._div()._id_("jtalk");}));return $rec._addClass_("jtalkBody");})("body"._asJQuery());
  7041. (function($rec){$rec._addTab_(smalltalk.Transcript._current());return $rec._addTab_(smalltalk.Workspace._new());})(self);
  7042. self._selectTab_(self._tabs()._last());
  7043. (function($rec){$rec._onResize_((function(){return self._updateBodyMargin();}));return $rec._updatePositionOnWindowResize();})(self);
  7044. return self;},
  7045. 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%5D%3B%0A%09updatePositionOnWindowResize%0A')}),
  7046. smalltalk.TabManager);
  7047. smalltalk.addMethod(
  7048. '_tabs',
  7049. smalltalk.method({
  7050. selector: 'tabs',
  7051. category: 'accessing',
  7052. fn: function (){
  7053. var self=this;
  7054. return self['@tabs']._ifNil_((function(){return self['@tabs']=smalltalk.Array._new();}));
  7055. return self;},
  7056. source: unescape('tabs%0A%20%20%20%20%5Etabs%20ifNil%3A%20%5Btabs%20%3A%3D%20Array%20new%5D%0A')}),
  7057. smalltalk.TabManager);
  7058. smalltalk.addMethod(
  7059. '_addTab_',
  7060. smalltalk.method({
  7061. selector: 'addTab:',
  7062. category: 'adding/Removing',
  7063. fn: function (aWidget){
  7064. var self=this;
  7065. self._tabs()._add_(aWidget);
  7066. unescape("%23jtalk")._asJQuery()._append_(aWidget);
  7067. aWidget._root()._asJQuery()._hide();
  7068. return self;},
  7069. 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')}),
  7070. smalltalk.TabManager);
  7071. smalltalk.addMethod(
  7072. '_removeTab_',
  7073. smalltalk.method({
  7074. selector: 'removeTab:',
  7075. category: 'adding/Removing',
  7076. fn: function (aWidget){
  7077. var self=this;
  7078. self._tabs()._remove_(aWidget);
  7079. self._update();
  7080. return self;},
  7081. source: unescape('removeTab%3A%20aWidget%0A%20%20%20%20self%20tabs%20remove%3A%20aWidget.%0A%20%20%20%20self%20update%0A')}),
  7082. smalltalk.TabManager);
  7083. smalltalk.addMethod(
  7084. '_updateBodyMargin',
  7085. smalltalk.method({
  7086. selector: 'updateBodyMargin',
  7087. category: 'actions',
  7088. fn: function (){
  7089. var self=this;
  7090. self._setBodyMargin_(unescape("%23jtalk")._asJQuery()._height().__plus((27)));
  7091. return self;},
  7092. source: unescape('updateBodyMargin%0A%20%20%20%20self%20setBodyMargin%3A%20%27%23jtalk%27%20asJQuery%20height%20+%2027%0A')}),
  7093. smalltalk.TabManager);
  7094. smalltalk.addMethod(
  7095. '_removeBodyMargin',
  7096. smalltalk.method({
  7097. selector: 'removeBodyMargin',
  7098. category: 'actions',
  7099. fn: function (){
  7100. var self=this;
  7101. self._setBodyMargin_((0));
  7102. return self;},
  7103. source: unescape('removeBodyMargin%0A%20%20%20%20self%20setBodyMargin%3A%200%0A')}),
  7104. smalltalk.TabManager);
  7105. smalltalk.addMethod(
  7106. '_setBodyMargin_',
  7107. smalltalk.method({
  7108. selector: 'setBodyMargin:',
  7109. category: 'actions',
  7110. fn: function (anInteger){
  7111. var self=this;
  7112. ".jtalkBody"._asJQuery()._cssAt_put_(unescape("margin-bottom"),anInteger._asString().__comma("px"));
  7113. return self;},
  7114. 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')}),
  7115. smalltalk.TabManager);
  7116. smalltalk.addMethod(
  7117. '_onResize_',
  7118. smalltalk.method({
  7119. selector: 'onResize:',
  7120. category: 'actions',
  7121. fn: function (aBlock){
  7122. var self=this;
  7123. (function(){jQuery('#jtalk').resizable({handles: 'n', stop: aBlock, minHeight: 230});})();
  7124. return self;},
  7125. source: unescape('onResize%3A%20aBlock%0A%20%20%20%20%7B%27jQuery%28%27%27%23jtalk%27%27%29.resizable%28%7Bhandles%3A%20%27%27n%27%27%2C%20stop%3A%20aBlock%2C%20minHeight%3A%20230%7D%29%3B%27%7D%0A')}),
  7126. smalltalk.TabManager);
  7127. smalltalk.addMethod(
  7128. '_updatePositionOnWindowResize',
  7129. smalltalk.method({
  7130. selector: 'updatePositionOnWindowResize',
  7131. category: 'actions',
  7132. fn: function (){
  7133. var self=this;
  7134. (function(){jQuery(window).resize(function(e){jQuery('#jtalk').css('top', '').css('bottom', '27px')});})();
  7135. return self;},
  7136. source: unescape('updatePositionOnWindowResize%0A%20%20%20%20%7B%27jQuery%28window%29.resize%28function%28e%29%7BjQuery%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%7D%29%3B%27%7D%0A')}),
  7137. smalltalk.TabManager);
  7138. smalltalk.addMethod(
  7139. '_open',
  7140. smalltalk.method({
  7141. selector: 'open',
  7142. category: 'actions',
  7143. fn: function (){
  7144. var self=this;
  7145. 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;}));
  7146. return self;},
  7147. 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')}),
  7148. smalltalk.TabManager);
  7149. smalltalk.addMethod(
  7150. '_close',
  7151. smalltalk.method({
  7152. selector: 'close',
  7153. category: 'actions',
  7154. fn: function (){
  7155. var self=this;
  7156. self['@opened']._ifTrue_((function(){self._root()._asJQuery()._hide();unescape("%23jtalk")._asJQuery()._hide();self._removeBodyMargin();"body"._asJQuery()._removeClass_("jtalkBody");return self['@opened']=false;}));
  7157. return self;},
  7158. 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')}),
  7159. smalltalk.TabManager);
  7160. smalltalk.addMethod(
  7161. '_newBrowserTab',
  7162. smalltalk.method({
  7163. selector: 'newBrowserTab',
  7164. category: 'actions',
  7165. fn: function (){
  7166. var self=this;
  7167. smalltalk.Browser._open();
  7168. return self;},
  7169. source: unescape('newBrowserTab%0A%20%20%20%20Browser%20open%0A')}),
  7170. smalltalk.TabManager);
  7171. smalltalk.addMethod(
  7172. '_selectTab_',
  7173. smalltalk.method({
  7174. selector: 'selectTab:',
  7175. category: 'actions',
  7176. fn: function (aWidget){
  7177. var self=this;
  7178. self._open();
  7179. self['@selectedTab']=aWidget;
  7180. self._tabs()._do_((function(each){return each._root()._asJQuery()._hide();}));
  7181. aWidget._root()._asJQuery()._show();
  7182. self._update();
  7183. return self;},
  7184. 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')}),
  7185. smalltalk.TabManager);
  7186. smalltalk.addMethod(
  7187. '_closeTab_',
  7188. smalltalk.method({
  7189. selector: 'closeTab:',
  7190. category: 'actions',
  7191. fn: function (aWidget){
  7192. var self=this;
  7193. self._removeTab_(aWidget);
  7194. self._selectTab_(self._tabs()._last());
  7195. aWidget._root()._asJQuery()._remove();
  7196. self._update();
  7197. return self;},
  7198. 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')}),
  7199. smalltalk.TabManager);
  7200. smalltalk.addMethod(
  7201. '_renderOn_',
  7202. smalltalk.method({
  7203. selector: 'renderOn:',
  7204. category: 'rendering',
  7205. fn: function (html){
  7206. var self=this;
  7207. (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());
  7208. return self;},
  7209. 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')}),
  7210. smalltalk.TabManager);
  7211. smalltalk.addMethod(
  7212. '_renderTabFor_on_',
  7213. smalltalk.method({
  7214. selector: 'renderTabFor:on:',
  7215. category: 'rendering',
  7216. fn: function (aWidget, html){
  7217. var self=this;
  7218. var li=nil;
  7219. li=html._li();
  7220. self['@selectedTab'].__eq(aWidget)._ifTrue_((function(){return li._class_("selected");}));
  7221. 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());}));}));
  7222. return self;},
  7223. 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')}),
  7224. smalltalk.TabManager);
  7225. smalltalk.TabManager.klass.iVarNames = ['current'];
  7226. smalltalk.addMethod(
  7227. '_current',
  7228. smalltalk.method({
  7229. selector: 'current',
  7230. category: 'instance creation',
  7231. fn: function (){
  7232. var self=this;
  7233. return self['@current']._ifNil_((function(){return self['@current']=self.klass.superclass.fn.prototype['_new'].apply(self, []);}));
  7234. return self;},
  7235. source: unescape('current%0A%20%20%20%20%5Ecurrent%20ifNil%3A%20%5Bcurrent%20%3A%3D%20super%20new%5D%0A')}),
  7236. smalltalk.TabManager.klass);
  7237. smalltalk.addMethod(
  7238. '_new',
  7239. smalltalk.method({
  7240. selector: 'new',
  7241. category: 'instance creation',
  7242. fn: function (){
  7243. var self=this;
  7244. self._shouldNotImplement();
  7245. return self;},
  7246. source: unescape('new%0A%20%20%20%20self%20shouldNotImplement%0A')}),
  7247. smalltalk.TabManager.klass);
  7248. smalltalk.addClass('TabWidget', smalltalk.Widget, [], 'IDE');
  7249. smalltalk.addMethod(
  7250. '_label',
  7251. smalltalk.method({
  7252. selector: 'label',
  7253. category: 'accessing',
  7254. fn: function (){
  7255. var self=this;
  7256. self._subclassResponsibility();
  7257. return self;},
  7258. source: unescape('label%0A%20%20%20%20self%20subclassResponsibility%0A')}),
  7259. smalltalk.TabWidget);
  7260. smalltalk.addMethod(
  7261. '_open',
  7262. smalltalk.method({
  7263. selector: 'open',
  7264. category: 'actions',
  7265. fn: function (){
  7266. var self=this;
  7267. (function($rec){$rec._addTab_(self);return $rec._selectTab_(self);})(smalltalk.TabManager._current());
  7268. return self;},
  7269. source: unescape('open%0A%20%20%20%20TabManager%20current%0A%09addTab%3A%20self%3B%0A%09selectTab%3A%20self%0A')}),
  7270. smalltalk.TabWidget);
  7271. smalltalk.addMethod(
  7272. '_canBeClosed',
  7273. smalltalk.method({
  7274. selector: 'canBeClosed',
  7275. category: 'testing',
  7276. fn: function (){
  7277. var self=this;
  7278. return false;
  7279. return self;},
  7280. source: unescape('canBeClosed%0A%20%20%20%20%5Efalse%0A')}),
  7281. smalltalk.TabWidget);
  7282. smalltalk.addMethod(
  7283. '_renderOn_',
  7284. smalltalk.method({
  7285. selector: 'renderOn:',
  7286. category: 'rendering',
  7287. fn: function (html){
  7288. var self=this;
  7289. (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());
  7290. return self;},
  7291. 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')}),
  7292. smalltalk.TabWidget);
  7293. smalltalk.addMethod(
  7294. '_renderBoxOn_',
  7295. smalltalk.method({
  7296. selector: 'renderBoxOn:',
  7297. category: 'rendering',
  7298. fn: function (html){
  7299. var self=this;
  7300. return self;},
  7301. source: unescape('renderBoxOn%3A%20html%0A')}),
  7302. smalltalk.TabWidget);
  7303. smalltalk.addMethod(
  7304. '_renderButtonsOn_',
  7305. smalltalk.method({
  7306. selector: 'renderButtonsOn:',
  7307. category: 'rendering',
  7308. fn: function (html){
  7309. var self=this;
  7310. return self;},
  7311. source: unescape('renderButtonsOn%3A%20html%0A')}),
  7312. smalltalk.TabWidget);
  7313. smalltalk.addMethod(
  7314. '_open',
  7315. smalltalk.method({
  7316. selector: 'open',
  7317. category: 'instance creation',
  7318. fn: function (){
  7319. var self=this;
  7320. return self._new()._open();
  7321. return self;},
  7322. source: unescape('open%0A%20%20%20%20%5Eself%20new%20open%0A')}),
  7323. smalltalk.TabWidget.klass);
  7324. smalltalk.addClass('Workspace', smalltalk.TabWidget, ['textarea'], 'IDE');
  7325. smalltalk.addMethod(
  7326. '_label',
  7327. smalltalk.method({
  7328. selector: 'label',
  7329. category: 'accessing',
  7330. fn: function (){
  7331. var self=this;
  7332. return unescape("%5BWorkspace%5D");
  7333. return self;},
  7334. source: unescape('label%0A%20%20%20%20%5E%27%5BWorkspace%5D%27%0A')}),
  7335. smalltalk.Workspace);
  7336. smalltalk.addMethod(
  7337. '_selection',
  7338. smalltalk.method({
  7339. selector: 'selection',
  7340. category: 'accessing',
  7341. fn: function (){
  7342. var self=this;
  7343. return (function(){return document.selection})();
  7344. return self;},
  7345. source: unescape('selection%0A%20%20%20%20%5E%7B%27return%20document.selection%27%7D%0A')}),
  7346. smalltalk.Workspace);
  7347. smalltalk.addMethod(
  7348. '_selectionStart',
  7349. smalltalk.method({
  7350. selector: 'selectionStart',
  7351. category: 'accessing',
  7352. fn: function (){
  7353. var self=this;
  7354. return (function(){return jQuery('.jt_workspace')[0].selectionStart})();
  7355. return self;},
  7356. 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')}),
  7357. smalltalk.Workspace);
  7358. smalltalk.addMethod(
  7359. '_selectionEnd',
  7360. smalltalk.method({
  7361. selector: 'selectionEnd',
  7362. category: 'accessing',
  7363. fn: function (){
  7364. var self=this;
  7365. return (function(){return jQuery('.jt_workspace')[0].selectionEnd})();
  7366. return self;},
  7367. 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')}),
  7368. smalltalk.Workspace);
  7369. smalltalk.addMethod(
  7370. '_selectionStart_',
  7371. smalltalk.method({
  7372. selector: 'selectionStart:',
  7373. category: 'accessing',
  7374. fn: function (anInteger){
  7375. var self=this;
  7376. (function(){jQuery('.jt_workspace')[0].selectionStart = anInteger})();
  7377. return self;},
  7378. 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')}),
  7379. smalltalk.Workspace);
  7380. smalltalk.addMethod(
  7381. '_selectionEnd_',
  7382. smalltalk.method({
  7383. selector: 'selectionEnd:',
  7384. category: 'accessing',
  7385. fn: function (anInteger){
  7386. var self=this;
  7387. (function(){jQuery('.jt_workspace')[0].selectionEnd = anInteger})();
  7388. return self;},
  7389. 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')}),
  7390. smalltalk.Workspace);
  7391. smalltalk.addMethod(
  7392. '_currentLine',
  7393. smalltalk.method({
  7394. selector: 'currentLine',
  7395. category: 'accessing',
  7396. fn: function (){
  7397. var self=this;
  7398. try{var lines=nil;
  7399. var startLine=nil;
  7400. var endLine=nil;
  7401. lines=self['@textarea']._asJQuery()._val()._tokenize_(smalltalk.String._cr());
  7402. startLine=endLine=(0);
  7403. 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}})})();}));}));
  7404. return self;
  7405. } catch(e) {if(e.name === 'stReturn' && e.selector === '_currentLine'){return e.fn()} throw(e)}},
  7406. 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')}),
  7407. smalltalk.Workspace);
  7408. smalltalk.addMethod(
  7409. '_handleKeyDown_',
  7410. smalltalk.method({
  7411. selector: 'handleKeyDown:',
  7412. category: 'actions',
  7413. fn: function (anEvent){
  7414. var self=this;
  7415. return (function(){if(anEvent.ctrlKey) {
  7416. if(anEvent.keyCode === 68) { //ctrl+p
  7417. self._printIt();
  7418. return false;
  7419. }
  7420. if(anEvent.keyCode === 80) { //ctrl+d
  7421. self._doIt();
  7422. return false;
  7423. }
  7424. }})();
  7425. return self;},
  7426. 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')}),
  7427. smalltalk.Workspace);
  7428. smalltalk.addMethod(
  7429. '_clearWorkspace',
  7430. smalltalk.method({
  7431. selector: 'clearWorkspace',
  7432. category: 'actions',
  7433. fn: function (){
  7434. var self=this;
  7435. self['@textarea']._asJQuery()._val_("");
  7436. return self;},
  7437. source: unescape('clearWorkspace%0A%20%20%20%20textarea%20asJQuery%20val%3A%20%27%27%0A')}),
  7438. smalltalk.Workspace);
  7439. smalltalk.addMethod(
  7440. '_doIt',
  7441. smalltalk.method({
  7442. selector: 'doIt',
  7443. category: 'actions',
  7444. fn: function (){
  7445. var self=this;
  7446. self._printIt();
  7447. return self;},
  7448. source: unescape('doIt%0A%20%20%20%20self%20printIt%0A')}),
  7449. smalltalk.Workspace);
  7450. smalltalk.addMethod(
  7451. '_printIt',
  7452. smalltalk.method({
  7453. selector: 'printIt',
  7454. category: 'actions',
  7455. fn: function (){
  7456. var self=this;
  7457. var selection=nil;
  7458. self['@textarea']._asJQuery()._focus();
  7459. 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)));}));
  7460. self._print_(self._eval_(selection)._printString());
  7461. return self;},
  7462. 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')}),
  7463. smalltalk.Workspace);
  7464. smalltalk.addMethod(
  7465. '_print_',
  7466. smalltalk.method({
  7467. selector: 'print:',
  7468. category: 'actions',
  7469. fn: function (aString){
  7470. var self=this;
  7471. var start=nil;
  7472. start=self._selectionEnd();
  7473. 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())));
  7474. self._selectionStart_(start);
  7475. self._selectionEnd_(start.__plus(aString._size()).__plus((2)));
  7476. return self;},
  7477. 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')}),
  7478. smalltalk.Workspace);
  7479. smalltalk.addMethod(
  7480. '_eval_',
  7481. smalltalk.method({
  7482. selector: 'eval:',
  7483. category: 'actions',
  7484. fn: function (aString){
  7485. var self=this;
  7486. return smalltalk.Compiler._new()._loadExpression_(aString);
  7487. return self;},
  7488. source: unescape('eval%3A%20aString%0A%20%20%20%20%5ECompiler%20new%20loadExpression%3A%20aString%0A')}),
  7489. smalltalk.Workspace);
  7490. smalltalk.addMethod(
  7491. '_renderBoxOn_',
  7492. smalltalk.method({
  7493. selector: 'renderBoxOn:',
  7494. category: 'rendering',
  7495. fn: function (html){
  7496. var self=this;
  7497. self['@textarea']=html._textarea();
  7498. self['@textarea']._asJQuery()._call_("tabby");
  7499. self['@textarea']._onKeyDown_((function(e){return self._handleKeyDown_(e);}));
  7500. (function($rec){$rec._class_("jt_workspace");return $rec._at_put_("spellcheck","false");})(self['@textarea']);
  7501. return self;},
  7502. 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')}),
  7503. smalltalk.Workspace);
  7504. smalltalk.addMethod(
  7505. '_renderButtonsOn_',
  7506. smalltalk.method({
  7507. selector: 'renderButtonsOn:',
  7508. category: 'rendering',
  7509. fn: function (html){
  7510. var self=this;
  7511. (function($rec){$rec._with_("DoIt");$rec._title_(unescape("ctrl+d"));return $rec._onClick_((function(){return self._doIt();}));})(html._button());
  7512. (function($rec){$rec._with_("PrintIt");$rec._title_(unescape("ctrl+p"));return $rec._onClick_((function(){return self._printIt();}));})(html._button());
  7513. (function($rec){$rec._with_("Clear workspace");return $rec._onClick_((function(){return self._clearWorkspace();}));})(html._button());
  7514. return self;},
  7515. 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')}),
  7516. smalltalk.Workspace);
  7517. smalltalk.addClass('Transcript', smalltalk.TabWidget, ['textarea'], 'IDE');
  7518. smalltalk.addMethod(
  7519. '_label',
  7520. smalltalk.method({
  7521. selector: 'label',
  7522. category: 'accessing',
  7523. fn: function (){
  7524. var self=this;
  7525. return unescape("%5BTranscript%5D");
  7526. return self;},
  7527. source: unescape('label%0A%20%20%20%20%5E%27%5BTranscript%5D%27%0A')}),
  7528. smalltalk.Transcript);
  7529. smalltalk.addMethod(
  7530. '_show_',
  7531. smalltalk.method({
  7532. selector: 'show:',
  7533. category: 'actions',
  7534. fn: function (anObject){
  7535. var self=this;
  7536. self['@textarea']._asJQuery()._val_(self['@textarea']._asJQuery()._val().__comma(anObject._asString()));
  7537. return self;},
  7538. source: unescape('show%3A%20anObject%0A%20%20%20%20textarea%20asJQuery%20val%3A%20textarea%20asJQuery%20val%2C%20anObject%20asString.%0A%0A')}),
  7539. smalltalk.Transcript);
  7540. smalltalk.addMethod(
  7541. '_cr',
  7542. smalltalk.method({
  7543. selector: 'cr',
  7544. category: 'actions',
  7545. fn: function (){
  7546. var self=this;
  7547. self['@textarea']._asJQuery()._val_(self['@textarea']._asJQuery()._val().__comma(smalltalk.String._cr()));
  7548. return self;},
  7549. source: unescape('cr%0A%20%20%20%20textarea%20asJQuery%20val%3A%20textarea%20asJQuery%20val%2C%20String%20cr.%0A')}),
  7550. smalltalk.Transcript);
  7551. smalltalk.addMethod(
  7552. '_clear',
  7553. smalltalk.method({
  7554. selector: 'clear',
  7555. category: 'actions',
  7556. fn: function (){
  7557. var self=this;
  7558. self['@textarea']._asJQuery()._val_("");
  7559. return self;},
  7560. source: unescape('clear%0A%20%20%20%20textarea%20asJQuery%20val%3A%20%27%27%0A')}),
  7561. smalltalk.Transcript);
  7562. smalltalk.addMethod(
  7563. '_renderBoxOn_',
  7564. smalltalk.method({
  7565. selector: 'renderBoxOn:',
  7566. category: 'rendering',
  7567. fn: function (html){
  7568. var self=this;
  7569. self['@textarea']=html._textarea();
  7570. self['@textarea']._asJQuery()._call_("tabby");
  7571. (function($rec){$rec._class_("jt_transcript");return $rec._at_put_("spellcheck","false");})(self['@textarea']);
  7572. return self;},
  7573. 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')}),
  7574. smalltalk.Transcript);
  7575. smalltalk.addMethod(
  7576. '_renderButtonsOn_',
  7577. smalltalk.method({
  7578. selector: 'renderButtonsOn:',
  7579. category: 'rendering',
  7580. fn: function (html){
  7581. var self=this;
  7582. (function($rec){$rec._with_("Clear transcript");return $rec._onClick_((function(){return self._clear();}));})(html._button());
  7583. return self;},
  7584. 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')}),
  7585. smalltalk.Transcript);
  7586. smalltalk.Transcript.klass.iVarNames = ['current'];
  7587. smalltalk.addMethod(
  7588. '_open',
  7589. smalltalk.method({
  7590. selector: 'open',
  7591. category: 'instance creation',
  7592. fn: function (){
  7593. var self=this;
  7594. self._current()._open();
  7595. return self;},
  7596. source: unescape('open%0A%20%20%20%20self%20current%20open%0A')}),
  7597. smalltalk.Transcript.klass);
  7598. smalltalk.addMethod(
  7599. '_new',
  7600. smalltalk.method({
  7601. selector: 'new',
  7602. category: 'instance creation',
  7603. fn: function (){
  7604. var self=this;
  7605. self._shouldNotImplement();
  7606. return self;},
  7607. source: unescape('new%0A%20%20%20%20self%20shouldNotImplement%0A')}),
  7608. smalltalk.Transcript.klass);
  7609. smalltalk.addMethod(
  7610. '_current',
  7611. smalltalk.method({
  7612. selector: 'current',
  7613. category: 'instance creation',
  7614. fn: function (){
  7615. var self=this;
  7616. return self['@current']._ifNil_((function(){return self['@current']=self.klass.superclass.fn.prototype['_new'].apply(self, []);}));
  7617. return self;},
  7618. source: unescape('current%0A%20%20%20%20%5Ecurrent%20ifNil%3A%20%5Bcurrent%20%3A%3D%20super%20new%5D%0A')}),
  7619. smalltalk.Transcript.klass);
  7620. smalltalk.addMethod(
  7621. '_show_',
  7622. smalltalk.method({
  7623. selector: 'show:',
  7624. category: 'printing',
  7625. fn: function (anObject){
  7626. var self=this;
  7627. self._current()._show_(anObject);
  7628. return self;},
  7629. source: unescape('show%3A%20anObject%0A%20%20%20%20self%20current%20show%3A%20anObject%0A')}),
  7630. smalltalk.Transcript.klass);
  7631. smalltalk.addMethod(
  7632. '_cr',
  7633. smalltalk.method({
  7634. selector: 'cr',
  7635. category: 'printing',
  7636. fn: function (){
  7637. var self=this;
  7638. self._current()._show_(smalltalk.String._cr());
  7639. return self;},
  7640. source: unescape('cr%0A%20%20%20%20self%20current%20show%3A%20String%20cr%0A')}),
  7641. smalltalk.Transcript.klass);
  7642. smalltalk.addMethod(
  7643. '_clear',
  7644. smalltalk.method({
  7645. selector: 'clear',
  7646. category: 'printing',
  7647. fn: function (){
  7648. var self=this;
  7649. self._current()._clear();
  7650. return self;},
  7651. source: unescape('clear%0A%20%20%20%20self%20current%20clear%0A')}),
  7652. smalltalk.Transcript.klass);
  7653. smalltalk.addClass('Browser', smalltalk.TabWidget, ['selectedCategory', 'selectedClass', 'selectedProtocol', 'selectedMethod', 'categoriesList', 'classesList', 'protocolsList', 'methodsList', 'sourceTextarea', 'tabsList', 'selectedTab', 'saveButton', 'classButtons', 'methodButtons'], 'IDE');
  7654. smalltalk.addMethod(
  7655. '_initialize',
  7656. smalltalk.method({
  7657. selector: 'initialize',
  7658. category: 'initialization',
  7659. fn: function (){
  7660. var self=this;
  7661. self.klass.superclass.fn.prototype['_initialize'].apply(self, []);
  7662. self['@selectedTab']="instance";
  7663. return self;},
  7664. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20selectedTab%20%3A%3D%20%23instance%0A')}),
  7665. smalltalk.Browser);
  7666. smalltalk.addMethod(
  7667. '_label',
  7668. smalltalk.method({
  7669. selector: 'label',
  7670. category: 'accessing',
  7671. fn: function (){
  7672. var self=this;
  7673. return self['@selectedClass']._ifNil_ifNotNil_((function(){return unescape("Browser%20%28nil%29");}),(function(){return self['@selectedClass']._name();}));
  7674. return self;},
  7675. 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')}),
  7676. smalltalk.Browser);
  7677. smalltalk.addMethod(
  7678. '_categories',
  7679. smalltalk.method({
  7680. selector: 'categories',
  7681. category: 'accessing',
  7682. fn: function (){
  7683. var self=this;
  7684. var categories=nil;
  7685. categories=smalltalk.Array._new();
  7686. smalltalk.Smalltalk._current()._classes()._do_((function(each){return categories._includes_(each._category())._ifFalse_((function(){return categories._add_(each._category());}));}));
  7687. return categories._sort();
  7688. return self;},
  7689. 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')}),
  7690. smalltalk.Browser);
  7691. smalltalk.addMethod(
  7692. '_classes',
  7693. smalltalk.method({
  7694. selector: 'classes',
  7695. category: 'accessing',
  7696. fn: function (){
  7697. var self=this;
  7698. return smalltalk.Smalltalk._current()._classes()._select_((function(each){return each._category().__eq(self['@selectedCategory']);}))._sort_((function(a, b){return a._name().__gt(b._name());}));
  7699. return self;},
  7700. 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')}),
  7701. smalltalk.Browser);
  7702. smalltalk.addMethod(
  7703. '_protocols',
  7704. smalltalk.method({
  7705. selector: 'protocols',
  7706. category: 'accessing',
  7707. fn: function (){
  7708. var self=this;
  7709. try{var klass=nil;
  7710. var protocols=nil;
  7711. protocols=smalltalk.Array._new();
  7712. 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());}));}));}));
  7713. (function(){throw({name: 'stReturn', selector: '_protocols', fn: function(){return protocols._sort()}})})();
  7714. return self;
  7715. } catch(e) {if(e.name === 'stReturn' && e.selector === '_protocols'){return e.fn()} throw(e)}},
  7716. 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')}),
  7717. smalltalk.Browser);
  7718. smalltalk.addMethod(
  7719. '_methods',
  7720. smalltalk.method({
  7721. selector: 'methods',
  7722. category: 'accessing',
  7723. fn: function (){
  7724. var self=this;
  7725. try{var klass=nil;
  7726. self['@selectedTab'].__eq("comment")._ifTrue_((function(){return (function(){throw({name: 'stReturn', selector: '_methods', fn: function(){return []}})})();}));
  7727. self['@selectedClass']._ifNotNil_((function(){return klass=self['@selectedTab'].__eq("instance")._ifTrue_ifFalse_((function(){return self['@selectedClass'];}),(function(){return self['@selectedClass']._class();}));}));
  7728. (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());}))}})})();
  7729. return self;
  7730. } catch(e) {if(e.name === 'stReturn' && e.selector === '_methods'){return e.fn()} throw(e)}},
  7731. 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')}),
  7732. smalltalk.Browser);
  7733. smalltalk.addMethod(
  7734. '_source',
  7735. smalltalk.method({
  7736. selector: 'source',
  7737. category: 'accessing',
  7738. fn: function (){
  7739. var self=this;
  7740. 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();}))}})})();}));
  7741. (function(){throw({name: 'stReturn', selector: '_source', fn: function(){return self['@selectedClass']._ifNil_ifNotNil_((function(){return "";}),(function(){return self._classCommentSource();}))}})})();
  7742. return self;
  7743. } catch(e) {if(e.name === 'stReturn' && e.selector === '_source'){return e.fn()} throw(e)}},
  7744. 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')}),
  7745. smalltalk.Browser);
  7746. smalltalk.addMethod(
  7747. '_methodSource',
  7748. smalltalk.method({
  7749. selector: 'methodSource',
  7750. category: 'accessing',
  7751. fn: function (){
  7752. var self=this;
  7753. return self['@selectedMethod']._ifNil_ifNotNil_((function(){return self._dummyMethodSource();}),(function(){return self['@selectedMethod']._source();}));
  7754. return self;},
  7755. source: unescape('methodSource%0A%20%20%20%20%5EselectedMethod%0A%09ifNil%3A%20%5Bself%20dummyMethodSource%5D%0A%09ifNotNil%3A%20%5BselectedMethod%20source%5D%0A')}),
  7756. smalltalk.Browser);
  7757. smalltalk.addMethod(
  7758. '_dummyMethodSource',
  7759. smalltalk.method({
  7760. selector: 'dummyMethodSource',
  7761. category: 'accessing',
  7762. fn: function (){
  7763. var self=this;
  7764. return unescape("messageSelectorAndArgumentNames%0A%09%22comment%20stating%20purpose%20of%20message%22%0A%0A%09%7C%20temporary%20variable%20names%20%7C%0A%09statements");
  7765. return self;},
  7766. 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')}),
  7767. smalltalk.Browser);
  7768. smalltalk.addMethod(
  7769. '_declarationSource',
  7770. smalltalk.method({
  7771. selector: 'declarationSource',
  7772. category: 'accessing',
  7773. fn: function (){
  7774. var self=this;
  7775. return self['@selectedTab'].__eq("instance")._ifTrue_ifFalse_((function(){return self._classDeclarationSource();}),(function(){return self._metaclassDeclarationSource();}));
  7776. return self;},
  7777. 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')}),
  7778. smalltalk.Browser);
  7779. smalltalk.addMethod(
  7780. '_classDeclarationSource',
  7781. smalltalk.method({
  7782. selector: 'classDeclarationSource',
  7783. category: 'accessing',
  7784. fn: function (){
  7785. var self=this;
  7786. var stream=nil;
  7787. stream=""._writeStream();
  7788. 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);}));
  7789. return stream._contents();
  7790. return self;},
  7791. 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')}),
  7792. smalltalk.Browser);
  7793. smalltalk.addMethod(
  7794. '_metaclassDeclarationSource',
  7795. smalltalk.method({
  7796. selector: 'metaclassDeclarationSource',
  7797. category: 'accessing',
  7798. fn: function (){
  7799. var self=this;
  7800. var stream=nil;
  7801. stream=""._writeStream();
  7802. 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"));}));
  7803. return stream._contents();
  7804. return self;},
  7805. 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')}),
  7806. smalltalk.Browser);
  7807. smalltalk.addMethod(
  7808. '_classCommentSource',
  7809. smalltalk.method({
  7810. selector: 'classCommentSource',
  7811. category: 'accessing',
  7812. fn: function (){
  7813. var self=this;
  7814. return self['@selectedClass']._comment();
  7815. return self;},
  7816. source: unescape('classCommentSource%0A%20%20%20%20%5EselectedClass%20comment%0A')}),
  7817. smalltalk.Browser);
  7818. smalltalk.addMethod(
  7819. '_enableSaveButton',
  7820. smalltalk.method({
  7821. selector: 'enableSaveButton',
  7822. category: 'actions',
  7823. fn: function (){
  7824. var self=this;
  7825. self['@saveButton']._removeAt_("disabled");
  7826. return self;},
  7827. source: unescape('enableSaveButton%0A%20%20%20%20saveButton%20removeAt%3A%20%27disabled%27%0A')}),
  7828. smalltalk.Browser);
  7829. smalltalk.addMethod(
  7830. '_disableSaveButton',
  7831. smalltalk.method({
  7832. selector: 'disableSaveButton',
  7833. category: 'actions',
  7834. fn: function (){
  7835. var self=this;
  7836. self['@saveButton']._ifNotNil_((function(){return self['@saveButton']._at_put_("disabled",true);}));
  7837. return self;},
  7838. source: unescape('disableSaveButton%0A%20%20%20%20saveButton%20ifNotNil%3A%20%5B%0A%09saveButton%20at%3A%20%27disabled%27%20put%3A%20true%5D%0A')}),
  7839. smalltalk.Browser);
  7840. smalltalk.addMethod(
  7841. '_hideClassButtons',
  7842. smalltalk.method({
  7843. selector: 'hideClassButtons',
  7844. category: 'actions',
  7845. fn: function (){
  7846. var self=this;
  7847. self['@classButtons']._asJQuery()._hide();
  7848. return self;},
  7849. source: unescape('hideClassButtons%0A%20%20%20%20classButtons%20asJQuery%20hide%0A')}),
  7850. smalltalk.Browser);
  7851. smalltalk.addMethod(
  7852. '_showClassButtons',
  7853. smalltalk.method({
  7854. selector: 'showClassButtons',
  7855. category: 'actions',
  7856. fn: function (){
  7857. var self=this;
  7858. self['@classButtons']._asJQuery()._show();
  7859. return self;},
  7860. source: unescape('showClassButtons%0A%20%20%20%20classButtons%20asJQuery%20show%0A')}),
  7861. smalltalk.Browser);
  7862. smalltalk.addMethod(
  7863. '_hideMethodButtons',
  7864. smalltalk.method({
  7865. selector: 'hideMethodButtons',
  7866. category: 'actions',
  7867. fn: function (){
  7868. var self=this;
  7869. self['@methodButtons']._asJQuery()._hide();
  7870. return self;},
  7871. source: unescape('hideMethodButtons%0A%20%20%20%20methodButtons%20asJQuery%20hide%0A')}),
  7872. smalltalk.Browser);
  7873. smalltalk.addMethod(
  7874. '_showMethodButtons',
  7875. smalltalk.method({
  7876. selector: 'showMethodButtons',
  7877. category: 'actions',
  7878. fn: function (){
  7879. var self=this;
  7880. self['@methodButtons']._asJQuery()._show();
  7881. return self;},
  7882. source: unescape('showMethodButtons%0A%20%20%20%20methodButtons%20asJQuery%20show%0A')}),
  7883. smalltalk.Browser);
  7884. smalltalk.addMethod(
  7885. '_compile',
  7886. smalltalk.method({
  7887. selector: 'compile',
  7888. category: 'actions',
  7889. fn: function (){
  7890. var self=this;
  7891. self['@selectedTab'].__eq("comment")._ifTrue_((function(){return self['@selectedClass']._ifNotNil_((function(){return self._compileClassComment();}));}));
  7892. self['@selectedProtocol']._notNil()._or_((function(){return self['@selectedMethod']._notNil();}))._ifFalse_ifTrue_((function(){return self._compileDefinition();}),(function(){return self._compileMethodDefinition();}));
  7893. self._disableSaveButton();
  7894. return self;},
  7895. source: unescape('compile%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%20%20%20%20self%20disableSaveButton%0A')}),
  7896. smalltalk.Browser);
  7897. smalltalk.addMethod(
  7898. '_compileClassComment',
  7899. smalltalk.method({
  7900. selector: 'compileClassComment',
  7901. category: 'actions',
  7902. fn: function (){
  7903. var self=this;
  7904. self['@selectedClass']._comment_(self['@sourceTextarea']._asJQuery()._val());
  7905. return self;},
  7906. source: unescape('compileClassComment%0A%20%20%20%20selectedClass%20comment%3A%20sourceTextarea%20asJQuery%20val%0A')}),
  7907. smalltalk.Browser);
  7908. smalltalk.addMethod(
  7909. '_compileMethodDefinition',
  7910. smalltalk.method({
  7911. selector: 'compileMethodDefinition',
  7912. category: 'actions',
  7913. fn: function (){
  7914. var self=this;
  7915. self['@selectedTab'].__eq("instance")._ifTrue_ifFalse_((function(){return self._compileMethodDefinitionFor_(self['@selectedClass']);}),(function(){return self._compileMethodDefinitionFor_(self['@selectedClass']._class());}));
  7916. return self;},
  7917. 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')}),
  7918. smalltalk.Browser);
  7919. smalltalk.addMethod(
  7920. '_compileMethodDefinitionFor_',
  7921. smalltalk.method({
  7922. selector: 'compileMethodDefinitionFor:',
  7923. category: 'actions',
  7924. fn: function (aClass){
  7925. var self=this;
  7926. var method=nil;
  7927. method=smalltalk.Compiler._new()._load_forClass_(self['@sourceTextarea']._asJQuery()._val(),self['@selectedClass']);
  7928. method._category_(self['@selectedProtocol']);
  7929. aClass._addCompiledMethod_(method);
  7930. self._updateMethodsList();
  7931. self._selectMethod_(method);
  7932. return self;},
  7933. source: unescape('compileMethodDefinitionFor%3A%20aClass%0A%20%20%20%20%7C%20method%20%7C%0A%20%20%20%20method%20%3A%3D%20Compiler%20new%20load%3A%20sourceTextarea%20asJQuery%20val%20forClass%3A%20selectedClass.%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')}),
  7934. smalltalk.Browser);
  7935. smalltalk.addMethod(
  7936. '_compileDefinition',
  7937. smalltalk.method({
  7938. selector: 'compileDefinition',
  7939. category: 'actions',
  7940. fn: function (){
  7941. var self=this;
  7942. var newClass=nil;
  7943. newClass=smalltalk.Compiler._new()._loadExpression_(self['@sourceTextarea']._asJQuery()._val());
  7944. (function($rec){$rec._updateCategoriesList();return $rec._updateClassesList();})(self);
  7945. return self;},
  7946. 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')}),
  7947. smalltalk.Browser);
  7948. smalltalk.addMethod(
  7949. '_removeClass',
  7950. smalltalk.method({
  7951. selector: 'removeClass',
  7952. category: 'actions',
  7953. fn: function (){
  7954. var self=this;
  7955. 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);}));
  7956. return self;},
  7957. 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')}),
  7958. smalltalk.Browser);
  7959. smalltalk.addMethod(
  7960. '_removeMethod',
  7961. smalltalk.method({
  7962. selector: 'removeMethod',
  7963. category: 'actions',
  7964. fn: function (){
  7965. var self=this;
  7966. 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);}));
  7967. return self;},
  7968. source: unescape('removeMethod%0A%20%20%20%20%28self%20confirm%3A%20%27Do%20you%20really%20want%20to%20remove%20%23%27%2C%20selectedMethod%20selector%2C%20%27%3F%27%29%0A%09ifTrue%3A%20%5B%0A%09%20%20%20%20selectedClass%20removeCompiledMethod%3A%20selectedMethod.%0A%09%20%20%20%20self%20selectMethod%3A%20nil%5D%0A')}),
  7969. smalltalk.Browser);
  7970. smalltalk.addMethod(
  7971. '_selectCategory_',
  7972. smalltalk.method({
  7973. selector: 'selectCategory:',
  7974. category: 'actions',
  7975. fn: function (aCategory){
  7976. var self=this;
  7977. self['@selectedCategory']=aCategory;
  7978. self['@selectedClass']=self['@selectedProtocol']=self['@selectedMethod']=nil;
  7979. (function($rec){$rec._updateCategoriesList();$rec._updateClassesList();$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();})(self);
  7980. return self;},
  7981. source: unescape('selectCategory%3A%20aCategory%0A%20%20%20%20selectedCategory%20%3A%3D%20aCategory.%0A%20%20%20%20selectedClass%20%3A%3D%20selectedProtocol%20%3A%3D%20selectedMethod%20%3A%3D%20%20nil.%0A%20%20%20%20self%20%0A%09updateCategoriesList%3B%0A%09updateClassesList%3B%0A%09updateProtocolsList%3B%0A%09updateMethodsList%3B%0A%09updateSourceAndButtons%0A')}),
  7982. smalltalk.Browser);
  7983. smalltalk.addMethod(
  7984. '_selectClass_',
  7985. smalltalk.method({
  7986. selector: 'selectClass:',
  7987. category: 'actions',
  7988. fn: function (aClass){
  7989. var self=this;
  7990. self['@selectedClass']=aClass;
  7991. self['@selectedProtocol']=self['@selectedMethod']=nil;
  7992. (function($rec){$rec._updateClassesList();$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();})(self);
  7993. return self;},
  7994. source: unescape('selectClass%3A%20aClass%0A%20%20%20%20selectedClass%20%3A%3D%20aClass.%0A%20%20%20%20selectedProtocol%20%3A%3D%20selectedMethod%20%3A%3D%20nil.%0A%20%20%20%20self%20%0A%09updateClassesList%3B%0A%09updateProtocolsList%3B%0A%09updateMethodsList%3B%0A%09updateSourceAndButtons%0A')}),
  7995. smalltalk.Browser);
  7996. smalltalk.addMethod(
  7997. '_selectProtocol_',
  7998. smalltalk.method({
  7999. selector: 'selectProtocol:',
  8000. category: 'actions',
  8001. fn: function (aString){
  8002. var self=this;
  8003. self['@selectedProtocol']=aString;
  8004. self['@selectedMethod']=nil;
  8005. (function($rec){$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();})(self);
  8006. return self;},
  8007. source: unescape('selectProtocol%3A%20aString%0A%20%20%20%20selectedProtocol%20%3A%3D%20aString.%0A%20%20%20%20selectedMethod%20%3A%3D%20nil.%0A%20%20%20%20self%20%0A%09updateProtocolsList%3B%0A%09updateMethodsList%3B%0A%09updateSourceAndButtons%0A')}),
  8008. smalltalk.Browser);
  8009. smalltalk.addMethod(
  8010. '_selectMethod_',
  8011. smalltalk.method({
  8012. selector: 'selectMethod:',
  8013. category: 'actions',
  8014. fn: function (aMethod){
  8015. var self=this;
  8016. self['@selectedMethod']=aMethod;
  8017. (function($rec){$rec._updateProtocolsList();$rec._updateMethodsList();return $rec._updateSourceAndButtons();})(self);
  8018. return self;},
  8019. source: unescape('selectMethod%3A%20aMethod%0A%20%20%20%20selectedMethod%20%3A%3D%20aMethod.%0A%20%20%20%20self%20%0A%09updateProtocolsList%3B%0A%09updateMethodsList%3B%0A%09updateSourceAndButtons%0A')}),
  8020. smalltalk.Browser);
  8021. smalltalk.addMethod(
  8022. '_selectTab_',
  8023. smalltalk.method({
  8024. selector: 'selectTab:',
  8025. category: 'actions',
  8026. fn: function (aString){
  8027. var self=this;
  8028. self['@selectedTab']=aString;
  8029. self._selectProtocol_(nil);
  8030. self._updateTabsList();
  8031. return self;},
  8032. source: unescape('selectTab%3A%20aString%0A%20%20%20%20selectedTab%20%3A%3D%20aString.%0A%20%20%20%20self%20selectProtocol%3A%20nil.%0A%20%20%20%20self%20updateTabsList.%0A')}),
  8033. smalltalk.Browser);
  8034. smalltalk.addMethod(
  8035. '_renderBoxOn_',
  8036. smalltalk.method({
  8037. selector: 'renderBoxOn:',
  8038. category: 'rendering',
  8039. fn: function (html){
  8040. var self=this;
  8041. (function($rec){$rec._renderTopPanelOn_(html);$rec._renderTabsOn_(html);return $rec._renderBottomPanelOn_(html);})(self);
  8042. return self;},
  8043. 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')}),
  8044. smalltalk.Browser);
  8045. smalltalk.addMethod(
  8046. '_renderTopPanelOn_',
  8047. smalltalk.method({
  8048. selector: 'renderTopPanelOn:',
  8049. category: 'rendering',
  8050. fn: function (html){
  8051. var self=this;
  8052. (function($rec){$rec._class_("top");return $rec._with_((function(){self['@categoriesList']=html._ul()._class_("jt_column categories");self['@classesList']=html._ul()._class_("jt_column classes");self['@protocolsList']=html._ul()._class_("jt_column protocols");self['@methodsList']=html._ul()._class_("jt_column methods");(function($rec){$rec._updateCategoriesList();$rec._updateClassesList();$rec._updateProtocolsList();return $rec._updateMethodsList();})(self);return html._div()._class_("jt_clear");}));})(html._div());
  8053. return self;},
  8054. source: unescape('renderTopPanelOn%3A%20html%0A%20%20%20%20html%20div%20%0A%09class%3A%20%27top%27%3B%20%0A%09with%3A%20%5B%0A%09%20%20%20%20categoriesList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20categories%27.%0A%09%20%20%20%20classesList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20classes%27.%0A%09%20%20%20%20protocolsList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20protocols%27.%0A%09%20%20%20%20methodsList%20%3A%3D%20html%20ul%20class%3A%20%27jt_column%20methods%27.%0A%09%20%20%20%20self%0A%09%09updateCategoriesList%3B%0A%09%09updateClassesList%3B%0A%09%09updateProtocolsList%3B%0A%09%09updateMethodsList.%0A%09%20%20%20%20html%20div%20class%3A%20%27jt_clear%27%5D%0A')}),
  8055. smalltalk.Browser);
  8056. smalltalk.addMethod(
  8057. '_renderTabsOn_',
  8058. smalltalk.method({
  8059. selector: 'renderTabsOn:',
  8060. category: 'rendering',
  8061. fn: function (html){
  8062. var self=this;
  8063. self['@tabsList']=html._ul()._class_("jt_tabs");
  8064. self._updateTabsList();
  8065. return self;},
  8066. 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')}),
  8067. smalltalk.Browser);
  8068. smalltalk.addMethod(
  8069. '_renderBottomPanelOn_',
  8070. smalltalk.method({
  8071. selector: 'renderBottomPanelOn:',
  8072. category: 'rendering',
  8073. fn: function (html){
  8074. var self=this;
  8075. (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());
  8076. return self;},
  8077. 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')}),
  8078. smalltalk.Browser);
  8079. smalltalk.addMethod(
  8080. '_renderButtonsOn_',
  8081. smalltalk.method({
  8082. selector: 'renderButtonsOn:',
  8083. category: 'rendering',
  8084. fn: function (html){
  8085. var self=this;
  8086. self['@saveButton']=html._button();
  8087. (function($rec){$rec._with_("Save");return $rec._onClick_((function(){return self._compile();}));})(self['@saveButton']);
  8088. self['@methodButtons']=html._span()._with_((function(){return (function($rec){$rec._with_("Remove method");return $rec._onClick_((function(){return self._removeMethod();}));})(html._button());}));
  8089. self['@classButtons']=html._span()._with_((function(){return (function($rec){$rec._with_("Remove class");return $rec._onClick_((function(){return self._removeClass();}));})(html._button());}));
  8090. self._updateSourceAndButtons();
  8091. return self;},
  8092. 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%20with%3A%20%5B%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%5D.%0A%20%20%20%20classButtons%20%3A%3D%20html%20span%20with%3A%20%5B%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%20self%20updateSourceAndButtons%0A')}),
  8093. smalltalk.Browser);
  8094. smalltalk.addMethod(
  8095. '_updateCategoriesList',
  8096. smalltalk.method({
  8097. selector: 'updateCategoriesList',
  8098. category: 'updating',
  8099. fn: function (){
  8100. var self=this;
  8101. self['@categoriesList']._contents_((function(html){return self._categories()._do_((function(each){var li=nil;
  8102. 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);}));}));
  8103. return self;},
  8104. 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')}),
  8105. smalltalk.Browser);
  8106. smalltalk.addMethod(
  8107. '_updateClassesList',
  8108. smalltalk.method({
  8109. selector: 'updateClassesList',
  8110. category: 'updating',
  8111. fn: function (){
  8112. var self=this;
  8113. smalltalk.TabManager._current()._update();
  8114. self['@classesList']._contents_((function(html){return self._classes()._do_((function(each){var li=nil;
  8115. 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);}));}));
  8116. return self;},
  8117. 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')}),
  8118. smalltalk.Browser);
  8119. smalltalk.addMethod(
  8120. '_updateProtocolsList',
  8121. smalltalk.method({
  8122. selector: 'updateProtocolsList',
  8123. category: 'updating',
  8124. fn: function (){
  8125. var self=this;
  8126. self['@protocolsList']._contents_((function(html){return self._protocols()._do_((function(each){var li=nil;
  8127. 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);}));}));
  8128. return self;},
  8129. 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')}),
  8130. smalltalk.Browser);
  8131. smalltalk.addMethod(
  8132. '_updateMethodsList',
  8133. smalltalk.method({
  8134. selector: 'updateMethodsList',
  8135. category: 'updating',
  8136. fn: function (){
  8137. var self=this;
  8138. self['@methodsList']._contents_((function(html){return self._methods()._do_((function(each){var li=nil;
  8139. 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);}));}));
  8140. return self;},
  8141. 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')}),
  8142. smalltalk.Browser);
  8143. smalltalk.addMethod(
  8144. '_updateTabsList',
  8145. smalltalk.method({
  8146. selector: 'updateTabsList',
  8147. category: 'updating',
  8148. fn: function (){
  8149. var self=this;
  8150. self['@tabsList']._contents_((function(html){var li=nil;
  8151. 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);}));
  8152. return self;},
  8153. 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')}),
  8154. smalltalk.Browser);
  8155. smalltalk.addMethod(
  8156. '_updateSourceAndButtons',
  8157. smalltalk.method({
  8158. selector: 'updateSourceAndButtons',
  8159. category: 'updating',
  8160. fn: function (){
  8161. var self=this;
  8162. self._disableSaveButton();
  8163. 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();}));
  8164. self['@sourceTextarea']._asJQuery()._val_(self._source());
  8165. return self;},
  8166. source: unescape('updateSourceAndButtons%0A%20%20%20%20self%20disableSaveButton.%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')}),
  8167. smalltalk.Browser);
  8168. smalltalk.addMethod(
  8169. '_canBeClosed',
  8170. smalltalk.method({
  8171. selector: 'canBeClosed',
  8172. category: 'testing',
  8173. fn: function (){
  8174. var self=this;
  8175. return true;
  8176. return self;},
  8177. source: unescape('canBeClosed%0A%20%20%20%20%5Etrue%0A')}),
  8178. smalltalk.Browser);
  8179. smalltalk.addMethod(
  8180. '_openOn_',
  8181. smalltalk.method({
  8182. selector: 'openOn:',
  8183. category: 'convenience',
  8184. fn: function (aClass){
  8185. var self=this;
  8186. (function($rec){$rec._open();$rec._selectCategory_(aClass._category());return $rec._selectClass_(aClass);})(self._new());
  8187. return self;},
  8188. 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')}),
  8189. smalltalk.Browser.klass);
  8190. smalltalk.addMethod(
  8191. '_open',
  8192. smalltalk.method({
  8193. selector: 'open',
  8194. category: 'convenience',
  8195. fn: function (){
  8196. var self=this;
  8197. self._new()._open();
  8198. return self;},
  8199. source: unescape('open%0A%20%20%20%20self%20new%20open%0A')}),
  8200. smalltalk.Browser.klass);
  8201. smalltalk.init(smalltalk.Object);