Lexical error in string continuation
harendra.kumar at gmail.com
Sat Jan 7 22:22:47 UTC 2017
I am making a change in runghc on the ghc master branch. When compiling the
following code (edited/new code in utils/runghc):
208 splitGhcNonGhcArgs :: [String] -> IO ([String], [String])
209 splitGhcNonGhcArgs args = do
210 let (ghc, other) = break notAFlag args
211 when (hasUnescapedGhcArgs ghc) $
212 hPutStrLn stderr "yy\
213 \ xx"
I get an error because of the string continuation at line 212. If I put the
backslashes on the same line I do not get any error. I have more string
continuations in the same file and they all work fine. This snippet works
fine with ghc-7.10.3/ghc-8.0.1 when compiled separately. Here is the error
message that I get:
lexical error in string/character literal at character 'x'
212 | hPutStrLn stderr "yy\
utils/runghc/ghc.mk:30: recipe for target
make: *** [utils/runghc/dist-install/build/Main.dyn_o] Error 1
Makefile:122: recipe for target 'all_utils/runghc' failed
make: *** [all_utils/runghc] Error 2
make: Leaving directory '/vol/hosts/cueball/workspace/play/ghc'
../../mk/sub-makefile.mk:50: recipe for target 'all' failed
make: *** [all] Error 2
Any help will be appreciated. I can send the modified file if anyone wants
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ghc-devs