ast icon indicating copy to clipboard operation
ast copied to clipboard

Derive naming

Open CAD97 opened this issue 7 years ago • 0 comments

What should we call the derive?

The implemented plumbing trait is FromPest. That's not what this discussion is about.

This is about the derive naming, which is currently #[derive(FromPest)].

This is nice, because it says what it does on the tin: it derives FromPest for the type. But especially if we add a way to derive precedence climbing, it might make sense to split the derives into multiple.

Additionally, the current #[derive(FromPest)] is both in a separate crate from the trait FromPest (pest-ast and from-pest, respectively), as well as using #[pest_ast(..)] as its "attribute namespace" for additional information on the type and fields.

If PrecClimb gets its own derive (which I think could very well be beneficial both to internal code organization of the derive crate and the derive API), then I think the main derive should be renamed away from just the generic FromPest, as it doesn't cover all derive possibilities anymore.

CAD97 avatar Nov 10 '18 08:11 CAD97