[GHC] #8424: quasi-quotes have carriage returns on Windows

#8424: quasi-quotes have carriage returns on Windows ------------------------------------+------------------------------------- Reporter: GregWeber | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.6.3 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- A Windows user rerported using Data.Text.IO.writeFile to write out quasi- quoted text. writeFile automatically translates '\r' to "\r\n", so the user ended up writing out "\r\r\n" to a file. Haskell seems to be adopting the policy or removing '\r' from Haskell land. Is there any reason why quasi-quotes should not automatically strip carriage returns? I asked this question on ghc-users and there was no response. I am willing to make this fix if it is deemed appropriate. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8424 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8424: quasi-quotes have carriage returns on Windows -------------------------------------+------------------------------------ Reporter: GregWeber | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by rwbarton): This is talking about a source file like {{{ multilineString :: String multilineString = [q|foo bar baz|] }}} right? I'm surprised the '\r's don't get stripped out when GHC reads the source file, is it opening it in binary mode? Should it be? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8424#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8424: quasi-quotes have carriage returns on Windows -------------------------------------+------------------------------------ Reporter: GregWeber | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by GregWeber): yes, that is an equivalent example source file. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8424#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8424: quasi-quotes have carriage returns on Windows -------------------------------------+------------------------------------ Reporter: GregWeber | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by GregWeber): So it seems that the carriage returns are not wanted. I will work with the reporter to see if we can produce a patch. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8424#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8424: quasi-quotes have carriage returns on Windows -------------------------------------+------------------------------------- Reporter: GregWeber | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Template | Version: 7.6.3 Haskell | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: Windows | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thomie): * cc: gintas (added) * os: Unknown/Multiple => Windows Comment: While cleaning up [https://github.com/ghc/ghc/blob/64c9898f7b5239435f131f5444d62bda23dfc9ef/com... Lexer.x] a few months ago, I tried to change: {{{ $white_no_nl = $whitechar # \n }}} To: {{{ $white_no_nl = $whitechar # $nl }}} That didn't validate, and I didn't quite understand what was going on, so I left it at that. I did add a TODO, because I thought it might be related to this ticket. To whomever fixes this bug: please also remove that TODO, especially if that line turns out to be fine the way it is. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8424#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8424: quasi-quotes have carriage returns on Windows -------------------------------------+------------------------------------- Reporter: GregWeber | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.6.3 Resolution: | Keywords: Operating System: Windows | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11215 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * cc: gintas (removed) * related: => #11215 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8424#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8424: quasi-quotes have carriage returns on Windows -------------------------------------+------------------------------------- Reporter: GregWeber | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Template Haskell | Version: 7.6.3 Resolution: duplicate | Keywords: Operating System: Windows | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11215 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * status: new => closed * resolution: => duplicate Comment: refold says in #11215: Yes, #8424 seems to be the same issue. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8424#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC