[GHC] #11140: add command-line option to GHC to dump raw parse trees of Haskell programs

#11140: add command-line option to GHC to dump raw parse trees of Haskell programs -------------------------------------+------------------------------------- Reporter: bollu | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.10.2 Keywords: newcomer | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- As of now, GHC has no option to dump the parse tree of a given Haskell source file. `-ddump-parsed` only displays the pretty-printed AST structure, and cannot be used to inspect parse trees. An existing implementation of such a feature is present in apply- refact(https://github.com/mpickering/apply-refact) by invoking the tool as `refactor --debug`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11140 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11140: add command-line option to GHC to dump raw parse trees of Haskell programs -------------------------------------+------------------------------------- Reporter: bollu | Owner: Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * type: bug => feature request Comment: See the description of #11024 for example output. irc confo: * rwbarton > I think this is going to be kind of a messy continuum between representing all the data in the AST and producing output that's at all comprehensible to a human * mpickering > rwbarton: we have some code in ghc-exactprint which dumps the while AST and it has been very useful for us fwiw * mpickering > it's useful when you want to check what exact SrcSpan something has for example -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11140#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11140: add command-line option to GHC to dump raw parse trees of Haskell programs -------------------------------------+------------------------------------- Reporter: bollu | Owner: Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by alanz): * cc: alanz (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11140#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11140: add command-line option to GHC to dump raw parse trees of Haskell programs -------------------------------------+------------------------------------- Reporter: bollu | Owner: Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * keywords: newcomer => Comment: Why should this be a GHC feature? Why not use `apply-refact`? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11140#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11140: add command-line option to GHC to dump raw parse trees of Haskell programs -------------------------------------+------------------------------------- Reporter: bollu | Owner: Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): Because I think it would be useful when working on the parser to see the parse trees. It is often not obvious how the parser works, see for example the recent work I have been doing with export lists and there's another ticket about how `BooleanFormula` is parsed in a very strange way. Both would be easier to debug with this flag. There is already precedent for this, after all the other stages in the compiler pipeline there is an flag which dumps the correct compiler output (`-ddump-simple`, `-ddump-rn`, `-ddump-rn` etc) so why not for dumping parse trees as well? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11140#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11140: add command-line option to GHC to dump raw parse trees of Haskell programs -------------------------------------+------------------------------------- Reporter: bollu | Owner: Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rwbarton): None of those dump anything like "raw" format though (by this I assume you mean something like what the derived Show instance would produce if there was one). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11140#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11140: add command-line option to GHC to dump raw parse trees of Haskell programs -------------------------------------+------------------------------------- Reporter: bollu | Owner: Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): That is true but by them stages in the compilation pipeline you don't care about what the raw format looks like. When modifying the parser you need to know the precise structure of the AST rather than some pretty printed version produced by `Outputtable`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11140#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11140: add command-line option to GHC to dump raw parse trees of Haskell programs -------------------------------------+------------------------------------- Reporter: bollu | Owner: Type: feature request | Status: patch Priority: low | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2958 Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * status: new => patch * differential: => Phab:D2958 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11140#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11140: add command-line option to GHC to dump raw parse trees of Haskell programs -------------------------------------+------------------------------------- Reporter: bollu | Owner: alanz Type: feature request | Status: patch Priority: low | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2958 Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * owner: => alanz -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11140#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11140: add command-line option to GHC to dump raw parse trees of Haskell programs
-------------------------------------+-------------------------------------
Reporter: bollu | Owner: alanz
Type: feature request | Status: patch
Priority: low | Milestone:
Component: Compiler | Version: 7.10.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D2958
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Alan Zimmerman

#11140: add command-line option to GHC to dump raw parse trees of Haskell programs -------------------------------------+------------------------------------- Reporter: bollu | Owner: alanz Type: feature request | Status: closed Priority: low | Milestone: Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2958 Wiki Page: | -------------------------------------+------------------------------------- Changes (by alanz): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11140#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC