123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786 |
- /*! @author Toru Nagashima <https://github.com/mysticatea> */
- var ast = Object.freeze({
- });
- function assert(condition, message) {
- if (!condition) {
- throw new Error(message || "AssertionError");
- }
- }
- function last(xs) {
- return xs.length === 0 ? undefined : xs[xs.length - 1];
- }
- const legacyImpl = {
- at(s, end, i) {
- return i < end ? s.charCodeAt(i) : -1;
- },
- width(c) {
- return 1;
- },
- };
- const unicodeImpl = {
- at(s, end, i) {
- return i < end ? s.codePointAt(i) : -1;
- },
- width(c) {
- return c > 0xffff ? 2 : 1;
- },
- };
- class Reader {
- constructor() {
- this._impl = legacyImpl;
- this._s = "";
- this._i = 0;
- this._end = 0;
- this._cp1 = -1;
- this._w1 = 1;
- this._cp2 = -1;
- this._w2 = 1;
- this._cp3 = -1;
- this._w3 = 1;
- this._cp4 = -1;
- }
- get source() {
- return this._s;
- }
- get index() {
- return this._i;
- }
- get currentCodePoint() {
- return this._cp1;
- }
- get nextCodePoint() {
- return this._cp2;
- }
- get nextCodePoint2() {
- return this._cp3;
- }
- get nextCodePoint3() {
- return this._cp4;
- }
- reset(source, start, end, uFlag) {
- this._impl = uFlag ? unicodeImpl : legacyImpl;
- this._s = source;
- this._end = end;
- this.rewind(start);
- }
- rewind(index) {
- const impl = this._impl;
- this._i = index;
- this._cp1 = impl.at(this._s, this._end, index);
- this._w1 = impl.width(this._cp1);
- this._cp2 = impl.at(this._s, this._end, index + this._w1);
- this._w2 = impl.width(this._cp2);
- this._cp3 = impl.at(this._s, this._end, index + this._w1 + this._w2);
- this._w3 = impl.width(this._cp3);
- this._cp4 = impl.at(this._s, this._end, index + this._w1 + this._w2 + this._w3);
- }
- advance() {
- if (this._cp1 !== -1) {
- const impl = this._impl;
- this._i += this._w1;
- this._cp1 = this._cp2;
- this._w1 = this._w2;
- this._cp2 = this._cp3;
- this._w2 = impl.width(this._cp2);
- this._cp3 = this._cp4;
- this._w3 = impl.width(this._cp3);
- this._cp4 = impl.at(this._s, this._end, this._i + this._w1 + this._w2 + this._w3);
- }
- }
- eat(cp) {
- if (this._cp1 === cp) {
- this.advance();
- return true;
- }
- return false;
- }
- eat2(cp1, cp2) {
- if (this._cp1 === cp1 && this._cp2 === cp2) {
- this.advance();
- this.advance();
- return true;
- }
- return false;
- }
- eat3(cp1, cp2, cp3) {
- if (this._cp1 === cp1 && this._cp2 === cp2 && this._cp3 === cp3) {
- this.advance();
- this.advance();
- this.advance();
- return true;
- }
- return false;
- }
- }
- class RegExpSyntaxError extends SyntaxError {
- constructor(source, uFlag, index, message) {
- if (source) {
- if (source[0] !== "/") {
- source = `/${source}/${uFlag ? "u" : ""}`;
- }
- source = `: ${source}`;
- }
- super(`Invalid regular expression${source}: ${message}`);
- this.index = index;
- }
- }
- function isIdStart(cp) {
- if (cp < 0x41)
- return false;
- if (cp < 0x5b)
- return true;
- if (cp < 0x61)
- return false;
- if (cp < 0x7b)
- return true;
- return isLargeIdStart(cp);
- }
- function isIdContinue(cp) {
- if (cp < 0x30)
- return false;
- if (cp < 0x3a)
- return true;
- if (cp < 0x41)
- return false;
- if (cp < 0x5b)
- return true;
- if (cp === 0x5f)
- return true;
- if (cp < 0x61)
- return false;
- if (cp < 0x7b)
- return true;
- return isLargeIdStart(cp) || isLargeIdContinue(cp);
- }
- function isLargeIdStart(cp) {
- if (cp < 0x303c) {
- if (cp < 0xeaa) {
- if (cp < 0xa2a) {
- if (cp < 0x6d5) {
- if (cp < 0x37a) {
- if (cp < 0x294) {
- if (cp < 0xf8) {
- if (cp === 0xaa)
- return true;
- if (cp === 0xb5)
- return true;
- if (cp === 0xba)
- return true;
- if (cp < 0xc0)
- return false;
- if (cp < 0xd7)
- return true;
- if (cp < 0xd8)
- return false;
- if (cp < 0xf7)
- return true;
- return false;
- }
- if (cp < 0x1bb)
- return true;
- if (cp === 0x1bb)
- return true;
- if (cp < 0x1bc)
- return false;
- if (cp < 0x1c0)
- return true;
- if (cp < 0x1c0)
- return false;
- if (cp < 0x1c4)
- return true;
- if (cp < 0x1c4)
- return false;
- if (cp < 0x294)
- return true;
- return false;
- }
- if (cp < 0x2ec) {
- if (cp === 0x294)
- return true;
- if (cp < 0x295)
- return false;
- if (cp < 0x2b0)
- return true;
- if (cp < 0x2b0)
- return false;
- if (cp < 0x2c2)
- return true;
- if (cp < 0x2c6)
- return false;
- if (cp < 0x2d2)
- return true;
- if (cp < 0x2e0)
- return false;
- if (cp < 0x2e5)
- return true;
- return false;
- }
- if (cp === 0x2ec)
- return true;
- if (cp === 0x2ee)
- return true;
- if (cp < 0x370)
- return false;
- if (cp < 0x374)
- return true;
- if (cp === 0x374)
- return true;
- if (cp < 0x376)
- return false;
- if (cp < 0x378)
- return true;
- return false;
- }
- if (cp < 0x531) {
- if (cp < 0x38c) {
- if (cp === 0x37a)
- return true;
- if (cp < 0x37b)
- return false;
- if (cp < 0x37e)
- return true;
- if (cp === 0x37f)
- return true;
- if (cp === 0x386)
- return true;
- if (cp < 0x388)
- return false;
- if (cp < 0x38b)
- return true;
- return false;
- }
- if (cp === 0x38c)
- return true;
- if (cp < 0x38e)
- return false;
- if (cp < 0x3a2)
- return true;
- if (cp < 0x3a3)
- return false;
- if (cp < 0x3f6)
- return true;
- if (cp < 0x3f7)
- return false;
- if (cp < 0x482)
- return true;
- if (cp < 0x48a)
- return false;
- if (cp < 0x530)
- return true;
- return false;
- }
- if (cp < 0x620) {
- if (cp < 0x531)
- return false;
- if (cp < 0x557)
- return true;
- if (cp === 0x559)
- return true;
- if (cp < 0x561)
- return false;
- if (cp < 0x588)
- return true;
- if (cp < 0x5d0)
- return false;
- if (cp < 0x5eb)
- return true;
- if (cp < 0x5f0)
- return false;
- if (cp < 0x5f3)
- return true;
- return false;
- }
- if (cp < 0x640)
- return true;
- if (cp === 0x640)
- return true;
- if (cp < 0x641)
- return false;
- if (cp < 0x64b)
- return true;
- if (cp < 0x66e)
- return false;
- if (cp < 0x670)
- return true;
- if (cp < 0x671)
- return false;
- if (cp < 0x6d4)
- return true;
- return false;
- }
- if (cp < 0x904) {
- if (cp < 0x7f4) {
- if (cp < 0x710) {
- if (cp === 0x6d5)
- return true;
- if (cp < 0x6e5)
- return false;
- if (cp < 0x6e7)
- return true;
- if (cp < 0x6ee)
- return false;
- if (cp < 0x6f0)
- return true;
- if (cp < 0x6fa)
- return false;
- if (cp < 0x6fd)
- return true;
- if (cp === 0x6ff)
- return true;
- return false;
- }
- if (cp === 0x710)
- return true;
- if (cp < 0x712)
- return false;
- if (cp < 0x730)
- return true;
- if (cp < 0x74d)
- return false;
- if (cp < 0x7a6)
- return true;
- if (cp === 0x7b1)
- return true;
- if (cp < 0x7ca)
- return false;
- if (cp < 0x7eb)
- return true;
- return false;
- }
- if (cp < 0x828) {
- if (cp < 0x7f4)
- return false;
- if (cp < 0x7f6)
- return true;
- if (cp === 0x7fa)
- return true;
- if (cp < 0x800)
- return false;
- if (cp < 0x816)
- return true;
- if (cp === 0x81a)
- return true;
- if (cp === 0x824)
- return true;
- return false;
- }
- if (cp === 0x828)
- return true;
- if (cp < 0x840)
- return false;
- if (cp < 0x859)
- return true;
- if (cp < 0x860)
- return false;
- if (cp < 0x86b)
- return true;
- if (cp < 0x8a0)
- return false;
- if (cp < 0x8b5)
- return true;
- if (cp < 0x8b6)
- return false;
- if (cp < 0x8be)
- return true;
- return false;
- }
- if (cp < 0x9b2) {
- if (cp < 0x972) {
- if (cp < 0x904)
- return false;
- if (cp < 0x93a)
- return true;
- if (cp === 0x93d)
- return true;
- if (cp === 0x950)
- return true;
- if (cp < 0x958)
- return false;
- if (cp < 0x962)
- return true;
- if (cp === 0x971)
- return true;
- return false;
- }
- if (cp < 0x981)
- return true;
- if (cp < 0x985)
- return false;
- if (cp < 0x98d)
- return true;
- if (cp < 0x98f)
- return false;
- if (cp < 0x991)
- return true;
- if (cp < 0x993)
- return false;
- if (cp < 0x9a9)
- return true;
- if (cp < 0x9aa)
- return false;
- if (cp < 0x9b1)
- return true;
- return false;
- }
- if (cp < 0x9df) {
- if (cp === 0x9b2)
- return true;
- if (cp < 0x9b6)
- return false;
- if (cp < 0x9ba)
- return true;
- if (cp === 0x9bd)
- return true;
- if (cp === 0x9ce)
- return true;
- if (cp < 0x9dc)
- return false;
- if (cp < 0x9de)
- return true;
- return false;
- }
- if (cp < 0x9e2)
- return true;
- if (cp < 0x9f0)
- return false;
- if (cp < 0x9f2)
- return true;
- if (cp === 0x9fc)
- return true;
- if (cp < 0xa05)
- return false;
- if (cp < 0xa0b)
- return true;
- if (cp < 0xa0f)
- return false;
- if (cp < 0xa11)
- return true;
- if (cp < 0xa13)
- return false;
- if (cp < 0xa29)
- return true;
- return false;
- }
- if (cp < 0xc2a) {
- if (cp < 0xb2a) {
- if (cp < 0xaaa) {
- if (cp < 0xa5e) {
- if (cp < 0xa2a)
- return false;
- if (cp < 0xa31)
- return true;
- if (cp < 0xa32)
- return false;
- if (cp < 0xa34)
- return true;
- if (cp < 0xa35)
- return false;
- if (cp < 0xa37)
- return true;
- if (cp < 0xa38)
- return false;
- if (cp < 0xa3a)
- return true;
- if (cp < 0xa59)
- return false;
- if (cp < 0xa5d)
- return true;
- return false;
- }
- if (cp === 0xa5e)
- return true;
- if (cp < 0xa72)
- return false;
- if (cp < 0xa75)
- return true;
- if (cp < 0xa85)
- return false;
- if (cp < 0xa8e)
- return true;
- if (cp < 0xa8f)
- return false;
- if (cp < 0xa92)
- return true;
- if (cp < 0xa93)
- return false;
- if (cp < 0xaa9)
- return true;
- return false;
- }
- if (cp < 0xae0) {
- if (cp < 0xaaa)
- return false;
- if (cp < 0xab1)
- return true;
- if (cp < 0xab2)
- return false;
- if (cp < 0xab4)
- return true;
- if (cp < 0xab5)
- return false;
- if (cp < 0xaba)
- return true;
- if (cp === 0xabd)
- return true;
- if (cp === 0xad0)
- return true;
- return false;
- }
- if (cp < 0xae2)
- return true;
- if (cp === 0xaf9)
- return true;
- if (cp < 0xb05)
- return false;
- if (cp < 0xb0d)
- return true;
- if (cp < 0xb0f)
- return false;
- if (cp < 0xb11)
- return true;
- if (cp < 0xb13)
- return false;
- if (cp < 0xb29)
- return true;
- return false;
- }
- if (cp < 0xb92) {
- if (cp < 0xb5f) {
- if (cp < 0xb2a)
- return false;
- if (cp < 0xb31)
- return true;
- if (cp < 0xb32)
- return false;
- if (cp < 0xb34)
- return true;
- if (cp < 0xb35)
- return false;
- if (cp < 0xb3a)
- return true;
- if (cp === 0xb3d)
- return true;
- if (cp < 0xb5c)
- return false;
- if (cp < 0xb5e)
- return true;
- return false;
- }
- if (cp < 0xb62)
- return true;
- if (cp === 0xb71)
- return true;
- if (cp === 0xb83)
- return true;
- if (cp < 0xb85)
- return false;
- if (cp < 0xb8b)
- return true;
- if (cp < 0xb8e)
- return false;
- if (cp < 0xb91)
- return true;
- return false;
- }
- if (cp < 0xba8) {
- if (cp < 0xb92)
- return false;
- if (cp < 0xb96)
- return true;
- if (cp < 0xb99)
- return false;
- if (cp < 0xb9b)
- return true;
- if (cp === 0xb9c)
- return true;
- if (cp < 0xb9e)
- return false;
- if (cp < 0xba0)
- return true;
- if (cp < 0xba3)
- return false;
- if (cp < 0xba5)
- return true;
- return false;
- }
- if (cp < 0xbab)
- return true;
- if (cp < 0xbae)
- return false;
- if (cp < 0xbba)
- return true;
- if (cp === 0xbd0)
- return true;
- if (cp < 0xc05)
- return false;
- if (cp < 0xc0d)
- return true;
- if (cp < 0xc0e)
- return false;
- if (cp < 0xc11)
- return true;
- if (cp < 0xc12)
- return false;
- if (cp < 0xc29)
- return true;
- return false;
- }
- if (cp < 0xd5f) {
- if (cp < 0xcbd) {
- if (cp < 0xc85) {
- if (cp < 0xc2a)
- return false;
- if (cp < 0xc3a)
- return true;
- if (cp === 0xc3d)
- return true;
- if (cp < 0xc58)
- return false;
- if (cp < 0xc5b)
- return true;
- if (cp < 0xc60)
- return false;
- if (cp < 0xc62)
- return true;
- if (cp === 0xc80)
- return true;
- return false;
- }
- if (cp < 0xc8d)
- return true;
- if (cp < 0xc8e)
- return false;
- if (cp < 0xc91)
- return true;
- if (cp < 0xc92)
- return false;
- if (cp < 0xca9)
- return true;
- if (cp < 0xcaa)
- return false;
- if (cp < 0xcb4)
- return true;
- if (cp < 0xcb5)
- return false;
- if (cp < 0xcba)
- return true;
- return false;
- }
- if (cp < 0xd0e) {
- if (cp === 0xcbd)
- return true;
- if (cp === 0xcde)
- return true;
- if (cp < 0xce0)
- return false;
- if (cp < 0xce2)
- return true;
- if (cp < 0xcf1)
- return false;
- if (cp < 0xcf3)
- return true;
- if (cp < 0xd05)
- return false;
- if (cp < 0xd0d)
- return true;
- return false;
- }
- if (cp < 0xd11)
- return true;
- if (cp < 0xd12)
- return false;
- if (cp < 0xd3b)
- return true;
- if (cp === 0xd3d)
- return true;
- if (cp === 0xd4e)
- return true;
- if (cp < 0xd54)
- return false;
- if (cp < 0xd57)
- return true;
- return false;
- }
- if (cp < 0xe46) {
- if (cp < 0xdbd) {
- if (cp < 0xd5f)
- return false;
- if (cp < 0xd62)
- return true;
- if (cp < 0xd7a)
- return false;
- if (cp < 0xd80)
- return true;
- if (cp < 0xd85)
- return false;
- if (cp < 0xd97)
- return true;
- if (cp < 0xd9a)
- return false;
- if (cp < 0xdb2)
- return true;
- if (cp < 0xdb3)
- return false;
- if (cp < 0xdbc)
- return true;
- return false;
- }
- if (cp === 0xdbd)
- return true;
- if (cp < 0xdc0)
- return false;
- if (cp < 0xdc7)
- return true;
- if (cp < 0xe01)
- return false;
- if (cp < 0xe31)
- return true;
- if (cp < 0xe32)
- return false;
- if (cp < 0xe34)
- return true;
- if (cp < 0xe40)
- return false;
- if (cp < 0xe46)
- return true;
- return false;
- }
- if (cp < 0xe8d) {
- if (cp === 0xe46)
- return true;
- if (cp < 0xe81)
- return false;
- if (cp < 0xe83)
- return true;
- if (cp === 0xe84)
- return true;
- if (cp < 0xe87)
- return false;
- if (cp < 0xe89)
- return true;
- if (cp === 0xe8a)
- return true;
- return false;
- }
- if (cp === 0xe8d)
- return true;
- if (cp < 0xe94)
- return false;
- if (cp < 0xe98)
- return true;
- if (cp < 0xe99)
- return false;
- if (cp < 0xea0)
- return true;
- if (cp < 0xea1)
- return false;
- if (cp < 0xea4)
- return true;
- if (cp === 0xea5)
- return true;
- if (cp === 0xea7)
- return true;
- return false;
- }
- if (cp < 0x1c5a) {
- if (cp < 0x1380) {
- if (cp < 0x10a0) {
- if (cp < 0xf88) {
- if (cp < 0xec6) {
- if (cp < 0xeaa)
- return false;
- if (cp < 0xeac)
- return true;
- if (cp < 0xead)
- return false;
- if (cp < 0xeb1)
- return true;
- if (cp < 0xeb2)
- return false;
- if (cp < 0xeb4)
- return true;
- if (cp === 0xebd)
- return true;
- if (cp < 0xec0)
- return false;
- if (cp < 0xec5)
- return true;
- return false;
- }
- if (cp === 0xec6)
- return true;
- if (cp < 0xedc)
- return false;
- if (cp < 0xee0)
- return true;
- if (cp === 0xf00)
- return true;
- if (cp < 0xf40)
- return false;
- if (cp < 0xf48)
- return true;
- if (cp < 0xf49)
- return false;
- if (cp < 0xf6d)
- return true;
- return false;
- }
- if (cp < 0x1061) {
- if (cp < 0xf88)
- return false;
- if (cp < 0xf8d)
- return true;
- if (cp < 0x1000)
- return false;
- if (cp < 0x102b)
- return true;
- if (cp === 0x103f)
- return true;
- if (cp < 0x1050)
- return false;
- if (cp < 0x1056)
- return true;
- if (cp < 0x105a)
- return false;
- if (cp < 0x105e)
- return true;
- return false;
- }
- if (cp === 0x1061)
- return true;
- if (cp < 0x1065)
- return false;
- if (cp < 0x1067)
- return true;
- if (cp < 0x106e)
- return false;
- if (cp < 0x1071)
- return true;
- if (cp < 0x1075)
- return false;
- if (cp < 0x1082)
- return true;
- if (cp === 0x108e)
- return true;
- return false;
- }
- if (cp < 0x1260) {
- if (cp < 0x10fd) {
- if (cp < 0x10a0)
- return false;
- if (cp < 0x10c6)
- return true;
- if (cp === 0x10c7)
- return true;
- if (cp === 0x10cd)
- return true;
- if (cp < 0x10d0)
- return false;
- if (cp < 0x10fb)
- return true;
- if (cp === 0x10fc)
- return true;
- return false;
- }
- if (cp < 0x1249)
- return true;
- if (cp < 0x124a)
- return false;
- if (cp < 0x124e)
- return true;
- if (cp < 0x1250)
- return false;
- if (cp < 0x1257)
- return true;
- if (cp === 0x1258)
- return true;
- if (cp < 0x125a)
- return false;
- if (cp < 0x125e)
- return true;
- return false;
- }
- if (cp < 0x12c0) {
- if (cp < 0x1260)
- return false;
- if (cp < 0x1289)
- return true;
- if (cp < 0x128a)
- return false;
- if (cp < 0x128e)
- return true;
- if (cp < 0x1290)
- return false;
- if (cp < 0x12b1)
- return true;
- if (cp < 0x12b2)
- return false;
- if (cp < 0x12b6)
- return true;
- if (cp < 0x12b8)
- return false;
- if (cp < 0x12bf)
- return true;
- return false;
- }
- if (cp === 0x12c0)
- return true;
- if (cp < 0x12c2)
- return false;
- if (cp < 0x12c6)
- return true;
- if (cp < 0x12c8)
- return false;
- if (cp < 0x12d7)
- return true;
- if (cp < 0x12d8)
- return false;
- if (cp < 0x1311)
- return true;
- if (cp < 0x1312)
- return false;
- if (cp < 0x1316)
- return true;
- if (cp < 0x1318)
- return false;
- if (cp < 0x135b)
- return true;
- return false;
- }
- if (cp < 0x1844) {
- if (cp < 0x170e) {
- if (cp < 0x1681) {
- if (cp < 0x1380)
- return false;
- if (cp < 0x1390)
- return true;
- if (cp < 0x13a0)
- return false;
- if (cp < 0x13f6)
- return true;
- if (cp < 0x13f8)
- return false;
- if (cp < 0x13fe)
- return true;
- if (cp < 0x1401)
- return false;
- if (cp < 0x166d)
- return true;
- if (cp < 0x166f)
- return false;
- if (cp < 0x1680)
- return true;
- return false;
- }
- if (cp < 0x169b)
- return true;
- if (cp < 0x16a0)
- return false;
- if (cp < 0x16eb)
- return true;
- if (cp < 0x16ee)
- return false;
- if (cp < 0x16f1)
- return true;
- if (cp < 0x16f1)
- return false;
- if (cp < 0x16f9)
- return true;
- if (cp < 0x1700)
- return false;
- if (cp < 0x170d)
- return true;
- return false;
- }
- if (cp < 0x1780) {
- if (cp < 0x170e)
- return false;
- if (cp < 0x1712)
- return true;
- if (cp < 0x1720)
- return false;
- if (cp < 0x1732)
- return true;
- if (cp < 0x1740)
- return false;
- if (cp < 0x1752)
- return true;
- if (cp < 0x1760)
- return false;
- if (cp < 0x176d)
- return true;
- if (cp < 0x176e)
- return false;
- if (cp < 0x1771)
- return true;
- return false;
- }
- if (cp < 0x17b4)
- return true;
- if (cp === 0x17d7)
- return true;
- if (cp === 0x17dc)
- return true;
- if (cp < 0x1820)
- return false;
- if (cp < 0x1843)
- return true;
- if (cp === 0x1843)
- return true;
- return false;
- }
- if (cp < 0x19b0) {
- if (cp < 0x18b0) {
- if (cp < 0x1844)
- return false;
- if (cp < 0x1878)
- return true;
- if (cp < 0x1880)
- return false;
- if (cp < 0x1885)
- return true;
- if (cp < 0x1885)
- return false;
- if (cp < 0x1887)
- return true;
- if (cp < 0x1887)
- return false;
- if (cp < 0x18a9)
- return true;
- if (cp === 0x18aa)
- return true;
- return false;
- }
- if (cp < 0x18f6)
- return true;
- if (cp < 0x1900)
- return false;
- if (cp < 0x191f)
- return true;
- if (cp < 0x1950)
- return false;
- if (cp < 0x196e)
- return true;
- if (cp < 0x1970)
- return false;
- if (cp < 0x1975)
- return true;
- if (cp < 0x1980)
- return false;
- if (cp < 0x19ac)
- return true;
- return false;
- }
- if (cp < 0x1b45) {
- if (cp < 0x19b0)
- return false;
- if (cp < 0x19ca)
- return true;
- if (cp < 0x1a00)
- return false;
- if (cp < 0x1a17)
- return true;
- if (cp < 0x1a20)
- return false;
- if (cp < 0x1a55)
- return true;
- if (cp === 0x1aa7)
- return true;
- if (cp < 0x1b05)
- return false;
- if (cp < 0x1b34)
- return true;
- return false;
- }
- if (cp < 0x1b4c)
- return true;
- if (cp < 0x1b83)
- return false;
- if (cp < 0x1ba1)
- return true;
- if (cp < 0x1bae)
- return false;
- if (cp < 0x1bb0)
- return true;
- if (cp < 0x1bba)
- return false;
- if (cp < 0x1be6)
- return true;
- if (cp < 0x1c00)
- return false;
- if (cp < 0x1c24)
- return true;
- if (cp < 0x1c4d)
- return false;
- if (cp < 0x1c50)
- return true;
- return false;
- }
- if (cp < 0x2126) {
- if (cp < 0x1f5f) {
- if (cp < 0x1d79) {
- if (cp < 0x1cf5) {
- if (cp < 0x1c5a)
- return false;
- if (cp < 0x1c78)
- return true;
- if (cp < 0x1c78)
- return false;
- if (cp < 0x1c7e)
- return true;
- if (cp < 0x1c80)
- return false;
- if (cp < 0x1c89)
- return true;
- if (cp < 0x1ce9)
- return false;
- if (cp < 0x1ced)
- return true;
- if (cp < 0x1cee)
- return false;
- if (cp < 0x1cf2)
- return true;
- return false;
- }
- if (cp < 0x1cf7)
- return true;
- if (cp < 0x1d00)
- return false;
- if (cp < 0x1d2c)
- return true;
- if (cp < 0x1d2c)
- return false;
- if (cp < 0x1d6b)
- return true;
- if (cp < 0x1d6b)
- return false;
- if (cp < 0x1d78)
- return true;
- if (cp === 0x1d78)
- return true;
- return false;
- }
- if (cp < 0x1f48) {
- if (cp < 0x1d79)
- return false;
- if (cp < 0x1d9b)
- return true;
- if (cp < 0x1d9b)
- return false;
- if (cp < 0x1dc0)
- return true;
- if (cp < 0x1e00)
- return false;
- if (cp < 0x1f16)
- return true;
- if (cp < 0x1f18)
- return false;
- if (cp < 0x1f1e)
- return true;
- if (cp < 0x1f20)
- return false;
- if (cp < 0x1f46)
- return true;
- return false;
- }
- if (cp < 0x1f4e)
- return true;
- if (cp < 0x1f50)
- return false;
- if (cp < 0x1f58)
- return true;
- if (cp === 0x1f59)
- return true;
- if (cp === 0x1f5b)
- return true;
- if (cp === 0x1f5d)
- return true;
- return false;
- }
- if (cp < 0x1ff6) {
- if (cp < 0x1fc6) {
- if (cp < 0x1f5f)
- return false;
- if (cp < 0x1f7e)
- return true;
- if (cp < 0x1f80)
- return false;
- if (cp < 0x1fb5)
- return true;
- if (cp < 0x1fb6)
- return false;
- if (cp < 0x1fbd)
- return true;
- if (cp === 0x1fbe)
- return true;
- if (cp < 0x1fc2)
- return false;
- if (cp < 0x1fc5)
- return true;
- return false;
- }
- if (cp < 0x1fcd)
- return true;
- if (cp < 0x1fd0)
- return false;
- if (cp < 0x1fd4)
- return true;
- if (cp < 0x1fd6)
- return false;
- if (cp < 0x1fdc)
- return true;
- if (cp < 0x1fe0)
- return false;
- if (cp < 0x1fed)
- return true;
- if (cp < 0x1ff2)
- return false;
- if (cp < 0x1ff5)
- return true;
- return false;
- }
- if (cp < 0x2107) {
- if (cp < 0x1ff6)
- return false;
- if (cp < 0x1ffd)
- return true;
- if (cp === 0x2071)
- return true;
- if (cp === 0x207f)
- return true;
- if (cp < 0x2090)
- return false;
- if (cp < 0x209d)
- return true;
- if (cp === 0x2102)
- return true;
- return false;
- }
- if (cp === 0x2107)
- return true;
- if (cp < 0x210a)
- return false;
- if (cp < 0x2114)
- return true;
- if (cp === 0x2115)
- return true;
- if (cp === 0x2118)
- return true;
- if (cp < 0x2119)
- return false;
- if (cp < 0x211e)
- return true;
- if (cp === 0x2124)
- return true;
- return false;
- }
- if (cp < 0x2d00) {
- if (cp < 0x2160) {
- if (cp < 0x2135) {
- if (cp === 0x2126)
- return true;
- if (cp === 0x2128)
- return true;
- if (cp < 0x212a)
- return false;
- if (cp < 0x212e)
- return true;
- if (cp === 0x212e)
- return true;
- if (cp < 0x212f)
- return false;
- if (cp < 0x2135)
- return true;
- return false;
- }
- if (cp < 0x2139)
- return true;
- if (cp === 0x2139)
- return true;
- if (cp < 0x213c)
- return false;
- if (cp < 0x2140)
- return true;
- if (cp < 0x2145)
- return false;
- if (cp < 0x214a)
- return true;
- if (cp === 0x214e)
- return true;
- return false;
- }
- if (cp < 0x2c60) {
- if (cp < 0x2160)
- return false;
- if (cp < 0x2183)
- return true;
- if (cp < 0x2183)
- return false;
- if (cp < 0x2185)
- return true;
- if (cp < 0x2185)
- return false;
- if (cp < 0x2189)
- return true;
- if (cp < 0x2c00)
- return false;
- if (cp < 0x2c2f)
- return true;
- if (cp < 0x2c30)
- return false;
- if (cp < 0x2c5f)
- return true;
- return false;
- }
- if (cp < 0x2c7c)
- return true;
- if (cp < 0x2c7c)
- return false;
- if (cp < 0x2c7e)
- return true;
- if (cp < 0x2c7e)
- return false;
- if (cp < 0x2ce5)
- return true;
- if (cp < 0x2ceb)
- return false;
- if (cp < 0x2cef)
- return true;
- if (cp < 0x2cf2)
- return false;
- if (cp < 0x2cf4)
- return true;
- return false;
- }
- if (cp < 0x2dc0) {
- if (cp < 0x2d80) {
- if (cp < 0x2d00)
- return false;
- if (cp < 0x2d26)
- return true;
- if (cp === 0x2d27)
- return true;
- if (cp === 0x2d2d)
- return true;
- if (cp < 0x2d30)
- return false;
- if (cp < 0x2d68)
- return true;
- if (cp === 0x2d6f)
- return true;
- return false;
- }
- if (cp < 0x2d97)
- return true;
- if (cp < 0x2da0)
- return false;
- if (cp < 0x2da7)
- return true;
- if (cp < 0x2da8)
- return false;
- if (cp < 0x2daf)
- return true;
- if (cp < 0x2db0)
- return false;
- if (cp < 0x2db7)
- return true;
- if (cp < 0x2db8)
- return false;
- if (cp < 0x2dbf)
- return true;
- return false;
- }
- if (cp < 0x3006) {
- if (cp < 0x2dc0)
- return false;
- if (cp < 0x2dc7)
- return true;
- if (cp < 0x2dc8)
- return false;
- if (cp < 0x2dcf)
- return true;
- if (cp < 0x2dd0)
- return false;
- if (cp < 0x2dd7)
- return true;
- if (cp < 0x2dd8)
- return false;
- if (cp < 0x2ddf)
- return true;
- if (cp === 0x3005)
- return true;
- return false;
- }
- if (cp === 0x3006)
- return true;
- if (cp === 0x3007)
- return true;
- if (cp < 0x3021)
- return false;
- if (cp < 0x302a)
- return true;
- if (cp < 0x3031)
- return false;
- if (cp < 0x3036)
- return true;
- if (cp < 0x3038)
- return false;
- if (cp < 0x303b)
- return true;
- if (cp === 0x303b)
- return true;
- return false;
- }
- if (cp < 0x10a10) {
- if (cp < 0xab28) {
- if (cp < 0xa7fa) {
- if (cp < 0xa60c) {
- if (cp < 0x31a0) {
- if (cp < 0x30a1) {
- if (cp === 0x303c)
- return true;
- if (cp < 0x3041)
- return false;
- if (cp < 0x3097)
- return true;
- if (cp < 0x309b)
- return false;
- if (cp < 0x309d)
- return true;
- if (cp < 0x309d)
- return false;
- if (cp < 0x309f)
- return true;
- if (cp === 0x309f)
- return true;
- return false;
- }
- if (cp < 0x30fb)
- return true;
- if (cp < 0x30fc)
- return false;
- if (cp < 0x30ff)
- return true;
- if (cp === 0x30ff)
- return true;
- if (cp < 0x3105)
- return false;
- if (cp < 0x312f)
- return true;
- if (cp < 0x3131)
- return false;
- if (cp < 0x318f)
- return true;
- return false;
- }
- if (cp < 0xa015) {
- if (cp < 0x31a0)
- return false;
- if (cp < 0x31bb)
- return true;
- if (cp < 0x31f0)
- return false;
- if (cp < 0x3200)
- return true;
- if (cp < 0x3400)
- return false;
- if (cp < 0x4db6)
- return true;
- if (cp < 0x4e00)
- return false;
- if (cp < 0x9feb)
- return true;
- if (cp < 0xa000)
- return false;
- if (cp < 0xa015)
- return true;
- return false;
- }
- if (cp === 0xa015)
- return true;
- if (cp < 0xa016)
- return false;
- if (cp < 0xa48d)
- return true;
- if (cp < 0xa4d0)
- return false;
- if (cp < 0xa4f8)
- return true;
- if (cp < 0xa4f8)
- return false;
- if (cp < 0xa4fe)
- return true;
- if (cp < 0xa500)
- return false;
- if (cp < 0xa60c)
- return true;
- return false;
- }
- if (cp < 0xa717) {
- if (cp < 0xa67f) {
- if (cp === 0xa60c)
- return true;
- if (cp < 0xa610)
- return false;
- if (cp < 0xa620)
- return true;
- if (cp < 0xa62a)
- return false;
- if (cp < 0xa62c)
- return true;
- if (cp < 0xa640)
- return false;
- if (cp < 0xa66e)
- return true;
- if (cp === 0xa66e)
- return true;
- return false;
- }
- if (cp === 0xa67f)
- return true;
- if (cp < 0xa680)
- return false;
- if (cp < 0xa69c)
- return true;
- if (cp < 0xa69c)
- return false;
- if (cp < 0xa69e)
- return true;
- if (cp < 0xa6a0)
- return false;
- if (cp < 0xa6e6)
- return true;
- if (cp < 0xa6e6)
- return false;
- if (cp < 0xa6f0)
- return true;
- return false;
- }
- if (cp < 0xa78b) {
- if (cp < 0xa717)
- return false;
- if (cp < 0xa720)
- return true;
- if (cp < 0xa722)
- return false;
- if (cp < 0xa770)
- return true;
- if (cp === 0xa770)
- return true;
- if (cp < 0xa771)
- return false;
- if (cp < 0xa788)
- return true;
- if (cp === 0xa788)
- return true;
- return false;
- }
- if (cp < 0xa78f)
- return true;
- if (cp === 0xa78f)
- return true;
- if (cp < 0xa790)
- return false;
- if (cp < 0xa7af)
- return true;
- if (cp < 0xa7b0)
- return false;
- if (cp < 0xa7b8)
- return true;
- if (cp === 0xa7f7)
- return true;
- if (cp < 0xa7f8)
- return false;
- if (cp < 0xa7fa)
- return true;
- return false;
- }
- if (cp < 0xaa40) {
- if (cp < 0xa90a) {
- if (cp < 0xa840) {
- if (cp === 0xa7fa)
- return true;
- if (cp < 0xa7fb)
- return false;
- if (cp < 0xa802)
- return true;
- if (cp < 0xa803)
- return false;
- if (cp < 0xa806)
- return true;
- if (cp < 0xa807)
- return false;
- if (cp < 0xa80b)
- return true;
- if (cp < 0xa80c)
- return false;
- if (cp < 0xa823)
- return true;
- return false;
- }
- if (cp < 0xa874)
- return true;
- if (cp < 0xa882)
- return false;
- if (cp < 0xa8b4)
- return true;
- if (cp < 0xa8f2)
- return false;
- if (cp < 0xa8f8)
- return true;
- if (cp === 0xa8fb)
- return true;
- if (cp === 0xa8fd)
- return true;
- return false;
- }
- if (cp < 0xa9e0) {
- if (cp < 0xa90a)
- return false;
- if (cp < 0xa926)
- return true;
- if (cp < 0xa930)
- return false;
- if (cp < 0xa947)
- return true;
- if (cp < 0xa960)
- return false;
- if (cp < 0xa97d)
- return true;
- if (cp < 0xa984)
- return false;
- if (cp < 0xa9b3)
- return true;
- if (cp === 0xa9cf)
- return true;
- return false;
- }
- if (cp < 0xa9e5)
- return true;
- if (cp === 0xa9e6)
- return true;
- if (cp < 0xa9e7)
- return false;
- if (cp < 0xa9f0)
- return true;
- if (cp < 0xa9fa)
- return false;
- if (cp < 0xa9ff)
- return true;
- if (cp < 0xaa00)
- return false;
- if (cp < 0xaa29)
- return true;
- return false;
- }
- if (cp < 0xaac0) {
- if (cp < 0xaa7a) {
- if (cp < 0xaa40)
- return false;
- if (cp < 0xaa43)
- return true;
- if (cp < 0xaa44)
- return false;
- if (cp < 0xaa4c)
- return true;
- if (cp < 0xaa60)
- return false;
- if (cp < 0xaa70)
- return true;
- if (cp === 0xaa70)
- return true;
- if (cp < 0xaa71)
- return false;
- if (cp < 0xaa77)
- return true;
- return false;
- }
- if (cp === 0xaa7a)
- return true;
- if (cp < 0xaa7e)
- return false;
- if (cp < 0xaab0)
- return true;
- if (cp === 0xaab1)
- return true;
- if (cp < 0xaab5)
- return false;
- if (cp < 0xaab7)
- return true;
- if (cp < 0xaab9)
- return false;
- if (cp < 0xaabe)
- return true;
- return false;
- }
- if (cp < 0xaaf2) {
- if (cp === 0xaac0)
- return true;
- if (cp === 0xaac2)
- return true;
- if (cp < 0xaadb)
- return false;
- if (cp < 0xaadd)
- return true;
- if (cp === 0xaadd)
- return true;
- if (cp < 0xaae0)
- return false;
- if (cp < 0xaaeb)
- return true;
- return false;
- }
- if (cp === 0xaaf2)
- return true;
- if (cp < 0xaaf3)
- return false;
- if (cp < 0xaaf5)
- return true;
- if (cp < 0xab01)
- return false;
- if (cp < 0xab07)
- return true;
- if (cp < 0xab09)
- return false;
- if (cp < 0xab0f)
- return true;
- if (cp < 0xab11)
- return false;
- if (cp < 0xab17)
- return true;
- if (cp < 0xab20)
- return false;
- if (cp < 0xab27)
- return true;
- return false;
- }
- if (cp < 0x1003c) {
- if (cp < 0xfb46) {
- if (cp < 0xfa70) {
- if (cp < 0xabc0) {
- if (cp < 0xab28)
- return false;
- if (cp < 0xab2f)
- return true;
- if (cp < 0xab30)
- return false;
- if (cp < 0xab5b)
- return true;
- if (cp < 0xab5c)
- return false;
- if (cp < 0xab60)
- return true;
- if (cp < 0xab60)
- return false;
- if (cp < 0xab66)
- return true;
- if (cp < 0xab70)
- return false;
- if (cp < 0xabc0)
- return true;
- return false;
- }
- if (cp < 0xabe3)
- return true;
- if (cp < 0xac00)
- return false;
- if (cp < 0xd7a4)
- return true;
- if (cp < 0xd7b0)
- return false;
- if (cp < 0xd7c7)
- return true;
- if (cp < 0xd7cb)
- return false;
- if (cp < 0xd7fc)
- return true;
- if (cp < 0xf900)
- return false;
- if (cp < 0xfa6e)
- return true;
- return false;
- }
- if (cp < 0xfb2a) {
- if (cp < 0xfa70)
- return false;
- if (cp < 0xfada)
- return true;
- if (cp < 0xfb00)
- return false;
- if (cp < 0xfb07)
- return true;
- if (cp < 0xfb13)
- return false;
- if (cp < 0xfb18)
- return true;
- if (cp === 0xfb1d)
- return true;
- if (cp < 0xfb1f)
- return false;
- if (cp < 0xfb29)
- return true;
- return false;
- }
- if (cp < 0xfb37)
- return true;
- if (cp < 0xfb38)
- return false;
- if (cp < 0xfb3d)
- return true;
- if (cp === 0xfb3e)
- return true;
- if (cp < 0xfb40)
- return false;
- if (cp < 0xfb42)
- return true;
- if (cp < 0xfb43)
- return false;
- if (cp < 0xfb45)
- return true;
- return false;
- }
- if (cp < 0xff70) {
- if (cp < 0xfe70) {
- if (cp < 0xfb46)
- return false;
- if (cp < 0xfbb2)
- return true;
- if (cp < 0xfbd3)
- return false;
- if (cp < 0xfd3e)
- return true;
- if (cp < 0xfd50)
- return false;
- if (cp < 0xfd90)
- return true;
- if (cp < 0xfd92)
- return false;
- if (cp < 0xfdc8)
- return true;
- if (cp < 0xfdf0)
- return false;
- if (cp < 0xfdfc)
- return true;
- return false;
- }
- if (cp < 0xfe75)
- return true;
- if (cp < 0xfe76)
- return false;
- if (cp < 0xfefd)
- return true;
- if (cp < 0xff21)
- return false;
- if (cp < 0xff3b)
- return true;
- if (cp < 0xff41)
- return false;
- if (cp < 0xff5b)
- return true;
- if (cp < 0xff66)
- return false;
- if (cp < 0xff70)
- return true;
- return false;
- }
- if (cp < 0xffca) {
- if (cp === 0xff70)
- return true;
- if (cp < 0xff71)
- return false;
- if (cp < 0xff9e)
- return true;
- if (cp < 0xff9e)
- return false;
- if (cp < 0xffa0)
- return true;
- if (cp < 0xffa0)
- return false;
- if (cp < 0xffbf)
- return true;
- if (cp < 0xffc2)
- return false;
- if (cp < 0xffc8)
- return true;
- return false;
- }
- if (cp < 0xffd0)
- return true;
- if (cp < 0xffd2)
- return false;
- if (cp < 0xffd8)
- return true;
- if (cp < 0xffda)
- return false;
- if (cp < 0xffdd)
- return true;
- if (cp < 0x10000)
- return false;
- if (cp < 0x1000c)
- return true;
- if (cp < 0x1000d)
- return false;
- if (cp < 0x10027)
- return true;
- if (cp < 0x10028)
- return false;
- if (cp < 0x1003b)
- return true;
- return false;
- }
- if (cp < 0x104d8) {
- if (cp < 0x10342) {
- if (cp < 0x10280) {
- if (cp < 0x1003c)
- return false;
- if (cp < 0x1003e)
- return true;
- if (cp < 0x1003f)
- return false;
- if (cp < 0x1004e)
- return true;
- if (cp < 0x10050)
- return false;
- if (cp < 0x1005e)
- return true;
- if (cp < 0x10080)
- return false;
- if (cp < 0x100fb)
- return true;
- if (cp < 0x10140)
- return false;
- if (cp < 0x10175)
- return true;
- return false;
- }
- if (cp < 0x1029d)
- return true;
- if (cp < 0x102a0)
- return false;
- if (cp < 0x102d1)
- return true;
- if (cp < 0x10300)
- return false;
- if (cp < 0x10320)
- return true;
- if (cp < 0x1032d)
- return false;
- if (cp < 0x10341)
- return true;
- if (cp === 0x10341)
- return true;
- return false;
- }
- if (cp < 0x103c8) {
- if (cp < 0x10342)
- return false;
- if (cp < 0x1034a)
- return true;
- if (cp === 0x1034a)
- return true;
- if (cp < 0x10350)
- return false;
- if (cp < 0x10376)
- return true;
- if (cp < 0x10380)
- return false;
- if (cp < 0x1039e)
- return true;
- if (cp < 0x103a0)
- return false;
- if (cp < 0x103c4)
- return true;
- return false;
- }
- if (cp < 0x103d0)
- return true;
- if (cp < 0x103d1)
- return false;
- if (cp < 0x103d6)
- return true;
- if (cp < 0x10400)
- return false;
- if (cp < 0x10450)
- return true;
- if (cp < 0x10450)
- return false;
- if (cp < 0x1049e)
- return true;
- if (cp < 0x104b0)
- return false;
- if (cp < 0x104d4)
- return true;
- return false;
- }
- if (cp < 0x1083c) {
- if (cp < 0x10760) {
- if (cp < 0x104d8)
- return false;
- if (cp < 0x104fc)
- return true;
- if (cp < 0x10500)
- return false;
- if (cp < 0x10528)
- return true;
- if (cp < 0x10530)
- return false;
- if (cp < 0x10564)
- return true;
- if (cp < 0x10600)
- return false;
- if (cp < 0x10737)
- return true;
- if (cp < 0x10740)
- return false;
- if (cp < 0x10756)
- return true;
- return false;
- }
- if (cp < 0x10768)
- return true;
- if (cp < 0x10800)
- return false;
- if (cp < 0x10806)
- return true;
- if (cp === 0x10808)
- return true;
- if (cp < 0x1080a)
- return false;
- if (cp < 0x10836)
- return true;
- if (cp < 0x10837)
- return false;
- if (cp < 0x10839)
- return true;
- return false;
- }
- if (cp < 0x108f4) {
- if (cp === 0x1083c)
- return true;
- if (cp < 0x1083f)
- return false;
- if (cp < 0x10856)
- return true;
- if (cp < 0x10860)
- return false;
- if (cp < 0x10877)
- return true;
- if (cp < 0x10880)
- return false;
- if (cp < 0x1089f)
- return true;
- if (cp < 0x108e0)
- return false;
- if (cp < 0x108f3)
- return true;
- return false;
- }
- if (cp < 0x108f6)
- return true;
- if (cp < 0x10900)
- return false;
- if (cp < 0x10916)
- return true;
- if (cp < 0x10920)
- return false;
- if (cp < 0x1093a)
- return true;
- if (cp < 0x10980)
- return false;
- if (cp < 0x109b8)
- return true;
- if (cp < 0x109be)
- return false;
- if (cp < 0x109c0)
- return true;
- if (cp === 0x10a00)
- return true;
- return false;
- }
- if (cp < 0x16f50) {
- if (cp < 0x11400) {
- if (cp < 0x11183) {
- if (cp < 0x10b80) {
- if (cp < 0x10ac0) {
- if (cp < 0x10a10)
- return false;
- if (cp < 0x10a14)
- return true;
- if (cp < 0x10a15)
- return false;
- if (cp < 0x10a18)
- return true;
- if (cp < 0x10a19)
- return false;
- if (cp < 0x10a34)
- return true;
- if (cp < 0x10a60)
- return false;
- if (cp < 0x10a7d)
- return true;
- if (cp < 0x10a80)
- return false;
- if (cp < 0x10a9d)
- return true;
- return false;
- }
- if (cp < 0x10ac8)
- return true;
- if (cp < 0x10ac9)
- return false;
- if (cp < 0x10ae5)
- return true;
- if (cp < 0x10b00)
- return false;
- if (cp < 0x10b36)
- return true;
- if (cp < 0x10b40)
- return false;
- if (cp < 0x10b56)
- return true;
- if (cp < 0x10b60)
- return false;
- if (cp < 0x10b73)
- return true;
- return false;
- }
- if (cp < 0x11083) {
- if (cp < 0x10b80)
- return false;
- if (cp < 0x10b92)
- return true;
- if (cp < 0x10c00)
- return false;
- if (cp < 0x10c49)
- return true;
- if (cp < 0x10c80)
- return false;
- if (cp < 0x10cb3)
- return true;
- if (cp < 0x10cc0)
- return false;
- if (cp < 0x10cf3)
- return true;
- if (cp < 0x11003)
- return false;
- if (cp < 0x11038)
- return true;
- return false;
- }
- if (cp < 0x110b0)
- return true;
- if (cp < 0x110d0)
- return false;
- if (cp < 0x110e9)
- return true;
- if (cp < 0x11103)
- return false;
- if (cp < 0x11127)
- return true;
- if (cp < 0x11150)
- return false;
- if (cp < 0x11173)
- return true;
- if (cp === 0x11176)
- return true;
- return false;
- }
- if (cp < 0x1129f) {
- if (cp < 0x11213) {
- if (cp < 0x11183)
- return false;
- if (cp < 0x111b3)
- return true;
- if (cp < 0x111c1)
- return false;
- if (cp < 0x111c5)
- return true;
- if (cp === 0x111da)
- return true;
- if (cp === 0x111dc)
- return true;
- if (cp < 0x11200)
- return false;
- if (cp < 0x11212)
- return true;
- return false;
- }
- if (cp < 0x1122c)
- return true;
- if (cp < 0x11280)
- return false;
- if (cp < 0x11287)
- return true;
- if (cp === 0x11288)
- return true;
- if (cp < 0x1128a)
- return false;
- if (cp < 0x1128e)
- return true;
- if (cp < 0x1128f)
- return false;
- if (cp < 0x1129e)
- return true;
- return false;
- }
- if (cp < 0x1132a) {
- if (cp < 0x1129f)
- return false;
- if (cp < 0x112a9)
- return true;
- if (cp < 0x112b0)
- return false;
- if (cp < 0x112df)
- return true;
- if (cp < 0x11305)
- return false;
- if (cp < 0x1130d)
- return true;
- if (cp < 0x1130f)
- return false;
- if (cp < 0x11311)
- return true;
- if (cp < 0x11313)
- return false;
- if (cp < 0x11329)
- return true;
- return false;
- }
- if (cp < 0x11331)
- return true;
- if (cp < 0x11332)
- return false;
- if (cp < 0x11334)
- return true;
- if (cp < 0x11335)
- return false;
- if (cp < 0x1133a)
- return true;
- if (cp === 0x1133d)
- return true;
- if (cp === 0x11350)
- return true;
- if (cp < 0x1135d)
- return false;
- if (cp < 0x11362)
- return true;
- return false;
- }
- if (cp < 0x11c00) {
- if (cp < 0x11700) {
- if (cp < 0x11580) {
- if (cp < 0x11400)
- return false;
- if (cp < 0x11435)
- return true;
- if (cp < 0x11447)
- return false;
- if (cp < 0x1144b)
- return true;
- if (cp < 0x11480)
- return false;
- if (cp < 0x114b0)
- return true;
- if (cp < 0x114c4)
- return false;
- if (cp < 0x114c6)
- return true;
- if (cp === 0x114c7)
- return true;
- return false;
- }
- if (cp < 0x115af)
- return true;
- if (cp < 0x115d8)
- return false;
- if (cp < 0x115dc)
- return true;
- if (cp < 0x11600)
- return false;
- if (cp < 0x11630)
- return true;
- if (cp === 0x11644)
- return true;
- if (cp < 0x11680)
- return false;
- if (cp < 0x116ab)
- return true;
- return false;
- }
- if (cp < 0x11a3a) {
- if (cp < 0x11700)
- return false;
- if (cp < 0x1171a)
- return true;
- if (cp < 0x118a0)
- return false;
- if (cp < 0x118e0)
- return true;
- if (cp === 0x118ff)
- return true;
- if (cp === 0x11a00)
- return true;
- if (cp < 0x11a0b)
- return false;
- if (cp < 0x11a33)
- return true;
- return false;
- }
- if (cp === 0x11a3a)
- return true;
- if (cp === 0x11a50)
- return true;
- if (cp < 0x11a5c)
- return false;
- if (cp < 0x11a84)
- return true;
- if (cp < 0x11a86)
- return false;
- if (cp < 0x11a8a)
- return true;
- if (cp < 0x11ac0)
- return false;
- if (cp < 0x11af9)
- return true;
- return false;
- }
- if (cp < 0x12480) {
- if (cp < 0x11d08) {
- if (cp < 0x11c00)
- return false;
- if (cp < 0x11c09)
- return true;
- if (cp < 0x11c0a)
- return false;
- if (cp < 0x11c2f)
- return true;
- if (cp === 0x11c40)
- return true;
- if (cp < 0x11c72)
- return false;
- if (cp < 0x11c90)
- return true;
- if (cp < 0x11d00)
- return false;
- if (cp < 0x11d07)
- return true;
- return false;
- }
- if (cp < 0x11d0a)
- return true;
- if (cp < 0x11d0b)
- return false;
- if (cp < 0x11d31)
- return true;
- if (cp === 0x11d46)
- return true;
- if (cp < 0x12000)
- return false;
- if (cp < 0x1239a)
- return true;
- if (cp < 0x12400)
- return false;
- if (cp < 0x1246f)
- return true;
- return false;
- }
- if (cp < 0x16ad0) {
- if (cp < 0x12480)
- return false;
- if (cp < 0x12544)
- return true;
- if (cp < 0x13000)
- return false;
- if (cp < 0x1342f)
- return true;
- if (cp < 0x14400)
- return false;
- if (cp < 0x14647)
- return true;
- if (cp < 0x16800)
- return false;
- if (cp < 0x16a39)
- return true;
- if (cp < 0x16a40)
- return false;
- if (cp < 0x16a5f)
- return true;
- return false;
- }
- if (cp < 0x16aee)
- return true;
- if (cp < 0x16b00)
- return false;
- if (cp < 0x16b30)
- return true;
- if (cp < 0x16b40)
- return false;
- if (cp < 0x16b44)
- return true;
- if (cp < 0x16b63)
- return false;
- if (cp < 0x16b78)
- return true;
- if (cp < 0x16b7d)
- return false;
- if (cp < 0x16b90)
- return true;
- if (cp < 0x16f00)
- return false;
- if (cp < 0x16f45)
- return true;
- return false;
- }
- if (cp < 0x1e800) {
- if (cp < 0x1d4c5) {
- if (cp < 0x1bc90) {
- if (cp < 0x1b000) {
- if (cp === 0x16f50)
- return true;
- if (cp < 0x16f93)
- return false;
- if (cp < 0x16fa0)
- return true;
- if (cp < 0x16fe0)
- return false;
- if (cp < 0x16fe2)
- return true;
- if (cp < 0x17000)
- return false;
- if (cp < 0x187ed)
- return true;
- if (cp < 0x18800)
- return false;
- if (cp < 0x18af3)
- return true;
- return false;
- }
- if (cp < 0x1b11f)
- return true;
- if (cp < 0x1b170)
- return false;
- if (cp < 0x1b2fc)
- return true;
- if (cp < 0x1bc00)
- return false;
- if (cp < 0x1bc6b)
- return true;
- if (cp < 0x1bc70)
- return false;
- if (cp < 0x1bc7d)
- return true;
- if (cp < 0x1bc80)
- return false;
- if (cp < 0x1bc89)
- return true;
- return false;
- }
- if (cp < 0x1d4a5) {
- if (cp < 0x1bc90)
- return false;
- if (cp < 0x1bc9a)
- return true;
- if (cp < 0x1d400)
- return false;
- if (cp < 0x1d455)
- return true;
- if (cp < 0x1d456)
- return false;
- if (cp < 0x1d49d)
- return true;
- if (cp < 0x1d49e)
- return false;
- if (cp < 0x1d4a0)
- return true;
- if (cp === 0x1d4a2)
- return true;
- return false;
- }
- if (cp < 0x1d4a7)
- return true;
- if (cp < 0x1d4a9)
- return false;
- if (cp < 0x1d4ad)
- return true;
- if (cp < 0x1d4ae)
- return false;
- if (cp < 0x1d4ba)
- return true;
- if (cp === 0x1d4bb)
- return true;
- if (cp < 0x1d4bd)
- return false;
- if (cp < 0x1d4c4)
- return true;
- return false;
- }
- if (cp < 0x1d6a8) {
- if (cp < 0x1d53b) {
- if (cp < 0x1d4c5)
- return false;
- if (cp < 0x1d506)
- return true;
- if (cp < 0x1d507)
- return false;
- if (cp < 0x1d50b)
- return true;
- if (cp < 0x1d50d)
- return false;
- if (cp < 0x1d515)
- return true;
- if (cp < 0x1d516)
- return false;
- if (cp < 0x1d51d)
- return true;
- if (cp < 0x1d51e)
- return false;
- if (cp < 0x1d53a)
- return true;
- return false;
- }
- if (cp < 0x1d53f)
- return true;
- if (cp < 0x1d540)
- return false;
- if (cp < 0x1d545)
- return true;
- if (cp === 0x1d546)
- return true;
- if (cp < 0x1d54a)
- return false;
- if (cp < 0x1d551)
- return true;
- if (cp < 0x1d552)
- return false;
- if (cp < 0x1d6a6)
- return true;
- return false;
- }
- if (cp < 0x1d736) {
- if (cp < 0x1d6a8)
- return false;
- if (cp < 0x1d6c1)
- return true;
- if (cp < 0x1d6c2)
- return false;
- if (cp < 0x1d6db)
- return true;
- if (cp < 0x1d6dc)
- return false;
- if (cp < 0x1d6fb)
- return true;
- if (cp < 0x1d6fc)
- return false;
- if (cp < 0x1d715)
- return true;
- if (cp < 0x1d716)
- return false;
- if (cp < 0x1d735)
- return true;
- return false;
- }
- if (cp < 0x1d74f)
- return true;
- if (cp < 0x1d750)
- return false;
- if (cp < 0x1d76f)
- return true;
- if (cp < 0x1d770)
- return false;
- if (cp < 0x1d789)
- return true;
- if (cp < 0x1d78a)
- return false;
- if (cp < 0x1d7a9)
- return true;
- if (cp < 0x1d7aa)
- return false;
- if (cp < 0x1d7c3)
- return true;
- if (cp < 0x1d7c4)
- return false;
- if (cp < 0x1d7cc)
- return true;
- return false;
- }
- if (cp < 0x1ee5b) {
- if (cp < 0x1ee3b) {
- if (cp < 0x1ee24) {
- if (cp < 0x1e800)
- return false;
- if (cp < 0x1e8c5)
- return true;
- if (cp < 0x1e900)
- return false;
- if (cp < 0x1e944)
- return true;
- if (cp < 0x1ee00)
- return false;
- if (cp < 0x1ee04)
- return true;
- if (cp < 0x1ee05)
- return false;
- if (cp < 0x1ee20)
- return true;
- if (cp < 0x1ee21)
- return false;
- if (cp < 0x1ee23)
- return true;
- return false;
- }
- if (cp === 0x1ee24)
- return true;
- if (cp === 0x1ee27)
- return true;
- if (cp < 0x1ee29)
- return false;
- if (cp < 0x1ee33)
- return true;
- if (cp < 0x1ee34)
- return false;
- if (cp < 0x1ee38)
- return true;
- if (cp === 0x1ee39)
- return true;
- return false;
- }
- if (cp < 0x1ee4d) {
- if (cp === 0x1ee3b)
- return true;
- if (cp === 0x1ee42)
- return true;
- if (cp === 0x1ee47)
- return true;
- if (cp === 0x1ee49)
- return true;
- if (cp === 0x1ee4b)
- return true;
- return false;
- }
- if (cp < 0x1ee50)
- return true;
- if (cp < 0x1ee51)
- return false;
- if (cp < 0x1ee53)
- return true;
- if (cp === 0x1ee54)
- return true;
- if (cp === 0x1ee57)
- return true;
- if (cp === 0x1ee59)
- return true;
- return false;
- }
- if (cp < 0x1ee80) {
- if (cp < 0x1ee67) {
- if (cp === 0x1ee5b)
- return true;
- if (cp === 0x1ee5d)
- return true;
- if (cp === 0x1ee5f)
- return true;
- if (cp < 0x1ee61)
- return false;
- if (cp < 0x1ee63)
- return true;
- if (cp === 0x1ee64)
- return true;
- return false;
- }
- if (cp < 0x1ee6b)
- return true;
- if (cp < 0x1ee6c)
- return false;
- if (cp < 0x1ee73)
- return true;
- if (cp < 0x1ee74)
- return false;
- if (cp < 0x1ee78)
- return true;
- if (cp < 0x1ee79)
- return false;
- if (cp < 0x1ee7d)
- return true;
- if (cp === 0x1ee7e)
- return true;
- return false;
- }
- if (cp < 0x20000) {
- if (cp < 0x1ee80)
- return false;
- if (cp < 0x1ee8a)
- return true;
- if (cp < 0x1ee8b)
- return false;
- if (cp < 0x1ee9c)
- return true;
- if (cp < 0x1eea1)
- return false;
- if (cp < 0x1eea4)
- return true;
- if (cp < 0x1eea5)
- return false;
- if (cp < 0x1eeaa)
- return true;
- if (cp < 0x1eeab)
- return false;
- if (cp < 0x1eebc)
- return true;
- return false;
- }
- if (cp < 0x2a6d7)
- return true;
- if (cp < 0x2a700)
- return false;
- if (cp < 0x2b735)
- return true;
- if (cp < 0x2b740)
- return false;
- if (cp < 0x2b81e)
- return true;
- if (cp < 0x2b820)
- return false;
- if (cp < 0x2cea2)
- return true;
- if (cp < 0x2ceb0)
- return false;
- if (cp < 0x2ebe1)
- return true;
- if (cp < 0x2f800)
- return false;
- if (cp < 0x2fa1e)
- return true;
- return false;
- }
- function isLargeIdContinue(cp) {
- if (cp < 0x1bf2) {
- if (cp < 0xd62) {
- if (cp < 0xa83) {
- if (cp < 0x93b) {
- if (cp < 0x6ea) {
- if (cp < 0x5c7) {
- if (cp === 0xb7)
- return true;
- if (cp < 0x300)
- return false;
- if (cp < 0x370)
- return true;
- if (cp === 0x387)
- return true;
- if (cp < 0x483)
- return false;
- if (cp < 0x488)
- return true;
- if (cp < 0x591)
- return false;
- if (cp < 0x5be)
- return true;
- if (cp === 0x5bf)
- return true;
- if (cp < 0x5c1)
- return false;
- if (cp < 0x5c3)
- return true;
- if (cp < 0x5c4)
- return false;
- if (cp < 0x5c6)
- return true;
- return false;
- }
- if (cp === 0x5c7)
- return true;
- if (cp < 0x610)
- return false;
- if (cp < 0x61b)
- return true;
- if (cp < 0x64b)
- return false;
- if (cp < 0x660)
- return true;
- if (cp < 0x660)
- return false;
- if (cp < 0x66a)
- return true;
- if (cp === 0x670)
- return true;
- if (cp < 0x6d6)
- return false;
- if (cp < 0x6dd)
- return true;
- if (cp < 0x6df)
- return false;
- if (cp < 0x6e5)
- return true;
- if (cp < 0x6e7)
- return false;
- if (cp < 0x6e9)
- return true;
- return false;
- }
- if (cp < 0x81b) {
- if (cp < 0x6ea)
- return false;
- if (cp < 0x6ee)
- return true;
- if (cp < 0x6f0)
- return false;
- if (cp < 0x6fa)
- return true;
- if (cp === 0x711)
- return true;
- if (cp < 0x730)
- return false;
- if (cp < 0x74b)
- return true;
- if (cp < 0x7a6)
- return false;
- if (cp < 0x7b1)
- return true;
- if (cp < 0x7c0)
- return false;
- if (cp < 0x7ca)
- return true;
- if (cp < 0x7eb)
- return false;
- if (cp < 0x7f4)
- return true;
- if (cp < 0x816)
- return false;
- if (cp < 0x81a)
- return true;
- return false;
- }
- if (cp < 0x824)
- return true;
- if (cp < 0x825)
- return false;
- if (cp < 0x828)
- return true;
- if (cp < 0x829)
- return false;
- if (cp < 0x82e)
- return true;
- if (cp < 0x859)
- return false;
- if (cp < 0x85c)
- return true;
- if (cp < 0x8d4)
- return false;
- if (cp < 0x8e2)
- return true;
- if (cp < 0x8e3)
- return false;
- if (cp < 0x903)
- return true;
- if (cp === 0x903)
- return true;
- if (cp === 0x93a)
- return true;
- return false;
- }
- if (cp < 0x9cb) {
- if (cp < 0x962) {
- if (cp === 0x93b)
- return true;
- if (cp === 0x93c)
- return true;
- if (cp < 0x93e)
- return false;
- if (cp < 0x941)
- return true;
- if (cp < 0x941)
- return false;
- if (cp < 0x949)
- return true;
- if (cp < 0x949)
- return false;
- if (cp < 0x94d)
- return true;
- if (cp === 0x94d)
- return true;
- if (cp < 0x94e)
- return false;
- if (cp < 0x950)
- return true;
- if (cp < 0x951)
- return false;
- if (cp < 0x958)
- return true;
- return false;
- }
- if (cp < 0x964)
- return true;
- if (cp < 0x966)
- return false;
- if (cp < 0x970)
- return true;
- if (cp === 0x981)
- return true;
- if (cp < 0x982)
- return false;
- if (cp < 0x984)
- return true;
- if (cp === 0x9bc)
- return true;
- if (cp < 0x9be)
- return false;
- if (cp < 0x9c1)
- return true;
- if (cp < 0x9c1)
- return false;
- if (cp < 0x9c5)
- return true;
- if (cp < 0x9c7)
- return false;
- if (cp < 0x9c9)
- return true;
- return false;
- }
- if (cp < 0xa3e) {
- if (cp < 0x9cb)
- return false;
- if (cp < 0x9cd)
- return true;
- if (cp === 0x9cd)
- return true;
- if (cp === 0x9d7)
- return true;
- if (cp < 0x9e2)
- return false;
- if (cp < 0x9e4)
- return true;
- if (cp < 0x9e6)
- return false;
- if (cp < 0x9f0)
- return true;
- if (cp < 0xa01)
- return false;
- if (cp < 0xa03)
- return true;
- if (cp === 0xa03)
- return true;
- if (cp === 0xa3c)
- return true;
- return false;
- }
- if (cp < 0xa41)
- return true;
- if (cp < 0xa41)
- return false;
- if (cp < 0xa43)
- return true;
- if (cp < 0xa47)
- return false;
- if (cp < 0xa49)
- return true;
- if (cp < 0xa4b)
- return false;
- if (cp < 0xa4e)
- return true;
- if (cp === 0xa51)
- return true;
- if (cp < 0xa66)
- return false;
- if (cp < 0xa70)
- return true;
- if (cp < 0xa70)
- return false;
- if (cp < 0xa72)
- return true;
- if (cp === 0xa75)
- return true;
- if (cp < 0xa81)
- return false;
- if (cp < 0xa83)
- return true;
- return false;
- }
- if (cp < 0xbd7) {
- if (cp < 0xb40) {
- if (cp < 0xae2) {
- if (cp === 0xa83)
- return true;
- if (cp === 0xabc)
- return true;
- if (cp < 0xabe)
- return false;
- if (cp < 0xac1)
- return true;
- if (cp < 0xac1)
- return false;
- if (cp < 0xac6)
- return true;
- if (cp < 0xac7)
- return false;
- if (cp < 0xac9)
- return true;
- if (cp === 0xac9)
- return true;
- if (cp < 0xacb)
- return false;
- if (cp < 0xacd)
- return true;
- if (cp === 0xacd)
- return true;
- return false;
- }
- if (cp < 0xae4)
- return true;
- if (cp < 0xae6)
- return false;
- if (cp < 0xaf0)
- return true;
- if (cp < 0xafa)
- return false;
- if (cp < 0xb00)
- return true;
- if (cp === 0xb01)
- return true;
- if (cp < 0xb02)
- return false;
- if (cp < 0xb04)
- return true;
- if (cp === 0xb3c)
- return true;
- if (cp === 0xb3e)
- return true;
- if (cp === 0xb3f)
- return true;
- return false;
- }
- if (cp < 0xb66) {
- if (cp === 0xb40)
- return true;
- if (cp < 0xb41)
- return false;
- if (cp < 0xb45)
- return true;
- if (cp < 0xb47)
- return false;
- if (cp < 0xb49)
- return true;
- if (cp < 0xb4b)
- return false;
- if (cp < 0xb4d)
- return true;
- if (cp === 0xb4d)
- return true;
- if (cp === 0xb56)
- return true;
- if (cp === 0xb57)
- return true;
- if (cp < 0xb62)
- return false;
- if (cp < 0xb64)
- return true;
- return false;
- }
- if (cp < 0xb70)
- return true;
- if (cp === 0xb82)
- return true;
- if (cp < 0xbbe)
- return false;
- if (cp < 0xbc0)
- return true;
- if (cp === 0xbc0)
- return true;
- if (cp < 0xbc1)
- return false;
- if (cp < 0xbc3)
- return true;
- if (cp < 0xbc6)
- return false;
- if (cp < 0xbc9)
- return true;
- if (cp < 0xbca)
- return false;
- if (cp < 0xbcd)
- return true;
- if (cp === 0xbcd)
- return true;
- return false;
- }
- if (cp < 0xcc0) {
- if (cp < 0xc55) {
- if (cp === 0xbd7)
- return true;
- if (cp < 0xbe6)
- return false;
- if (cp < 0xbf0)
- return true;
- if (cp === 0xc00)
- return true;
- if (cp < 0xc01)
- return false;
- if (cp < 0xc04)
- return true;
- if (cp < 0xc3e)
- return false;
- if (cp < 0xc41)
- return true;
- if (cp < 0xc41)
- return false;
- if (cp < 0xc45)
- return true;
- if (cp < 0xc46)
- return false;
- if (cp < 0xc49)
- return true;
- if (cp < 0xc4a)
- return false;
- if (cp < 0xc4e)
- return true;
- return false;
- }
- if (cp < 0xc57)
- return true;
- if (cp < 0xc62)
- return false;
- if (cp < 0xc64)
- return true;
- if (cp < 0xc66)
- return false;
- if (cp < 0xc70)
- return true;
- if (cp === 0xc81)
- return true;
- if (cp < 0xc82)
- return false;
- if (cp < 0xc84)
- return true;
- if (cp === 0xcbc)
- return true;
- if (cp === 0xcbe)
- return true;
- if (cp === 0xcbf)
- return true;
- return false;
- }
- if (cp < 0xd00) {
- if (cp < 0xcc0)
- return false;
- if (cp < 0xcc5)
- return true;
- if (cp === 0xcc6)
- return true;
- if (cp < 0xcc7)
- return false;
- if (cp < 0xcc9)
- return true;
- if (cp < 0xcca)
- return false;
- if (cp < 0xccc)
- return true;
- if (cp < 0xccc)
- return false;
- if (cp < 0xcce)
- return true;
- if (cp < 0xcd5)
- return false;
- if (cp < 0xcd7)
- return true;
- if (cp < 0xce2)
- return false;
- if (cp < 0xce4)
- return true;
- if (cp < 0xce6)
- return false;
- if (cp < 0xcf0)
- return true;
- return false;
- }
- if (cp < 0xd02)
- return true;
- if (cp < 0xd02)
- return false;
- if (cp < 0xd04)
- return true;
- if (cp < 0xd3b)
- return false;
- if (cp < 0xd3d)
- return true;
- if (cp < 0xd3e)
- return false;
- if (cp < 0xd41)
- return true;
- if (cp < 0xd41)
- return false;
- if (cp < 0xd45)
- return true;
- if (cp < 0xd46)
- return false;
- if (cp < 0xd49)
- return true;
- if (cp < 0xd4a)
- return false;
- if (cp < 0xd4d)
- return true;
- if (cp === 0xd4d)
- return true;
- if (cp === 0xd57)
- return true;
- return false;
- }
- if (cp < 0x17be) {
- if (cp < 0x102b) {
- if (cp < 0xebb) {
- if (cp < 0xde6) {
- if (cp < 0xd62)
- return false;
- if (cp < 0xd64)
- return true;
- if (cp < 0xd66)
- return false;
- if (cp < 0xd70)
- return true;
- if (cp < 0xd82)
- return false;
- if (cp < 0xd84)
- return true;
- if (cp === 0xdca)
- return true;
- if (cp < 0xdcf)
- return false;
- if (cp < 0xdd2)
- return true;
- if (cp < 0xdd2)
- return false;
- if (cp < 0xdd5)
- return true;
- if (cp === 0xdd6)
- return true;
- if (cp < 0xdd8)
- return false;
- if (cp < 0xde0)
- return true;
- return false;
- }
- if (cp < 0xdf0)
- return true;
- if (cp < 0xdf2)
- return false;
- if (cp < 0xdf4)
- return true;
- if (cp === 0xe31)
- return true;
- if (cp < 0xe34)
- return false;
- if (cp < 0xe3b)
- return true;
- if (cp < 0xe47)
- return false;
- if (cp < 0xe4f)
- return true;
- if (cp < 0xe50)
- return false;
- if (cp < 0xe5a)
- return true;
- if (cp === 0xeb1)
- return true;
- if (cp < 0xeb4)
- return false;
- if (cp < 0xeba)
- return true;
- return false;
- }
- if (cp < 0xf3e) {
- if (cp < 0xebb)
- return false;
- if (cp < 0xebd)
- return true;
- if (cp < 0xec8)
- return false;
- if (cp < 0xece)
- return true;
- if (cp < 0xed0)
- return false;
- if (cp < 0xeda)
- return true;
- if (cp < 0xf18)
- return false;
- if (cp < 0xf1a)
- return true;
- if (cp < 0xf20)
- return false;
- if (cp < 0xf2a)
- return true;
- if (cp === 0xf35)
- return true;
- if (cp === 0xf37)
- return true;
- if (cp === 0xf39)
- return true;
- return false;
- }
- if (cp < 0xf40)
- return true;
- if (cp < 0xf71)
- return false;
- if (cp < 0xf7f)
- return true;
- if (cp === 0xf7f)
- return true;
- if (cp < 0xf80)
- return false;
- if (cp < 0xf85)
- return true;
- if (cp < 0xf86)
- return false;
- if (cp < 0xf88)
- return true;
- if (cp < 0xf8d)
- return false;
- if (cp < 0xf98)
- return true;
- if (cp < 0xf99)
- return false;
- if (cp < 0xfbd)
- return true;
- if (cp === 0xfc6)
- return true;
- return false;
- }
- if (cp < 0x1083) {
- if (cp < 0x1040) {
- if (cp < 0x102b)
- return false;
- if (cp < 0x102d)
- return true;
- if (cp < 0x102d)
- return false;
- if (cp < 0x1031)
- return true;
- if (cp === 0x1031)
- return true;
- if (cp < 0x1032)
- return false;
- if (cp < 0x1038)
- return true;
- if (cp === 0x1038)
- return true;
- if (cp < 0x1039)
- return false;
- if (cp < 0x103b)
- return true;
- if (cp < 0x103b)
- return false;
- if (cp < 0x103d)
- return true;
- if (cp < 0x103d)
- return false;
- if (cp < 0x103f)
- return true;
- return false;
- }
- if (cp < 0x104a)
- return true;
- if (cp < 0x1056)
- return false;
- if (cp < 0x1058)
- return true;
- if (cp < 0x1058)
- return false;
- if (cp < 0x105a)
- return true;
- if (cp < 0x105e)
- return false;
- if (cp < 0x1061)
- return true;
- if (cp < 0x1062)
- return false;
- if (cp < 0x1065)
- return true;
- if (cp < 0x1067)
- return false;
- if (cp < 0x106e)
- return true;
- if (cp < 0x1071)
- return false;
- if (cp < 0x1075)
- return true;
- if (cp === 0x1082)
- return true;
- return false;
- }
- if (cp < 0x135d) {
- if (cp < 0x1083)
- return false;
- if (cp < 0x1085)
- return true;
- if (cp < 0x1085)
- return false;
- if (cp < 0x1087)
- return true;
- if (cp < 0x1087)
- return false;
- if (cp < 0x108d)
- return true;
- if (cp === 0x108d)
- return true;
- if (cp === 0x108f)
- return true;
- if (cp < 0x1090)
- return false;
- if (cp < 0x109a)
- return true;
- if (cp < 0x109a)
- return false;
- if (cp < 0x109d)
- return true;
- if (cp === 0x109d)
- return true;
- return false;
- }
- if (cp < 0x1360)
- return true;
- if (cp < 0x1369)
- return false;
- if (cp < 0x1372)
- return true;
- if (cp < 0x1712)
- return false;
- if (cp < 0x1715)
- return true;
- if (cp < 0x1732)
- return false;
- if (cp < 0x1735)
- return true;
- if (cp < 0x1752)
- return false;
- if (cp < 0x1754)
- return true;
- if (cp < 0x1772)
- return false;
- if (cp < 0x1774)
- return true;
- if (cp < 0x17b4)
- return false;
- if (cp < 0x17b6)
- return true;
- if (cp === 0x17b6)
- return true;
- if (cp < 0x17b7)
- return false;
- if (cp < 0x17be)
- return true;
- return false;
- }
- if (cp < 0x1a73) {
- if (cp < 0x1939) {
- if (cp < 0x18a9) {
- if (cp < 0x17be)
- return false;
- if (cp < 0x17c6)
- return true;
- if (cp === 0x17c6)
- return true;
- if (cp < 0x17c7)
- return false;
- if (cp < 0x17c9)
- return true;
- if (cp < 0x17c9)
- return false;
- if (cp < 0x17d4)
- return true;
- if (cp === 0x17dd)
- return true;
- if (cp < 0x17e0)
- return false;
- if (cp < 0x17ea)
- return true;
- if (cp < 0x180b)
- return false;
- if (cp < 0x180e)
- return true;
- if (cp < 0x1810)
- return false;
- if (cp < 0x181a)
- return true;
- return false;
- }
- if (cp === 0x18a9)
- return true;
- if (cp < 0x1920)
- return false;
- if (cp < 0x1923)
- return true;
- if (cp < 0x1923)
- return false;
- if (cp < 0x1927)
- return true;
- if (cp < 0x1927)
- return false;
- if (cp < 0x1929)
- return true;
- if (cp < 0x1929)
- return false;
- if (cp < 0x192c)
- return true;
- if (cp < 0x1930)
- return false;
- if (cp < 0x1932)
- return true;
- if (cp === 0x1932)
- return true;
- if (cp < 0x1933)
- return false;
- if (cp < 0x1939)
- return true;
- return false;
- }
- if (cp < 0x1a56) {
- if (cp < 0x1939)
- return false;
- if (cp < 0x193c)
- return true;
- if (cp < 0x1946)
- return false;
- if (cp < 0x1950)
- return true;
- if (cp < 0x19d0)
- return false;
- if (cp < 0x19da)
- return true;
- if (cp === 0x19da)
- return true;
- if (cp < 0x1a17)
- return false;
- if (cp < 0x1a19)
- return true;
- if (cp < 0x1a19)
- return false;
- if (cp < 0x1a1b)
- return true;
- if (cp === 0x1a1b)
- return true;
- if (cp === 0x1a55)
- return true;
- return false;
- }
- if (cp === 0x1a56)
- return true;
- if (cp === 0x1a57)
- return true;
- if (cp < 0x1a58)
- return false;
- if (cp < 0x1a5f)
- return true;
- if (cp === 0x1a60)
- return true;
- if (cp === 0x1a61)
- return true;
- if (cp === 0x1a62)
- return true;
- if (cp < 0x1a63)
- return false;
- if (cp < 0x1a65)
- return true;
- if (cp < 0x1a65)
- return false;
- if (cp < 0x1a6d)
- return true;
- if (cp < 0x1a6d)
- return false;
- if (cp < 0x1a73)
- return true;
- return false;
- }
- if (cp < 0x1b6b) {
- if (cp < 0x1b35) {
- if (cp < 0x1a73)
- return false;
- if (cp < 0x1a7d)
- return true;
- if (cp === 0x1a7f)
- return true;
- if (cp < 0x1a80)
- return false;
- if (cp < 0x1a8a)
- return true;
- if (cp < 0x1a90)
- return false;
- if (cp < 0x1a9a)
- return true;
- if (cp < 0x1ab0)
- return false;
- if (cp < 0x1abe)
- return true;
- if (cp < 0x1b00)
- return false;
- if (cp < 0x1b04)
- return true;
- if (cp === 0x1b04)
- return true;
- if (cp === 0x1b34)
- return true;
- return false;
- }
- if (cp === 0x1b35)
- return true;
- if (cp < 0x1b36)
- return false;
- if (cp < 0x1b3b)
- return true;
- if (cp === 0x1b3b)
- return true;
- if (cp === 0x1b3c)
- return true;
- if (cp < 0x1b3d)
- return false;
- if (cp < 0x1b42)
- return true;
- if (cp === 0x1b42)
- return true;
- if (cp < 0x1b43)
- return false;
- if (cp < 0x1b45)
- return true;
- if (cp < 0x1b50)
- return false;
- if (cp < 0x1b5a)
- return true;
- return false;
- }
- if (cp < 0x1bab) {
- if (cp < 0x1b6b)
- return false;
- if (cp < 0x1b74)
- return true;
- if (cp < 0x1b80)
- return false;
- if (cp < 0x1b82)
- return true;
- if (cp === 0x1b82)
- return true;
- if (cp === 0x1ba1)
- return true;
- if (cp < 0x1ba2)
- return false;
- if (cp < 0x1ba6)
- return true;
- if (cp < 0x1ba6)
- return false;
- if (cp < 0x1ba8)
- return true;
- if (cp < 0x1ba8)
- return false;
- if (cp < 0x1baa)
- return true;
- if (cp === 0x1baa)
- return true;
- return false;
- }
- if (cp < 0x1bae)
- return true;
- if (cp < 0x1bb0)
- return false;
- if (cp < 0x1bba)
- return true;
- if (cp === 0x1be6)
- return true;
- if (cp === 0x1be7)
- return true;
- if (cp < 0x1be8)
- return false;
- if (cp < 0x1bea)
- return true;
- if (cp < 0x1bea)
- return false;
- if (cp < 0x1bed)
- return true;
- if (cp === 0x1bed)
- return true;
- if (cp === 0x1bee)
- return true;
- if (cp < 0x1bef)
- return false;
- if (cp < 0x1bf2)
- return true;
- return false;
- }
- if (cp < 0x111d0) {
- if (cp < 0xaa43) {
- if (cp < 0xa69e) {
- if (cp < 0x1dc0) {
- if (cp < 0x1cd4) {
- if (cp < 0x1bf2)
- return false;
- if (cp < 0x1bf4)
- return true;
- if (cp < 0x1c24)
- return false;
- if (cp < 0x1c2c)
- return true;
- if (cp < 0x1c2c)
- return false;
- if (cp < 0x1c34)
- return true;
- if (cp < 0x1c34)
- return false;
- if (cp < 0x1c36)
- return true;
- if (cp < 0x1c36)
- return false;
- if (cp < 0x1c38)
- return true;
- if (cp < 0x1c40)
- return false;
- if (cp < 0x1c4a)
- return true;
- if (cp < 0x1c50)
- return false;
- if (cp < 0x1c5a)
- return true;
- if (cp < 0x1cd0)
- return false;
- if (cp < 0x1cd3)
- return true;
- return false;
- }
- if (cp < 0x1ce1)
- return true;
- if (cp === 0x1ce1)
- return true;
- if (cp < 0x1ce2)
- return false;
- if (cp < 0x1ce9)
- return true;
- if (cp === 0x1ced)
- return true;
- if (cp < 0x1cf2)
- return false;
- if (cp < 0x1cf4)
- return true;
- if (cp === 0x1cf4)
- return true;
- if (cp === 0x1cf7)
- return true;
- if (cp < 0x1cf8)
- return false;
- if (cp < 0x1cfa)
- return true;
- return false;
- }
- if (cp < 0x2d7f) {
- if (cp < 0x1dc0)
- return false;
- if (cp < 0x1dfa)
- return true;
- if (cp < 0x1dfb)
- return false;
- if (cp < 0x1e00)
- return true;
- if (cp < 0x203f)
- return false;
- if (cp < 0x2041)
- return true;
- if (cp === 0x2054)
- return true;
- if (cp < 0x20d0)
- return false;
- if (cp < 0x20dd)
- return true;
- if (cp === 0x20e1)
- return true;
- if (cp < 0x20e5)
- return false;
- if (cp < 0x20f1)
- return true;
- if (cp < 0x2cef)
- return false;
- if (cp < 0x2cf2)
- return true;
- return false;
- }
- if (cp === 0x2d7f)
- return true;
- if (cp < 0x2de0)
- return false;
- if (cp < 0x2e00)
- return true;
- if (cp < 0x302a)
- return false;
- if (cp < 0x302e)
- return true;
- if (cp < 0x302e)
- return false;
- if (cp < 0x3030)
- return true;
- if (cp < 0x3099)
- return false;
- if (cp < 0x309b)
- return true;
- if (cp < 0xa620)
- return false;
- if (cp < 0xa62a)
- return true;
- if (cp === 0xa66f)
- return true;
- if (cp < 0xa674)
- return false;
- if (cp < 0xa67e)
- return true;
- return false;
- }
- if (cp < 0xa952) {
- if (cp < 0xa880) {
- if (cp < 0xa69e)
- return false;
- if (cp < 0xa6a0)
- return true;
- if (cp < 0xa6f0)
- return false;
- if (cp < 0xa6f2)
- return true;
- if (cp === 0xa802)
- return true;
- if (cp === 0xa806)
- return true;
- if (cp === 0xa80b)
- return true;
- if (cp < 0xa823)
- return false;
- if (cp < 0xa825)
- return true;
- if (cp < 0xa825)
- return false;
- if (cp < 0xa827)
- return true;
- if (cp === 0xa827)
- return true;
- return false;
- }
- if (cp < 0xa882)
- return true;
- if (cp < 0xa8b4)
- return false;
- if (cp < 0xa8c4)
- return true;
- if (cp < 0xa8c4)
- return false;
- if (cp < 0xa8c6)
- return true;
- if (cp < 0xa8d0)
- return false;
- if (cp < 0xa8da)
- return true;
- if (cp < 0xa8e0)
- return false;
- if (cp < 0xa8f2)
- return true;
- if (cp < 0xa900)
- return false;
- if (cp < 0xa90a)
- return true;
- if (cp < 0xa926)
- return false;
- if (cp < 0xa92e)
- return true;
- if (cp < 0xa947)
- return false;
- if (cp < 0xa952)
- return true;
- return false;
- }
- if (cp < 0xa9bd) {
- if (cp < 0xa952)
- return false;
- if (cp < 0xa954)
- return true;
- if (cp < 0xa980)
- return false;
- if (cp < 0xa983)
- return true;
- if (cp === 0xa983)
- return true;
- if (cp === 0xa9b3)
- return true;
- if (cp < 0xa9b4)
- return false;
- if (cp < 0xa9b6)
- return true;
- if (cp < 0xa9b6)
- return false;
- if (cp < 0xa9ba)
- return true;
- if (cp < 0xa9ba)
- return false;
- if (cp < 0xa9bc)
- return true;
- if (cp === 0xa9bc)
- return true;
- return false;
- }
- if (cp < 0xa9c1)
- return true;
- if (cp < 0xa9d0)
- return false;
- if (cp < 0xa9da)
- return true;
- if (cp === 0xa9e5)
- return true;
- if (cp < 0xa9f0)
- return false;
- if (cp < 0xa9fa)
- return true;
- if (cp < 0xaa29)
- return false;
- if (cp < 0xaa2f)
- return true;
- if (cp < 0xaa2f)
- return false;
- if (cp < 0xaa31)
- return true;
- if (cp < 0xaa31)
- return false;
- if (cp < 0xaa33)
- return true;
- if (cp < 0xaa33)
- return false;
- if (cp < 0xaa35)
- return true;
- if (cp < 0xaa35)
- return false;
- if (cp < 0xaa37)
- return true;
- return false;
- }
- if (cp < 0x102e0) {
- if (cp < 0xaaf6) {
- if (cp < 0xaab2) {
- if (cp === 0xaa43)
- return true;
- if (cp === 0xaa4c)
- return true;
- if (cp === 0xaa4d)
- return true;
- if (cp < 0xaa50)
- return false;
- if (cp < 0xaa5a)
- return true;
- if (cp === 0xaa7b)
- return true;
- if (cp === 0xaa7c)
- return true;
- if (cp === 0xaa7d)
- return true;
- if (cp === 0xaab0)
- return true;
- return false;
- }
- if (cp < 0xaab5)
- return true;
- if (cp < 0xaab7)
- return false;
- if (cp < 0xaab9)
- return true;
- if (cp < 0xaabe)
- return false;
- if (cp < 0xaac0)
- return true;
- if (cp === 0xaac1)
- return true;
- if (cp === 0xaaeb)
- return true;
- if (cp < 0xaaec)
- return false;
- if (cp < 0xaaee)
- return true;
- if (cp < 0xaaee)
- return false;
- if (cp < 0xaaf0)
- return true;
- if (cp === 0xaaf5)
- return true;
- return false;
- }
- if (cp < 0xabf0) {
- if (cp === 0xaaf6)
- return true;
- if (cp < 0xabe3)
- return false;
- if (cp < 0xabe5)
- return true;
- if (cp === 0xabe5)
- return true;
- if (cp < 0xabe6)
- return false;
- if (cp < 0xabe8)
- return true;
- if (cp === 0xabe8)
- return true;
- if (cp < 0xabe9)
- return false;
- if (cp < 0xabeb)
- return true;
- if (cp === 0xabec)
- return true;
- if (cp === 0xabed)
- return true;
- return false;
- }
- if (cp < 0xabfa)
- return true;
- if (cp === 0xfb1e)
- return true;
- if (cp < 0xfe00)
- return false;
- if (cp < 0xfe10)
- return true;
- if (cp < 0xfe20)
- return false;
- if (cp < 0xfe30)
- return true;
- if (cp < 0xfe33)
- return false;
- if (cp < 0xfe35)
- return true;
- if (cp < 0xfe4d)
- return false;
- if (cp < 0xfe50)
- return true;
- if (cp < 0xff10)
- return false;
- if (cp < 0xff1a)
- return true;
- if (cp === 0xff3f)
- return true;
- if (cp === 0x101fd)
- return true;
- return false;
- }
- if (cp < 0x110b0) {
- if (cp < 0x10ae5) {
- if (cp === 0x102e0)
- return true;
- if (cp < 0x10376)
- return false;
- if (cp < 0x1037b)
- return true;
- if (cp < 0x104a0)
- return false;
- if (cp < 0x104aa)
- return true;
- if (cp < 0x10a01)
- return false;
- if (cp < 0x10a04)
- return true;
- if (cp < 0x10a05)
- return false;
- if (cp < 0x10a07)
- return true;
- if (cp < 0x10a0c)
- return false;
- if (cp < 0x10a10)
- return true;
- if (cp < 0x10a38)
- return false;
- if (cp < 0x10a3b)
- return true;
- if (cp === 0x10a3f)
- return true;
- return false;
- }
- if (cp < 0x10ae7)
- return true;
- if (cp === 0x11000)
- return true;
- if (cp === 0x11001)
- return true;
- if (cp === 0x11002)
- return true;
- if (cp < 0x11038)
- return false;
- if (cp < 0x11047)
- return true;
- if (cp < 0x11066)
- return false;
- if (cp < 0x11070)
- return true;
- if (cp < 0x1107f)
- return false;
- if (cp < 0x11082)
- return true;
- if (cp === 0x11082)
- return true;
- return false;
- }
- if (cp < 0x1112d) {
- if (cp < 0x110b0)
- return false;
- if (cp < 0x110b3)
- return true;
- if (cp < 0x110b3)
- return false;
- if (cp < 0x110b7)
- return true;
- if (cp < 0x110b7)
- return false;
- if (cp < 0x110b9)
- return true;
- if (cp < 0x110b9)
- return false;
- if (cp < 0x110bb)
- return true;
- if (cp < 0x110f0)
- return false;
- if (cp < 0x110fa)
- return true;
- if (cp < 0x11100)
- return false;
- if (cp < 0x11103)
- return true;
- if (cp < 0x11127)
- return false;
- if (cp < 0x1112c)
- return true;
- if (cp === 0x1112c)
- return true;
- return false;
- }
- if (cp < 0x11135)
- return true;
- if (cp < 0x11136)
- return false;
- if (cp < 0x11140)
- return true;
- if (cp === 0x11173)
- return true;
- if (cp < 0x11180)
- return false;
- if (cp < 0x11182)
- return true;
- if (cp === 0x11182)
- return true;
- if (cp < 0x111b3)
- return false;
- if (cp < 0x111b6)
- return true;
- if (cp < 0x111b6)
- return false;
- if (cp < 0x111bf)
- return true;
- if (cp < 0x111bf)
- return false;
- if (cp < 0x111c1)
- return true;
- if (cp < 0x111ca)
- return false;
- if (cp < 0x111cd)
- return true;
- return false;
- }
- if (cp < 0x11726) {
- if (cp < 0x114b3) {
- if (cp < 0x11340) {
- if (cp < 0x112df) {
- if (cp < 0x111d0)
- return false;
- if (cp < 0x111da)
- return true;
- if (cp < 0x1122c)
- return false;
- if (cp < 0x1122f)
- return true;
- if (cp < 0x1122f)
- return false;
- if (cp < 0x11232)
- return true;
- if (cp < 0x11232)
- return false;
- if (cp < 0x11234)
- return true;
- if (cp === 0x11234)
- return true;
- if (cp === 0x11235)
- return true;
- if (cp < 0x11236)
- return false;
- if (cp < 0x11238)
- return true;
- if (cp === 0x1123e)
- return true;
- return false;
- }
- if (cp === 0x112df)
- return true;
- if (cp < 0x112e0)
- return false;
- if (cp < 0x112e3)
- return true;
- if (cp < 0x112e3)
- return false;
- if (cp < 0x112eb)
- return true;
- if (cp < 0x112f0)
- return false;
- if (cp < 0x112fa)
- return true;
- if (cp < 0x11300)
- return false;
- if (cp < 0x11302)
- return true;
- if (cp < 0x11302)
- return false;
- if (cp < 0x11304)
- return true;
- if (cp === 0x1133c)
- return true;
- if (cp < 0x1133e)
- return false;
- if (cp < 0x11340)
- return true;
- return false;
- }
- if (cp < 0x11435) {
- if (cp === 0x11340)
- return true;
- if (cp < 0x11341)
- return false;
- if (cp < 0x11345)
- return true;
- if (cp < 0x11347)
- return false;
- if (cp < 0x11349)
- return true;
- if (cp < 0x1134b)
- return false;
- if (cp < 0x1134e)
- return true;
- if (cp === 0x11357)
- return true;
- if (cp < 0x11362)
- return false;
- if (cp < 0x11364)
- return true;
- if (cp < 0x11366)
- return false;
- if (cp < 0x1136d)
- return true;
- if (cp < 0x11370)
- return false;
- if (cp < 0x11375)
- return true;
- return false;
- }
- if (cp < 0x11438)
- return true;
- if (cp < 0x11438)
- return false;
- if (cp < 0x11440)
- return true;
- if (cp < 0x11440)
- return false;
- if (cp < 0x11442)
- return true;
- if (cp < 0x11442)
- return false;
- if (cp < 0x11445)
- return true;
- if (cp === 0x11445)
- return true;
- if (cp === 0x11446)
- return true;
- if (cp < 0x11450)
- return false;
- if (cp < 0x1145a)
- return true;
- if (cp < 0x114b0)
- return false;
- if (cp < 0x114b3)
- return true;
- return false;
- }
- if (cp < 0x11633) {
- if (cp < 0x115af) {
- if (cp < 0x114b3)
- return false;
- if (cp < 0x114b9)
- return true;
- if (cp === 0x114b9)
- return true;
- if (cp === 0x114ba)
- return true;
- if (cp < 0x114bb)
- return false;
- if (cp < 0x114bf)
- return true;
- if (cp < 0x114bf)
- return false;
- if (cp < 0x114c1)
- return true;
- if (cp === 0x114c1)
- return true;
- if (cp < 0x114c2)
- return false;
- if (cp < 0x114c4)
- return true;
- if (cp < 0x114d0)
- return false;
- if (cp < 0x114da)
- return true;
- return false;
- }
- if (cp < 0x115b2)
- return true;
- if (cp < 0x115b2)
- return false;
- if (cp < 0x115b6)
- return true;
- if (cp < 0x115b8)
- return false;
- if (cp < 0x115bc)
- return true;
- if (cp < 0x115bc)
- return false;
- if (cp < 0x115be)
- return true;
- if (cp === 0x115be)
- return true;
- if (cp < 0x115bf)
- return false;
- if (cp < 0x115c1)
- return true;
- if (cp < 0x115dc)
- return false;
- if (cp < 0x115de)
- return true;
- if (cp < 0x11630)
- return false;
- if (cp < 0x11633)
- return true;
- return false;
- }
- if (cp < 0x116ad) {
- if (cp < 0x11633)
- return false;
- if (cp < 0x1163b)
- return true;
- if (cp < 0x1163b)
- return false;
- if (cp < 0x1163d)
- return true;
- if (cp === 0x1163d)
- return true;
- if (cp === 0x1163e)
- return true;
- if (cp < 0x1163f)
- return false;
- if (cp < 0x11641)
- return true;
- if (cp < 0x11650)
- return false;
- if (cp < 0x1165a)
- return true;
- if (cp === 0x116ab)
- return true;
- if (cp === 0x116ac)
- return true;
- return false;
- }
- if (cp === 0x116ad)
- return true;
- if (cp < 0x116ae)
- return false;
- if (cp < 0x116b0)
- return true;
- if (cp < 0x116b0)
- return false;
- if (cp < 0x116b6)
- return true;
- if (cp === 0x116b6)
- return true;
- if (cp === 0x116b7)
- return true;
- if (cp < 0x116c0)
- return false;
- if (cp < 0x116ca)
- return true;
- if (cp < 0x1171d)
- return false;
- if (cp < 0x11720)
- return true;
- if (cp < 0x11720)
- return false;
- if (cp < 0x11722)
- return true;
- if (cp < 0x11722)
- return false;
- if (cp < 0x11726)
- return true;
- return false;
- }
- if (cp < 0x11d3f) {
- if (cp < 0x11a98) {
- if (cp < 0x11a39) {
- if (cp === 0x11726)
- return true;
- if (cp < 0x11727)
- return false;
- if (cp < 0x1172c)
- return true;
- if (cp < 0x11730)
- return false;
- if (cp < 0x1173a)
- return true;
- if (cp < 0x118e0)
- return false;
- if (cp < 0x118ea)
- return true;
- if (cp < 0x11a01)
- return false;
- if (cp < 0x11a07)
- return true;
- if (cp < 0x11a07)
- return false;
- if (cp < 0x11a09)
- return true;
- if (cp < 0x11a09)
- return false;
- if (cp < 0x11a0b)
- return true;
- if (cp < 0x11a33)
- return false;
- if (cp < 0x11a39)
- return true;
- return false;
- }
- if (cp === 0x11a39)
- return true;
- if (cp < 0x11a3b)
- return false;
- if (cp < 0x11a3f)
- return true;
- if (cp === 0x11a47)
- return true;
- if (cp < 0x11a51)
- return false;
- if (cp < 0x11a57)
- return true;
- if (cp < 0x11a57)
- return false;
- if (cp < 0x11a59)
- return true;
- if (cp < 0x11a59)
- return false;
- if (cp < 0x11a5c)
- return true;
- if (cp < 0x11a8a)
- return false;
- if (cp < 0x11a97)
- return true;
- if (cp === 0x11a97)
- return true;
- return false;
- }
- if (cp < 0x11ca9) {
- if (cp < 0x11a98)
- return false;
- if (cp < 0x11a9a)
- return true;
- if (cp === 0x11c2f)
- return true;
- if (cp < 0x11c30)
- return false;
- if (cp < 0x11c37)
- return true;
- if (cp < 0x11c38)
- return false;
- if (cp < 0x11c3e)
- return true;
- if (cp === 0x11c3e)
- return true;
- if (cp === 0x11c3f)
- return true;
- if (cp < 0x11c50)
- return false;
- if (cp < 0x11c5a)
- return true;
- if (cp < 0x11c92)
- return false;
- if (cp < 0x11ca8)
- return true;
- return false;
- }
- if (cp === 0x11ca9)
- return true;
- if (cp < 0x11caa)
- return false;
- if (cp < 0x11cb1)
- return true;
- if (cp === 0x11cb1)
- return true;
- if (cp < 0x11cb2)
- return false;
- if (cp < 0x11cb4)
- return true;
- if (cp === 0x11cb4)
- return true;
- if (cp < 0x11cb5)
- return false;
- if (cp < 0x11cb7)
- return true;
- if (cp < 0x11d31)
- return false;
- if (cp < 0x11d37)
- return true;
- if (cp === 0x11d3a)
- return true;
- if (cp < 0x11d3c)
- return false;
- if (cp < 0x11d3e)
- return true;
- return false;
- }
- if (cp < 0x1d242) {
- if (cp < 0x16f8f) {
- if (cp < 0x11d3f)
- return false;
- if (cp < 0x11d46)
- return true;
- if (cp === 0x11d47)
- return true;
- if (cp < 0x11d50)
- return false;
- if (cp < 0x11d5a)
- return true;
- if (cp < 0x16a60)
- return false;
- if (cp < 0x16a6a)
- return true;
- if (cp < 0x16af0)
- return false;
- if (cp < 0x16af5)
- return true;
- if (cp < 0x16b30)
- return false;
- if (cp < 0x16b37)
- return true;
- if (cp < 0x16b50)
- return false;
- if (cp < 0x16b5a)
- return true;
- if (cp < 0x16f51)
- return false;
- if (cp < 0x16f7f)
- return true;
- return false;
- }
- if (cp < 0x16f93)
- return true;
- if (cp < 0x1bc9d)
- return false;
- if (cp < 0x1bc9f)
- return true;
- if (cp < 0x1d165)
- return false;
- if (cp < 0x1d167)
- return true;
- if (cp < 0x1d167)
- return false;
- if (cp < 0x1d16a)
- return true;
- if (cp < 0x1d16d)
- return false;
- if (cp < 0x1d173)
- return true;
- if (cp < 0x1d17b)
- return false;
- if (cp < 0x1d183)
- return true;
- if (cp < 0x1d185)
- return false;
- if (cp < 0x1d18c)
- return true;
- if (cp < 0x1d1aa)
- return false;
- if (cp < 0x1d1ae)
- return true;
- return false;
- }
- if (cp < 0x1e000) {
- if (cp < 0x1d242)
- return false;
- if (cp < 0x1d245)
- return true;
- if (cp < 0x1d7ce)
- return false;
- if (cp < 0x1d800)
- return true;
- if (cp < 0x1da00)
- return false;
- if (cp < 0x1da37)
- return true;
- if (cp < 0x1da3b)
- return false;
- if (cp < 0x1da6d)
- return true;
- if (cp === 0x1da75)
- return true;
- if (cp === 0x1da84)
- return true;
- if (cp < 0x1da9b)
- return false;
- if (cp < 0x1daa0)
- return true;
- if (cp < 0x1daa1)
- return false;
- if (cp < 0x1dab0)
- return true;
- return false;
- }
- if (cp < 0x1e007)
- return true;
- if (cp < 0x1e008)
- return false;
- if (cp < 0x1e019)
- return true;
- if (cp < 0x1e01b)
- return false;
- if (cp < 0x1e022)
- return true;
- if (cp < 0x1e023)
- return false;
- if (cp < 0x1e025)
- return true;
- if (cp < 0x1e026)
- return false;
- if (cp < 0x1e02b)
- return true;
- if (cp < 0x1e8d0)
- return false;
- if (cp < 0x1e8d7)
- return true;
- if (cp < 0x1e944)
- return false;
- if (cp < 0x1e94b)
- return true;
- if (cp < 0x1e950)
- return false;
- if (cp < 0x1e95a)
- return true;
- if (cp < 0xe0100)
- return false;
- if (cp < 0xe01f0)
- return true;
- return false;
- }
- const PropertyData = {
- $LONE: new Set([
- "ASCII",
- "ASCII_Hex_Digit",
- "AHex",
- "Alphabetic",
- "Alpha",
- "Any",
- "Assigned",
- "Bidi_Control",
- "Bidi_C",
- "Bidi_Mirrored",
- "Bidi_M",
- "Case_Ignorable",
- "CI",
- "Cased",
- "Changes_When_Casefolded",
- "CWCF",
- "Changes_When_Casemapped",
- "CWCM",
- "Changes_When_Lowercased",
- "CWL",
- "Changes_When_NFKC_Casefolded",
- "CWKCF",
- "Changes_When_Titlecased",
- "CWT",
- "Changes_When_Uppercased",
- "CWU",
- "Dash",
- "Default_Ignorable_Code_Point",
- "DI",
- "Deprecated",
- "Dep",
- "Diacritic",
- "Dia",
- "Emoji",
- "Emoji_Component",
- "Emoji_Modifier",
- "Emoji_Modifier_Base",
- "Emoji_Presentation",
- "Extender",
- "Ext",
- "Grapheme_Base",
- "Gr_Base",
- "Grapheme_Extend",
- "Gr_Ext",
- "Hex_Digit",
- "Hex",
- "IDS_Binary_Operator",
- "IDSB",
- "IDS_Trinary_Operator",
- "IDST",
- "ID_Continue",
- "IDC",
- "ID_Start",
- "IDS",
- "Ideographic",
- "Ideo",
- "Join_Control",
- "Join_C",
- "Logical_Order_Exception",
- "LOE",
- "Lowercase",
- "Lower",
- "Math",
- "Noncharacter_Code_Point",
- "NChar",
- "Pattern_Syntax",
- "Pat_Syn",
- "Pattern_White_Space",
- "Pat_WS",
- "Quotation_Mark",
- "QMark",
- "Radical",
- "Regional_Indicator",
- "RI",
- "Sentence_Terminal",
- "STerm",
- "Soft_Dotted",
- "SD",
- "Terminal_Punctuation",
- "Term",
- "Unified_Ideograph",
- "UIdeo",
- "Uppercase",
- "Upper",
- "Variation_Selector",
- "VS",
- "White_Space",
- "space",
- "XID_Continue",
- "XIDC",
- "XID_Start",
- "XIDS",
- ]),
- General_Category: new Set([
- "Cased_Letter",
- "LC",
- "Close_Punctuation",
- "Pe",
- "Connector_Punctuation",
- "Pc",
- "Control",
- "Cc",
- "cntrl",
- "Currency_Symbol",
- "Sc",
- "Dash_Punctuation",
- "Pd",
- "Decimal_Number",
- "Nd",
- "digit",
- "Enclosing_Mark",
- "Me",
- "Final_Punctuation",
- "Pf",
- "Format",
- "Cf",
- "Initial_Punctuation",
- "Pi",
- "Letter",
- "L",
- "Letter_Number",
- "Nl",
- "Line_Separator",
- "Zl",
- "Lowercase_Letter",
- "Ll",
- "Mark",
- "M",
- "Combining_Mark",
- "Math_Symbol",
- "Sm",
- "Modifier_Letter",
- "Lm",
- "Modifier_Symbol",
- "Sk",
- "Nonspacing_Mark",
- "Mn",
- "Number",
- "N",
- "Open_Punctuation",
- "Ps",
- "Other",
- "C",
- "Other_Letter",
- "Lo",
- "Other_Number",
- "No",
- "Other_Punctuation",
- "Po",
- "Other_Symbol",
- "So",
- "Paragraph_Separator",
- "Zp",
- "Private_Use",
- "Co",
- "Punctuation",
- "P",
- "punct",
- "Separator",
- "Z",
- "Space_Separator",
- "Zs",
- "Spacing_Mark",
- "Mc",
- "Surrogate",
- "Cs",
- "Symbol",
- "S",
- "Titlecase_Letter",
- "Lt",
- "Unassigned",
- "Cn",
- "Uppercase_Letter",
- "Lu",
- ]),
- Script: new Set([
- "Adlam",
- "Adlm",
- "Ahom",
- "Anatolian_Hieroglyphs",
- "Hluw",
- "Arabic",
- "Arab",
- "Armenian",
- "Armn",
- "Avestan",
- "Avst",
- "Balinese",
- "Bali",
- "Bamum",
- "Bamu",
- "Bassa_Vah",
- "Bass",
- "Batak",
- "Batk",
- "Bengali",
- "Beng",
- "Bhaiksuki",
- "Bhks",
- "Bopomofo",
- "Bopo",
- "Brahmi",
- "Brah",
- "Braille",
- "Brai",
- "Buginese",
- "Bugi",
- "Buhid",
- "Buhd",
- "Canadian_Aboriginal",
- "Cans",
- "Carian",
- "Cari",
- "Caucasian_Albanian",
- "Aghb",
- "Chakma",
- "Cakm",
- "Cham",
- "Cherokee",
- "Cher",
- "Common",
- "Zyyy",
- "Coptic",
- "Copt",
- "Qaac",
- "Cuneiform",
- "Xsux",
- "Cypriot",
- "Cprt",
- "Cyrillic",
- "Cyrl",
- "Deseret",
- "Dsrt",
- "Devanagari",
- "Deva",
- "Duployan",
- "Dupl",
- "Egyptian_Hieroglyphs",
- "Egyp",
- "Elbasan",
- "Elba",
- "Ethiopic",
- "Ethi",
- "Georgian",
- "Geor",
- "Glagolitic",
- "Glag",
- "Gothic",
- "Goth",
- "Grantha",
- "Gran",
- "Greek",
- "Grek",
- "Gujarati",
- "Gujr",
- "Gurmukhi",
- "Guru",
- "Han",
- "Hani",
- "Hangul",
- "Hang",
- "Hanunoo",
- "Hano",
- "Hatran",
- "Hatr",
- "Hebrew",
- "Hebr",
- "Hiragana",
- "Hira",
- "Imperial_Aramaic",
- "Armi",
- "Inherited",
- "Zinh",
- "Qaai",
- "Inscriptional_Pahlavi",
- "Phli",
- "Inscriptional_Parthian",
- "Prti",
- "Javanese",
- "Java",
- "Kaithi",
- "Kthi",
- "Kannada",
- "Knda",
- "Katakana",
- "Kana",
- "Kayah_Li",
- "Kali",
- "Kharoshthi",
- "Khar",
- "Khmer",
- "Khmr",
- "Khojki",
- "Khoj",
- "Khudawadi",
- "Sind",
- "Lao",
- "Laoo",
- "Latin",
- "Latn",
- "Lepcha",
- "Lepc",
- "Limbu",
- "Limb",
- "Linear_A",
- "Lina",
- "Linear_B",
- "Linb",
- "Lisu",
- "Lycian",
- "Lyci",
- "Lydian",
- "Lydi",
- "Mahajani",
- "Mahj",
- "Malayalam",
- "Mlym",
- "Mandaic",
- "Mand",
- "Manichaean",
- "Mani",
- "Marchen",
- "Marc",
- "Masaram_Gondi",
- "Gonm",
- "Meetei_Mayek",
- "Mtei",
- "Mende_Kikakui",
- "Mend",
- "Meroitic_Cursive",
- "Merc",
- "Meroitic_Hieroglyphs",
- "Mero",
- "Miao",
- "Plrd",
- "Modi",
- "Mongolian",
- "Mong",
- "Mro",
- "Mroo",
- "Multani",
- "Mult",
- "Myanmar",
- "Mymr",
- "Nabataean",
- "Nbat",
- "New_Tai_Lue",
- "Talu",
- "Newa",
- "Nko",
- "Nkoo",
- "Nushu",
- "Nshu",
- "Ogham",
- "Ogam",
- "Ol_Chiki",
- "Olck",
- "Old_Hungarian",
- "Hung",
- "Old_Italic",
- "Ital",
- "Old_North_Arabian",
- "Narb",
- "Old_Permic",
- "Perm",
- "Old_Persian",
- "Xpeo",
- "Old_South_Arabian",
- "Sarb",
- "Old_Turkic",
- "Orkh",
- "Oriya",
- "Orya",
- "Osage",
- "Osge",
- "Osmanya",
- "Osma",
- "Pahawh_Hmong",
- "Hmng",
- "Palmyrene",
- "Palm",
- "Pau_Cin_Hau",
- "Pauc",
- "Phags_Pa",
- "Phag",
- "Phoenician",
- "Phnx",
- "Psalter_Pahlavi",
- "Phlp",
- "Rejang",
- "Rjng",
- "Runic",
- "Runr",
- "Samaritan",
- "Samr",
- "Saurashtra",
- "Saur",
- "Sharada",
- "Shrd",
- "Shavian",
- "Shaw",
- "Siddham",
- "Sidd",
- "SignWriting",
- "Sgnw",
- "Sinhala",
- "Sinh",
- "Sora_Sompeng",
- "Sora",
- "Soyombo",
- "Soyo",
- "Sundanese",
- "Sund",
- "Syloti_Nagri",
- "Sylo",
- "Syriac",
- "Syrc",
- "Tagalog",
- "Tglg",
- "Tagbanwa",
- "Tagb",
- "Tai_Le",
- "Tale",
- "Tai_Tham",
- "Lana",
- "Tai_Viet",
- "Tavt",
- "Takri",
- "Takr",
- "Tamil",
- "Taml",
- "Tangut",
- "Tang",
- "Telugu",
- "Telu",
- "Thaana",
- "Thaa",
- "Thai",
- "Tibetan",
- "Tibt",
- "Tifinagh",
- "Tfng",
- "Tirhuta",
- "Tirh",
- "Ugaritic",
- "Ugar",
- "Vai",
- "Vaii",
- "Warang_Citi",
- "Wara",
- "Yi",
- "Yiii",
- "Zanabazar_Square",
- "Zanb",
- ]),
- };
- PropertyData.gc = PropertyData.General_Category;
- PropertyData.sc = PropertyData.Script_Extensions = PropertyData.scx =
- PropertyData.Script;
- const Backspace = 0x08;
- const CharacterTabulation = 0x09;
- const LineFeed = 0x0a;
- const LineTabulation = 0x0b;
- const FormFeed = 0x0c;
- const CarriageReturn = 0x0d;
- const ExclamationMark = 0x21;
- const DollarSign = 0x24;
- const LeftParenthesis = 0x28;
- const RightParenthesis = 0x29;
- const Asterisk = 0x2a;
- const PlusSign = 0x2b;
- const Comma = 0x2c;
- const HyphenMinus = 0x2d;
- const FullStop = 0x2e;
- const Solidus = 0x2f;
- const DigitZero = 0x30;
- const DigitOne = 0x31;
- const DigitSeven = 0x37;
- const DigitNine = 0x39;
- const Colon = 0x3a;
- const LessThanSign = 0x3c;
- const EqualsSign = 0x3d;
- const GreaterThanSign = 0x3e;
- const QuestionMark = 0x3f;
- const LatinCapitalLetterA = 0x41;
- const LatinCapitalLetterB = 0x42;
- const LatinCapitalLetterD = 0x44;
- const LatinCapitalLetterF = 0x46;
- const LatinCapitalLetterP = 0x50;
- const LatinCapitalLetterS = 0x53;
- const LatinCapitalLetterW = 0x57;
- const LatinCapitalLetterZ = 0x5a;
- const LowLine = 0x5f;
- const LatinSmallLetterA = 0x61;
- const LatinSmallLetterB = 0x62;
- const LatinSmallLetterC = 0x63;
- const LatinSmallLetterD = 0x64;
- const LatinSmallLetterF = 0x66;
- const LatinSmallLetterG = 0x67;
- const LatinSmallLetterI = 0x69;
- const LatinSmallLetterK = 0x6b;
- const LatinSmallLetterM = 0x6d;
- const LatinSmallLetterN = 0x6e;
- const LatinSmallLetterP = 0x70;
- const LatinSmallLetterR = 0x72;
- const LatinSmallLetterS = 0x73;
- const LatinSmallLetterT = 0x74;
- const LatinSmallLetterU = 0x75;
- const LatinSmallLetterV = 0x76;
- const LatinSmallLetterW = 0x77;
- const LatinSmallLetterX = 0x78;
- const LatinSmallLetterY = 0x79;
- const LatinSmallLetterZ = 0x7a;
- const LeftSquareBracket = 0x5b;
- const ReverseSolidus = 0x5c;
- const RightSquareBracket = 0x5d;
- const CircumflexAccent = 0x5e;
- const LeftCurlyBracket = 0x7b;
- const VerticalLine = 0x7c;
- const RightCurlyBracket = 0x7d;
- const ZeroWidthNonJoiner = 0x200c;
- const ZeroWidthJoiner = 0x200d;
- const LineSeparator = 0x2028;
- const ParagraphSeparator = 0x2029;
- const MinCodePoint = 0x00;
- const MaxCodePoint = 0x10ffff;
- function isLatinLetter(code) {
- return ((code >= LatinCapitalLetterA && code <= LatinCapitalLetterZ) ||
- (code >= LatinSmallLetterA && code <= LatinSmallLetterZ));
- }
- function isDecimalDigit(code) {
- return code >= DigitZero && code <= DigitNine;
- }
- function isOctalDigit(code) {
- return code >= DigitZero && code <= DigitSeven;
- }
- function isHexDigit(code) {
- return ((code >= DigitZero && code <= DigitNine) ||
- (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) ||
- (code >= LatinSmallLetterA && code <= LatinSmallLetterF));
- }
- function isLineTerminator(code) {
- return (code === LineFeed ||
- code === CarriageReturn ||
- code === LineSeparator ||
- code === ParagraphSeparator);
- }
- function isValidUnicode(code) {
- return code >= MinCodePoint && code <= MaxCodePoint;
- }
- function digitToInt(code) {
- if (code >= LatinSmallLetterA && code <= LatinSmallLetterF) {
- return code - LatinSmallLetterA + 10;
- }
- if (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) {
- return code - LatinCapitalLetterA + 10;
- }
- return code - DigitZero;
- }
- function isSyntaxCharacter(cp) {
- return (cp === CircumflexAccent ||
- cp === DollarSign ||
- cp === ReverseSolidus ||
- cp === FullStop ||
- cp === Asterisk ||
- cp === PlusSign ||
- cp === QuestionMark ||
- cp === LeftParenthesis ||
- cp === RightParenthesis ||
- cp === LeftSquareBracket ||
- cp === RightSquareBracket ||
- cp === LeftCurlyBracket ||
- cp === RightCurlyBracket ||
- cp === VerticalLine);
- }
- function isRegExpIdentifierStart(cp) {
- return isIdStart(cp) || cp === DollarSign || cp === LowLine;
- }
- function isRegExpIdentifierPart(cp) {
- return (isIdContinue(cp) ||
- cp === DollarSign ||
- cp === LowLine ||
- cp === ZeroWidthNonJoiner ||
- cp === ZeroWidthJoiner);
- }
- function isUnicodePropertyNameCharacter(cp) {
- return isLatinLetter(cp) || cp === LowLine;
- }
- function isUnicodePropertyValueCharacter(cp) {
- return isUnicodePropertyNameCharacter(cp) || isDecimalDigit(cp);
- }
- function isValidUnicodeProperty(name, value) {
- return PropertyData.hasOwnProperty(name) && PropertyData[name].has(value);
- }
- function isValidUnicodePropertyName(name) {
- return PropertyData.$LONE.has(name);
- }
- class RegExpValidator {
- constructor(options) {
- this._reader = new Reader();
- this._uFlag = false;
- this._nFlag = false;
- this._lastIntValue = 0;
- this._lastMinValue = 0;
- this._lastMaxValue = 0;
- this._lastStrValue = "";
- this._lastKeyValue = "";
- this._lastValValue = "";
- this._lastAssertionIsQuantifiable = false;
- this._numCapturingParens = 0;
- this._groupNames = new Set();
- this._backreferenceNames = new Set();
- this._options = options || {};
- }
- validateLiteral(source, start = 0, end = source.length) {
- this._uFlag = this._nFlag = false;
- this.reset(source, start, end);
- this.onLiteralEnter(start);
- if (this.eat(Solidus) && this.eatRegExpBody() && this.eat(Solidus)) {
- const flagStart = this.index;
- const uFlag = source.indexOf("u", flagStart) !== -1;
- this.validateFlags(source, flagStart, end);
- this.validatePattern(source, start + 1, flagStart - 1, uFlag);
- }
- else if (start >= end) {
- this.raise("Empty");
- }
- else {
- const c = String.fromCodePoint(this.currentCodePoint);
- this.raise(`Unexpected character '${c}'`);
- }
- this.onLiteralLeave(start, end);
- }
- validateFlags(source, start = 0, end = source.length) {
- const existingFlags = new Set();
- let global = false;
- let ignoreCase = false;
- let multiline = false;
- let sticky = false;
- let unicode = false;
- let dotAll = false;
- for (let i = start; i < end; ++i) {
- const flag = source.charCodeAt(i);
- if (existingFlags.has(flag)) {
- this.raise(`Duplicated flag '${source[i]}'`);
- }
- existingFlags.add(flag);
- if (flag === LatinSmallLetterG) {
- global = true;
- }
- else if (flag === LatinSmallLetterI) {
- ignoreCase = true;
- }
- else if (flag === LatinSmallLetterM) {
- multiline = true;
- }
- else if (flag === LatinSmallLetterU && this.ecmaVersion >= 2015) {
- unicode = true;
- }
- else if (flag === LatinSmallLetterY && this.ecmaVersion >= 2015) {
- sticky = true;
- }
- else if (flag === LatinSmallLetterS && this.ecmaVersion >= 2018) {
- dotAll = true;
- }
- else {
- this.raise(`Invalid flag '${source[i]}'`);
- }
- }
- this.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll);
- }
- validatePattern(source, start = 0, end = source.length, uFlag = false) {
- this._uFlag = uFlag && this.ecmaVersion >= 2015;
- this._nFlag = uFlag && this.ecmaVersion >= 2018;
- this.reset(source, start, end);
- this.pattern();
- if (!this._nFlag &&
- this.ecmaVersion >= 2018 &&
- this._groupNames.size > 0) {
- this._nFlag = true;
- this.rewind(start);
- this.pattern();
- }
- }
- get strict() {
- return Boolean(this._options.strict || this._uFlag);
- }
- get ecmaVersion() {
- return this._options.ecmaVersion || 2018;
- }
- onLiteralEnter(start) {
- if (this._options.onLiteralEnter) {
- this._options.onLiteralEnter(start);
- }
- }
- onLiteralLeave(start, end) {
- if (this._options.onLiteralLeave) {
- this._options.onLiteralLeave(start, end);
- }
- }
- onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll) {
- if (this._options.onFlags) {
- this._options.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll);
- }
- }
- onPatternEnter(start) {
- if (this._options.onPatternEnter) {
- this._options.onPatternEnter(start);
- }
- }
- onPatternLeave(start, end) {
- if (this._options.onPatternLeave) {
- this._options.onPatternLeave(start, end);
- }
- }
- onDisjunctionEnter(start) {
- if (this._options.onDisjunctionEnter) {
- this._options.onDisjunctionEnter(start);
- }
- }
- onDisjunctionLeave(start, end) {
- if (this._options.onDisjunctionLeave) {
- this._options.onDisjunctionLeave(start, end);
- }
- }
- onAlternativeEnter(start, index) {
- if (this._options.onAlternativeEnter) {
- this._options.onAlternativeEnter(start, index);
- }
- }
- onAlternativeLeave(start, end, index) {
- if (this._options.onAlternativeLeave) {
- this._options.onAlternativeLeave(start, end, index);
- }
- }
- onGroupEnter(start) {
- if (this._options.onGroupEnter) {
- this._options.onGroupEnter(start);
- }
- }
- onGroupLeave(start, end) {
- if (this._options.onGroupLeave) {
- this._options.onGroupLeave(start, end);
- }
- }
- onCapturingGroupEnter(start, name) {
- if (this._options.onCapturingGroupEnter) {
- this._options.onCapturingGroupEnter(start, name);
- }
- }
- onCapturingGroupLeave(start, end, name) {
- if (this._options.onCapturingGroupLeave) {
- this._options.onCapturingGroupLeave(start, end, name);
- }
- }
- onQuantifier(start, end, min, max, greedy) {
- if (this._options.onQuantifier) {
- this._options.onQuantifier(start, end, min, max, greedy);
- }
- }
- onLookaroundAssertionEnter(start, kind, negate) {
- if (this._options.onLookaroundAssertionEnter) {
- this._options.onLookaroundAssertionEnter(start, kind, negate);
- }
- }
- onLookaroundAssertionLeave(start, end, kind, negate) {
- if (this._options.onLookaroundAssertionLeave) {
- this._options.onLookaroundAssertionLeave(start, end, kind, negate);
- }
- }
- onEdgeAssertion(start, end, kind) {
- if (this._options.onEdgeAssertion) {
- this._options.onEdgeAssertion(start, end, kind);
- }
- }
- onWordBoundaryAssertion(start, end, kind, negate) {
- if (this._options.onWordBoundaryAssertion) {
- this._options.onWordBoundaryAssertion(start, end, kind, negate);
- }
- }
- onAnyCharacterSet(start, end, kind) {
- if (this._options.onAnyCharacterSet) {
- this._options.onAnyCharacterSet(start, end, kind);
- }
- }
- onEscapeCharacterSet(start, end, kind, negate) {
- if (this._options.onEscapeCharacterSet) {
- this._options.onEscapeCharacterSet(start, end, kind, negate);
- }
- }
- onUnicodePropertyCharacterSet(start, end, kind, key, value, negate) {
- if (this._options.onUnicodePropertyCharacterSet) {
- this._options.onUnicodePropertyCharacterSet(start, end, kind, key, value, negate);
- }
- }
- onCharacter(start, end, value) {
- if (this._options.onCharacter) {
- this._options.onCharacter(start, end, value);
- }
- }
- onBackreference(start, end, ref) {
- if (this._options.onBackreference) {
- this._options.onBackreference(start, end, ref);
- }
- }
- onCharacterClassEnter(start, negate) {
- if (this._options.onCharacterClassEnter) {
- this._options.onCharacterClassEnter(start, negate);
- }
- }
- onCharacterClassLeave(start, end, negate) {
- if (this._options.onCharacterClassLeave) {
- this._options.onCharacterClassLeave(start, end, negate);
- }
- }
- onCharacterClassRange(start, end, min, max) {
- if (this._options.onCharacterClassRange) {
- this._options.onCharacterClassRange(start, end, min, max);
- }
- }
- get source() {
- return this._reader.source;
- }
- get index() {
- return this._reader.index;
- }
- get currentCodePoint() {
- return this._reader.currentCodePoint;
- }
- get nextCodePoint() {
- return this._reader.nextCodePoint;
- }
- get nextCodePoint2() {
- return this._reader.nextCodePoint2;
- }
- get nextCodePoint3() {
- return this._reader.nextCodePoint3;
- }
- reset(source, start, end) {
- this._reader.reset(source, start, end, this._uFlag);
- }
- rewind(index) {
- this._reader.rewind(index);
- }
- advance() {
- this._reader.advance();
- }
- eat(cp) {
- return this._reader.eat(cp);
- }
- eat2(cp1, cp2) {
- return this._reader.eat2(cp1, cp2);
- }
- eat3(cp1, cp2, cp3) {
- return this._reader.eat3(cp1, cp2, cp3);
- }
- raise(message) {
- throw new RegExpSyntaxError(this.source, this._uFlag, this.index, message);
- }
- eatRegExpBody() {
- const start = this.index;
- let inClass = false;
- let escaped = false;
- for (;;) {
- const cp = this.currentCodePoint;
- if (cp === -1 || isLineTerminator(cp)) {
- const kind = inClass ? "character class" : "regular expression";
- this.raise(`Unterminated ${kind}`);
- }
- if (escaped) {
- escaped = false;
- }
- else if (cp === ReverseSolidus) {
- escaped = true;
- }
- else if (cp === LeftSquareBracket) {
- inClass = true;
- }
- else if (cp === RightSquareBracket) {
- inClass = false;
- }
- else if ((cp === Solidus && !inClass) ||
- (cp === Asterisk && this.index === start)) {
- break;
- }
- this.advance();
- }
- return this.index !== start;
- }
- pattern() {
- const start = this.index;
- this._numCapturingParens = this.countCapturingParens();
- this._groupNames.clear();
- this._backreferenceNames.clear();
- this.onPatternEnter(start);
- this.disjunction();
- const cp = this.currentCodePoint;
- if (this.currentCodePoint !== -1) {
- if (cp === RightParenthesis) {
- this.raise("Unmatched ')'");
- }
- if (cp === RightSquareBracket || cp === RightCurlyBracket) {
- this.raise("Lone quantifier brackets");
- }
- const c = String.fromCodePoint(cp);
- this.raise(`Unexpected character '${c}'`);
- }
- this._backreferenceNames.forEach(name => {
- if (!this._groupNames.has(name)) {
- this.raise("Invalid named capture referenced");
- }
- });
- this.onPatternLeave(start, this.index);
- }
- countCapturingParens() {
- const start = this.index;
- let inClass = false;
- let escaped = false;
- let count = 0;
- let cp = 0;
- while ((cp = this.currentCodePoint) !== -1) {
- if (escaped) {
- escaped = false;
- }
- else if (cp === ReverseSolidus) {
- escaped = true;
- }
- else if (cp === LeftSquareBracket) {
- inClass = true;
- }
- else if (cp === RightSquareBracket) {
- inClass = false;
- }
- else if (cp === LeftParenthesis &&
- !inClass &&
- (this.nextCodePoint !== QuestionMark ||
- (this.nextCodePoint2 === LessThanSign &&
- this.nextCodePoint3 !== EqualsSign &&
- this.nextCodePoint3 !== ExclamationMark))) {
- count += 1;
- }
- this.advance();
- }
- this.rewind(start);
- return count;
- }
- disjunction() {
- const start = this.index;
- let i = 0;
- this.onDisjunctionEnter(start);
- this.alternative(i++);
- while (this.eat(VerticalLine)) {
- this.alternative(i++);
- }
- if (this.eatQuantifier(true)) {
- this.raise("Nothing to repeat");
- }
- if (this.eat(LeftCurlyBracket)) {
- this.raise("Lone quantifier brackets");
- }
- this.onDisjunctionLeave(start, this.index);
- }
- alternative(i) {
- const start = this.index;
- this.onAlternativeEnter(start, i);
- while (this.currentCodePoint !== -1 && this.eatTerm())
- ;
- this.onAlternativeLeave(start, this.index, i);
- }
- eatTerm() {
- if (this.eatAssertion()) {
- if (this._lastAssertionIsQuantifiable) {
- this.eatQuantifier();
- }
- return true;
- }
- if (this.strict ? this.eatAtom() : this.eatExtendedAtom()) {
- this.eatQuantifier();
- return true;
- }
- return false;
- }
- eatAssertion() {
- const start = this.index;
- this._lastAssertionIsQuantifiable = false;
- if (this.eat(CircumflexAccent)) {
- this.onEdgeAssertion(start, this.index, "start");
- return true;
- }
- if (this.eat(DollarSign)) {
- this.onEdgeAssertion(start, this.index, "end");
- return true;
- }
- if (this.eat2(ReverseSolidus, LatinCapitalLetterB)) {
- this.onWordBoundaryAssertion(start, this.index, "word", true);
- return true;
- }
- if (this.eat2(ReverseSolidus, LatinSmallLetterB)) {
- this.onWordBoundaryAssertion(start, this.index, "word", false);
- return true;
- }
- if (this.eat2(LeftParenthesis, QuestionMark)) {
- const lookbehind = this.ecmaVersion >= 2018 && this.eat(LessThanSign);
- let negate = false;
- if (this.eat(EqualsSign) || (negate = this.eat(ExclamationMark))) {
- const kind = lookbehind ? "lookbehind" : "lookahead";
- this.onLookaroundAssertionEnter(start, kind, negate);
- this.disjunction();
- if (!this.eat(RightParenthesis)) {
- this.raise("Unterminated group");
- }
- this._lastAssertionIsQuantifiable = !lookbehind && !this.strict;
- this.onLookaroundAssertionLeave(start, this.index, kind, negate);
- return true;
- }
- this.rewind(start);
- }
- return false;
- }
- eatQuantifier(noError = false) {
- const start = this.index;
- let min = 0;
- let max = 0;
- let greedy = false;
- if (this.eat(Asterisk)) {
- min = 0;
- max = Number.POSITIVE_INFINITY;
- }
- else if (this.eat(PlusSign)) {
- min = 1;
- max = Number.POSITIVE_INFINITY;
- }
- else if (this.eat(QuestionMark)) {
- min = 0;
- max = 1;
- }
- else if (this.eatBracedQuantifier(noError)) {
- min = this._lastMinValue;
- max = this._lastMaxValue;
- }
- else {
- return false;
- }
- greedy = !this.eat(QuestionMark);
- if (!noError) {
- this.onQuantifier(start, this.index, min, max, greedy);
- }
- return true;
- }
- eatBracedQuantifier(noError) {
- const start = this.index;
- if (this.eat(LeftCurlyBracket)) {
- this._lastMinValue = 0;
- this._lastMaxValue = Number.POSITIVE_INFINITY;
- if (this.eatDecimalDigits()) {
- this._lastMinValue = this._lastMaxValue = this._lastIntValue;
- if (this.eat(Comma)) {
- this._lastMaxValue = this.eatDecimalDigits()
- ? this._lastIntValue
- : Number.POSITIVE_INFINITY;
- }
- if (this.eat(RightCurlyBracket)) {
- if (!noError && this._lastMaxValue < this._lastMinValue) {
- this.raise("numbers out of order in {} quantifier");
- }
- return true;
- }
- }
- if (!noError && this.strict) {
- this.raise("Incomplete quantifier");
- }
- this.rewind(start);
- }
- return false;
- }
- eatAtom() {
- return (this.eatPatternCharacter() ||
- this.eatDot() ||
- this.eatReverseSolidusAtomEscape() ||
- this.eatCharacterClass() ||
- this.eatUncapturingGroup() ||
- this.eatCapturingGroup());
- }
- eatDot() {
- if (this.eat(FullStop)) {
- this.onAnyCharacterSet(this.index - 1, this.index, "any");
- return true;
- }
- return false;
- }
- eatReverseSolidusAtomEscape() {
- const start = this.index;
- if (this.eat(ReverseSolidus)) {
- if (this.eatAtomEscape()) {
- return true;
- }
- this.rewind(start);
- }
- return false;
- }
- eatUncapturingGroup() {
- const start = this.index;
- if (this.eat3(LeftParenthesis, QuestionMark, Colon)) {
- this.onGroupEnter(start);
- this.disjunction();
- if (!this.eat(RightParenthesis)) {
- this.raise("Unterminated group");
- }
- this.onGroupLeave(start, this.index);
- return true;
- }
- return false;
- }
- eatCapturingGroup() {
- const start = this.index;
- if (this.eat(LeftParenthesis)) {
- this._lastStrValue = "";
- if (this.ecmaVersion >= 2018) {
- this.groupSpecifier();
- }
- else if (this.currentCodePoint === QuestionMark) {
- this.raise("Invalid group");
- }
- const name = this._lastStrValue || null;
- this.onCapturingGroupEnter(start, name);
- this.disjunction();
- if (!this.eat(RightParenthesis)) {
- this.raise("Unterminated group");
- }
- this.onCapturingGroupLeave(start, this.index, name);
- return true;
- }
- return false;
- }
- eatExtendedAtom() {
- return (this.eatDot() ||
- this.eatReverseSolidusAtomEscape() ||
- this.eatCharacterClass() ||
- this.eatUncapturingGroup() ||
- this.eatCapturingGroup() ||
- this.eatInvalidBracedQuantifier() ||
- this.eatExtendedPatternCharacter());
- }
- eatInvalidBracedQuantifier() {
- if (this.eatBracedQuantifier(true)) {
- this.raise("Nothing to repeat");
- }
- return false;
- }
- eatSyntaxCharacter() {
- if (isSyntaxCharacter(this.currentCodePoint)) {
- this._lastIntValue = this.currentCodePoint;
- this.advance();
- return true;
- }
- return false;
- }
- eatPatternCharacter() {
- const start = this.index;
- const cp = this.currentCodePoint;
- if (cp !== -1 && !isSyntaxCharacter(cp)) {
- this.advance();
- this.onCharacter(start, this.index, cp);
- return true;
- }
- return false;
- }
- eatExtendedPatternCharacter() {
- const start = this.index;
- const cp = this.currentCodePoint;
- if (cp !== -1 &&
- cp !== CircumflexAccent &&
- cp !== DollarSign &&
- cp !== FullStop &&
- cp !== Asterisk &&
- cp !== PlusSign &&
- cp !== QuestionMark &&
- cp !== LeftParenthesis &&
- cp !== RightParenthesis &&
- cp !== LeftSquareBracket &&
- cp !== VerticalLine) {
- this.advance();
- this.onCharacter(start, this.index, cp);
- return true;
- }
- return false;
- }
- groupSpecifier() {
- this._lastStrValue = "";
- if (this.eat(QuestionMark)) {
- if (this.eatGroupName()) {
- if (!this._groupNames.has(this._lastStrValue)) {
- this._groupNames.add(this._lastStrValue);
- return;
- }
- this.raise("Duplicate capture group name");
- }
- this.raise("Invalid group");
- }
- }
- eatGroupName() {
- this._lastStrValue = "";
- if (this.eat(LessThanSign)) {
- if (this.eatRegExpIdentifierName() && this.eat(GreaterThanSign)) {
- return true;
- }
- this.raise("Invalid capture group name");
- }
- return false;
- }
- eatRegExpIdentifierName() {
- this._lastStrValue = "";
- if (this.eatRegExpIdentifierStart()) {
- this._lastStrValue += String.fromCodePoint(this._lastIntValue);
- while (this.eatRegExpIdentifierPart()) {
- this._lastStrValue += String.fromCodePoint(this._lastIntValue);
- }
- return true;
- }
- return false;
- }
- eatRegExpIdentifierStart() {
- const start = this.index;
- let cp = this.currentCodePoint;
- this.advance();
- if (cp === ReverseSolidus && this.eatRegExpUnicodeEscapeSequence()) {
- cp = this._lastIntValue;
- }
- if (isRegExpIdentifierStart(cp)) {
- this._lastIntValue = cp;
- return true;
- }
- if (this.index !== start) {
- this.rewind(start);
- }
- return false;
- }
- eatRegExpIdentifierPart() {
- const start = this.index;
- let cp = this.currentCodePoint;
- this.advance();
- if (cp === ReverseSolidus && this.eatRegExpUnicodeEscapeSequence()) {
- cp = this._lastIntValue;
- }
- if (isRegExpIdentifierPart(cp)) {
- this._lastIntValue = cp;
- return true;
- }
- if (this.index !== start) {
- this.rewind(start);
- }
- return false;
- }
- eatAtomEscape() {
- if (this.eatBackreference() ||
- this.eatCharacterClassEscape() ||
- this.eatCharacterEscape() ||
- (this._nFlag && this.eatKGroupName())) {
- return true;
- }
- if (this.strict || this._uFlag) {
- this.raise("Invalid escape");
- }
- return false;
- }
- eatBackreference() {
- const start = this.index;
- if (this.eatDecimalEscape()) {
- const n = this._lastIntValue;
- if (n <= this._numCapturingParens) {
- this.onBackreference(start - 1, this.index, n);
- return true;
- }
- if (this.strict) {
- this.raise("Invalid escape");
- }
- this.rewind(start);
- }
- return false;
- }
- eatKGroupName() {
- const start = this.index;
- if (this.eat(LatinSmallLetterK)) {
- if (this.eatGroupName()) {
- const groupName = this._lastStrValue;
- this._backreferenceNames.add(groupName);
- this.onBackreference(start - 1, this.index, groupName);
- return true;
- }
- this.raise("Invalid named reference");
- }
- return false;
- }
- eatCharacterEscape() {
- const start = this.index;
- if (this.eatControlEscape() ||
- this.eatCControlLetter() ||
- this.eatZero() ||
- this.eatHexEscapeSequence() ||
- this.eatRegExpUnicodeEscapeSequence() ||
- (!this.strict && this.eatLegacyOctalEscapeSequence()) ||
- this.eatIdentityEscape()) {
- this.onCharacter(start - 1, this.index, this._lastIntValue);
- return true;
- }
- return false;
- }
- eatCControlLetter() {
- const start = this.index;
- if (this.eat(LatinSmallLetterC)) {
- if (this.eatControlLetter()) {
- return true;
- }
- this.rewind(start);
- }
- return false;
- }
- eatZero() {
- if (this.currentCodePoint === DigitZero &&
- !isDecimalDigit(this.nextCodePoint)) {
- this._lastIntValue = 0;
- this.advance();
- return true;
- }
- return false;
- }
- eatControlEscape() {
- if (this.eat(LatinSmallLetterT)) {
- this._lastIntValue = CharacterTabulation;
- return true;
- }
- if (this.eat(LatinSmallLetterN)) {
- this._lastIntValue = LineFeed;
- return true;
- }
- if (this.eat(LatinSmallLetterV)) {
- this._lastIntValue = LineTabulation;
- return true;
- }
- if (this.eat(LatinSmallLetterF)) {
- this._lastIntValue = FormFeed;
- return true;
- }
- if (this.eat(LatinSmallLetterR)) {
- this._lastIntValue = CarriageReturn;
- return true;
- }
- return false;
- }
- eatControlLetter() {
- const cp = this.currentCodePoint;
- if (isLatinLetter(cp)) {
- this.advance();
- this._lastIntValue = cp % 0x20;
- return true;
- }
- return false;
- }
- eatRegExpUnicodeEscapeSequence() {
- const start = this.index;
- if (this.eat(LatinSmallLetterU)) {
- if (this.eatFixedHexDigits(4)) {
- const lead = this._lastIntValue;
- if (this._uFlag && lead >= 0xd800 && lead <= 0xdbff) {
- const leadSurrogateEnd = this.index;
- if (this.eat(ReverseSolidus) &&
- this.eat(LatinSmallLetterU) &&
- this.eatFixedHexDigits(4)) {
- const trail = this._lastIntValue;
- if (trail >= 0xdc00 && trail <= 0xdfff) {
- this._lastIntValue =
- (lead - 0xd800) * 0x400 +
- (trail - 0xdc00) +
- 0x10000;
- return true;
- }
- }
- this.rewind(leadSurrogateEnd);
- this._lastIntValue = lead;
- }
- return true;
- }
- if (this._uFlag &&
- this.eat(LeftCurlyBracket) &&
- this.eatHexDigits() &&
- this.eat(RightCurlyBracket) &&
- isValidUnicode(this._lastIntValue)) {
- return true;
- }
- if (this.strict || this._uFlag) {
- this.raise("Invalid unicode escape");
- }
- this.rewind(start);
- }
- return false;
- }
- eatIdentityEscape() {
- if (this._uFlag) {
- if (this.eatSyntaxCharacter()) {
- return true;
- }
- if (this.eat(Solidus)) {
- this._lastIntValue = Solidus;
- return true;
- }
- return false;
- }
- if (this.isValidIdentityEscape(this.currentCodePoint)) {
- this._lastIntValue = this.currentCodePoint;
- this.advance();
- return true;
- }
- return false;
- }
- isValidIdentityEscape(cp) {
- if (cp === -1) {
- return false;
- }
- if (this.strict) {
- return !isIdContinue(cp);
- }
- return (cp !== LatinSmallLetterC &&
- (!this._nFlag || cp !== LatinSmallLetterK));
- }
- eatDecimalEscape() {
- this._lastIntValue = 0;
- let cp = this.currentCodePoint;
- if (cp >= DigitOne && cp <= DigitNine) {
- do {
- this._lastIntValue = 10 * this._lastIntValue + (cp - DigitZero);
- this.advance();
- } while ((cp = this.currentCodePoint) >= DigitZero &&
- cp <= DigitNine);
- return true;
- }
- return false;
- }
- eatCharacterClassEscape() {
- const start = this.index;
- if (this.eat(LatinSmallLetterD)) {
- this._lastIntValue = -1;
- this.onEscapeCharacterSet(start - 1, this.index, "digit", false);
- return true;
- }
- if (this.eat(LatinCapitalLetterD)) {
- this._lastIntValue = -1;
- this.onEscapeCharacterSet(start - 1, this.index, "digit", true);
- return true;
- }
- if (this.eat(LatinSmallLetterS)) {
- this._lastIntValue = -1;
- this.onEscapeCharacterSet(start - 1, this.index, "space", false);
- return true;
- }
- if (this.eat(LatinCapitalLetterS)) {
- this._lastIntValue = -1;
- this.onEscapeCharacterSet(start - 1, this.index, "space", true);
- return true;
- }
- if (this.eat(LatinSmallLetterW)) {
- this._lastIntValue = -1;
- this.onEscapeCharacterSet(start - 1, this.index, "word", false);
- return true;
- }
- if (this.eat(LatinCapitalLetterW)) {
- this._lastIntValue = -1;
- this.onEscapeCharacterSet(start - 1, this.index, "word", true);
- return true;
- }
- let negate = false;
- if (this._uFlag &&
- this.ecmaVersion >= 2018 &&
- (this.eat(LatinSmallLetterP) ||
- (negate = this.eat(LatinCapitalLetterP)))) {
- this._lastIntValue = -1;
- if (this.eat(LeftCurlyBracket) &&
- this.eatUnicodePropertyValueExpression() &&
- this.eat(RightCurlyBracket)) {
- this.onUnicodePropertyCharacterSet(start - 1, this.index, "property", this._lastKeyValue, this._lastValValue || null, negate);
- return true;
- }
- this.raise("Invalid property name");
- }
- return false;
- }
- eatUnicodePropertyValueExpression() {
- const start = this.index;
- if (this.eatUnicodePropertyName() && this.eat(EqualsSign)) {
- this._lastKeyValue = this._lastStrValue;
- if (this.eatUnicodePropertyValue()) {
- this._lastValValue = this._lastStrValue;
- if (isValidUnicodeProperty(this._lastKeyValue, this._lastValValue)) {
- return true;
- }
- this.raise("Invalid property name");
- }
- }
- this.rewind(start);
- if (this.eatLoneUnicodePropertyNameOrValue()) {
- const nameOrValue = this._lastStrValue;
- if (isValidUnicodeProperty("General_Category", nameOrValue)) {
- this._lastKeyValue = "General_Category";
- this._lastValValue = nameOrValue;
- return true;
- }
- if (isValidUnicodePropertyName(nameOrValue)) {
- this._lastKeyValue = nameOrValue;
- this._lastValValue = "";
- return true;
- }
- this.raise("Invalid property name");
- }
- return false;
- }
- eatUnicodePropertyName() {
- this._lastStrValue = "";
- while (isUnicodePropertyNameCharacter(this.currentCodePoint)) {
- this._lastStrValue += String.fromCodePoint(this.currentCodePoint);
- this.advance();
- }
- return this._lastStrValue !== "";
- }
- eatUnicodePropertyValue() {
- this._lastStrValue = "";
- while (isUnicodePropertyValueCharacter(this.currentCodePoint)) {
- this._lastStrValue += String.fromCodePoint(this.currentCodePoint);
- this.advance();
- }
- return this._lastStrValue !== "";
- }
- eatLoneUnicodePropertyNameOrValue() {
- return this.eatUnicodePropertyValue();
- }
- eatCharacterClass() {
- const start = this.index;
- if (this.eat(LeftSquareBracket)) {
- const negate = this.eat(CircumflexAccent);
- this.onCharacterClassEnter(start, negate);
- this.classRanges();
- if (!this.eat(RightSquareBracket)) {
- this.raise("Unterminated character class");
- }
- this.onCharacterClassLeave(start, this.index, negate);
- return true;
- }
- return false;
- }
- classRanges() {
- let start = this.index;
- while (this.eatClassAtom()) {
- const left = this._lastIntValue;
- const hyphenStart = this.index;
- if (this.eat(HyphenMinus)) {
- this.onCharacter(hyphenStart, this.index, HyphenMinus);
- if (this.eatClassAtom()) {
- const right = this._lastIntValue;
- if (left === -1 || right === -1) {
- if (this.strict) {
- this.raise("Invalid character class");
- }
- }
- else if (left > right) {
- this.raise("Range out of order in character class");
- }
- else {
- this.onCharacterClassRange(start, this.index, left, right);
- }
- }
- }
- start = this.index;
- }
- }
- eatClassAtom() {
- const start = this.index;
- if (this.eat(ReverseSolidus)) {
- if (this.eatClassEscape()) {
- return true;
- }
- if (this._uFlag) {
- this.raise("Invalid escape");
- }
- this.rewind(start);
- }
- const cp = this.currentCodePoint;
- if (cp !== -1 && cp !== RightSquareBracket) {
- this.advance();
- this._lastIntValue = cp;
- this.onCharacter(start, this.index, cp);
- return true;
- }
- return false;
- }
- eatClassEscape() {
- const start = this.index;
- if (this.eat(LatinSmallLetterB)) {
- this._lastIntValue = Backspace;
- this.onCharacter(start - 1, this.index, Backspace);
- return true;
- }
- if (this._uFlag && this.eat(HyphenMinus)) {
- this._lastIntValue = HyphenMinus;
- this.onCharacter(start - 1, this.index, HyphenMinus);
- return true;
- }
- if (!this._uFlag && this.eat(LatinSmallLetterC)) {
- if (this.eatClassControlLetter()) {
- this.onCharacter(start - 1, this.index, this._lastIntValue);
- return true;
- }
- this.rewind(start);
- }
- return this.eatCharacterClassEscape() || this.eatCharacterEscape();
- }
- eatClassControlLetter() {
- const cp = this.currentCodePoint;
- if (isDecimalDigit(cp) || cp === LowLine) {
- this.advance();
- this._lastIntValue = cp % 0x20;
- return true;
- }
- return false;
- }
- eatHexEscapeSequence() {
- const start = this.index;
- if (this.eat(LatinSmallLetterX)) {
- if (this.eatFixedHexDigits(2)) {
- return true;
- }
- if (this._uFlag) {
- this.raise("Invalid escape");
- }
- this.rewind(start);
- }
- return false;
- }
- eatDecimalDigits() {
- const start = this.index;
- this._lastIntValue = 0;
- while (isDecimalDigit(this.currentCodePoint)) {
- this._lastIntValue =
- 10 * this._lastIntValue + digitToInt(this.currentCodePoint);
- this.advance();
- }
- return this.index !== start;
- }
- eatHexDigits() {
- const start = this.index;
- this._lastIntValue = 0;
- while (isHexDigit(this.currentCodePoint)) {
- this._lastIntValue =
- 16 * this._lastIntValue + digitToInt(this.currentCodePoint);
- this.advance();
- }
- return this.index !== start;
- }
- eatLegacyOctalEscapeSequence() {
- if (this.eatOctalDigit()) {
- const n1 = this._lastIntValue;
- if (this.eatOctalDigit()) {
- const n2 = this._lastIntValue;
- if (n1 <= 3 && this.eatOctalDigit()) {
- this._lastIntValue = n1 * 64 + n2 * 8 + this._lastIntValue;
- }
- else {
- this._lastIntValue = n1 * 8 + n2;
- }
- }
- else {
- this._lastIntValue = n1;
- }
- return true;
- }
- return false;
- }
- eatOctalDigit() {
- const cp = this.currentCodePoint;
- if (isOctalDigit(cp)) {
- this.advance();
- this._lastIntValue = cp - DigitZero;
- return true;
- }
- this._lastIntValue = 0;
- return false;
- }
- eatFixedHexDigits(length) {
- const start = this.index;
- this._lastIntValue = 0;
- for (let i = 0; i < length; ++i) {
- const cp = this.currentCodePoint;
- if (!isHexDigit(cp)) {
- this.rewind(start);
- return false;
- }
- this._lastIntValue = 16 * this._lastIntValue + digitToInt(cp);
- this.advance();
- }
- return true;
- }
- }
- const DummyPattern = {};
- const DummyFlags = {};
- const DummyCapturingGroup = {};
- function elementsToAlternative(elements, parent) {
- for (const element of elements) {
- assert(element.type !== "Disjunction");
- element.parent = parent;
- }
- return elements;
- }
- function addAlternativeElement(parent, node) {
- if (parent.type === "Disjunction") {
- last(parent.alternatives).push(node);
- }
- else {
- parent.elements.push(node);
- }
- }
- function addCommonElement(parent, node) {
- if (parent.type === "Disjunction") {
- last(parent.alternatives).push(node);
- }
- else if (parent.type === "CharacterClass") {
- parent.elements.push(node);
- }
- else {
- parent.elements.push(node);
- }
- }
- class RegExpParserState {
- constructor(options) {
- this._node = DummyPattern;
- this._flags = DummyFlags;
- this._disjunctionStartStack = [];
- this._backreferences = [];
- this._capturingGroups = [];
- this.source = "";
- this.strict = Boolean(options && options.strict);
- this.ecmaVersion = (options && options.ecmaVersion) || 2018;
- }
- get pattern() {
- if (this._node.type !== "Pattern") {
- throw new Error("UnknownError");
- }
- return this._node;
- }
- get flags() {
- if (this._flags.type !== "Flags") {
- throw new Error("UnknownError");
- }
- return this._flags;
- }
- onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll) {
- this._flags = {
- type: "Flags",
- parent: null,
- start,
- end,
- raw: this.source.slice(start, end),
- global,
- ignoreCase,
- multiline,
- unicode,
- sticky,
- dotAll,
- };
- }
- onPatternEnter(start) {
- this._node = {
- type: "Pattern",
- parent: null,
- start,
- end: start,
- raw: "",
- elements: [],
- };
- this._backreferences.length = 0;
- this._capturingGroups.length = 0;
- }
- onPatternLeave(start, end) {
- this._node.end = end;
- this._node.raw = this.source.slice(start, end);
- for (const reference of this._backreferences) {
- const ref = reference.ref;
- const group = typeof ref === "number"
- ? this._capturingGroups[ref - 1]
- : this._capturingGroups.find(g => g.name === ref);
- reference.resolved = group;
- group.references.push(reference);
- }
- }
- onDisjunctionEnter(start) {
- this._disjunctionStartStack.push(start);
- }
- onDisjunctionLeave(start, end) {
- this._disjunctionStartStack.pop();
- }
- onAlternativeEnter(start, index) {
- if (index === 0) {
- return;
- }
- const parentNode = this._node;
- if (parentNode.type === "Disjunction" ||
- parentNode.type === "CharacterClass") {
- throw new Error("UnknownError");
- }
- const prevNode = last(parentNode.elements);
- if (prevNode != null && prevNode.type === "Disjunction") {
- this._node = prevNode;
- prevNode.alternatives.push([]);
- }
- else {
- this._node = {
- type: "Disjunction",
- parent: parentNode,
- start: last(this._disjunctionStartStack),
- end: start,
- raw: "",
- alternatives: [],
- };
- const elements = elementsToAlternative(parentNode.elements, this._node);
- this._node.alternatives.push(elements, []);
- parentNode.elements = [this._node];
- }
- }
- onAlternativeLeave(start, end, index) {
- if (index === 0) {
- return;
- }
- this._node.end = end;
- this._node.raw = this.source.slice(this._node.start, end);
- this._node = this._node.parent;
- }
- onGroupEnter(start) {
- const parentNode = this._node;
- if (parentNode.type === "CharacterClass") {
- throw new Error("UnknownError");
- }
- this._node = {
- type: "Group",
- parent: parentNode,
- start,
- end: start,
- raw: "",
- elements: [],
- };
- addAlternativeElement(parentNode, this._node);
- }
- onGroupLeave(start, end) {
- this._node.end = end;
- this._node.raw = this.source.slice(start, end);
- this._node = this._node.parent;
- }
- onCapturingGroupEnter(start, name) {
- const parentNode = this._node;
- if (parentNode.type === "CharacterClass") {
- throw new Error("UnknownError");
- }
- this._node = {
- type: "CapturingGroup",
- parent: parentNode,
- start,
- end: start,
- raw: "",
- name,
- elements: [],
- references: [],
- };
- addAlternativeElement(parentNode, this._node);
- this._capturingGroups.push(this._node);
- }
- onCapturingGroupLeave(start, end, name) {
- this._node.end = end;
- this._node.raw = this.source.slice(start, end);
- this._node = this._node.parent;
- }
- onQuantifier(start, end, min, max, greedy) {
- const parentNode = this._node;
- if (parentNode.type === "CharacterClass") {
- throw new Error("UnknownError");
- }
- const elements = parentNode.type === "Disjunction"
- ? last(parentNode.alternatives)
- : parentNode.elements;
- const prevNode = elements.pop();
- const node = {
- type: "Quantifier",
- parent: parentNode,
- start,
- end,
- raw: this.source.slice(start, end),
- min,
- max,
- greedy,
- element: prevNode,
- };
- elements.push(node);
- prevNode.parent = node;
- }
- onLookaroundAssertionEnter(start, kind, negate) {
- const parentNode = this._node;
- if (parentNode.type === "CharacterClass") {
- throw new Error("UnknownError");
- }
- this._node = {
- type: "Assertion",
- parent: parentNode,
- start,
- end: start,
- raw: "",
- kind,
- negate,
- elements: [],
- };
- addAlternativeElement(parentNode, this._node);
- }
- onLookaroundAssertionLeave(start, end, kind, negate) {
- this._node.end = end;
- this._node.raw = this.source.slice(start, end);
- this._node = this._node.parent;
- }
- onEdgeAssertion(start, end, kind) {
- const parentNode = this._node;
- if (parentNode.type === "CharacterClass") {
- throw new Error("UnknownError");
- }
- addAlternativeElement(parentNode, {
- type: "Assertion",
- parent: parentNode,
- start,
- end,
- raw: this.source.slice(start, end),
- kind,
- });
- }
- onWordBoundaryAssertion(start, end, kind, negate) {
- const parentNode = this._node;
- if (parentNode.type === "CharacterClass") {
- throw new Error("UnknownError");
- }
- addAlternativeElement(parentNode, {
- type: "Assertion",
- parent: parentNode,
- start,
- end,
- raw: this.source.slice(start, end),
- kind,
- negate,
- });
- }
- onAnyCharacterSet(start, end, kind) {
- const parentNode = this._node;
- if (parentNode.type === "CharacterClass") {
- throw new Error("UnknownError");
- }
- addAlternativeElement(parentNode, {
- type: "CharacterSet",
- parent: parentNode,
- start,
- end,
- raw: this.source.slice(start, end),
- kind,
- });
- }
- onEscapeCharacterSet(start, end, kind, negate) {
- addCommonElement(this._node, {
- type: "CharacterSet",
- parent: this._node,
- start,
- end,
- raw: this.source.slice(start, end),
- kind,
- negate,
- });
- }
- onUnicodePropertyCharacterSet(start, end, kind, key, value, negate) {
- addCommonElement(this._node, {
- type: "CharacterSet",
- parent: this._node,
- start,
- end,
- raw: this.source.slice(start, end),
- kind,
- key,
- value,
- negate,
- });
- }
- onCharacter(start, end, value) {
- addCommonElement(this._node, {
- type: "Character",
- parent: this._node,
- start,
- end,
- raw: this.source.slice(start, end),
- value,
- });
- }
- onBackreference(start, end, ref) {
- const parentNode = this._node;
- if (parentNode.type === "CharacterClass") {
- throw new Error("UnknownError");
- }
- const node = {
- type: "Backreference",
- parent: parentNode,
- start,
- end,
- raw: this.source.slice(start, end),
- ref,
- resolved: DummyCapturingGroup,
- };
- addAlternativeElement(parentNode, node);
- this._backreferences.push(node);
- }
- onCharacterClassEnter(start, negate) {
- const parentNode = this._node;
- if (parentNode.type === "CharacterClass") {
- throw new Error("UnknownError");
- }
- this._node = {
- type: "CharacterClass",
- parent: parentNode,
- start,
- end: start,
- raw: "",
- negate,
- elements: [],
- };
- addAlternativeElement(parentNode, this._node);
- }
- onCharacterClassLeave(start, end, negate) {
- this._node.end = end;
- this._node.raw = this.source.slice(start, end);
- this._node = this._node.parent;
- }
- onCharacterClassRange(start, end, min, max) {
- const parentNode = this._node;
- if (parentNode.type !== "CharacterClass") {
- throw new Error("UnknownError");
- }
- const elements = parentNode.elements;
- const rightNode = elements.pop();
- elements.pop();
- const leftNode = elements.pop();
- const node = {
- type: "CharacterClassRange",
- parent: parentNode,
- start,
- end,
- raw: this.source.slice(start, end),
- min: leftNode,
- max: rightNode,
- };
- assert(leftNode != null && leftNode.type === "Character");
- assert(rightNode != null && rightNode.type === "Character");
- leftNode.parent = node;
- rightNode.parent = node;
- elements.push(node);
- }
- }
- class RegExpParser {
- constructor(options) {
- this._state = new RegExpParserState(options);
- this._validator = new RegExpValidator(this._state);
- }
- parseLiteral(source, start = 0, end = source.length) {
- this._state.source = source;
- this._validator.validateLiteral(source, start, end);
- const pattern = this._state.pattern;
- const flags = this._state.flags;
- const literal = {
- type: "RegExpLiteral",
- parent: null,
- start,
- end,
- raw: source,
- pattern,
- flags,
- };
- pattern.parent = literal;
- flags.parent = literal;
- return literal;
- }
- parseFlags(source, start = 0, end = source.length) {
- this._state.source = source;
- this._validator.validateFlags(source, start, end);
- return this._state.flags;
- }
- parsePattern(source, start = 0, end = source.length, uFlag = false) {
- this._state.source = source;
- this._validator.validatePattern(source, start, end, uFlag);
- return this._state.pattern;
- }
- }
- function parseRegExpLiteral(source, options) {
- return new RegExpParser(options).parseLiteral(source);
- }
- function validateRegExpLiteral(source, options) {
- return new RegExpValidator(options).validateLiteral(source);
- }
- export { ast as AST, RegExpParser, RegExpValidator, parseRegExpLiteral, validateRegExpLiteral };
- //# sourceMappingURL=index.mjs.map
|