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

pure and @safe grammars/rules? #303

Open
Dechcaudron opened this issue Jul 27, 2021 · 3 comments
Open

pure and @safe grammars/rules? #303

Dechcaudron opened this issue Jul 27, 2021 · 3 comments

Comments

@Dechcaudron
Copy link

Hi,

First of all thanks for the great library and for the good work that is still put into maintaining it. I would like to request an improvement, if possible.

Is there any chance grammar and rule functions can be made pure @safe? Conceptually I do not see any reason why they should not be, but there may be internal limitations I am not aware of.

Thanks in advance,
Héctor

@veelo
Copy link
Collaborator

veelo commented Jul 27, 2021

Hi Héctor,

I don't see a problem there either. @cbleser has done a lot of @safe work in #302, but I cannot merge that as it is failing tests. I am very much in favour of separating the @safe work out of that PR, as well as other refactorings, to keep things easy to review and not have progress stall because of unrelated problems. I am fine with combining @safe and pure in the same PR, though.

Even though it should be fairly straightforward, I am not sure when I would be able to add this myself. Feel free to have a go at it, I'll be happy to answer any questions regarding building Pegged. Beware that a number of files are generated, so make your edits at the right spot :-)

Cheers,
Bastiaan.

@Dechcaudron
Copy link
Author

Hi Bastiaan,

apologies for taking so long to reply. I'm currently working against the clock to meet some deadlines, so I will have to make due by calling unsafe-impure functions in debug conditional statements. I hope to be able to fix that in pegged once I finish what I have in my hands.

I would naïvely think the grammar template mixin is a good place to begin?

Regards,
Héctor

@veelo
Copy link
Collaborator

veelo commented Jul 30, 2021

I would naïvely think the grammar template mixin is a good place to begin?

I would naïvely think so too :-) Reuse from #302 where practical, and be sure to not change files that are generated (change the generator).

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

2 participants