Skip to content

How to unpack list parser to another list parser #76

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

You must be logged in to vote

This also includes the start and end tokens:

Parser<List<Token>> expression = (expressionStart & expressionBody & expressionEnd)
    .map((parts) => [parts[0], ...parts[1], parts[2]]);

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by renggli
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 #76 on December 08, 2020 19:55.