
#4931: hsc2hs emits invalid OPTIONS_GHC pragmas -------------------------------------+------------------------------------- Reporter: awson | Owner: Type: bug | Status: new Priority: low | Milestone: 7.12.1 Component: hsc2hs | Version: 7.0.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by peddie): I started to poke at this, following the second suggestion in comment:6. It's more complicated than I thought at first, because it ought to handle escaped strings (e.g. `#define FOO "bar \"baz\""`) and multiple command- line flags per line (though `hsc2hs` doesn't do this, the current code handles it). This is more than GHC has to do to parse `-D'"FOO BAR"'`, I think, because GHC gets handed `argv`. I have a patch that addresses the above cases, but it's ~22 lines in place of `words str`, and it's still ad-hoc parsing, so I hesitate to submit it. Can anyone suggest what I should shoot for here? Just address the immediate bug and punt on escaped strings etc.? More complicated ad-hoc parsing? Split as `argv` would be and pull in the command-line options parser? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/4931#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler