import type { Combinator } from '../types.ts'; /** * Treat a parser as one source token. * * The wrapped parser runs with trivia cleared, so its parts must be contiguous. * On success the token returns the matched source text and captures one CST leaf * for the full span, suppressing any internal terminal leaves. */ export declare function token(root: Combinator): Combinator; /** * Reduce a structural parser to one semantic leaf. * * Unlike `token()`, `leaf()` does not change trivia policy: put `noTrivia()` or * a scoped `parser({ trivia })` inside the supplied grammar when that region has * a local spacing rule. Internal CST captures are suppressed, while selected * root-source trivia remains visible, and one leaf with the reducer's value and * the complete consumed span is exposed to the parent. */ export declare function leaf(root: Combinator, fn: (value: T, span: { start: number; end: number; }) => U): Combinator; //# sourceMappingURL=token.d.ts.map