Fix startsVarSym and refactor operator predicates (fixes #4239)
authorMalo Jaffré <jaffre.malo@gmail.com>
Thu, 1 Sep 2016 18:13:47 +0000 (14:13 -0400)
committerBen Gamari <ben@smart-cactus.org>
Thu, 1 Sep 2016 19:05:16 +0000 (15:05 -0400)
commitf233f00b1915ac6c0a200b8017a9f07deefd401e
tree0dc9eaa34f6754564ef2869e67e3ce381ea766a8
parentb946cf3f5d6fd273a79b008472e8cb0ad1432be1
Fix startsVarSym and refactor operator predicates (fixes #4239)

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.

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2480

GHC Trac Issues: #4239
compiler/basicTypes/Lexeme.hs
libraries/ghc-boot-th/GHC/Lexeme.hs
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
testsuite/tests/rename/should_compile/T4239.hs
testsuite/tests/rename/should_compile/T4239.stdout
testsuite/tests/rename/should_compile/T4239A.hs