Skip to content

Latest commit

 

History

History
29 lines (17 loc) · 951 Bytes

prsc.codepoint.md

File metadata and controls

29 lines (17 loc) · 951 Bytes

Home > prsc > codepoint

codepoint() function

Creates a Parser that skips the next code point if the given predicate returns true.

This counts in unicode characters (code points), not UTF-16 code units.

To match a sequence of code points, consider using codepoints instead.

Signature:

export declare function codepoint(isMatch: (codepoint: number) => boolean, expected: string[]): Parser<void>;

Parameters

Parameter Type Description
isMatch (codepoint: number) => boolean callback called with the next codepoint, should return whether that matches
expected string[] expected strings to return if the codepoint does not match

Returns:

Parser<void>