Experimental
Experimental
positionCurrent position in the source string.
Readonly
Experimental
sourceThe source string to be parsed.
Experimental
Indicates whether the parser has reached the end of the source string.
true
if the current position is at or beyond the end of the source; otherwise, false
.
Experimental
Consumes the first matching string from the provided iterable if it matches the current position. Advances the position if a match is found.
One or more strings to match.
Optional
comparer: EqualityComparer<any>An optional equality comparer for custom string comparison.
The matched string if successful; otherwise, undefined
.
Experimental
Consumes a regular expression match at the current position in the source. Advances the position if the match is successful.
The regular expression to match. Must include the y
(sticky) flag.
The match result if successful; otherwise, undefined
.
Experimental
Consumes the specified string if it matches the current position in the source. Advances the position if the match is successful.
The string to match.
Optional
comparer: EqualityComparer<any>An optional equality comparer for custom string comparison.
true
if the string was successfully consumed; otherwise, false
.
Experimental
Checks if any of the provided strings match the current position in the source without consuming it.
One or more strings to match.
Optional
comparer: EqualityComparer<any>An optional equality comparer for custom string comparison.
The matched string if successful; otherwise, undefined
.
Experimental
Checks if a regular expression matches the current position in the source without consuming it.
The regular expression to match. Must include the y
(sticky) flag.
The match result if successful; otherwise, undefined
.
Experimental
Checks if the specified string matches the current position in the source without consuming it.
The string to match.
Optional
comparer: EqualityComparer<any>An optional equality comparer for custom string comparison.
true
if the string matches; otherwise, false
.
Experimental
Saves the current position in the source to the state stack.
A helper class for parsing strings into tokens. This class provides methods to consume or lookahead for specific pattern, with traceback support.