[Git][ghc/ghc][wip/T18599] reduce imports; improve locs

Shayne Fletcher gitlab at gitlab.haskell.org
Sun Oct 11 14:54:57 UTC 2020



Shayne Fletcher pushed to branch wip/T18599 at Glasgow Haskell Compiler / GHC


Commits:
25dded33 by Shayne Fletcher at 2020-10-11T10:54:45-04:00
reduce imports; improve locs

- - - - -


2 changed files:

- compiler/GHC/Parser.y
- compiler/GHC/Parser/PostProcess.hs


Changes:

=====================================
compiler/GHC/Parser.y
=====================================
@@ -2625,7 +2625,11 @@ fexp    :: { ECP }
                   -- a projection 'r.a' (say) then we want the parse
                   -- '(r.a).b'.
                   ; return . ecpFromExp $ case $1 of
-                      L _ (HsApp _ f arg) | not $ isGetField f -> f `mkApp` mkGetField (comb2 arg $3) arg $3
+                      L _ (HsApp _ f arg)
+                        | not $ isGetField f ->
+                           let l = (comb2 arg $3) in
+                           L  (getLoc f `combineSrcSpans` l)
+                             (HsApp noExtField f (mkGetField l arg $3))
                       _ -> mkGetField (comb2 $1 $>) $1 $3
             }}
 


=====================================
compiler/GHC/Parser/PostProcess.hs
=====================================
@@ -19,7 +19,7 @@
 {-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
 
 module GHC.Parser.PostProcess (
-        mkApp, mkGetField, mkVar, mkFieldUpdater, mkProj, isGetField, applyFieldUpdates, Fbind(..), -- RecordDot
+        mkGetField, mkFieldUpdater, mkProj, isGetField, Fbind(..), -- RecordDot
         mkHsOpApp,
         mkHsIntegral, mkHsFractional, mkHsIsString,
         mkHsDo, mkSpliceDecl,



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/25dded331792c1a74a640c77017b1d46543e18ff

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/25dded331792c1a74a640c77017b1d46543e18ff
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201011/354b79d8/attachment-0001.html>


More information about the ghc-commits mailing list