Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tzlaine opened this issue Mar 8, 2024 · 0 comments

Comments

@tzlaine
Copy link
Collaborator

tzlaine commented Mar 8, 2024

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.

tzlaine added a commit that referenced this issue Dec 9, 2024
…ions to

parsers, like turning off attribute generation (replacing omit_parser).
Change char_parser to support the use of parser_modifiers, and change lit() to
return a parameterized char_parser instead of char_parser wrapped in an
omit_parser.

See #160.
tzlaine added a commit that referenced this issue Dec 9, 2024
…ions to

parsers, like turning off attribute generation (replacing omit_parser).
Change char_parser to support the use of parser_modifiers, and change lit() to
return a parameterized char_parser instead of char_parser wrapped in an
omit_parser.

See #160.
tzlaine added a commit that referenced this issue Dec 9, 2024
…ions to

parsers, like turning off attribute generation (replacing omit_parser).
Change char_parser to support the use of parser_modifiers, and change lit() to
return a parameterized char_parser instead of char_parser wrapped in an
omit_parser.

See #160.
tzlaine added a commit that referenced this issue Dec 9, 2024
…ge lit()

to return a parameterized string_parser instead of string_parser wrapped in an
omit_parser.

See #160.
tzlaine added a commit that referenced this issue Dec 14, 2024
… the

parsers not already modified.  Generalize with_parser_mods().  Remove
omit_parser, since it is now moot.

See #160.
tzlaine added a commit that referenced this issue Dec 14, 2024
… the

parsers not already modified.  Generalize with_parser_mods().  Remove
omit_parser, since it is now moot.

See #160.
tzlaine added a commit that referenced this issue Dec 14, 2024
… the

parsers not already modified.  Generalize with_parser_mods().  Remove
omit_parser, since it is now moot.

See #160.
tzlaine added a commit that referenced this issue Dec 14, 2024
… the

parsers not already modified.  Generalize with_parser_mods().  Remove
omit_parser, since it is now moot.

See #160.
tzlaine added a commit that referenced this issue Dec 15, 2024
tzlaine added a commit that referenced this issue Dec 15, 2024
tzlaine added a commit that referenced this issue Dec 17, 2024
look-ahead/-behind positive or negative assertions.

When combining parsers using op>> and op>, if either side is an expect_parser
and the other side has an open pre_-/post_parser slot, take the subparser out
of the expect_parser, and use it directly in the pre_-/post_parser slot.

See #160.
tzlaine added a commit that referenced this issue Dec 17, 2024
…ions to

parsers, like turning off attribute generation (replacing omit_parser).
Change char_parser to support the use of parser_modifiers, and change lit() to
return a parameterized char_parser instead of char_parser wrapped in an
omit_parser.

See #160.
tzlaine added a commit that referenced this issue Dec 17, 2024
…ge lit()

to return a parameterized string_parser instead of string_parser wrapped in an
omit_parser.

See #160.
tzlaine added a commit that referenced this issue Dec 17, 2024
… the

parsers not already modified.  Generalize with_parser_mods().  Remove
omit_parser, since it is now moot.

See #160.
tzlaine added a commit that referenced this issue Dec 17, 2024
tzlaine added a commit that referenced this issue Dec 17, 2024
tzlaine added a commit that referenced this issue Dec 17, 2024
look-ahead/-behind positive or negative assertions.

When combining parsers using op>> and op>, if either side is an expect_parser
and the other side has an open pre_-/post_parser slot, take the subparser out
of the expect_parser, and use it directly in the pre_-/post_parser slot.

See #160.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant