TakeWhile class

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

Parsing always succeeds.

Returns: A string consisting of the consumed characters.

Inheritance

Constructors

TakeWhile.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, String>
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<String>?
Parses the input and returns a result wrapped in Result if successful, null otherwise.
override
parseAsync(State<ChunkedData<StringReader>> state) AsyncResult<String>
Experimental. Not yet fully implemented
override
toString() String
A string representation of this object.
inherited

Operators

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