module /** */ import { ParsingState } from "../state" ; import { ParjsProjection } from "../parjser" ; import { ParjsCombinator } from "../../index" ; import { defineCombinator } from "./combinator" ; import { ParjserBase } from "../parser" ; param action export function each < T > ( action ) ; export function each ( action ) { return defineCombinator ( source => { return new class extends ParjserBase { type = "each" ; expecting = source . expecting ; _apply ( ps ) { source . apply ( ps ) ; if ( ! ps . isOk ) { return ; } action ( ps . value , ps . userState ) ; } } ( ) ; } ) ; }