Skip to content

Alternative to deprecated separatedBy(separator, includeSeparators: false) #161

Answered by renggli
asartalo asked this question in Q&A
Discussion options

You must be logged in to vote

The equivalent using plusSeparated() would be:

Parser footer() => ref0(footerLine)
     .plusSeparated(newLine)
     .map((list) => list.elements)     
     .plus();

The result of plusSeparated is a SeparatedList that contains the statically typed elements and separators (and some helpers). This is different to separatedBy() that had to return a single dynamically typed list.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by renggli
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #160 on November 20, 2023 14:22.