Skip to content

Latest commit

 

History

History
26 lines (15 loc) · 946 Bytes

prsc.recognize.md

File metadata and controls

26 lines (15 loc) · 946 Bytes

Home > prsc > recognize

recognize() function

Creates a Parser that applies the given parser. If successful, the inner parser's value is discarded and the substring that was consumed from the input is returned as value instead. Errors are returned as-is.

When using this in combination with star or plus, consider using starConsumed or plusConsumed instead for efficiency.

Signature:

export declare function recognize<T>(parser: Parser<T>): Parser<string>;

Parameters

Parameter Type Description
parser Parser<T> The parser to apply, value is discarded and replaced by the consumed input.

Returns:

Parser<string>