Satisfy class

Applies a predicate f to parsed character and consumes input if the predicate returns true.

Parsing succeeds if the character has been consumed.

Otherwise, parsing fails with the error ErrorUnexpectedCharacter.

Returns: Consumed character.

Inheritance

Constructors

Satisfy.new(Predicate<int> f, {String? name})
const

Properties

f Predicate<int>
final
getInputType Type
no setterinherited
getOutputType Type
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
name String?
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

backtrack(State<ChunkedData<StringReader>> state) bool
inherited
build(ParserBuilder<StringReader> builder) Parser<StringReader, int>
Builds a new parser using the specified builder.
override
fastParse(State<StringReader> state) bool
Parses the input and returns true if successful, false otherwise.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(State<StringReader> state) Result<int>?
Parses the input and returns a result wrapped in Result if successful, null otherwise.
override
parseAsync(State<ChunkedData<StringReader>> state) AsyncResult<int>
Experimental. Not yet fully implemented
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited