Skip to content

Consider adding omit, prefix and suffix template parameters to all parsers #160

Open
@tzlaine

Description

@tzlaine

The new parameters would be something like:

bool Omit, typename Prefix, typename Suffix, ...

It turns out that the omit_parser::call() shows up pretty high in profiling of Parser. If each parser knew if it was wrapped in a notional omit[], omit[] could just take a parser, and return a copy with true for the template parameter Omit. This means that the actual function call to omit_parser::call() (and omit_parser itself) goes away.

No so sure the other two would be as big a win, but a lot of parsers are something like eps(cond) >> p (that's what if_(cond) expands to). If all those instances, and expect_parser itself, were just built in to every parser (with a nope when there's no prefix and/or sufffix condition(s)), that might similarly speed things up. expect_parser would just go away in that case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions