• Alan Zimmerman's avatar
    ApiAnnotations : RdrHsSyn.isFunLhs discards parentheses · 5bde9f7c
    Alan Zimmerman authored
    The RdrHsSyn.isFunLhs function has the following
      isFunLhs e = go e []
         go (L loc (HsVar f)) es
              | not (isRdrDataCon f)   = return (Just (L loc f, False, es))
         go (L _ (HsApp f e)) es       = go f (e:es)
         go (L _ (HsPar e))   es@(_:_) = go e es
    The treatment of HsPar means that any parentheses around an infix function will be discarded.
      (f =*= g) sa i = f (toF sa i) =^= g (toG sa i)
    will lose the ( before f and the closing one after g
    Test Plan: ./validate
    Reviewers: hvr, austin
    Reviewed By: austin
    Subscribers: bgamari, thomie
    Differential Revision: https://phabricator.haskell.org/D832
    GHC Trac Issues: #10269
Parser.y 162 KB