Skip to content

v0.1.4

Compare
Choose a tag to compare
@sharnoff sharnoff released this 04 Mar 02:47
· 10 commits to master since this release
49e9a4d

Adds conditional parsing to struct fields - both through the existing #[peek] and #[peek_with] attributes, as well as the new #[parse_if] attribute. A new section in the README gives a brief example.

To briefly elaborate on the motivation here:

A pattern that tends to come up in complex Parse implementations is having optional fields. Most of these conditions boil down to either (1) peeking, or (2) some expression based on what's already been parsed. I've already found that I wanted to allow this behavior in my personal use, so it's now a feature!