ohm.js 654 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481
  1. (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ohm = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
  2. if (typeof Object.create === 'function') {
  3. // implementation from standard node.js 'util' module
  4. module.exports = function inherits(ctor, superCtor) {
  5. if (superCtor) {
  6. ctor.super_ = superCtor
  7. ctor.prototype = Object.create(superCtor.prototype, {
  8. constructor: {
  9. value: ctor,
  10. enumerable: false,
  11. writable: true,
  12. configurable: true
  13. }
  14. })
  15. }
  16. };
  17. } else {
  18. // old school shim for old browsers
  19. module.exports = function inherits(ctor, superCtor) {
  20. if (superCtor) {
  21. ctor.super_ = superCtor
  22. var TempCtor = function () {}
  23. TempCtor.prototype = superCtor.prototype
  24. ctor.prototype = new TempCtor()
  25. ctor.prototype.constructor = ctor
  26. }
  27. }
  28. }
  29. },{}],2:[function(require,module,exports){
  30. // Copyright Joyent, Inc. and other Node contributors.
  31. //
  32. // Permission is hereby granted, free of charge, to any person obtaining a
  33. // copy of this software and associated documentation files (the
  34. // "Software"), to deal in the Software without restriction, including
  35. // without limitation the rights to use, copy, modify, merge, publish,
  36. // distribute, sublicense, and/or sell copies of the Software, and to permit
  37. // persons to whom the Software is furnished to do so, subject to the
  38. // following conditions:
  39. //
  40. // The above copyright notice and this permission notice shall be included
  41. // in all copies or substantial portions of the Software.
  42. //
  43. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  44. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  45. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  46. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  47. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  48. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  49. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  50. module.exports = extend;
  51. function extend(origin, add) {
  52. // Don't do anything if add isn't an object
  53. if (!add || typeof add !== 'object') return origin;
  54. var keys = Object.keys(add);
  55. var i = keys.length;
  56. while (i--) {
  57. origin[keys[i]] = add[keys[i]];
  58. }
  59. return origin;
  60. }
  61. },{}],3:[function(require,module,exports){
  62. var ohm = require('..');
  63. module.exports = ohm.makeRecipe(["grammar",{"source":"BuiltInRules {\n\n alnum (an alpha-numeric character)\n = letter\n | digit\n\n letter (a letter)\n = lower\n | upper\n | unicodeLtmo\n\n digit (a digit)\n = \"0\"..\"9\"\n\n hexDigit (a hexadecimal digit)\n = digit\n | \"a\"..\"f\"\n | \"A\"..\"F\"\n\n ListOf<elem, sep>\n = NonemptyListOf<elem, sep>\n | EmptyListOf<elem, sep>\n\n NonemptyListOf<elem, sep>\n = elem (sep elem)*\n\n EmptyListOf<elem, sep>\n = /* nothing */\n\n listOf<elem, sep>\n = nonemptyListOf<elem, sep>\n | emptyListOf<elem, sep>\n\n nonemptyListOf<elem, sep>\n = elem (sep elem)*\n\n emptyListOf<elem, sep>\n = /* nothing */\n\n}"},"BuiltInRules",null,null,{"alnum":["define",{"sourceInterval":[18,78]},"an alpha-numeric character",[],["alt",{"sourceInterval":[60,78]},["app",{"sourceInterval":[60,66]},"letter",[]],["app",{"sourceInterval":[73,78]},"digit",[]]]],"letter":["define",{"sourceInterval":[82,142]},"a letter",[],["alt",{"sourceInterval":[107,142]},["app",{"sourceInterval":[107,112]},"lower",[]],["app",{"sourceInterval":[119,124]},"upper",[]],["app",{"sourceInterval":[131,142]},"unicodeLtmo",[]]]],"digit":["define",{"sourceInterval":[146,177]},"a digit",[],["range",{"sourceInterval":[169,177]},"0","9"]],"hexDigit":["define",{"sourceInterval":[181,254]},"a hexadecimal digit",[],["alt",{"sourceInterval":[219,254]},["app",{"sourceInterval":[219,224]},"digit",[]],["range",{"sourceInterval":[231,239]},"a","f"],["range",{"sourceInterval":[246,254]},"A","F"]]],"ListOf":["define",{"sourceInterval":[258,336]},null,["elem","sep"],["alt",{"sourceInterval":[282,336]},["app",{"sourceInterval":[282,307]},"NonemptyListOf",[["param",{},0],["param",{},1]]],["app",{"sourceInterval":[314,336]},"EmptyListOf",[["param",{},0],["param",{},1]]]]],"NonemptyListOf":["define",{"sourceInterval":[340,388]},null,["elem","sep"],["seq",{"sourceInterval":[372,388]},["param",{},0],["star",{"sourceInterval":[377,388]},["seq",{"sourceInterval":[378,386]},["param",{},1],["param",{},0]]]]],"EmptyListOf":["define",{"sourceInterval":[392,434]},null,["elem","sep"],["seq",{"sourceInterval":[438,438]}]],"listOf":["define",{"sourceInterval":[438,516]},null,["elem","sep"],["alt",{"sourceInterval":[462,516]},["app",{"sourceInterval":[462,487]},"nonemptyListOf",[["param",{},0],["param",{},1]]],["app",{"sourceInterval":[494,516]},"emptyListOf",[["param",{},0],["param",{},1]]]]],"nonemptyListOf":["define",{"sourceInterval":[520,568]},null,["elem","sep"],["seq",{"sourceInterval":[552,568]},["param",{},0],["star",{"sourceInterval":[557,568]},["seq",{"sourceInterval":[558,566]},["param",{},1],["param",{},0]]]]],"emptyListOf":["define",{"sourceInterval":[572,614]},null,["elem","sep"],["seq",{"sourceInterval":[616,616]}]]}]);
  64. },{"..":26}],4:[function(require,module,exports){
  65. var ohm = require('..');
  66. module.exports = ohm.makeRecipe(["grammar",{"source":"Ohm {\n\n Grammars\n = Grammar*\n\n Grammar\n = ident SuperGrammar? \"{\" Rule* \"}\"\n\n SuperGrammar\n = \"<:\" ident\n\n Rule\n = ident Formals? ruleDescr? \"=\" RuleBody -- define\n | ident Formals? \":=\" RuleBody -- override\n | ident Formals? \"+=\" RuleBody -- extend\n\n RuleBody\n = \"|\"? NonemptyListOf<TopLevelTerm, \"|\">\n\n TopLevelTerm\n = Seq caseName -- inline\n | Seq\n\n Formals\n = \"<\" ListOf<ident, \",\"> \">\"\n\n Params\n = \"<\" ListOf<Seq, \",\"> \">\"\n\n Alt\n = NonemptyListOf<Seq, \"|\">\n\n Seq\n = Iter*\n\n Iter\n = Pred \"*\" -- star\n | Pred \"+\" -- plus\n | Pred \"?\" -- opt\n | Pred\n\n Pred\n = \"~\" Lex -- not\n | \"&\" Lex -- lookahead\n | Lex\n\n Lex\n = \"#\" Base -- lex\n | Base\n\n Base\n = ident Params? ~(ruleDescr? \"=\" | \":=\" | \"+=\") -- application\n | oneCharTerminal \"..\" oneCharTerminal -- range\n | terminal -- terminal\n | \"(\" Alt \")\" -- paren\n\n ruleDescr (a rule description)\n = \"(\" ruleDescrText \")\"\n\n ruleDescrText\n = (~\")\" any)*\n\n caseName\n = \"--\" (~\"\\n\" space)* name (~\"\\n\" space)* (\"\\n\" | &\"}\")\n\n name (a name)\n = nameFirst nameRest*\n\n nameFirst\n = \"_\"\n | letter\n\n nameRest\n = \"_\"\n | alnum\n\n ident (an identifier)\n = name\n\n terminal\n = \"\\\"\" terminalChar* \"\\\"\"\n\n oneCharTerminal\n = \"\\\"\" terminalChar \"\\\"\"\n\n terminalChar\n = escapeChar\n | ~\"\\\\\" ~\"\\\"\" ~\"\\n\" any\n\n escapeChar (an escape sequence)\n = \"\\\\\\\\\" -- backslash\n | \"\\\\\\\"\" -- doubleQuote\n | \"\\\\\\'\" -- singleQuote\n | \"\\\\b\" -- backspace\n | \"\\\\n\" -- lineFeed\n | \"\\\\r\" -- carriageReturn\n | \"\\\\t\" -- tab\n | \"\\\\u\" hexDigit hexDigit hexDigit hexDigit -- unicodeEscape\n | \"\\\\x\" hexDigit hexDigit -- hexEscape\n\n space\n += comment\n\n comment\n = \"//\" (~\"\\n\" any)* \"\\n\" -- singleLine\n | \"/*\" (~\"*/\" any)* \"*/\" -- multiLine\n\n tokens = token*\n\n token = caseName | comment | ident | operator | punctuation | terminal | any\n\n operator = \"<:\" | \"=\" | \":=\" | \"+=\" | \"*\" | \"+\" | \"?\" | \"~\" | \"&\"\n\n punctuation = \"<\" | \">\" | \",\" | \"--\"\n}"},"Ohm",null,"Grammars",{"Grammars":["define",{"sourceInterval":[9,32]},null,[],["star",{"sourceInterval":[24,32]},["app",{"sourceInterval":[24,31]},"Grammar",[]]]],"Grammar":["define",{"sourceInterval":[36,83]},null,[],["seq",{"sourceInterval":[50,83]},["app",{"sourceInterval":[50,55]},"ident",[]],["opt",{"sourceInterval":[56,69]},["app",{"sourceInterval":[56,68]},"SuperGrammar",[]]],["terminal",{"sourceInterval":[70,73]},"{"],["star",{"sourceInterval":[74,79]},["app",{"sourceInterval":[74,78]},"Rule",[]]],["terminal",{"sourceInterval":[80,83]},"}"]]],"SuperGrammar":["define",{"sourceInterval":[87,116]},null,[],["seq",{"sourceInterval":[106,116]},["terminal",{"sourceInterval":[106,110]},"<:"],["app",{"sourceInterval":[111,116]},"ident",[]]]],"Rule_define":["define",{"sourceInterval":[131,181]},null,[],["seq",{"sourceInterval":[131,170]},["app",{"sourceInterval":[131,136]},"ident",[]],["opt",{"sourceInterval":[137,145]},["app",{"sourceInterval":[137,144]},"Formals",[]]],["opt",{"sourceInterval":[146,156]},["app",{"sourceInterval":[146,155]},"ruleDescr",[]]],["terminal",{"sourceInterval":[157,160]},"="],["app",{"sourceInterval":[162,170]},"RuleBody",[]]]],"Rule_override":["define",{"sourceInterval":[188,240]},null,[],["seq",{"sourceInterval":[188,227]},["app",{"sourceInterval":[188,193]},"ident",[]],["opt",{"sourceInterval":[194,202]},["app",{"sourceInterval":[194,201]},"Formals",[]]],["terminal",{"sourceInterval":[214,218]},":="],["app",{"sourceInterval":[219,227]},"RuleBody",[]]]],"Rule_extend":["define",{"sourceInterval":[247,297]},null,[],["seq",{"sourceInterval":[247,286]},["app",{"sourceInterval":[247,252]},"ident",[]],["opt",{"sourceInterval":[253,261]},["app",{"sourceInterval":[253,260]},"Formals",[]]],["terminal",{"sourceInterval":[273,277]},"+="],["app",{"sourceInterval":[278,286]},"RuleBody",[]]]],"Rule":["define",{"sourceInterval":[120,297]},null,[],["alt",{"sourceInterval":[131,297]},["app",{"sourceInterval":[131,170]},"Rule_define",[]],["app",{"sourceInterval":[188,227]},"Rule_override",[]],["app",{"sourceInterval":[247,286]},"Rule_extend",[]]]],"RuleBody":["define",{"sourceInterval":[301,354]},null,[],["seq",{"sourceInterval":[316,354]},["opt",{"sourceInterval":[316,320]},["terminal",{"sourceInterval":[316,319]},"|"]],["app",{"sourceInterval":[321,354]},"NonemptyListOf",[["app",{"sourceInterval":[336,348]},"TopLevelTerm",[]],["terminal",{"sourceInterval":[350,353]},"|"]]]]],"TopLevelTerm_inline":["define",{"sourceInterval":[377,400]},null,[],["seq",{"sourceInterval":[377,389]},["app",{"sourceInterval":[377,380]},"Seq",[]],["app",{"sourceInterval":[381,389]},"caseName",[]]]],"TopLevelTerm":["define",{"sourceInterval":[358,410]},null,[],["alt",{"sourceInterval":[377,410]},["app",{"sourceInterval":[377,389]},"TopLevelTerm_inline",[]],["app",{"sourceInterval":[407,410]},"Seq",[]]]],"Formals":["define",{"sourceInterval":[414,454]},null,[],["seq",{"sourceInterval":[428,454]},["terminal",{"sourceInterval":[428,431]},"<"],["app",{"sourceInterval":[432,450]},"ListOf",[["app",{"sourceInterval":[439,444]},"ident",[]],["terminal",{"sourceInterval":[446,449]},","]]],["terminal",{"sourceInterval":[451,454]},">"]]],"Params":["define",{"sourceInterval":[458,495]},null,[],["seq",{"sourceInterval":[471,495]},["terminal",{"sourceInterval":[471,474]},"<"],["app",{"sourceInterval":[475,491]},"ListOf",[["app",{"sourceInterval":[482,485]},"Seq",[]],["terminal",{"sourceInterval":[487,490]},","]]],["terminal",{"sourceInterval":[492,495]},">"]]],"Alt":["define",{"sourceInterval":[499,533]},null,[],["app",{"sourceInterval":[509,533]},"NonemptyListOf",[["app",{"sourceInterval":[524,527]},"Seq",[]],["terminal",{"sourceInterval":[529,532]},"|"]]]],"Seq":["define",{"sourceInterval":[537,552]},null,[],["star",{"sourceInterval":[547,552]},["app",{"sourceInterval":[547,551]},"Iter",[]]]],"Iter_star":["define",{"sourceInterval":[567,584]},null,[],["seq",{"sourceInterval":[567,575]},["app",{"sourceInterval":[567,571]},"Pred",[]],["terminal",{"sourceInterval":[572,575]},"*"]]],"Iter_plus":["define",{"sourceInterval":[591,608]},null,[],["seq",{"sourceInterval":[591,599]},["app",{"sourceInterval":[591,595]},"Pred",[]],["terminal",{"sourceInterval":[596,599]},"+"]]],"Iter_opt":["define",{"sourceInterval":[615,631]},null,[],["seq",{"sourceInterval":[615,623]},["app",{"sourceInterval":[615,619]},"Pred",[]],["terminal",{"sourceInterval":[620,623]},"?"]]],"Iter":["define",{"sourceInterval":[556,642]},null,[],["alt",{"sourceInterval":[567,642]},["app",{"sourceInterval":[567,575]},"Iter_star",[]],["app",{"sourceInterval":[591,599]},"Iter_plus",[]],["app",{"sourceInterval":[615,623]},"Iter_opt",[]],["app",{"sourceInterval":[638,642]},"Pred",[]]]],"Pred_not":["define",{"sourceInterval":[657,672]},null,[],["seq",{"sourceInterval":[657,664]},["terminal",{"sourceInterval":[657,660]},"~"],["app",{"sourceInterval":[661,664]},"Lex",[]]]],"Pred_lookahead":["define",{"sourceInterval":[679,700]},null,[],["seq",{"sourceInterval":[679,686]},["terminal",{"sourceInterval":[679,682]},"&"],["app",{"sourceInterval":[683,686]},"Lex",[]]]],"Pred":["define",{"sourceInterval":[646,710]},null,[],["alt",{"sourceInterval":[657,710]},["app",{"sourceInterval":[657,664]},"Pred_not",[]],["app",{"sourceInterval":[679,686]},"Pred_lookahead",[]],["app",{"sourceInterval":[707,710]},"Lex",[]]]],"Lex_lex":["define",{"sourceInterval":[724,740]},null,[],["seq",{"sourceInterval":[724,732]},["terminal",{"sourceInterval":[724,727]},"#"],["app",{"sourceInterval":[728,732]},"Base",[]]]],"Lex":["define",{"sourceInterval":[714,751]},null,[],["alt",{"sourceInterval":[724,751]},["app",{"sourceInterval":[724,732]},"Lex_lex",[]],["app",{"sourceInterval":[747,751]},"Base",[]]]],"Base_application":["define",{"sourceInterval":[766,827]},null,[],["seq",{"sourceInterval":[766,811]},["app",{"sourceInterval":[766,771]},"ident",[]],["opt",{"sourceInterval":[772,779]},["app",{"sourceInterval":[772,778]},"Params",[]]],["not",{"sourceInterval":[780,811]},["alt",{"sourceInterval":[782,810]},["seq",{"sourceInterval":[782,796]},["opt",{"sourceInterval":[782,792]},["app",{"sourceInterval":[782,791]},"ruleDescr",[]]],["terminal",{"sourceInterval":[793,796]},"="]],["terminal",{"sourceInterval":[799,803]},":="],["terminal",{"sourceInterval":[806,810]},"+="]]]]],"Base_range":["define",{"sourceInterval":[834,889]},null,[],["seq",{"sourceInterval":[834,870]},["app",{"sourceInterval":[834,849]},"oneCharTerminal",[]],["terminal",{"sourceInterval":[850,854]},".."],["app",{"sourceInterval":[855,870]},"oneCharTerminal",[]]]],"Base_terminal":["define",{"sourceInterval":[896,954]},null,[],["app",{"sourceInterval":[896,904]},"terminal",[]]],"Base_paren":["define",{"sourceInterval":[961,1016]},null,[],["seq",{"sourceInterval":[961,972]},["terminal",{"sourceInterval":[961,964]},"("],["app",{"sourceInterval":[965,968]},"Alt",[]],["terminal",{"sourceInterval":[969,972]},")"]]],"Base":["define",{"sourceInterval":[755,1016]},null,[],["alt",{"sourceInterval":[766,1016]},["app",{"sourceInterval":[766,811]},"Base_application",[]],["app",{"sourceInterval":[834,870]},"Base_range",[]],["app",{"sourceInterval":[896,904]},"Base_terminal",[]],["app",{"sourceInterval":[961,972]},"Base_paren",[]]]],"ruleDescr":["define",{"sourceInterval":[1020,1079]},"a rule description",[],["seq",{"sourceInterval":[1058,1079]},["terminal",{"sourceInterval":[1058,1061]},"("],["app",{"sourceInterval":[1062,1075]},"ruleDescrText",[]],["terminal",{"sourceInterval":[1076,1079]},")"]]],"ruleDescrText":["define",{"sourceInterval":[1083,1114]},null,[],["star",{"sourceInterval":[1103,1114]},["seq",{"sourceInterval":[1104,1112]},["not",{"sourceInterval":[1104,1108]},["terminal",{"sourceInterval":[1105,1108]},")"]],["app",{"sourceInterval":[1109,1112]},"any",[]]]]],"caseName":["define",{"sourceInterval":[1118,1186]},null,[],["seq",{"sourceInterval":[1133,1186]},["terminal",{"sourceInterval":[1133,1137]},"--"],["star",{"sourceInterval":[1138,1152]},["seq",{"sourceInterval":[1139,1150]},["not",{"sourceInterval":[1139,1144]},["terminal",{"sourceInterval":[1140,1144]},"\n"]],["app",{"sourceInterval":[1145,1150]},"space",[]]]],["app",{"sourceInterval":[1153,1157]},"name",[]],["star",{"sourceInterval":[1158,1172]},["seq",{"sourceInterval":[1159,1170]},["not",{"sourceInterval":[1159,1164]},["terminal",{"sourceInterval":[1160,1164]},"\n"]],["app",{"sourceInterval":[1165,1170]},"space",[]]]],["alt",{"sourceInterval":[1174,1185]},["terminal",{"sourceInterval":[1174,1178]},"\n"],["lookahead",{"sourceInterval":[1181,1185]},["terminal",{"sourceInterval":[1182,1185]},"}"]]]]],"name":["define",{"sourceInterval":[1190,1230]},"a name",[],["seq",{"sourceInterval":[1211,1230]},["app",{"sourceInterval":[1211,1220]},"nameFirst",[]],["star",{"sourceInterval":[1221,1230]},["app",{"sourceInterval":[1221,1229]},"nameRest",[]]]]],"nameFirst":["define",{"sourceInterval":[1234,1266]},null,[],["alt",{"sourceInterval":[1250,1266]},["terminal",{"sourceInterval":[1250,1253]},"_"],["app",{"sourceInterval":[1260,1266]},"letter",[]]]],"nameRest":["define",{"sourceInterval":[1270,1300]},null,[],["alt",{"sourceInterval":[1285,1300]},["terminal",{"sourceInterval":[1285,1288]},"_"],["app",{"sourceInterval":[1295,1300]},"alnum",[]]]],"ident":["define",{"sourceInterval":[1304,1337]},"an identifier",[],["app",{"sourceInterval":[1333,1337]},"name",[]]],"terminal":["define",{"sourceInterval":[1341,1379]},null,[],["seq",{"sourceInterval":[1356,1379]},["terminal",{"sourceInterval":[1356,1360]},"\""],["star",{"sourceInterval":[1361,1374]},["app",{"sourceInterval":[1361,1373]},"terminalChar",[]]],["terminal",{"sourceInterval":[1375,1379]},"\""]]],"oneCharTerminal":["define",{"sourceInterval":[1383,1427]},null,[],["seq",{"sourceInterval":[1405,1427]},["terminal",{"sourceInterval":[1405,1409]},"\""],["app",{"sourceInterval":[1410,1422]},"terminalChar",[]],["terminal",{"sourceInterval":[1423,1427]},"\""]]],"terminalChar":["define",{"sourceInterval":[1431,1488]},null,[],["alt",{"sourceInterval":[1450,1488]},["app",{"sourceInterval":[1450,1460]},"escapeChar",[]],["seq",{"sourceInterval":[1467,1488]},["not",{"sourceInterval":[1467,1472]},["terminal",{"sourceInterval":[1468,1472]},"\\"]],["not",{"sourceInterval":[1473,1478]},["terminal",{"sourceInterval":[1474,1478]},"\""]],["not",{"sourceInterval":[1479,1484]},["terminal",{"sourceInterval":[1480,1484]},"\n"]],["app",{"sourceInterval":[1485,1488]},"any",[]]]]],"escapeChar_backslash":["define",{"sourceInterval":[1531,1586]},null,[],["terminal",{"sourceInterval":[1531,1537]},"\\\\"]],"escapeChar_doubleQuote":["define",{"sourceInterval":[1593,1650]},null,[],["terminal",{"sourceInterval":[1593,1599]},"\\\""]],"escapeChar_singleQuote":["define",{"sourceInterval":[1657,1714]},null,[],["terminal",{"sourceInterval":[1657,1663]},"\\'"]],"escapeChar_backspace":["define",{"sourceInterval":[1721,1776]},null,[],["terminal",{"sourceInterval":[1721,1726]},"\\b"]],"escapeChar_lineFeed":["define",{"sourceInterval":[1783,1837]},null,[],["terminal",{"sourceInterval":[1783,1788]},"\\n"]],"escapeChar_carriageReturn":["define",{"sourceInterval":[1844,1904]},null,[],["terminal",{"sourceInterval":[1844,1849]},"\\r"]],"escapeChar_tab":["define",{"sourceInterval":[1911,1960]},null,[],["terminal",{"sourceInterval":[1911,1916]},"\\t"]],"escapeChar_unicodeEscape":["define",{"sourceInterval":[1967,2026]},null,[],["seq",{"sourceInterval":[1967,2008]},["terminal",{"sourceInterval":[1967,1972]},"\\u"],["app",{"sourceInterval":[1973,1981]},"hexDigit",[]],["app",{"sourceInterval":[1982,1990]},"hexDigit",[]],["app",{"sourceInterval":[1991,1999]},"hexDigit",[]],["app",{"sourceInterval":[2000,2008]},"hexDigit",[]]]],"escapeChar_hexEscape":["define",{"sourceInterval":[2033,2088]},null,[],["seq",{"sourceInterval":[2033,2056]},["terminal",{"sourceInterval":[2033,2038]},"\\x"],["app",{"sourceInterval":[2039,2047]},"hexDigit",[]],["app",{"sourceInterval":[2048,2056]},"hexDigit",[]]]],"escapeChar":["define",{"sourceInterval":[1492,2088]},"an escape sequence",[],["alt",{"sourceInterval":[1531,2088]},["app",{"sourceInterval":[1531,1537]},"escapeChar_backslash",[]],["app",{"sourceInterval":[1593,1599]},"escapeChar_doubleQuote",[]],["app",{"sourceInterval":[1657,1663]},"escapeChar_singleQuote",[]],["app",{"sourceInterval":[1721,1726]},"escapeChar_backspace",[]],["app",{"sourceInterval":[1783,1788]},"escapeChar_lineFeed",[]],["app",{"sourceInterval":[1844,1849]},"escapeChar_carriageReturn",[]],["app",{"sourceInterval":[1911,1916]},"escapeChar_tab",[]],["app",{"sourceInterval":[1967,2008]},"escapeChar_unicodeEscape",[]],["app",{"sourceInterval":[2033,2056]},"escapeChar_hexEscape",[]]]],"space":["extend",{"sourceInterval":[2092,2111]},null,[],["app",{"sourceInterval":[2104,2111]},"comment",[]]],"comment_singleLine":["define",{"sourceInterval":[2129,2166]},null,[],["seq",{"sourceInterval":[2129,2151]},["terminal",{"sourceInterval":[2129,2133]},"//"],["star",{"sourceInterval":[2134,2146]},["seq",{"sourceInterval":[2135,2144]},["not",{"sourceInterval":[2135,2140]},["terminal",{"sourceInterval":[2136,2140]},"\n"]],["app",{"sourceInterval":[2141,2144]},"any",[]]]],["terminal",{"sourceInterval":[2147,2151]},"\n"]]],"comment_multiLine":["define",{"sourceInterval":[2173,2209]},null,[],["seq",{"sourceInterval":[2173,2195]},["terminal",{"sourceInterval":[2173,2177]},"/*"],["star",{"sourceInterval":[2178,2190]},["seq",{"sourceInterval":[2179,2188]},["not",{"sourceInterval":[2179,2184]},["terminal",{"sourceInterval":[2180,2184]},"*/"]],["app",{"sourceInterval":[2185,2188]},"any",[]]]],["terminal",{"sourceInterval":[2191,2195]},"*/"]]],"comment":["define",{"sourceInterval":[2115,2209]},null,[],["alt",{"sourceInterval":[2129,2209]},["app",{"sourceInterval":[2129,2151]},"comment_singleLine",[]],["app",{"sourceInterval":[2173,2195]},"comment_multiLine",[]]]],"tokens":["define",{"sourceInterval":[2213,2228]},null,[],["star",{"sourceInterval":[2222,2228]},["app",{"sourceInterval":[2222,2227]},"token",[]]]],"token":["define",{"sourceInterval":[2232,2308]},null,[],["alt",{"sourceInterval":[2240,2308]},["app",{"sourceInterval":[2240,2248]},"caseName",[]],["app",{"sourceInterval":[2251,2258]},"comment",[]],["app",{"sourceInterval":[2261,2266]},"ident",[]],["app",{"sourceInterval":[2269,2277]},"operator",[]],["app",{"sourceInterval":[2280,2291]},"punctuation",[]],["app",{"sourceInterval":[2294,2302]},"terminal",[]],["app",{"sourceInterval":[2305,2308]},"any",[]]]],"operator":["define",{"sourceInterval":[2312,2377]},null,[],["alt",{"sourceInterval":[2323,2377]},["terminal",{"sourceInterval":[2323,2327]},"<:"],["terminal",{"sourceInterval":[2330,2333]},"="],["terminal",{"sourceInterval":[2336,2340]},":="],["terminal",{"sourceInterval":[2343,2347]},"+="],["terminal",{"sourceInterval":[2350,2353]},"*"],["terminal",{"sourceInterval":[2356,2359]},"+"],["terminal",{"sourceInterval":[2362,2365]},"?"],["terminal",{"sourceInterval":[2368,2371]},"~"],["terminal",{"sourceInterval":[2374,2377]},"&"]]],"punctuation":["define",{"sourceInterval":[2381,2417]},null,[],["alt",{"sourceInterval":[2395,2417]},["terminal",{"sourceInterval":[2395,2398]},"<"],["terminal",{"sourceInterval":[2401,2404]},">"],["terminal",{"sourceInterval":[2407,2410]},","],["terminal",{"sourceInterval":[2413,2417]},"--"]]]}]);
  67. },{"..":26}],5:[function(require,module,exports){
  68. var ohm = require('..');
  69. module.exports = ohm.makeRecipe(["grammar",{"source":"OperationsAndAttributes {\n\n AttributeSignature =\n name\n\n OperationSignature =\n name Formals?\n\n Formals\n = \"(\" ListOf<name, \",\"> \")\"\n\n name (a name)\n = nameFirst nameRest*\n\n nameFirst\n = \"_\"\n | letter\n\n nameRest\n = \"_\"\n | alnum\n\n}"},"OperationsAndAttributes",null,"AttributeSignature",{"AttributeSignature":["define",{"sourceInterval":[29,58]},null,[],["app",{"sourceInterval":[54,58]},"name",[]]],"OperationSignature":["define",{"sourceInterval":[62,100]},null,[],["seq",{"sourceInterval":[87,100]},["app",{"sourceInterval":[87,91]},"name",[]],["opt",{"sourceInterval":[92,100]},["app",{"sourceInterval":[92,99]},"Formals",[]]]]],"Formals":["define",{"sourceInterval":[104,143]},null,[],["seq",{"sourceInterval":[118,143]},["terminal",{"sourceInterval":[118,121]},"("],["app",{"sourceInterval":[122,139]},"ListOf",[["app",{"sourceInterval":[129,133]},"name",[]],["terminal",{"sourceInterval":[135,138]},","]]],["terminal",{"sourceInterval":[140,143]},")"]]],"name":["define",{"sourceInterval":[147,187]},"a name",[],["seq",{"sourceInterval":[168,187]},["app",{"sourceInterval":[168,177]},"nameFirst",[]],["star",{"sourceInterval":[178,187]},["app",{"sourceInterval":[178,186]},"nameRest",[]]]]],"nameFirst":["define",{"sourceInterval":[191,223]},null,[],["alt",{"sourceInterval":[207,223]},["terminal",{"sourceInterval":[207,210]},"_"],["app",{"sourceInterval":[217,223]},"letter",[]]]],"nameRest":["define",{"sourceInterval":[227,257]},null,[],["alt",{"sourceInterval":[242,257]},["terminal",{"sourceInterval":[242,245]},"_"],["app",{"sourceInterval":[252,257]},"alnum",[]]]]}]);
  70. },{"..":26}],6:[function(require,module,exports){
  71. 'use strict';
  72. // --------------------------------------------------------------------
  73. // Imports
  74. // --------------------------------------------------------------------
  75. var assert = require('../src/common').assert;
  76. // --------------------------------------------------------------------
  77. // Private stuff
  78. // --------------------------------------------------------------------
  79. // Helpers
  80. function getProp(name, thing, fn) {
  81. return fn(thing[name]);
  82. }
  83. function mapProp(name, thing, fn) {
  84. return thing[name].map(fn);
  85. }
  86. // Returns a function that will walk a single property of a node.
  87. // `descriptor` is a string indicating the property name, optionally ending
  88. // with '[]' (e.g., 'children[]').
  89. function getPropWalkFn(descriptor) {
  90. var parts = descriptor.split(/ ?\[\]/);
  91. if (parts.length === 2) {
  92. return mapProp.bind(null, parts[0]);
  93. }
  94. return getProp.bind(null, descriptor);
  95. }
  96. function getProps(walkFns, thing, fn) {
  97. return walkFns.map(function(walkFn) {
  98. return walkFn(thing, fn);
  99. });
  100. }
  101. function getWalkFn(shape) {
  102. if (typeof shape === 'string') {
  103. return getProps.bind(null, [getPropWalkFn(shape)]);
  104. } else if (Array.isArray(shape)) {
  105. return getProps.bind(null, shape.map(getPropWalkFn));
  106. } else {
  107. assert(typeof shape === 'function', 'Expected a string, Array, or function');
  108. assert(shape.length === 2, 'Expected a function of arity 2, got ' + shape.length);
  109. return shape;
  110. }
  111. }
  112. function isRestrictedIdentifier(str) {
  113. return /^[a-zA-Z_][0-9a-zA-Z_]*$/.test(str);
  114. }
  115. function trim(s) {
  116. return s.trim();
  117. }
  118. function parseSignature(sig) {
  119. var parts = sig.split(/[()]/).map(trim);
  120. if (parts.length === 3 && parts[2] === '') {
  121. var name = parts[0];
  122. var params = [];
  123. if (parts[1].length > 0) {
  124. params = parts[1].split(',').map(trim);
  125. }
  126. if (isRestrictedIdentifier(name) && params.every(isRestrictedIdentifier)) {
  127. return {name: name, formals: params};
  128. }
  129. }
  130. throw new Error('Invalid operation signature: ' + sig);
  131. }
  132. /*
  133. A VisitorFamily contains a set of recursive operations that are defined over some kind of
  134. tree structure. The `config` parameter specifies how to walk the tree:
  135. - 'getTag' is function which, given a node in the tree, returns the node's 'tag' (type)
  136. - 'shapes' an object that maps from a tag to a value that describes how to recursively
  137. evaluate the operation for nodes of that type. The value can be:
  138. * a string indicating the property name that holds that node's only child
  139. * an Array of property names (or an empty array indicating a leaf type), or
  140. * a function taking two arguments (node, fn), and returning an Array which is the result
  141. of apply `fn` to each of the node's children.
  142. */
  143. function VisitorFamily(config) {
  144. this._shapes = config.shapes;
  145. this._getTag = config.getTag;
  146. this.Adapter = function(thing, family) {
  147. this._adaptee = thing;
  148. this._family = family;
  149. };
  150. this.Adapter.prototype.valueOf = function() {
  151. throw new Error('heeey!');
  152. };
  153. this.operations = {};
  154. this._arities = Object.create(null);
  155. this._getChildren = Object.create(null);
  156. var self = this;
  157. Object.keys(this._shapes).forEach(function(k) {
  158. var shape = self._shapes[k];
  159. self._getChildren[k] = getWalkFn(shape);
  160. // A function means the arity isn't fixed, so don't put an entry in the arity map.
  161. if (typeof shape !== 'function') {
  162. self._arities[k] = Array.isArray(shape) ? shape.length : 1;
  163. }
  164. });
  165. this._wrap = function(thing) { return new self.Adapter(thing, self); };
  166. }
  167. VisitorFamily.prototype.wrap = function(thing) {
  168. return this._wrap(thing);
  169. };
  170. VisitorFamily.prototype._checkActionDict = function(dict) {
  171. var self = this;
  172. Object.keys(dict).forEach(function(k) {
  173. assert(k in self._getChildren, "Unrecognized action name '" + k + "'");
  174. var action = dict[k];
  175. assert(typeof action === 'function', "Key '" + k + "': expected function, got " + action);
  176. if (k in self._arities) {
  177. var expected = self._arities[k];
  178. var actual = dict[k].length;
  179. assert(actual === expected,
  180. "Action '" + k + "' has the wrong arity: expected " + expected + ', got ' + actual);
  181. }
  182. });
  183. };
  184. VisitorFamily.prototype.addOperation = function(signature, actions) {
  185. var sig = parseSignature(signature);
  186. var name = sig.name;
  187. this._checkActionDict(actions);
  188. this.operations[name] = {
  189. name: name,
  190. formals: sig.formals,
  191. actions: actions
  192. };
  193. var family = this;
  194. this.Adapter.prototype[name] = function() {
  195. var tag = family._getTag(this._adaptee);
  196. assert(tag in family._getChildren, "getTag returned unrecognized tag '" + tag + "'");
  197. assert(tag in actions, "No action for '" + tag + "' in operation '" + name + "'");
  198. // Create an "arguments object" from the arguments that were passed to this
  199. // operation / attribute.
  200. var args = Object.create(null);
  201. for (var i = 0; i < arguments.length; i++) {
  202. args[sig.formals[i]] = arguments[i];
  203. }
  204. var oldArgs = this.args;
  205. this.args = args;
  206. var ans = actions[tag].apply(this, family._getChildren[tag](this._adaptee, family._wrap));
  207. this.args = oldArgs;
  208. return ans;
  209. };
  210. return this;
  211. };
  212. // --------------------------------------------------------------------
  213. // Exports
  214. // --------------------------------------------------------------------
  215. module.exports = VisitorFamily;
  216. },{"../src/common":24}],7:[function(require,module,exports){
  217. 'use strict';
  218. module.exports = {
  219. VisitorFamily: require('./VisitorFamily'),
  220. semanticsForToAST: require('./semantics-toAST').semantics,
  221. toAST: require('./semantics-toAST').helper
  222. };
  223. },{"./VisitorFamily":6,"./semantics-toAST":8}],8:[function(require,module,exports){
  224. 'use strict';
  225. // --------------------------------------------------------------------
  226. // Imports
  227. // --------------------------------------------------------------------
  228. var pexprs = require('../src/pexprs');
  229. var MatchResult = require('../src/MatchResult');
  230. var Grammar = require('../src/Grammar');
  231. var extend = require('util-extend');
  232. // --------------------------------------------------------------------
  233. // Operations
  234. // --------------------------------------------------------------------
  235. var defaultOperation = {
  236. _terminal: function() {
  237. return this.primitiveValue;
  238. },
  239. _nonterminal: function(children) {
  240. var ctorName = this._node.ctorName;
  241. var mapping = this.args.mapping;
  242. // without customization
  243. if (!mapping.hasOwnProperty(ctorName)) {
  244. // intermediate node
  245. if (this._node instanceof pexprs.Alt || this._node instanceof pexprs.Apply) {
  246. return children[0].toAST(mapping);
  247. }
  248. // lexical rule
  249. if (this.isLexical()) {
  250. return this.sourceString;
  251. }
  252. // singular node (e.g. only surrounded by literals or lookaheads)
  253. var realChildren = children.filter(function(child) {
  254. return !child.isTerminal();
  255. });
  256. if (realChildren.length === 1) {
  257. return realChildren[0].toAST(mapping);
  258. }
  259. // rest: terms with multiple children
  260. }
  261. // direct forward
  262. if (typeof mapping[ctorName] === 'number') {
  263. return children[mapping[ctorName]].toAST(mapping);
  264. }
  265. // named/mapped children or unnamed children ('0', '1', '2', ...)
  266. var propMap = mapping[ctorName] || children;
  267. var node = {
  268. type: ctorName
  269. };
  270. for (var prop in propMap) {
  271. var mappedProp = mapping[ctorName] && mapping[ctorName][prop];
  272. if (typeof mappedProp === 'number') {
  273. // direct forward
  274. node[prop] = children[mappedProp].toAST(mapping);
  275. } else if ((typeof mappedProp === 'string') || (typeof mappedProp === 'boolean') ||
  276. (mappedProp === null)) {
  277. // primitive value
  278. node[prop] = mappedProp;
  279. } else if ((typeof mappedProp === 'object') && (mappedProp instanceof Number)) {
  280. // primitive number (must be unboxed)
  281. node[prop] = Number(mappedProp);
  282. } else if (typeof mappedProp === 'function') {
  283. // computed value
  284. node[prop] = mappedProp.call(this, children);
  285. } else if (mappedProp === undefined) {
  286. if (children[prop] && !children[prop].isTerminal()) {
  287. node[prop] = children[prop].toAST(mapping);
  288. } else {
  289. // delete predefined 'type' properties, like 'type', if explicitely removed
  290. delete node[prop];
  291. }
  292. }
  293. }
  294. return node;
  295. },
  296. _iter: function(children) {
  297. if (this._node.isOptional()) {
  298. if (this.numChildren === 0) {
  299. return null;
  300. } else {
  301. return children[0].toAST(this.args.mapping);
  302. }
  303. }
  304. return children.map(function(child) {
  305. return child.toAST(this.args.mapping);
  306. }, this);
  307. },
  308. NonemptyListOf: function(first, sep, rest) {
  309. return [first.toAST(this.args.mapping)].concat(rest.toAST(this.args.mapping));
  310. },
  311. EmptyListOf: function() {
  312. return [];
  313. }
  314. };
  315. // Returns a plain JavaScript object that includes an abstract syntax tree (AST)
  316. // for the given match result `res` containg a concrete syntax tree (CST) and grammar.
  317. // The optional `mapping` parameter can be used to customize how the nodes of the CST
  318. // are mapped to the AST (see /doc/extras.md#toastmatchresult-mapping).
  319. function toAST(res, mapping) {
  320. if (!(res instanceof MatchResult) || res.failed()) {
  321. throw new Error('toAST() expects a succesfull MatchResult as first parameter');
  322. }
  323. mapping = extend({}, mapping);
  324. var operation = extend({}, defaultOperation);
  325. for (var termName in mapping) {
  326. if (typeof mapping[termName] === 'function') {
  327. operation[termName] = mapping[termName];
  328. delete mapping[termName];
  329. }
  330. }
  331. var g = res._cst.grammar;
  332. var s = g.createSemantics().addOperation('toAST(mapping)', operation);
  333. return s(res).toAST(mapping);
  334. }
  335. // Returns a semantics containg the toAST(mapping) operation for the given grammar g.
  336. function semanticsForToAST(g) {
  337. if (!(g instanceof Grammar)) {
  338. throw new Error('semanticsToAST() expects a Grammar as parameter');
  339. }
  340. return g.createSemantics().addOperation('toAST(mapping)', defaultOperation);
  341. }
  342. module.exports = {
  343. helper: toAST,
  344. semantics: semanticsForToAST
  345. };
  346. },{"../src/Grammar":13,"../src/MatchResult":17,"../src/pexprs":44,"util-extend":2}],9:[function(require,module,exports){
  347. /*!
  348. * Determine if an object is a Buffer
  349. *
  350. * @author Feross Aboukhadijeh <https://feross.org>
  351. * @license MIT
  352. */
  353. module.exports = function isBuffer (obj) {
  354. return obj != null && obj.constructor != null &&
  355. typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
  356. }
  357. },{}],10:[function(require,module,exports){
  358. 'use strict';
  359. // --------------------------------------------------------------------
  360. // Imports
  361. // --------------------------------------------------------------------
  362. var GrammarDecl = require('./GrammarDecl');
  363. var pexprs = require('./pexprs');
  364. // --------------------------------------------------------------------
  365. // Private stuff
  366. // --------------------------------------------------------------------
  367. function Builder() {}
  368. Builder.prototype = {
  369. currentDecl: null,
  370. newGrammar: function(name) {
  371. return new GrammarDecl(name);
  372. },
  373. grammar: function(metaInfo, name, superGrammar, defaultStartRule, rules) {
  374. var gDecl = new GrammarDecl(name);
  375. if (superGrammar) {
  376. gDecl.withSuperGrammar(this.fromRecipe(superGrammar));
  377. }
  378. if (defaultStartRule) {
  379. gDecl.withDefaultStartRule(defaultStartRule);
  380. }
  381. if (metaInfo && metaInfo.source) {
  382. gDecl.withSource(metaInfo.source);
  383. }
  384. var self = this;
  385. this.currentDecl = gDecl;
  386. Object.keys(rules).forEach(function(ruleName) {
  387. var ruleRecipe = rules[ruleName];
  388. var action = ruleRecipe[0]; // define/extend/override
  389. var metaInfo = ruleRecipe[1];
  390. var description = ruleRecipe[2];
  391. var formals = ruleRecipe[3];
  392. var body = self.fromRecipe(ruleRecipe[4]);
  393. var source;
  394. if (gDecl.source && metaInfo && metaInfo.sourceInterval) {
  395. source = gDecl.source.subInterval(
  396. metaInfo.sourceInterval[0],
  397. metaInfo.sourceInterval[1] - metaInfo.sourceInterval[0]);
  398. }
  399. gDecl[action](ruleName, formals, body, description, source);
  400. });
  401. this.currentDecl = null;
  402. return gDecl.build();
  403. },
  404. terminal: function(x) {
  405. return new pexprs.Terminal(x);
  406. },
  407. range: function(from, to) {
  408. return new pexprs.Range(from, to);
  409. },
  410. param: function(index) {
  411. return new pexprs.Param(index);
  412. },
  413. alt: function(/* term1, term1, ... */) {
  414. var terms = [];
  415. for (var idx = 0; idx < arguments.length; idx++) {
  416. var arg = arguments[idx];
  417. if (!(arg instanceof pexprs.PExpr)) {
  418. arg = this.fromRecipe(arg);
  419. }
  420. if (arg instanceof pexprs.Alt) {
  421. terms = terms.concat(arg.terms);
  422. } else {
  423. terms.push(arg);
  424. }
  425. }
  426. return terms.length === 1 ? terms[0] : new pexprs.Alt(terms);
  427. },
  428. seq: function(/* factor1, factor2, ... */) {
  429. var factors = [];
  430. for (var idx = 0; idx < arguments.length; idx++) {
  431. var arg = arguments[idx];
  432. if (!(arg instanceof pexprs.PExpr)) {
  433. arg = this.fromRecipe(arg);
  434. }
  435. if (arg instanceof pexprs.Seq) {
  436. factors = factors.concat(arg.factors);
  437. } else {
  438. factors.push(arg);
  439. }
  440. }
  441. return factors.length === 1 ? factors[0] : new pexprs.Seq(factors);
  442. },
  443. star: function(expr) {
  444. if (!(expr instanceof pexprs.PExpr)) {
  445. expr = this.fromRecipe(expr);
  446. }
  447. return new pexprs.Star(expr);
  448. },
  449. plus: function(expr) {
  450. if (!(expr instanceof pexprs.PExpr)) {
  451. expr = this.fromRecipe(expr);
  452. }
  453. return new pexprs.Plus(expr);
  454. },
  455. opt: function(expr) {
  456. if (!(expr instanceof pexprs.PExpr)) {
  457. expr = this.fromRecipe(expr);
  458. }
  459. return new pexprs.Opt(expr);
  460. },
  461. not: function(expr) {
  462. if (!(expr instanceof pexprs.PExpr)) {
  463. expr = this.fromRecipe(expr);
  464. }
  465. return new pexprs.Not(expr);
  466. },
  467. la: function(expr) {
  468. // TODO: temporary to still be able to read old recipes
  469. return this.lookahead(expr);
  470. },
  471. lookahead: function(expr) {
  472. if (!(expr instanceof pexprs.PExpr)) {
  473. expr = this.fromRecipe(expr);
  474. }
  475. return new pexprs.Lookahead(expr);
  476. },
  477. lex: function(expr) {
  478. if (!(expr instanceof pexprs.PExpr)) {
  479. expr = this.fromRecipe(expr);
  480. }
  481. return new pexprs.Lex(expr);
  482. },
  483. app: function(ruleName, optParams) {
  484. if (optParams && optParams.length > 0) {
  485. optParams = optParams.map(function(param) {
  486. return param instanceof pexprs.PExpr ? param :
  487. this.fromRecipe(param);
  488. }, this);
  489. }
  490. return new pexprs.Apply(ruleName, optParams);
  491. },
  492. fromRecipe: function(recipe) {
  493. // the meta-info of 'grammar' is proccessed in Builder.grammar
  494. var result = this[recipe[0]].apply(this,
  495. recipe[0] === 'grammar' ? recipe.slice(1) : recipe.slice(2));
  496. var metaInfo = recipe[1];
  497. if (metaInfo) {
  498. if (metaInfo.sourceInterval && this.currentDecl) {
  499. result.withSource(
  500. this.currentDecl.sourceInterval.apply(this.currentDecl, metaInfo.sourceInterval)
  501. );
  502. }
  503. }
  504. return result;
  505. }
  506. };
  507. // --------------------------------------------------------------------
  508. // Exports
  509. // --------------------------------------------------------------------
  510. module.exports = Builder;
  511. },{"./GrammarDecl":14,"./pexprs":44}],11:[function(require,module,exports){
  512. 'use strict';
  513. // --------------------------------------------------------------------
  514. // Imports
  515. // --------------------------------------------------------------------
  516. var Failure = require('./Failure');
  517. var TerminalNode = require('./nodes').TerminalNode;
  518. var assert = require('./common').assert;
  519. var inherits = require('inherits');
  520. var pexprs = require('./pexprs');
  521. function CaseInsensitiveTerminal(param) {
  522. this.obj = param;
  523. }
  524. inherits(CaseInsensitiveTerminal, pexprs.PExpr);
  525. CaseInsensitiveTerminal.prototype = {
  526. _getString: function(state) {
  527. var terminal = state.currentApplication().args[this.obj.index];
  528. assert(terminal instanceof pexprs.Terminal, 'expected a Terminal expression');
  529. return terminal.obj;
  530. },
  531. // Implementation of the PExpr API
  532. allowsSkippingPrecedingSpace: function() {
  533. return true;
  534. },
  535. eval: function(state) {
  536. var inputStream = state.inputStream;
  537. var origPos = inputStream.pos;
  538. var matchStr = this._getString(state);
  539. if (!inputStream.matchString(matchStr, true)) {
  540. state.processFailure(origPos, this);
  541. return false;
  542. } else {
  543. state.pushBinding(new TerminalNode(state.grammar, matchStr), origPos);
  544. return true;
  545. }
  546. },
  547. generateExample: function(grammar, examples, inSyntacticContext, actuals) {
  548. // Start with a example generated from the Terminal...
  549. var str = this.obj.generateExample(grammar, examples, inSyntacticContext, actuals).value;
  550. // ...and randomly switch characters to uppercase/lowercase.
  551. var value = '';
  552. for (var i = 0; i < str.length; ++i) {
  553. value += Math.random() < 0.5 ? str[i].toLocaleLowerCase() : str[i].toLocaleUpperCase();
  554. }
  555. return {value: value};
  556. },
  557. getArity: function() {
  558. return 1;
  559. },
  560. substituteParams: function(actuals) {
  561. return new CaseInsensitiveTerminal(this.obj.substituteParams(actuals));
  562. },
  563. toDisplayString: function() {
  564. return this.obj.toDisplayString() + ' (case-insensitive)';
  565. },
  566. toFailure: function(grammar) {
  567. return new Failure(this, this.obj.toFailure(grammar) + ' (case-insensitive)', 'description');
  568. },
  569. _isNullable: function(grammar, memo) {
  570. return this.obj._isNullable(grammar, memo);
  571. }
  572. };
  573. module.exports = CaseInsensitiveTerminal;
  574. },{"./Failure":12,"./common":24,"./nodes":27,"./pexprs":44,"inherits":1}],12:[function(require,module,exports){
  575. 'use strict';
  576. // --------------------------------------------------------------------
  577. // Private stuff
  578. // --------------------------------------------------------------------
  579. /*
  580. `Failure`s represent expressions that weren't matched while parsing. They are used to generate
  581. error messages automatically. The interface of `Failure`s includes the collowing methods:
  582. - getText() : String
  583. - getType() : String (one of {"description", "string", "code"})
  584. - isDescription() : bool
  585. - isStringTerminal() : bool
  586. - isCode() : bool
  587. - isFluffy() : bool
  588. - makeFluffy() : void
  589. - subsumes(Failure) : bool
  590. */
  591. function isValidType(type) {
  592. return type === 'description' || type === 'string' || type === 'code';
  593. }
  594. function Failure(pexpr, text, type) {
  595. if (!isValidType(type)) {
  596. throw new Error('invalid Failure type: ' + type);
  597. }
  598. this.pexpr = pexpr;
  599. this.text = text;
  600. this.type = type;
  601. this.fluffy = false;
  602. }
  603. Failure.prototype.getPExpr = function() {
  604. return this.pexpr;
  605. };
  606. Failure.prototype.getText = function() {
  607. return this.text;
  608. };
  609. Failure.prototype.getType = function() {
  610. return this.type;
  611. };
  612. Failure.prototype.isDescription = function() {
  613. return this.type === 'description';
  614. };
  615. Failure.prototype.isStringTerminal = function() {
  616. return this.type === 'string';
  617. };
  618. Failure.prototype.isCode = function() {
  619. return this.type === 'code';
  620. };
  621. Failure.prototype.isFluffy = function() {
  622. return this.fluffy;
  623. };
  624. Failure.prototype.makeFluffy = function() {
  625. this.fluffy = true;
  626. };
  627. Failure.prototype.clearFluffy = function() {
  628. this.fluffy = false;
  629. };
  630. Failure.prototype.subsumes = function(that) {
  631. return this.getText() === that.getText() &&
  632. this.type === that.type &&
  633. (!this.isFluffy() || this.isFluffy() && that.isFluffy());
  634. };
  635. Failure.prototype.toString = function() {
  636. return this.type === 'string' ?
  637. JSON.stringify(this.getText()) :
  638. this.getText();
  639. };
  640. Failure.prototype.clone = function() {
  641. var failure = new Failure(this.pexpr, this.text, this.type);
  642. if (this.isFluffy()) {
  643. failure.makeFluffy();
  644. }
  645. return failure;
  646. };
  647. Failure.prototype.toKey = function() {
  648. return this.toString() + '#' + this.type;
  649. };
  650. // --------------------------------------------------------------------
  651. // Exports
  652. // --------------------------------------------------------------------
  653. module.exports = Failure;
  654. },{}],13:[function(require,module,exports){
  655. 'use strict';
  656. // --------------------------------------------------------------------
  657. // Imports
  658. // --------------------------------------------------------------------
  659. var CaseInsensitiveTerminal = require('./CaseInsensitiveTerminal');
  660. var Matcher = require('./Matcher');
  661. var Semantics = require('./Semantics');
  662. var common = require('./common');
  663. var errors = require('./errors');
  664. var pexprs = require('./pexprs');
  665. // --------------------------------------------------------------------
  666. // Private stuff
  667. // --------------------------------------------------------------------
  668. function getSortedRuleValues(grammar) {
  669. return Object.keys(grammar.rules).sort().map(function(name) { return grammar.rules[name]; });
  670. }
  671. function Grammar(
  672. name,
  673. superGrammar,
  674. rules,
  675. optDefaultStartRule) {
  676. this.name = name;
  677. this.superGrammar = superGrammar;
  678. this.rules = rules;
  679. if (optDefaultStartRule) {
  680. if (!(optDefaultStartRule in rules)) {
  681. throw new Error("Invalid start rule: '" + optDefaultStartRule +
  682. "' is not a rule in grammar '" + name + "'");
  683. }
  684. this.defaultStartRule = optDefaultStartRule;
  685. }
  686. }
  687. var ohmGrammar;
  688. var buildGrammar;
  689. // This method is called from main.js once Ohm has loaded.
  690. Grammar.initApplicationParser = function(grammar, builderFn) {
  691. ohmGrammar = grammar;
  692. buildGrammar = builderFn;
  693. };
  694. Grammar.prototype = {
  695. matcher: function() {
  696. return new Matcher(this);
  697. },
  698. // Return true if the grammar is a built-in grammar, otherwise false.
  699. // NOTE: This might give an unexpected result if called before BuiltInRules is defined!
  700. isBuiltIn: function() {
  701. return this === Grammar.ProtoBuiltInRules || this === Grammar.BuiltInRules;
  702. },
  703. equals: function(g) {
  704. if (this === g) {
  705. return true;
  706. }
  707. // Do the cheapest comparisons first.
  708. if (g == null ||
  709. this.name !== g.name ||
  710. this.defaultStartRule !== g.defaultStartRule ||
  711. !(this.superGrammar === g.superGrammar || this.superGrammar.equals(g.superGrammar))) {
  712. return false;
  713. }
  714. var myRules = getSortedRuleValues(this);
  715. var otherRules = getSortedRuleValues(g);
  716. return myRules.length === otherRules.length && myRules.every(function(rule, i) {
  717. return rule.description === otherRules[i].description &&
  718. rule.formals.join(',') === otherRules[i].formals.join(',') &&
  719. rule.body.toString() === otherRules[i].body.toString();
  720. });
  721. },
  722. match: function(input, optStartApplication) {
  723. var m = this.matcher();
  724. m.replaceInputRange(0, 0, input);
  725. return m.match(optStartApplication);
  726. },
  727. trace: function(input, optStartApplication) {
  728. var m = this.matcher();
  729. m.replaceInputRange(0, 0, input);
  730. return m.trace(optStartApplication);
  731. },
  732. semantics: function() {
  733. // TODO: Remove this eventually! Deprecated in v0.12.
  734. throw new Error('semantics() is deprecated -- use createSemantics() instead.');
  735. },
  736. createSemantics: function() {
  737. return Semantics.createSemantics(this);
  738. },
  739. extendSemantics: function(superSemantics) {
  740. return Semantics.createSemantics(this, superSemantics._getSemantics());
  741. },
  742. // Check that every key in `actionDict` corresponds to a semantic action, and that it maps to
  743. // a function of the correct arity. If not, throw an exception.
  744. _checkTopDownActionDict: function(what, name, actionDict) {
  745. function isSpecialAction(a) {
  746. return a === '_iter' || a === '_terminal' || a === '_nonterminal' || a === '_default';
  747. }
  748. var problems = [];
  749. for (var k in actionDict) {
  750. var v = actionDict[k];
  751. if (!isSpecialAction(k) && !(k in this.rules)) {
  752. problems.push("'" + k + "' is not a valid semantic action for '" + this.name + "'");
  753. } else if (typeof v !== 'function') {
  754. problems.push(
  755. "'" + k + "' must be a function in an action dictionary for '" + this.name + "'");
  756. } else {
  757. var actual = v.length;
  758. var expected = this._topDownActionArity(k);
  759. if (actual !== expected) {
  760. problems.push(
  761. "Semantic action '" + k + "' has the wrong arity: " +
  762. 'expected ' + expected + ', got ' + actual);
  763. }
  764. }
  765. }
  766. if (problems.length > 0) {
  767. var prettyProblems = problems.map(function(problem) { return '- ' + problem; });
  768. var error = new Error(
  769. "Found errors in the action dictionary of the '" + name + "' " + what + ':\n' +
  770. prettyProblems.join('\n'));
  771. error.problems = problems;
  772. throw error;
  773. }
  774. },
  775. // Return the expected arity for a semantic action named `actionName`, which
  776. // is either a rule name or a special action name like '_nonterminal'.
  777. _topDownActionArity: function(actionName) {
  778. if (actionName === '_iter' || actionName === '_nonterminal' || actionName === '_default') {
  779. return 1;
  780. } else if (actionName === '_terminal') {
  781. return 0;
  782. }
  783. return this.rules[actionName].body.getArity();
  784. },
  785. _inheritsFrom: function(grammar) {
  786. var g = this.superGrammar;
  787. while (g) {
  788. if (g.equals(grammar, true)) {
  789. return true;
  790. }
  791. g = g.superGrammar;
  792. }
  793. return false;
  794. },
  795. toRecipe: function(optVarName) {
  796. var metaInfo = {};
  797. // Include the grammar source if it is available.
  798. if (this.source) {
  799. metaInfo.source = this.source.contents;
  800. }
  801. var superGrammar = null;
  802. if (this.superGrammar && !this.superGrammar.isBuiltIn()) {
  803. superGrammar = JSON.parse(this.superGrammar.toRecipe());
  804. }
  805. var startRule = null;
  806. if (this.defaultStartRule) {
  807. startRule = this.defaultStartRule;
  808. }
  809. var rules = {};
  810. var self = this;
  811. Object.keys(this.rules).forEach(function(ruleName) {
  812. var ruleInfo = self.rules[ruleName];
  813. var body = ruleInfo.body;
  814. var isDefinition = !self.superGrammar || !self.superGrammar.rules[ruleName];
  815. var operation;
  816. if (isDefinition) {
  817. operation = 'define';
  818. } else {
  819. operation = body instanceof pexprs.Extend ? 'extend' : 'override';
  820. }
  821. var metaInfo = {};
  822. if (ruleInfo.source && self.source) {
  823. var adjusted = ruleInfo.source.relativeTo(self.source);
  824. metaInfo.sourceInterval = [adjusted.startIdx, adjusted.endIdx];
  825. }
  826. var description = isDefinition ? ruleInfo.description : null;
  827. var bodyRecipe = body.outputRecipe(ruleInfo.formals, self.source);
  828. rules[ruleName] = [
  829. operation, // "define"/"extend"/"override"
  830. metaInfo,
  831. description,
  832. ruleInfo.formals,
  833. bodyRecipe
  834. ];
  835. });
  836. return JSON.stringify([
  837. 'grammar',
  838. metaInfo,
  839. this.name,
  840. superGrammar,
  841. startRule,
  842. rules
  843. ]);
  844. },
  845. // TODO: Come up with better names for these methods.
  846. // TODO: Write the analog of these methods for inherited attributes.
  847. toOperationActionDictionaryTemplate: function() {
  848. return this._toOperationOrAttributeActionDictionaryTemplate();
  849. },
  850. toAttributeActionDictionaryTemplate: function() {
  851. return this._toOperationOrAttributeActionDictionaryTemplate();
  852. },
  853. _toOperationOrAttributeActionDictionaryTemplate: function() {
  854. // TODO: add the super-grammar's templates at the right place, e.g., a case for AddExpr_plus
  855. // should appear next to other cases of AddExpr.
  856. var sb = new common.StringBuffer();
  857. sb.append('{');
  858. var first = true;
  859. for (var ruleName in this.rules) {
  860. var body = this.rules[ruleName].body;
  861. if (first) {
  862. first = false;
  863. } else {
  864. sb.append(',');
  865. }
  866. sb.append('\n');
  867. sb.append(' ');
  868. this.addSemanticActionTemplate(ruleName, body, sb);
  869. }
  870. sb.append('\n}');
  871. return sb.contents();
  872. },
  873. addSemanticActionTemplate: function(ruleName, body, sb) {
  874. sb.append(ruleName);
  875. sb.append(': function(');
  876. var arity = this._topDownActionArity(ruleName);
  877. sb.append(common.repeat('_', arity).join(', '));
  878. sb.append(') {\n');
  879. sb.append(' }');
  880. },
  881. // Parse a string which expresses a rule application in this grammar, and return the
  882. // resulting Apply node.
  883. parseApplication: function(str) {
  884. var app;
  885. if (str.indexOf('<') === -1) {
  886. // simple application
  887. app = new pexprs.Apply(str);
  888. } else {
  889. // parameterized application
  890. var cst = ohmGrammar.match(str, 'Base_application');
  891. app = buildGrammar(cst, {});
  892. }
  893. // Ensure that the application is valid.
  894. if (!(app.ruleName in this.rules)) {
  895. throw errors.undeclaredRule(app.ruleName, this.name);
  896. }
  897. var formals = this.rules[app.ruleName].formals;
  898. if (formals.length !== app.args.length) {
  899. var source = this.rules[app.ruleName].source;
  900. throw errors.wrongNumberOfParameters(app.ruleName, formals.length, app.args.length, source);
  901. }
  902. return app;
  903. }
  904. };
  905. // The following grammar contains a few rules that couldn't be written in "userland".
  906. // At the bottom of src/main.js, we create a sub-grammar of this grammar that's called
  907. // `BuiltInRules`. That grammar contains several convenience rules, e.g., `letter` and
  908. // `digit`, and is implicitly the super-grammar of any grammar whose super-grammar
  909. // isn't specified.
  910. Grammar.ProtoBuiltInRules = new Grammar(
  911. 'ProtoBuiltInRules', // name
  912. undefined, // supergrammar
  913. {
  914. any: {
  915. body: pexprs.any,
  916. formals: [],
  917. description: 'any character',
  918. primitive: true
  919. },
  920. end: {
  921. body: pexprs.end,
  922. formals: [],
  923. description: 'end of input',
  924. primitive: true
  925. },
  926. caseInsensitive: {
  927. body: new CaseInsensitiveTerminal(new pexprs.Param(0)),
  928. formals: ['str'],
  929. primitive: true
  930. },
  931. lower: {
  932. body: new pexprs.UnicodeChar('Ll'),
  933. formals: [],
  934. description: 'a lowercase letter',
  935. primitive: true
  936. },
  937. upper: {
  938. body: new pexprs.UnicodeChar('Lu'),
  939. formals: [],
  940. description: 'an uppercase letter',
  941. primitive: true
  942. },
  943. // The union of Lt (titlecase), Lm (modifier), and Lo (other), i.e. any letter not in Ll or Lu.
  944. unicodeLtmo: {
  945. body: new pexprs.UnicodeChar('Ltmo'),
  946. formals: [],
  947. description: 'a Unicode character in Lt, Lm, or Lo',
  948. primitive: true
  949. },
  950. // These rules are not truly primitive (they could be written in userland) but are defined
  951. // here for bootstrapping purposes.
  952. spaces: {
  953. body: new pexprs.Star(new pexprs.Apply('space')),
  954. formals: []
  955. },
  956. space: {
  957. body: new pexprs.Range('\x00', ' '),
  958. formals: [],
  959. description: 'a space'
  960. }
  961. }
  962. );
  963. // --------------------------------------------------------------------
  964. // Exports
  965. // --------------------------------------------------------------------
  966. module.exports = Grammar;
  967. },{"./CaseInsensitiveTerminal":11,"./Matcher":19,"./Semantics":22,"./common":24,"./errors":25,"./pexprs":44}],14:[function(require,module,exports){
  968. 'use strict';
  969. // --------------------------------------------------------------------
  970. // Imports
  971. // --------------------------------------------------------------------
  972. var Grammar = require('./Grammar');
  973. var InputStream = require('./InputStream');
  974. var common = require('./common');
  975. var errors = require('./errors');
  976. var pexprs = require('./pexprs');
  977. // --------------------------------------------------------------------
  978. // Private Stuff
  979. // --------------------------------------------------------------------
  980. // Constructors
  981. function GrammarDecl(name) {
  982. this.name = name;
  983. }
  984. // Helpers
  985. GrammarDecl.prototype.sourceInterval = function(startIdx, endIdx) {
  986. return this.source.subInterval(startIdx, endIdx - startIdx);
  987. };
  988. GrammarDecl.prototype.ensureSuperGrammar = function() {
  989. if (!this.superGrammar) {
  990. this.withSuperGrammar(
  991. // TODO: The conditional expression below is an ugly hack. It's kind of ok because
  992. // I doubt anyone will ever try to declare a grammar called `BuiltInRules`. Still,
  993. // we should try to find a better way to do this.
  994. this.name === 'BuiltInRules' ?
  995. Grammar.ProtoBuiltInRules :
  996. Grammar.BuiltInRules);
  997. }
  998. return this.superGrammar;
  999. };
  1000. GrammarDecl.prototype.installOverriddenOrExtendedRule = function(name, formals, body, source) {
  1001. var duplicateParameterNames = common.getDuplicates(formals);
  1002. if (duplicateParameterNames.length > 0) {
  1003. throw errors.duplicateParameterNames(name, duplicateParameterNames, source);
  1004. }
  1005. var ruleInfo = this.ensureSuperGrammar().rules[name];
  1006. var expectedFormals = ruleInfo.formals;
  1007. var expectedNumFormals = expectedFormals ? expectedFormals.length : 0;
  1008. if (formals.length !== expectedNumFormals) {
  1009. throw errors.wrongNumberOfParameters(name, expectedNumFormals, formals.length, source);
  1010. }
  1011. return this.install(name, formals, body, ruleInfo.description, source);
  1012. };
  1013. GrammarDecl.prototype.install = function(name, formals, body, description, source) {
  1014. this.rules[name] = {
  1015. body: body.introduceParams(formals),
  1016. formals: formals,
  1017. description: description,
  1018. source: source
  1019. };
  1020. return this;
  1021. };
  1022. // Stuff that you should only do once
  1023. GrammarDecl.prototype.withSuperGrammar = function(superGrammar) {
  1024. if (this.superGrammar) {
  1025. throw new Error('the super grammar of a GrammarDecl cannot be set more than once');
  1026. }
  1027. this.superGrammar = superGrammar;
  1028. this.rules = Object.create(superGrammar.rules);
  1029. // Grammars with an explicit supergrammar inherit a default start rule.
  1030. if (!superGrammar.isBuiltIn()) {
  1031. this.defaultStartRule = superGrammar.defaultStartRule;
  1032. }
  1033. return this;
  1034. };
  1035. GrammarDecl.prototype.withDefaultStartRule = function(ruleName) {
  1036. this.defaultStartRule = ruleName;
  1037. return this;
  1038. };
  1039. GrammarDecl.prototype.withSource = function(source) {
  1040. this.source = new InputStream(source).interval(0, source.length);
  1041. return this;
  1042. };
  1043. // Creates a Grammar instance, and if it passes the sanity checks, returns it.
  1044. GrammarDecl.prototype.build = function() {
  1045. var grammar = new Grammar(
  1046. this.name,
  1047. this.ensureSuperGrammar(),
  1048. this.rules,
  1049. this.defaultStartRule);
  1050. // TODO: change the pexpr.prototype.assert... methods to make them add
  1051. // exceptions to an array that's provided as an arg. Then we'll be able to
  1052. // show more than one error of the same type at a time.
  1053. // TODO: include the offending pexpr in the errors, that way we can show
  1054. // the part of the source that caused it.
  1055. var grammarErrors = [];
  1056. var grammarHasInvalidApplications = false;
  1057. Object.keys(grammar.rules).forEach(function(ruleName) {
  1058. var body = grammar.rules[ruleName].body;
  1059. try {
  1060. body.assertChoicesHaveUniformArity(ruleName);
  1061. } catch (e) {
  1062. grammarErrors.push(e);
  1063. }
  1064. try {
  1065. body.assertAllApplicationsAreValid(ruleName, grammar);
  1066. } catch (e) {
  1067. grammarErrors.push(e);
  1068. grammarHasInvalidApplications = true;
  1069. }
  1070. });
  1071. if (!grammarHasInvalidApplications) {
  1072. // The following check can only be done if the grammar has no invalid applications.
  1073. Object.keys(grammar.rules).forEach(function(ruleName) {
  1074. var body = grammar.rules[ruleName].body;
  1075. try {
  1076. body.assertIteratedExprsAreNotNullable(grammar, []);
  1077. } catch (e) {
  1078. grammarErrors.push(e);
  1079. }
  1080. });
  1081. }
  1082. if (grammarErrors.length > 0) {
  1083. errors.throwErrors(grammarErrors);
  1084. }
  1085. if (this.source) {
  1086. grammar.source = this.source;
  1087. }
  1088. return grammar;
  1089. };
  1090. // Rule declarations
  1091. GrammarDecl.prototype.define = function(name, formals, body, description, source) {
  1092. this.ensureSuperGrammar();
  1093. if (this.superGrammar.rules[name]) {
  1094. throw errors.duplicateRuleDeclaration(name, this.name, this.superGrammar.name, source);
  1095. } else if (this.rules[name]) {
  1096. throw errors.duplicateRuleDeclaration(name, this.name, this.name, source);
  1097. }
  1098. var duplicateParameterNames = common.getDuplicates(formals);
  1099. if (duplicateParameterNames.length > 0) {
  1100. throw errors.duplicateParameterNames(name, duplicateParameterNames, source);
  1101. }
  1102. return this.install(name, formals, body, description, source);
  1103. };
  1104. GrammarDecl.prototype.override = function(name, formals, body, descIgnored, source) {
  1105. var ruleInfo = this.ensureSuperGrammar().rules[name];
  1106. if (!ruleInfo) {
  1107. throw errors.cannotOverrideUndeclaredRule(name, this.superGrammar.name, source);
  1108. }
  1109. this.installOverriddenOrExtendedRule(name, formals, body, source);
  1110. return this;
  1111. };
  1112. GrammarDecl.prototype.extend = function(name, formals, fragment, descIgnored, source) {
  1113. var ruleInfo = this.ensureSuperGrammar().rules[name];
  1114. if (!ruleInfo) {
  1115. throw errors.cannotExtendUndeclaredRule(name, this.superGrammar.name, source);
  1116. }
  1117. var body = new pexprs.Extend(this.superGrammar, name, fragment);
  1118. body.source = fragment.source;
  1119. this.installOverriddenOrExtendedRule(name, formals, body, source);
  1120. return this;
  1121. };
  1122. // --------------------------------------------------------------------
  1123. // Exports
  1124. // --------------------------------------------------------------------
  1125. module.exports = GrammarDecl;
  1126. },{"./Grammar":13,"./InputStream":15,"./common":24,"./errors":25,"./pexprs":44}],15:[function(require,module,exports){
  1127. 'use strict';
  1128. // --------------------------------------------------------------------
  1129. // Imports
  1130. // --------------------------------------------------------------------
  1131. var Interval = require('./Interval');
  1132. // --------------------------------------------------------------------
  1133. // Private stuff
  1134. // --------------------------------------------------------------------
  1135. function InputStream(source) {
  1136. this.source = source;
  1137. this.pos = 0;
  1138. this.examinedLength = 0;
  1139. }
  1140. InputStream.prototype = {
  1141. atEnd: function() {
  1142. var ans = this.pos === this.source.length;
  1143. this.examinedLength = Math.max(this.examinedLength, this.pos + 1);
  1144. return ans;
  1145. },
  1146. next: function() {
  1147. var ans = this.source[this.pos++];
  1148. this.examinedLength = Math.max(this.examinedLength, this.pos);
  1149. return ans;
  1150. },
  1151. matchString: function(s, optIgnoreCase) {
  1152. var idx;
  1153. if (optIgnoreCase) {
  1154. /*
  1155. Case-insensitive comparison is a tricky business. Some notable gotchas include the
  1156. "Turkish I" problem (http://www.i18nguy.com/unicode/turkish-i18n.html) and the fact
  1157. that the German Esszet (ß) turns into "SS" in upper case.
  1158. This is intended to be a locale-invariant comparison, which means it may not obey
  1159. locale-specific expectations (e.g. "i" => "İ").
  1160. */
  1161. for (idx = 0; idx < s.length; idx++) {
  1162. var actual = this.next();
  1163. var expected = s[idx];
  1164. if (actual == null || actual.toUpperCase() !== expected.toUpperCase()) {
  1165. return false;
  1166. }
  1167. }
  1168. return true;
  1169. }
  1170. // Default is case-sensitive comparison.
  1171. for (idx = 0; idx < s.length; idx++) {
  1172. if (this.next() !== s[idx]) { return false; }
  1173. }
  1174. return true;
  1175. },
  1176. sourceSlice: function(startIdx, endIdx) {
  1177. return this.source.slice(startIdx, endIdx);
  1178. },
  1179. interval: function(startIdx, optEndIdx) {
  1180. return new Interval(this.source, startIdx, optEndIdx ? optEndIdx : this.pos);
  1181. }
  1182. };
  1183. // --------------------------------------------------------------------
  1184. // Exports
  1185. // --------------------------------------------------------------------
  1186. module.exports = InputStream;
  1187. },{"./Interval":16}],16:[function(require,module,exports){
  1188. 'use strict';
  1189. // --------------------------------------------------------------------
  1190. // Imports
  1191. // --------------------------------------------------------------------
  1192. var assert = require('./common').assert;
  1193. var errors = require('./errors');
  1194. var util = require('./util');
  1195. // --------------------------------------------------------------------
  1196. // Private stuff
  1197. // --------------------------------------------------------------------
  1198. function Interval(sourceString, startIdx, endIdx) {
  1199. this.sourceString = sourceString;
  1200. this.startIdx = startIdx;
  1201. this.endIdx = endIdx;
  1202. }
  1203. Interval.coverage = function(/* interval1, interval2, ... */) {
  1204. var sourceString = arguments[0].sourceString;
  1205. var startIdx = arguments[0].startIdx;
  1206. var endIdx = arguments[0].endIdx;
  1207. for (var idx = 1; idx < arguments.length; idx++) {
  1208. var interval = arguments[idx];
  1209. if (interval.sourceString !== sourceString) {
  1210. throw errors.intervalSourcesDontMatch();
  1211. } else {
  1212. startIdx = Math.min(startIdx, arguments[idx].startIdx);
  1213. endIdx = Math.max(endIdx, arguments[idx].endIdx);
  1214. }
  1215. }
  1216. return new Interval(sourceString, startIdx, endIdx);
  1217. };
  1218. Interval.prototype = {
  1219. coverageWith: function(/* interval1, interval2, ... */) {
  1220. var intervals = Array.prototype.slice.call(arguments);
  1221. intervals.push(this);
  1222. return Interval.coverage.apply(undefined, intervals);
  1223. },
  1224. collapsedLeft: function() {
  1225. return new Interval(this.sourceString, this.startIdx, this.startIdx);
  1226. },
  1227. collapsedRight: function() {
  1228. return new Interval(this.sourceString, this.endIdx, this.endIdx);
  1229. },
  1230. getLineAndColumnMessage: function() {
  1231. var range = [this.startIdx, this.endIdx];
  1232. return util.getLineAndColumnMessage(this.sourceString, this.startIdx, range);
  1233. },
  1234. // Returns an array of 0, 1, or 2 intervals that represents the result of the
  1235. // interval difference operation.
  1236. minus: function(that) {
  1237. if (this.sourceString !== that.sourceString) {
  1238. throw errors.intervalSourcesDontMatch();
  1239. } else if (this.startIdx === that.startIdx && this.endIdx === that.endIdx) {
  1240. // `this` and `that` are the same interval!
  1241. return [
  1242. ];
  1243. } else if (this.startIdx < that.startIdx && that.endIdx < this.endIdx) {
  1244. // `that` splits `this` into two intervals
  1245. return [
  1246. new Interval(this.sourceString, this.startIdx, that.startIdx),
  1247. new Interval(this.sourceString, that.endIdx, this.endIdx)
  1248. ];
  1249. } else if (this.startIdx < that.endIdx && that.endIdx < this.endIdx) {
  1250. // `that` contains a prefix of `this`
  1251. return [
  1252. new Interval(this.sourceString, that.endIdx, this.endIdx)
  1253. ];
  1254. } else if (this.startIdx < that.startIdx && that.startIdx < this.endIdx) {
  1255. // `that` contains a suffix of `this`
  1256. return [
  1257. new Interval(this.sourceString, this.startIdx, that.startIdx)
  1258. ];
  1259. } else {
  1260. // `that` and `this` do not overlap
  1261. return [
  1262. this
  1263. ];
  1264. }
  1265. },
  1266. // Returns a new Interval that has the same extent as this one, but which is relative
  1267. // to `that`, an Interval that fully covers this one.
  1268. relativeTo: function(that) {
  1269. if (this.sourceString !== that.sourceString) {
  1270. throw errors.intervalSourcesDontMatch();
  1271. }
  1272. assert(this.startIdx >= that.startIdx && this.endIdx <= that.endIdx,
  1273. 'other interval does not cover this one');
  1274. return new Interval(this.sourceString,
  1275. this.startIdx - that.startIdx,
  1276. this.endIdx - that.startIdx);
  1277. },
  1278. // Returns a new Interval which contains the same contents as this one,
  1279. // but with whitespace trimmed from both ends. (This only makes sense when
  1280. // the input stream is a string.)
  1281. trimmed: function() {
  1282. var contents = this.contents;
  1283. var startIdx = this.startIdx + contents.match(/^\s*/)[0].length;
  1284. var endIdx = this.endIdx - contents.match(/\s*$/)[0].length;
  1285. return new Interval(this.sourceString, startIdx, endIdx);
  1286. },
  1287. subInterval: function(offset, len) {
  1288. var newStartIdx = this.startIdx + offset;
  1289. return new Interval(this.sourceString, newStartIdx, newStartIdx + len);
  1290. }
  1291. };
  1292. Object.defineProperties(Interval.prototype, {
  1293. contents: {
  1294. get: function() {
  1295. if (this._contents === undefined) {
  1296. this._contents = this.sourceString.slice(this.startIdx, this.endIdx);
  1297. }
  1298. return this._contents;
  1299. },
  1300. enumerable: true
  1301. },
  1302. length: {
  1303. get: function() { return this.endIdx - this.startIdx; },
  1304. enumerable: true
  1305. }
  1306. });
  1307. // --------------------------------------------------------------------
  1308. // Exports
  1309. // --------------------------------------------------------------------
  1310. module.exports = Interval;
  1311. },{"./common":24,"./errors":25,"./util":45}],17:[function(require,module,exports){
  1312. 'use strict';
  1313. // --------------------------------------------------------------------
  1314. // Imports
  1315. // --------------------------------------------------------------------
  1316. var common = require('./common');
  1317. var util = require('./util');
  1318. var Interval = require('./Interval');
  1319. // --------------------------------------------------------------------
  1320. // Private stuff
  1321. // --------------------------------------------------------------------
  1322. function MatchResult(
  1323. matcher,
  1324. input,
  1325. startExpr,
  1326. cst,
  1327. cstOffset,
  1328. rightmostFailurePosition,
  1329. optRecordedFailures) {
  1330. this.matcher = matcher;
  1331. this.input = input;
  1332. this.startExpr = startExpr;
  1333. this._cst = cst;
  1334. this._cstOffset = cstOffset;
  1335. this._rightmostFailurePosition = rightmostFailurePosition;
  1336. this._rightmostFailures = optRecordedFailures;
  1337. if (this.failed()) {
  1338. common.defineLazyProperty(this, 'message', function() {
  1339. var detail = 'Expected ' + this.getExpectedText();
  1340. return util.getLineAndColumnMessage(this.input, this.getRightmostFailurePosition()) + detail;
  1341. });
  1342. common.defineLazyProperty(this, 'shortMessage', function() {
  1343. var detail = 'expected ' + this.getExpectedText();
  1344. var errorInfo = util.getLineAndColumn(this.input, this.getRightmostFailurePosition());
  1345. return 'Line ' + errorInfo.lineNum + ', col ' + errorInfo.colNum + ': ' + detail;
  1346. });
  1347. }
  1348. }
  1349. MatchResult.prototype.succeeded = function() {
  1350. return !!this._cst;
  1351. };
  1352. MatchResult.prototype.failed = function() {
  1353. return !this.succeeded();
  1354. };
  1355. MatchResult.prototype.getRightmostFailurePosition = function() {
  1356. return this._rightmostFailurePosition;
  1357. };
  1358. MatchResult.prototype.getRightmostFailures = function() {
  1359. if (!this._rightmostFailures) {
  1360. this.matcher.setInput(this.input);
  1361. var matchResultWithFailures =
  1362. this.matcher._match(this.startExpr, false, this.getRightmostFailurePosition());
  1363. this._rightmostFailures = matchResultWithFailures.getRightmostFailures();
  1364. }
  1365. return this._rightmostFailures;
  1366. };
  1367. MatchResult.prototype.toString = function() {
  1368. return this.succeeded() ?
  1369. '[match succeeded]' :
  1370. '[match failed at position ' + this.getRightmostFailurePosition() + ']';
  1371. };
  1372. // Return a string summarizing the expected contents of the input stream when
  1373. // the match failure occurred.
  1374. MatchResult.prototype.getExpectedText = function() {
  1375. if (this.succeeded()) {
  1376. throw new Error('cannot get expected text of a successful MatchResult');
  1377. }
  1378. var sb = new common.StringBuffer();
  1379. var failures = this.getRightmostFailures();
  1380. // Filter out the fluffy failures to make the default error messages more useful
  1381. failures = failures.filter(function(failure) {
  1382. return !failure.isFluffy();
  1383. });
  1384. for (var idx = 0; idx < failures.length; idx++) {
  1385. if (idx > 0) {
  1386. if (idx === failures.length - 1) {
  1387. sb.append(failures.length > 2 ? ', or ' : ' or ');
  1388. } else {
  1389. sb.append(', ');
  1390. }
  1391. }
  1392. sb.append(failures[idx].toString());
  1393. }
  1394. return sb.contents();
  1395. };
  1396. MatchResult.prototype.getInterval = function() {
  1397. var pos = this.getRightmostFailurePosition();
  1398. return new Interval(this.input, pos, pos);
  1399. };
  1400. // --------------------------------------------------------------------
  1401. // Exports
  1402. // --------------------------------------------------------------------
  1403. module.exports = MatchResult;
  1404. },{"./Interval":16,"./common":24,"./util":45}],18:[function(require,module,exports){
  1405. 'use strict';
  1406. // --------------------------------------------------------------------
  1407. // Imports
  1408. // --------------------------------------------------------------------
  1409. var InputStream = require('./InputStream');
  1410. var MatchResult = require('./MatchResult');
  1411. var PosInfo = require('./PosInfo');
  1412. var Trace = require('./Trace');
  1413. var pexprs = require('./pexprs');
  1414. // --------------------------------------------------------------------
  1415. // Private stuff
  1416. // --------------------------------------------------------------------
  1417. var applySpaces = new pexprs.Apply('spaces');
  1418. function MatchState(matcher, startExpr, optPositionToRecordFailures) {
  1419. this.matcher = matcher;
  1420. this.startExpr = startExpr;
  1421. this.grammar = matcher.grammar;
  1422. this.input = matcher.input;
  1423. this.inputStream = new InputStream(matcher.input);
  1424. this.memoTable = matcher.memoTable;
  1425. this._bindings = [];
  1426. this._bindingOffsets = [];
  1427. this._applicationStack = [];
  1428. this._posStack = [0];
  1429. this.inLexifiedContextStack = [false];
  1430. this.rightmostFailurePosition = -1;
  1431. this._rightmostFailurePositionStack = [];
  1432. this._recordedFailuresStack = [];
  1433. if (optPositionToRecordFailures !== undefined) {
  1434. this.positionToRecordFailures = optPositionToRecordFailures;
  1435. this.recordedFailures = Object.create(null);
  1436. }
  1437. }
  1438. MatchState.prototype = {
  1439. posToOffset: function(pos) {
  1440. return pos - this._posStack[this._posStack.length - 1];
  1441. },
  1442. enterApplication: function(posInfo, app) {
  1443. this._posStack.push(this.inputStream.pos);
  1444. this._applicationStack.push(app);
  1445. this.inLexifiedContextStack.push(false);
  1446. posInfo.enter(app);
  1447. this._rightmostFailurePositionStack.push(this.rightmostFailurePosition);
  1448. this.rightmostFailurePosition = -1;
  1449. },
  1450. exitApplication: function(posInfo, optNode) {
  1451. var origPos = this._posStack.pop();
  1452. this._applicationStack.pop();
  1453. this.inLexifiedContextStack.pop();
  1454. posInfo.exit();
  1455. this.rightmostFailurePosition = Math.max(
  1456. this.rightmostFailurePosition,
  1457. this._rightmostFailurePositionStack.pop());
  1458. if (optNode) {
  1459. this.pushBinding(optNode, origPos);
  1460. }
  1461. },
  1462. enterLexifiedContext: function() {
  1463. this.inLexifiedContextStack.push(true);
  1464. },
  1465. exitLexifiedContext: function() {
  1466. this.inLexifiedContextStack.pop();
  1467. },
  1468. currentApplication: function() {
  1469. return this._applicationStack[this._applicationStack.length - 1];
  1470. },
  1471. inSyntacticContext: function() {
  1472. if (typeof this.inputStream.source !== 'string') {
  1473. return false;
  1474. }
  1475. var currentApplication = this.currentApplication();
  1476. if (currentApplication) {
  1477. return currentApplication.isSyntactic() && !this.inLexifiedContext();
  1478. } else {
  1479. // The top-level context is syntactic if the start application is.
  1480. return this.startExpr.factors[0].isSyntactic();
  1481. }
  1482. },
  1483. inLexifiedContext: function() {
  1484. return this.inLexifiedContextStack[this.inLexifiedContextStack.length - 1];
  1485. },
  1486. skipSpaces: function() {
  1487. this.pushFailuresInfo();
  1488. this.eval(applySpaces);
  1489. this.popBinding();
  1490. this.popFailuresInfo();
  1491. return this.inputStream.pos;
  1492. },
  1493. skipSpacesIfInSyntacticContext: function() {
  1494. return this.inSyntacticContext() ?
  1495. this.skipSpaces() :
  1496. this.inputStream.pos;
  1497. },
  1498. maybeSkipSpacesBefore: function(expr) {
  1499. if (expr instanceof pexprs.Apply && expr.isSyntactic()) {
  1500. return this.skipSpaces();
  1501. } else if (expr.allowsSkippingPrecedingSpace() && expr !== applySpaces) {
  1502. return this.skipSpacesIfInSyntacticContext();
  1503. } else {
  1504. return this.inputStream.pos;
  1505. }
  1506. },
  1507. pushBinding: function(node, origPos) {
  1508. this._bindings.push(node);
  1509. this._bindingOffsets.push(this.posToOffset(origPos));
  1510. },
  1511. popBinding: function() {
  1512. this._bindings.pop();
  1513. this._bindingOffsets.pop();
  1514. },
  1515. numBindings: function() {
  1516. return this._bindings.length;
  1517. },
  1518. truncateBindings: function(newLength) {
  1519. // Yes, this is this really faster than setting the `length` property (tested with
  1520. // bin/es5bench on Node v6.1.0).
  1521. while (this._bindings.length > newLength) {
  1522. this.popBinding();
  1523. }
  1524. },
  1525. getCurrentPosInfo: function() {
  1526. return this.getPosInfo(this.inputStream.pos);
  1527. },
  1528. getPosInfo: function(pos) {
  1529. var posInfo = this.memoTable[pos];
  1530. if (!posInfo) {
  1531. posInfo = this.memoTable[pos] = new PosInfo();
  1532. }
  1533. return posInfo;
  1534. },
  1535. processFailure: function(pos, expr) {
  1536. this.rightmostFailurePosition = Math.max(this.rightmostFailurePosition, pos);
  1537. if (this.recordedFailures && pos === this.positionToRecordFailures) {
  1538. var app = this.currentApplication();
  1539. if (app) {
  1540. // Substitute parameters with the actual pexprs that were passed to
  1541. // the current rule.
  1542. expr = expr.substituteParams(app.args);
  1543. } else {
  1544. // This branch is only reached for the "end-check" that is
  1545. // performed after the top-level application. In that case,
  1546. // expr === pexprs.end so there is no need to substitute
  1547. // parameters.
  1548. }
  1549. this.recordFailure(expr.toFailure(this.grammar), false);
  1550. }
  1551. },
  1552. recordFailure: function(failure, shouldCloneIfNew) {
  1553. var key = failure.toKey();
  1554. if (!this.recordedFailures[key]) {
  1555. this.recordedFailures[key] = shouldCloneIfNew ? failure.clone() : failure;
  1556. } else if (this.recordedFailures[key].isFluffy() && !failure.isFluffy()) {
  1557. this.recordedFailures[key].clearFluffy();
  1558. }
  1559. },
  1560. recordFailures: function(failures, shouldCloneIfNew) {
  1561. var self = this;
  1562. Object.keys(failures).forEach(function(key) {
  1563. self.recordFailure(failures[key], shouldCloneIfNew);
  1564. });
  1565. },
  1566. cloneRecordedFailures: function() {
  1567. if (!this.recordedFailures) {
  1568. return undefined;
  1569. }
  1570. var ans = Object.create(null);
  1571. var self = this;
  1572. Object.keys(this.recordedFailures).forEach(function(key) {
  1573. ans[key] = self.recordedFailures[key].clone();
  1574. });
  1575. return ans;
  1576. },
  1577. getRightmostFailurePosition: function() {
  1578. return this.rightmostFailurePosition;
  1579. },
  1580. _getRightmostFailureOffset: function() {
  1581. return this.rightmostFailurePosition >= 0 ?
  1582. this.posToOffset(this.rightmostFailurePosition) :
  1583. -1;
  1584. },
  1585. // Returns the memoized trace entry for `expr` at `pos`, if one exists, `null` otherwise.
  1586. getMemoizedTraceEntry: function(pos, expr) {
  1587. var posInfo = this.memoTable[pos];
  1588. if (posInfo && expr.ruleName) {
  1589. var memoRec = posInfo.memo[expr.toMemoKey()];
  1590. if (memoRec && memoRec.traceEntry) {
  1591. var entry = memoRec.traceEntry.cloneWithExpr(expr);
  1592. entry.isMemoized = true;
  1593. return entry;
  1594. }
  1595. }
  1596. return null;
  1597. },
  1598. // Returns a new trace entry, with the currently active trace array as its children.
  1599. getTraceEntry: function(pos, expr, succeeded, bindings) {
  1600. if (expr instanceof pexprs.Apply) {
  1601. var app = this.currentApplication();
  1602. var actuals = app ? app.args : [];
  1603. expr = expr.substituteParams(actuals);
  1604. }
  1605. return this.getMemoizedTraceEntry(pos, expr) ||
  1606. new Trace(this.input, pos, this.inputStream.pos, expr, succeeded, bindings, this.trace);
  1607. },
  1608. isTracing: function() {
  1609. return !!this.trace;
  1610. },
  1611. hasNecessaryInfo: function(memoRec) {
  1612. if (this.trace && !memoRec.traceEntry) {
  1613. return false;
  1614. }
  1615. if (this.recordedFailures &&
  1616. this.inputStream.pos + memoRec.rightmostFailureOffset === this.positionToRecordFailures) {
  1617. return !!memoRec.failuresAtRightmostPosition;
  1618. }
  1619. return true;
  1620. },
  1621. useMemoizedResult: function(origPos, memoRec) {
  1622. if (this.trace) {
  1623. this.trace.push(memoRec.traceEntry);
  1624. }
  1625. var memoRecRightmostFailurePosition = this.inputStream.pos + memoRec.rightmostFailureOffset;
  1626. this.rightmostFailurePosition =
  1627. Math.max(this.rightmostFailurePosition, memoRecRightmostFailurePosition);
  1628. if (this.recordedFailures &&
  1629. this.positionToRecordFailures === memoRecRightmostFailurePosition &&
  1630. memoRec.failuresAtRightmostPosition) {
  1631. this.recordFailures(memoRec.failuresAtRightmostPosition, true);
  1632. }
  1633. this.inputStream.examinedLength =
  1634. Math.max(this.inputStream.examinedLength, memoRec.examinedLength + origPos);
  1635. if (memoRec.value) {
  1636. this.inputStream.pos += memoRec.matchLength;
  1637. this.pushBinding(memoRec.value, origPos);
  1638. return true;
  1639. }
  1640. return false;
  1641. },
  1642. // Evaluate `expr` and return `true` if it succeeded, `false` otherwise. On success, `bindings`
  1643. // will have `expr.getArity()` more elements than before, and the input stream's position may
  1644. // have increased. On failure, `bindings` and position will be unchanged.
  1645. eval: function(expr) {
  1646. var inputStream = this.inputStream;
  1647. var origNumBindings = this._bindings.length;
  1648. var origRecordedFailures;
  1649. if (this.recordedFailures) {
  1650. origRecordedFailures = this.recordedFailures;
  1651. this.recordedFailures = Object.create(null);
  1652. }
  1653. var origPos = inputStream.pos;
  1654. var memoPos = this.maybeSkipSpacesBefore(expr);
  1655. var origTrace;
  1656. if (this.trace) {
  1657. origTrace = this.trace;
  1658. this.trace = [];
  1659. }
  1660. // Do the actual evaluation.
  1661. var ans = expr.eval(this);
  1662. if (this.trace) {
  1663. var bindings = this._bindings.slice(origNumBindings);
  1664. var traceEntry = this.getTraceEntry(memoPos, expr, ans, bindings);
  1665. traceEntry.isImplicitSpaces = expr === applySpaces;
  1666. traceEntry.isRootNode = expr === this.startExpr;
  1667. origTrace.push(traceEntry);
  1668. this.trace = origTrace;
  1669. }
  1670. if (ans) {
  1671. if (this.recordedFailures && inputStream.pos === this.positionToRecordFailures) {
  1672. var self = this;
  1673. Object.keys(this.recordedFailures).forEach(function(key) {
  1674. self.recordedFailures[key].makeFluffy();
  1675. });
  1676. }
  1677. } else {
  1678. // Reset the position and the bindings.
  1679. inputStream.pos = origPos;
  1680. this.truncateBindings(origNumBindings);
  1681. }
  1682. if (this.recordedFailures) {
  1683. this.recordFailures(origRecordedFailures, false);
  1684. }
  1685. return ans;
  1686. },
  1687. getMatchResult: function() {
  1688. this.eval(this.startExpr);
  1689. var rightmostFailures;
  1690. if (this.recordedFailures) {
  1691. var self = this;
  1692. rightmostFailures = Object.keys(this.recordedFailures).map(function(key) {
  1693. return self.recordedFailures[key];
  1694. });
  1695. }
  1696. return new MatchResult(
  1697. this.matcher,
  1698. this.input,
  1699. this.startExpr,
  1700. this._bindings[0],
  1701. this._bindingOffsets[0],
  1702. this.rightmostFailurePosition,
  1703. rightmostFailures);
  1704. },
  1705. getTrace: function() {
  1706. this.trace = [];
  1707. var matchResult = this.getMatchResult();
  1708. // The trace node for the start rule is always the last entry. If it is a syntactic rule,
  1709. // the first entry is for an application of 'spaces'.
  1710. // TODO(pdubroy): Clean this up by introducing a special `Match<startAppl>` rule, which will
  1711. // ensure that there is always a single root trace node.
  1712. var rootTrace = this.trace[this.trace.length - 1];
  1713. rootTrace.result = matchResult;
  1714. return rootTrace;
  1715. },
  1716. pushFailuresInfo: function() {
  1717. this._rightmostFailurePositionStack.push(this.rightmostFailurePosition);
  1718. this._recordedFailuresStack.push(this.recordedFailures);
  1719. },
  1720. popFailuresInfo: function() {
  1721. this.rightmostFailurePosition = this._rightmostFailurePositionStack.pop();
  1722. this.recordedFailures = this._recordedFailuresStack.pop();
  1723. }
  1724. };
  1725. // --------------------------------------------------------------------
  1726. // Exports
  1727. // --------------------------------------------------------------------
  1728. module.exports = MatchState;
  1729. },{"./InputStream":15,"./MatchResult":17,"./PosInfo":21,"./Trace":23,"./pexprs":44}],19:[function(require,module,exports){
  1730. 'use strict';
  1731. // --------------------------------------------------------------------
  1732. // Imports
  1733. // --------------------------------------------------------------------
  1734. var MatchState = require('./MatchState');
  1735. var pexprs = require('./pexprs');
  1736. // --------------------------------------------------------------------
  1737. // Private stuff
  1738. // --------------------------------------------------------------------
  1739. function Matcher(grammar) {
  1740. this.grammar = grammar;
  1741. this.memoTable = [];
  1742. this.input = '';
  1743. }
  1744. Matcher.prototype.getInput = function() {
  1745. return this.input;
  1746. };
  1747. Matcher.prototype.setInput = function(str) {
  1748. if (this.input !== str) {
  1749. this.replaceInputRange(0, this.input.length, str);
  1750. }
  1751. return this;
  1752. };
  1753. Matcher.prototype.replaceInputRange = function(startIdx, endIdx, str) {
  1754. var currentInput = this.input;
  1755. if (startIdx < 0 || startIdx > currentInput.length ||
  1756. endIdx < 0 || endIdx > currentInput.length ||
  1757. startIdx > endIdx) {
  1758. throw new Error('Invalid indices: ' + startIdx + ' and ' + endIdx);
  1759. }
  1760. // update input
  1761. this.input = currentInput.slice(0, startIdx) + str + currentInput.slice(endIdx);
  1762. // update memo table (similar to the above)
  1763. var restOfMemoTable = this.memoTable.slice(endIdx);
  1764. this.memoTable.length = startIdx;
  1765. for (var idx = 0; idx < str.length; idx++) {
  1766. this.memoTable.push(undefined);
  1767. }
  1768. restOfMemoTable.forEach(
  1769. function(posInfo) { this.memoTable.push(posInfo); },
  1770. this);
  1771. // Invalidate memoRecs
  1772. for (var pos = 0; pos < startIdx; pos++) {
  1773. var posInfo = this.memoTable[pos];
  1774. if (posInfo) {
  1775. posInfo.clearObsoleteEntries(pos, startIdx);
  1776. }
  1777. }
  1778. return this;
  1779. };
  1780. Matcher.prototype.match = function(optStartApplicationStr) {
  1781. return this._match(this._getStartExpr(optStartApplicationStr), false);
  1782. };
  1783. Matcher.prototype.trace = function(optStartApplicationStr) {
  1784. return this._match(this._getStartExpr(optStartApplicationStr), true);
  1785. };
  1786. Matcher.prototype._match = function(startExpr, tracing, optPositionToRecordFailures) {
  1787. var state = new MatchState(this, startExpr, optPositionToRecordFailures);
  1788. return tracing ? state.getTrace() : state.getMatchResult();
  1789. };
  1790. /*
  1791. Returns the starting expression for this Matcher's associated grammar. If `optStartApplicationStr`
  1792. is specified, it is a string expressing a rule application in the grammar. If not specified, the
  1793. grammar's default start rule will be used.
  1794. */
  1795. Matcher.prototype._getStartExpr = function(optStartApplicationStr) {
  1796. var applicationStr = optStartApplicationStr || this.grammar.defaultStartRule;
  1797. if (!applicationStr) {
  1798. throw new Error('Missing start rule argument -- the grammar has no default start rule.');
  1799. }
  1800. var startApp = this.grammar.parseApplication(applicationStr);
  1801. return new pexprs.Seq([startApp, pexprs.end]);
  1802. };
  1803. // --------------------------------------------------------------------
  1804. // Exports
  1805. // --------------------------------------------------------------------
  1806. module.exports = Matcher;
  1807. },{"./MatchState":18,"./pexprs":44}],20:[function(require,module,exports){
  1808. 'use strict';
  1809. // --------------------------------------------------------------------
  1810. // Imports
  1811. // --------------------------------------------------------------------
  1812. var extend = require('util-extend');
  1813. // --------------------------------------------------------------------
  1814. // Private stuff
  1815. // --------------------------------------------------------------------
  1816. function Namespace() {
  1817. }
  1818. Namespace.prototype = Object.create(null);
  1819. Namespace.asNamespace = function(objOrNamespace) {
  1820. if (objOrNamespace instanceof Namespace) {
  1821. return objOrNamespace;
  1822. }
  1823. return Namespace.createNamespace(objOrNamespace);
  1824. };
  1825. // Create a new namespace. If `optProps` is specified, all of its properties
  1826. // will be copied to the new namespace.
  1827. Namespace.createNamespace = function(optProps) {
  1828. return Namespace.extend(Namespace.prototype, optProps);
  1829. };
  1830. // Create a new namespace which extends another namespace. If `optProps` is
  1831. // specified, all of its properties will be copied to the new namespace.
  1832. Namespace.extend = function(namespace, optProps) {
  1833. if (namespace !== Namespace.prototype && !(namespace instanceof Namespace)) {
  1834. throw new TypeError('not a Namespace object: ' + namespace);
  1835. }
  1836. var ns = Object.create(namespace, {
  1837. constructor: {
  1838. value: Namespace,
  1839. enumerable: false,
  1840. writable: true,
  1841. configurable: true
  1842. }
  1843. });
  1844. return extend(ns, optProps);
  1845. };
  1846. // TODO: Should this be a regular method?
  1847. Namespace.toString = function(ns) {
  1848. return Object.prototype.toString.call(ns);
  1849. };
  1850. // --------------------------------------------------------------------
  1851. // Exports
  1852. // --------------------------------------------------------------------
  1853. module.exports = Namespace;
  1854. },{"util-extend":2}],21:[function(require,module,exports){
  1855. 'use strict';
  1856. // --------------------------------------------------------------------
  1857. // Private stuff
  1858. // --------------------------------------------------------------------
  1859. function PosInfo() {
  1860. this.applicationMemoKeyStack = []; // active applications at this position
  1861. this.memo = {};
  1862. this.maxExaminedLength = 0;
  1863. this.maxRightmostFailureOffset = -1;
  1864. this.currentLeftRecursion = undefined;
  1865. }
  1866. PosInfo.prototype = {
  1867. isActive: function(application) {
  1868. return this.applicationMemoKeyStack.indexOf(application.toMemoKey()) >= 0;
  1869. },
  1870. enter: function(application) {
  1871. this.applicationMemoKeyStack.push(application.toMemoKey());
  1872. },
  1873. exit: function() {
  1874. this.applicationMemoKeyStack.pop();
  1875. },
  1876. startLeftRecursion: function(headApplication, memoRec) {
  1877. memoRec.isLeftRecursion = true;
  1878. memoRec.headApplication = headApplication;
  1879. memoRec.nextLeftRecursion = this.currentLeftRecursion;
  1880. this.currentLeftRecursion = memoRec;
  1881. var applicationMemoKeyStack = this.applicationMemoKeyStack;
  1882. var indexOfFirstInvolvedRule = applicationMemoKeyStack.indexOf(headApplication.toMemoKey()) + 1;
  1883. var involvedApplicationMemoKeys = applicationMemoKeyStack.slice(indexOfFirstInvolvedRule);
  1884. memoRec.isInvolved = function(applicationMemoKey) {
  1885. return involvedApplicationMemoKeys.indexOf(applicationMemoKey) >= 0;
  1886. };
  1887. memoRec.updateInvolvedApplicationMemoKeys = function() {
  1888. for (var idx = indexOfFirstInvolvedRule; idx < applicationMemoKeyStack.length; idx++) {
  1889. var applicationMemoKey = applicationMemoKeyStack[idx];
  1890. if (!this.isInvolved(applicationMemoKey)) {
  1891. involvedApplicationMemoKeys.push(applicationMemoKey);
  1892. }
  1893. }
  1894. };
  1895. },
  1896. endLeftRecursion: function() {
  1897. this.currentLeftRecursion = this.currentLeftRecursion.nextLeftRecursion;
  1898. },
  1899. // Note: this method doesn't get called for the "head" of a left recursion -- for LR heads,
  1900. // the memoized result (which starts out being a failure) is always used.
  1901. shouldUseMemoizedResult: function(memoRec) {
  1902. if (!memoRec.isLeftRecursion) {
  1903. return true;
  1904. }
  1905. var applicationMemoKeyStack = this.applicationMemoKeyStack;
  1906. for (var idx = 0; idx < applicationMemoKeyStack.length; idx++) {
  1907. var applicationMemoKey = applicationMemoKeyStack[idx];
  1908. if (memoRec.isInvolved(applicationMemoKey)) {
  1909. return false;
  1910. }
  1911. }
  1912. return true;
  1913. },
  1914. memoize: function(memoKey, memoRec) {
  1915. this.memo[memoKey] = memoRec;
  1916. this.maxExaminedLength = Math.max(this.maxExaminedLength, memoRec.examinedLength);
  1917. this.maxRightmostFailureOffset =
  1918. Math.max(this.maxRightmostFailureOffset, memoRec.rightmostFailureOffset);
  1919. return memoRec;
  1920. },
  1921. clearObsoleteEntries: function(pos, invalidatedIdx) {
  1922. if (pos + this.maxExaminedLength <= invalidatedIdx) {
  1923. // Optimization: none of the rule applications that were memoized here examined the
  1924. // interval of the input that changed, so nothing has to be invalidated.
  1925. return;
  1926. }
  1927. var memo = this.memo;
  1928. this.maxExaminedLength = 0;
  1929. this.maxRightmostFailureOffset = -1;
  1930. var self = this;
  1931. Object.keys(memo).forEach(function(k) {
  1932. var memoRec = memo[k];
  1933. if (pos + memoRec.examinedLength > invalidatedIdx) {
  1934. delete memo[k];
  1935. } else {
  1936. self.maxExaminedLength = Math.max(self.maxExaminedLength, memoRec.examinedLength);
  1937. self.maxRightmostFailureOffset =
  1938. Math.max(self.maxRightmostFailureOffset, memoRec.rightmostFailureOffset);
  1939. }
  1940. });
  1941. }
  1942. };
  1943. // --------------------------------------------------------------------
  1944. // Exports
  1945. // --------------------------------------------------------------------
  1946. module.exports = PosInfo;
  1947. },{}],22:[function(require,module,exports){
  1948. 'use strict';
  1949. // --------------------------------------------------------------------
  1950. // Imports
  1951. // --------------------------------------------------------------------
  1952. var inherits = require('inherits');
  1953. var InputStream = require('./InputStream');
  1954. var IterationNode = require('./nodes').IterationNode;
  1955. var MatchResult = require('./MatchResult');
  1956. var common = require('./common');
  1957. var errors = require('./errors');
  1958. var util = require('./util');
  1959. // --------------------------------------------------------------------
  1960. // Private stuff
  1961. // --------------------------------------------------------------------
  1962. var globalActionStack = [];
  1963. var prototypeGrammar;
  1964. var prototypeGrammarSemantics;
  1965. // JSON is not a valid subset of JavaScript because there are two possible line terminators,
  1966. // U+2028 (line separator) and U+2029 (paragraph separator) that are allowed in JSON strings
  1967. // but not in JavaScript strings.
  1968. // jsonToJS() properly encodes those two characters in JSON so that it can seamlessly be
  1969. // inserted into JavaScript code (plus the encoded version is still valid JSON)
  1970. function jsonToJS(str) {
  1971. var output = str.replace(/[\u2028\u2029]/g, function(char, pos, str) {
  1972. var hex = char.codePointAt(0).toString(16);
  1973. return '\\u' + '0000'.slice(hex.length) + hex;
  1974. });
  1975. return output;
  1976. }
  1977. // ----------------- Wrappers -----------------
  1978. // Wrappers decorate CST nodes with all of the functionality (i.e., operations and attributes)
  1979. // provided by a Semantics (see below). `Wrapper` is the abstract superclass of all wrappers. A
  1980. // `Wrapper` must have `_node` and `_semantics` instance variables, which refer to the CST node and
  1981. // Semantics (resp.) for which it was created, and a `_childWrappers` instance variable which is
  1982. // used to cache the wrapper instances that are created for its child nodes. Setting these instance
  1983. // variables is the responsibility of the constructor of each Semantics-specific subclass of
  1984. // `Wrapper`.
  1985. function Wrapper() {}
  1986. Wrapper.prototype.toString = function() {
  1987. return '[semantics wrapper for ' + this._node.grammar.name + ']';
  1988. };
  1989. // This is used by ohm editor to display a node wrapper appropriately.
  1990. Wrapper.prototype.toJSON = function() {
  1991. return this.toString();
  1992. };
  1993. Wrapper.prototype._forgetMemoizedResultFor = function(attributeName) {
  1994. // Remove the memoized attribute from the cstNode and all its children.
  1995. delete this._node[this._semantics.attributeKeys[attributeName]];
  1996. this.children.forEach(function(child) {
  1997. child._forgetMemoizedResultFor(attributeName);
  1998. });
  1999. };
  2000. // Returns the wrapper of the specified child node. Child wrappers are created lazily and cached in
  2001. // the parent wrapper's `_childWrappers` instance variable.
  2002. Wrapper.prototype.child = function(idx) {
  2003. if (!(0 <= idx && idx < this._node.numChildren())) {
  2004. // TODO: Consider throwing an exception here.
  2005. return undefined;
  2006. }
  2007. var childWrapper = this._childWrappers[idx];
  2008. if (!childWrapper) {
  2009. var childNode = this._node.childAt(idx);
  2010. var offset = this._node.childOffsets[idx];
  2011. var source = this._baseInterval.subInterval(offset, childNode.matchLength);
  2012. var base = childNode.isNonterminal() ? source : this._baseInterval;
  2013. childWrapper = this._childWrappers[idx] = this._semantics.wrap(childNode, source, base);
  2014. }
  2015. return childWrapper;
  2016. };
  2017. // Returns an array containing the wrappers of all of the children of the node associated with this
  2018. // wrapper.
  2019. Wrapper.prototype._children = function() {
  2020. // Force the creation of all child wrappers
  2021. for (var idx = 0; idx < this._node.numChildren(); idx++) {
  2022. this.child(idx);
  2023. }
  2024. return this._childWrappers;
  2025. };
  2026. // Returns `true` if the CST node associated with this wrapper corresponds to an iteration
  2027. // expression, i.e., a Kleene-*, Kleene-+, or an optional. Returns `false` otherwise.
  2028. Wrapper.prototype.isIteration = function() {
  2029. return this._node.isIteration();
  2030. };
  2031. // Returns `true` if the CST node associated with this wrapper is a terminal node, `false`
  2032. // otherwise.
  2033. Wrapper.prototype.isTerminal = function() {
  2034. return this._node.isTerminal();
  2035. };
  2036. // Returns `true` if the CST node associated with this wrapper is a nonterminal node, `false`
  2037. // otherwise.
  2038. Wrapper.prototype.isNonterminal = function() {
  2039. return this._node.isNonterminal();
  2040. };
  2041. // Returns `true` if the CST node associated with this wrapper is a nonterminal node
  2042. // corresponding to a syntactic rule, `false` otherwise.
  2043. Wrapper.prototype.isSyntactic = function() {
  2044. return this.isNonterminal() && this._node.isSyntactic();
  2045. };
  2046. // Returns `true` if the CST node associated with this wrapper is a nonterminal node
  2047. // corresponding to a lexical rule, `false` otherwise.
  2048. Wrapper.prototype.isLexical = function() {
  2049. return this.isNonterminal() && this._node.isLexical();
  2050. };
  2051. // Returns `true` if the CST node associated with this wrapper is an iterator node
  2052. // having either one or no child (? operator), `false` otherwise.
  2053. // Otherwise, throws an exception.
  2054. Wrapper.prototype.isOptional = function() {
  2055. return this._node.isOptional();
  2056. };
  2057. // Create a new _iter wrapper in the same semantics as this wrapper.
  2058. Wrapper.prototype.iteration = function(optChildWrappers) {
  2059. var childWrappers = optChildWrappers || [];
  2060. var childNodes = childWrappers.map(function(c) { return c._node; });
  2061. var iter = new IterationNode(this._node.grammar, childNodes, [], -1, false);
  2062. var wrapper = this._semantics.wrap(iter, null, null);
  2063. wrapper._childWrappers = childWrappers;
  2064. return wrapper;
  2065. };
  2066. Object.defineProperties(Wrapper.prototype, {
  2067. // Returns an array containing the children of this CST node.
  2068. children: {get: function() { return this._children(); }},
  2069. // Returns the name of grammar rule that created this CST node.
  2070. ctorName: {get: function() { return this._node.ctorName; }},
  2071. // TODO: Remove this eventually (deprecated in v0.12).
  2072. interval: {get: function() {
  2073. throw new Error('The `interval` property is deprecated -- use `source` instead');
  2074. }},
  2075. // Returns the number of children of this CST node.
  2076. numChildren: {get: function() { return this._node.numChildren(); }},
  2077. // Returns the primitive value of this CST node, if it's a terminal node. Otherwise,
  2078. // throws an exception.
  2079. primitiveValue: {
  2080. get: function() {
  2081. if (this.isTerminal()) {
  2082. return this._node.primitiveValue;
  2083. }
  2084. throw new TypeError(
  2085. "tried to access the 'primitiveValue' attribute of a non-terminal CST node");
  2086. }
  2087. },
  2088. // Returns the contents of the input stream consumed by this CST node.
  2089. sourceString: {get: function() { return this.source.contents; }}
  2090. });
  2091. // ----------------- Semantics -----------------
  2092. // A Semantics is a container for a family of Operations and Attributes for a given grammar.
  2093. // Semantics enable modularity (different clients of a grammar can create their set of operations
  2094. // and attributes in isolation) and extensibility even when operations and attributes are mutually-
  2095. // recursive. This constructor should not be called directly except from
  2096. // `Semantics.createSemantics`. The normal ways to create a Semantics, given a grammar 'g', are
  2097. // `g.createSemantics()` and `g.extendSemantics(parentSemantics)`.
  2098. function Semantics(grammar, superSemantics) {
  2099. var self = this;
  2100. this.grammar = grammar;
  2101. this.checkedActionDicts = false;
  2102. // Constructor for wrapper instances, which are passed as the arguments to the semantic actions
  2103. // of an operation or attribute. Operations and attributes require double dispatch: the semantic
  2104. // action is chosen based on both the node's type and the semantics. Wrappers ensure that
  2105. // the `execute` method is called with the correct (most specific) semantics object as an
  2106. // argument.
  2107. this.Wrapper = function(node, sourceInterval, baseInterval) {
  2108. self.checkActionDictsIfHaventAlready();
  2109. this._semantics = self;
  2110. this._node = node;
  2111. this.source = sourceInterval;
  2112. // The interval that the childOffsets of `node` are relative to. It should be the source
  2113. // of the closest Nonterminal node.
  2114. this._baseInterval = baseInterval;
  2115. if (node.isNonterminal()) {
  2116. common.assert(sourceInterval === baseInterval);
  2117. }
  2118. this._childWrappers = [];
  2119. };
  2120. this.super = superSemantics;
  2121. if (superSemantics) {
  2122. if (!(grammar.equals(this.super.grammar) || grammar._inheritsFrom(this.super.grammar))) {
  2123. throw new Error(
  2124. "Cannot extend a semantics for grammar '" + this.super.grammar.name +
  2125. "' for use with grammar '" + grammar.name + "' (not a sub-grammar)");
  2126. }
  2127. inherits(this.Wrapper, this.super.Wrapper);
  2128. this.operations = Object.create(this.super.operations);
  2129. this.attributes = Object.create(this.super.attributes);
  2130. this.attributeKeys = Object.create(null);
  2131. // Assign unique symbols for each of the attributes inherited from the super-semantics so that
  2132. // they are memoized independently.
  2133. for (var attributeName in this.attributes) {
  2134. Object.defineProperty(this.attributeKeys, attributeName, {
  2135. value: util.uniqueId(attributeName)
  2136. });
  2137. }
  2138. } else {
  2139. inherits(this.Wrapper, Wrapper);
  2140. this.operations = Object.create(null);
  2141. this.attributes = Object.create(null);
  2142. this.attributeKeys = Object.create(null);
  2143. }
  2144. }
  2145. Semantics.prototype.toString = function() {
  2146. return '[semantics for ' + this.grammar.name + ']';
  2147. };
  2148. Semantics.prototype.checkActionDictsIfHaventAlready = function() {
  2149. if (!this.checkedActionDicts) {
  2150. this.checkActionDicts();
  2151. this.checkedActionDicts = true;
  2152. }
  2153. };
  2154. // Checks that the action dictionaries for all operations and attributes in this semantics,
  2155. // including the ones that were inherited from the super-semantics, agree with the grammar.
  2156. // Throws an exception if one or more of them doesn't.
  2157. Semantics.prototype.checkActionDicts = function() {
  2158. var name;
  2159. for (name in this.operations) {
  2160. this.operations[name].checkActionDict(this.grammar);
  2161. }
  2162. for (name in this.attributes) {
  2163. this.attributes[name].checkActionDict(this.grammar);
  2164. }
  2165. };
  2166. Semantics.prototype.toRecipe = function(semanticsOnly) {
  2167. function hasSuperSemantics(s) {
  2168. return s.super !== Semantics.BuiltInSemantics._getSemantics();
  2169. }
  2170. var str = '(function(g) {\n';
  2171. if (hasSuperSemantics(this)) {
  2172. str += ' var semantics = ' + this.super.toRecipe(true) + '(g';
  2173. var superSemanticsGrammar = this.super.grammar;
  2174. var relatedGrammar = this.grammar;
  2175. while (relatedGrammar !== superSemanticsGrammar) {
  2176. str += '.superGrammar';
  2177. relatedGrammar = relatedGrammar.superGrammar;
  2178. }
  2179. str += ');\n';
  2180. str += ' return g.extendSemantics(semantics)';
  2181. } else {
  2182. str += ' return g.createSemantics()';
  2183. }
  2184. ['Operation', 'Attribute'].forEach(function(type) {
  2185. var semanticOperations = this[type.toLowerCase() + 's'];
  2186. Object.keys(semanticOperations).forEach(function(name) {
  2187. var signature = name;
  2188. if (semanticOperations[name].formals.length > 0) {
  2189. signature += '(' + semanticOperations[name].formals.join(', ') + ')';
  2190. }
  2191. var method;
  2192. if (hasSuperSemantics(this) && this.super[type.toLowerCase() + 's'][name]) {
  2193. method = 'extend' + type;
  2194. } else {
  2195. method = 'add' + type;
  2196. }
  2197. str += '\n .' + method + '(' + JSON.stringify(signature) + ', {';
  2198. var actions = semanticOperations[name].actionDict;
  2199. var srcArray = [];
  2200. Object.keys(actions).forEach(function(actionName) {
  2201. if (semanticOperations[name].builtInDefault !== actions[actionName]) {
  2202. srcArray.push('\n ' + JSON.stringify(actionName) + ': ' +
  2203. actions[actionName].toString());
  2204. }
  2205. });
  2206. str += srcArray.join(',');
  2207. str += '\n })';
  2208. }, this);
  2209. }, this);
  2210. str += ';\n })';
  2211. if (!semanticsOnly) {
  2212. str =
  2213. '(function() {\n' +
  2214. ' var grammar = this.fromRecipe(' + jsonToJS(this.grammar.toRecipe()) + ');\n' +
  2215. ' var semantics = ' + str + '(grammar);\n' +
  2216. ' return semantics;\n' +
  2217. '});\n';
  2218. }
  2219. return str;
  2220. };
  2221. function parseSignature(signature, type) {
  2222. if (!prototypeGrammar) {
  2223. // The Operations and Attributes grammar won't be available while Ohm is loading,
  2224. // but we can get away the following simplification b/c none of the operations
  2225. // that are used while loading take arguments.
  2226. common.assert(signature.indexOf('(') === -1);
  2227. return {
  2228. name: signature,
  2229. formals: []
  2230. };
  2231. }
  2232. var r = prototypeGrammar.match(
  2233. signature,
  2234. type === 'operation' ? 'OperationSignature' : 'AttributeSignature');
  2235. if (r.failed()) {
  2236. throw new Error(r.message);
  2237. }
  2238. return prototypeGrammarSemantics(r).parse();
  2239. }
  2240. function newDefaultAction(type, name, doIt) {
  2241. return function(children) {
  2242. var self = this;
  2243. var thisThing = this._semantics.operations[name] || this._semantics.attributes[name];
  2244. var args = thisThing.formals.map(function(formal) {
  2245. return self.args[formal];
  2246. });
  2247. if (this.isIteration()) {
  2248. // This CST node corresponds to an iteration expression in the grammar (*, +, or ?). The
  2249. // default behavior is to map this operation or attribute over all of its child nodes.
  2250. return children.map(function(child) { return doIt.apply(child, args); });
  2251. }
  2252. // This CST node corresponds to a non-terminal in the grammar (e.g., AddExpr). The fact that
  2253. // we got here means that this action dictionary doesn't have an action for this particular
  2254. // non-terminal or a generic `_nonterminal` action.
  2255. if (children.length === 1) {
  2256. // As a convenience, if this node only has one child, we just return the result of
  2257. // applying this operation / attribute to the child node.
  2258. return doIt.apply(children[0], args);
  2259. } else {
  2260. // Otherwise, we throw an exception to let the programmer know that we don't know what
  2261. // to do with this node.
  2262. throw errors.missingSemanticAction(this.ctorName, name, type, globalActionStack);
  2263. }
  2264. };
  2265. }
  2266. Semantics.prototype.addOperationOrAttribute = function(type, signature, actionDict) {
  2267. var typePlural = type + 's';
  2268. var parsedNameAndFormalArgs = parseSignature(signature, type);
  2269. var name = parsedNameAndFormalArgs.name;
  2270. var formals = parsedNameAndFormalArgs.formals;
  2271. // TODO: check that there are no duplicate formal arguments
  2272. this.assertNewName(name, type);
  2273. // Create the action dictionary for this operation / attribute that contains a `_default` action
  2274. // which defines the default behavior of iteration, terminal, and non-terminal nodes...
  2275. var builtInDefault = newDefaultAction(type, name, doIt);
  2276. var realActionDict = {_default: builtInDefault};
  2277. // ... and add in the actions supplied by the programmer, which may override some or all of the
  2278. // default ones.
  2279. Object.keys(actionDict).forEach(function(name) {
  2280. realActionDict[name] = actionDict[name];
  2281. });
  2282. var entry = type === 'operation' ?
  2283. new Operation(name, formals, realActionDict, builtInDefault) :
  2284. new Attribute(name, realActionDict, builtInDefault);
  2285. // The following check is not strictly necessary (it will happen later anyway) but it's better to
  2286. // catch errors early.
  2287. entry.checkActionDict(this.grammar);
  2288. this[typePlural][name] = entry;
  2289. function doIt() {
  2290. // Dispatch to most specific version of this operation / attribute -- it may have been
  2291. // overridden by a sub-semantics.
  2292. var thisThing = this._semantics[typePlural][name];
  2293. // Check that the caller passed the correct number of arguments.
  2294. if (arguments.length !== thisThing.formals.length) {
  2295. throw new Error(
  2296. 'Invalid number of arguments passed to ' + name + ' ' + type + ' (expected ' +
  2297. thisThing.formals.length + ', got ' + arguments.length + ')');
  2298. }
  2299. // Create an "arguments object" from the arguments that were passed to this
  2300. // operation / attribute.
  2301. var args = Object.create(null);
  2302. for (var idx = 0; idx < arguments.length; idx++) {
  2303. var formal = thisThing.formals[idx];
  2304. args[formal] = arguments[idx];
  2305. }
  2306. var oldArgs = this.args;
  2307. this.args = args;
  2308. var ans = thisThing.execute(this._semantics, this);
  2309. this.args = oldArgs;
  2310. return ans;
  2311. }
  2312. if (type === 'operation') {
  2313. this.Wrapper.prototype[name] = doIt;
  2314. this.Wrapper.prototype[name].toString = function() {
  2315. return '[' + name + ' operation]';
  2316. };
  2317. } else {
  2318. Object.defineProperty(this.Wrapper.prototype, name, {
  2319. get: doIt,
  2320. configurable: true // So the property can be deleted.
  2321. });
  2322. Object.defineProperty(this.attributeKeys, name, {
  2323. value: util.uniqueId(name)
  2324. });
  2325. }
  2326. };
  2327. Semantics.prototype.extendOperationOrAttribute = function(type, name, actionDict) {
  2328. var typePlural = type + 's';
  2329. // Make sure that `name` really is just a name, i.e., that it doesn't also contain formals.
  2330. parseSignature(name, 'attribute');
  2331. if (!(this.super && name in this.super[typePlural])) {
  2332. throw new Error('Cannot extend ' + type + " '" + name +
  2333. "': did not inherit an " + type + ' with that name');
  2334. }
  2335. if (Object.prototype.hasOwnProperty.call(this[typePlural], name)) {
  2336. throw new Error('Cannot extend ' + type + " '" + name + "' again");
  2337. }
  2338. // Create a new operation / attribute whose actionDict delegates to the super operation /
  2339. // attribute's actionDict, and which has all the keys from `inheritedActionDict`.
  2340. var inheritedFormals = this[typePlural][name].formals;
  2341. var inheritedActionDict = this[typePlural][name].actionDict;
  2342. var newActionDict = Object.create(inheritedActionDict);
  2343. Object.keys(actionDict).forEach(function(name) {
  2344. newActionDict[name] = actionDict[name];
  2345. });
  2346. this[typePlural][name] = type === 'operation' ?
  2347. new Operation(name, inheritedFormals, newActionDict) :
  2348. new Attribute(name, newActionDict);
  2349. // The following check is not strictly necessary (it will happen later anyway) but it's better to
  2350. // catch errors early.
  2351. this[typePlural][name].checkActionDict(this.grammar);
  2352. };
  2353. Semantics.prototype.assertNewName = function(name, type) {
  2354. if (Wrapper.prototype.hasOwnProperty(name)) {
  2355. throw new Error(
  2356. 'Cannot add ' + type + " '" + name + "': that's a reserved name");
  2357. }
  2358. if (name in this.operations) {
  2359. throw new Error(
  2360. 'Cannot add ' + type + " '" + name + "': an operation with that name already exists");
  2361. }
  2362. if (name in this.attributes) {
  2363. throw new Error(
  2364. 'Cannot add ' + type + " '" + name + "': an attribute with that name already exists");
  2365. }
  2366. };
  2367. // Returns a wrapper for the given CST `node` in this semantics.
  2368. // If `node` is already a wrapper, returns `node` itself. // TODO: why is this needed?
  2369. Semantics.prototype.wrap = function(node, source, optBaseInterval) {
  2370. var baseInterval = optBaseInterval || source;
  2371. return node instanceof this.Wrapper ? node : new this.Wrapper(node, source, baseInterval);
  2372. };
  2373. // Creates a new Semantics instance for `grammar`, inheriting operations and attributes from
  2374. // `optSuperSemantics`, if it is specified. Returns a function that acts as a proxy for the new
  2375. // Semantics instance. When that function is invoked with a CST node as an argument, it returns
  2376. // a wrapper for that node which gives access to the operations and attributes provided by this
  2377. // semantics.
  2378. Semantics.createSemantics = function(grammar, optSuperSemantics) {
  2379. var s = new Semantics(
  2380. grammar,
  2381. optSuperSemantics !== undefined ?
  2382. optSuperSemantics :
  2383. Semantics.BuiltInSemantics._getSemantics());
  2384. // To enable clients to invoke a semantics like a function, return a function that acts as a proxy
  2385. // for `s`, which is the real `Semantics` instance.
  2386. var proxy = function ASemantics(matchResult) {
  2387. if (!(matchResult instanceof MatchResult)) {
  2388. throw new TypeError(
  2389. 'Semantics expected a MatchResult, but got ' + common.unexpectedObjToString(matchResult));
  2390. }
  2391. if (matchResult.failed()) {
  2392. throw new TypeError('cannot apply Semantics to ' + matchResult.toString());
  2393. }
  2394. var cst = matchResult._cst;
  2395. if (cst.grammar !== grammar) {
  2396. throw new Error(
  2397. "Cannot use a MatchResult from grammar '" + cst.grammar.name +
  2398. "' with a semantics for '" + grammar.name + "'");
  2399. }
  2400. var inputStream = new InputStream(matchResult.input);
  2401. return s.wrap(cst, inputStream.interval(matchResult._cstOffset, matchResult.input.length));
  2402. };
  2403. // Forward public methods from the proxy to the semantics instance.
  2404. proxy.addOperation = function(signature, actionDict) {
  2405. s.addOperationOrAttribute('operation', signature, actionDict);
  2406. return proxy;
  2407. };
  2408. proxy.extendOperation = function(name, actionDict) {
  2409. s.extendOperationOrAttribute('operation', name, actionDict);
  2410. return proxy;
  2411. };
  2412. proxy.addAttribute = function(name, actionDict) {
  2413. s.addOperationOrAttribute('attribute', name, actionDict);
  2414. return proxy;
  2415. };
  2416. proxy.extendAttribute = function(name, actionDict) {
  2417. s.extendOperationOrAttribute('attribute', name, actionDict);
  2418. return proxy;
  2419. };
  2420. proxy._getActionDict = function(operationOrAttributeName) {
  2421. var action = s.operations[operationOrAttributeName] || s.attributes[operationOrAttributeName];
  2422. if (!action) {
  2423. throw new Error('"' + operationOrAttributeName + '" is not a valid operation or attribute ' +
  2424. 'name in this semantics for "' + grammar.name + '"');
  2425. }
  2426. return action.actionDict;
  2427. };
  2428. proxy._remove = function(operationOrAttributeName) {
  2429. var semantic;
  2430. if (operationOrAttributeName in s.operations) {
  2431. semantic = s.operations[operationOrAttributeName];
  2432. delete s.operations[operationOrAttributeName];
  2433. } else if (operationOrAttributeName in s.attributes) {
  2434. semantic = s.attributes[operationOrAttributeName];
  2435. delete s.attributes[operationOrAttributeName];
  2436. }
  2437. delete s.Wrapper.prototype[operationOrAttributeName];
  2438. return semantic;
  2439. };
  2440. proxy.getOperationNames = function() {
  2441. return Object.keys(s.operations);
  2442. };
  2443. proxy.getAttributeNames = function() {
  2444. return Object.keys(s.attributes);
  2445. };
  2446. proxy.getGrammar = function() {
  2447. return s.grammar;
  2448. };
  2449. proxy.toRecipe = function(semanticsOnly) {
  2450. return s.toRecipe(semanticsOnly);
  2451. };
  2452. // Make the proxy's toString() work.
  2453. proxy.toString = s.toString.bind(s);
  2454. // Returns the semantics for the proxy.
  2455. proxy._getSemantics = function() {
  2456. return s;
  2457. };
  2458. return proxy;
  2459. };
  2460. // ----------------- Operation -----------------
  2461. // An Operation represents a function to be applied to a concrete syntax tree (CST) -- it's very
  2462. // similar to a Visitor (http://en.wikipedia.org/wiki/Visitor_pattern). An operation is executed by
  2463. // recursively walking the CST, and at each node, invoking the matching semantic action from
  2464. // `actionDict`. See `Operation.prototype.execute` for details of how a CST node's matching semantic
  2465. // action is found.
  2466. function Operation(name, formals, actionDict, builtInDefault) {
  2467. this.name = name;
  2468. this.formals = formals;
  2469. this.actionDict = actionDict;
  2470. this.builtInDefault = builtInDefault;
  2471. }
  2472. Operation.prototype.typeName = 'operation';
  2473. Operation.prototype.checkActionDict = function(grammar) {
  2474. grammar._checkTopDownActionDict(this.typeName, this.name, this.actionDict);
  2475. };
  2476. // Execute this operation on the CST node associated with `nodeWrapper` in the context of the given
  2477. // Semantics instance.
  2478. Operation.prototype.execute = function(semantics, nodeWrapper) {
  2479. try {
  2480. // Look for a semantic action whose name matches the node's constructor name, which is either
  2481. // the name of a rule in the grammar, or '_terminal' (for a terminal node), or '_iter' (for an
  2482. // iteration node). In the latter case, the action function receives a single argument, which
  2483. // is an array containing all of the children of the CST node.
  2484. var ctorName = nodeWrapper._node.ctorName;
  2485. var actionFn = this.actionDict[ctorName];
  2486. var ans;
  2487. if (actionFn) {
  2488. globalActionStack.push([this, ctorName]);
  2489. ans = this.doAction(semantics, nodeWrapper, actionFn, nodeWrapper.isIteration());
  2490. return ans;
  2491. }
  2492. // The action dictionary does not contain a semantic action for this specific type of node.
  2493. // If this is a nonterminal node and the programmer has provided a `_nonterminal` semantic
  2494. // action, we invoke it:
  2495. if (nodeWrapper.isNonterminal()) {
  2496. actionFn = this.actionDict._nonterminal;
  2497. if (actionFn) {
  2498. globalActionStack.push([this, '_nonterminal', ctorName]);
  2499. ans = this.doAction(semantics, nodeWrapper, actionFn, true);
  2500. return ans;
  2501. }
  2502. }
  2503. // Otherwise, we invoke the '_default' semantic action.
  2504. globalActionStack.push([this, 'default action', ctorName]);
  2505. ans = this.doAction(semantics, nodeWrapper, this.actionDict._default, true);
  2506. return ans;
  2507. } finally {
  2508. globalActionStack.pop();
  2509. }
  2510. };
  2511. // Invoke `actionFn` on the CST node that corresponds to `nodeWrapper`, in the context of
  2512. // `semantics`. If `optPassChildrenAsArray` is truthy, `actionFn` will be called with a single
  2513. // argument, which is an array of wrappers. Otherwise, the number of arguments to `actionFn` will
  2514. // be equal to the number of children in the CST node.
  2515. Operation.prototype.doAction = function(semantics, nodeWrapper, actionFn, optPassChildrenAsArray) {
  2516. return optPassChildrenAsArray ?
  2517. actionFn.call(nodeWrapper, nodeWrapper._children()) :
  2518. actionFn.apply(nodeWrapper, nodeWrapper._children());
  2519. };
  2520. // ----------------- Attribute -----------------
  2521. // Attributes are Operations whose results are memoized. This means that, for any given semantics,
  2522. // the semantic action for a CST node will be invoked no more than once.
  2523. function Attribute(name, actionDict, builtInDefault) {
  2524. this.name = name;
  2525. this.formals = [];
  2526. this.actionDict = actionDict;
  2527. this.builtInDefault = builtInDefault;
  2528. }
  2529. inherits(Attribute, Operation);
  2530. Attribute.prototype.typeName = 'attribute';
  2531. Attribute.prototype.execute = function(semantics, nodeWrapper) {
  2532. var node = nodeWrapper._node;
  2533. var key = semantics.attributeKeys[this.name];
  2534. if (!node.hasOwnProperty(key)) {
  2535. // The following is a super-send -- isn't JS beautiful? :/
  2536. node[key] = Operation.prototype.execute.call(this, semantics, nodeWrapper);
  2537. }
  2538. return node[key];
  2539. };
  2540. // ----------------- Deferred initialization -----------------
  2541. util.awaitBuiltInRules(function(builtInRules) {
  2542. var operationsAndAttributesGrammar = require('../dist/operations-and-attributes');
  2543. initBuiltInSemantics(builtInRules);
  2544. initPrototypeParser(operationsAndAttributesGrammar); // requires BuiltInSemantics
  2545. });
  2546. function initBuiltInSemantics(builtInRules) {
  2547. var actions = {
  2548. empty: function() {
  2549. return this.iteration();
  2550. },
  2551. nonEmpty: function(first, _, rest) {
  2552. return this.iteration([first].concat(rest.children));
  2553. }
  2554. };
  2555. Semantics.BuiltInSemantics = Semantics
  2556. .createSemantics(builtInRules, null)
  2557. .addOperation('asIteration', {
  2558. emptyListOf: actions.empty,
  2559. nonemptyListOf: actions.nonEmpty,
  2560. EmptyListOf: actions.empty,
  2561. NonemptyListOf: actions.nonEmpty
  2562. });
  2563. }
  2564. function initPrototypeParser(grammar) {
  2565. prototypeGrammarSemantics = grammar.createSemantics().addOperation('parse', {
  2566. AttributeSignature: function(name) {
  2567. return {
  2568. name: name.parse(),
  2569. formals: []
  2570. };
  2571. },
  2572. OperationSignature: function(name, optFormals) {
  2573. return {
  2574. name: name.parse(),
  2575. formals: optFormals.parse()[0] || []
  2576. };
  2577. },
  2578. Formals: function(oparen, fs, cparen) {
  2579. return fs.asIteration().parse();
  2580. },
  2581. name: function(first, rest) {
  2582. return this.sourceString;
  2583. }
  2584. });
  2585. prototypeGrammar = grammar;
  2586. };
  2587. // --------------------------------------------------------------------
  2588. // Exports
  2589. // --------------------------------------------------------------------
  2590. module.exports = Semantics;
  2591. },{"../dist/operations-and-attributes":5,"./InputStream":15,"./MatchResult":17,"./common":24,"./errors":25,"./nodes":27,"./util":45,"inherits":1}],23:[function(require,module,exports){
  2592. 'use strict';
  2593. // --------------------------------------------------------------------
  2594. // Imports
  2595. // --------------------------------------------------------------------
  2596. var Interval = require('./Interval');
  2597. var common = require('./common');
  2598. // --------------------------------------------------------------------
  2599. // Private stuff
  2600. // --------------------------------------------------------------------
  2601. // Unicode characters that are used in the `toString` output.
  2602. var BALLOT_X = '\u2717';
  2603. var CHECK_MARK = '\u2713';
  2604. var DOT_OPERATOR = '\u22C5';
  2605. var RIGHTWARDS_DOUBLE_ARROW = '\u21D2';
  2606. var SYMBOL_FOR_HORIZONTAL_TABULATION = '\u2409';
  2607. var SYMBOL_FOR_LINE_FEED = '\u240A';
  2608. var SYMBOL_FOR_CARRIAGE_RETURN = '\u240D';
  2609. var Flags = {
  2610. succeeded: 1 << 0,
  2611. isRootNode: 1 << 1,
  2612. isImplicitSpaces: 1 << 2,
  2613. isMemoized: 1 << 3,
  2614. isHeadOfLeftRecursion: 1 << 4,
  2615. terminatesLR: 1 << 5
  2616. };
  2617. function spaces(n) {
  2618. return common.repeat(' ', n).join('');
  2619. }
  2620. // Return a string representation of a portion of `input` at offset `pos`.
  2621. // The result will contain exactly `len` characters.
  2622. function getInputExcerpt(input, pos, len) {
  2623. var excerpt = asEscapedString(input.slice(pos, pos + len));
  2624. // Pad the output if necessary.
  2625. if (excerpt.length < len) {
  2626. return excerpt + common.repeat(' ', len - excerpt.length).join('');
  2627. }
  2628. return excerpt;
  2629. }
  2630. function asEscapedString(obj) {
  2631. if (typeof obj === 'string') {
  2632. // Replace non-printable characters with visible symbols.
  2633. return obj
  2634. .replace(/ /g, DOT_OPERATOR)
  2635. .replace(/\t/g, SYMBOL_FOR_HORIZONTAL_TABULATION)
  2636. .replace(/\n/g, SYMBOL_FOR_LINE_FEED)
  2637. .replace(/\r/g, SYMBOL_FOR_CARRIAGE_RETURN);
  2638. }
  2639. return String(obj);
  2640. }
  2641. // ----------------- Trace -----------------
  2642. function Trace(input, pos1, pos2, expr, succeeded, bindings, optChildren) {
  2643. this.input = input;
  2644. this.pos = this.pos1 = pos1;
  2645. this.pos2 = pos2;
  2646. this.source = new Interval(input, pos1, pos2);
  2647. this.expr = expr;
  2648. this.bindings = bindings;
  2649. this.children = optChildren || [];
  2650. this.terminatingLREntry = null;
  2651. this._flags = succeeded ? Flags.succeeded : 0;
  2652. }
  2653. // A value that can be returned from visitor functions to indicate that a
  2654. // node should not be recursed into.
  2655. Trace.prototype.SKIP = {};
  2656. Object.defineProperty(Trace.prototype, 'displayString', {
  2657. get: function() { return this.expr.toDisplayString(); }
  2658. });
  2659. // For convenience, create a getter and setter for the boolean flags in `Flags`.
  2660. Object.keys(Flags).forEach(function(name) {
  2661. var mask = Flags[name];
  2662. Object.defineProperty(Trace.prototype, name, {
  2663. get: function() {
  2664. return (this._flags & mask) !== 0;
  2665. },
  2666. set: function(val) {
  2667. if (val) {
  2668. this._flags |= mask;
  2669. } else {
  2670. this._flags &= ~mask;
  2671. }
  2672. }
  2673. });
  2674. });
  2675. Trace.prototype.clone = function() {
  2676. return this.cloneWithExpr(this.expr);
  2677. };
  2678. Trace.prototype.cloneWithExpr = function(expr) {
  2679. var ans = new Trace(
  2680. this.input, this.pos, this.pos2, expr, this.succeeded, this.bindings, this.children);
  2681. ans.isHeadOfLeftRecursion = this.isHeadOfLeftRecursion;
  2682. ans.isImplicitSpaces = this.isImplicitSpaces;
  2683. ans.isMemoized = this.isMemoized;
  2684. ans.isRootNode = this.isRootNode;
  2685. ans.terminatesLR = this.terminatesLR;
  2686. ans.terminatingLREntry = this.terminatingLREntry;
  2687. return ans;
  2688. };
  2689. // Record the trace information for the terminating condition of the LR loop.
  2690. Trace.prototype.recordLRTermination = function(ruleBodyTrace, value) {
  2691. this.terminatingLREntry =
  2692. new Trace(this.input, this.pos, this.pos2, this.expr, false, [value], [ruleBodyTrace]);
  2693. this.terminatingLREntry.terminatesLR = true;
  2694. };
  2695. // Recursively traverse this trace node and all its descendents, calling a visitor function
  2696. // for each node that is visited. If `vistorObjOrFn` is an object, then its 'enter' property
  2697. // is a function to call before visiting the children of a node, and its 'exit' property is
  2698. // a function to call afterwards. If `visitorObjOrFn` is a function, it represents the 'enter'
  2699. // function.
  2700. //
  2701. // The functions are called with three arguments: the Trace node, its parent Trace, and a number
  2702. // representing the depth of the node in the tree. (The root node has depth 0.) `optThisArg`, if
  2703. // specified, is the value to use for `this` when executing the visitor functions.
  2704. Trace.prototype.walk = function(visitorObjOrFn, optThisArg) {
  2705. var visitor = visitorObjOrFn;
  2706. if (typeof visitor === 'function') {
  2707. visitor = {enter: visitor};
  2708. }
  2709. function _walk(node, parent, depth) {
  2710. var recurse = true;
  2711. if (visitor.enter) {
  2712. if (visitor.enter.call(optThisArg, node, parent, depth) === Trace.prototype.SKIP) {
  2713. recurse = false;
  2714. }
  2715. }
  2716. if (recurse) {
  2717. node.children.forEach(function(child) {
  2718. _walk(child, node, depth + 1);
  2719. });
  2720. if (visitor.exit) {
  2721. visitor.exit.call(optThisArg, node, parent, depth);
  2722. }
  2723. }
  2724. }
  2725. if (this.isRootNode) {
  2726. // Don't visit the root node itself, only its children.
  2727. this.children.forEach(function(c) { _walk(c, null, 0); });
  2728. } else {
  2729. _walk(this, null, 0);
  2730. }
  2731. };
  2732. // Return a string representation of the trace.
  2733. // Sample:
  2734. // 12⋅+⋅2⋅*⋅3 ✓ exp ⇒ "12"
  2735. // 12⋅+⋅2⋅*⋅3 ✓ addExp (LR) ⇒ "12"
  2736. // 12⋅+⋅2⋅*⋅3 ✗ addExp_plus
  2737. Trace.prototype.toString = function() {
  2738. var sb = new common.StringBuffer();
  2739. this.walk(function(node, parent, depth) {
  2740. if (!node) {
  2741. return this.SKIP;
  2742. }
  2743. var ctorName = node.expr.constructor.name;
  2744. // Don't print anything for Alt nodes.
  2745. if (ctorName === 'Alt') {
  2746. return; // eslint-disable-line consistent-return
  2747. }
  2748. sb.append(getInputExcerpt(node.input, node.pos, 10) + spaces(depth * 2 + 1));
  2749. sb.append((node.succeeded ? CHECK_MARK : BALLOT_X) + ' ' + node.displayString);
  2750. if (node.isHeadOfLeftRecursion) {
  2751. sb.append(' (LR)');
  2752. }
  2753. if (node.succeeded) {
  2754. var contents = asEscapedString(node.source.contents);
  2755. sb.append(' ' + RIGHTWARDS_DOUBLE_ARROW + ' ');
  2756. sb.append(typeof contents === 'string' ? '"' + contents + '"' : contents);
  2757. }
  2758. sb.append('\n');
  2759. }.bind(this));
  2760. return sb.contents();
  2761. };
  2762. // --------------------------------------------------------------------
  2763. // Exports
  2764. // --------------------------------------------------------------------
  2765. module.exports = Trace;
  2766. },{"./Interval":16,"./common":24}],24:[function(require,module,exports){
  2767. 'use strict';
  2768. // --------------------------------------------------------------------
  2769. // Imports
  2770. // --------------------------------------------------------------------
  2771. var extend = require('util-extend');
  2772. // --------------------------------------------------------------------
  2773. // Private Stuff
  2774. // --------------------------------------------------------------------
  2775. // Helpers
  2776. var escapeStringFor = {};
  2777. for (var c = 0; c < 128; c++) {
  2778. escapeStringFor[c] = String.fromCharCode(c);
  2779. }
  2780. escapeStringFor["'".charCodeAt(0)] = "\\'";
  2781. escapeStringFor['"'.charCodeAt(0)] = '\\"';
  2782. escapeStringFor['\\'.charCodeAt(0)] = '\\\\';
  2783. escapeStringFor['\b'.charCodeAt(0)] = '\\b';
  2784. escapeStringFor['\f'.charCodeAt(0)] = '\\f';
  2785. escapeStringFor['\n'.charCodeAt(0)] = '\\n';
  2786. escapeStringFor['\r'.charCodeAt(0)] = '\\r';
  2787. escapeStringFor['\t'.charCodeAt(0)] = '\\t';
  2788. escapeStringFor['\u000b'.charCodeAt(0)] = '\\v';
  2789. // --------------------------------------------------------------------
  2790. // Exports
  2791. // --------------------------------------------------------------------
  2792. exports.abstract = function(optMethodName) {
  2793. var methodName = optMethodName || '';
  2794. return function() {
  2795. throw new Error(
  2796. 'this method ' + methodName + ' is abstract! ' +
  2797. '(it has no implementation in class ' + this.constructor.name + ')');
  2798. };
  2799. };
  2800. exports.assert = function(cond, message) {
  2801. if (!cond) {
  2802. throw new Error(message);
  2803. }
  2804. };
  2805. // Define a lazily-computed, non-enumerable property named `propName`
  2806. // on the object `obj`. `getterFn` will be called to compute the value the
  2807. // first time the property is accessed.
  2808. exports.defineLazyProperty = function(obj, propName, getterFn) {
  2809. var memo;
  2810. Object.defineProperty(obj, propName, {
  2811. get: function() {
  2812. if (!memo) {
  2813. memo = getterFn.call(this);
  2814. }
  2815. return memo;
  2816. }
  2817. });
  2818. };
  2819. exports.clone = function(obj) {
  2820. if (obj) {
  2821. return extend({}, obj);
  2822. }
  2823. return obj;
  2824. };
  2825. exports.extend = extend;
  2826. exports.repeatFn = function(fn, n) {
  2827. var arr = [];
  2828. while (n-- > 0) {
  2829. arr.push(fn());
  2830. }
  2831. return arr;
  2832. };
  2833. exports.repeatStr = function(str, n) {
  2834. return new Array(n + 1).join(str);
  2835. };
  2836. exports.repeat = function(x, n) {
  2837. return exports.repeatFn(function() { return x; }, n);
  2838. };
  2839. exports.getDuplicates = function(array) {
  2840. var duplicates = [];
  2841. for (var idx = 0; idx < array.length; idx++) {
  2842. var x = array[idx];
  2843. if (array.lastIndexOf(x) !== idx && duplicates.indexOf(x) < 0) {
  2844. duplicates.push(x);
  2845. }
  2846. }
  2847. return duplicates;
  2848. };
  2849. exports.copyWithoutDuplicates = function(array) {
  2850. var noDuplicates = [];
  2851. array.forEach(function(entry) {
  2852. if (noDuplicates.indexOf(entry) < 0) {
  2853. noDuplicates.push(entry);
  2854. }
  2855. });
  2856. return noDuplicates;
  2857. };
  2858. exports.isSyntactic = function(ruleName) {
  2859. var firstChar = ruleName[0];
  2860. return firstChar === firstChar.toUpperCase();
  2861. };
  2862. exports.isLexical = function(ruleName) {
  2863. return !exports.isSyntactic(ruleName);
  2864. };
  2865. exports.padLeft = function(str, len, optChar) {
  2866. var ch = optChar || ' ';
  2867. if (str.length < len) {
  2868. return exports.repeatStr(ch, len - str.length) + str;
  2869. }
  2870. return str;
  2871. };
  2872. // StringBuffer
  2873. exports.StringBuffer = function() {
  2874. this.strings = [];
  2875. };
  2876. exports.StringBuffer.prototype.append = function(str) {
  2877. this.strings.push(str);
  2878. };
  2879. exports.StringBuffer.prototype.contents = function() {
  2880. return this.strings.join('');
  2881. };
  2882. // Character escaping and unescaping
  2883. exports.escapeChar = function(c, optDelim) {
  2884. var charCode = c.charCodeAt(0);
  2885. if ((c === '"' || c === "'") && optDelim && c !== optDelim) {
  2886. return c;
  2887. } else if (charCode < 128) {
  2888. return escapeStringFor[charCode];
  2889. } else if (128 <= charCode && charCode < 256) {
  2890. return '\\x' + exports.padLeft(charCode.toString(16), 2, '0');
  2891. } else {
  2892. return '\\u' + exports.padLeft(charCode.toString(16), 4, '0');
  2893. }
  2894. };
  2895. exports.unescapeChar = function(s) {
  2896. if (s.charAt(0) === '\\') {
  2897. switch (s.charAt(1)) {
  2898. case 'b': return '\b';
  2899. case 'f': return '\f';
  2900. case 'n': return '\n';
  2901. case 'r': return '\r';
  2902. case 't': return '\t';
  2903. case 'v': return '\v';
  2904. case 'x': return String.fromCharCode(parseInt(s.substring(2, 4), 16));
  2905. case 'u': return String.fromCharCode(parseInt(s.substring(2, 6), 16));
  2906. default: return s.charAt(1);
  2907. }
  2908. } else {
  2909. return s;
  2910. }
  2911. };
  2912. // Helper for producing a description of an unknown object in a safe way.
  2913. // Especially useful for error messages where an unexpected type of object was encountered.
  2914. exports.unexpectedObjToString = function(obj) {
  2915. if (obj == null) {
  2916. return String(obj);
  2917. }
  2918. var baseToString = Object.prototype.toString.call(obj);
  2919. try {
  2920. var typeName;
  2921. if (obj.constructor && obj.constructor.name) {
  2922. typeName = obj.constructor.name;
  2923. } else if (baseToString.indexOf('[object ') === 0) {
  2924. typeName = baseToString.slice(8, -1); // Extract e.g. "Array" from "[object Array]".
  2925. } else {
  2926. typeName = typeof obj;
  2927. }
  2928. return typeName + ': ' + JSON.stringify(String(obj));
  2929. } catch (e) {
  2930. return baseToString;
  2931. }
  2932. };
  2933. },{"util-extend":2}],25:[function(require,module,exports){
  2934. 'use strict';
  2935. // --------------------------------------------------------------------
  2936. // Imports
  2937. // --------------------------------------------------------------------
  2938. var pexprs = require('./pexprs');
  2939. var Namespace = require('./Namespace');
  2940. // --------------------------------------------------------------------
  2941. // Private stuff
  2942. // --------------------------------------------------------------------
  2943. function createError(message, optInterval) {
  2944. var e;
  2945. if (optInterval) {
  2946. e = new Error(optInterval.getLineAndColumnMessage() + message);
  2947. e.shortMessage = message;
  2948. e.interval = optInterval;
  2949. } else {
  2950. e = new Error(message);
  2951. }
  2952. return e;
  2953. }
  2954. // ----------------- errors about intervals -----------------
  2955. function intervalSourcesDontMatch() {
  2956. return createError("Interval sources don't match");
  2957. }
  2958. // ----------------- errors about grammars -----------------
  2959. // Grammar syntax error
  2960. function grammarSyntaxError(matchFailure) {
  2961. var e = new Error();
  2962. Object.defineProperty(e, 'message', {
  2963. enumerable: true,
  2964. get: function() {
  2965. return matchFailure.message;
  2966. }
  2967. });
  2968. Object.defineProperty(e, 'shortMessage', {
  2969. enumerable: true,
  2970. get: function() {
  2971. return 'Expected ' + matchFailure.getExpectedText();
  2972. }
  2973. });
  2974. e.interval = matchFailure.getInterval();
  2975. return e;
  2976. }
  2977. // Undeclared grammar
  2978. function undeclaredGrammar(grammarName, namespace, interval) {
  2979. var message = namespace ?
  2980. 'Grammar ' + grammarName + ' is not declared in namespace ' + Namespace.toString(namespace) :
  2981. 'Undeclared grammar ' + grammarName;
  2982. return createError(message, interval);
  2983. }
  2984. // Duplicate grammar declaration
  2985. function duplicateGrammarDeclaration(grammar, namespace) {
  2986. return createError('Grammar ' + grammar.name + ' is already declared in this namespace');
  2987. }
  2988. // ----------------- rules -----------------
  2989. // Undeclared rule
  2990. function undeclaredRule(ruleName, grammarName, optInterval) {
  2991. return createError(
  2992. 'Rule ' + ruleName + ' is not declared in grammar ' + grammarName,
  2993. optInterval);
  2994. }
  2995. // Cannot override undeclared rule
  2996. function cannotOverrideUndeclaredRule(ruleName, grammarName, optSource) {
  2997. return createError(
  2998. 'Cannot override rule ' + ruleName + ' because it is not declared in ' + grammarName,
  2999. optSource);
  3000. }
  3001. // Cannot extend undeclared rule
  3002. function cannotExtendUndeclaredRule(ruleName, grammarName, optSource) {
  3003. return createError(
  3004. 'Cannot extend rule ' + ruleName + ' because it is not declared in ' + grammarName,
  3005. optSource);
  3006. }
  3007. // Duplicate rule declaration
  3008. function duplicateRuleDeclaration(ruleName, grammarName, declGrammarName, optSource) {
  3009. var message = "Duplicate declaration for rule '" + ruleName +
  3010. "' in grammar '" + grammarName + "'";
  3011. if (grammarName !== declGrammarName) {
  3012. message += " (originally declared in '" + declGrammarName + "')";
  3013. }
  3014. return createError(message, optSource);
  3015. }
  3016. // Wrong number of parameters
  3017. function wrongNumberOfParameters(ruleName, expected, actual, source) {
  3018. return createError(
  3019. 'Wrong number of parameters for rule ' + ruleName +
  3020. ' (expected ' + expected + ', got ' + actual + ')',
  3021. source);
  3022. }
  3023. // Wrong number of arguments
  3024. function wrongNumberOfArguments(ruleName, expected, actual, expr) {
  3025. return createError(
  3026. 'Wrong number of arguments for rule ' + ruleName +
  3027. ' (expected ' + expected + ', got ' + actual + ')',
  3028. expr.source);
  3029. }
  3030. // Duplicate parameter names
  3031. function duplicateParameterNames(ruleName, duplicates, source) {
  3032. return createError(
  3033. 'Duplicate parameter names in rule ' + ruleName + ': ' + duplicates.join(', '),
  3034. source);
  3035. }
  3036. // Invalid parameter expression
  3037. function invalidParameter(ruleName, expr) {
  3038. return createError(
  3039. 'Invalid parameter to rule ' + ruleName + ': ' + expr + ' has arity ' + expr.getArity() +
  3040. ', but parameter expressions must have arity 1',
  3041. expr.source);
  3042. }
  3043. // Application of syntactic rule from lexical rule
  3044. function applicationOfSyntacticRuleFromLexicalContext(ruleName, applyExpr) {
  3045. return createError(
  3046. 'Cannot apply syntactic rule ' + ruleName + ' from here (inside a lexical context)',
  3047. applyExpr.source);
  3048. }
  3049. // Incorrect argument type
  3050. function incorrectArgumentType(expectedType, expr) {
  3051. return createError('Incorrect argument type: expected ' + expectedType, expr.source);
  3052. }
  3053. // ----------------- Kleene operators -----------------
  3054. function kleeneExprHasNullableOperand(kleeneExpr, applicationStack) {
  3055. var actuals = applicationStack.length > 0 ?
  3056. applicationStack[applicationStack.length - 1].args :
  3057. [];
  3058. var expr = kleeneExpr.expr.substituteParams(actuals);
  3059. var message =
  3060. 'Nullable expression ' + expr + " is not allowed inside '" +
  3061. kleeneExpr.operator + "' (possible infinite loop)";
  3062. if (applicationStack.length > 0) {
  3063. var stackTrace = applicationStack
  3064. .map(function(app) { return new pexprs.Apply(app.ruleName, app.args); })
  3065. .join('\n');
  3066. message += '\nApplication stack (most recent application last):\n' + stackTrace;
  3067. }
  3068. return createError(message, kleeneExpr.expr.source);
  3069. }
  3070. // ----------------- arity -----------------
  3071. function inconsistentArity(ruleName, expected, actual, expr) {
  3072. return createError(
  3073. 'Rule ' + ruleName + ' involves an alternation which has inconsistent arity ' +
  3074. '(expected ' + expected + ', got ' + actual + ')',
  3075. expr.source);
  3076. }
  3077. // ----------------- properties -----------------
  3078. function duplicatePropertyNames(duplicates) {
  3079. return createError('Object pattern has duplicate property names: ' + duplicates.join(', '));
  3080. }
  3081. // ----------------- constructors -----------------
  3082. function invalidConstructorCall(grammar, ctorName, children) {
  3083. return createError(
  3084. 'Attempt to invoke constructor ' + ctorName + ' with invalid or unexpected arguments');
  3085. }
  3086. // ----------------- convenience -----------------
  3087. function multipleErrors(errors) {
  3088. var messages = errors.map(function(e) { return e.message; });
  3089. return createError(
  3090. ['Errors:'].concat(messages).join('\n- '),
  3091. errors[0].interval);
  3092. }
  3093. // ----------------- semantic -----------------
  3094. function missingSemanticAction(ctorName, name, type, stack) {
  3095. var stackTrace = stack.slice(0, -1).map(function(info) {
  3096. var ans = ' ' + info[0].name + ' > ' + info[1];
  3097. return info.length === 3
  3098. ? ans + " for '" + info[2] + "'"
  3099. : ans;
  3100. }).join('\n');
  3101. stackTrace += '\n ' + name + ' > ' + ctorName;
  3102. var where = type + " '" + name + "'";
  3103. var message = "Missing semantic action for '" + ctorName + "' in " + where + '\n' +
  3104. 'Action stack (most recent call last):\n' + stackTrace;
  3105. var e = createError(message);
  3106. e.name = 'missingSemanticAction';
  3107. return e;
  3108. }
  3109. // --------------------------------------------------------------------
  3110. // Exports
  3111. // --------------------------------------------------------------------
  3112. module.exports = {
  3113. applicationOfSyntacticRuleFromLexicalContext: applicationOfSyntacticRuleFromLexicalContext,
  3114. cannotExtendUndeclaredRule: cannotExtendUndeclaredRule,
  3115. cannotOverrideUndeclaredRule: cannotOverrideUndeclaredRule,
  3116. duplicateGrammarDeclaration: duplicateGrammarDeclaration,
  3117. duplicateParameterNames: duplicateParameterNames,
  3118. duplicatePropertyNames: duplicatePropertyNames,
  3119. duplicateRuleDeclaration: duplicateRuleDeclaration,
  3120. inconsistentArity: inconsistentArity,
  3121. incorrectArgumentType: incorrectArgumentType,
  3122. intervalSourcesDontMatch: intervalSourcesDontMatch,
  3123. invalidConstructorCall: invalidConstructorCall,
  3124. invalidParameter: invalidParameter,
  3125. grammarSyntaxError: grammarSyntaxError,
  3126. kleeneExprHasNullableOperand: kleeneExprHasNullableOperand,
  3127. missingSemanticAction: missingSemanticAction,
  3128. undeclaredGrammar: undeclaredGrammar,
  3129. undeclaredRule: undeclaredRule,
  3130. wrongNumberOfArguments: wrongNumberOfArguments,
  3131. wrongNumberOfParameters: wrongNumberOfParameters,
  3132. throwErrors: function(errors) {
  3133. if (errors.length === 1) {
  3134. throw errors[0];
  3135. }
  3136. if (errors.length > 1) {
  3137. throw multipleErrors(errors);
  3138. }
  3139. }
  3140. };
  3141. },{"./Namespace":20,"./pexprs":44}],26:[function(require,module,exports){
  3142. /* global document, XMLHttpRequest */
  3143. 'use strict';
  3144. // --------------------------------------------------------------------
  3145. // Imports
  3146. // --------------------------------------------------------------------
  3147. var Builder = require('./Builder');
  3148. var Grammar = require('./Grammar');
  3149. var Namespace = require('./Namespace');
  3150. var common = require('./common');
  3151. var errors = require('./errors');
  3152. var pexprs = require('./pexprs');
  3153. var util = require('./util');
  3154. var version = require('./version');
  3155. var isBuffer = require('is-buffer');
  3156. // --------------------------------------------------------------------
  3157. // Private stuff
  3158. // --------------------------------------------------------------------
  3159. // The metagrammar, i.e. the grammar for Ohm grammars. Initialized at the
  3160. // bottom of this file because loading the grammar requires Ohm itself.
  3161. var ohmGrammar;
  3162. // An object which makes it possible to stub out the document API for testing.
  3163. var documentInterface = {
  3164. querySelector: function(sel) { return document.querySelector(sel); },
  3165. querySelectorAll: function(sel) { return document.querySelectorAll(sel); }
  3166. };
  3167. // Check if `obj` is a DOM element.
  3168. function isElement(obj) {
  3169. return !!(obj && obj.nodeType === 1);
  3170. }
  3171. function isUndefined(obj) {
  3172. return obj === void 0; // eslint-disable-line no-void
  3173. }
  3174. var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
  3175. function isArrayLike(obj) {
  3176. if (obj == null) {
  3177. return false;
  3178. }
  3179. var length = obj.length;
  3180. return typeof length === 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;
  3181. }
  3182. // TODO: just use the jQuery thing
  3183. function load(url) {
  3184. var req = new XMLHttpRequest();
  3185. req.open('GET', url, false);
  3186. try {
  3187. req.send();
  3188. if (req.status === 0 || req.status === 200) {
  3189. return req.responseText;
  3190. }
  3191. } catch (e) {}
  3192. throw new Error('unable to load url ' + url);
  3193. }
  3194. // Returns a Grammar instance (i.e., an object with a `match` method) for
  3195. // `tree`, which is the concrete syntax tree of a user-written grammar.
  3196. // The grammar will be assigned into `namespace` under the name of the grammar
  3197. // as specified in the source.
  3198. function buildGrammar(match, namespace, optOhmGrammarForTesting) {
  3199. var builder = new Builder();
  3200. var decl;
  3201. var currentRuleName;
  3202. var currentRuleFormals;
  3203. var overriding = false;
  3204. var metaGrammar = optOhmGrammarForTesting || ohmGrammar;
  3205. // A visitor that produces a Grammar instance from the CST.
  3206. var helpers = metaGrammar.createSemantics().addOperation('visit', {
  3207. Grammar: function(n, s, open, rs, close) {
  3208. var grammarName = n.visit();
  3209. decl = builder.newGrammar(grammarName, namespace);
  3210. s.visit();
  3211. rs.visit();
  3212. var g = decl.build();
  3213. g.source = this.source.trimmed();
  3214. if (grammarName in namespace) {
  3215. throw errors.duplicateGrammarDeclaration(g, namespace);
  3216. }
  3217. namespace[grammarName] = g;
  3218. return g;
  3219. },
  3220. SuperGrammar: function(_, n) {
  3221. var superGrammarName = n.visit();
  3222. if (superGrammarName === 'null') {
  3223. decl.withSuperGrammar(null);
  3224. } else {
  3225. if (!namespace || !(superGrammarName in namespace)) {
  3226. throw errors.undeclaredGrammar(superGrammarName, namespace, n.source);
  3227. }
  3228. decl.withSuperGrammar(namespace[superGrammarName]);
  3229. }
  3230. },
  3231. Rule_define: function(n, fs, d, _, b) {
  3232. currentRuleName = n.visit();
  3233. currentRuleFormals = fs.visit()[0] || [];
  3234. // If there is no default start rule yet, set it now. This must be done before visiting
  3235. // the body, because it might contain an inline rule definition.
  3236. if (!decl.defaultStartRule && decl.ensureSuperGrammar() !== Grammar.ProtoBuiltInRules) {
  3237. decl.withDefaultStartRule(currentRuleName);
  3238. }
  3239. var body = b.visit();
  3240. var description = d.visit()[0];
  3241. var source = this.source.trimmed();
  3242. return decl.define(currentRuleName, currentRuleFormals, body, description, source);
  3243. },
  3244. Rule_override: function(n, fs, _, b) {
  3245. currentRuleName = n.visit();
  3246. currentRuleFormals = fs.visit()[0] || [];
  3247. overriding = true;
  3248. var body = b.visit();
  3249. var source = this.source.trimmed();
  3250. var ans = decl.override(currentRuleName, currentRuleFormals, body, null, source);
  3251. overriding = false;
  3252. return ans;
  3253. },
  3254. Rule_extend: function(n, fs, _, b) {
  3255. currentRuleName = n.visit();
  3256. currentRuleFormals = fs.visit()[0] || [];
  3257. var body = b.visit();
  3258. var source = this.source.trimmed();
  3259. var ans = decl.extend(currentRuleName, currentRuleFormals, body, null, source);
  3260. return ans;
  3261. },
  3262. RuleBody: function(_, terms) {
  3263. var args = terms.visit();
  3264. return builder.alt.apply(builder, args).withSource(this.source);
  3265. },
  3266. Formals: function(opointy, fs, cpointy) {
  3267. return fs.visit();
  3268. },
  3269. Params: function(opointy, ps, cpointy) {
  3270. return ps.visit();
  3271. },
  3272. Alt: function(seqs) {
  3273. var args = seqs.visit();
  3274. return builder.alt.apply(builder, args).withSource(this.source);
  3275. },
  3276. TopLevelTerm_inline: function(b, n) {
  3277. var inlineRuleName = currentRuleName + '_' + n.visit();
  3278. var body = b.visit();
  3279. var source = this.source.trimmed();
  3280. var isNewRuleDeclaration =
  3281. !(decl.superGrammar && decl.superGrammar.rules[inlineRuleName]);
  3282. if (overriding && !isNewRuleDeclaration) {
  3283. decl.override(inlineRuleName, currentRuleFormals, body, null, source);
  3284. } else {
  3285. decl.define(inlineRuleName, currentRuleFormals, body, null, source);
  3286. }
  3287. var params = currentRuleFormals.map(function(formal) { return builder.app(formal); });
  3288. return builder.app(inlineRuleName, params).withSource(body.source);
  3289. },
  3290. Seq: function(expr) {
  3291. return builder.seq.apply(builder, expr.visit()).withSource(this.source);
  3292. },
  3293. Iter_star: function(x, _) {
  3294. return builder.star(x.visit()).withSource(this.source);
  3295. },
  3296. Iter_plus: function(x, _) {
  3297. return builder.plus(x.visit()).withSource(this.source);
  3298. },
  3299. Iter_opt: function(x, _) {
  3300. return builder.opt(x.visit()).withSource(this.source);
  3301. },
  3302. Pred_not: function(_, x) {
  3303. return builder.not(x.visit()).withSource(this.source);
  3304. },
  3305. Pred_lookahead: function(_, x) {
  3306. return builder.lookahead(x.visit()).withSource(this.source);
  3307. },
  3308. Lex_lex: function(_, x) {
  3309. return builder.lex(x.visit()).withSource(this.source);
  3310. },
  3311. Base_application: function(rule, ps) {
  3312. return builder.app(rule.visit(), ps.visit()[0] || []).withSource(this.source);
  3313. },
  3314. Base_range: function(from, _, to) {
  3315. return builder.range(from.visit(), to.visit()).withSource(this.source);
  3316. },
  3317. Base_terminal: function(expr) {
  3318. return builder.terminal(expr.visit()).withSource(this.source);
  3319. },
  3320. Base_paren: function(open, x, close) {
  3321. return x.visit();
  3322. },
  3323. ruleDescr: function(open, t, close) {
  3324. return t.visit();
  3325. },
  3326. ruleDescrText: function(_) {
  3327. return this.sourceString.trim();
  3328. },
  3329. caseName: function(_, space1, n, space2, end) {
  3330. return n.visit();
  3331. },
  3332. name: function(first, rest) {
  3333. return this.sourceString;
  3334. },
  3335. nameFirst: function(expr) {},
  3336. nameRest: function(expr) {},
  3337. terminal: function(open, cs, close) {
  3338. return cs.visit().join('');
  3339. },
  3340. oneCharTerminal: function(open, c, close) {
  3341. return c.visit();
  3342. },
  3343. terminalChar: function(_) {
  3344. return common.unescapeChar(this.sourceString);
  3345. },
  3346. escapeChar: function(_) {
  3347. return this.sourceString;
  3348. },
  3349. NonemptyListOf: function(x, _, xs) {
  3350. return [x.visit()].concat(xs.visit());
  3351. },
  3352. EmptyListOf: function() {
  3353. return [];
  3354. },
  3355. _terminal: function() {
  3356. return this.primitiveValue;
  3357. }
  3358. });
  3359. return helpers(match).visit();
  3360. }
  3361. function compileAndLoad(source, namespace) {
  3362. var m = ohmGrammar.match(source, 'Grammars');
  3363. if (m.failed()) {
  3364. throw errors.grammarSyntaxError(m);
  3365. }
  3366. return buildGrammar(m, namespace);
  3367. }
  3368. // Return the contents of a script element, fetching it via XHR if necessary.
  3369. function getScriptElementContents(el) {
  3370. if (!isElement(el)) {
  3371. throw new TypeError('Expected a DOM Node, got ' + common.unexpectedObjToString(el));
  3372. }
  3373. if (el.type !== 'text/ohm-js') {
  3374. throw new Error('Expected a script tag with type="text/ohm-js", got ' + el);
  3375. }
  3376. return el.getAttribute('src') ? load(el.getAttribute('src')) : el.innerHTML;
  3377. }
  3378. function grammar(source, optNamespace) {
  3379. var ns = grammars(source, optNamespace);
  3380. // Ensure that the source contained no more than one grammar definition.
  3381. var grammarNames = Object.keys(ns);
  3382. if (grammarNames.length === 0) {
  3383. throw new Error('Missing grammar definition');
  3384. } else if (grammarNames.length > 1) {
  3385. var secondGrammar = ns[grammarNames[1]];
  3386. var interval = secondGrammar.source;
  3387. throw new Error(
  3388. util.getLineAndColumnMessage(interval.sourceString, interval.startIdx) +
  3389. 'Found more than one grammar definition -- use ohm.grammars() instead.');
  3390. }
  3391. return ns[grammarNames[0]]; // Return the one and only grammar.
  3392. }
  3393. function grammars(source, optNamespace) {
  3394. var ns = Namespace.extend(Namespace.asNamespace(optNamespace));
  3395. if (typeof source !== 'string') {
  3396. // For convenience, detect Node.js Buffer objects and automatically call toString().
  3397. if (isBuffer(source)) {
  3398. source = source.toString();
  3399. } else {
  3400. throw new TypeError(
  3401. 'Expected string as first argument, got ' + common.unexpectedObjToString(source));
  3402. }
  3403. }
  3404. compileAndLoad(source, ns);
  3405. return ns;
  3406. }
  3407. function grammarFromScriptElement(optNode) {
  3408. var node = optNode;
  3409. if (isUndefined(node)) {
  3410. var nodeList = documentInterface.querySelectorAll('script[type="text/ohm-js"]');
  3411. if (nodeList.length !== 1) {
  3412. throw new Error(
  3413. 'Expected exactly one script tag with type="text/ohm-js", found ' + nodeList.length);
  3414. }
  3415. node = nodeList[0];
  3416. }
  3417. return grammar(getScriptElementContents(node));
  3418. }
  3419. function grammarsFromScriptElements(optNodeOrNodeList) {
  3420. // Simple case: the argument is a DOM node.
  3421. if (isElement(optNodeOrNodeList)) {
  3422. return grammars(optNodeOrNodeList);
  3423. }
  3424. // Otherwise, it must be either undefined or a NodeList.
  3425. var nodeList = optNodeOrNodeList;
  3426. if (isUndefined(nodeList)) {
  3427. // Find all script elements with type="text/ohm-js".
  3428. nodeList = documentInterface.querySelectorAll('script[type="text/ohm-js"]');
  3429. } else if (typeof nodeList === 'string' || (!isElement(nodeList) && !isArrayLike(nodeList))) {
  3430. throw new TypeError('Expected a Node, NodeList, or Array, but got ' + nodeList);
  3431. }
  3432. var ns = Namespace.createNamespace();
  3433. for (var i = 0; i < nodeList.length; ++i) {
  3434. // Copy the new grammars into `ns` to keep the namespace flat.
  3435. common.extend(ns, grammars(getScriptElementContents(nodeList[i]), ns));
  3436. }
  3437. return ns;
  3438. }
  3439. function makeRecipe(recipe) {
  3440. if (typeof recipe === 'function') {
  3441. return recipe.call(new Builder());
  3442. } else {
  3443. if (typeof recipe === 'string') {
  3444. // stringified JSON recipe
  3445. recipe = JSON.parse(recipe);
  3446. }
  3447. return (new Builder()).fromRecipe(recipe);
  3448. }
  3449. }
  3450. // --------------------------------------------------------------------
  3451. // Exports
  3452. // --------------------------------------------------------------------
  3453. // Stuff that users should know about
  3454. module.exports = {
  3455. createNamespace: Namespace.createNamespace,
  3456. grammar: grammar,
  3457. grammars: grammars,
  3458. grammarFromScriptElement: grammarFromScriptElement,
  3459. grammarsFromScriptElements: grammarsFromScriptElements,
  3460. makeRecipe: makeRecipe,
  3461. ohmGrammar: null, // Initialized below, after Grammar.BuiltInRules.
  3462. pexprs: pexprs,
  3463. util: util,
  3464. extras: require('../extras'),
  3465. version: version
  3466. };
  3467. // Stuff for testing, etc.
  3468. module.exports._buildGrammar = buildGrammar;
  3469. module.exports._setDocumentInterfaceForTesting = function(doc) { documentInterface = doc; };
  3470. // Late initialization for stuff that is bootstrapped.
  3471. Grammar.BuiltInRules = require('../dist/built-in-rules');
  3472. util.announceBuiltInRules(Grammar.BuiltInRules);
  3473. module.exports.ohmGrammar = ohmGrammar = require('../dist/ohm-grammar');
  3474. Grammar.initApplicationParser(ohmGrammar, buildGrammar);
  3475. },{"../dist/built-in-rules":3,"../dist/ohm-grammar":4,"../extras":7,"./Builder":10,"./Grammar":13,"./Namespace":20,"./common":24,"./errors":25,"./pexprs":44,"./util":45,"./version":46,"is-buffer":9}],27:[function(require,module,exports){
  3476. 'use strict';
  3477. var inherits = require('inherits');
  3478. var common = require('./common');
  3479. // --------------------------------------------------------------------
  3480. // Private stuff
  3481. // --------------------------------------------------------------------
  3482. function Node(grammar, ctorName, matchLength) {
  3483. this.grammar = grammar;
  3484. this.ctorName = ctorName;
  3485. this.matchLength = matchLength;
  3486. }
  3487. Node.prototype.numChildren = function() {
  3488. return this.children ? this.children.length : 0;
  3489. };
  3490. Node.prototype.childAt = function(idx) {
  3491. if (this.children) {
  3492. return this.children[idx];
  3493. }
  3494. };
  3495. Node.prototype.indexOfChild = function(arg) {
  3496. return this.children.indexOf(arg);
  3497. };
  3498. Node.prototype.hasChildren = function() {
  3499. return this.numChildren() > 1;
  3500. };
  3501. Node.prototype.hasNoChildren = function() {
  3502. return !this.hasChildren();
  3503. };
  3504. Node.prototype.onlyChild = function() {
  3505. if (this.numChildren() !== 1) {
  3506. throw new Error(
  3507. 'cannot get only child of a node of type ' + this.ctorName +
  3508. ' (it has ' + this.numChildren() + ' children)');
  3509. } else {
  3510. return this.firstChild();
  3511. }
  3512. };
  3513. Node.prototype.firstChild = function() {
  3514. if (this.hasNoChildren()) {
  3515. throw new Error(
  3516. 'cannot get first child of a ' + this.ctorName + ' node, which has no children');
  3517. } else {
  3518. return this.childAt(0);
  3519. }
  3520. };
  3521. Node.prototype.lastChild = function() {
  3522. if (this.hasNoChildren()) {
  3523. throw new Error(
  3524. 'cannot get last child of a ' + this.ctorName + ' node, which has no children');
  3525. } else {
  3526. return this.childAt(this.numChildren() - 1);
  3527. }
  3528. };
  3529. Node.prototype.childBefore = function(child) {
  3530. var childIdx = this.indexOfChild(child);
  3531. if (childIdx < 0) {
  3532. throw new Error('Node.childBefore() called w/ an argument that is not a child');
  3533. } else if (childIdx === 0) {
  3534. throw new Error('cannot get child before first child');
  3535. } else {
  3536. return this.childAt(childIdx - 1);
  3537. }
  3538. };
  3539. Node.prototype.childAfter = function(child) {
  3540. var childIdx = this.indexOfChild(child);
  3541. if (childIdx < 0) {
  3542. throw new Error('Node.childAfter() called w/ an argument that is not a child');
  3543. } else if (childIdx === this.numChildren() - 1) {
  3544. throw new Error('cannot get child after last child');
  3545. } else {
  3546. return this.childAt(childIdx + 1);
  3547. }
  3548. };
  3549. Node.prototype.isTerminal = function() {
  3550. return false;
  3551. };
  3552. Node.prototype.isNonterminal = function() {
  3553. return false;
  3554. };
  3555. Node.prototype.isIteration = function() {
  3556. return false;
  3557. };
  3558. Node.prototype.isOptional = function() {
  3559. return false;
  3560. };
  3561. Node.prototype.toJSON = function() {
  3562. var r = {};
  3563. r[this.ctorName] = this.children;
  3564. return r;
  3565. };
  3566. // Terminals
  3567. function TerminalNode(grammar, value) {
  3568. var matchLength = value ? value.length : 0;
  3569. Node.call(this, grammar, '_terminal', matchLength);
  3570. this.primitiveValue = value;
  3571. }
  3572. inherits(TerminalNode, Node);
  3573. TerminalNode.prototype.isTerminal = function() {
  3574. return true;
  3575. };
  3576. TerminalNode.prototype.toJSON = function() {
  3577. var r = {};
  3578. r[this.ctorName] = this.primitiveValue;
  3579. return r;
  3580. };
  3581. // Nonterminals
  3582. function NonterminalNode(grammar, ruleName, children, childOffsets, matchLength) {
  3583. Node.call(this, grammar, ruleName, matchLength);
  3584. this.children = children;
  3585. this.childOffsets = childOffsets;
  3586. }
  3587. inherits(NonterminalNode, Node);
  3588. NonterminalNode.prototype.isNonterminal = function() {
  3589. return true;
  3590. };
  3591. NonterminalNode.prototype.isLexical = function() {
  3592. return common.isLexical(this.ctorName);
  3593. };
  3594. NonterminalNode.prototype.isSyntactic = function() {
  3595. return common.isSyntactic(this.ctorName);
  3596. };
  3597. // Iterations
  3598. function IterationNode(grammar, children, childOffsets, matchLength, isOptional) {
  3599. Node.call(this, grammar, '_iter', matchLength);
  3600. this.children = children;
  3601. this.childOffsets = childOffsets;
  3602. this.optional = isOptional;
  3603. }
  3604. inherits(IterationNode, Node);
  3605. IterationNode.prototype.isIteration = function() {
  3606. return true;
  3607. };
  3608. IterationNode.prototype.isOptional = function() {
  3609. return this.optional;
  3610. };
  3611. // --------------------------------------------------------------------
  3612. // Exports
  3613. // --------------------------------------------------------------------
  3614. module.exports = {
  3615. Node: Node,
  3616. TerminalNode: TerminalNode,
  3617. NonterminalNode: NonterminalNode,
  3618. IterationNode: IterationNode
  3619. };
  3620. },{"./common":24,"inherits":1}],28:[function(require,module,exports){
  3621. 'use strict';
  3622. // --------------------------------------------------------------------
  3623. // Imports
  3624. // --------------------------------------------------------------------
  3625. var common = require('./common');
  3626. var pexprs = require('./pexprs');
  3627. // --------------------------------------------------------------------
  3628. // Operations
  3629. // --------------------------------------------------------------------
  3630. /*
  3631. Return true if we should skip spaces preceding this expression in a syntactic context.
  3632. */
  3633. pexprs.PExpr.prototype.allowsSkippingPrecedingSpace = common.abstract(
  3634. 'allowsSkippingPrecedingSpace'
  3635. );
  3636. /*
  3637. Generally, these are all first-order expressions and (with the exception of Apply)
  3638. directly read from the input stream.
  3639. */
  3640. pexprs.any.allowsSkippingPrecedingSpace =
  3641. pexprs.end.allowsSkippingPrecedingSpace =
  3642. pexprs.Apply.prototype.allowsSkippingPrecedingSpace =
  3643. pexprs.Terminal.prototype.allowsSkippingPrecedingSpace =
  3644. pexprs.Range.prototype.allowsSkippingPrecedingSpace =
  3645. pexprs.UnicodeChar.prototype.allowsSkippingPrecedingSpace = function() {
  3646. return true;
  3647. };
  3648. /*
  3649. Higher-order expressions that don't directly consume input.
  3650. */
  3651. pexprs.Alt.prototype.allowsSkippingPrecedingSpace =
  3652. pexprs.Iter.prototype.allowsSkippingPrecedingSpace =
  3653. pexprs.Lex.prototype.allowsSkippingPrecedingSpace =
  3654. pexprs.Lookahead.prototype.allowsSkippingPrecedingSpace =
  3655. pexprs.Not.prototype.allowsSkippingPrecedingSpace =
  3656. pexprs.Param.prototype.allowsSkippingPrecedingSpace =
  3657. pexprs.Seq.prototype.allowsSkippingPrecedingSpace = function() {
  3658. return false;
  3659. };
  3660. },{"./common":24,"./pexprs":44}],29:[function(require,module,exports){
  3661. 'use strict';
  3662. // --------------------------------------------------------------------
  3663. // Imports
  3664. // --------------------------------------------------------------------
  3665. var common = require('./common');
  3666. var errors = require('./errors');
  3667. var pexprs = require('./pexprs');
  3668. var util = require('./util');
  3669. var BuiltInRules;
  3670. util.awaitBuiltInRules(function(g) { BuiltInRules = g; });
  3671. // --------------------------------------------------------------------
  3672. // Operations
  3673. // --------------------------------------------------------------------
  3674. var lexifyCount;
  3675. pexprs.PExpr.prototype.assertAllApplicationsAreValid = function(ruleName, grammar) {
  3676. lexifyCount = 0;
  3677. this._assertAllApplicationsAreValid(ruleName, grammar);
  3678. };
  3679. pexprs.PExpr.prototype._assertAllApplicationsAreValid = common.abstract(
  3680. '_assertAllApplicationsAreValid'
  3681. );
  3682. pexprs.any._assertAllApplicationsAreValid =
  3683. pexprs.end._assertAllApplicationsAreValid =
  3684. pexprs.Terminal.prototype._assertAllApplicationsAreValid =
  3685. pexprs.Range.prototype._assertAllApplicationsAreValid =
  3686. pexprs.Param.prototype._assertAllApplicationsAreValid =
  3687. pexprs.UnicodeChar.prototype._assertAllApplicationsAreValid = function(ruleName, grammar) {
  3688. // no-op
  3689. };
  3690. pexprs.Lex.prototype._assertAllApplicationsAreValid = function(ruleName, grammar) {
  3691. lexifyCount++;
  3692. this.expr._assertAllApplicationsAreValid(ruleName, grammar);
  3693. lexifyCount--;
  3694. };
  3695. pexprs.Alt.prototype._assertAllApplicationsAreValid = function(ruleName, grammar) {
  3696. for (var idx = 0; idx < this.terms.length; idx++) {
  3697. this.terms[idx]._assertAllApplicationsAreValid(ruleName, grammar);
  3698. }
  3699. };
  3700. pexprs.Seq.prototype._assertAllApplicationsAreValid = function(ruleName, grammar) {
  3701. for (var idx = 0; idx < this.factors.length; idx++) {
  3702. this.factors[idx]._assertAllApplicationsAreValid(ruleName, grammar);
  3703. }
  3704. };
  3705. pexprs.Iter.prototype._assertAllApplicationsAreValid =
  3706. pexprs.Not.prototype._assertAllApplicationsAreValid =
  3707. pexprs.Lookahead.prototype._assertAllApplicationsAreValid = function(ruleName, grammar) {
  3708. this.expr._assertAllApplicationsAreValid(ruleName, grammar);
  3709. };
  3710. pexprs.Apply.prototype._assertAllApplicationsAreValid = function(ruleName, grammar) {
  3711. var ruleInfo = grammar.rules[this.ruleName];
  3712. // Make sure that the rule exists...
  3713. if (!ruleInfo) {
  3714. throw errors.undeclaredRule(this.ruleName, grammar.name, this.source);
  3715. }
  3716. // ...and that this application is allowed
  3717. if (common.isSyntactic(this.ruleName) && (!common.isSyntactic(ruleName) || lexifyCount > 0)) {
  3718. throw errors.applicationOfSyntacticRuleFromLexicalContext(this.ruleName, this);
  3719. }
  3720. // ...and that this application has the correct number of arguments
  3721. var actual = this.args.length;
  3722. var expected = ruleInfo.formals.length;
  3723. if (actual !== expected) {
  3724. throw errors.wrongNumberOfArguments(this.ruleName, expected, actual, this.source);
  3725. }
  3726. // ...and that all of the argument expressions only have valid applications and have arity 1.
  3727. var self = this;
  3728. this.args.forEach(function(arg) {
  3729. arg._assertAllApplicationsAreValid(ruleName, grammar);
  3730. if (arg.getArity() !== 1) {
  3731. throw errors.invalidParameter(self.ruleName, arg);
  3732. }
  3733. });
  3734. // Extra checks for "special" applications
  3735. // If it's an application of 'caseInsensitive', ensure that the argument is a Terminal.
  3736. if (BuiltInRules && ruleInfo === BuiltInRules.rules.caseInsensitive) {
  3737. if (!(this.args[0] instanceof pexprs.Terminal)) {
  3738. throw errors.incorrectArgumentType('a Terminal (e.g. \"abc\")', this.args[0]);
  3739. }
  3740. }
  3741. };
  3742. },{"./common":24,"./errors":25,"./pexprs":44,"./util":45}],30:[function(require,module,exports){
  3743. 'use strict';
  3744. // --------------------------------------------------------------------
  3745. // Imports
  3746. // --------------------------------------------------------------------
  3747. var common = require('./common');
  3748. var errors = require('./errors');
  3749. var pexprs = require('./pexprs');
  3750. // --------------------------------------------------------------------
  3751. // Operations
  3752. // --------------------------------------------------------------------
  3753. pexprs.PExpr.prototype.assertChoicesHaveUniformArity = common.abstract(
  3754. 'assertChoicesHaveUniformArity'
  3755. );
  3756. pexprs.any.assertChoicesHaveUniformArity =
  3757. pexprs.end.assertChoicesHaveUniformArity =
  3758. pexprs.Terminal.prototype.assertChoicesHaveUniformArity =
  3759. pexprs.Range.prototype.assertChoicesHaveUniformArity =
  3760. pexprs.Param.prototype.assertChoicesHaveUniformArity =
  3761. pexprs.Lex.prototype.assertChoicesHaveUniformArity =
  3762. pexprs.UnicodeChar.prototype.assertChoicesHaveUniformArity = function(ruleName) {
  3763. // no-op
  3764. };
  3765. pexprs.Alt.prototype.assertChoicesHaveUniformArity = function(ruleName) {
  3766. if (this.terms.length === 0) {
  3767. return;
  3768. }
  3769. var arity = this.terms[0].getArity();
  3770. for (var idx = 0; idx < this.terms.length; idx++) {
  3771. var term = this.terms[idx];
  3772. term.assertChoicesHaveUniformArity();
  3773. var otherArity = term.getArity();
  3774. if (arity !== otherArity) {
  3775. throw errors.inconsistentArity(ruleName, arity, otherArity, term);
  3776. }
  3777. }
  3778. };
  3779. pexprs.Extend.prototype.assertChoicesHaveUniformArity = function(ruleName) {
  3780. // Extend is a special case of Alt that's guaranteed to have exactly two
  3781. // cases: [extensions, origBody].
  3782. var actualArity = this.terms[0].getArity();
  3783. var expectedArity = this.terms[1].getArity();
  3784. if (actualArity !== expectedArity) {
  3785. throw errors.inconsistentArity(ruleName, expectedArity, actualArity, this.terms[0]);
  3786. }
  3787. };
  3788. pexprs.Seq.prototype.assertChoicesHaveUniformArity = function(ruleName) {
  3789. for (var idx = 0; idx < this.factors.length; idx++) {
  3790. this.factors[idx].assertChoicesHaveUniformArity(ruleName);
  3791. }
  3792. };
  3793. pexprs.Iter.prototype.assertChoicesHaveUniformArity = function(ruleName) {
  3794. this.expr.assertChoicesHaveUniformArity(ruleName);
  3795. };
  3796. pexprs.Not.prototype.assertChoicesHaveUniformArity = function(ruleName) {
  3797. // no-op (not required b/c the nested expr doesn't show up in the CST)
  3798. };
  3799. pexprs.Lookahead.prototype.assertChoicesHaveUniformArity = function(ruleName) {
  3800. this.expr.assertChoicesHaveUniformArity(ruleName);
  3801. };
  3802. pexprs.Apply.prototype.assertChoicesHaveUniformArity = function(ruleName) {
  3803. // The arities of the parameter expressions is required to be 1 by
  3804. // `assertAllApplicationsAreValid()`.
  3805. };
  3806. },{"./common":24,"./errors":25,"./pexprs":44}],31:[function(require,module,exports){
  3807. 'use strict';
  3808. // --------------------------------------------------------------------
  3809. // Imports
  3810. // --------------------------------------------------------------------
  3811. var common = require('./common');
  3812. var errors = require('./errors');
  3813. var pexprs = require('./pexprs');
  3814. // --------------------------------------------------------------------
  3815. // Operations
  3816. // --------------------------------------------------------------------
  3817. pexprs.PExpr.prototype.assertIteratedExprsAreNotNullable = common.abstract(
  3818. 'assertIteratedExprsAreNotNullable'
  3819. );
  3820. pexprs.any.assertIteratedExprsAreNotNullable =
  3821. pexprs.end.assertIteratedExprsAreNotNullable =
  3822. pexprs.Terminal.prototype.assertIteratedExprsAreNotNullable =
  3823. pexprs.Range.prototype.assertIteratedExprsAreNotNullable =
  3824. pexprs.Param.prototype.assertIteratedExprsAreNotNullable =
  3825. pexprs.UnicodeChar.prototype.assertIteratedExprsAreNotNullable = function(grammar) {
  3826. // no-op
  3827. };
  3828. pexprs.Alt.prototype.assertIteratedExprsAreNotNullable = function(grammar) {
  3829. for (var idx = 0; idx < this.terms.length; idx++) {
  3830. this.terms[idx].assertIteratedExprsAreNotNullable(grammar);
  3831. }
  3832. };
  3833. pexprs.Seq.prototype.assertIteratedExprsAreNotNullable = function(grammar) {
  3834. for (var idx = 0; idx < this.factors.length; idx++) {
  3835. this.factors[idx].assertIteratedExprsAreNotNullable(grammar);
  3836. }
  3837. };
  3838. pexprs.Iter.prototype.assertIteratedExprsAreNotNullable = function(grammar) {
  3839. // Note: this is the implementation of this method for `Star` and `Plus` expressions.
  3840. // It is overridden for `Opt` below.
  3841. this.expr.assertIteratedExprsAreNotNullable(grammar);
  3842. if (this.expr.isNullable(grammar)) {
  3843. throw errors.kleeneExprHasNullableOperand(this, []);
  3844. }
  3845. };
  3846. pexprs.Opt.prototype.assertIteratedExprsAreNotNullable =
  3847. pexprs.Not.prototype.assertIteratedExprsAreNotNullable =
  3848. pexprs.Lookahead.prototype.assertIteratedExprsAreNotNullable =
  3849. pexprs.Lex.prototype.assertIteratedExprsAreNotNullable = function(grammar) {
  3850. this.expr.assertIteratedExprsAreNotNullable(grammar);
  3851. };
  3852. pexprs.Apply.prototype.assertIteratedExprsAreNotNullable = function(grammar) {
  3853. this.args.forEach(function(arg) {
  3854. arg.assertIteratedExprsAreNotNullable(grammar);
  3855. });
  3856. };
  3857. },{"./common":24,"./errors":25,"./pexprs":44}],32:[function(require,module,exports){
  3858. 'use strict';
  3859. // --------------------------------------------------------------------
  3860. // Imports
  3861. // --------------------------------------------------------------------
  3862. var common = require('./common');
  3863. var nodes = require('./nodes');
  3864. var pexprs = require('./pexprs');
  3865. // --------------------------------------------------------------------
  3866. // Operations
  3867. // --------------------------------------------------------------------
  3868. pexprs.PExpr.prototype.check = common.abstract('check');
  3869. pexprs.any.check = function(grammar, vals) {
  3870. return vals.length >= 1;
  3871. };
  3872. pexprs.end.check = function(grammar, vals) {
  3873. return vals[0] instanceof nodes.Node &&
  3874. vals[0].isTerminal() &&
  3875. vals[0].primitiveValue === undefined;
  3876. };
  3877. pexprs.Terminal.prototype.check = function(grammar, vals) {
  3878. return vals[0] instanceof nodes.Node &&
  3879. vals[0].isTerminal() &&
  3880. vals[0].primitiveValue === this.obj;
  3881. };
  3882. pexprs.Range.prototype.check = function(grammar, vals) {
  3883. return vals[0] instanceof nodes.Node &&
  3884. vals[0].isTerminal() &&
  3885. typeof vals[0].primitiveValue === typeof this.from;
  3886. };
  3887. pexprs.Param.prototype.check = function(grammar, vals) {
  3888. return vals.length >= 1;
  3889. };
  3890. pexprs.Alt.prototype.check = function(grammar, vals) {
  3891. for (var i = 0; i < this.terms.length; i++) {
  3892. var term = this.terms[i];
  3893. if (term.check(grammar, vals)) {
  3894. return true;
  3895. }
  3896. }
  3897. return false;
  3898. };
  3899. pexprs.Seq.prototype.check = function(grammar, vals) {
  3900. var pos = 0;
  3901. for (var i = 0; i < this.factors.length; i++) {
  3902. var factor = this.factors[i];
  3903. if (factor.check(grammar, vals.slice(pos))) {
  3904. pos += factor.getArity();
  3905. } else {
  3906. return false;
  3907. }
  3908. }
  3909. return true;
  3910. };
  3911. pexprs.Iter.prototype.check = function(grammar, vals) {
  3912. var arity = this.getArity();
  3913. var columns = vals.slice(0, arity);
  3914. if (columns.length !== arity) {
  3915. return false;
  3916. }
  3917. var rowCount = columns[0].length;
  3918. var i;
  3919. for (i = 1; i < arity; i++) {
  3920. if (columns[i].length !== rowCount) {
  3921. return false;
  3922. }
  3923. }
  3924. for (i = 0; i < rowCount; i++) {
  3925. var row = [];
  3926. for (var j = 0; j < arity; j++) {
  3927. row.push(columns[j][i]);
  3928. }
  3929. if (!this.expr.check(grammar, row)) {
  3930. return false;
  3931. }
  3932. }
  3933. return true;
  3934. };
  3935. pexprs.Not.prototype.check = function(grammar, vals) {
  3936. return true;
  3937. };
  3938. pexprs.Lookahead.prototype.check =
  3939. pexprs.Lex.prototype.check = function(grammar, vals) {
  3940. return this.expr.check(grammar, vals);
  3941. };
  3942. pexprs.Apply.prototype.check = function(grammar, vals) {
  3943. if (!(vals[0] instanceof nodes.Node &&
  3944. vals[0].grammar === grammar &&
  3945. vals[0].ctorName === this.ruleName)) {
  3946. return false;
  3947. }
  3948. // TODO: think about *not* doing the following checks, i.e., trusting that the rule
  3949. // was correctly constructed.
  3950. var ruleNode = vals[0];
  3951. var body = grammar.rules[this.ruleName].body;
  3952. return body.check(grammar, ruleNode.children) && ruleNode.numChildren() === body.getArity();
  3953. };
  3954. pexprs.UnicodeChar.prototype.check = function(grammar, vals) {
  3955. return vals[0] instanceof nodes.Node &&
  3956. vals[0].isTerminal() &&
  3957. typeof vals[0].primitiveValue === 'string';
  3958. };
  3959. },{"./common":24,"./nodes":27,"./pexprs":44}],33:[function(require,module,exports){
  3960. 'use strict';
  3961. // --------------------------------------------------------------------
  3962. // Imports
  3963. // --------------------------------------------------------------------
  3964. var Trace = require('./Trace');
  3965. var common = require('./common');
  3966. var errors = require('./errors');
  3967. var nodes = require('./nodes');
  3968. var pexprs = require('./pexprs');
  3969. var TerminalNode = nodes.TerminalNode;
  3970. var NonterminalNode = nodes.NonterminalNode;
  3971. var IterationNode = nodes.IterationNode;
  3972. // --------------------------------------------------------------------
  3973. // Operations
  3974. // --------------------------------------------------------------------
  3975. /*
  3976. Evaluate the expression and return `true` if it succeeds, `false` otherwise. This method should
  3977. only be called directly by `State.prototype.eval(expr)`, which also updates the data structures
  3978. that are used for tracing. (Making those updates in a method of `State` enables the trace-specific
  3979. data structures to be "secrets" of that class, which is good for modularity.)
  3980. The contract of this method is as follows:
  3981. * When the return value is `true`,
  3982. - the state object will have `expr.getArity()` more bindings than it did before the call.
  3983. * When the return value is `false`,
  3984. - the state object may have more bindings than it did before the call, and
  3985. - its input stream's position may be anywhere.
  3986. Note that `State.prototype.eval(expr)`, unlike this method, guarantees that neither the state
  3987. object's bindings nor its input stream's position will change if the expression fails to match.
  3988. */
  3989. pexprs.PExpr.prototype.eval = common.abstract('eval'); // function(state) { ... }
  3990. pexprs.any.eval = function(state) {
  3991. var inputStream = state.inputStream;
  3992. var origPos = inputStream.pos;
  3993. var ch = inputStream.next();
  3994. if (ch) {
  3995. state.pushBinding(new TerminalNode(state.grammar, ch), origPos);
  3996. return true;
  3997. } else {
  3998. state.processFailure(origPos, this);
  3999. return false;
  4000. }
  4001. };
  4002. pexprs.end.eval = function(state) {
  4003. var inputStream = state.inputStream;
  4004. var origPos = inputStream.pos;
  4005. if (inputStream.atEnd()) {
  4006. state.pushBinding(new TerminalNode(state.grammar, undefined), origPos);
  4007. return true;
  4008. } else {
  4009. state.processFailure(origPos, this);
  4010. return false;
  4011. }
  4012. };
  4013. pexprs.Terminal.prototype.eval = function(state) {
  4014. var inputStream = state.inputStream;
  4015. var origPos = inputStream.pos;
  4016. if (!inputStream.matchString(this.obj)) {
  4017. state.processFailure(origPos, this);
  4018. return false;
  4019. } else {
  4020. state.pushBinding(new TerminalNode(state.grammar, this.obj), origPos);
  4021. return true;
  4022. }
  4023. };
  4024. pexprs.Range.prototype.eval = function(state) {
  4025. var inputStream = state.inputStream;
  4026. var origPos = inputStream.pos;
  4027. var ch = inputStream.next();
  4028. if (ch && this.from <= ch && ch <= this.to) {
  4029. state.pushBinding(new TerminalNode(state.grammar, ch), origPos);
  4030. return true;
  4031. } else {
  4032. state.processFailure(origPos, this);
  4033. return false;
  4034. }
  4035. };
  4036. pexprs.Param.prototype.eval = function(state) {
  4037. return state.eval(state.currentApplication().args[this.index]);
  4038. };
  4039. pexprs.Lex.prototype.eval = function(state) {
  4040. state.enterLexifiedContext();
  4041. var ans = state.eval(this.expr);
  4042. state.exitLexifiedContext();
  4043. return ans;
  4044. };
  4045. pexprs.Alt.prototype.eval = function(state) {
  4046. for (var idx = 0; idx < this.terms.length; idx++) {
  4047. if (state.eval(this.terms[idx])) {
  4048. return true;
  4049. }
  4050. }
  4051. return false;
  4052. };
  4053. pexprs.Seq.prototype.eval = function(state) {
  4054. for (var idx = 0; idx < this.factors.length; idx++) {
  4055. var factor = this.factors[idx];
  4056. if (!state.eval(factor)) {
  4057. return false;
  4058. }
  4059. }
  4060. return true;
  4061. };
  4062. pexprs.Iter.prototype.eval = function(state) {
  4063. var inputStream = state.inputStream;
  4064. var origPos = inputStream.pos;
  4065. var arity = this.getArity();
  4066. var cols = [];
  4067. var colOffsets = [];
  4068. while (cols.length < arity) {
  4069. cols.push([]);
  4070. colOffsets.push([]);
  4071. }
  4072. var numMatches = 0;
  4073. var prevPos = origPos;
  4074. var idx;
  4075. while (numMatches < this.maxNumMatches && state.eval(this.expr)) {
  4076. if (inputStream.pos === prevPos) {
  4077. throw errors.kleeneExprHasNullableOperand(this, state._applicationStack);
  4078. }
  4079. prevPos = inputStream.pos;
  4080. numMatches++;
  4081. var row = state._bindings.splice(state._bindings.length - arity, arity);
  4082. var rowOffsets = state._bindingOffsets.splice(state._bindingOffsets.length - arity, arity);
  4083. for (idx = 0; idx < row.length; idx++) {
  4084. cols[idx].push(row[idx]);
  4085. colOffsets[idx].push(rowOffsets[idx]);
  4086. }
  4087. }
  4088. if (numMatches < this.minNumMatches) {
  4089. return false;
  4090. }
  4091. var offset = state.posToOffset(origPos);
  4092. var matchLength = 0;
  4093. if (numMatches > 0) {
  4094. var lastCol = cols[arity - 1];
  4095. var lastColOffsets = colOffsets[arity - 1];
  4096. var endOffset =
  4097. lastColOffsets[lastColOffsets.length - 1] + lastCol[lastCol.length - 1].matchLength;
  4098. offset = colOffsets[0][0];
  4099. matchLength = endOffset - offset;
  4100. }
  4101. var isOptional = this instanceof pexprs.Opt;
  4102. for (idx = 0; idx < cols.length; idx++) {
  4103. state._bindings.push(
  4104. new IterationNode(state.grammar, cols[idx], colOffsets[idx], matchLength, isOptional));
  4105. state._bindingOffsets.push(offset);
  4106. }
  4107. return true;
  4108. };
  4109. pexprs.Not.prototype.eval = function(state) {
  4110. /*
  4111. TODO:
  4112. - Right now we're just throwing away all of the failures that happen inside a `not`, and
  4113. recording `this` as a failed expression.
  4114. - Double negation should be equivalent to lookahead, but that's not the case right now wrt
  4115. failures. E.g., ~~'foo' produces a failure for ~~'foo', but maybe it should produce
  4116. a failure for 'foo' instead.
  4117. */
  4118. var inputStream = state.inputStream;
  4119. var origPos = inputStream.pos;
  4120. state.pushFailuresInfo();
  4121. var ans = state.eval(this.expr);
  4122. state.popFailuresInfo();
  4123. if (ans) {
  4124. state.processFailure(origPos, this);
  4125. return false;
  4126. }
  4127. inputStream.pos = origPos;
  4128. return true;
  4129. };
  4130. pexprs.Lookahead.prototype.eval = function(state) {
  4131. var inputStream = state.inputStream;
  4132. var origPos = inputStream.pos;
  4133. if (state.eval(this.expr)) {
  4134. inputStream.pos = origPos;
  4135. return true;
  4136. } else {
  4137. return false;
  4138. }
  4139. };
  4140. pexprs.Apply.prototype.eval = function(state) {
  4141. var caller = state.currentApplication();
  4142. var actuals = caller ? caller.args : [];
  4143. var app = this.substituteParams(actuals);
  4144. var posInfo = state.getCurrentPosInfo();
  4145. if (posInfo.isActive(app)) {
  4146. // This rule is already active at this position, i.e., it is left-recursive.
  4147. return app.handleCycle(state);
  4148. }
  4149. var memoKey = app.toMemoKey();
  4150. var memoRec = posInfo.memo[memoKey];
  4151. if (memoRec && posInfo.shouldUseMemoizedResult(memoRec)) {
  4152. if (state.hasNecessaryInfo(memoRec)) {
  4153. return state.useMemoizedResult(state.inputStream.pos, memoRec);
  4154. }
  4155. delete posInfo.memo[memoKey];
  4156. }
  4157. return app.reallyEval(state);
  4158. };
  4159. pexprs.Apply.prototype.handleCycle = function(state) {
  4160. var posInfo = state.getCurrentPosInfo();
  4161. var currentLeftRecursion = posInfo.currentLeftRecursion;
  4162. var memoKey = this.toMemoKey();
  4163. var memoRec = posInfo.memo[memoKey];
  4164. if (currentLeftRecursion && currentLeftRecursion.headApplication.toMemoKey() === memoKey) {
  4165. // We already know about this left recursion, but it's possible there are "involved
  4166. // applications" that we don't already know about, so...
  4167. memoRec.updateInvolvedApplicationMemoKeys();
  4168. } else if (!memoRec) {
  4169. // New left recursion detected! Memoize a failure to try to get a seed parse.
  4170. memoRec = posInfo.memoize(
  4171. memoKey,
  4172. {matchLength: 0, examinedLength: 0, value: false, rightmostFailureOffset: -1});
  4173. posInfo.startLeftRecursion(this, memoRec);
  4174. }
  4175. return state.useMemoizedResult(state.inputStream.pos, memoRec);
  4176. };
  4177. pexprs.Apply.prototype.reallyEval = function(state) {
  4178. var inputStream = state.inputStream;
  4179. var origPos = inputStream.pos;
  4180. var origPosInfo = state.getCurrentPosInfo();
  4181. var ruleInfo = state.grammar.rules[this.ruleName];
  4182. var body = ruleInfo.body;
  4183. var description = ruleInfo.description;
  4184. state.enterApplication(origPosInfo, this);
  4185. if (description) {
  4186. state.pushFailuresInfo();
  4187. }
  4188. // Reset the input stream's examinedLength property so that we can track
  4189. // the examined length of this particular application.
  4190. var origInputStreamExaminedLength = inputStream.examinedLength;
  4191. inputStream.examinedLength = 0;
  4192. var value = this.evalOnce(body, state);
  4193. var currentLR = origPosInfo.currentLeftRecursion;
  4194. var memoKey = this.toMemoKey();
  4195. var isHeadOfLeftRecursion = currentLR && currentLR.headApplication.toMemoKey() === memoKey;
  4196. var memoRec;
  4197. if (isHeadOfLeftRecursion) {
  4198. value = this.growSeedResult(body, state, origPos, currentLR, value);
  4199. origPosInfo.endLeftRecursion();
  4200. memoRec = currentLR;
  4201. memoRec.examinedLength = inputStream.examinedLength - origPos;
  4202. memoRec.rightmostFailureOffset = state._getRightmostFailureOffset();
  4203. origPosInfo.memoize(memoKey, memoRec); // updates origPosInfo's maxExaminedLength
  4204. } else if (!currentLR || !currentLR.isInvolved(memoKey)) {
  4205. // This application is not involved in left recursion, so it's ok to memoize it.
  4206. memoRec = origPosInfo.memoize(memoKey, {
  4207. matchLength: inputStream.pos - origPos,
  4208. examinedLength: inputStream.examinedLength - origPos,
  4209. value: value,
  4210. failuresAtRightmostPosition: state.cloneRecordedFailures(),
  4211. rightmostFailureOffset: state._getRightmostFailureOffset()
  4212. });
  4213. }
  4214. var succeeded = !!value;
  4215. if (description) {
  4216. state.popFailuresInfo();
  4217. if (!succeeded) {
  4218. state.processFailure(origPos, this);
  4219. }
  4220. if (memoRec) {
  4221. memoRec.failuresAtRightmostPosition = state.cloneRecordedFailures();
  4222. }
  4223. }
  4224. // Record trace information in the memo table, so that it is available if the memoized result
  4225. // is used later.
  4226. if (state.isTracing() && memoRec) {
  4227. var entry = state.getTraceEntry(origPos, this, succeeded, succeeded ? [value] : []);
  4228. if (isHeadOfLeftRecursion) {
  4229. common.assert(entry.terminatingLREntry != null || !succeeded);
  4230. entry.isHeadOfLeftRecursion = true;
  4231. }
  4232. memoRec.traceEntry = entry;
  4233. }
  4234. // Fix the input stream's examinedLength -- it should be the maximum examined length
  4235. // across all applications, not just this one.
  4236. inputStream.examinedLength = Math.max(inputStream.examinedLength, origInputStreamExaminedLength);
  4237. state.exitApplication(origPosInfo, value);
  4238. return succeeded;
  4239. };
  4240. pexprs.Apply.prototype.evalOnce = function(expr, state) {
  4241. var inputStream = state.inputStream;
  4242. var origPos = inputStream.pos;
  4243. if (state.eval(expr)) {
  4244. var arity = expr.getArity();
  4245. var bindings = state._bindings.splice(state._bindings.length - arity, arity);
  4246. var offsets = state._bindingOffsets.splice(state._bindingOffsets.length - arity, arity);
  4247. return new NonterminalNode(
  4248. state.grammar, this.ruleName, bindings, offsets, inputStream.pos - origPos);
  4249. } else {
  4250. return false;
  4251. }
  4252. };
  4253. pexprs.Apply.prototype.growSeedResult = function(body, state, origPos, lrMemoRec, newValue) {
  4254. if (!newValue) {
  4255. return false;
  4256. }
  4257. var inputStream = state.inputStream;
  4258. while (true) {
  4259. lrMemoRec.matchLength = inputStream.pos - origPos;
  4260. lrMemoRec.value = newValue;
  4261. lrMemoRec.failuresAtRightmostPosition = state.cloneRecordedFailures();
  4262. if (state.isTracing()) {
  4263. // Before evaluating the body again, add a trace node for this application to the memo entry.
  4264. // Its only child is a copy of the trace node from `newValue`, which will always be the last
  4265. // element in `state.trace`.
  4266. var seedTrace = state.trace[state.trace.length - 1];
  4267. lrMemoRec.traceEntry = new Trace(
  4268. state.input, origPos, inputStream.pos, this, true, [newValue], [seedTrace.clone()]);
  4269. }
  4270. inputStream.pos = origPos;
  4271. newValue = this.evalOnce(body, state);
  4272. if (inputStream.pos - origPos <= lrMemoRec.matchLength) {
  4273. break;
  4274. }
  4275. if (state.isTracing()) {
  4276. state.trace.splice(-2, 1); // Drop the trace for the old seed.
  4277. }
  4278. }
  4279. if (state.isTracing()) {
  4280. // The last entry is for an unused result -- pop it and save it in the "real" entry.
  4281. lrMemoRec.traceEntry.recordLRTermination(state.trace.pop(), newValue);
  4282. }
  4283. inputStream.pos = origPos + lrMemoRec.matchLength;
  4284. return lrMemoRec.value;
  4285. };
  4286. pexprs.UnicodeChar.prototype.eval = function(state) {
  4287. var inputStream = state.inputStream;
  4288. var origPos = inputStream.pos;
  4289. var ch = inputStream.next();
  4290. if (ch && this.pattern.test(ch)) {
  4291. state.pushBinding(new TerminalNode(state.grammar, ch), origPos);
  4292. return true;
  4293. } else {
  4294. state.processFailure(origPos, this);
  4295. return false;
  4296. }
  4297. };
  4298. },{"./Trace":23,"./common":24,"./errors":25,"./nodes":27,"./pexprs":44}],34:[function(require,module,exports){
  4299. 'use strict';
  4300. // --------------------------------------------------------------------
  4301. // Imports
  4302. // --------------------------------------------------------------------
  4303. var common = require('./common');
  4304. var pexprs = require('./pexprs');
  4305. // --------------------------------------------------------------------
  4306. // Helpers
  4307. // --------------------------------------------------------------------
  4308. function flatten(listOfLists) {
  4309. return Array.prototype.concat.apply([], listOfLists);
  4310. }
  4311. // --------------------------------------------------------------------
  4312. // Operations
  4313. // --------------------------------------------------------------------
  4314. pexprs.PExpr.prototype.generateExample = common.abstract('generateExample');
  4315. function categorizeExamples(examples) {
  4316. // A list of rules that the system needs examples of, in order to generate an example
  4317. // for the current rule
  4318. var examplesNeeded = examples.filter(function(example) {
  4319. return example.hasOwnProperty('examplesNeeded');
  4320. })
  4321. .map(function(example) { return example.examplesNeeded; });
  4322. examplesNeeded = flatten(examplesNeeded);
  4323. var uniqueExamplesNeeded = {};
  4324. for (var i = 0; i < examplesNeeded.length; i++) {
  4325. var currentExampleNeeded = examplesNeeded[i];
  4326. uniqueExamplesNeeded[currentExampleNeeded] = true;
  4327. }
  4328. examplesNeeded = Object.keys(uniqueExamplesNeeded);
  4329. // A list of successfully generated examples
  4330. var successfulExamples = examples.filter(function(example) {
  4331. return example.hasOwnProperty('value');
  4332. })
  4333. .map(function(item) { return item.value; });
  4334. // This flag returns true if the system cannot generate the rule it is currently
  4335. // attempting to generate, regardless of whether or not it has the examples it needs.
  4336. // Currently, this is only used in overriding generators to prevent the system from
  4337. // generating examples for certain rules (e.g. 'ident').
  4338. var needHelp = examples.some(function(item) { return item.needHelp; });
  4339. return {
  4340. examplesNeeded: examplesNeeded,
  4341. successfulExamples: successfulExamples,
  4342. needHelp: needHelp
  4343. };
  4344. }
  4345. pexprs.any.generateExample = function(grammar, examples, inSyntacticContext, actuals) {
  4346. return {value: String.fromCharCode(Math.floor(Math.random() * 255))};
  4347. };
  4348. // Assumes that terminal's object is always a string
  4349. pexprs.Terminal.prototype.generateExample = function(grammar, examples, inSyntacticContext) {
  4350. return {value: this.obj};
  4351. };
  4352. pexprs.Range.prototype.generateExample = function(grammar, examples, inSyntacticContext) {
  4353. var rangeSize = this.to.charCodeAt(0) - this.from.charCodeAt(0);
  4354. return {value: String.fromCharCode(
  4355. this.from.charCodeAt(0) + Math.floor(rangeSize * Math.random())
  4356. )};
  4357. };
  4358. pexprs.Param.prototype.generateExample = function(grammar, examples, inSyntacticContext, actuals) {
  4359. return actuals[this.index].generateExample(grammar, examples, inSyntacticContext, actuals);
  4360. };
  4361. pexprs.Alt.prototype.generateExample = function(grammar, examples, inSyntacticContext, actuals) {
  4362. // items -> termExamples
  4363. var termExamples = this.terms.map(function(term) {
  4364. return term.generateExample(grammar, examples, inSyntacticContext, actuals);
  4365. });
  4366. var categorizedExamples = categorizeExamples(termExamples);
  4367. var examplesNeeded = categorizedExamples.examplesNeeded;
  4368. var successfulExamples = categorizedExamples.successfulExamples;
  4369. var needHelp = categorizedExamples.needHelp;
  4370. var ans = {};
  4371. // Alt can contain both an example and a request for examples
  4372. if (successfulExamples.length > 0) {
  4373. var i = Math.floor(Math.random() * successfulExamples.length);
  4374. ans.value = successfulExamples[i];
  4375. }
  4376. if (examplesNeeded.length > 0) {
  4377. ans.examplesNeeded = examplesNeeded;
  4378. }
  4379. ans.needHelp = needHelp;
  4380. return ans;
  4381. };
  4382. pexprs.Seq.prototype.generateExample = function(grammar, examples, inSyntacticContext, actuals) {
  4383. var factorExamples = this.factors.map(function(factor) {
  4384. return factor.generateExample(grammar, examples, inSyntacticContext, actuals);
  4385. });
  4386. var categorizedExamples = categorizeExamples(factorExamples);
  4387. var examplesNeeded = categorizedExamples.examplesNeeded;
  4388. var successfulExamples = categorizedExamples.successfulExamples;
  4389. var needHelp = categorizedExamples.needHelp;
  4390. var ans = {};
  4391. // In a Seq, all pieces must succeed in order to have a successful example.
  4392. if (examplesNeeded.length > 0 || needHelp) {
  4393. ans.examplesNeeded = examplesNeeded;
  4394. ans.needHelp = needHelp;
  4395. } else {
  4396. ans.value = successfulExamples.join(inSyntacticContext ? ' ' : '');
  4397. }
  4398. return ans;
  4399. };
  4400. pexprs.Iter.prototype.generateExample = function(grammar, examples, inSyntacticContext, actuals) {
  4401. var rangeTimes = Math.min(this.maxNumMatches - this.minNumMatches, 3);
  4402. var numTimes = Math.floor(Math.random() * (rangeTimes + 1) + this.minNumMatches);
  4403. var items = [];
  4404. for (var i = 0; i < numTimes; i++) {
  4405. items.push(this.expr.generateExample(grammar, examples, inSyntacticContext, actuals));
  4406. }
  4407. var categorizedExamples = categorizeExamples(items);
  4408. var examplesNeeded = categorizedExamples.examplesNeeded;
  4409. var successfulExamples = categorizedExamples.successfulExamples;
  4410. var ans = {};
  4411. // It's always either one or the other.
  4412. // TODO: instead of ' ', call 'spaces.generateExample()'
  4413. ans.value = successfulExamples.join(inSyntacticContext ? ' ' : '');
  4414. if (examplesNeeded.length > 0) {
  4415. ans.examplesNeeded = examplesNeeded;
  4416. }
  4417. return ans;
  4418. };
  4419. // Right now, 'Not' and 'Lookahead' generate nothing and assume that whatever follows will
  4420. // work according to the encoded constraints.
  4421. pexprs.Not.prototype.generateExample = function(grammar, examples, inSyntacticContext) {
  4422. return {value: ''};
  4423. };
  4424. pexprs.Lookahead.prototype.generateExample = function(grammar, examples, inSyntacticContext) {
  4425. return {value: ''};
  4426. };
  4427. pexprs.Lex.prototype.generateExample = function(grammar, examples, inSyntacticContext, actuals) {
  4428. return this.expr.generateExample(grammar, examples, false, actuals);
  4429. };
  4430. pexprs.Apply.prototype.generateExample = function(grammar, examples, inSyntacticContext, actuals) {
  4431. var ans = {};
  4432. var ruleName = this.substituteParams(actuals).toString();
  4433. if (!examples.hasOwnProperty(ruleName)) {
  4434. ans.examplesNeeded = [ruleName];
  4435. } else {
  4436. var relevantExamples = examples[ruleName];
  4437. var i = Math.floor(Math.random() * relevantExamples.length);
  4438. ans.value = relevantExamples[i];
  4439. }
  4440. return ans;
  4441. };
  4442. pexprs.UnicodeChar.prototype.generateExample = function(
  4443. grammar, examples, inSyntacticContext, actuals) {
  4444. var char;
  4445. switch (this.category) {
  4446. case 'Lu': char = 'Á'; break;
  4447. case 'Ll': char = 'ŏ'; break;
  4448. case 'Lt': char = 'Dž'; break;
  4449. case 'Lm': char = 'ˮ'; break;
  4450. case 'Lo': char = 'ƻ'; break;
  4451. case 'Nl': char = 'ↂ'; break;
  4452. case 'Nd': char = '½'; break;
  4453. case 'Mn': char = '\u0487'; break;
  4454. case 'Mc': char = 'ि'; break;
  4455. case 'Pc': char = '⁀'; break;
  4456. case 'Zs': char = '\u2001'; break;
  4457. case 'L': char = 'Á'; break;
  4458. case 'Ltmo': char = 'Dž'; break;
  4459. }
  4460. return {value: char}; // 💩
  4461. };
  4462. },{"./common":24,"./pexprs":44}],35:[function(require,module,exports){
  4463. 'use strict';
  4464. // --------------------------------------------------------------------
  4465. // Imports
  4466. // --------------------------------------------------------------------
  4467. var common = require('./common');
  4468. var pexprs = require('./pexprs');
  4469. // --------------------------------------------------------------------
  4470. // Operations
  4471. // --------------------------------------------------------------------
  4472. pexprs.PExpr.prototype.getArity = common.abstract('getArity');
  4473. pexprs.any.getArity =
  4474. pexprs.end.getArity =
  4475. pexprs.Terminal.prototype.getArity =
  4476. pexprs.Range.prototype.getArity =
  4477. pexprs.Param.prototype.getArity =
  4478. pexprs.Apply.prototype.getArity =
  4479. pexprs.UnicodeChar.prototype.getArity = function() {
  4480. return 1;
  4481. };
  4482. pexprs.Alt.prototype.getArity = function() {
  4483. // This is ok b/c all terms must have the same arity -- this property is
  4484. // checked by the Grammar constructor.
  4485. return this.terms.length === 0 ? 0 : this.terms[0].getArity();
  4486. };
  4487. pexprs.Seq.prototype.getArity = function() {
  4488. var arity = 0;
  4489. for (var idx = 0; idx < this.factors.length; idx++) {
  4490. arity += this.factors[idx].getArity();
  4491. }
  4492. return arity;
  4493. };
  4494. pexprs.Iter.prototype.getArity = function() {
  4495. return this.expr.getArity();
  4496. };
  4497. pexprs.Not.prototype.getArity = function() {
  4498. return 0;
  4499. };
  4500. pexprs.Lookahead.prototype.getArity =
  4501. pexprs.Lex.prototype.getArity = function() {
  4502. return this.expr.getArity();
  4503. };
  4504. },{"./common":24,"./pexprs":44}],36:[function(require,module,exports){
  4505. 'use strict';
  4506. // --------------------------------------------------------------------
  4507. // Imports
  4508. // --------------------------------------------------------------------
  4509. var common = require('./common');
  4510. var pexprs = require('./pexprs');
  4511. // --------------------------------------------------------------------
  4512. // Operations
  4513. // --------------------------------------------------------------------
  4514. /*
  4515. Called at grammar creation time to rewrite a rule body, replacing each reference to a formal
  4516. parameter with a `Param` node. Returns a PExpr -- either a new one, or the original one if
  4517. it was modified in place.
  4518. */
  4519. pexprs.PExpr.prototype.introduceParams = common.abstract('introduceParams');
  4520. pexprs.any.introduceParams =
  4521. pexprs.end.introduceParams =
  4522. pexprs.Terminal.prototype.introduceParams =
  4523. pexprs.Range.prototype.introduceParams =
  4524. pexprs.Param.prototype.introduceParams =
  4525. pexprs.UnicodeChar.prototype.introduceParams = function(formals) {
  4526. return this;
  4527. };
  4528. pexprs.Alt.prototype.introduceParams = function(formals) {
  4529. this.terms.forEach(function(term, idx, terms) {
  4530. terms[idx] = term.introduceParams(formals);
  4531. });
  4532. return this;
  4533. };
  4534. pexprs.Seq.prototype.introduceParams = function(formals) {
  4535. this.factors.forEach(function(factor, idx, factors) {
  4536. factors[idx] = factor.introduceParams(formals);
  4537. });
  4538. return this;
  4539. };
  4540. pexprs.Iter.prototype.introduceParams =
  4541. pexprs.Not.prototype.introduceParams =
  4542. pexprs.Lookahead.prototype.introduceParams =
  4543. pexprs.Lex.prototype.introduceParams = function(formals) {
  4544. this.expr = this.expr.introduceParams(formals);
  4545. return this;
  4546. };
  4547. pexprs.Apply.prototype.introduceParams = function(formals) {
  4548. var index = formals.indexOf(this.ruleName);
  4549. if (index >= 0) {
  4550. if (this.args.length > 0) {
  4551. // TODO: Should this be supported? See issue #64.
  4552. throw new Error('Parameterized rules cannot be passed as arguments to another rule.');
  4553. }
  4554. return new pexprs.Param(index).withSource(this.source);
  4555. } else {
  4556. this.args.forEach(function(arg, idx, args) {
  4557. args[idx] = arg.introduceParams(formals);
  4558. });
  4559. return this;
  4560. }
  4561. };
  4562. },{"./common":24,"./pexprs":44}],37:[function(require,module,exports){
  4563. 'use strict';
  4564. // --------------------------------------------------------------------
  4565. // Imports
  4566. // --------------------------------------------------------------------
  4567. var common = require('./common');
  4568. var pexprs = require('./pexprs');
  4569. // --------------------------------------------------------------------
  4570. // Operations
  4571. // --------------------------------------------------------------------
  4572. // Returns `true` if this parsing expression may accept without consuming any input.
  4573. pexprs.PExpr.prototype.isNullable = function(grammar) {
  4574. return this._isNullable(grammar, Object.create(null));
  4575. };
  4576. pexprs.PExpr.prototype._isNullable = common.abstract('_isNullable');
  4577. pexprs.any._isNullable =
  4578. pexprs.Range.prototype._isNullable =
  4579. pexprs.Param.prototype._isNullable =
  4580. pexprs.Plus.prototype._isNullable =
  4581. pexprs.UnicodeChar.prototype._isNullable = function(grammar, memo) {
  4582. return false;
  4583. };
  4584. pexprs.end._isNullable = function(grammar, memo) {
  4585. return true;
  4586. };
  4587. pexprs.Terminal.prototype._isNullable = function(grammar, memo) {
  4588. if (typeof this.obj === 'string') {
  4589. // This is an over-simplification: it's only correct if the input is a string. If it's an array
  4590. // or an object, then the empty string parsing expression is not nullable.
  4591. return this.obj === '';
  4592. } else {
  4593. return false;
  4594. }
  4595. };
  4596. pexprs.Alt.prototype._isNullable = function(grammar, memo) {
  4597. return this.terms.length === 0 ||
  4598. this.terms.some(function(term) { return term._isNullable(grammar, memo); });
  4599. };
  4600. pexprs.Seq.prototype._isNullable = function(grammar, memo) {
  4601. return this.factors.every(function(factor) { return factor._isNullable(grammar, memo); });
  4602. };
  4603. pexprs.Star.prototype._isNullable =
  4604. pexprs.Opt.prototype._isNullable =
  4605. pexprs.Not.prototype._isNullable =
  4606. pexprs.Lookahead.prototype._isNullable = function(grammar, memo) {
  4607. return true;
  4608. };
  4609. pexprs.Lex.prototype._isNullable = function(grammar, memo) {
  4610. return this.expr._isNullable(grammar, memo);
  4611. };
  4612. pexprs.Apply.prototype._isNullable = function(grammar, memo) {
  4613. var key = this.toMemoKey();
  4614. if (!Object.prototype.hasOwnProperty.call(memo, key)) {
  4615. var body = grammar.rules[this.ruleName].body;
  4616. var inlined = body.substituteParams(this.args);
  4617. memo[key] = false; // Prevent infinite recursion for recursive rules.
  4618. memo[key] = inlined._isNullable(grammar, memo);
  4619. }
  4620. return memo[key];
  4621. };
  4622. },{"./common":24,"./pexprs":44}],38:[function(require,module,exports){
  4623. 'use strict';
  4624. // --------------------------------------------------------------------
  4625. // Imports
  4626. // --------------------------------------------------------------------
  4627. var common = require('./common');
  4628. var pexprs = require('./pexprs');
  4629. // --------------------------------------------------------------------
  4630. // Private stuff
  4631. // --------------------------------------------------------------------
  4632. function getMetaInfo(expr, grammarInterval) {
  4633. var metaInfo = {};
  4634. if (expr.source && grammarInterval) {
  4635. var adjusted = expr.source.relativeTo(grammarInterval);
  4636. metaInfo.sourceInterval = [adjusted.startIdx, adjusted.endIdx];
  4637. }
  4638. return metaInfo;
  4639. }
  4640. // --------------------------------------------------------------------
  4641. // Operations
  4642. // --------------------------------------------------------------------
  4643. pexprs.PExpr.prototype.outputRecipe = common.abstract('outputRecipe');
  4644. pexprs.any.outputRecipe = function(formals, grammarInterval) {
  4645. return ['any', getMetaInfo(this, grammarInterval)];
  4646. };
  4647. pexprs.end.outputRecipe = function(formals, grammarInterval) {
  4648. return ['end', getMetaInfo(this, grammarInterval)];
  4649. };
  4650. pexprs.Terminal.prototype.outputRecipe = function(formals, grammarInterval) {
  4651. return [
  4652. 'terminal',
  4653. getMetaInfo(this, grammarInterval),
  4654. this.obj
  4655. ];
  4656. };
  4657. pexprs.Range.prototype.outputRecipe = function(formals, grammarInterval) {
  4658. return [
  4659. 'range',
  4660. getMetaInfo(this, grammarInterval),
  4661. this.from,
  4662. this.to
  4663. ];
  4664. };
  4665. pexprs.Param.prototype.outputRecipe = function(formals, grammarInterval) {
  4666. return [
  4667. 'param',
  4668. getMetaInfo(this, grammarInterval),
  4669. this.index
  4670. ];
  4671. };
  4672. pexprs.Alt.prototype.outputRecipe = function(formals, grammarInterval) {
  4673. return [
  4674. 'alt',
  4675. getMetaInfo(this, grammarInterval)
  4676. ].concat(this.terms.map(function(term) {
  4677. return term.outputRecipe(formals, grammarInterval);
  4678. }));
  4679. };
  4680. pexprs.Extend.prototype.outputRecipe = function(formals, grammarInterval) {
  4681. var extension = this.terms[0]; // [extension, orginal]
  4682. return extension.outputRecipe(formals, grammarInterval);
  4683. };
  4684. pexprs.Seq.prototype.outputRecipe = function(formals, grammarInterval) {
  4685. return [
  4686. 'seq',
  4687. getMetaInfo(this, grammarInterval)
  4688. ].concat(this.factors.map(function(factor) {
  4689. return factor.outputRecipe(formals, grammarInterval);
  4690. }));
  4691. };
  4692. pexprs.Star.prototype.outputRecipe =
  4693. pexprs.Plus.prototype.outputRecipe =
  4694. pexprs.Opt.prototype.outputRecipe =
  4695. pexprs.Not.prototype.outputRecipe =
  4696. pexprs.Lookahead.prototype.outputRecipe =
  4697. pexprs.Lex.prototype.outputRecipe = function(formals, grammarInterval) {
  4698. return [
  4699. this.constructor.name.toLowerCase(),
  4700. getMetaInfo(this, grammarInterval),
  4701. this.expr.outputRecipe(formals, grammarInterval)
  4702. ];
  4703. };
  4704. pexprs.Apply.prototype.outputRecipe = function(formals, grammarInterval) {
  4705. return [
  4706. 'app',
  4707. getMetaInfo(this, grammarInterval),
  4708. this.ruleName,
  4709. this.args.map(function(arg) {
  4710. return arg.outputRecipe(formals, grammarInterval);
  4711. })
  4712. ];
  4713. };
  4714. pexprs.UnicodeChar.prototype.outputRecipe = function(formals, grammarInterval) {
  4715. return [
  4716. 'unicodeChar',
  4717. getMetaInfo(this, grammarInterval),
  4718. this.category
  4719. ];
  4720. };
  4721. },{"./common":24,"./pexprs":44}],39:[function(require,module,exports){
  4722. 'use strict';
  4723. // --------------------------------------------------------------------
  4724. // Imports
  4725. // --------------------------------------------------------------------
  4726. var common = require('./common');
  4727. var pexprs = require('./pexprs');
  4728. // --------------------------------------------------------------------
  4729. // Operations
  4730. // --------------------------------------------------------------------
  4731. /*
  4732. Returns a PExpr that results from recursively replacing every formal parameter (i.e., instance
  4733. of `Param`) inside this PExpr with its actual value from `actuals` (an Array).
  4734. The receiver must not be modified; a new PExpr must be returned if any replacement is necessary.
  4735. */
  4736. // function(actuals) { ... }
  4737. pexprs.PExpr.prototype.substituteParams = common.abstract('substituteParams');
  4738. pexprs.any.substituteParams =
  4739. pexprs.end.substituteParams =
  4740. pexprs.Terminal.prototype.substituteParams =
  4741. pexprs.Range.prototype.substituteParams =
  4742. pexprs.UnicodeChar.prototype.substituteParams = function(actuals) {
  4743. return this;
  4744. };
  4745. pexprs.Param.prototype.substituteParams = function(actuals) {
  4746. return actuals[this.index];
  4747. };
  4748. pexprs.Alt.prototype.substituteParams = function(actuals) {
  4749. return new pexprs.Alt(
  4750. this.terms.map(function(term) { return term.substituteParams(actuals); }));
  4751. };
  4752. pexprs.Seq.prototype.substituteParams = function(actuals) {
  4753. return new pexprs.Seq(
  4754. this.factors.map(function(factor) { return factor.substituteParams(actuals); }));
  4755. };
  4756. pexprs.Iter.prototype.substituteParams =
  4757. pexprs.Not.prototype.substituteParams =
  4758. pexprs.Lookahead.prototype.substituteParams =
  4759. pexprs.Lex.prototype.substituteParams = function(actuals) {
  4760. return new this.constructor(this.expr.substituteParams(actuals));
  4761. };
  4762. pexprs.Apply.prototype.substituteParams = function(actuals) {
  4763. if (this.args.length === 0) {
  4764. // Avoid making a copy of this application, as an optimization
  4765. return this;
  4766. } else {
  4767. var args = this.args.map(function(arg) { return arg.substituteParams(actuals); });
  4768. return new pexprs.Apply(this.ruleName, args);
  4769. }
  4770. };
  4771. },{"./common":24,"./pexprs":44}],40:[function(require,module,exports){
  4772. 'use strict';
  4773. // --------------------------------------------------------------------
  4774. // Imports
  4775. // --------------------------------------------------------------------
  4776. var common = require('./common');
  4777. var pexprs = require('./pexprs');
  4778. var copyWithoutDuplicates = common.copyWithoutDuplicates;
  4779. // --------------------------------------------------------------------
  4780. // Private stuff
  4781. // --------------------------------------------------------------------
  4782. function isRestrictedJSIdentifier(str) {
  4783. return /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(str);
  4784. }
  4785. function resolveDuplicatedNames(argumentNameList) {
  4786. // `count` is used to record the number of times each argument name occurs in the list,
  4787. // this is useful for checking duplicated argument name. It maps argument names to ints.
  4788. var count = Object.create(null);
  4789. argumentNameList.forEach(function(argName) {
  4790. count[argName] = (count[argName] || 0) + 1;
  4791. });
  4792. // Append subscripts ('_1', '_2', ...) to duplicate argument names.
  4793. Object.keys(count).forEach(function(dupArgName) {
  4794. if (count[dupArgName] <= 1) {
  4795. return;
  4796. }
  4797. // This name shows up more than once, so add subscripts.
  4798. var subscript = 1;
  4799. argumentNameList.forEach(function(argName, idx) {
  4800. if (argName === dupArgName) {
  4801. argumentNameList[idx] = argName + '_' + subscript++;
  4802. }
  4803. });
  4804. });
  4805. }
  4806. // --------------------------------------------------------------------
  4807. // Operations
  4808. // --------------------------------------------------------------------
  4809. /*
  4810. Returns a list of strings that will be used as the default argument names for its receiver
  4811. (a pexpr) in a semantic action. This is used exclusively by the Semantics Editor.
  4812. `firstArgIndex` is the 1-based index of the first argument name that will be generated for this
  4813. pexpr. It enables us to name arguments positionally, e.g., if the second argument is a
  4814. non-alphanumeric terminal like "+", it will be named '$2'.
  4815. `noDupCheck` is true if the caller of `toArgumentNameList` is not a top level caller. It enables
  4816. us to avoid nested duplication subscripts appending, e.g., '_1_1', '_1_2', by only checking
  4817. duplicates at the top level.
  4818. Here is a more elaborate example that illustrates how this method works:
  4819. `(a "+" b).toArgumentNameList(1)` evaluates to `['a', '$2', 'b']` with the following recursive
  4820. calls:
  4821. (a).toArgumentNameList(1) -> ['a'],
  4822. ("+").toArgumentNameList(2) -> ['$2'],
  4823. (b).toArgumentNameList(3) -> ['b']
  4824. Notes:
  4825. * This method must only be called on well-formed expressions, e.g., the receiver must
  4826. not have any Alt sub-expressions with inconsistent arities.
  4827. * e.getArity() === e.toArgumentNameList(1).length
  4828. */
  4829. // function(firstArgIndex, noDupCheck) { ... }
  4830. pexprs.PExpr.prototype.toArgumentNameList = common.abstract('toArgumentNameList');
  4831. pexprs.any.toArgumentNameList = function(firstArgIndex, noDupCheck) {
  4832. return ['any'];
  4833. };
  4834. pexprs.end.toArgumentNameList = function(firstArgIndex, noDupCheck) {
  4835. return ['end'];
  4836. };
  4837. pexprs.Terminal.prototype.toArgumentNameList = function(firstArgIndex, noDupCheck) {
  4838. if (typeof this.obj === 'string' && /^[_a-zA-Z0-9]+$/.test(this.obj)) {
  4839. // If this terminal is a valid suffix for a JS identifier, just prepend it with '_'
  4840. return ['_' + this.obj];
  4841. } else {
  4842. // Otherwise, name it positionally.
  4843. return ['$' + firstArgIndex];
  4844. }
  4845. };
  4846. pexprs.Range.prototype.toArgumentNameList = function(firstArgIndex, noDupCheck) {
  4847. var argName = this.from + '_to_' + this.to;
  4848. // If the `argName` is not valid then try to prepend a `_`.
  4849. if (!isRestrictedJSIdentifier(argName)) {
  4850. argName = '_' + argName;
  4851. }
  4852. // If the `argName` still not valid after prepending a `_`, then name it positionally.
  4853. if (!isRestrictedJSIdentifier(argName)) {
  4854. argName = '$' + firstArgIndex;
  4855. }
  4856. return [argName];
  4857. };
  4858. pexprs.Alt.prototype.toArgumentNameList = function(firstArgIndex, noDupCheck) {
  4859. // `termArgNameLists` is an array of arrays where each row is the
  4860. // argument name list that corresponds to a term in this alternation.
  4861. var termArgNameLists = this.terms.map(function(term) {
  4862. return term.toArgumentNameList(firstArgIndex, true);
  4863. });
  4864. var argumentNameList = [];
  4865. var numArgs = termArgNameLists[0].length;
  4866. for (var colIdx = 0; colIdx < numArgs; colIdx++) {
  4867. var col = [];
  4868. for (var rowIdx = 0; rowIdx < this.terms.length; rowIdx++) {
  4869. col.push(termArgNameLists[rowIdx][colIdx]);
  4870. }
  4871. var uniqueNames = copyWithoutDuplicates(col);
  4872. argumentNameList.push(uniqueNames.join('_or_'));
  4873. }
  4874. if (!noDupCheck) {
  4875. resolveDuplicatedNames(argumentNameList);
  4876. }
  4877. return argumentNameList;
  4878. };
  4879. pexprs.Seq.prototype.toArgumentNameList = function(firstArgIndex, noDupCheck) {
  4880. // Generate the argument name list, without worrying about duplicates.
  4881. var argumentNameList = [];
  4882. this.factors.forEach(function(factor) {
  4883. var factorArgumentNameList = factor.toArgumentNameList(firstArgIndex, true);
  4884. argumentNameList = argumentNameList.concat(factorArgumentNameList);
  4885. // Shift the firstArgIndex to take this factor's argument names into account.
  4886. firstArgIndex += factorArgumentNameList.length;
  4887. });
  4888. if (!noDupCheck) {
  4889. resolveDuplicatedNames(argumentNameList);
  4890. }
  4891. return argumentNameList;
  4892. };
  4893. pexprs.Iter.prototype.toArgumentNameList = function(firstArgIndex, noDupCheck) {
  4894. var argumentNameList = this.expr.toArgumentNameList(firstArgIndex, noDupCheck)
  4895. .map(function(exprArgumentString) {
  4896. return exprArgumentString[exprArgumentString.length - 1] === 's' ?
  4897. exprArgumentString + 'es' :
  4898. exprArgumentString + 's';
  4899. });
  4900. if (!noDupCheck) {
  4901. resolveDuplicatedNames(argumentNameList);
  4902. }
  4903. return argumentNameList;
  4904. };
  4905. pexprs.Opt.prototype.toArgumentNameList = function(firstArgIndex, noDupCheck) {
  4906. return this.expr.toArgumentNameList(firstArgIndex, noDupCheck).map(function(argName) {
  4907. return 'opt' + argName[0].toUpperCase() + argName.slice(1);
  4908. });
  4909. };
  4910. pexprs.Not.prototype.toArgumentNameList = function(firstArgIndex, noDupCheck) {
  4911. return [];
  4912. };
  4913. pexprs.Lookahead.prototype.toArgumentNameList =
  4914. pexprs.Lex.prototype.toArgumentNameList = function(firstArgIndex, noDupCheck) {
  4915. return this.expr.toArgumentNameList(firstArgIndex, noDupCheck);
  4916. };
  4917. pexprs.Apply.prototype.toArgumentNameList = function(firstArgIndex, noDupCheck) {
  4918. return [this.ruleName];
  4919. };
  4920. pexprs.UnicodeChar.prototype.toArgumentNameList = function(firstArgIndex, noDupCheck) {
  4921. return ['$' + firstArgIndex];
  4922. };
  4923. pexprs.Param.prototype.toArgumentNameList = function(firstArgIndex, noDupCheck) {
  4924. return ['param' + this.index];
  4925. };
  4926. // "Value pexprs" (Value, Str, Arr, Obj) are going away soon, so we don't worry about them here.
  4927. },{"./common":24,"./pexprs":44}],41:[function(require,module,exports){
  4928. 'use strict';
  4929. // --------------------------------------------------------------------
  4930. // Imports
  4931. // --------------------------------------------------------------------
  4932. var common = require('./common');
  4933. var pexprs = require('./pexprs');
  4934. // --------------------------------------------------------------------
  4935. // Operations
  4936. // --------------------------------------------------------------------
  4937. // Returns a string representing the PExpr, for use as a UI label, etc.
  4938. pexprs.PExpr.prototype.toDisplayString = common.abstract('toDisplayString');
  4939. pexprs.Alt.prototype.toDisplayString =
  4940. pexprs.Seq.prototype.toDisplayString = function() {
  4941. if (this.source) {
  4942. return this.source.trimmed().contents;
  4943. }
  4944. return '[' + this.constructor.name + ']';
  4945. };
  4946. pexprs.any.toDisplayString =
  4947. pexprs.end.toDisplayString =
  4948. pexprs.Iter.prototype.toDisplayString =
  4949. pexprs.Not.prototype.toDisplayString =
  4950. pexprs.Lookahead.prototype.toDisplayString =
  4951. pexprs.Lex.prototype.toDisplayString =
  4952. pexprs.Terminal.prototype.toDisplayString =
  4953. pexprs.Range.prototype.toDisplayString =
  4954. pexprs.Param.prototype.toDisplayString = function() {
  4955. return this.toString();
  4956. };
  4957. pexprs.Apply.prototype.toDisplayString = function() {
  4958. if (this.args.length > 0) {
  4959. var ps = this.args.map(function(arg) { return arg.toDisplayString(); });
  4960. return this.ruleName + '<' + ps.join(',') + '>';
  4961. } else {
  4962. return this.ruleName;
  4963. }
  4964. };
  4965. pexprs.UnicodeChar.prototype.toDisplayString = function() {
  4966. return 'Unicode [' + this.category + '] character';
  4967. };
  4968. },{"./common":24,"./pexprs":44}],42:[function(require,module,exports){
  4969. 'use strict';
  4970. // --------------------------------------------------------------------
  4971. // Imports
  4972. // --------------------------------------------------------------------
  4973. var Failure = require('./Failure');
  4974. var common = require('./common');
  4975. var pexprs = require('./pexprs');
  4976. // --------------------------------------------------------------------
  4977. // Operations
  4978. // --------------------------------------------------------------------
  4979. pexprs.PExpr.prototype.toFailure = common.abstract('toFailure');
  4980. pexprs.any.toFailure = function(grammar) {
  4981. return new Failure(this, 'any object', 'description');
  4982. };
  4983. pexprs.end.toFailure = function(grammar) {
  4984. return new Failure(this, 'end of input', 'description');
  4985. };
  4986. pexprs.Terminal.prototype.toFailure = function(grammar) {
  4987. return new Failure(this, this.obj, 'string');
  4988. };
  4989. pexprs.Range.prototype.toFailure = function(grammar) {
  4990. // TODO: come up with something better
  4991. return new Failure(this, JSON.stringify(this.from) + '..' + JSON.stringify(this.to), 'code');
  4992. };
  4993. pexprs.Not.prototype.toFailure = function(grammar) {
  4994. var description = this.expr === pexprs.any ?
  4995. 'nothing' :
  4996. 'not ' + this.expr.toFailure(grammar);
  4997. return new Failure(this, description, 'description');
  4998. };
  4999. pexprs.Lookahead.prototype.toFailure = function(grammar) {
  5000. return this.expr.toFailure(grammar);
  5001. };
  5002. pexprs.Apply.prototype.toFailure = function(grammar) {
  5003. var description = grammar.rules[this.ruleName].description;
  5004. if (!description) {
  5005. var article = (/^[aeiouAEIOU]/.test(this.ruleName) ? 'an' : 'a');
  5006. description = article + ' ' + this.ruleName;
  5007. }
  5008. return new Failure(this, description, 'description');
  5009. };
  5010. pexprs.UnicodeChar.prototype.toFailure = function(grammar) {
  5011. return new Failure(this, 'a Unicode [' + this.category + '] character', 'description');
  5012. };
  5013. pexprs.Alt.prototype.toFailure = function(grammar) {
  5014. var fs = this.terms.map(function(t) { return t.toFailure(grammar); });
  5015. var description = '(' + fs.join(' or ') + ')';
  5016. return new Failure(this, description, 'description');
  5017. };
  5018. pexprs.Seq.prototype.toFailure = function(grammar) {
  5019. var fs = this.factors.map(function(f) { return f.toFailure(grammar); });
  5020. var description = '(' + fs.join(' ') + ')';
  5021. return new Failure(this, description, 'description');
  5022. };
  5023. pexprs.Iter.prototype.toFailure = function(grammar) {
  5024. var description = '(' + this.expr.toFailure(grammar) + this.operator + ')';
  5025. return new Failure(this, description, 'description');
  5026. };
  5027. },{"./Failure":12,"./common":24,"./pexprs":44}],43:[function(require,module,exports){
  5028. 'use strict';
  5029. // --------------------------------------------------------------------
  5030. // Imports
  5031. // --------------------------------------------------------------------
  5032. var common = require('./common');
  5033. var pexprs = require('./pexprs');
  5034. // --------------------------------------------------------------------
  5035. // Operations
  5036. // --------------------------------------------------------------------
  5037. /*
  5038. e1.toString() === e2.toString() ==> e1 and e2 are semantically equivalent.
  5039. Note that this is not an iff (<==>): e.g.,
  5040. (~"b" "a").toString() !== ("a").toString(), even though
  5041. ~"b" "a" and "a" are interchangeable in any grammar,
  5042. both in terms of the languages they accept and their arities.
  5043. */
  5044. pexprs.PExpr.prototype.toString = common.abstract('toString');
  5045. pexprs.any.toString = function() {
  5046. return 'any';
  5047. };
  5048. pexprs.end.toString = function() {
  5049. return 'end';
  5050. };
  5051. pexprs.Terminal.prototype.toString = function() {
  5052. return JSON.stringify(this.obj);
  5053. };
  5054. pexprs.Range.prototype.toString = function() {
  5055. return JSON.stringify(this.from) + '..' + JSON.stringify(this.to);
  5056. };
  5057. pexprs.Param.prototype.toString = function() {
  5058. return '$' + this.index;
  5059. };
  5060. pexprs.Lex.prototype.toString = function() {
  5061. return '#(' + this.expr.toString() + ')';
  5062. };
  5063. pexprs.Alt.prototype.toString = function() {
  5064. return this.terms.length === 1 ?
  5065. this.terms[0].toString() :
  5066. '(' + this.terms.map(function(term) { return term.toString(); }).join(' | ') + ')';
  5067. };
  5068. pexprs.Seq.prototype.toString = function() {
  5069. return this.factors.length === 1 ?
  5070. this.factors[0].toString() :
  5071. '(' + this.factors.map(function(factor) { return factor.toString(); }).join(' ') + ')';
  5072. };
  5073. pexprs.Iter.prototype.toString = function() {
  5074. return this.expr + this.operator;
  5075. };
  5076. pexprs.Not.prototype.toString = function() {
  5077. return '~' + this.expr;
  5078. };
  5079. pexprs.Lookahead.prototype.toString = function() {
  5080. return '&' + this.expr;
  5081. };
  5082. pexprs.Apply.prototype.toString = function() {
  5083. if (this.args.length > 0) {
  5084. var ps = this.args.map(function(arg) { return arg.toString(); });
  5085. return this.ruleName + '<' + ps.join(',') + '>';
  5086. } else {
  5087. return this.ruleName;
  5088. }
  5089. };
  5090. pexprs.UnicodeChar.prototype.toString = function() {
  5091. return '\\p{' + this.category + '}';
  5092. };
  5093. },{"./common":24,"./pexprs":44}],44:[function(require,module,exports){
  5094. 'use strict';
  5095. // --------------------------------------------------------------------
  5096. // Imports
  5097. // --------------------------------------------------------------------
  5098. var UnicodeCategories = require('../third_party/UnicodeCategories');
  5099. var common = require('./common');
  5100. var inherits = require('inherits');
  5101. // --------------------------------------------------------------------
  5102. // Private stuff
  5103. // --------------------------------------------------------------------
  5104. // General stuff
  5105. function PExpr() {
  5106. throw new Error("PExpr cannot be instantiated -- it's abstract");
  5107. }
  5108. // Set the `source` property to the interval containing the source for this expression.
  5109. PExpr.prototype.withSource = function(interval) {
  5110. if (interval) {
  5111. this.source = interval.trimmed();
  5112. }
  5113. return this;
  5114. };
  5115. // Any
  5116. var any = Object.create(PExpr.prototype);
  5117. // End
  5118. var end = Object.create(PExpr.prototype);
  5119. // Terminals
  5120. function Terminal(obj) {
  5121. this.obj = obj;
  5122. }
  5123. inherits(Terminal, PExpr);
  5124. // Ranges
  5125. function Range(from, to) {
  5126. this.from = from;
  5127. this.to = to;
  5128. }
  5129. inherits(Range, PExpr);
  5130. // Parameters
  5131. function Param(index) {
  5132. this.index = index;
  5133. }
  5134. inherits(Param, PExpr);
  5135. // Alternation
  5136. function Alt(terms) {
  5137. this.terms = terms;
  5138. }
  5139. inherits(Alt, PExpr);
  5140. // Extend is an implementation detail of rule extension
  5141. function Extend(superGrammar, name, body) {
  5142. this.superGrammar = superGrammar;
  5143. this.name = name;
  5144. this.body = body;
  5145. var origBody = superGrammar.rules[name].body;
  5146. this.terms = [body, origBody];
  5147. }
  5148. inherits(Extend, Alt);
  5149. // Sequences
  5150. function Seq(factors) {
  5151. this.factors = factors;
  5152. }
  5153. inherits(Seq, PExpr);
  5154. // Iterators and optionals
  5155. function Iter(expr) {
  5156. this.expr = expr;
  5157. }
  5158. inherits(Iter, PExpr);
  5159. function Star(expr) {
  5160. this.expr = expr;
  5161. }
  5162. inherits(Star, Iter);
  5163. function Plus(expr) {
  5164. this.expr = expr;
  5165. }
  5166. inherits(Plus, Iter);
  5167. function Opt(expr) {
  5168. this.expr = expr;
  5169. }
  5170. inherits(Opt, Iter);
  5171. Star.prototype.operator = '*';
  5172. Plus.prototype.operator = '+';
  5173. Opt.prototype.operator = '?';
  5174. Star.prototype.minNumMatches = 0;
  5175. Plus.prototype.minNumMatches = 1;
  5176. Opt.prototype.minNumMatches = 0;
  5177. Star.prototype.maxNumMatches = Number.POSITIVE_INFINITY;
  5178. Plus.prototype.maxNumMatches = Number.POSITIVE_INFINITY;
  5179. Opt.prototype.maxNumMatches = 1;
  5180. // Predicates
  5181. function Not(expr) {
  5182. this.expr = expr;
  5183. }
  5184. inherits(Not, PExpr);
  5185. function Lookahead(expr) {
  5186. this.expr = expr;
  5187. }
  5188. inherits(Lookahead, PExpr);
  5189. // "Lexification"
  5190. function Lex(expr) {
  5191. this.expr = expr;
  5192. }
  5193. inherits(Lex, PExpr);
  5194. // Rule application
  5195. function Apply(ruleName, optArgs) {
  5196. this.ruleName = ruleName;
  5197. this.args = optArgs || [];
  5198. }
  5199. inherits(Apply, PExpr);
  5200. Apply.prototype.isSyntactic = function() {
  5201. return common.isSyntactic(this.ruleName);
  5202. };
  5203. // This method just caches the result of `this.toString()` in a non-enumerable property.
  5204. Apply.prototype.toMemoKey = function() {
  5205. if (!this._memoKey) {
  5206. Object.defineProperty(this, '_memoKey', {value: this.toString()});
  5207. }
  5208. return this._memoKey;
  5209. };
  5210. // Unicode character
  5211. function UnicodeChar(category) {
  5212. this.category = category;
  5213. this.pattern = UnicodeCategories[category];
  5214. }
  5215. inherits(UnicodeChar, PExpr);
  5216. // --------------------------------------------------------------------
  5217. // Exports
  5218. // --------------------------------------------------------------------
  5219. exports.PExpr = PExpr;
  5220. exports.any = any;
  5221. exports.end = end;
  5222. exports.Terminal = Terminal;
  5223. exports.Range = Range;
  5224. exports.Param = Param;
  5225. exports.Alt = Alt;
  5226. exports.Extend = Extend;
  5227. exports.Seq = Seq;
  5228. exports.Iter = Iter;
  5229. exports.Star = Star;
  5230. exports.Plus = Plus;
  5231. exports.Opt = Opt;
  5232. exports.Not = Not;
  5233. exports.Lookahead = Lookahead;
  5234. exports.Lex = Lex;
  5235. exports.Apply = Apply;
  5236. exports.UnicodeChar = UnicodeChar;
  5237. // --------------------------------------------------------------------
  5238. // Extensions
  5239. // --------------------------------------------------------------------
  5240. require('./pexprs-allowsSkippingPrecedingSpace');
  5241. require('./pexprs-assertAllApplicationsAreValid');
  5242. require('./pexprs-assertChoicesHaveUniformArity');
  5243. require('./pexprs-assertIteratedExprsAreNotNullable');
  5244. require('./pexprs-check');
  5245. require('./pexprs-eval');
  5246. require('./pexprs-getArity');
  5247. require('./pexprs-generateExample');
  5248. require('./pexprs-outputRecipe');
  5249. require('./pexprs-introduceParams');
  5250. require('./pexprs-isNullable');
  5251. require('./pexprs-substituteParams');
  5252. require('./pexprs-toDisplayString');
  5253. require('./pexprs-toArgumentNameList');
  5254. require('./pexprs-toFailure');
  5255. require('./pexprs-toString');
  5256. },{"../third_party/UnicodeCategories":47,"./common":24,"./pexprs-allowsSkippingPrecedingSpace":28,"./pexprs-assertAllApplicationsAreValid":29,"./pexprs-assertChoicesHaveUniformArity":30,"./pexprs-assertIteratedExprsAreNotNullable":31,"./pexprs-check":32,"./pexprs-eval":33,"./pexprs-generateExample":34,"./pexprs-getArity":35,"./pexprs-introduceParams":36,"./pexprs-isNullable":37,"./pexprs-outputRecipe":38,"./pexprs-substituteParams":39,"./pexprs-toArgumentNameList":40,"./pexprs-toDisplayString":41,"./pexprs-toFailure":42,"./pexprs-toString":43,"inherits":1}],45:[function(require,module,exports){
  5257. 'use strict';
  5258. // --------------------------------------------------------------------
  5259. // Imports
  5260. // --------------------------------------------------------------------
  5261. var common = require('./common');
  5262. // --------------------------------------------------------------------
  5263. // Private stuff
  5264. // --------------------------------------------------------------------
  5265. // Given an array of numbers `arr`, return an array of the numbers as strings,
  5266. // right-justified and padded to the same length.
  5267. function padNumbersToEqualLength(arr) {
  5268. var maxLen = 0;
  5269. var strings = arr.map(function(n) {
  5270. var str = n.toString();
  5271. maxLen = Math.max(maxLen, str.length);
  5272. return str;
  5273. });
  5274. return strings.map(function(s) { return common.padLeft(s, maxLen); });
  5275. }
  5276. // Produce a new string that would be the result of copying the contents
  5277. // of the string `src` onto `dest` at offset `offest`.
  5278. function strcpy(dest, src, offset) {
  5279. var origDestLen = dest.length;
  5280. var start = dest.slice(0, offset);
  5281. var end = dest.slice(offset + src.length);
  5282. return (start + src + end).substr(0, origDestLen);
  5283. }
  5284. // --------------------------------------------------------------------
  5285. // Exports
  5286. // --------------------------------------------------------------------
  5287. var builtInRulesCallbacks = [];
  5288. // Since Grammar.BuiltInRules is bootstrapped, most of Ohm can't directly depend it.
  5289. // This function allows modules that do depend on the built-in rules to register a callback
  5290. // that will be called later in the initialization process.
  5291. exports.awaitBuiltInRules = function(cb) {
  5292. builtInRulesCallbacks.push(cb);
  5293. };
  5294. exports.announceBuiltInRules = function(grammar) {
  5295. builtInRulesCallbacks.forEach(function(cb) {
  5296. cb(grammar);
  5297. });
  5298. builtInRulesCallbacks = null;
  5299. };
  5300. // Return an object with the line and column information for the given
  5301. // offset in `str`.
  5302. exports.getLineAndColumn = function(str, offset) {
  5303. var lineNum = 1;
  5304. var colNum = 1;
  5305. var currOffset = 0;
  5306. var lineStartOffset = 0;
  5307. var nextLine = null;
  5308. var prevLine = null;
  5309. var prevLineStartOffset = -1;
  5310. while (currOffset < offset) {
  5311. var c = str.charAt(currOffset++);
  5312. if (c === '\n') {
  5313. lineNum++;
  5314. colNum = 1;
  5315. prevLineStartOffset = lineStartOffset;
  5316. lineStartOffset = currOffset;
  5317. } else if (c !== '\r') {
  5318. colNum++;
  5319. }
  5320. }
  5321. // Find the end of the target line.
  5322. var lineEndOffset = str.indexOf('\n', lineStartOffset);
  5323. if (lineEndOffset === -1) {
  5324. lineEndOffset = str.length;
  5325. } else {
  5326. // Get the next line.
  5327. var nextLineEndOffset = str.indexOf('\n', lineEndOffset + 1);
  5328. nextLine = nextLineEndOffset === -1 ? str.slice(lineEndOffset)
  5329. : str.slice(lineEndOffset, nextLineEndOffset);
  5330. // Strip leading and trailing EOL char(s).
  5331. nextLine = nextLine.replace(/^\r?\n/, '').replace(/\r$/, '');
  5332. }
  5333. // Get the previous line.
  5334. if (prevLineStartOffset >= 0) {
  5335. prevLine = str.slice(prevLineStartOffset, lineStartOffset)
  5336. .replace(/\r?\n$/, ''); // Strip trailing EOL char(s).
  5337. }
  5338. // Get the target line, stripping a trailing carriage return if necessary.
  5339. var line = str.slice(lineStartOffset, lineEndOffset).replace(/\r$/, '');
  5340. return {
  5341. lineNum: lineNum,
  5342. colNum: colNum,
  5343. line: line,
  5344. prevLine: prevLine,
  5345. nextLine: nextLine
  5346. };
  5347. };
  5348. // Return a nicely-formatted string describing the line and column for the
  5349. // given offset in `str`.
  5350. exports.getLineAndColumnMessage = function(str, offset /* ...ranges */) {
  5351. var repeatStr = common.repeatStr;
  5352. var lineAndCol = exports.getLineAndColumn(str, offset);
  5353. var sb = new common.StringBuffer();
  5354. sb.append('Line ' + lineAndCol.lineNum + ', col ' + lineAndCol.colNum + ':\n');
  5355. // An array of the previous, current, and next line numbers as strings of equal length.
  5356. var lineNumbers = padNumbersToEqualLength([
  5357. lineAndCol.prevLine == null ? 0 : lineAndCol.lineNum - 1,
  5358. lineAndCol.lineNum,
  5359. lineAndCol.nextLine == null ? 0 : lineAndCol.lineNum + 1
  5360. ]);
  5361. // Helper for appending formatting input lines to the buffer.
  5362. function appendLine(num, content, prefix) {
  5363. sb.append(prefix + lineNumbers[num] + ' | ' + content + '\n');
  5364. }
  5365. // Include the previous line for context if possible.
  5366. if (lineAndCol.prevLine != null) {
  5367. appendLine(0, lineAndCol.prevLine, ' ');
  5368. }
  5369. // Line that the error occurred on.
  5370. appendLine(1, lineAndCol.line, '> ');
  5371. // Build up the line that points to the offset and possible indicates one or more ranges.
  5372. // Start with a blank line, and indicate each range by overlaying a string of `~` chars.
  5373. var lineLen = lineAndCol.line.length;
  5374. var indicationLine = repeatStr(' ', lineLen + 1);
  5375. var ranges = Array.prototype.slice.call(arguments, 2);
  5376. for (var i = 0; i < ranges.length; ++i) {
  5377. var startIdx = ranges[i][0];
  5378. var endIdx = ranges[i][1];
  5379. common.assert(startIdx >= 0 && startIdx <= endIdx, 'range start must be >= 0 and <= end');
  5380. var lineStartOffset = offset - lineAndCol.colNum + 1;
  5381. startIdx = Math.max(0, startIdx - lineStartOffset);
  5382. endIdx = Math.min(endIdx - lineStartOffset, lineLen);
  5383. indicationLine = strcpy(indicationLine, repeatStr('~', endIdx - startIdx), startIdx);
  5384. }
  5385. var gutterWidth = 2 + lineNumbers[1].length + 3;
  5386. sb.append(repeatStr(' ', gutterWidth));
  5387. indicationLine = strcpy(indicationLine, '^', lineAndCol.colNum - 1);
  5388. sb.append(indicationLine.replace(/ +$/, '') + '\n');
  5389. // Include the next line for context if possible.
  5390. if (lineAndCol.nextLine != null) {
  5391. appendLine(2, lineAndCol.nextLine, ' ');
  5392. }
  5393. return sb.contents();
  5394. };
  5395. exports.uniqueId = (function() {
  5396. var idCounter = 0;
  5397. return function(prefix) {
  5398. return '' + prefix + idCounter++;
  5399. };
  5400. })();
  5401. },{"./common":24}],46:[function(require,module,exports){
  5402. (function (browserifyGlobalOhmVersion){
  5403. /* global browserifyGlobalOhmVersion */
  5404. 'use strict';
  5405. // When running under Node, read the version from package.json. For the browser,
  5406. // use a special global variable defined in the build process (see bin/build-debug.js).
  5407. module.exports = typeof browserifyGlobalOhmVersion === 'string'
  5408. ? browserifyGlobalOhmVersion
  5409. : require('../package.json').version;
  5410. }).call(this,"15.0.1")
  5411. },{"../package.json":undefined}],47:[function(require,module,exports){
  5412. // Based on https://github.com/mathiasbynens/unicode-9.0.0.
  5413. // These are just categories that are used in ES5/ES2015.
  5414. // The full list of Unicode categories is here: http://www.fileformat.info/info/unicode/category/index.htm.
  5415. module.exports = {
  5416. // Letters
  5417. Lu: /[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A]|\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]/,
  5418. Ll: /[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u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\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]|\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43]/,
  5419. Lt: /[\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC]/,
  5420. Lm: /[\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F]|\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0]/,
  5421. Lo: /[\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05F0-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\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-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10D0-\u10FA\u10FD-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,
  5422. // Numbers
  5423. Nl: /[\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF]|\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]|\uD809[\uDC00-\uDC6E]/,
  5424. Nd: /[0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD801[\uDCA0-\uDCA9]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|[\uD805\uD807][\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDD50-\uDD59]/,
  5425. // Marks
  5426. Mn: /[\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D01\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDCA-\uDDCC\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF]/,
  5427. Mc: /[\u0903-\u0903]|[\u093E-\u0940]|[\u0949-\u094C]|[\u0982-\u0983]|[\u09BE-\u09C0]|[\u09C7-\u09C8]|[\u09CB-\u09CC]|[\u09D7-\u09D7]|[\u0A3E-\u0A40]|[\u0A83-\u0A83]|[\u0ABE-\u0AC0]|[\u0AC9-\u0AC9]|[\u0ACB-\u0ACC]|[\u0B02-\u0B03]|[\u0B3E-\u0B3E]|[\u0B40-\u0B40]|[\u0B47-\u0B48]|[\u0B4B-\u0B4C]|[\u0B57-\u0B57]|[\u0B83-\u0B83]|[\u0BBE-\u0BBF]|[\u0BC1-\u0BC2]|[\u0BC6-\u0BC8]|[\u0BCA-\u0BCC]|[\u0BD7-\u0BD7]|[\u0C01-\u0C03]|[\u0C41-\u0C44]|[\u0C82-\u0C83]|[\u0CBE-\u0CBE]|[\u0CC0-\u0CC4]|[\u0CC7-\u0CC8]|[\u0CCA-\u0CCB]|[\u0CD5-\u0CD6]|[\u0D02-\u0D03]|[\u0D3E-\u0D40]|[\u0D46-\u0D48]|[\u0D4A-\u0D4C]|[\u0D57-\u0D57]|[\u0F3E-\u0F3F]|[\u0F7F-\u0F7F]/,
  5428. // Punctuation, Connector
  5429. Pc: /[_\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F]/,
  5430. // Separator, Space
  5431. Zs: /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,
  5432. // These two are not real Unicode categories, but our useful for Ohm.
  5433. // L is a combination of all the letter categories.
  5434. // Ltmo is a combination of Lt, Lm, and Lo.
  5435. L: /[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,
  5436. Ltmo: /[\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC]|[\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F]|\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F\uDFE0]|[\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05F0-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10D0-\u10FA\u10FD-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/
  5437. };
  5438. },{}]},{},[26])(26)
  5439. });
  5440. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCIuLi9ub2RlX21vZHVsZXMvaW5oZXJpdHMvaW5oZXJpdHNfYnJvd3Nlci5qcyIsIi4uL25vZGVfbW9kdWxlcy91dGlsLWV4dGVuZC9leHRlbmQuanMiLCJkaXN0L2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IG5hbWVcXG5cXG4gIHRlcm1pbmFsXFxuICAgID0gXFxcIlxcXFxcXFwiXFxcIiB0ZXJtaW5hbENoYXIqIFxcXCJcXFxcXFxcIlxcXCJcXG5cXG4gIG9uZUNoYXJUZXJtaW5hbFxcbiAgICA9IFxcXCJcXFxcXFxcIlxcXCIgdGVybWluYWxDaGFyIFxcXCJcXFxcXFxcIlxcXCJcXG5cXG4gIHRlcm1pbmFsQ2hhclxcbiAgICA9IGVzY2FwZUNoYXJcXG4gICAgfCB+XFxcIlxcXFxcXFxcXFxcIiB+XFxcIlxcXFxcXFwiXFxcIiB+XFxcIlxcXFxuXFxcIiBhbnlcXG5cXG4gIGVzY2FwZUNoYXIgIChhbiBlc2NhcGUgc2VxdWVuY2UpXFxuICAgID0gXFxcIlxcXFxcXFxcXFxcXFxcXFxcXFwiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0tIGJhY2tzbGFzaFxcbiAgICB8IFxcXCJcXFxcXFxcXFxcXFxcXFwiXFxcIiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtLSBkb3VibGVRdW90ZVxcbiAgICB8IFxcXCJcXFxcXFxcXFxcXFwnXFxcIiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtLSBzaW5nbGVRdW90ZVxcbiAgICB8IFxcXCJcXFxcXFxcXGJcXFwiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtLSBiYWNrc3BhY2VcXG4gICAgfCBcXFwiXFxcXFxcXFxuXFxcIiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLS0gbGluZUZlZWRcXG4gICAgfCBcXFwiXFxcXFxcXFxyXFxcIiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLS0gY2FycmlhZ2VSZXR1cm5cXG4gICAgfCBcXFwiXFxcXFxcXFx0XFxcIiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLS0gdGF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REQyMC1cXHVERDM5XFx1REQ4MC1cXHVEREI3XFx1RERCRVxcdUREQkZcXHVERTAwXFx1REUxMC1cXHVERTEzXFx1REUxNS1cXHVERTE3XFx1REUxOS1cXHVERTMzXFx1REU2MC1cXHVERTdDXFx1REU4MC1cXHVERTlDXFx1REVDMC1cXHVERUM3XFx1REVDOS1cXHVERUU0XFx1REYwMC1cXHVERjM1XFx1REY0MC1cXHVERjU1XFx1REY2MC1cXHVERjcyXFx1REY4MC1cXHVERjkxXXxcXHVEODAzW1xcdURDMDAtXFx1REM0OF18XFx1RDgwNFtcXHVEQzAzLVxcdURDMzdcXHVEQzgzLVxcdURDQUZcXHVEQ0QwLVxcdURDRThcXHVERDAzLVxcdUREMjZcXHVERDUwLVxcdURENzJcXHVERDc2XFx1REQ4My1cXHVEREIyXFx1RERDMS1cXHVEREM0XFx1REREQVxcdURERENcXHVERTAwLVxcdURFMTFcXHVERTEzLVxcdURFMkJcXHVERTgwLVxcdURFODZcXHVERTg4XFx1REU4QS1cXHVERThEXFx1REU4Ri1cXHVERTlEXFx1REU5Ri1cXHVERUE4XFx1REVCMC1cXHVERURFXFx1REYwNS1cXHVERjBDXFx1REYwRlxcdURGMTBcXHVERjEzLVxcdURGMjhcXHVERjJBLVxcdURGMzBcXHVERjMyXFx1REYzM1xcdURGMzUtXFx1REYzOVxcdURGM0RcXHVERjUwXFx1REY1RC1cXHVERjYxXXxcXHVEODA1W1xcdURDMDAtXFx1REMzNFxcdURDNDctXFx1REM0QVxcdURDODAtXFx1RENBRlxcdURDQzRcXHVEQ0M1XFx1RENDN1xcdUREODAtXFx1RERBRVxcdURERDgtXFx1REREQlxcdURFMDAtXFx1REUyRlxcdURFNDRcXHVERTgwLVxcdURFQUFcXHVERjAwLVxcdURGMTldfFxcdUQ4MDZbXFx1RENGRlxcdURFQzAtXFx1REVGOF18XFx1RDgwN1tcXHVEQzAwLVxcdURDMDhcXHVEQzBBLVxcdURDMkVcXHVEQzQwXFx1REM3Mi1cXHVE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1xcdURDMzhcXHVEQzNDXFx1REMzRi1cXHVEQzU1XFx1REM2MC1cXHVEQzc2XFx1REM4MC1cXHVEQzlFXFx1RENFMC1cXHVEQ0YyXFx1RENGNFxcdURDRjVcXHVERDAwLVxcdUREMTVcXHVERDIwLVxcdUREMzlcXHVERDgwLVxcdUREQjdcXHVEREJFXFx1RERCRlxcdURFMDBcXHVERTEwLVxcdURFMTNcXHVERTE1LVxcdURFMTdcXHVERTE5LVxcdURFMzNcXHVERTYwLVxcdURFN0NcXHVERTgwLVxcdURFOUNcXHVERUMwLVxcdURFQzdcXHVERUM5LVxcdURFRTRcXHVERjAwLVxcdURGMzVcXHVERjQwLVxcdURGNTVcXHVERjYwLVxcdURGNzJcXHVERjgwLVxcdURGOTFdfFxcdUQ4MDNbXFx1REMwMC1cXHVEQzQ4XXxcXHVEODA0W1xcdURDMDMtXFx1REMzN1xcdURDODMtXFx1RENBRlxcdURDRDAtXFx1RENFOFxcdUREMDMtXFx1REQyNlxcdURENTAtXFx1REQ3MlxcdURENzZcXHVERDgzLVxcdUREQjJcXHVEREMxLVxcdUREQzRcXHVERERBXFx1REREQ1xcdURFMDAtXFx1REUxMVxcdURFMTMtXFx1REUyQlxcdURFODAtXFx1REU4NlxcdURFODhcXHVERThBLVxcdURFOERcXHVERThGLVxcdURFOURcXHVERTlGLVxcdURFQThcXHVERUIwLVxcdURFREVcXHVERjA1LVxcdURGMENcXHVERjBGXFx1REYxMFxcdURGMTMtXFx1REYyOFxcdURGMkEtXFx1REYzMFxcdURGMzJcXHVERjMzXFx1REYzNS1cXHVERjM5XFx1REYzRFxcdURGNTBcXHVERjVELVxcdURGNjFdfFxcdUQ4MDVbXFx1REMwMC1cXHVEQzM0XFx1REM0Ny1cXHVEQzRBXFx1REM4MC1cXHVEQ0FGXFx1RENDNFxcdURDQzVcXHVEQ0M3XFx1REQ4MC1cXHVEREFFXFx1REREOC1cXHVERERCXFx1REUwMC1cXHVERTJGXFx1REU0NFxcdURFODAtXFx1REV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