-
Notifications
You must be signed in to change notification settings - Fork 10
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
Integration of dhall #72
Conversation
…ble dhases (like in cassava)
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.
Great work @jneira! That was an intense refactor :)
component = P.munch1 (\c -> isAlphaNum c || c `elem` "_") | ||
parsec' = (:) <$> lead <*> rest | ||
lead = P.satisfy (\c -> isAlphaNum c || c == '_') | ||
rest = P.munch (\c -> isAlphaNum c || c == '_' || c == '-') |
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.
Do these changes change the parsing behavior or is it just a refactoring?
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.
Ok looks like a refactor.
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.
It is weird but testing with .cabal files gave me an error when indexing cassava with PARSEC option. It has an infamous flag with an internal double dash. Dont know why previous etlas version that has PARSEC enabled didnt throw the error
(See 1847005)
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.
This is a weird thing in that stack.yaml
in this repo turns on the parsec
flag, while the stack.yaml
in the main eta
repo doesn't. So the etlas
you use normally when doing ./cleaninstall.sh
doesn't use parsec.
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.
Ohhh, ok, however i think i've used etlas installed from its own repo and i dont remember having that error (cassava is always indexed?).. anyway afaik the new flag parser is more robust cause it will support previous and future flag formats
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.
Great work! :)
Nothing -> error $ "Couldn't read cabal file " | ||
++ show fileName | ||
parsed = if takeExtension fileName == ".dhall" | ||
then fmap Just $ PackageDesc.Parse.parseGenericPackageDescriptionFromDhall fileName |
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.
Does parsing dhall files always succeed?
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.
Nvm this is parsing from the index, so only valid dhall files will be parsed.
See #66 (comment)