1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556moduleS=Reason_single_parsertype'aparser='aS.parserlistletinitialentry_pointposition=[S.initialentry_pointposition]type'astep=|Intermediateof'aparser|Successof'a*Reason_lexer.invalid_docstrings|Errorletrecforktoken=function|[]->[]|x::xs->(matchS.stepxtokenwith|S.Intermediatex'->x::x'::forktokenxs|_->x::forktokenxs)letrecprogress_successfultokenacc=function|[]->Intermediate(List.revacc)|x::xs->(matchS.stepxtokenwith|S.Intermediatep->progress_successfultoken(p::acc)xs|S.Error->progress_successfultokenaccxs|S.Success(result,ds)->Success(result,ds))letstepparserstoken=matchtokenwith|Reason_parser.ES6_FUN,_,_->(* Fork case *)Intermediate(forktokenparsers)|_->(* Regular case *)(matchparserswith|[x]->(* Fast-path: One parser *)(matchS.stepxtokenwith|S.Intermediateparser->Intermediate[parser]|S.Success(result,ds)->Success(result,ds)|S.Error->Error)(* Parallel parsing case *)|x::xs->(matchS.stepxtokenwith|S.Intermediatep->progress_successfultoken[p]xs|S.Success(result,ds)->Success(result,ds)|S.Error->(matchprogress_successfultoken[]xswith|Intermediate[]->Error|result->result))(* Impossible case *)|[]->assertfalse)(* Interface for recovery *)letrecovercpds=[S.recovercpds]letrecovery_env=function[]->assertfalse|x::_xs->S.recovery_envx