PEGTL icon indicating copy to clipboard operation
PEGTL copied to clipboard

Implementing peg2pegtl, based on abnf2pegtl.

Open redmercury opened this issue 1 year ago • 9 comments

This PR implements peg2pegtl based on abnf2pegtl. The input grammar is from the original PEG paper.

redmercury avatar Mar 16 '25 17:03 redmercury

I'm a little confused about the clang-tidy errors given that they're in files untouched by this PR. Any insights into that?

redmercury avatar Mar 16 '25 21:03 redmercury

I'm a little confused about the clang-tidy errors given that they're in files untouched by this PR. Any insights into that?

Sometimes this happens when the jobs switch to a newer version of clang-tidy, I'll look into this, and the rest of the PR as soon as I have some free time. Thanks for the initiative!

ColinH avatar Mar 23 '25 20:03 ColinH

Thanks. Ideally I would have added a test that recompiled peg2pegtl using the generated output from generating a grammar from peg.peg, but I'm not quite sure how to achieve that in cmake (it's been a while since I used it). I did verify manually that replacing the grammar from peg.hpp with generated output generated the same output though.

redmercury avatar Mar 28 '25 16:03 redmercury

This PR still appears to contain some Bazel related files?

ColinH avatar Apr 06 '25 13:04 ColinH

@redmercury Thank you for your PR. Please, keep focused only in the proposed feature, do not add a new build system that's not supported in the project already, please, revert the bazel changes and keep only cmake for now. There is a separate discussion about including bazel in project.

uilianries avatar Apr 07 '25 06:04 uilianries

Sorry about that, it wasn't my intention, just an oversight when experimenting. My apologies. should be good now.

redmercury avatar Apr 08 '25 02:04 redmercury

@redmercury Thank you!! I see the clang tidy is failing again. I'll take a look over the weekend or this week. Sorry about that!

uilianries avatar Apr 08 '25 07:04 uilianries

@ColinH Are you okay with this commit now I've removed those files?

redmercury avatar May 18 '25 02:05 redmercury

We're getting there. A couple of things could be improved in the grammar to bring it more in line with best practices. For example the Comment rule can be simplified using tao::pegtl::until<>, and the final case of Char could be simplified with not_one<>. Do you want to give it a go?

ColinH avatar May 18 '25 17:05 ColinH