Skip to content

Postfix trace #852

Description

@cactusdualcore

Please complete the following tasks

winnow version

0.7.14

Describe your use case

In many places I have somewhat long call chains on parsers wrapped in trace. The surrounding trace is somewhat unwieldy and gets in the way during reformatting.

Describe the solution you'd like

I would like to be able to call .trace("name") on a parser as an inherent method rather than a standalone function. This transformation would look like this:

/// old
trace("my_parser", my_parser.map(f).context(...));

/// new
my_parser.map(f).context(...).trace("my_parser");

Alternatives, if applicable

Use a custom extension trait or existing the standalone function

Additional Context

I think both forms have their places and should be supported. The postfix could just call the standalone function. Might overlap with #630 a bit.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Raise on the bar on expectations

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions