• Alan Zimmerman's avatar
    Add HsSyn prettyprinter tests · 499e4382
    Alan Zimmerman authored
    Add prettyprinter tests, which take a file, parse it, pretty print it,
    re-parse the pretty printed version and then compare the original and
    new ASTs (ignoring locations)
    Updates haddock submodule to match the AST changes.
    There are three issues outstanding
    1. Extra parens around a context are not reproduced. This will require an
       AST change and will be done in a separate patch.
    2. Currently if an `HsTickPragma` is found, this is not pretty-printed,
       to prevent noise in the output.
       I am not sure what the desired behaviour in this case is, so have left
       it as before. Test Ppr047 is marked as expected fail for this.
    3. Apart from in a context, the ParsedSource AST keeps all the parens from
       the original source.  Something is happening in the renamer to remove the
       parens around visible type application, causing T12530 to fail, as the
       dumped splice decl is after the renamer.
       This needs to be fixed by keeping the parens, but I do not know where ...
RnTypes.hs 69.3 KB