Ticket #3 (closed enhancement: fixed)

Opened 20 months ago

Last modified 6 months ago

Add derived Show instances to Language.C.Data

Reported by: ezyang Owned by: benedikt
Priority: minor Milestone: 0.4.1
Component: parser Version: 0.4.1-darcs
Keywords: Cc: ezyang@…

Description

It would be quite useful to have derived Show instances for Language.C.Data, so that there's an easy way to take a look at the AST that Language.C parses into.

Attachments

DumpAst.patch Download (73.5 KB) - added by benedikt 12 months ago.
Patch: Show instances for AST types

Change History

Changed 12 months ago by benedikt

Patch: Show instances for AST types

Changed 12 months ago by benedikt

  • priority changed from major to minor
  • status changed from new to assigned
  • version changed from 0.3.1.1 to 0.4.0.0-darcs

(from Alexander Bernauer)

Please find attached a patch whitch enables dumping the AST of a parsed
file.

Basically all data types from the Syntax module are now deriving Show.
Additionally, Data.NodeInfo? has a manually created instance of Show which
just outputs "_". If somebody want's to really show a NodeInfo? he/she
has to wrap it into the NodeInfoS type which has a proper Show
instanciation.

I hope doing it this way is acceptable. And I hope I didn't mess
anything up with darcs. This is my first project where I am using it.

Changed 6 months ago by benedikt

  • status changed from assigned to closed
  • version changed from 0.4.0.0-darcs to 0.4.1-darcs
  • resolution set to fixed
  • milestone changed from 0.4.0 to 0.4.1
Note: See TracTickets for help on using tickets.