-
-
Notifications
You must be signed in to change notification settings - Fork 203
Open
Labels
apiA problem with the design of an API featureA problem with the design of an API featureenhancementNew feature or requestNew feature or request
Description
Say we have the two parsers:
fn lexer() -> impl Parser<char, Vec<Token>, Error = Simple<char>>;fn token_parser() -> impl Parser<Token, Expr, Error = Simple<Token>>;
Feature request
A way to merge the two parsers as one.
let parser = token_parser().inputed_from(lexer());
parser.parse(src)Potential benefits
- Prevent the creation of
Vec<Token>which takes up a bit of heap memory, so that it makes inter-procedures zero-copy. parser.parse(src)seems cooler thanlet tokens = lexer.parse(src); token_parser.parse(tokens)in user code. By "users" I mean those who use the built parser(s).
My questions
- Is it possible to do this with current implementations?
- Is the idea makes sense to most use cases so that it worths being implemented?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
apiA problem with the design of an API featureA problem with the design of an API featureenhancementNew feature or requestNew feature or request