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
Replace cabal project parsing with Parsec #8889
base: master
Are you sure you want to change the base?
Conversation
@ulysses4ever as announced, here is an early PR of the changes. Still lots of work, but I have a rough outline of the ticket. I would be glad if you would take a look! |
64a2545
to
ed3b177
Compare
ed3b177
to
66a94a8
Compare
9ea3fc6
to
402f607
Compare
402f607
to
9016a3a
Compare
@grayjay I know you’re more of a solver person, but if you happen to have some time for advising and feel comfortable in this part of the code, your contribution would be priceless. |
@jgotoh there's a bi-weekly cabal devs meeting, where, I am sure, people would be delighted to hear your experience so far. The closest one is this Thursday (Apr 20th), 1 PM Eastern Time (US). The link to a Jitsi video call is posted before the meeting on #hackage at libera.chat (can be browsed using Element/Matrix or an IRC client). Are you interested? |
@ulysses4ever Thank you very much for you invitation! I've already wondered about the cabal devs main communication channel. I am definitely interested and will be glad to attend :) |
@jgotoh cool! let me know if you want me to mail you the jitsi link beforehand. |
I'm not familiar with this part of the code, but I tried to answer a couple questions based on my understanding of the parser behavior. |
dcc3a02
to
f493c4f
Compare
2f21c31
to
8a6f3fd
Compare
liftPR :: (a -> IO (ParseResult b)) -> ParseResult a -> IO (ParseResult b) | ||
liftPR f pr = unPR pr emptyPRState failure success | ||
where | ||
failure s = return $ PR $ \s' failure' _ -> failure' (concatPRState s s') | ||
success s a = do | ||
pr' <- f a | ||
return $ PR $ \s' failure' success' -> unPR pr' (concatPRState s s') failure' success' | ||
concatPRState (PRState warnings errors version) (PRState warnings' errors' version') = | ||
(PRState (warnings ++ warnings') (toList errors ++ errors') (version <|> version')) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gbaz I migrated this from Legacy.hs:281 to the new ParseResult. I think you implemented the old version in Legacy.hs? Could you help reviewing this new version? As far as I see it works, but it would be awesome if you would take a look.
f449135
to
a2e0241
Compare
Implements #6101
Please include the following checklist in your PR:
Please also shortly describe how you tested your change. Bonus points for added tests!
This is a really early version to gather some feedback and to check whether I am on the right track.
I created the rough module structure and a draft of the parser with still lots of holes.
My next steps will be the definition of the FieldGrammar and Lens for ProjectConfigs, afterwards I want to add lots of tests for it.
There are some open questions in the source code that I am really unsure of, I will create some comments after I have created the PR.