Fix startsVarSym and refactor operator predicates (fixes #4239)
ClosedPublic

Authored by MaloJaffre on Aug 27 2016, 12:29 PM.

Details

Summary

startsVarSym used isSymbol which does not recognize valid operators
beginning with OtherPunctuation generalCategory (e. g. (·)).
Move it to ghc-boot-th for reducing duplication.

This patch fixes template-haskell pretty printer, which is used by
-ddump-minimal-imports.

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
MaloJaffre updated this revision to Diff 8491.Aug 27 2016, 12:29 PM
MaloJaffre retitled this revision from to Fix startsVarSym and refactor operator predicates (fixes #4239).
MaloJaffre updated this object.
MaloJaffre edited the test plan for this revision. (Show Details)
MaloJaffre updated the Trac tickets for this revision.
MaloJaffre updated this revision to Diff 8493.Aug 27 2016, 12:45 PM
MaloJaffre edited edge metadata.
MaloJaffre removed rGHC Glasgow Haskell Compiler as the repository for this revision.
thomie set the repository for this revision to rGHC Glasgow Haskell Compiler.Aug 28 2016, 5:42 PM
bgamari edited edge metadata.Aug 31 2016, 2:33 PM

Thanks @MaloJaffre.

libraries/template-haskell/Language/Haskell/TH/Ppr.hs
121

Thanks for killing this one. However, I am a bit concerned that this set doesn't match the set used by okSymChar. Have you verified that okSymChar is correct?

MaloJaffre marked an inline comment as done.Sep 1 2016, 8:15 AM
MaloJaffre added inline comments.
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
121

All these ASCII characters are also matched by okSymChar, so they are equivalent for ASCII input.

bgamari accepted this revision.Sep 1 2016, 10:12 AM
bgamari edited edge metadata.

Thanks @MaloJaffre!

libraries/template-haskell/Language/Haskell/TH/Ppr.hs
121

Alright, works for me.

This revision is now accepted and ready to land.Sep 1 2016, 10:12 AM
This revision was automatically updated to reflect the committed changes.

I'm very sorry @MaloJaffre, it looks like Phabricator gave me authorship over your patch. I've reverted and pushed a new commit with proper attribution.