Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file reason_multi_parser.ml
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768moduleS=Reason_single_parsertype'aparser='aS.parserlistletinitialentry_pointposition=[S.initialentry_pointposition]type'astep=|Intermediateof'aparser|Successof'a*Reason_lexer.invalid_docstrings|Errorletrecforktoken=function|[]->[]|x::xs->beginmatchS.stepxtokenwith|S.Intermediatex'->x::x'::forktokenxs|_->x::forktokenxsendletrecprogress_successfultokenacc=function|[]->Intermediate(List.revacc)|x::xs->beginmatchS.stepxtokenwith|S.Intermediatep->progress_successfultoken(p::acc)xs|S.Error->progress_successfultokenaccxs|S.Success(result,ds)->Success(result,ds)endletstepparserstoken=matchtokenwith|(Reason_parser.ES6_FUN,_,_)->(* Fork case *)Intermediate(forktokenparsers)|_->(* Regular case *)matchparserswith|[x]->(* Fast-path: One parser *)beginmatchS.stepxtokenwith|S.Intermediateparser->Intermediate[parser]|S.Success(result,ds)->Success(result,ds)|S.Error->Errorend(* Parallel parsing case *)|x::xs->beginmatchS.stepxtokenwith|S.Intermediatep->progress_successfultoken[p]xs|S.Success(result,ds)->Success(result,ds)|S.Error->beginmatchprogress_successfultoken[]xswith|Intermediate[]->Error|result->resultendend(* Impossible case *)|[]->assertfalse(* Interface for recovery *)letrecovercpds=[S.recovercpds]letrecovery_env=function|[]->assertfalse|x::_xs->S.recovery_envx