From: Simon Marlow Date: Fri, 6 Nov 2009 10:23:19 +0000 (+0000) Subject: Accept any non-space characters in a header file (#3624) X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=3035c581282adb24ae1f63c5bc970cfa5c2292ce;p=ghc-hetmet.git Accept any non-space characters in a header file (#3624) The FFI spec doesn't say exactly which characters may occur in a header file, so to be on the safe side we'll accept anything that isn't a space. --- diff --git a/compiler/parser/RdrHsSyn.lhs b/compiler/parser/RdrHsSyn.lhs index c785c22..5b7269a 100644 --- a/compiler/parser/RdrHsSyn.lhs +++ b/compiler/parser/RdrHsSyn.lhs @@ -1012,7 +1012,9 @@ parseCImport cconv safety nm str = mk = CImport cconv safety - hdr_char c = isAscii c && (isAlphaNum c || c `elem` "._-") + hdr_char c = not (isSpace c) -- header files are filenames, which can contain + -- pretty much any char (depending on the platform), + -- so just accept any non-space character id_char c = isAlphaNum c || c == '_' cimp nm = (ReadP.char '&' >> skipSpaces >> CLabel <$> cid)