forked from haskell/cabal
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parse: Fix parsing of ghc-options and similar. Fixes haskell#1346.
So far, ghc-options: -with-rtsopts="-A1000 -H1000 -K1000" was parsed and run as as 'ghc' ... '-with-rtsopts="-A1000' '-H1000' '-K1000"' which will fail. This is because we *tried* to parse quoted spaces (by leveraging reads to parse them as Haskell Strings), but only at the beginning of an option. This commit fixes it by allowing String literals also in the middle of options. Note that because of the fact that we are still using reads, ghc-options: -with-rtsopts='-A1000 -H1000 -K1000' (single quotes) will still fail. The example from above now parses and runs successfully as 'ghc' ... '-with-rtsopts="-A1000 -H1000 -K1000"' This change applies to: * ghc-options * cc-options * cpp-options * ld-options
- Loading branch information
Showing
2 changed files
with
45 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters