castList<S> method

  1. @useResult
Parser<List<S>> castList<S>()

Returns a parser that casts itself to Parser<List<R>>. Assumes this parser to be of type Parser<List>.

For example, the parser digit().star().castList<String>() returns a list of strings.

Implementation

@useResult
Parser<List<S>> castList<S>() => CastListParser<R, S>(this);