-
Notifications
You must be signed in to change notification settings - Fork 698
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
Raw parse error for --allow-newer='' #7740
Comments
Empty list parsingI did a little tracing of I found two ways of explicitly supplying an empty list.
Outer enclosing quotes are fine but not inner quotes enclosing an empty list (and neither is empty list as
At this point the behaviour seems fine but perhaps we could update the docs with a note or warning? Non-empty list parsingAn example for the project is
I can convert that project list example to the command line by repeating the option for each list item.
An example for the command line shows a condensed list
The repeated option
The docs for the project say that "A bare
The parsing of
Should we add another case, cabal/cabal-install/src/Distribution/Client/Types/AllowNewer.hs Lines 82 to 85 in 00a2351
cabal/cabal-install/src/Distribution/Client/Types/AllowNewer.hs Lines 169 to 178 in 00a2351
|
With this change I could do what is asked (and more) but am not sure I should. relaxDepsParser :: CabalParsing m => m (Maybe RelaxDeps)
relaxDepsParser =
- (Just . RelaxDepsSome . toList) `fmap` P.sepByNonEmpty parsec (P.char ',')
+ (Just . RelaxDepsSome . const []) `fmap` (P.string "''" <|> P.string "\"\"" <|> P.string "[]")
+ <|>
+ (Just . RelaxDepsSome . toList) `fmap` P.sepBy parsec (P.string ", ")
+ <|>
+ (Just . RelaxDepsSome . toList) `fmap` P.sepBy parsec (P.char ',')
|
The tricky part is that
would do very different things. |
I agree this is confusing. If so, should we intercept |
Hello! Let's try to reach a consensus so that our skilled contributors can implement it. Is it fine to error out at |
Yes, sounds reasonable to me. |
Thank you. No objections since Jan, so the PR is really welcome, with the agreed design. I imagine this can't be too hard, given the analysis above. |
I looked into this a bit and got stuck: there doesn't seem to be a good way to tune the error message according to a parser error because of how
For the context,
So, the actual parsing is done in |
Posted #8140 for this, but it's not ideal, I feel. |
#8140 searches for the second reviewer, don't pass by! |
…er-parse Improve error message for empty --allow-newer= (fix #7740)
Describe the bug
Passing
--allow-newer=''
raises a raw parse error.To Reproduce
Expected behavior
I would expect this invokation to succeed (what's so wrong with an empty list of packages?) or at least fail with a non-internal error.
The text was updated successfully, but these errors were encountered: